home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / in4wjcxu / other / irc / include / h.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-14  |  9.2 KB  |  227 lines

  1. /************************************************************************
  2.  *   IRC - Internet Relay Chat, include/h.h
  3.  *   Copyright (C) 1992 Darren Reed
  4.  *
  5.  *   This program is free software; you can redistribute it and/or modify
  6.  *   it under the terms of the GNU General Public License as published by
  7.  *   the Free Software Foundation; either version 1, or (at your option)
  8.  *   any later version.
  9.  *
  10.  *   This program is distributed in the hope that it will be useful,
  11.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *   GNU General Public License for more details.
  14.  *
  15.  *   You should have received a copy of the GNU General Public License
  16.  *   along with this program; if not, write to the Free Software
  17.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20. /*
  21.  * "h.h". - Headers file.
  22.  *
  23.  * Most of the externs and prototypes thrown in here to 'cleanup' things.
  24.  * -avalon
  25.  */
  26.  
  27. extern    time_t    nextconnect, nextdnscheck, nextping;
  28. extern    aClient    *client, me, *local[];
  29. extern    aChannel *channel;
  30. extern    struct    stats    *ircstp;
  31. extern    int    bootopt;
  32.  
  33. extern    aChannel *find_channel PROTO((char *, aChannel *));
  34. extern    void    remove_user_from_channel PROTO((aClient *, aChannel *));
  35. extern    void    del_invite PROTO((aClient *, aChannel *));
  36. extern    void    send_user_joins PROTO((aClient *, aClient *));
  37. extern    void    clean_channelname PROTO((char *));
  38. extern    int    can_send PROTO((aClient *, aChannel *));
  39. extern    int    is_chan_op PROTO((aClient *, aChannel *));
  40. extern    int    has_voice PROTO((aClient *, aChannel *));
  41. extern    int    count_channels PROTO((aClient *));
  42.  
  43. extern    aClient    *find_client PROTO((char *, aClient *));
  44. extern    aClient    *find_name PROTO((char *, aClient *));
  45. extern    aClient    *find_person PROTO((char *, aClient *));
  46. extern    aClient    *find_server PROTO((char *, aClient *));
  47. extern    aClient    *find_service PROTO((char *, aClient *));
  48. extern    aClient    *find_userhost PROTO((char *, char *, aClient *, int *));
  49.  
  50. extern    int    attach_conf PROTO((aClient *, aConfItem *));
  51. extern    aConfItem *attach_confs PROTO((aClient*, char *, int));
  52. extern    aConfItem *attach_confs_host PROTO((aClient*, char *, int));
  53. extern    int    attach_Iline PROTO((aClient *, struct hostent *, char *));
  54. extern    aConfItem *conf, *find_me PROTO(()), *find_admin PROTO(());
  55. extern    aConfItem *count_cnlines PROTO((Link *));
  56. extern    void    det_confs_butmask PROTO((aClient *, int));
  57. extern    int    detach_conf PROTO((aClient *, aConfItem *));
  58. extern    aConfItem *det_confs_butone PROTO((aClient *, aConfItem *));
  59. extern    aConfItem *find_conf PROTO((Link *, char*, int));
  60. extern    aConfItem *find_conf_exact PROTO((char *, char *, char *, int));
  61. extern    aConfItem *find_conf_host PROTO((Link *, char *, int));
  62. extern    aConfItem *find_conf_ip PROTO((Link *, char *, char *, int));
  63. extern    aConfItem *find_conf_name PROTO((char *, int));
  64. extern    int    find_kill PROTO((aClient *));
  65. extern    int    find_restrict PROTO((aClient *));
  66. extern    int    rehash PROTO((aClient *, aClient *, int));
  67. extern    int    initconf PROTO((int));
  68.  
  69. extern    char    *MyMalloc PROTO((int)), *MyRealloc PROTO((char *, int));
  70. extern    char    *debugmode, *configfile, *sbrk0;
  71. extern    char    *getfield PROTO((char *));
  72. extern    void    get_sockhost PROTO((aClient *, char *));
  73. extern    char    *rpl_str PROTO((int)), *err_str PROTO((int));
  74. extern    char    *strerror PROTO((int));
  75. extern    int    dgets PROTO((int, char *, int));
  76. extern    char    *inetntoa PROTO((char *));
  77.  
  78. extern    int    dbufalloc, dbufblocks, debuglevel, errno, h_errno;
  79. extern    int    highest_fd, debuglevel, portnum, debugtty, maxusersperchannel;
  80. extern    int    readcalls, udpfd, resfd;
  81. extern    aClient    *add_connection PROTO((aClient *, int));
  82. extern    int    add_listener PROTO((aConfItem *));
  83. extern    void    add_local_domain PROTO((char *, int));
  84. extern    int    check_client PROTO((aClient *));
  85. extern    int    check_server PROTO((aClient *, struct hostent *, \
  86.                     aConfItem *, aConfItem *, int));
  87. extern    int    check_server_init PROTO((aClient *));
  88. extern    void    close_connection PROTO((aClient *));
  89. extern    void    close_listeners PROTO(());
  90. extern    int connect_server PROTO((aConfItem *, aClient *, struct hostent *));
  91. extern    void    get_my_name PROTO((aClient *, char *, int));
  92. extern    int    get_sockerr PROTO((aClient *));
  93. extern    int    inetport PROTO((aClient *, char *, int));
  94. extern    void    init_sys PROTO(());
  95. extern    int    read_message PROTO((time_t));
  96. extern    void    report_error PROTO((char *, aClient *));
  97. extern    void    set_non_blocking PROTO((int, aClient *));
  98. extern    int    setup_ping PROTO(());
  99. extern    void    summon PROTO((aClient *, char *, char *, char *));
  100. extern    int    unixport PROTO((aClient *, char *, int));
  101. extern    int    utmp_open PROTO(());
  102. extern    int    utmp_read PROTO((int, char *, char *, char *, int));
  103. extern    int    utmp_close PROTO((int));
  104.  
  105. extern    void    start_auth PROTO((aClient *));
  106. extern    void    read_authports PROTO((aClient *));
  107. extern    void    send_authports PROTO((aClient *));
  108.  
  109. extern    void    restart PROTO((char *));
  110. extern    void    send_channel_modes PROTO((aClient *, aChannel *));
  111. extern    void    server_reboot PROTO(());
  112. extern    void    terminate PROTO(()), write_pidfile PROTO(());
  113.  
  114. extern    int    send_queued PROTO((aClient *));
  115. /*VARARGS2*/
  116. extern    void    sendto_one();
  117. /*VARARGS4*/
  118. extern    void    sendto_channel_butone();
  119. /*VARARGS2*/
  120. extern    void    sendto_serv_butone();
  121. /*VARARGS2*/
  122. extern    void    sendto_common_channels();
  123. /*VARARGS3*/
  124. extern    void    sendto_channel_butserv();
  125. /*VARARGS3*/
  126. extern    void    sendto_match_servs();
  127. /*VARARGS5*/
  128. extern    void    sendto_match_butone();
  129. /*VARARGS3*/
  130. extern    void    sendto_all_butone();
  131. /*VARARGS1*/
  132. extern    void    sendto_ops();
  133. /*VARARGS3*/
  134. extern    void    sendto_ops_butone();
  135. /*VARARGS3*/
  136. extern    void    sendto_prefix_one();
  137.  
  138. extern    int    writecalls, writeb[];
  139. extern    int    deliver_it PROTO((aClient *, char *, int));
  140.  
  141. extern    int    check_registered PROTO((aClient *));
  142. extern    int    check_registered_user PROTO((aClient *));
  143. extern    char    *get_client_name PROTO((aClient *, int));
  144. extern    char    *get_client_host PROTO((aClient *));
  145. extern    char    *my_name_for_link PROTO((char *, aConfItem *));
  146. extern    char    *myctime PROTO((time_t)), *date PROTO((time_t));
  147. extern    int    exit_client PROTO((aClient *, aClient *, aClient *, char *));
  148. extern    void    initstats PROTO(()), tstats PROTO((aClient *, char *));
  149.  
  150. extern    int    parse PROTO((aClient *, char *, char *, struct Message *));
  151. extern    int    do_numeric PROTO((int, aClient *, aClient *, int, char **));
  152. extern    int hunt_server PROTO((aClient *,aClient *,char *,int,int,char **));
  153. extern    aClient    *next_client PROTO((aClient *, char *));
  154. #ifndef    CLIENT_COMPILE
  155. extern    int    m_umode PROTO((aClient *, aClient *, int, char **));
  156. extern    int    m_names PROTO((aClient *, aClient *, int, char **));
  157. extern    int    m_server_estab PROTO((aClient *));
  158. extern    void    send_umode PROTO((aClient *, aClient *, int, int, char *));
  159. extern    void    send_umode_out PROTO((aClient*, aClient *, int));
  160. #endif
  161.  
  162. extern    void    free_client PROTO((aClient *));
  163. extern    void    free_link PROTO((Link *));
  164. extern    void    free_conf PROTO((aConfItem *));
  165. extern    void    free_class PROTO((aClass *));
  166. extern    void    free_user PROTO((anUser *, aClient *));
  167. extern    Link    *make_link PROTO(());
  168. extern    anUser    *make_user PROTO((aClient *));
  169. extern    aConfItem *make_conf PROTO(());
  170. extern    aClass    *make_class PROTO(());
  171. extern    aServer    *make_server PROTO(());
  172. extern    aClient    *make_client PROTO((aClient *));
  173. extern    Link    *find_user_link PROTO((Link *, aClient *));
  174. extern    void    add_client_to_list PROTO((aClient *));
  175. extern    void    checklist PROTO(());
  176. extern    void    remove_client_from_list PROTO((aClient *));
  177. extern    void    initlists PROTO(());
  178.  
  179. extern    void    add_class PROTO((int, int, int, int, long));
  180. extern    void    fix_class PROTO((aConfItem *, aConfItem *));
  181. extern    long    get_sendq PROTO((aClient *));
  182. extern    int    get_con_freq PROTO((aClass *));
  183. extern    int    get_client_ping PROTO((aClient *));
  184. extern    int    get_client_class PROTO((aClient *));
  185. extern    int    get_conf_class PROTO((aConfItem *));
  186. extern    void    report_classes PROTO((aClient *));
  187.  
  188. extern    struct    hostent    *get_res PROTO((char *));
  189. extern    struct    hostent    *gethost_byaddr PROTO((char *, Link *));
  190. extern    struct    hostent    *gethost_byname PROTO((char *, Link *));
  191. extern    void    flush_cache PROTO(());
  192. extern    int    init_resolver PROTO((int));
  193. extern    time_t    timeout_query_list PROTO((time_t));
  194. extern    time_t    expire_cache PROTO((time_t));
  195. extern    void    del_queries PROTO((char *));
  196.  
  197. extern    void    clear_channel_hash_table PROTO(());
  198. extern    void    clear_client_hash_table PROTO(());
  199. extern    int    add_to_client_hash_table PROTO((char *, aClient *));
  200. extern    int    del_from_client_hash_table PROTO((char *, aClient *));
  201. extern    int    add_to_channel_hash_table PROTO((char *, aChannel *));
  202. extern    int    del_from_channel_hash_table PROTO((char *, aChannel *));
  203. extern    aChannel *hash_find_channel PROTO((char *, aChannel *));
  204. extern    aClient    *hash_find_client PROTO((char *, aClient *));
  205. extern    aClient    *hash_find_nickserver PROTO((char *, aClient *));
  206. extern    aClient    *hash_find_server PROTO((char *, aClient *));
  207.  
  208. extern    void    add_history PROTO((aClient *));
  209. extern    aClient    *get_history PROTO((char *, time_t));
  210. extern    void    initwhowas PROTO(());
  211. extern    void    off_history PROTO((aClient *));
  212.  
  213. extern    int    dopacket PROTO((aClient *, char *, int));
  214.  
  215. #ifdef    CLIENT_COMPILE
  216. extern    char    *mycncmp PROTO((char *, char *));
  217. #endif
  218.  
  219. /*VARARGS2*/
  220. extern    void    debug();
  221. #if defined(DEBUGMODE) && !defined(CLIENT_COMPILE)
  222. extern    void    send_usage PROTO((aClient *, char *));
  223. extern    void    send_listinfo PROTO((aClient *, char *));
  224. extern    void    count_memory PROTO((aClient *, char *));
  225. #endif
  226.  
  227.