libpurple/protocols/zephyr/zephyr_internal.h

changeset 39829
ce056c64e426
parent 39819
3554dac2991b
child 39831
c7e0d1617aae
--- a/libpurple/protocols/zephyr/zephyr_internal.h	Mon Sep 16 19:37:11 2019 -0400
+++ b/libpurple/protocols/zephyr/zephyr_internal.h	Mon Sep 16 19:50:39 2019 -0400
@@ -26,16 +26,7 @@
 #endif
 #endif
 
-/* Use __STDC__ to guess whether we can use stdarg, prototypes, and const.
- * This is a public header file, so autoconf can't help us here. */
-#ifdef __STDC__
-# include <stdarg.h>
-# define ZP(x) x
-# define ZCONST const
-#else
-# define ZP(x) ()
-# define ZCONST
-#endif
+#include <stdarg.h>
 
 #ifdef WIN32
 /* this really should be uint32_t */
@@ -74,7 +65,7 @@
 typedef enum {
     UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK, CLIENTACK, STAT
 } ZNotice_Kind_t;
-extern ZCONST char *ZNoticeKinds[9];
+extern const char *ZNoticeKinds[9];
 
 /* Unique ID format */
 typedef struct {
@@ -138,90 +129,84 @@
 
 /* for ZSetDebug */
 #ifdef Z_DEBUG
-void (*__Z_debug_print) ZP((ZCONST char *fmt, va_list args, void *closure));
+void (*__Z_debug_print)(const char *fmt, va_list args, void *closure);
 void *__Z_debug_print_closure;
 #endif
 
-int ZCompareUIDPred ZP((ZNotice_t *, void *));
-int ZCompareMultiUIDPred ZP((ZNotice_t *, void *));
+int ZCompareUIDPred(ZNotice_t *, void *);
+int ZCompareMultiUIDPred(ZNotice_t *, void *);
 
 /* Defines for ZFormatNotice, et al. */
-typedef Code_t (*Z_AuthProc) ZP((ZNotice_t*, char *, int, int *));
-Code_t ZMakeAuthentication ZP((ZNotice_t*, char *,int, int*));
+typedef Code_t (*Z_AuthProc)(ZNotice_t *, char *, int, int *);
+Code_t ZMakeAuthentication(ZNotice_t *, char *, int, int *);
 
-char *ZGetSender ZP((void));
-char *ZGetVariable ZP((char *));
-Code_t ZSetVariable ZP((char *var, char *value));
-Code_t ZUnsetVariable ZP((char *var));
-int ZGetWGPort ZP((void));
-Code_t ZSetDestAddr ZP((struct sockaddr_in *));
-Code_t ZFormatNoticeList ZP((ZNotice_t*, char**, int,
-			     char **, int*, Z_AuthProc));
-Code_t ZParseNotice ZP((char*, int, ZNotice_t *));
-Code_t ZReadAscii ZP((char*, int, unsigned char*, int));
-Code_t ZReadAscii32 ZP((char *, int, unsigned long *));
-Code_t ZReadAscii16 ZP((char *, int, unsigned short *));
-Code_t ZSendPacket ZP((char*, int, int));
-Code_t ZSendList ZP((ZNotice_t*, char *[], int, Z_AuthProc));
-Code_t ZSrvSendList ZP((ZNotice_t*, char*[], int, Z_AuthProc, Code_t (*)()));
-Code_t ZSendNotice ZP((ZNotice_t *, Z_AuthProc));
-Code_t ZSrvSendNotice ZP((ZNotice_t*, Z_AuthProc, Code_t (*)()));
-Code_t ZFormatNotice ZP((ZNotice_t*, char**, int*, Z_AuthProc));
-Code_t ZFormatSmallNotice ZP((ZNotice_t*, ZPacket_t, int*, Z_AuthProc));
-Code_t ZFormatRawNoticeList ZP((ZNotice_t *notice, char *list[], int nitems,
-				char **buffer, int *ret_len));
-Code_t ZLocateUser ZP((char *, int *, Z_AuthProc));
-Code_t ZRequestLocations ZP((const char *, ZAsyncLocateData_t *,
-			     ZNotice_Kind_t, Z_AuthProc));
-Code_t ZhmStat ZP((struct in_addr *, ZNotice_t *));
-Code_t ZInitialize ZP((void));
-Code_t ZSetServerState ZP((int));
-Code_t ZSetFD ZP((int));
-Code_t ZFormatSmallRawNotice ZP((ZNotice_t*, ZPacket_t, int*));
-int ZCompareUID ZP((ZUnique_Id_t*, ZUnique_Id_t*));
-Code_t ZMakeAscii ZP((char*, int, unsigned char*, int));
-Code_t ZMakeAscii32 ZP((char *, int, unsigned long));
-Code_t ZMakeAscii16 ZP((char *, int, unsigned int));
-Code_t ZReceivePacket ZP((ZPacket_t, int*, struct sockaddr_in*));
-Code_t ZCheckAuthentication ZP((ZNotice_t*, struct sockaddr_in*));
-Code_t ZSetLocation ZP((char *exposure));
-Code_t ZUnsetLocation ZP((void));
-Code_t ZFlushMyLocations ZP((void));
-Code_t ZFormatRawNotice ZP((ZNotice_t *, char**, int *));
-Code_t ZRetrieveSubscriptions ZP((unsigned short, int*));
-Code_t ZOpenPort ZP((unsigned short *port));
-Code_t ZClosePort ZP((void));
-Code_t ZFlushLocations ZP((void));
-Code_t ZFlushSubscriptions ZP((void));
-Code_t ZFreeNotice ZP((ZNotice_t *notice));
-Code_t ZParseLocations ZP((register ZNotice_t *notice,
-			   register ZAsyncLocateData_t *zald, int *nlocs,
-			   char **user));
-int ZCompareALDPred ZP((ZNotice_t *notice, void *zald));
-void ZFreeALD ZP((register ZAsyncLocateData_t *zald));
-Code_t ZCheckIfNotice ZP((ZNotice_t *notice, struct sockaddr_in *from,
-			  register int (*predicate) ZP((ZNotice_t *,void *)),
-			  void *args));
-Code_t ZPeekPacket ZP((char **buffer, int *ret_len,
-		       struct sockaddr_in *from));
-Code_t ZPeekNotice ZP((ZNotice_t *notice, struct sockaddr_in *from));
-Code_t ZIfNotice ZP((ZNotice_t *notice, struct sockaddr_in *from,
-		     int (*predicate) ZP((ZNotice_t *, void *)), void *args));
-Code_t ZSubscribeTo ZP((ZSubscription_t *sublist, int nitems,
-			unsigned int port));
-Code_t ZSubscribeToSansDefaults ZP((ZSubscription_t *sublist, int nitems,
-				    unsigned int port));
-Code_t ZUnsubscribeTo ZP((ZSubscription_t *sublist, int nitems,
-			  unsigned int port));
-Code_t ZCancelSubscriptions ZP((unsigned int port));
-int ZPending ZP((void));
-Code_t ZReceiveNotice ZP((ZNotice_t *notice, struct sockaddr_in *from));
+char *ZGetSender(void);
+char *ZGetVariable(char *);
+Code_t ZSetVariable(char *var, char *value);
+Code_t ZUnsetVariable(char *var);
+int ZGetWGPort(void);
+Code_t ZSetDestAddr(struct sockaddr_in *);
+Code_t ZFormatNoticeList(ZNotice_t *, char **, int, char **, int *, Z_AuthProc);
+Code_t ZParseNotice(char *, int, ZNotice_t *);
+Code_t ZReadAscii(char *, int, unsigned char *, int);
+Code_t ZReadAscii32(char *, int, unsigned long *);
+Code_t ZReadAscii16(char *, int, unsigned short *);
+Code_t ZSendPacket(char *, int, int);
+Code_t ZSendList(ZNotice_t *, char *[], int, Z_AuthProc);
+Code_t ZSrvSendList(ZNotice_t *, char *[], int, Z_AuthProc, Code_t (*)());
+Code_t ZSendNotice(ZNotice_t *, Z_AuthProc);
+Code_t ZSrvSendNotice(ZNotice_t *, Z_AuthProc, Code_t (*)());
+Code_t ZFormatNotice(ZNotice_t *, char **, int *, Z_AuthProc);
+Code_t ZFormatSmallNotice(ZNotice_t *, ZPacket_t, int *, Z_AuthProc);
+Code_t ZFormatRawNoticeList(ZNotice_t *notice, char *list[], int nitems,
+                            char **buffer, int *ret_len);
+Code_t ZLocateUser(char *, int *, Z_AuthProc);
+Code_t ZRequestLocations(const char *, ZAsyncLocateData_t *, ZNotice_Kind_t,
+                         Z_AuthProc);
+Code_t ZhmStat(struct in_addr *, ZNotice_t *);
+Code_t ZInitialize(void);
+Code_t ZSetServerState(int);
+Code_t ZSetFD(int);
+Code_t ZFormatSmallRawNotice(ZNotice_t *, ZPacket_t, int *);
+int ZCompareUID(ZUnique_Id_t *, ZUnique_Id_t *);
+Code_t ZMakeAscii(char *, int, unsigned char *, int);
+Code_t ZMakeAscii32(char *, int, unsigned long);
+Code_t ZMakeAscii16(char *, int, unsigned int);
+Code_t ZReceivePacket(ZPacket_t, int *, struct sockaddr_in *);
+Code_t ZCheckAuthentication(ZNotice_t *, struct sockaddr_in *);
+Code_t ZSetLocation(char *exposure);
+Code_t ZUnsetLocation(void);
+Code_t ZFlushMyLocations(void);
+Code_t ZFormatRawNotice(ZNotice_t *, char **, int *);
+Code_t ZRetrieveSubscriptions(unsigned short, int *);
+Code_t ZOpenPort(unsigned short *port);
+Code_t ZClosePort(void);
+Code_t ZFlushLocations(void);
+Code_t ZFlushSubscriptions(void);
+Code_t ZFreeNotice(ZNotice_t *notice);
+Code_t ZParseLocations(register ZNotice_t *notice,
+                       register ZAsyncLocateData_t *zald, int *nlocs,
+                       char **user);
+int ZCompareALDPred(ZNotice_t *notice, void *zald);
+void ZFreeALD(register ZAsyncLocateData_t *zald);
+Code_t ZCheckIfNotice(ZNotice_t *notice, struct sockaddr_in *from,
+                      register int (*predicate)(ZNotice_t *, void *),
+                      void *args);
+Code_t ZPeekPacket(char **buffer, int *ret_len, struct sockaddr_in *from);
+Code_t ZPeekNotice(ZNotice_t *notice, struct sockaddr_in *from);
+Code_t ZIfNotice(ZNotice_t *notice, struct sockaddr_in *from,
+                 int (*predicate)(ZNotice_t *, void *), void *args);
+Code_t ZSubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port);
+Code_t ZSubscribeToSansDefaults(ZSubscription_t *sublist, int nitems,
+                                unsigned int port);
+Code_t ZUnsubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port);
+Code_t ZCancelSubscriptions(unsigned int port);
+int ZPending(void);
+Code_t ZReceiveNotice(ZNotice_t *notice, struct sockaddr_in *from);
 #ifdef Z_DEBUG
-void Z_debug ZP((ZCONST char *, ...));
+void Z_debug(const char *, ...);
 #endif
 
-#undef ZP
-
 /* Compatibility */
 #define	ZNewLocateUser ZLocateUser
 
@@ -236,7 +221,7 @@
 #define ZGetRealm()	__Zephyr_realm
 
 #ifdef Z_DEBUG
-void ZSetDebug ZP((void (*)(ZCONST char *, va_list, void *), void *));
+void ZSetDebug(void (*)(const char *, va_list, void *), void *);
 #define ZSetDebug(proc,closure)    (__Z_debug_print=(proc), \
 				    __Z_debug_print_closure=(closure), \
 				    (void) 0)

mercurial