home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / yagirc-0.51.tar.gz / yagirc-0.51.tar / yagirc-0.51 / irc.h < prev    next >
C/C++ Source or Header  |  1998-05-05  |  2KB  |  75 lines

  1. #ifndef __IRC_H
  2. #define __IRC_H
  3.  
  4. #include <glib.h>
  5. #include "data.h"
  6.  
  7. enum
  8. {
  9.     TXT_TYPE_DEFAULT,
  10.     TXT_TYPE_ERROR,
  11.     TXT_TYPE_SERVER_TEXT,
  12.     TXT_TYPE_NOTICE,
  13.     TXT_TYPE_DCC,
  14. };
  15.  
  16. enum
  17. {
  18.     IGNORE_PUBLIC,
  19.     IGNORE_PRIVATE,
  20.     IGNORE_CTCP,
  21. };
  22.  
  23. #define isircflag(a) ((a) == '@' || (a) == '+' || (a) == '-' || (a) == '~')
  24.  
  25. void irc_init(void);
  26. void irc_deinit(void);
  27.  
  28. /* Write text to window, convert color codes. */
  29. void drawtext(WINDOW_REC *win, int type, char *str, ...);
  30.  
  31. /* Send command to IRC server */
  32. int irc_send_cmd(SERVER_REC *serv, char *cmd);
  33. /* Parse outgoing line */
  34. int irc_parse_outgoing(CHAN_REC *chan, char *line);
  35.  
  36. /* Connect to IRC server */
  37. SERVER_REC *irc_server_connect(char *name, int port);
  38. /* Disconnect from IRC server */
  39. void irc_server_disconnect(SERVER_REC *server);
  40.  
  41. /* Create new IRC window, if win == NULL new top level window is created, if
  42.    not, new window for same toplevel window as "win" is created. */
  43. WINDOW_REC *irc_window_new(SERVER_REC *server, WINDOW_REC *win);
  44. /* Close IRC window */
  45. void irc_window_close(WINDOW_REC *win);
  46. /* Window got focus */
  47. void irc_window_focus(WINDOW_REC *win);
  48.  
  49. /* Check if nick is in ignore list */
  50. int irc_is_ignored(char *nick, int type);
  51. /* Select new "default server window" for server messages */
  52. void irc_select_new_server_window(WINDOW_REC *win);
  53.  
  54. /* Destroy IRC channel record */
  55. void irc_chan_free(CHAN_REC *chan);
  56. /* Find server record */
  57. SERVER_REC *irc_get_server(int handle);
  58. /* Find channel record of chan in server serv, if serv==NULL, find from all servers */
  59. CHAN_REC *channel_joined(SERVER_REC *serv, char *chan);
  60. /* IRC nick comparision for sort functions */
  61. int irc_nicks_compare(char *p1, char *p2);
  62. /* Select any other channel in window except the one we are now */
  63. int irc_select_new_channel(WINDOW_REC *window);
  64.  
  65. extern GList *winlist; /* List of windows */
  66. extern GList *servlist; /* List of servers */
  67. extern GList *scriptlist; /* List of scripts loaded */
  68. extern GList *aliases; /* List of command aliases */
  69. extern GList *ignores; /* Ignore list */
  70. extern GList *notifies; /* Notify list */
  71. extern WINDOW_REC *curwin; /* current window */
  72. extern SERVER_REC *cserver; /* current server */
  73.  
  74. #endif
  75.