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 / data.h < prev    next >
C/C++ Source or Header  |  1998-05-06  |  2KB  |  110 lines

  1. #ifndef __DATA_H
  2. #define __DATA_H
  3.  
  4. #include <sys/time.h>
  5.  
  6. typedef struct _CHAN_REC CHAN_REC;
  7. typedef struct _WINDOW_REC WINDOW_REC;
  8. typedef struct _SERVER_REC SERVER_REC;
  9. typedef struct _SCRIPT_REC SCRIPT_REC;
  10. typedef struct _DCC_REC DCC_REC;
  11.  
  12. #include "gui.h"
  13.  
  14. typedef void (*DRAW_FUNC)(char *, void *);
  15.  
  16. struct _WINDOW_REC
  17. {
  18.     int num; /* window number */
  19.     GList *chanlist; /* list of channels in this window */
  20.     CHAN_REC *curchan; /* current active channel */
  21.     SERVER_REC *defserv;
  22.  
  23.     DRAW_FUNC drawfunc;
  24.     void *drawfuncdata;
  25.  
  26.     int new_data; /* set on when text is written to this window */
  27.  
  28.     char textbuf[1024];
  29.     int textbuflen;
  30.  
  31.     GUI_WINDOW_REC *gui;
  32. };
  33.  
  34. struct _CHAN_REC
  35. {
  36.     char *name; /* channel name */
  37.     char *topic; /* channel topic */
  38.     GList *nicks; /* list of nicks in this channel */
  39.     WINDOW_REC *window; /* channel window */
  40.     SERVER_REC *server; /* channel server */
  41.  
  42.     int new_data; /* set on when text is written to this channel */
  43.  
  44.     GUI_CHAN_REC *gui;
  45. };
  46.  
  47. struct _SERVER_REC
  48. {
  49.     char *name; /* server name */
  50.     char *nick; /* your nick */
  51.     int connected; /* connected to server */
  52.     int handle; /* socket handle */
  53.     int readtag; /* gui input tag */
  54.     int timetag; /* gui timeout tag */
  55.     int ison_reqs; /* number of /ISON requests sent to server for now */
  56.     WINDOW_REC *defwin; /* default window where to send server messages */
  57.  
  58.     char buf[512]; /* receive buffer */
  59.     int bufpos;
  60. };
  61.  
  62. struct _SCRIPT_REC
  63. {
  64.     char *name;
  65.     int readfd;
  66.     int writefd;
  67.     int pid;
  68.     int tag;
  69.  
  70.     char buf[512]; /* receive buffer */
  71.     int bufpos;
  72. };
  73.  
  74. enum
  75. {
  76.     DCC_TYPE_CHAT = 1,
  77.     DCC_TYPE_SEND,
  78.     DCC_TYPE_GET,
  79. } DCCType;
  80.  
  81. struct _DCC_REC
  82. {
  83.     int type;
  84.  
  85.     char *arg;
  86.     char *nick;
  87.  
  88.     char *addr; /* address we're connected in */
  89.     int port; /* port we're connected in */
  90.  
  91.     long size, transfd; /* file size / bytes transferred */
  92.     int handle, tag; /* socket handle / gui tag */
  93.     int fhandle; /* file handle */
  94.     time_t starttime; /* transfer start time */
  95.  
  96.     char *buf; /* read buffer */
  97.     int bufpos;
  98.  
  99.     GUI_DCC_REC *gui;
  100. };
  101.  
  102. typedef struct
  103. {
  104.     char *alias;
  105.     char *cmd;
  106. }
  107. ALIAS_REC;
  108.  
  109. #endif
  110.