]> jfr.im git - irc/ircd-hybrid/libopm.git/commitdiff
Removed remote struct callbacks, now only scanner-wide callbacks are
authorstrtok <redacted>
Sun, 27 Oct 2002 19:20:18 +0000 (19:20 +0000)
committerstrtok <redacted>
Sun, 27 Oct 2002 19:20:18 +0000 (19:20 +0000)
used.

doc/libopm-api.txt
src/libopm.c
src/opm.h

index b3dd45eb43eb7b1f6de810da5d3e59f4e30d073d..d61fa5b9b542600de61b39712a207a6d9c10d6d9 100644 (file)
@@ -237,7 +237,6 @@ OPM_ERR_T opm_scan(OPM_T *, OPM_REMOTE_T *)
 
 
 OPM_ERR_T opm_callback(OPM_T *, int, OPM_CALLBACK_T)
-          opm_remote_callback(OPM_T *, int, OPM_CALLBACK_T)
 
    Parameters: OPM_T: Scanner to set callbacks on
                int: Callback type
index 4bd6a0f6da0959be96606daf893f69cb893f6b33..6a5e276b37f3e9058c3fdd8f1ea4e94146463031 100644 (file)
@@ -159,15 +159,6 @@ OPM_REMOTE_T *opm_remote_create(char *ip)
 
    ret->ip = (char*) strdup(ip);  /* replace with custom strdup function */
  
-   /* Setup callbacks */
-   ret->callbacks = MyMalloc(sizeof(OPM_CALLBACK_T) * CBLEN);
-
-   for(i = 0; i < CBLEN; i++)
-   {
-      ret->callbacks[i].func = NULL;
-      ret->callbacks[i].data = NULL;
-   }
-
    ret->port          = 0;
    ret->protocol      = 0;
    ret->bytes_read    = 0;
@@ -191,8 +182,6 @@ OPM_REMOTE_T *opm_remote_create(char *ip)
 void opm_remote_free(OPM_REMOTE_T *remote)
 {
 
-   MyFree(remote->callbacks);
-
    if(remote->ip)
       MyFree(remote->ip);
 
@@ -202,31 +191,6 @@ void opm_remote_free(OPM_REMOTE_T *remote)
 
 
 
-/* opm_remote_callback
- *
- * Register remote level callback 
- *
- * Parameters:
- *    remote: remote struct 
- *    type:   callback type
- * Return:
- *    Error code
- */
-
-OPM_ERR_T opm_remote_callback(OPM_REMOTE_T *remote, int type, OPM_CALLBACK_FUNC *function,
-      void *data)
-{
-   if(type < 0 || type >= (CBLEN + 1))
-      return OPM_ERR_CBNOTFOUND;
-
-   remote->callbacks[type].func = function;
-   remote->callbacks[type].data = data;
-
-   return OPM_SUCCESS;
-}
-
-
-
 /* opm_callback
  *    Register scanner level callback
  *
@@ -1248,8 +1212,6 @@ static void libopm_do_callback(OPM_T *scanner, OPM_REMOTE_T *remote, int type, i
 
    if(scanner->callbacks[type].func)
       (scanner->callbacks[type].func) (scanner, remote, var, scanner->callbacks[type].data);
-   if(remote->callbacks[type].func)
-      (remote->callbacks[type].func)  (scanner, remote, var, remote->callbacks[type].data);
 }
 
 
index 8507a5df671aac0e4804ed4ad0852f9409a13b54..78673801bd6c4e33960603a8049282a944cdd78d 100644 (file)
--- a/src/opm.h
+++ b/src/opm.h
@@ -46,7 +46,6 @@ struct _OPM_REMOTE {
    unsigned short int   protocol;        /* Protocol passed back on certain callbacks   */
    unsigned short int   bytes_read;      /* Bytes read passed back on certain callbacks */
 
-   OPM_CALLBACK_T     *callbacks;       /* Callback configuration                      */
 };
 
 OPM_T *opm_create();
@@ -61,7 +60,6 @@ OPM_ERR_T opm_scan(OPM_T *, OPM_REMOTE_T *);
 OPM_ERR_T opm_addtype(OPM_T *, int, unsigned short int);
 OPM_ERR_T opm_addcustom(OPM_T *, char *, char *, unsigned short int);
 
-OPM_ERR_T opm_remote_callback(OPM_REMOTE_T *, int, OPM_CALLBACK_FUNC *, void *);
 OPM_ERR_T opm_callback(OPM_T *, int, OPM_CALLBACK_FUNC *, void *);
 
 void opm_cycle(OPM_T *);