libpurple/protocols/zephyr/zephyr_internal.h

changeset 39829
ce056c64e426
parent 39819
3554dac2991b
child 39831
c7e0d1617aae
equal deleted inserted replaced
39828:7372deed606c 39829:ce056c64e426
24 #ifndef WIN32 24 #ifndef WIN32
25 #include <netinet/in.h> 25 #include <netinet/in.h>
26 #endif 26 #endif
27 #endif 27 #endif
28 28
29 /* Use __STDC__ to guess whether we can use stdarg, prototypes, and const. 29 #include <stdarg.h>
30 * This is a public header file, so autoconf can't help us here. */
31 #ifdef __STDC__
32 # include <stdarg.h>
33 # define ZP(x) x
34 # define ZCONST const
35 #else
36 # define ZP(x) ()
37 # define ZCONST
38 #endif
39 30
40 #ifdef WIN32 31 #ifdef WIN32
41 /* this really should be uint32_t */ 32 /* this really should be uint32_t */
42 /*typedef unsigned int in_addr_t; 33 /*typedef unsigned int in_addr_t;
43 struct in_addr 34 struct in_addr
72 63
73 /* Packet type */ 64 /* Packet type */
74 typedef enum { 65 typedef enum {
75 UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK, CLIENTACK, STAT 66 UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK, CLIENTACK, STAT
76 } ZNotice_Kind_t; 67 } ZNotice_Kind_t;
77 extern ZCONST char *ZNoticeKinds[9]; 68 extern const char *ZNoticeKinds[9];
78 69
79 /* Unique ID format */ 70 /* Unique ID format */
80 typedef struct { 71 typedef struct {
81 struct in_addr zuid_addr; 72 struct in_addr zuid_addr;
82 struct timeval tv; 73 struct timeval tv;
136 char *version; 127 char *version;
137 } ZAsyncLocateData_t; 128 } ZAsyncLocateData_t;
138 129
139 /* for ZSetDebug */ 130 /* for ZSetDebug */
140 #ifdef Z_DEBUG 131 #ifdef Z_DEBUG
141 void (*__Z_debug_print) ZP((ZCONST char *fmt, va_list args, void *closure)); 132 void (*__Z_debug_print)(const char *fmt, va_list args, void *closure);
142 void *__Z_debug_print_closure; 133 void *__Z_debug_print_closure;
143 #endif 134 #endif
144 135
145 int ZCompareUIDPred ZP((ZNotice_t *, void *)); 136 int ZCompareUIDPred(ZNotice_t *, void *);
146 int ZCompareMultiUIDPred ZP((ZNotice_t *, void *)); 137 int ZCompareMultiUIDPred(ZNotice_t *, void *);
147 138
148 /* Defines for ZFormatNotice, et al. */ 139 /* Defines for ZFormatNotice, et al. */
149 typedef Code_t (*Z_AuthProc) ZP((ZNotice_t*, char *, int, int *)); 140 typedef Code_t (*Z_AuthProc)(ZNotice_t *, char *, int, int *);
150 Code_t ZMakeAuthentication ZP((ZNotice_t*, char *,int, int*)); 141 Code_t ZMakeAuthentication(ZNotice_t *, char *, int, int *);
151 142
152 char *ZGetSender ZP((void)); 143 char *ZGetSender(void);
153 char *ZGetVariable ZP((char *)); 144 char *ZGetVariable(char *);
154 Code_t ZSetVariable ZP((char *var, char *value)); 145 Code_t ZSetVariable(char *var, char *value);
155 Code_t ZUnsetVariable ZP((char *var)); 146 Code_t ZUnsetVariable(char *var);
156 int ZGetWGPort ZP((void)); 147 int ZGetWGPort(void);
157 Code_t ZSetDestAddr ZP((struct sockaddr_in *)); 148 Code_t ZSetDestAddr(struct sockaddr_in *);
158 Code_t ZFormatNoticeList ZP((ZNotice_t*, char**, int, 149 Code_t ZFormatNoticeList(ZNotice_t *, char **, int, char **, int *, Z_AuthProc);
159 char **, int*, Z_AuthProc)); 150 Code_t ZParseNotice(char *, int, ZNotice_t *);
160 Code_t ZParseNotice ZP((char*, int, ZNotice_t *)); 151 Code_t ZReadAscii(char *, int, unsigned char *, int);
161 Code_t ZReadAscii ZP((char*, int, unsigned char*, int)); 152 Code_t ZReadAscii32(char *, int, unsigned long *);
162 Code_t ZReadAscii32 ZP((char *, int, unsigned long *)); 153 Code_t ZReadAscii16(char *, int, unsigned short *);
163 Code_t ZReadAscii16 ZP((char *, int, unsigned short *)); 154 Code_t ZSendPacket(char *, int, int);
164 Code_t ZSendPacket ZP((char*, int, int)); 155 Code_t ZSendList(ZNotice_t *, char *[], int, Z_AuthProc);
165 Code_t ZSendList ZP((ZNotice_t*, char *[], int, Z_AuthProc)); 156 Code_t ZSrvSendList(ZNotice_t *, char *[], int, Z_AuthProc, Code_t (*)());
166 Code_t ZSrvSendList ZP((ZNotice_t*, char*[], int, Z_AuthProc, Code_t (*)())); 157 Code_t ZSendNotice(ZNotice_t *, Z_AuthProc);
167 Code_t ZSendNotice ZP((ZNotice_t *, Z_AuthProc)); 158 Code_t ZSrvSendNotice(ZNotice_t *, Z_AuthProc, Code_t (*)());
168 Code_t ZSrvSendNotice ZP((ZNotice_t*, Z_AuthProc, Code_t (*)())); 159 Code_t ZFormatNotice(ZNotice_t *, char **, int *, Z_AuthProc);
169 Code_t ZFormatNotice ZP((ZNotice_t*, char**, int*, Z_AuthProc)); 160 Code_t ZFormatSmallNotice(ZNotice_t *, ZPacket_t, int *, Z_AuthProc);
170 Code_t ZFormatSmallNotice ZP((ZNotice_t*, ZPacket_t, int*, Z_AuthProc)); 161 Code_t ZFormatRawNoticeList(ZNotice_t *notice, char *list[], int nitems,
171 Code_t ZFormatRawNoticeList ZP((ZNotice_t *notice, char *list[], int nitems, 162 char **buffer, int *ret_len);
172 char **buffer, int *ret_len)); 163 Code_t ZLocateUser(char *, int *, Z_AuthProc);
173 Code_t ZLocateUser ZP((char *, int *, Z_AuthProc)); 164 Code_t ZRequestLocations(const char *, ZAsyncLocateData_t *, ZNotice_Kind_t,
174 Code_t ZRequestLocations ZP((const char *, ZAsyncLocateData_t *, 165 Z_AuthProc);
175 ZNotice_Kind_t, Z_AuthProc)); 166 Code_t ZhmStat(struct in_addr *, ZNotice_t *);
176 Code_t ZhmStat ZP((struct in_addr *, ZNotice_t *)); 167 Code_t ZInitialize(void);
177 Code_t ZInitialize ZP((void)); 168 Code_t ZSetServerState(int);
178 Code_t ZSetServerState ZP((int)); 169 Code_t ZSetFD(int);
179 Code_t ZSetFD ZP((int)); 170 Code_t ZFormatSmallRawNotice(ZNotice_t *, ZPacket_t, int *);
180 Code_t ZFormatSmallRawNotice ZP((ZNotice_t*, ZPacket_t, int*)); 171 int ZCompareUID(ZUnique_Id_t *, ZUnique_Id_t *);
181 int ZCompareUID ZP((ZUnique_Id_t*, ZUnique_Id_t*)); 172 Code_t ZMakeAscii(char *, int, unsigned char *, int);
182 Code_t ZMakeAscii ZP((char*, int, unsigned char*, int)); 173 Code_t ZMakeAscii32(char *, int, unsigned long);
183 Code_t ZMakeAscii32 ZP((char *, int, unsigned long)); 174 Code_t ZMakeAscii16(char *, int, unsigned int);
184 Code_t ZMakeAscii16 ZP((char *, int, unsigned int)); 175 Code_t ZReceivePacket(ZPacket_t, int *, struct sockaddr_in *);
185 Code_t ZReceivePacket ZP((ZPacket_t, int*, struct sockaddr_in*)); 176 Code_t ZCheckAuthentication(ZNotice_t *, struct sockaddr_in *);
186 Code_t ZCheckAuthentication ZP((ZNotice_t*, struct sockaddr_in*)); 177 Code_t ZSetLocation(char *exposure);
187 Code_t ZSetLocation ZP((char *exposure)); 178 Code_t ZUnsetLocation(void);
188 Code_t ZUnsetLocation ZP((void)); 179 Code_t ZFlushMyLocations(void);
189 Code_t ZFlushMyLocations ZP((void)); 180 Code_t ZFormatRawNotice(ZNotice_t *, char **, int *);
190 Code_t ZFormatRawNotice ZP((ZNotice_t *, char**, int *)); 181 Code_t ZRetrieveSubscriptions(unsigned short, int *);
191 Code_t ZRetrieveSubscriptions ZP((unsigned short, int*)); 182 Code_t ZOpenPort(unsigned short *port);
192 Code_t ZOpenPort ZP((unsigned short *port)); 183 Code_t ZClosePort(void);
193 Code_t ZClosePort ZP((void)); 184 Code_t ZFlushLocations(void);
194 Code_t ZFlushLocations ZP((void)); 185 Code_t ZFlushSubscriptions(void);
195 Code_t ZFlushSubscriptions ZP((void)); 186 Code_t ZFreeNotice(ZNotice_t *notice);
196 Code_t ZFreeNotice ZP((ZNotice_t *notice)); 187 Code_t ZParseLocations(register ZNotice_t *notice,
197 Code_t ZParseLocations ZP((register ZNotice_t *notice, 188 register ZAsyncLocateData_t *zald, int *nlocs,
198 register ZAsyncLocateData_t *zald, int *nlocs, 189 char **user);
199 char **user)); 190 int ZCompareALDPred(ZNotice_t *notice, void *zald);
200 int ZCompareALDPred ZP((ZNotice_t *notice, void *zald)); 191 void ZFreeALD(register ZAsyncLocateData_t *zald);
201 void ZFreeALD ZP((register ZAsyncLocateData_t *zald)); 192 Code_t ZCheckIfNotice(ZNotice_t *notice, struct sockaddr_in *from,
202 Code_t ZCheckIfNotice ZP((ZNotice_t *notice, struct sockaddr_in *from, 193 register int (*predicate)(ZNotice_t *, void *),
203 register int (*predicate) ZP((ZNotice_t *,void *)), 194 void *args);
204 void *args)); 195 Code_t ZPeekPacket(char **buffer, int *ret_len, struct sockaddr_in *from);
205 Code_t ZPeekPacket ZP((char **buffer, int *ret_len, 196 Code_t ZPeekNotice(ZNotice_t *notice, struct sockaddr_in *from);
206 struct sockaddr_in *from)); 197 Code_t ZIfNotice(ZNotice_t *notice, struct sockaddr_in *from,
207 Code_t ZPeekNotice ZP((ZNotice_t *notice, struct sockaddr_in *from)); 198 int (*predicate)(ZNotice_t *, void *), void *args);
208 Code_t ZIfNotice ZP((ZNotice_t *notice, struct sockaddr_in *from, 199 Code_t ZSubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port);
209 int (*predicate) ZP((ZNotice_t *, void *)), void *args)); 200 Code_t ZSubscribeToSansDefaults(ZSubscription_t *sublist, int nitems,
210 Code_t ZSubscribeTo ZP((ZSubscription_t *sublist, int nitems, 201 unsigned int port);
211 unsigned int port)); 202 Code_t ZUnsubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port);
212 Code_t ZSubscribeToSansDefaults ZP((ZSubscription_t *sublist, int nitems, 203 Code_t ZCancelSubscriptions(unsigned int port);
213 unsigned int port)); 204 int ZPending(void);
214 Code_t ZUnsubscribeTo ZP((ZSubscription_t *sublist, int nitems, 205 Code_t ZReceiveNotice(ZNotice_t *notice, struct sockaddr_in *from);
215 unsigned int port));
216 Code_t ZCancelSubscriptions ZP((unsigned int port));
217 int ZPending ZP((void));
218 Code_t ZReceiveNotice ZP((ZNotice_t *notice, struct sockaddr_in *from));
219 #ifdef Z_DEBUG 206 #ifdef Z_DEBUG
220 void Z_debug ZP((ZCONST char *, ...)); 207 void Z_debug(const char *, ...);
221 #endif 208 #endif
222
223 #undef ZP
224 209
225 /* Compatibility */ 210 /* Compatibility */
226 #define ZNewLocateUser ZLocateUser 211 #define ZNewLocateUser ZLocateUser
227 212
228 /* Macros to retrieve Zephyr library values. */ 213 /* Macros to retrieve Zephyr library values. */
234 #define ZQLength() __Q_CompleteLength 219 #define ZQLength() __Q_CompleteLength
235 #define ZGetDestAddr() __HM_addr 220 #define ZGetDestAddr() __HM_addr
236 #define ZGetRealm() __Zephyr_realm 221 #define ZGetRealm() __Zephyr_realm
237 222
238 #ifdef Z_DEBUG 223 #ifdef Z_DEBUG
239 void ZSetDebug ZP((void (*)(ZCONST char *, va_list, void *), void *)); 224 void ZSetDebug(void (*)(const char *, va_list, void *), void *);
240 #define ZSetDebug(proc,closure) (__Z_debug_print=(proc), \ 225 #define ZSetDebug(proc,closure) (__Z_debug_print=(proc), \
241 __Z_debug_print_closure=(closure), \ 226 __Z_debug_print_closure=(closure), \
242 (void) 0) 227 (void) 0)
243 #else 228 #else
244 #define ZSetDebug(proc,closure) 229 #define ZSetDebug(proc,closure)

mercurial