00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _EGG_MOD_SERVER_API_H_
00023 #define _EGG_MOD_SERVER_API_H_
00024
00025
00026 #define EGG_SERVER_API_MAJOR 0
00027 #define EGG_SERVER_API_MINOR 0
00028
00029
00030 #define SERVER_NOQUEUE 1
00031 #define SERVER_QUICK 2
00032 #define SERVER_NORMAL 3
00033 #define SERVER_SLOW 4
00034
00035 #define SERVER_NEXT 8
00036
00037
00038 typedef struct queue_entry {
00039 struct queue_entry *next, *prev;
00040 int id;
00041 irc_msg_t msg;
00042 } queue_entry_t;
00043
00044 typedef struct {
00045 queue_entry_t *queue_head, *queue_tail;
00046 int len;
00047 int next_id;
00048 } queue_t;
00049
00050
00051 typedef struct channel_member {
00052 struct channel_member *next;
00053
00054 char *nick;
00055 char *uhost;
00056 long join_time;
00057 flags_t mode;
00058 } channel_member_t;
00059
00060 typedef struct channel_mask {
00061 struct channel_mask *next;
00062 char *mask;
00063 char *set_by;
00064
00065 long time;
00066 long last_used;
00067 } channel_mask_t;
00068
00069 typedef struct channel_mask_list {
00070 struct channel_mask *head;
00071 int len;
00072 int loading;
00073 char type;
00074 } channel_mask_list_t;
00075
00076 typedef struct channel_mode_arg {
00077 int type;
00078 char *value;
00079 } channel_mode_arg_t;
00080
00081 typedef struct channel {
00082 struct channel *next, *prev;
00083
00084 char *name;
00085
00086 char *topic, *topic_nick;
00087 long topic_time;
00088
00089 flags_t mode;
00090 int limit;
00091 char *key;
00092
00093 channel_mask_list_t **lists;
00094 int nlists;
00095
00096 channel_mode_arg_t *args;
00097 int nargs;
00098
00099 channel_member_t *member_head;
00100 int nmembers;
00101
00102 channel_member_t *bot;
00103
00104 xml_node_t *settings;
00105 int status;
00106 int flags;
00107 } channel_t;
00108
00109
00110 typedef struct {
00111 int major, minor;
00112
00113
00114 int (*match_botnick)(const char *nick);
00115
00116
00117 int (*printserv)(int priority, const char *format, ...);
00118 queue_entry_t (*queue_new)(char *text);
00119 void (*queue_append)(queue_t *queue, queue_entry_t *q);
00120 void (*queue_unlink)(queue_t *queue, queue_entry_t *q);
00121 void (*queue_entry_from_text)(queue_entry_t *q, char *text);
00122 void (*queue_entry_to_text)(queue_entry_t *q, char *text, int *remaining);
00123 void (*queue_entry_cleanup)(queue_entry_t *q);
00124 queue_t *(*queue_get_by_priority)(int priority);
00125 void (*dequeue_messages)();
00126
00127
00128 channel_t *(*channel_lookup)(const char *chan_name);
00129 channel_t *(*channel_add)(const char *chan_name);
00130 int (*channel_set)(channel_t *chan, const char *value, ...);
00131 int (*channel_get)(channel_t *chan, char **strptr, ...);
00132 int (*channel_get_int)(channel_t *chan, int *intptr, ...);
00133
00134
00135 } egg_server_api_t;
00136
00137 #endif