Changeset 806 for trunk


Ignore:
Timestamp:
06/01/07 11:09:07 (5 years ago)
Author:
wd
Message:

Wow, a fully building ircd mode (so far). Some changes:

  • Updated LOTS of copyright notices.
  • Completed the split of channel and user modes
  • That core 'addon' is completely gone
  • Using hard/soft/post dependencies in what seems to me to be a good way.
Location:
trunk/ithildin
Files:
3 deleted
104 edited
16 moved

Legend:

Unmodified
Added
Removed
  • trunk/ithildin/build/tests.py

    r790 r806  
    105105    # If it is given or if the above didn't work, then try walking the list 
    106106    # of prefixes to see if the requisite files are there 
    107     if path == openssl_prefixes: 
     107    if path == openssl_prefixes or path == [True]: 
    108108        if ctx.TryLink(extension = '.c', text = testcode): 
    109109            # got it, okay 
  • trunk/ithildin/doc/module.txt

    r490 r806  
    1010############################################################################### 
    1111 
    12 Basic information for setting up a module: 
    13 In the module's main file you need two global variables of name 'mheader' 
    14 and 'mdepends'.  Additionally you may have functions to be called at load 
    15 time and at unload time. 
    16  
    17 You will need to include 'ithildin.h' in your module, then do the following: 
    18  
    19 MODULE_REGISTER("your module version", "your load function", 
    20 "your unload function); 
    21  
    22 the first value is optional and specifies the version of your module.  if it 
    23 is empty it should be the empty string "" 
    24 the second and third values are also optional, and specify the symbol names 
    25 of functions to call when the module is loaded and unloaded.  They may be 
    26 empty if no such functions exist.  You must *NOT* use init() and fini() for 
    27 this! 
    28  
    29 Following that, if your module has any dependencies, you should place them 
    30 in a comment that looks like this: 
    31 /* 
    32 @DEPENDENCIES@: module1 module2 module3 ... 
    33 */ 
    34 Several lines of that form are acceptable. 
    35  
    36 If you need to find a module symbol, you can either use 'module_symbol(mod, 
    37 name)' if you have the module's structure, or 'lookup_module_symbol(modname, 
    38 symname)' if you don't have it. 
    39  
    40 The initialization function should return an integer value of non-zero if 
    41 loading was successful, otherwise a value of 0 indicating that the module 
    42 was NOT successful loading (the module will be closed and dropped in this 
    43 case, and the unloader *WILL NOT* be called) 
     12Holy crap out of date.  Check out the echo or ircd modules for 
     13simple/complex examples.  I owe docs on this. 
  • trunk/ithildin/doc/style.txt

    r578 r806  
    33# style.txt: guide to recommended programming style/practices 
    44# 
    5 # Copyright 2002 the Ithildin Project. 
     5# Copyright 2002-2007 the Ithildin Project. 
    66# See the COPYING file for more information on licensing and use. 
    77# 
     
    3131 * here), but should be properly spaced on the left and aligned. */ 
    3232 
    33 /* All files have 4-space logical tab stops.  Two tab-stops should be replaced 
    34  * with a single <tab>, not eight spaces.  Text wraps at column 79 in all 
    35  * files.  Long lines should be extended using the \<newline> mechanism. */ 
     33/* All files have 4-space logical tab stops.  There are no <tab> characters in 
     34 * files.  Two logical tabs is eight spaces, not a <tab>.  Text wraps at 
     35 * column 79 in all files.  Long lines should be extended using the \<newline> 
     36 * mechanism. */ 
    3637 
    3738/* Each C file (including headers) should contain the above notice with the 
     
    4142 * file.name: brief summary of the purpose of the file 
    4243 * 
    43  * Copyright 2002 the Ithildin Project. 
     44 * Copyright 2002-2007 the Ithildin Project. 
    4445 * See the COPYING file for more information on licensing and use. 
    4546 * 
     
    5960  
    6061/* include statements should go as follows: any necessary system-wide files 
    61  * should be included first, followed by "stand.h", followed by any other 
    62  * necessary local includes.  The 'stand.h' include should be directly below 
    63  * the system includes (if they are used), and a blank line should be added 
    64  * before any necessary 'local' includes as demonstrated below: */ 
     62 * should be included first, followed by "ithildin.h", followed by any 
     63 * other necessary local includes.  The 'ithildin.h' include should be 
     64 * directly below the system includes (if they are used), and a blank 
     65 * line should be added before any necessary 'local' includes as 
     66 * demonstrated below: */ 
    6567 
    6668#include <system/header.h> 
    6769#include <ithildin/stand.h> 
    6870 
     71#include <module-header.h> 
     72 
    6973/* be sure to include an id in your file so it can be identified later. */ 
    7074IDSTRING(rcsid, "$Id$"); 
    7175 
    72 #include <module-header.h> 
    7376 
    7477/* function and structure declarations are placed below include (and other pre 
     
    8083 * should not, in most cases, be typedef'd.  examples follow: */ 
    8184 
    82 /* Comments about the use of 'foo', and it's general purpose, go here. 
    83  * additionally, types should be separated from variable names by up to two 
    84  * tabstops.  Comments about structure's member variables' functions should be 
    85  * aligned whenever possible. */ 
     85/* Comments about the use of 'foo', and its general purpose, go here. 
     86 * Comments about structure's member variables' functions should be 
     87 * aligned whenever possible after the 28th column (or later as need 
     88 * dictates) */ 
    8689struct foo { 
    87     int            bar;        /* brief description of variable */ 
    88     struct  baz abaz;        /* a baz structure */ 
    89     longtypename avar;        /* another variable. 
     90    int bar;                /* brief description of variable */ 
     91    struct baz abaz;        /* a baz structure */ 
     92    longtypename avar;      /* another variable. */ 
    9093 
    91     LIST_ENTRY(foo) lp; /* a list entry.  lists should be rolled with the 
    92                            macros in queue.h unless there is a pressing reason 
    93                            not to do so. */ 
     94    LIST_ENTRY(foo) lp;     /* a list entry.  lists should be rolled with the 
     95                               macros in queue.h unless there is a pressing 
     96                               reason not to do so. */ 
    9497}; 
    9598 
     
    120123 
    121124/* If other questions remain, and the style is not evident from existing code, 
    122  * please see the style(9) manual page on your nearest FreeBSD system *. 
     125 * please see the style(9) manual page on your nearest FreeBSD system */ 
    123126 
  • trunk/ithildin/include/ithildin/hash.h

    r787 r806  
    6262int hash_delete(hashtable_t *, void *); 
    6363void *hash_find(hashtable_t *, void *); 
     64#define hash_change_cmpfunc(table, func) ((table)->cmpfunc = func) 
    6465#endif 
    6566/* vi:set ts=8 sts=4 sw=4 tw=76 et: */ 
  • trunk/ithildin/lib/module.c

    r798 r806  
    324324        free(msdp->name); 
    325325        free(msdp); 
     326    } 
     327 
     328    /* load "post" dependencies here. A "post" dependency is a module which 
     329     * we should load after initializing the current module.  These are 
     330     * mostly identicaly to soft dependencies (load failures don't hurt us) 
     331     * and are just done at a different time. */ 
     332    if ((deplist = (char **)dlsym(m->handle, "mpostdepends")) != NULL) { 
     333        if (!load_module_deps(m, deplist, flags, false)) 
     334            log_warn("some soft dependencies for %s failed to load, " 
     335                     "continuing anyway.", m->name); 
    326336    } 
    327337 
  • trunk/ithildin/modules/ircd/addons/acl.c

    r804 r806  
    22 * acl.c: ircd ACL addon code 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
     
    1717 
    1818MODULE_REGISTER("$Rev$"); 
    19 const char **mdepends = [ 
    20     "ircd", 
    21     NULL 
    22 ] 
     19const char *mdepends[] = MDEPENDS; 
    2320 
    2421struct acl_module_data acl; 
     
    312309    if (ret < 1 || ret > 3) 
    313310        return 0; 
    314     else if (!strncasecmp(s, "connected", 4)) 
     311    else if (!strncasecmp(str, "connected", 4)) 
    315312        return ACL_STAGE_CONNECTED; 
    316     else if (!strncasecmp(s, "unregistered", 5)) 
     313    else if (!strncasecmp(str, "unregistered", 5)) 
    317314        return ACL_STAGE_UNREGISTERED; 
    318     else if (!strncasecmp(s, "registered", 3)) 
     315    else if (!strncasecmp(str, "registered", 3)) 
    319316        return ACL_STAGE_REGISTERED; 
    320317 
     
    361358    } 
    362359 
     360    /* PORTBREAK: need to support skipping dns/ident checks 
    363361    if (ap != NULL) { 
    364362        if (ap->flags & ACL_FL_SKIP_DNS) 
     
    367365            cp->flags |= IRCD_CONNFL_IDENT; 
    368366    } 
     367    */ 
    369368 
    370369    return NULL; /* default to accept */ 
     
    783782    LIST_ALLOC(acl.list); 
    784783    LIST_ALLOC(acl.connected_list); 
    785     LIST_ALLOC(acl.unregisted_list); 
     784    LIST_ALLOC(acl.unregistered_list); 
    786785    LIST_ALLOC(acl.registered_list); 
    787786 
     
    790789 
    791790    /* add hooks for stage checks */ 
    792     add_hook(ircd.events.connection_connected, acl_connected_hook); 
    793     add_hook(ircd.events.connection_unregistered, acl_unregistered_hook); 
    794     add_hook(ircd.events.connection_registered, acl_registered_hook); 
     791    add_hook(ircd.events.connection_connected, acl_connected_stage_hook); 
     792    add_hook(ircd.events.connection_unregistered, acl_unregistered_stage_hook); 
     793    add_hook(ircd.events.connection_registered, acl_registered_stage_hook); 
    795794    add_hook(me.events.read_conf, acl_conf_hook); 
    796795 
     
    810809    remove_xinfo_handler(xinfo_acl_handler); 
    811810 
    812     remove_hook(ircd.events.connection_connected, acl_connected_hook); 
    813     remove_hook(ircd.events.connection_unregistered, acl_unregistered_hook); 
    814     remove_hook(ircd.events.connection_registered, acl_registered_hook); 
     811    remove_hook(ircd.events.connection_connected, acl_connected_stage_hook); 
     812    remove_hook(ircd.events.connection_unregistered, 
     813            acl_unregistered_stage_hook); 
     814    remove_hook(ircd.events.connection_registered, acl_registered_stage_hook); 
    815815    remove_hook(me.events.read_conf, acl_conf_hook); 
    816816} 
  • trunk/ithildin/modules/ircd/addons/acl.h

    r801 r806  
    22 * acl.h: functions to allow adding/removing/checking ACLs 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/addons/antidrone.c

    r804 r806  
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
     
    1616 
    1717MODULE_REGISTER("$Rev$"); 
    18  
    19 const char **mdepends = [ 
    20     "ircd", 
    21     NULL 
    22 ] 
     18const char *mdepends[] = MDEPENDS; 
    2319 
    2420static bool anti_bear = false; 
  • trunk/ithildin/modules/ircd/addons/hostcrypt.c

    r804 r806  
    22 * hostcrypt.c: usermode based hostname encryption 
    33 *  
    4  * Copyright 2003 the Ithildin Project. 
     4 * Copyright 2003-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    1818 */ 
    1919 
    20 #include <ithildin/stand.h> 
     20#include <ithildin/ithildin.h> 
    2121 
    2222#include "ircd.h" 
     
    2525 
    2626MODULE_REGISTER("$Rev$"); 
    27 const char **mdepends = [ 
    28     "ircd", 
    29     "ircd.protocol.rfc1450", 
    30     NULL 
    31 ] 
     27const char *mdepends[] = MDEPENDS; 
    3228 
    3329typedef char *(*hostcrypt_func_t)(client_t *); 
     
    7066    if (!get_module_savedata(savelist, "hostcrypt", &hostcrypt)) { 
    7167        hostcrypt.mdext = create_mdext_item(ircd.mdext.client, HOSTLEN + 1); 
    72         EXPORT_SYM(hostcrypt_usermode_handler); 
    7368        usermode_request('x', &hostcrypt.mode, USERMODE_FL_GLOBAL, -1, 
    74                 "hostcrypt_usermode_handler"); 
     69                hostcrypt_usermode_handler); 
    7570        hostcrypt.see_priv = create_privilege("see-decrypted-host", 
    7671                PRIVILEGE_FL_BOOL, &i64, NULL); 
    77     } else 
     72    } else { 
     73        usermode_update_func(hostcrypt.mode, hostcrypt_usermode_handler); 
    7874        recrypt = true; 
     75    } 
     76 
    7977    hostcrypt.crypter = NULL; 
    8078 
  • trunk/ithildin/modules/ircd/addons/hostmask.c

    r804 r806  
    22 * hostmask.c: configuration based user-hostmasking 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
     
    1616 
    1717MODULE_REGISTER("$Rev$"); 
    18 const char **mdepends = [ 
    19     "ircd", 
    20     NULL 
    21 ] 
     18const char *mdepends[] = MDEPENDS; 
    2219 
    2320#define CGI_IRC_SPECIAL_MASK "cgi:irc" 
  • trunk/ithildin/modules/ircd/addons/quarantine.c

    r804 r806  
    22 * quarantine.c: channel/nickname quarantining 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
     
    1717 
    1818MODULE_REGISTER("$Rev$"); 
    19 const char **mdepends = [ 
    20     "ircd", 
    21     NULL 
    22 ] 
     19const char *mdepends[] = MDEPENDS; 
    2320 
    2421struct quarantine_module_data quarantine; 
  • trunk/ithildin/modules/ircd/addons/quarantine.h

    r579 r806  
    22 * quarantine.h: functions to allow for adding/removing quarantines. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/addons/servicesid.c

    r804 r806  
    22 * servicesid.c: An ID number tagging facility used by various services 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
     
    1717 
    1818MODULE_REGISTER("$Rev$"); 
    19 const char **mdepends = [ 
    20     "ircd", 
    21     NULL 
    22 ] 
     19const char *mdepends[] = MDEPENDS; 
    2320 
    2421struct mdext_item *servicesid_mdext; 
  • trunk/ithildin/modules/ircd/addons/servicesid.h

    r577 r806  
    22 * servicesid.h: client servicesid tracker (actually just data-holder) 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/addons/throttle.c

    r804 r806  
    22 * throttle.c: connection throttling. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    1111 */ 
    1212 
    13 #include <ithildin/stand.h> 
     13#include <ithildin/ithildin.h> 
    1414 
    1515#include "ircd.h" 
     
    1919 
    2020MODULE_REGISTER("$Rev$"); 
    21 const char **mdepends = [ 
    22     "ircd", 
    23     "ircd.addon.acl", 
    24     NULL 
    25 ] 
     21const char *mdepends[] = MDEPENDS; 
    2622 
    2723static const char *throttle_acl_type = "throttle"; 
     
    6258static void destroy_throttle(throttle_t *); 
    6359 
    64 HOOK_FUNCTION(throttle_connected_hook); 
     60HOOK_FUNCTION(throttle_connected_stage_hook); 
    6561HOOK_FUNCTION(throttle_conf_hook); 
    6662HOOK_FUNCTION(throttle_timer_hook); 
     
    107103#define THROTTLE_ERRMSG                                                        \ 
    108104    "Your host is trying to (re)connect too fast -- throttled." 
    109 HOOK_FUNCTION(throttle_connected_hook) { 
     105HOOK_FUNCTION(throttle_connected_stage_hook) { 
    110106    connection_t *cp = (connection_t *)data; 
    111107    throttle_t *tp = find_throttle(isock_raddr(cp->sock)); 
  • trunk/ithildin/modules/ircd/chanmodes/filter.c

    r804 r806  
    11/* 
    2  * cmode_filter.c: control-character filter mode 
     2 * filter.c: control-character filter mode 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
    14 #include "addons/core.h" 
    1514 
    1615IDSTRING(rcsid, "$Id$"); 
    1716 
    1817MODULE_REGISTER("$Rev$"); 
    19  
    20 const char **mdepends = [ 
    21     "ircd", 
    22     NULL 
    23 ] 
     18const char *mdepends[] = MDEPENDS; 
    2419 
    2520static unsigned char chanmode_filter; 
     
    2924HOOK_FUNCTION(filter_conf_hook); 
    3025 
    31 MODULE_LOADER(cmode_filter) { 
     26MODULE_LOADER(filter) { 
    3227 
    3328    if (!get_module_savedata(savelist, "chanmode_filter", &chanmode_filter)) 
    3429        chanmode_request('c', &chanmode_filter, CHANMODE_FL_D, 
    35                 "chanmode_flag", "chanmode_flag_query", 0, NULL); 
     30                chanmode_flag, chanmode_flag_query, 0, NULL); 
     31    else 
     32        chanmode_update_funcs(chanmode_filter, chanmode_flag, 
     33                chanmode_flag_query); 
    3634 
    3735    add_hook_before(ircd.events.can_send_channel, can_send_filter, NULL); 
     
    4947} 
    5048 
    51 MODULE_UNLOADER(cmode_filter) { 
     49MODULE_UNLOADER(filter) { 
    5250     
    5351    if (reload) 
     
    6361} 
    6462 
    65 #define ANSI_CHAR        '\033' 
    66 #define BLINK_CHAR        '\006' 
    67 #define BOLD_CHAR        '\002' 
    68 #define COLOR_CHAR        '\003' 
    69 #define INVERSE_CHAR        '\026' 
    70 #define UNDERLINE_CHAR        '\037' 
     63#define ANSI_CHAR       '\033' 
     64#define BLINK_CHAR      '\006' 
     65#define BOLD_CHAR       '\002' 
     66#define COLOR_CHAR      '\003' 
     67#define INVERSE_CHAR    '\026' 
     68#define UNDERLINE_CHAR  '\037' 
    7169 
    7270HOOK_FUNCTION(filter_conf_hook) { 
  • trunk/ithildin/modules/ircd/chanmodes/operonly.c

    r804 r806  
    11/* 
    2  * cmode_operonly.c: Operator-only access limiter for channels. 
     2 * operonly.c: Operator-only access limiter for channels. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    88 */ 
    99 
    10 #include <ithildin/stand.h> 
     10#include <ithildin/ithildin.h> 
    1111 
    1212#include "ircd.h" 
    13 #include "addons/core.h" 
    1413 
    1514IDSTRING(rcsid, "$Id$"); 
    1615 
    1716MODULE_REGISTER("$Rev$"); 
    18  
    19 const char **mdepends = [ 
    20     "ircd", 
    21     NULL 
    22 ] 
     17const char *mdepends[] = MDEPENDS; 
    2318 
    2419static unsigned char chanmode_operonly; 
     
    2621HOOK_FUNCTION(can_join_cmode_O); 
    2722 
    28 MODULE_LOADER(cmode_operonly) { 
     23MODULE_LOADER(operonly) { 
    2924 
    3025    if (!get_module_savedata(savelist, "chanmode_operonly", 
    3126                &chanmode_operonly)) 
    3227        chanmode_request('O', &chanmode_operonly, CHANMODE_FL_D, 
    33                 "chanmode_flag", "chanmode_flag_query", 0, NULL); 
     28                chanmode_flag, chanmode_flag_query, 0, NULL); 
     29    else 
     30        chanmode_update_funcs(chanmode_operonly, chanmode_flag, 
     31                chanmode_flag_query); 
    3432 
    3533    add_hook(ircd.events.can_join_channel, can_join_cmode_O); 
     
    3836} 
    3937 
    40 MODULE_UNLOADER(cmode_operonly) { 
     38MODULE_UNLOADER(operonly) { 
    4139     
    4240    if (reload) 
  • trunk/ithildin/modules/ircd/chanmodes/private.c

    r804 r806  
    11/* 
    2  * cmode_private.c: Flag mode for 'private' channels. 
     2 * private.c: Flag mode for 'private' channels. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    1010 */ 
    1111 
    12 #include <ithildin/stand.h> 
     12#include <ithildin/ithildin.h> 
    1313 
    1414#include "ircd.h" 
    15 #include "addons/core.h" 
    1615 
    1716IDSTRING(rcsid, "$Id$"); 
    1817 
    1918MODULE_REGISTER("$Rev$"); 
    20  
    21 const char **mdepends = [ 
    22     "ircd", 
    23     NULL 
    24 ] 
     19const char *mdepends[] = MDEPENDS; 
    2520 
    2621static unsigned char chanmode_private; 
    2722static HOOK_FUNCTION(can_show_chan_private); 
    2823 
    29 MODULE_LOADER(cmode_private) { 
     24MODULE_LOADER(private) { 
    3025 
    3126    if (!get_module_savedata(savelist, "chanmode_private", 
    3227                &chanmode_private)) 
    3328        chanmode_request('p', &chanmode_private, CHANMODE_FL_D, 
    34                 "chanmode_flag", "chanmode_flag_query", 0, NULL); 
     29                chanmode_flag, chanmode_flag_query, 0, NULL); 
     30    else 
     31        chanmode_update_funcs(chanmode_private, chanmode_flag, 
     32                chanmode_flag_query); 
    3533 
    3634    add_hook(ircd.events.can_see_channel, can_show_chan_private); 
     
    3937} 
    4038 
    41 MODULE_UNLOADER(cmode_private) { 
     39MODULE_UNLOADER(private) { 
    4240     
    4341    remove_hook(ircd.events.can_see_channel, can_show_chan_private); 
  • trunk/ithildin/modules/ircd/chanmodes/registered.c

    r804 r806  
    11/* 
    2  * cmode_reg.c: Flag mode for registered channels. 
     2 * registered.c: Flag mode for registered channels. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
    14 #include "addons/cmode_reg.h" 
    1514 
    1615IDSTRING(rcsid, "$Id$"); 
    1716 
    1817MODULE_REGISTER("$Rev$"); 
     18const char *mdepends[] = MDEPENDS; 
    1919 
    20 const char **mdepends = [ 
    21     "ircd", 
    22     NULL 
    23 ] 
     20unsigned char chanmode_registered; 
    2421 
    25 unsigned char reg_cmode; 
     22CHANMODE_FUNC(chanmode_registered_handler); 
    2623 
    27 CHANMODE_FUNC(chanmode_reg); 
     24MODULE_LOADER(registered) { 
    2825 
    29 MODULE_LOADER(cmode_reg) { 
    30  
    31     if (!get_module_savedata(savelist, "reg_cmode", &reg_cmode)) { 
    32         EXPORT_SYM(chanmode_reg); 
    33         chanmode_request('r', &reg_cmode, CHANMODE_FL_D, 
    34                 "chanmode_reg", "chanmode_flag_query", 0, NULL); 
    35     } 
     26    if (!get_module_savedata(savelist, "chanmode_registered", 
     27                &chanmode_registered)) 
     28        chanmode_request('r', &chanmode_registered, CHANMODE_FL_D, 
     29                chanmode_registered_handler, chanmode_flag_query, 0, NULL); 
     30    else 
     31        chanmode_update_funcs(chanmode_registered, 
     32                chanmode_registered_handler, chanmode_flag_query); 
    3633 
    3734#define ERR_ONLYSERVERSCANCHANGE 468 
     
    4138} 
    4239 
    43 MODULE_UNLOADER(cmode_reg) { 
     40MODULE_UNLOADER(registered) { 
    4441     
    4542    if (reload) 
    46         add_module_savedata(savelist, "reg_cmode", sizeof(reg_cmode), 
    47                 &reg_cmode); 
     43        add_module_savedata(savelist, "chanmode_registered", 
     44                sizeof(chanmode_registered), &chanmode_registered); 
    4845    else 
    49         chanmode_release(reg_cmode); 
     46        chanmode_release(chanmode_registered); 
    5047 
    5148    DMSG(ERR_ONLYSERVERSCANCHANGE); 
     
    5451/* Handle the 'r' channel mode.  Make sure the right folks are the only ones 
    5552 * who can set it. */ 
    56 CHANMODE_FUNC(chanmode_reg) { 
     53CHANMODE_FUNC(chanmode_registered_handler) { 
    5754 
    5855    *argused = 0; 
  • trunk/ithildin/modules/ircd/chanmodes/registered.h

    r613 r806  
    22 * cmode_reg.h: macro for checking registration status on channels 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    1111#define IRCD_ADDONS_CMODE_REG_H 
    1212 
    13 extern unsigned char reg_cmode; 
     13extern unsigned char chanmode_registered; 
    1414 
    15 #define ISREGCHAN(chan) (chanmode_isset(chan, reg_cmode)) 
     15#define ISREGCHAN(chan) (chanmode_isset(chan, chanmode_registered)) 
    1616 
    1717#endif 
  • trunk/ithildin/modules/ircd/chanmodes/regonly.c

    r804 r806  
    11/* 
    2  * cmodes_regonly.c: Registered nick channel restrictions 
     2 * regonly.c: Registered nick channel restrictions 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
    77 * These two modes restrict non-registered users from joining in or speaking in 
    8  * a channel.  They work with the 'regnicks' addon. 
     8 * a channel.  They work with the 'regnicks' usermode. 
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
    14 #include "addons/core.h" 
    15 #include "addons/umode_reg.h" 
     14#include "usermodes/registered.h" 
    1615#include "commands/mode.h" 
    1716 
     
    1918 
    2019MODULE_REGISTER("$Rev$"); 
    21  
    22 const char **mdepends = [ 
    23     "ircd", 
    24     "ircd.addon.umode_reg", 
    25     NULL 
    26 ] 
     20const char *mdepends[] = MDEPENDS; 
    2721 
    2822static struct { 
     
    3428HOOK_FUNCTION(can_join_cmode_R); 
    3529 
    36 MODULE_LOADER(cmodes_regonly) { 
     30MODULE_LOADER(regonly) { 
    3731 
    3832    if (!get_module_savedata(savelist, "regonly_chanmodes", 
    3933                &regonly_chanmodes)) { 
    4034        chanmode_request('M', &regonly_chanmodes.M, CHANMODE_FL_D, 
    41                 "chanmode_flag", "chanmode_flag_query", 0, NULL); 
     35                chanmode_flag, chanmode_flag_query, 0, NULL); 
    4236        chanmode_request('R', &regonly_chanmodes.R, CHANMODE_FL_D, 
    43                 "chanmode_flag", "chanmode_flag_query", 0, NULL); 
     37                chanmode_flag, chanmode_flag_query, 0, NULL); 
     38    } else { 
     39        chanmode_update_funcs(regonly_chanmodes.M, chanmode_flag, 
     40                chanmode_flag_query); 
     41        chanmode_update_funcs(regonly_chanmodes.R, chanmode_flag, 
     42                chanmode_flag_query); 
    4443    } 
    4544    add_hook(ircd.events.can_send_channel, can_send_cmode_M); 
     
    5554} 
    5655 
    57 MODULE_UNLOADER(cmodes_regonly) { 
     56MODULE_UNLOADER(regonly) { 
    5857     
    5958    if (reload) 
  • trunk/ithildin/modules/ircd/chanmodes/strip.c

    r804 r806  
    11/* 
    2  * cmode_strip.c: control-character stripping mode 
     2 * strip.c: control-character stripping mode 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    1616 */ 
    1717 
    18 #include <ithildin/stand.h> 
     18#include <ithildin/ithildin.h> 
    1919 
    2020#include "ircd.h" 
    21 #include "addons/core.h" 
    2221 
    2322IDSTRING(rcsid, "$Id$"); 
    2423 
    2524MODULE_REGISTER("$Rev$"); 
    26  
    27 const char **mdepends = [ 
    28     "ircd", 
    29     NULL 
    30 ] 
     25const char *mdepends[] = MDEPENDS; 
    3126 
    3227static unsigned char chanmode_strip; 
     
    3631HOOK_FUNCTION(strip_conf_hook); 
    3732 
    38 MODULE_LOADER(cmode_strip) { 
     33MODULE_LOADER(strip) { 
    3934 
    4035    if (!get_module_savedata(savelist, "chanmode_strip", &chanmode_strip)) 
    4136        chanmode_request('c', &chanmode_strip, CHANMODE_FL_D, 
    42                 "chanmode_flag", "chanmode_flag_query", 0, NULL); 
     37                chanmode_flag, chanmode_flag_query, 0, NULL); 
     38    else 
     39        chanmode_update_funcs(chanmode_strip, chanmode_flag, 
     40                chanmode_flag_query); 
    4341 
    4442    add_hook_before(ircd.events.can_send_channel, can_send_strip, NULL); 
     
    4947} 
    5048 
    51 MODULE_UNLOADER(cmode_strip) { 
     49MODULE_UNLOADER(strip) { 
    5250     
    5351    if (reload) 
  • trunk/ithildin/modules/ircd/class.c

    r744 r806  
    22 * class.c: connection class management functions 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/class.h

    r579 r806  
    22 * class.h: connection class structure definitions 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/command.c

    r803 r806  
    22 * command.c: command structure management/parsing 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/command.h

    r787 r806  
    22 * command.h: command structure declarations 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/commands/acl.c

    r804 r806  
    22 * acl.c: the ACL command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
     
    7272        act = ACMD_ADD; 
    7373        type = acl_kline_type; 
    74         stage = ACL_STAGE_REGISTER; 
     74        stage = ACL_STAGE_REGISTERED; 
    7575        acc = ACL_DENY; 
    7676        strlcpy(mask, argv[oarg++], USERLEN + HOSTLEN + 2); 
     
    8787        act = ACMD_DEL; 
    8888        type = acl_kline_type; 
    89         stage = ACL_STAGE_REGISTER; 
     89        stage = ACL_STAGE_REGISTERED; 
    9090        acc = ACL_DENY; 
    9191        strlcpy(mask, argv[oarg++], USERLEN + HOSTLEN + 2); 
     
    100100        act = ACMD_ADD; 
    101101        type = acl_zline_type; 
    102         stage = ACL_STAGE_CONNECT; 
     102        stage = ACL_STAGE_CONNECTED; 
    103103        acc = ACL_DENY; 
    104104        strlcpy(mask, argv[oarg++], USERLEN + HOSTLEN + 2); 
     
    115115        act = ACMD_DEL; 
    116116        type = acl_zline_type; 
    117         stage = ACL_STAGE_CONNECT; 
     117        stage = ACL_STAGE_CONNECTED; 
    118118        acc = ACL_DENY; 
    119119        strlcpy(mask, argv[oarg++], USERLEN + HOSTLEN + 2); 
     
    144144                if (argc > oarg) { 
    145145                    stage = str_conv_int(argv[oarg], 0); 
    146                     if (stage < ACL_STAGE_CONNECT || stage > 
    147                             ACL_STAGE_REGISTER) { 
     146                    if (stage < ACL_STAGE_CONNECTED || stage > 
     147                            ACL_STAGE_REGISTERED) { 
    148148                        sendto_one(cli, "NOTICE", 
    149149                                ":Invalid stage %s", argv[oarg]); 
  • trunk/ithildin/modules/ircd/commands/admin.c

    r804 r806  
    22 * admin.c: the ADMIN command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/akill.c

    r804 r806  
    22 * akill.c: the AKILL (and some others ;) command. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/away.c

    r804 r806  
    22 * away.c: the AWAY command. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
     
    2222 
    2323int priv_awaylen; 
     24struct mdext_item *away_mdext; 
    2425 
    2526MODULE_LOADER(away) { 
  • trunk/ithildin/modules/ircd/commands/away.h

    r492 r806  
    22 * away.h: stuff for tracking away messages. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    1212 
    1313/* for away messages.  if the away command isn't loaded, there are no away 
    14  * messages..  we actually put this in the core addon so that things which 
    15  * want to show away messages can check for them without the away module 
    16  * being loaded. */ 
     14 * messages..  */ 
    1715extern struct mdext_item *away_mdext; 
    1816/* safely look for an away message. */ 
  • trunk/ithildin/modules/ircd/commands/capab.c

    r804 r806  
    22 * capab.c: the CAPAB command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/chatops.c

    r804 r806  
    22 * chatops.c: the CHATOPS command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 * 
  • trunk/ithildin/modules/ircd/commands/connect.c

    r804 r806  
    22 * connect.c: the CONNECT command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/die.c

    r804 r806  
    22 * die.c: the DIE command. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/dns.c

    r804 r806  
    22 * dns.c: the DNS command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 * This command acts as a 'dig' like command using the dns module to perform 
  • trunk/ithildin/modules/ircd/commands/error.c

    r804 r806  
    22 * error.c: the ERROR command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/flags.c

    r804 r806  
    22 * flags.c: the FLAGS command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/globops.c

    r804 r806  
    22 * globops.c: the GLOBOPS command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/gnotice.c

    r804 r806  
    22 * gnotice.c: the GNOTICE command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/helper.c

    r804 r806  
    22 * helper.c: the HELPER command 
    33 *  
    4  * Copyright 2003 the Ithildin Project. 
     4 * Copyright 2003-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
     
    99 
    1010#include "ircd.h" 
    11 #include "addons/umode_helper.h" 
     11#include "usermodes/helper.h" 
    1212#include "commands/mode.h" 
    1313 
  • trunk/ithildin/modules/ircd/commands/helpops.c

    r804 r806  
    99 
    1010#include "ircd.h" 
    11 #include "addons/umode_helper.h" 
     11#include "usermodes/helper.h" 
    1212 
    1313IDSTRING(rcsid, "$Id$"); 
  • trunk/ithildin/modules/ircd/commands/info.c

    r804 r806  
    22 * info.c: the INFO command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/invite.c

    r804 r806  
    22 * invite.c: the INVITE command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
     
    99 
    1010#include "ircd.h" 
    11 #include "addons/core.h" 
    1211 
    1312IDSTRING(rcsid, "$Id$"); 
     
    3837                chanmode_flag_query, sizeof(struct channel_invite_list), NULL); 
    3938    } else 
    40         chanmode_change_funcs(chanmode_invite, chanmode_i, 
     39        chanmode_update_funcs(chanmode_invite, chanmode_i, 
    4140                chanmode_flag_query); 
    4241 
  • trunk/ithildin/modules/ircd/commands/ison.c

    r804 r806  
    22 * ison.c: the ISON command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/kick.c

    r804 r806  
    22 * kick.c: the KICK command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
     
    99 
    1010#include "ircd.h" 
    11 #include "addons/core.h" 
    1211 
    1312IDSTRING(rcsid, "$Id$"); 
  • trunk/ithildin/modules/ircd/commands/kill.c

    r804 r806  
    22 * kill.c: the KILL command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/links.c

    r804 r806  
    22 * links.c: the LINKS command. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/list.c

    r804 r806  
    1414 
    1515#include "ircd.h" 
    16 #include "addons/core.h" 
    1716#include "commands/topic.h" 
    1817 
     
    6160                ctp = TOPIC(chan); 
    6261                /* this is pretty stupid */ 
    63                 if (BPRIV(cli, core.privs.see_hidden_chan)) { 
     62                if (BPRIV(cli, ircd.privileges.priv_shc)) { 
    6463                    mgunk = chanmode_getmodes(chan); 
    6564                    if (*mgunk[1] != '\0') 
  • trunk/ithildin/modules/ircd/commands/locops.c

    r804 r806  
    22 * locops.c: the LOCOPS command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/lusers.c

    r804 r806  
    22 * lusers.c: the LUSERS command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/mode.c

    r804 r806  
    22 * mode.c: the MODE command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/mode.h

    r579 r806  
    22 * topic.h: a container for the 'topic' structure. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/commands/module.c

    r804 r806  
    22 * module.c: the MODULE command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
     
    99 
    1010#include "ircd.h" 
    11 #include "addons/core.h" 
    1211 
    1312IDSTRING(rcsid, "$Id$"); 
  • trunk/ithildin/modules/ircd/commands/motd.c

    r804 r806  
    22 * motd.c: the MOTD command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 * 
  • trunk/ithildin/modules/ircd/commands/names.c

    r804 r806  
    22 * names.c: the NAMES command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/nick.c

    r804 r806  
    22 * nick.c: the NICK command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
     
    99 
    1010#include "ircd.h" 
    11 #include "addons/core.h" 
    1211#include "commands/mode.h" 
    1312 
  • trunk/ithildin/modules/ircd/commands/notice.c

    r804 r806  
    22 * notice.c: the NOTICE (or PRIVMSG) command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/oper.c

    r804 r806  
    22 * oper.c: the OPER command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/part.c

    r804 r806  
    22 * part.c: the PART command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/pass.c

    r804 r806  
    22 * pass.c: the PASS command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/ping.c

    r804 r806  
    22 * ping.c: the PING command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/pong.c

    r804 r806  
    22 * pong.c: the PONG command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/quit.c

    r804 r806  
    22 * quit.c: the QUIT command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/rehash.c

    r804 r806  
    22 * rehash.c: the REHASH command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/samode.c

    r804 r806  
    22 * samode.c: the SAMODE command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
     
    99 
    1010#include "ircd.h" 
    11 #include "addons/umode_svcadmin.h" 
     11#include "usermodes/servicesadmin.h" 
    1212#include "commands/mode.h" 
    1313 
  • trunk/ithildin/modules/ircd/commands/server.c

    r804 r806  
    22 * server.c: the SERVER command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/services.c

    r804 r806  
    22 * services.c: the SERVICES (and a whole bunch more) commands 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 * 
  • trunk/ithildin/modules/ircd/commands/silence.c

    r804 r806  
    22 * silence.c: the SILENCE command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/sjoin.c

    r804 r806  
    22 * sjoin.c: the SJOIN command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/sqline.c

    r804 r806  
    22 * sqline.c: the SQLINE/UNSQLINE command. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/squit.c

    r804 r806  
    22 * squit.c: the SQUIT command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/stats.c

    r804 r806  
    22 * stats.c: the STATS command (wrapper for XINFO) 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/svinfo.c

    r804 r806  
    22 * svinfo.c: the SVINFO command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/svskill.c

    r804 r806  
    22 * svskill.c: the SVSKILL command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 * 
  • trunk/ithildin/modules/ircd/commands/svsmode.c

    r804 r806  
    22 * svsmode.c: the SVSMODE command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/svsnick.c

    r804 r806  
    22 * svsnick.c: the SVSNICK command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/time.c

    r804 r806  
    22 * time.c: the TIME command. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/topic.c

    r804 r806  
    22 * topic.c: the TOPIC command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
     
    99 
    1010#include "ircd.h" 
    11 #include "addons/core.h" 
    1211#include "commands/topic.h" 
    1312 
     
    1817 
    1918unsigned char topic_chanmode; 
     19struct mdext_item *topic_mdext; 
    2020HOOK_FUNCTION(topic_server_establish_hook); 
    2121HOOK_FUNCTION(topic_channel_add_hook); 
     
    2626    if (!get_module_savedata(savelist, "topic_chanmode", &topic_chanmode)) 
    2727        chanmode_request('t', &topic_chanmode, CHANMODE_FL_D, 
    28                 "chanmode_flag", "chanmode_flag_query", 0, NULL); 
     28                chanmode_flag, chanmode_flag_query, 0, NULL); 
     29    else 
     30        chanmode_update_funcs(topic_chanmode, chanmode_flag, 
     31                chanmode_flag_query); 
     32 
    2933    if (!get_module_savedata(savelist, "topic_mdext", &topic_mdext)) 
    3034        topic_mdext = create_mdext_item(ircd.mdext.channel, 
  • trunk/ithildin/modules/ircd/commands/topic.h

    r579 r806  
    22 * topic.h: a container for the 'topic' structure. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/commands/trace.c

    r804 r806  
    22 * trace.c: the TRACE command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/user.c

    r804 r806  
    22 * user.c: the USER command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/userhost.c

    r804 r806  
    22 * userhost.c: the USERHOST command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/version.c

    r804 r806  
    22 * version.c: the VERSION command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/wallops.c

    r804 r806  
    22 * wallops.c: the WALLOPS command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/watch.c

    r804 r806  
    22 * watch.c: the WATCH command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 * 
     
    7777        watch.table = create_hash_table(hashtable_size(ircd.hashes.client), 
    7878                offsetof(watch_t, nick), NICKLEN, 
    79                 HASH_FL_NOCASE|HASH_FL_STRING, "nickcmp"); 
    80     } 
     79                HASH_FL_NOCASE|HASH_FL_STRING, 
     80                (hashcmp_function_t)nickcmp); 
     81    } else 
     82        hash_change_cmpfunc(watch.table, (hashcmp_function_t)nickcmp); 
    8183 
    8284    add_isupport("WATCH", ISUPPORT_FL_PRIV, (char *)&watch.watchlim); 
  • trunk/ithildin/modules/ircd/commands/who.c

    r804 r806  
    22 * who.c: the WHO command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
     
    99 
    1010#include "ircd.h" 
    11 #include "addons/core.h" 
    1211#include "commands/away.h" 
    1312 
  • trunk/ithildin/modules/ircd/commands/whois.c

    r804 r806  
    22 * whois.c: the WHOIS command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/whois.h

    r492 r806  
    22 * whois.h: just a header to hold the 'whois' event declaration 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/commands/whowas.c

    r804 r806  
    22 * whowas.c: the WHOWAS command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/commands/xinfo.c

    r804 r806  
    22 * xinfo.c: the XINFO (eXtended INFO) command 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
  • trunk/ithildin/modules/ircd/conf.c

    r787 r806  
    22 * conf.c: ircd configuration data parser 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/conf.h

    r579 r806  
    22 * conf.h: configuration-specific constructs 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/connection.c

    r801 r806  
    22 * connection.c: connection handling routines 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/doc/connections.txt

    r579 r806  
    33# connections.txt: description of the ircd's connection handling process 
    44# 
    5 # Copyright 2002 the Ithildin Project. 
     5# Copyright 2002-2007 the Ithildin Project. 
    66# See the COPYING file for more information on licensing and use. 
    77# 
  • trunk/ithildin/modules/ircd/ircstring.c

    r744 r806  
    22 * ircstring.c: IRC string handling functions 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/ircstring.h

    r577 r806  
    22 * ircstring.h: IRC string support header 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/privilege.c

    r744 r806  
    22 * privilege.c: various functions used for handling privileges 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/privilege.h

    r579 r806  
    22 * privilege.h: support structures/prototypes for privilege.c 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/protocol.c

    r801 r806  
    22 * protocol.c: rudimentary protocol determination routines 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/protocol.h

    r787 r806  
    22 * protocol.h: protocol structure definitions/etc 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/protocols/bahamut14.c

    r579 r806  
    22 * bahamut14.c: the DALnet-ized server<->server protocol 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
    77 
    8 #include <ithildin/stand.h> 
     8#include <ithildin/ithildin.h> 
    99 
    1010#include "ircd.h" 
     
    1313 
    1414MODULE_REGISTER("$Rev$"); 
    15 /* 
    16 @DEPENDENCIES@: ircd 
    17 @DEPENDENCIES@: ircd/addons/core 
    18 @DEPENDENCIES@: ircd/commands/akill        ircd/commands/capab 
    19 @DEPENDENCIES@: ircd/commands/gnotice        ircd/commands/services 
    20 @DEPENDENCIES@: ircd/commands/sqline        ircd/commands/svskill 
    21 @DEPENDENCIES@: ircd/commands/svsmode        ircd/commands/svsnick 
    22 */ 
     15const char *mdepends[] = MDEPENDS; 
     16/* we do not link to these modules, but want them to be loaded to support 
     17 * features of the protocol */ 
     18const char *msoftdepends[] = { 
     19    "ircd.command.akill",      "ircd.command.capab", 
     20    "ircd.command.gnotice",    "ircd.command.services", 
     21    "ircd.command.sqline",     "ircd.command.svskill", 
     22    "ircd.command.svsmode",    "ircd.command.svsnick", 
     23    NULL 
     24}; 
    2325 
    2426uint64_t protocol_flags = PROTOCOL_SFL_SJOIN | PROTOCOL_SFL_NOQUIT | 
  • trunk/ithildin/modules/ircd/protocols/dreamforge.c

    r787 r806  
    66 */ 
    77 
    8 #include <ithildin/stand.h> 
     8#include <ithildin/ithildin.h> 
    99 
    1010#include "ircd.h" 
     
    1313 
    1414MODULE_REGISTER("$Rev$"); 
    15 /* 
    16 @DEPENDENCIES@: ircd 
    17 @DEPENDENCIES@: ircd/addons/core 
    18 @DEPENDENCIES@: ircd/commands/akill        ircd/commands/gnotice 
    19 @DEPENDENCIES@: ircd/commands/services        ircd/commands/sqline 
    20 @DEPENDENCIES@: ircd/commands/svskill        ircd/commands/svsmode 
    21 @DEPENDENCIES@: ircd/commands/svsnick 
    22 */ 
     15const char *mdepends[] = MDEPENDS; 
     16const char *msoftdepends[] = { 
     17    "ircd.command.akill", 
     18    "ircd.command.gnotice",    "ircd.command.services", 
     19    "ircd.command.sqline",     "ircd.command.svskill", 
     20    "ircd.command.svsmode",    "ircd.command.svsnick", 
     21    NULL 
     22}; 
    2323 
    2424uint64_t protocol_flags = PROTOCOL_SFL_SHORTAKILL; 
  • trunk/ithildin/modules/ircd/protocols/ithildin1.c

    r787 r806  
    66 */ 
    77 
    8 #include <ithildin/stand.h> 
     8#include <ithildin/ithildin.h> 
    99 
    1010#include "ircd.h" 
     
    1313 
    1414MODULE_REGISTER("$Rev$"); 
    15 /* 
    16 @DEPENDENCIES@: ircd 
    17 @DEPENDENCIES@: ircd/addons/core 
    18 @DEPENDENCIES@: ircd/commands/gnotice 
    19 */ 
     15const char *mdepends[] = MDEPENDS; 
     16const char *msoftdepends[] = { 
     17    "ircd.command.gnotice", 
     18    NULL 
     19}; 
    2020 
    2121uint64_t protocol_flags = PROTOCOL_SFL_SJOIN | PROTOCOL_SFL_NOQUIT | 
  • trunk/ithildin/modules/ircd/protocols/rfc1459.c

    r579 r806  
    22 * rfc1459.c: the standard client 'RFC1459' protocol 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 */ 
    77 
    8 #include <ithildin/stand.h> 
     8#include <ithildin/ithildin.h> 
    99 
    1010#include "ircd.h" 
     
    1313 
    1414MODULE_REGISTER("$Rev$"); 
    15 /* 
    16 @DEPENDENCIES@: ircd 
    17 @DEPENDENCIES@: ircd/commands/nick ircd/commands/pass ircd/commands/user 
    18 */ 
     15const char *mdepends[] = MDEPENDS; 
    1916 
    2017/* parser for packets */ 
  • trunk/ithildin/modules/ircd/send.c

    r803 r806  
    22 * send.c: various functions used for sending messages 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/send.h

    r803 r806  
    22 * send.h: support structures/prototypes for send.c 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/server.c

    r801 r806  
    22 * server.c: server handling functions 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/server.h

    r787 r806  
    22 * server.h: support structures/prototypes for server.e 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/support.c

    r787 r806  
    22 * support.c: handling for feature support in the server 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/support.h

    r787 r806  
    22 * support.h: structures for various secondary feature subsystems 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/usermodes/admin.c

    r804 r806  
    11/* 
    2  * umode_admin.c: Flag mode for server admins 
     2 * admin.c: Flag mode for server admins 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
    14 #include "addons/umode_admin.h" 
     14#include "usermodes/admin.h" 
    1515#include "commands/whois.h" 
    1616 
     
    1818 
    1919MODULE_REGISTER("$Rev$"); 
    20 const char **mdepends = [ 
    21     "ircd", 
    22     "ircd.command.whois", 
    23     NULL 
    24 ] 
     20const char *mdepends[] = MDEPENDS; 
    2521 
    2622unsigned char usermode_admin; 
     
    3026HOOK_FUNCTION(umode_admin_whois_hook); 
    3127 
    32 MODULE_LOADER(umode_admin) { 
     28MODULE_LOADER(admin) { 
    3329    uint64_t ui64 = 0; 
    3430 
    35     if (!get_module_savedata(savelist, "usermode_admin", &usermode_admin)) { 
    36         EXPORT_SYM(admin_usermode_handler); 
     31    if (!get_module_savedata(savelist, "usermode_admin", &usermode_admin)) 
    3732        usermode_request('A', &usermode_admin, USERMODE_FL_GLOBAL, -1, 
    38                 "admin_usermode_handler"); 
    39     } 
     33                admin_usermode_handler); 
     34    else 
     35        usermode_update_func(usermode_admin, admin_usermode_handler); 
     36 
    4037    if (!get_module_savedata(savelist, "admin_priv", &admin_priv)) 
    4138        admin_priv = create_privilege("administrator", PRIVILEGE_FL_BOOL, 
     
    5047} 
    5148 
    52 MODULE_UNLOADER(umode_admin) { 
     49MODULE_UNLOADER(admin) { 
    5350     
    5451    if (reload) { 
  • trunk/ithildin/modules/ircd/usermodes/admin.h

    r577 r806  
    22 * umode_admin.h: macro for checking server admin status on nicks 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/usermodes/helper.c

    r804 r806  
    11/* 
    2  * umode_helper.c: Flag mode for users who are designated helpers 
     2 * helper.c: Flag mode for users who are designated helpers 
    33 *  
    4  * Copyright 2003 the Ithildin Project. 
     4 * Copyright 2003-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
    14 #include "addons/umode_helper.h" 
    15 #include "commands/mode.h" 
     14#include "usermodes/helper.h" 
    1615#include "commands/whois.h" 
    1716 
     
    1918 
    2019MODULE_REGISTER("$Rev$"); 
    21 const char **mdepends = [ 
    22     "ircd", 
    23     "ircd.command.mode", 
    24     "ircd.command.whois", 
    25     NULL 
    26 ] 
     20const char *mdepends[] = MDEPENDS; 
    2721 
    2822unsigned char usermode_helper; 
     
    3226HOOK_FUNCTION(umode_helper_whois_hook); 
    3327 
    34 MODULE_LOADER(umode_helper) { 
     28MODULE_LOADER(helper) { 
    3529 
    3630    if (!get_module_savedata(savelist, "sflag_helper", &sflag_helper)) 
    3731        sflag_helper = create_send_flag("HELPER", SEND_LEVEL_OPERATOR, -1); 
    38     if (!get_module_savedata(savelist, "usermode_helper", &usermode_helper)) { 
    39         EXPORT_SYM(helper_usermode_handler); 
     32    if (!get_module_savedata(savelist, "usermode_helper", &usermode_helper)) 
    4033        usermode_request('h', &usermode_helper, USERMODE_FL_GLOBAL, 
    41                 sflag_helper, "helper_usermode_handler"); 
    42     } 
     34                sflag_helper, helper_usermode_handler); 
     35    else 
     36        usermode_update_func(usermode_helper, helper_usermode_handler); 
    4337 
    4438    add_hook(whois_event, umode_helper_whois_hook); 
     
    5145} 
    5246 
    53 MODULE_UNLOADER(umode_helper) { 
     47MODULE_UNLOADER(helper) { 
    5448     
    5549    if (reload) { 
  • trunk/ithildin/modules/ircd/usermodes/helper.h

    r577 r806  
    22 * umode_helper.h: macro for checking helper status 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
  • trunk/ithildin/modules/ircd/usermodes/registered.c

    r804 r806  
    11/* 
    2  * umode_reg.c: Flag mode for registered nicknames. 
     2 * registered.c: Flag mode for registered nicknames. 
    33 *  
    4  * Copyright 2002 the Ithildin Project. 
     4 * Copyright 2002-2007 the Ithildin Project. 
    55 * See the COPYING file for more information on licensing and use. 
    66 *  
     
    99 */ 
    1010 
    11 #include <ithildin/stand.h> 
     11#include <ithildin/ithildin.h> 
    1212 
    1313#include "ircd.h" 
    14 #include "addons/umode_reg.h" 
     14#include "usermodes/registered.h" 
    1515#include "commands/mode.h" 
    1616#include "commands/whois.h" 
     
    1919 
    2020MODULE_REGISTER("$Rev$"); 
    21 const char **mdepends = [ 
    22     "ircd", 
    23     "ircd.command.mode", 
    24     "ircd.command.whois", 
    25     NULL 
    26 ] 
     21const char *mdepends[] = MDEPENDS; 
    2722 
    28 unsigned char reg_umode; 
     23unsigned char usermode_registered; 
    2924 
    30 USERMODE_FUNC(usermode_reg); 
    31 HOOK_FUNCTION(umode_reg_nick_hook); 
    32 HOOK_FUNCTION(umode_reg_whois_hook); 
     25USERMODE_FUNC(usermode_registered_handler); 
     26HOOK_FUNCTION(usermode_registered_nick_hook); 
     27HOOK_FUNCTION(usermode_registered_whois_hook); 
    3328 
    3429MODULE_LOADER(umode_reg) { 
    3530 
    36     if (!get_module_savedata(savelist, "reg_umode", &reg_umode)) { 
    37         EXPORT_SYM(usermode_reg); 
    38         usermode_request('r', &reg_umode, USERMODE_FL_GLOBAL, -1, 
    39                 "usermode_reg"); 
    40     } 
     31    if (!get_module_savedata(savelist, "usermode_registered", 
     32                &usermode_registered)) 
     33        usermode_request('r', &usermode_registered, USERMODE_FL_GLOBAL, -1, 
     34                usermode_registered_handler); 
     35    else 
     36        usermode_update_func(usermode_registered, 
     37                usermode_registered_handler); 
    4138 
    42     add_hook(ircd.events.client_nick, umode_reg_nick_hook); 
    43     add_hook(whois_event, umode_reg_whois_hook); 
     39    add_hook(ircd.events.client_nick, usermode_registered_nick_hook); 
     40    add_hook(whois_event, usermode_registered_whois_hook); 
    4441 
    4542#define RPL_WHOISREGNICK 307 
     
    5249     
    5350    if (reload) 
    54         add_module_savedata(savelist, "reg_umode", sizeof(reg_umode), 
    55                 &reg_umode); 
     51        add_module_savedata(savelist, "usermode_registered", 
     52                sizeof(usermode_registered), &usermode_registered); 
    5653    else 
    57         usermode_release(reg_umode); 
     54        usermode_release(usermode_registered); 
    5855 
    59     remove_hook(ircd.events.client_nick, umode_reg_nick_hook); 
    60     remove_hook(whois_event, umode_reg_whois_hook); 
     56    remove_hook(ircd.events.client_nick, usermode_registered_nick_hook); 
     57    remove_hook(whois_event, usermode_registered_whois_hook); 
    6158 
    6259    DMSG(RPL_WHOISREGNICK); 
     
    6461 
    6562/* Don't let users change their registered/non-registered setting. */ 
    66 USERMODE_FUNC(usermode_reg) { 
     63USERMODE_FUNC(usermode_registered_handler) { 
    6764    /* clients cannot modify the +r mode themselves.  note however that 
    6865     * this will *not* cause the mode to fail for remote clients