/[svn]/hopm/trunk/src/libopm/src/libopm.c
ViewVC logotype

Diff of /hopm/trunk/src/libopm/src/libopm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8204 by michael, Sat Apr 15 20:30:39 2017 UTC revision 8205 by michael, Sat Apr 15 21:53:48 2017 UTC
# Line 105  opm_create(void) Line 105  opm_create(void)
105  {  {
106    OPM_T *ret;    OPM_T *ret;
107    
108    ret = xcalloc(sizeof(*ret));    ret = libopm_calloc(sizeof(*ret));
109    ret->config = libopm_config_create();    ret->config = libopm_config_create();
110    ret->scans = libopm_list_create();    ret->scans = libopm_list_create();
111    ret->queue = libopm_list_create();    ret->queue = libopm_list_create();
112    ret->protocols = libopm_list_create();    ret->protocols = libopm_list_create();
113    
114    /* Setup callbacks */    /* Setup callbacks */
115    ret->callbacks = xcalloc(sizeof(OPM_CALLBACK_T) * CBLEN);    ret->callbacks = libopm_calloc(sizeof(OPM_CALLBACK_T) * CBLEN);
116    
117    return ret;    return ret;
118  }  }
# Line 134  opm_remote_create(const char *ip) Line 134  opm_remote_create(const char *ip)
134  {  {
135    OPM_REMOTE_T *ret;    OPM_REMOTE_T *ret;
136    
137    ret = xcalloc(sizeof(*ret));    ret = libopm_calloc(sizeof(*ret));
138    ret->ip = libopm_xstrdup(ip);    ret->ip = libopm_strdup(ip);
139    ret->protocols = libopm_list_create();  /* Setup protocol list */    ret->protocols = libopm_list_create();  /* Setup protocol list */
140    
141    return ret;    return ret;
# Line 157  opm_remote_free(OPM_REMOTE_T *remote) Line 157  opm_remote_free(OPM_REMOTE_T *remote)
157    OPM_NODE_T *p, *next;    OPM_NODE_T *p, *next;
158    OPM_PROTOCOL_CONFIG_T *ppc;    OPM_PROTOCOL_CONFIG_T *ppc;
159    
160    MyFree(remote->ip);    libopm_free(remote->ip);
161    
162    LIST_FOREACH_SAFE(p, next, remote->protocols->head)    LIST_FOREACH_SAFE(p, next, remote->protocols->head)
163    {    {
# Line 170  opm_remote_free(OPM_REMOTE_T *remote) Line 170  opm_remote_free(OPM_REMOTE_T *remote)
170    
171    libopm_list_free(remote->protocols);    libopm_list_free(remote->protocols);
172    
173    MyFree(remote);    libopm_free(remote);
174  }  }
175    
176  /* opm_callback  /* opm_callback
# Line 245  opm_free(OPM_T *scanner) Line 245  opm_free(OPM_T *scanner)
245    libopm_list_free(scanner->scans);    libopm_list_free(scanner->scans);
246    libopm_list_free(scanner->queue);    libopm_list_free(scanner->queue);
247    
248    MyFree(scanner->callbacks);    libopm_free(scanner->callbacks);
249    MyFree(scanner);    libopm_free(scanner);
250  }  }
251    
252  /* opm_config  /* opm_config
# Line 364  libopm_protocol_config_create(void) Line 364  libopm_protocol_config_create(void)
364  {  {
365    OPM_PROTOCOL_CONFIG_T *ret;    OPM_PROTOCOL_CONFIG_T *ret;
366    
367    ret = xcalloc(sizeof(*ret));    ret = libopm_calloc(sizeof(*ret));
368    
369    return ret;    return ret;
370  }  }
# Line 382  libopm_protocol_config_create(void) Line 382  libopm_protocol_config_create(void)
382  static void  static void
383  libopm_protocol_config_free(OPM_PROTOCOL_CONFIG_T *protocol)  libopm_protocol_config_free(OPM_PROTOCOL_CONFIG_T *protocol)
384  {  {
385    MyFree(protocol);    libopm_free(protocol);
386  }  }
387    
388  /* opm_scan  /* opm_scan
# Line 570  libopm_scan_create(OPM_T *scanner, OPM_R Line 570  libopm_scan_create(OPM_T *scanner, OPM_R
570    }    }
571  #endif  #endif
572    
573    ret = xcalloc(sizeof(*ret));    ret = libopm_calloc(sizeof(*ret));
574    ret->remote = remote;    ret->remote = remote;
575    ret->connections = libopm_list_create();    ret->connections = libopm_list_create();
576    
# Line 642  libopm_scan_free(OPM_SCAN_T *scan) Line 642  libopm_scan_free(OPM_SCAN_T *scan)
642    
643    libopm_list_free(scan->connections);    libopm_list_free(scan->connections);
644    
645    MyFree(scan);    libopm_free(scan);
646  }  }
647    
648  /* connection_create  /* connection_create
# Line 660  libopm_connection_create(void) Line 660  libopm_connection_create(void)
660  {  {
661    OPM_CONNECTION_T *ret;    OPM_CONNECTION_T *ret;
662    
663    ret = xcalloc(sizeof(*ret));    ret = libopm_calloc(sizeof(*ret));
664    ret->state = OPM_STATE_UNESTABLISHED;    ret->state = OPM_STATE_UNESTABLISHED;
665    
666    return ret;    return ret;
# Line 679  libopm_connection_create(void) Line 679  libopm_connection_create(void)
679  static void  static void
680  libopm_connection_free(OPM_CONNECTION_T *conn)  libopm_connection_free(OPM_CONNECTION_T *conn)
681  {  {
682    MyFree(conn);    libopm_free(conn);
683  }  }
684    
685  /* opm_cycle  /* opm_cycle
# Line 975  libopm_check_poll(OPM_T *scanner) Line 975  libopm_check_poll(OPM_T *scanner)
975    /* Grow pollfd array (ufds) as needed */    /* Grow pollfd array (ufds) as needed */
976    if (ufds_size < (*(unsigned int *)libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT)))    if (ufds_size < (*(unsigned int *)libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT)))
977    {    {
978      MyFree(ufds);      libopm_free(ufds);
979    
980      ufds = xcalloc((sizeof *ufds) * (*(unsigned int *)libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT)));      ufds = libopm_calloc((sizeof *ufds) * (*(unsigned int *)libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT)));
981      ufds_size = (*(unsigned int *)libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT));      ufds_size = (*(unsigned int *)libopm_config(scanner->config, OPM_CONFIG_FD_LIMIT));
982    }    }
983    

Legend:
Removed from v.8204  
changed lines
  Added in v.8205

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28