Changeset 5451:db1e0b38bfb0 in roaraudio


Ignore:
Timestamp:
03/25/12 04:08:52 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

ported to new proto stuff, moved init() so it is only run when unload will also be run.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/roard/protocol-irc.c

    r5434 r5451  
    8888}; 
    8989 
    90 static void init(void) { 
    91  struct roar_event event; 
    92  
    93  memset(&event, 0, sizeof(event)); 
    94  
    95  event.event = ROAR_OE_BASICS_DELETE; 
    96  
    97  event.emitter = -1; 
    98  event.target = -1; 
    99  event.target_type = ROAR_OT_CLIENT; 
    100  
    101  memset(g_channels, 0, sizeof(g_channels)); 
    102  
    103  subscription_client_delete = roar_notify_core_subscribe(NULL, &event, cb_client_delete, NULL); 
    104 } 
    105  
    10690static int is_valid_name (const char * name) { 
    10791 register char c; 
     
    855839 
    856840// plugin handling suff: 
     841static int init(struct roar_dl_librarypara * para, struct roar_dl_libraryinst * lib) { 
     842 struct roar_event event; 
     843 
     844 (void)para, (void)lib; 
     845 
     846 memset(&event, 0, sizeof(event)); 
     847 
     848 event.event = ROAR_OE_BASICS_DELETE; 
     849 
     850 event.emitter = -1; 
     851 event.target = -1; 
     852 event.target_type = ROAR_OT_CLIENT; 
     853 
     854 memset(g_channels, 0, sizeof(g_channels)); 
     855 
     856 subscription_client_delete = roar_notify_core_subscribe(NULL, &event, cb_client_delete, NULL); 
     857 
     858 return 0; 
     859} 
    857860 
    858861static int unload(struct roar_dl_librarypara * para, struct roar_dl_libraryinst * lib) { 
     
    865868 
    866869static struct roard_proto proto[1] = { 
    867  {ROAR_PROTO_IRC, ROAR_SUBSYS_NONE, "Internet Relay Chat", NULL, new_client, check_client, NULL, NULL} 
     870 {ROAR_PROTO_IRC, ROAR_SUBSYS_NONE, "Internet Relay Chat", NULL, new_client, NULL, check_client, NULL, NULL} 
    868871}; 
    869872 
     
    879882 ROAR_DL_PLUGIN_META_DESC("Implementation of the Internet Relay Chat (IRC)"); 
    880883 
     884 ROAR_DL_PLUGIN_REG(ROAR_DL_FN_INIT, init); 
    881885 ROAR_DL_PLUGIN_REG_UNLOAD(unload); 
    882886 ROARD_DL_REGFN_PROTO(); 
    883  init(); 
    884887} ROAR_DL_PLUGIN_END 
    885888 
Note: See TracChangeset for help on using the changeset viewer.