Mon, 22 Aug 2022 21:40:04 -0500
Inline pidgin_make_scrollable
We need to change it for GTK4, and there are few enough that it can be inlined. Eventually, that code might be a `.ui` anyway.
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/1615/
| 2086 | 1 | /* This file is part of the Project Athena Zephyr Notification System. |
| 2 | * It contains global definitions | |
| 3 | * | |
| 4 | * Created by: Robert French | |
| 5 | * | |
| 6 | * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of | |
| 7 | * Technology. For copying and distribution information, see the | |
| 8 | * file "mit-copyright.h". | |
| 9 | */ | |
| 10 | ||
|
39819
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
11 | #ifndef PURPLE_ZEPHYR_ZEPHYR_INTERNAL_H |
|
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
12 | #define PURPLE_ZEPHYR_ZEPHYR_INTERNAL_H |
| 2086 | 13 | |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
39831
diff
changeset
|
14 | #ifdef HAVE_CONFIG_H |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
39831
diff
changeset
|
15 | # include <config.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
39831
diff
changeset
|
16 | #endif |
| 2086 | 17 | |
|
14253
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
12424
diff
changeset
|
18 | #include <glib.h> |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
19 | #include <gio/gio.h> |
|
14253
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
12424
diff
changeset
|
20 | |
| 2086 | 21 | #include <sys/types.h> |
| 22 | #include <sys/time.h> | |
| 23 | ||
| 10867 | 24 | #include <zephyr_err.h> |
| 2086 | 25 | |
| 26 | #ifndef IPPROTO_MAX /* Make sure not already included */ | |
| 10867 | 27 | #ifndef WIN32 |
| 2086 | 28 | #include <netinet/in.h> |
| 29 | #endif | |
| 10867 | 30 | #endif |
| 2086 | 31 | |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
32 | #include <stdarg.h> |
| 2086 | 33 | |
| 10867 | 34 | #ifdef WIN32 |
| 35 | /* this really should be uint32_t */ | |
| 36 | /*typedef unsigned int in_addr_t; | |
| 37 | struct in_addr | |
| 38 | { | |
| 39 | in_addr_t s_addr; | |
| 40 | }; */ | |
| 41 | #include <winsock2.h> | |
| 42 | #endif | |
| 43 | ||
| 2086 | 44 | /* Service names */ |
| 45 | #define HM_SVCNAME "zephyr-hm" | |
| 46 | #define HM_SRV_SVCNAME "zephyr-hm-srv" | |
| 47 | #define SERVER_SVCNAME "zephyr-clt" | |
| 48 | #define SERVER_SERVICE "zephyr" | |
| 49 | #define SERVER_INSTANCE "zephyr" | |
| 50 | ||
| 51 | #define ZVERSIONHDR "ZEPH" | |
| 52 | #define ZVERSIONMAJOR 0 | |
| 53 | #define ZVERSIONMINOR 2 | |
| 54 | ||
| 55 | #define Z_MAXPKTLEN 1024 | |
| 56 | #define Z_MAXHEADERLEN 800 | |
| 57 | #define Z_MAXOTHERFIELDS 10 /* Max unknown fields in ZNotice_t */ | |
| 58 | #define Z_NUMFIELDS 17 | |
| 59 | ||
| 60 | /* Authentication levels returned by ZCheckAuthentication */ | |
| 61 | #define ZAUTH_FAILED (-1) | |
| 62 | #define ZAUTH_YES 1 | |
| 63 | #define ZAUTH_NO 0 | |
| 64 | ||
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
65 | #define SERVER_SVC_FALLBACK (2103) |
|
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
66 | #define HM_SVC_FALLBACK (2104) |
|
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
67 | #define HM_SRV_SVC_FALLBACK (2105) |
|
40633
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
68 | |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
69 | #define ZAUTH_UNSET (-3) /* Internal to client library. */ |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
70 | #define Z_MAXFRAGS 500 /* Max number of packet fragments */ |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
71 | #define Z_MAXNOTICESIZE 400000 /* Max size of incoming notice */ |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
72 | #define Z_MAXQUEUESIZE 1500000 /* Max size of input queue notices */ |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
73 | #define Z_FRAGFUDGE 13 /* Room to for multinotice field */ |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
74 | #define Z_NOTICETIMELIMIT 30 /* Time to wait for fragments */ |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
75 | #define Z_INITFILTERSIZE 30 /* Starting size of uid filter */ |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
76 | |
| 2086 | 77 | typedef char ZPacket_t[Z_MAXPKTLEN]; |
| 78 | ||
| 79 | /* Packet type */ | |
| 80 | typedef enum { | |
| 81 | UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK, CLIENTACK, STAT | |
| 82 | } ZNotice_Kind_t; | |
| 83 | ||
| 84 | /* Unique ID format */ | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24672
diff
changeset
|
85 | typedef struct { |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
86 | guint32 zuid_addr; |
| 2086 | 87 | struct timeval tv; |
| 88 | } ZUnique_Id_t; | |
| 89 | ||
| 90 | /* Checksum */ | |
| 91 | typedef unsigned long ZChecksum_t; | |
| 92 | ||
| 93 | /* Notice definition */ | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24672
diff
changeset
|
94 | typedef struct { |
| 2086 | 95 | char *z_packet; |
| 96 | char *z_version; | |
| 97 | ZNotice_Kind_t z_kind; | |
| 98 | ZUnique_Id_t z_uid; | |
| 99 | #define z_sender_addr z_uid.zuid_addr | |
| 100 | struct timeval z_time; | |
| 101 | unsigned short z_port; | |
| 102 | int z_auth; | |
| 103 | int z_checked_auth; | |
| 104 | int z_authent_len; | |
| 105 | char *z_ascii_authent; | |
| 106 | char *z_class; | |
|
12424
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
107 | const char *z_class_inst; |
| 2086 | 108 | char *z_opcode; |
| 109 | char *z_sender; | |
| 5136 | 110 | const char *z_recipient; |
| 2086 | 111 | char *z_default_format; |
| 112 | char *z_multinotice; | |
| 113 | ZUnique_Id_t z_multiuid; | |
| 114 | ZChecksum_t z_checksum; | |
| 115 | int z_num_other_fields; | |
| 116 | char *z_other_fields[Z_MAXOTHERFIELDS]; | |
|
17469
9b5eb283f01c
Another change from o_sukhodolsky:
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
117 | caddr_t z_message; |
| 2086 | 118 | int z_message_len; |
| 119 | } ZNotice_t; | |
| 120 | ||
| 121 | /* Subscription structure */ | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24672
diff
changeset
|
122 | typedef struct { |
| 2086 | 123 | char *zsub_recipient; |
| 124 | char *zsub_class; | |
| 125 | char *zsub_classinst; | |
| 126 | } ZSubscription_t; | |
| 127 | ||
| 128 | /* Function return code */ | |
| 129 | typedef int Code_t; | |
| 130 | ||
| 131 | /* Locations structure */ | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24672
diff
changeset
|
132 | typedef struct { |
| 2086 | 133 | char *host; |
| 134 | char *time; | |
| 135 | char *tty; | |
| 136 | } ZLocations_t; | |
| 137 | ||
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24672
diff
changeset
|
138 | typedef struct { |
| 2086 | 139 | char *user; |
| 140 | ZUnique_Id_t uid; | |
| 141 | char *version; | |
| 142 | } ZAsyncLocateData_t; | |
| 143 | ||
|
40633
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
144 | typedef struct { |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
145 | gint first; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
146 | gint last; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
147 | } Z_Hole; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
148 | |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
149 | typedef struct { |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
150 | ZNotice_Kind_t kind; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
151 | gint64 time; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
152 | gint packet_len; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
153 | gchar *packet; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
154 | gboolean complete; |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
155 | GSocketAddress *from; |
|
40633
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
156 | GSList *holelist; /* element-type: Z_Hole* */ |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
157 | ZUnique_Id_t uid; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
158 | int auth; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
159 | gint header_len; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
160 | gchar *header; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
161 | gint msg_len; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
162 | gchar *msg; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
163 | } Z_InputQ; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
164 | |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
165 | int ZCompareUIDPred(ZNotice_t *, void *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
166 | int ZCompareMultiUIDPred(ZNotice_t *, void *); |
| 2086 | 167 | |
| 168 | /* Defines for ZFormatNotice, et al. */ | |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
169 | typedef Code_t (*Z_AuthProc)(ZNotice_t *, char *, int, int *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
170 | Code_t ZMakeAuthentication(ZNotice_t *, char *, int, int *); |
| 2086 | 171 | |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
172 | char *ZGetSender(void); |
|
39831
c7e0d1617aae
zephyr: Fix const-ness of variable loading.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39829
diff
changeset
|
173 | const gchar *ZGetVariable(const gchar *); |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
174 | Code_t ZSetVariable(char *var, char *value); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
175 | Code_t ZUnsetVariable(char *var); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
176 | int ZGetWGPort(void); |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
177 | Code_t ZSetDestAddr(GSocketAddress *); |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
178 | Code_t ZFormatNoticeList(ZNotice_t *, char **, int, char **, int *, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
179 | Code_t ZParseNotice(char *, int, ZNotice_t *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
180 | Code_t ZReadAscii(char *, int, unsigned char *, int); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
181 | Code_t ZReadAscii32(char *, int, unsigned long *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
182 | Code_t ZReadAscii16(char *, int, unsigned short *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
183 | Code_t ZSendPacket(char *, int, int); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
184 | Code_t ZSendList(ZNotice_t *, char *[], int, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
185 | Code_t ZSrvSendList(ZNotice_t *, char *[], int, Z_AuthProc, Code_t (*)()); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
186 | Code_t ZSendNotice(ZNotice_t *, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
187 | Code_t ZSrvSendNotice(ZNotice_t *, Z_AuthProc, Code_t (*)()); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
188 | Code_t ZFormatNotice(ZNotice_t *, char **, int *, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
189 | Code_t ZFormatSmallNotice(ZNotice_t *, ZPacket_t, int *, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
190 | Code_t ZFormatRawNoticeList(ZNotice_t *notice, char *list[], int nitems, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
191 | char **buffer, int *ret_len); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
192 | Code_t ZLocateUser(char *, int *, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
193 | Code_t ZRequestLocations(const char *, ZAsyncLocateData_t *, ZNotice_Kind_t, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
194 | Z_AuthProc); |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
195 | Code_t ZhmStat(ZNotice_t *); |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
196 | Code_t ZInitialize(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
197 | Code_t ZFormatSmallRawNotice(ZNotice_t *, ZPacket_t, int *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
198 | int ZCompareUID(ZUnique_Id_t *, ZUnique_Id_t *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
199 | Code_t ZMakeAscii(char *, int, unsigned char *, int); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
200 | Code_t ZMakeAscii32(char *, int, unsigned long); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
201 | Code_t ZMakeAscii16(char *, int, unsigned int); |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
202 | Code_t ZReceivePacket(ZPacket_t, int *, GSocketAddress **); |
|
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
203 | Code_t ZCheckAuthentication(ZNotice_t *); |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
204 | Code_t ZSetLocation(char *exposure); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
205 | Code_t ZUnsetLocation(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
206 | Code_t ZFlushMyLocations(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
207 | Code_t ZFormatRawNotice(ZNotice_t *, char **, int *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
208 | Code_t ZRetrieveSubscriptions(unsigned short, int *); |
|
40657
4942603c98ae
Move libzephyr declarations to zephyr_internal.h
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40643
diff
changeset
|
209 | Code_t ZGetSubscriptions(ZSubscription_t *, int *); |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
210 | Code_t ZOpenPort(unsigned short *port); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
211 | Code_t ZClosePort(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
212 | Code_t ZFlushLocations(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
213 | Code_t ZFlushSubscriptions(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
214 | Code_t ZFreeNotice(ZNotice_t *notice); |
|
40657
4942603c98ae
Move libzephyr declarations to zephyr_internal.h
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40643
diff
changeset
|
215 | Code_t ZGetLocations(ZLocations_t *, int *); |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
216 | Code_t ZParseLocations(register ZNotice_t *notice, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
217 | register ZAsyncLocateData_t *zald, int *nlocs, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
218 | char **user); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
219 | int ZCompareALDPred(ZNotice_t *notice, void *zald); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
220 | void ZFreeALD(register ZAsyncLocateData_t *zald); |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
221 | Code_t ZCheckIfNotice(ZNotice_t *notice, GSocketAddress **from, |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
222 | register int (*predicate)(ZNotice_t *, void *), |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
223 | void *args); |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
224 | Code_t ZPeekPacket(char **buffer, int *ret_len, GSocketAddress **from); |
|
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
225 | Code_t ZPeekNotice(ZNotice_t *notice, GSocketAddress **from); |
|
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
226 | Code_t ZIfNotice(ZNotice_t *notice, GSocketAddress **from, |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
227 | int (*predicate)(ZNotice_t *, void *), void *args); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
228 | Code_t ZSubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
229 | Code_t ZSubscribeToSansDefaults(ZSubscription_t *sublist, int nitems, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
230 | unsigned int port); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
231 | Code_t ZUnsubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
232 | Code_t ZCancelSubscriptions(unsigned int port); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
233 | int ZPending(void); |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
234 | Code_t ZReceiveNotice(ZNotice_t *notice, GSocketAddress **from); |
| 2086 | 235 | |
|
40633
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
236 | typedef Code_t (*Z_SendProc)(ZNotice_t *, char *, int, int); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
237 | |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
238 | Z_InputQ *Z_GetFirstComplete(void); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
239 | Z_InputQ *Z_GetNextComplete(Z_InputQ *); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
240 | Code_t Z_XmitFragment(ZNotice_t *, char *, int, int); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
241 | void Z_RemQueue(Z_InputQ *); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
242 | Code_t Z_AddNoticeToEntry(Z_InputQ *, ZNotice_t *, int); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
243 | Code_t Z_FormatAuthHeader(ZNotice_t *, char *, int, int *, Z_AuthProc); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
244 | Code_t Z_FormatHeader(ZNotice_t *, char *, int, int *, Z_AuthProc); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
245 | Code_t Z_FormatRawHeader(ZNotice_t *, char *, gsize, int *, char **, char **); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
246 | Code_t Z_ReadEnqueue(void); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
247 | Code_t Z_ReadWait(void); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
248 | Code_t Z_SendLocation(char *, char *, Z_AuthProc, char *); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
249 | Code_t Z_SendFragmentedNotice(ZNotice_t *notice, int len, Z_AuthProc cert_func, |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
250 | Z_SendProc send_func); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
251 | Code_t Z_WaitForComplete(void); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
252 | Code_t Z_WaitForNotice(ZNotice_t *notice, int (*pred)(ZNotice_t *, void *), |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
253 | void *arg, int timeout); |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
254 | |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
255 | extern GQueue Z_input_queue; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
256 | |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
257 | extern ZLocations_t *__locate_list; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
258 | extern int __locate_num; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
259 | extern int __locate_next; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
260 | |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
261 | extern ZSubscription_t *__subscriptions_list; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
262 | extern int __subscriptions_num; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
263 | extern int __subscriptions_next; |
|
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
264 | |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
265 | extern gint __Zephyr_port; /* Port number */ |
|
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
266 | extern guint32 __My_addr; |
|
40633
d884c4b6e202
Fix build with external libzephyr.
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40624
diff
changeset
|
267 | |
| 2086 | 268 | /* Macros to retrieve Zephyr library values. */ |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
269 | extern GSocket *__Zephyr_socket; |
| 2086 | 270 | extern int __Q_CompleteLength; |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
271 | extern GSocketAddress *__HM_addr; |
| 2086 | 272 | extern char __Zephyr_realm[]; |
|
40643
1c9bdf8d3e85
Convert zephyr to gio
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40633
diff
changeset
|
273 | #define ZGetSocket() __Zephyr_socket |
| 2086 | 274 | #define ZQLength() __Q_CompleteLength |
| 275 | #define ZGetDestAddr() __HM_addr | |
| 276 | #define ZGetRealm() __Zephyr_realm | |
| 277 | ||
| 278 | /* Maximum queue length */ | |
| 279 | #define Z_MAXQLEN 30 | |
| 280 | ||
| 281 | /* Successful function return */ | |
| 282 | #define ZERR_NONE 0 | |
| 283 | ||
| 284 | /* Hostmanager wait time (in secs) */ | |
| 10867 | 285 | #define HM_TIMEOUT 1 |
| 2086 | 286 | |
| 287 | /* Server wait time (in secs) */ | |
| 288 | #define SRV_TIMEOUT 30 | |
| 289 | ||
| 290 | #define ZAUTH (ZMakeAuthentication) | |
| 291 | #define ZNOAUTH ((Z_AuthProc)0) | |
| 292 | ||
| 293 | /* Packet strings */ | |
| 294 | #define ZSRVACK_SENT "SENT" /* SERVACK codes */ | |
| 295 | #define ZSRVACK_NOTSENT "LOST" | |
| 296 | #define ZSRVACK_FAIL "FAIL" | |
| 297 | ||
| 298 | /* Server internal class */ | |
| 299 | #define ZEPHYR_ADMIN_CLASS "ZEPHYR_ADMIN" /* Class */ | |
| 300 | ||
| 301 | /* Control codes sent to a server */ | |
| 302 | #define ZEPHYR_CTL_CLASS "ZEPHYR_CTL" /* Class */ | |
| 303 | ||
| 304 | #define ZEPHYR_CTL_CLIENT "CLIENT" /* Inst: From client */ | |
| 305 | #define CLIENT_SUBSCRIBE "SUBSCRIBE" /* Opcode: Subscribe */ | |
| 306 | #define CLIENT_SUBSCRIBE_NODEFS "SUBSCRIBE_NODEFS" /* Opcode: Subscribe */ | |
| 307 | #define CLIENT_UNSUBSCRIBE "UNSUBSCRIBE" /* Opcode: Unsubsubscribe */ | |
| 308 | #define CLIENT_CANCELSUB "CLEARSUB" /* Opcode: Clear all subs */ | |
| 309 | #define CLIENT_GIMMESUBS "GIMME" /* Opcode: Give me subs */ | |
| 310 | #define CLIENT_GIMMEDEFS "GIMMEDEFS" /* Opcode: Give me default | |
| 311 | * subscriptions */ | |
| 312 | ||
| 313 | #define ZEPHYR_CTL_HM "HM" /* Inst: From HM */ | |
| 314 | #define HM_BOOT "BOOT" /* Opcode: Boot msg */ | |
| 315 | #define HM_FLUSH "FLUSH" /* Opcode: Flush me */ | |
| 316 | #define HM_DETACH "DETACH" /* Opcode: Detach me */ | |
| 317 | #define HM_ATTACH "ATTACH" /* Opcode: Attach me */ | |
| 318 | ||
| 319 | /* Control codes send to a HostManager */ | |
| 320 | #define HM_CTL_CLASS "HM_CTL" /* Class */ | |
| 321 | ||
| 322 | #define HM_CTL_SERVER "SERVER" /* Inst: From server */ | |
| 323 | #define SERVER_SHUTDOWN "SHUTDOWN" /* Opcode: Server shutdown */ | |
| 324 | #define SERVER_PING "PING" /* Opcode: PING */ | |
| 325 | ||
| 326 | #define HM_CTL_CLIENT "CLIENT" /* Inst: From client */ | |
| 327 | #define CLIENT_FLUSH "FLUSH" /* Opcode: Send flush to srv */ | |
| 328 | #define CLIENT_NEW_SERVER "NEWSERV" /* Opcode: Find new server */ | |
| 329 | ||
| 330 | /* HM Statistics */ | |
| 331 | #define HM_STAT_CLASS "HM_STAT" /* Class */ | |
| 332 | ||
| 333 | #define HM_STAT_CLIENT "HMST_CLIENT" /* Inst: From client */ | |
| 334 | #define HM_GIMMESTATS "GIMMESTATS" /* Opcode: get stats */ | |
| 335 | ||
| 336 | /* Login class messages */ | |
| 337 | #define LOGIN_CLASS "LOGIN" /* Class */ | |
| 338 | ||
| 339 | /* Class Instance is principal of user who is logging in or logging out */ | |
| 340 | ||
| 341 | #define EXPOSE_NONE "NONE" /* Opcode: Not visible */ | |
| 342 | #define EXPOSE_OPSTAFF "OPSTAFF" /* Opcode: Opstaff visible */ | |
| 343 | #define EXPOSE_REALMVIS "REALM-VISIBLE" /* Opcode: Realm visible */ | |
| 344 | #define EXPOSE_REALMANN "REALM-ANNOUNCED"/* Opcode: Realm announced */ | |
| 345 | #define EXPOSE_NETVIS "NET-VISIBLE" /* Opcode: Net visible */ | |
| 346 | #define EXPOSE_NETANN "NET-ANNOUNCED" /* Opcode: Net announced */ | |
| 347 | #define LOGIN_USER_LOGIN "USER_LOGIN" /* Opcode: user login | |
| 348 | (from server) */ | |
| 349 | #define LOGIN_USER_LOGOUT "USER_LOGOUT" /* Opcode: User logout */ | |
| 350 | #define LOGIN_USER_FLUSH "USER_FLUSH" /* Opcode: flush all locs */ | |
| 351 | ||
| 352 | /* Locate class messages */ | |
| 353 | #define LOCATE_CLASS "USER_LOCATE" /* Class */ | |
| 354 | ||
| 355 | #define LOCATE_HIDE "USER_HIDE" /* Opcode: Hide me */ | |
| 356 | #define LOCATE_UNHIDE "USER_UNHIDE" /* Opcode: Unhide me */ | |
| 357 | ||
| 358 | /* Class Instance is principal of user to locate */ | |
| 359 | #define LOCATE_LOCATE "LOCATE" /* Opcode: Locate user */ | |
| 360 | ||
| 361 | /* WG_CTL class messages */ | |
| 362 | #define WG_CTL_CLASS "WG_CTL" /* Class */ | |
| 363 | ||
| 364 | #define WG_CTL_USER "USER" /* Inst: User request */ | |
| 365 | #define USER_REREAD "REREAD" /* Opcode: Reread desc file */ | |
| 366 | #define USER_SHUTDOWN "SHUTDOWN" /* Opcode: Go catatonic */ | |
| 367 | #define USER_STARTUP "STARTUP" /* Opcode: Come out of it */ | |
| 2419 | 368 | #define USER_EXIT "EXIT" /* Opcode: Exit the client */ |
| 2086 | 369 | |
|
39819
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
370 | #endif /* PURPLE_ZEPHYR_ZEPHYR_INTERNAL_H */ |