Mercurial > pidgin
annotate src/protocols/gg/libgg.h @ 4111:ee884f1d7ae3
[gaim-migrate @ 4326]
<Robot101> adds a gc->flag called OPT_CONN_AUTO_RESP so that
gc->away can always store the away message even if
the prpl doesn't support autoresponding
<Robot101> makes all protos correctly free and set gc->away to
avoid leaks
<Robot101> stores the current away state in gc->away_state
whenever gc->away is non-NULL (ie it's not just a
plain on-line)
<Robot101> also minor change to Jabber to make Chatty an away
state, and to Gadu-Gadu to make some other thing an
away state too
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 21 Dec 2002 19:33:54 +0000 |
parents | 7a3f16a375a5 |
children | 5239a3b4ab33 |
rev | line source |
---|---|
3466 | 1 /* $Id: libgg.h 3516 2002-08-29 01:47:15Z seanegan $ */ |
2393 | 2 |
3 /* | |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
4 * (C) Copyright 2001 Wojtek Kaniewski <wojtekka@irc.pl>, |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
5 * Robert J. Woźny <speedy@ziew.org> |
2393 | 6 * |
7 * This program is free software; you can redistribute it and/or modify | |
8 * it under the terms of the GNU General Public License Version 2 as | |
9 * published by the Free Software Foundation. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 */ | |
20 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
21 #ifndef __GG_LIBGG_H |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
22 #define __GG_LIBGG_H |
2393 | 23 |
24 #ifdef __cplusplus | |
25 extern "C" { | |
26 #endif | |
27 | |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
28 #if defined(sun) && !defined(INADDR_NONE) |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
29 #define INADDR_NONE 0xffffffff |
2475
ba7ee4c1908c
[gaim-migrate @ 2488]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2399
diff
changeset
|
30 #endif |
ba7ee4c1908c
[gaim-migrate @ 2488]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2399
diff
changeset
|
31 |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
32 #include <sys/types.h> |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
33 |
2393 | 34 /* |
35 * typ zmiennej określającej numerek danej osoby. | |
36 */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
37 typedef unsigned long uin_t; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
38 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
39 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
40 * struktura opisująca daną sesję. tworzona przez gg_login(). |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
41 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
42 struct gg_session { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
43 int fd; /* podglądany deskryptor */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
44 int check; /* sprawdzamy zapis czy odczyt */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
45 int state; /* aktualny stan maszynki */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
46 int error; /* kod błędu dla GG_STATE_ERROR */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
47 int type; /* rodzaj sesji. == GG_SESSION_GG */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
48 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
49 int async; /* czy połączenie jest asynchroniczne */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
50 int pid; /* pid procesu resolvera */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
51 int port; /* port, z którym się łączymy */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
52 int seq; /* numer sekwencyjny ostatniej wiadomości */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
53 int last_pong; /* czas otrzymania ostatniego ping/pong */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
54 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
55 unsigned int server_ip; /* adres serwera */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
56 unsigned int client_ip; /* adres klienta */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
57 int client_port; /* port, na którym klient słucha */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
58 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
59 uin_t uin; /* numerek klienta */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
60 char *password; /* i jego hasło. zwalniane automagicznie */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
61 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
62 int initial_status; /* początkowy stan klienta */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
63 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
64 char *recv_buf; /* bufor na otrzymywane pakiety */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
65 int recv_done; /* ile już wczytano do bufora */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
66 int recv_left; /* i ile jeszcze trzeba wczytać */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
67 }; |
2393 | 68 |
69 /* | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
70 * ogólna struktura opisująca stan wszystkich operacji http. |
2393 | 71 */ |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
72 struct gg_http { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
73 int fd; /* podglądany deskryptor */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
74 int check; /* sprawdzamy zapis czy odczyt */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
75 int state; /* aktualny stan maszynki */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
76 int error; /* kod błędu dla GG_STATE_ERROR */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
77 int type; /* rodzaj sesji. == GG_SESSION_HTTP */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
78 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
79 int async; /* czy połączenie asynchroniczne */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
80 int pid; /* pid procesu resolvera */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
81 int port; /* port, z którym się łączymy */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
82 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
83 char *query; /* bufor zapytania http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
84 char *header; /* bufor nagłówka */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
85 int header_size; /* rozmiar wczytanego nagłówka */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
86 char *body; /* bufor otrzymanych informacji */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
87 int body_size; /* ilość informacji */ |
2393 | 88 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
89 void *data; /* dane danej operacji http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
90 }; |
2393 | 91 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
92 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
93 * ogólna struktura opisująca różne sesje. przydatna w klientach. |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
94 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
95 struct gg_common { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
96 int fd; /* podglądany deskryptor */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
97 int check; /* sprawdzamy zapis czy odczyt */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
98 int state; /* aktualny stan maszynki */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
99 int error; /* kod błędu dla GG_STATE_ERROR */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
100 int type; /* rodzaj sesji */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
101 }; |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
102 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
103 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
104 * rodzaje sesji. |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
105 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
106 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
107 GG_SESSION_GG = 1, /* połączenie z serwerem gg */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
108 GG_SESSION_HTTP, /* ogólna sesja http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
109 GG_SESSION_SEARCH, /* szukanie */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
110 GG_SESSION_REGISTER, /* rejestrowanie */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
111 }; |
2393 | 112 |
113 /* | |
114 * różne stany asynchronicznej maszynki. | |
115 */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
116 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
117 /* wspólne */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
118 GG_STATE_IDLE = 0, /* nie powinno wystąpić. */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
119 GG_STATE_RESOLVING, /* wywołał gethostbyname() */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
120 GG_STATE_CONNECTING, /* wywołał connect() */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
121 GG_STATE_READING_DATA, /* czeka na dane http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
122 GG_STATE_ERROR, /* wystąpił błąd. kod w x->error */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
123 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
124 /* gg_session */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
125 GG_STATE_CONNECTING_GG, /* wywołał connect() */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
126 GG_STATE_READING_KEY, /* czeka na klucz */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
127 GG_STATE_READING_REPLY, /* czeka na odpowiedź */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
128 GG_STATE_CONNECTED, /* połączył się */ |
2393 | 129 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
130 /* gg_http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
131 GG_STATE_READING_HEADER, /* czeka na nagłówek http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
132 GG_STATE_PARSING, /* przetwarza dane */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
133 GG_STATE_DONE, /* skończył */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
134 }; |
2393 | 135 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
136 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
137 * dla zachowania kompatybilności wstecz. w wersji 1.0 będzie usunięte. oby. |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
138 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
139 #define GG_STATE_WRITING_HTTP GG_STATE_READING_DATA |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
140 #define GG_STATE_WAITING_FOR_KEY GG_STATE_READING_KEY |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
141 #define GG_STATE_SENDING_KEY GG_STATE_READING_REPLY |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
142 #define GG_STATE_FINISHED GG_STATE_DONE |
2393 | 143 |
144 /* | |
145 * co proces klienta powinien sprawdzać w deskryptorach? | |
146 */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
147 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
148 GG_CHECK_NONE = 0, /* nic. nie powinno wystąpić */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
149 GG_CHECK_WRITE = 1, /* sprawdzamy możliwość zapisu */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
150 GG_CHECK_READ = 2, /* sprawdzamy możliwość odczytu */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
151 }; |
2393 | 152 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
153 struct gg_session *gg_login(uin_t uin, char *password, int async); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
154 void gg_free_session(struct gg_session *sess); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
155 void gg_logoff(struct gg_session *sess); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
156 int gg_change_status(struct gg_session *sess, int status); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
157 int gg_send_message(struct gg_session *sess, int msgclass, uin_t recipient, unsigned char *message); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
158 int gg_ping(struct gg_session *sess); |
2393 | 159 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
160 struct gg_notify_reply { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
161 uin_t uin; /* numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
162 unsigned long status; /* status danej osoby */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
163 unsigned long remote_ip; /* adres ip delikwenta */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
164 unsigned short remote_port; /* port, na którym słucha klient */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
165 unsigned long version; /* == 0x0b */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
166 unsigned short dunno2; /* znowu port? */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
167 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
168 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
169 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
170 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
171 ; |
2393 | 172 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
173 struct gg_status { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
174 uin_t uin; /* numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
175 unsigned long status; /* nowy stan */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
176 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
177 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
178 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
179 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
180 ; |
2393 | 181 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
182 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
183 GG_EVENT_NONE = 0, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
184 GG_EVENT_MSG, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
185 GG_EVENT_NOTIFY, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
186 GG_EVENT_STATUS, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
187 GG_EVENT_ACK, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
188 GG_EVENT_CONN_FAILED, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
189 GG_EVENT_CONN_SUCCESS, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
190 }; |
2393 | 191 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
192 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
193 * niedługo się tego pozbędę na rzecz sensownej obsługi błędów. --w |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
194 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
195 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
196 GG_FAILURE_RESOLVING = 1, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
197 GG_FAILURE_CONNECTING, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
198 GG_FAILURE_INVALID, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
199 GG_FAILURE_READING, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
200 GG_FAILURE_WRITING, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
201 GG_FAILURE_PASSWORD, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
202 GG_FAILURE_404, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
203 }; |
2393 | 204 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
205 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
206 * rodzaje błędów, na razie używane przez http. bez rozczulania się nad |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
207 * powodami. klient powie, że albo nie znalazł hosta, albo nie mógł się |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
208 * połączyć, albo nie mógł wysłać, albo nie mógł odebrac. i tyle. jak |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
209 * ktoś będzie chciał, to będzie mógł sprawdzić errno. ale po co? |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
210 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
211 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
212 GG_ERROR_RESOLVING = 1, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
213 GG_ERROR_CONNECTING, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
214 GG_ERROR_READING, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
215 GG_ERROR_WRITING, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
216 }; |
2393 | 217 |
218 /* | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
219 * struktura opisująca rodzaj zdarzenia. wychodzi z gg_watch_fd() |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
220 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
221 struct gg_event { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
222 int type; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
223 union { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
224 struct { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
225 uin_t sender; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
226 int msgclass; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
227 time_t time; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
228 unsigned char *message; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
229 } msg; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
230 struct gg_notify_reply *notify; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
231 struct gg_status status; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
232 struct { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
233 uin_t recipient; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
234 int status; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
235 int seq; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
236 } ack; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
237 int failure; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
238 } event; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
239 }; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
240 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
241 struct gg_event *gg_watch_fd(struct gg_session *sess); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
242 void gg_free_event(struct gg_event *e); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
243 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
244 int gg_notify(struct gg_session *sess, uin_t *userlist, int count); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
245 int gg_add_notify(struct gg_session *sess, uin_t uin); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
246 int gg_remove_notify(struct gg_session *sess, uin_t uin); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
247 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
248 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
249 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
250 * OBSŁUGA HTTP |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
251 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
252 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
253 struct gg_http *gg_http_connect(char *hostname, int port, int async, char *method, char *path, char *header); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
254 int gg_http_watch_fd(struct gg_http *h); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
255 void gg_http_stop(struct gg_http *h); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
256 void gg_free_http(struct gg_http *h); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
257 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
258 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
259 * SZUKANIE UŻYTKOWNIKÓW |
2393 | 260 */ |
261 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
262 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
263 * struktura opisująca kryteria wyszukiwania. argument gg_search(). |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
264 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
265 struct gg_search_request { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
266 int active; /* czy ma szukać tylko aktywnych? */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
267 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
268 /* mode 0 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
269 char *nickname; /* pseudonim */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
270 char *first_name; /* imię */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
271 char *last_name; /* nazwisko */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
272 char *city; /* miasto */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
273 int gender; /* płeć */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
274 int min_birth; /* urodzony od roku... */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
275 int max_birth; /* urodzony do roku... */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
276 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
277 /* mode 1 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
278 char *email; /* adres e-mail */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
279 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
280 /* mode 2 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
281 char *phone; /* numer telefonu */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
282 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
283 /* mode 3 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
284 uin_t uin; /* numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
285 }; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
286 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
287 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
288 * struktura opisująca rezultat wyszukiwania. pole gg_http. |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
289 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
290 struct gg_search { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
291 int count; /* ilość znalezionych */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
292 struct gg_search_result *results; /* tabelka z nimi */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
293 }; |
2393 | 294 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
295 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
296 * pojedynczy rezultat wyszukiwania. |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
297 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
298 struct gg_search_result { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
299 uin_t uin; /* numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
300 char *first_name; /* imię */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
301 char *last_name; /* nazwisko */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
302 char *nickname; /* pseudonim */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
303 int born; /* rok urodzenia */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
304 int gender; /* płeć */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
305 char *city; /* miasto */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
306 int active; /* czy jest aktywny */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
307 }; |
2393 | 308 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
309 #define GG_GENDER_NONE 0 /* nie podano lub bez znaczenia */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
310 #define GG_GENDER_FEMALE 1 /* kobieta */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
311 #define GG_GENDER_MALE 2 /* mężczyzna */ |
2393 | 312 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
313 struct gg_http *gg_search(struct gg_search_request *r, int async); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
314 int gg_search_watch_fd(struct gg_http *f); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
315 void gg_free_search(struct gg_http *f); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
316 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
317 struct gg_search_request *gg_search_request_mode_0(char *nickname, char *first_name, char *last_name, char *city, int gender, int min_birth, int max_birth, int active); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
318 struct gg_search_request *gg_search_request_mode_1(char *email, int active); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
319 struct gg_search_request *gg_search_request_mode_2(char *phone, int active); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
320 struct gg_search_request *gg_search_request_mode_3(uin_t uin, int active); |
2393 | 321 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
322 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
323 * OPERACJE NA KATALOGU PUBLICZNYM |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
324 */ |
2393 | 325 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
326 struct gg_pubdir { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
327 int success; /* czy się udało */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
328 uin_t uin; /* otrzymany numerek. 0 jeśli błąd */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
329 }; |
2393 | 330 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
331 struct gg_http *gg_register(char *email, char *password, int async); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
332 void gg_free_register(struct gg_http *f); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
333 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
334 int gg_pubdir_watch_fd(struct gg_http *f); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
335 #define gg_register_watch_fd gg_pubdir_watch_fd |
2393 | 336 |
337 /* | |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
338 * jeśli chcemy sobie podebugować, wystarczy ustawić `gg_debug_level'. |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
339 * niestety w miarę przybywania wpisów `gg_debug(...)' nie chciało mi |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
340 * się ustawiać odpowiednich leveli, więc większość szła do _MISC. |
2393 | 341 */ |
342 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
343 extern int gg_debug_level; |
2393 | 344 |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
345 #define GG_DEBUG_NET 1 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
346 #define GG_DEBUG_TRAFFIC 2 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
347 #define GG_DEBUG_DUMP 4 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
348 #define GG_DEBUG_FUNCTION 8 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
349 #define GG_DEBUG_MISC 16 |
2393 | 350 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
351 void gg_debug(int level, char *format, ...); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
352 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
353 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
354 * Pare małych zmiennych do obsługi "http proxy" |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
355 * |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
356 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
357 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
358 extern int gg_http_use_proxy; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
359 extern char *gg_http_proxy_host; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
360 extern int gg_http_proxy_port; |
2393 | 361 |
362 /* | |
363 * ------------------------------------------------------------------------- | |
364 * poniżej znajdują się wewnętrzne sprawy biblioteki. zwykły klient nie | |
365 * powinien ich w ogóle ruszać, bo i nie ma po co. wszystko można załatwić | |
366 * procedurami wyższego poziomu, których definicje znajdują się na początku | |
367 * tego pliku. | |
368 * ------------------------------------------------------------------------- | |
369 */ | |
370 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
371 int gg_resolve(int *fd, int *pid, char *hostname); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
372 void gg_debug(int level, char *format, ...); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
373 char *gg_alloc_sprintf(char *format, ...); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
374 char *gg_get_line(char **ptr); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
375 int gg_connect(void *addr, int port, int async); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
376 void gg_read_line(int sock, char *buf, int length); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
377 void gg_chomp(char *line); |
3466 | 378 char *gg_urlencode(const char *str); |
379 int gg_http_hash(const unsigned char *email, const unsigned char *password); | |
2393 | 380 |
381 #define GG_APPMSG_HOST "appmsg.gadu-gadu.pl" | |
382 #define GG_APPMSG_PORT 80 | |
383 #define GG_PUBDIR_HOST "pubdir.gadu-gadu.pl" | |
384 #define GG_PUBDIR_PORT 80 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
385 #define GG_REGISTER_HOST "register.gadu-gadu.pl" |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
386 #define GG_REGISTER_PORT 80 |
2393 | 387 #define GG_DEFAULT_PORT 8074 |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
388 #define GG_HTTPS_PORT 443 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
389 #define GG_HTTP_USERAGENT "Mozilla/4.7 [en] (Win98; I)" |
2393 | 390 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
391 struct gg_header { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
392 unsigned long type; /* typ pakietu */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
393 unsigned long length; /* długość reszty pakietu */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
394 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
395 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
396 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
397 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
398 ; |
2393 | 399 |
400 #define GG_WELCOME 0x0001 | |
401 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
402 struct gg_welcome { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
403 unsigned long key; /* klucz szyfrowania hasła */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
404 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
405 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
406 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
407 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
408 ; |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
409 |
2393 | 410 #define GG_LOGIN 0x000c |
411 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
412 struct gg_login { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
413 uin_t uin; /* twój numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
414 unsigned long hash; /* hash hasła */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
415 unsigned long status; /* status na dzień dobry */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
416 unsigned long dunno; /* == 0x0b */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
417 unsigned long local_ip; /* mój adres ip */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
418 unsigned short local_port; /* port, na którym słucham */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
419 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
420 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
421 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
422 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
423 ; |
2393 | 424 |
425 #define GG_LOGIN_OK 0x0003 | |
426 | |
427 #define GG_LOGIN_FAILED 0x0009 | |
428 | |
429 #define GG_NEW_STATUS 0x0002 | |
430 | |
431 #define GG_STATUS_NOT_AVAIL 0x0001 /* rozłączony */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
432 #define GG_STATUS_AVAIL 0x0002 /* dostępny */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
433 #define GG_STATUS_BUSY 0x0003 /* zajęty */ |
2393 | 434 #define GG_STATUS_INVISIBLE 0x0014 /* niewidoczny (GG 4.6) */ |
435 | |
436 #define GG_STATUS_FRIENDS_MASK 0x8000 /* tylko dla znajomych (GG 4.6) */ | |
437 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
438 struct gg_new_status { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
439 unsigned long status; /* na jaki zmienić? */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
440 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
441 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
442 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
443 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
444 ; |
2393 | 445 |
446 #define GG_NOTIFY 0x0010 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
447 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
448 struct gg_notify { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
449 uin_t uin; /* numerek danej osoby */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
450 char dunno1; /* == 3 */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
451 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
452 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
453 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
454 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
455 ; |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
456 |
2393 | 457 #define GG_NOTIFY_REPLY 0x000c /* tak, to samo co GG_LOGIN */ |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
458 |
2393 | 459 /* struct gg_notify_reply zadeklarowane wyżej */ |
460 | |
461 #define GG_ADD_NOTIFY 0x000d | |
462 #define GG_REMOVE_NOTIFY 0x000e | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
463 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
464 struct gg_add_remove { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
465 uin_t uin; /* numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
466 char dunno1; /* == 3 */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
467 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
468 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
469 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
470 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
471 ; |
2393 | 472 |
473 #define GG_STATUS 0x0002 | |
474 | |
475 /* struct gg_status zadeklarowane wcześniej */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
476 |
2393 | 477 #define GG_SEND_MSG 0x000b |
478 | |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
479 #define GG_CLASS_QUEUED 0x0001 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
480 #define GG_CLASS_OFFLINE GG_CLASS_QUEUED |
2393 | 481 #define GG_CLASS_MSG 0x0004 |
482 #define GG_CLASS_CHAT 0x0008 | |
483 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
484 struct gg_send_msg { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
485 unsigned long recipient; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
486 unsigned long seq; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
487 unsigned long msgclass; |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
488 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
489 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
490 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
491 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
492 ; |
2393 | 493 |
494 #define GG_SEND_MSG_ACK 0x0005 | |
495 | |
496 #define GG_ACK_DELIVERED 0x0002 | |
497 #define GG_ACK_QUEUED 0x0003 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
498 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
499 struct gg_send_msg_ack { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
500 unsigned long status; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
501 unsigned long recipient; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
502 unsigned long seq; |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
503 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
504 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
505 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
506 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
507 ; |
2393 | 508 |
509 #define GG_RECV_MSG 0x000a | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
510 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
511 struct gg_recv_msg { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
512 unsigned long sender; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
513 unsigned long seq; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
514 unsigned long time; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
515 unsigned long msgclass; |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
516 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
517 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
518 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
519 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
520 ; |
2393 | 521 |
522 #define GG_PING 0x0008 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
523 |
2393 | 524 #define GG_PONG 0x0007 |
525 | |
526 #ifdef __cplusplus | |
527 } | |
528 #endif | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
529 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
530 #endif /* __GG_LIBGG_H */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
531 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
532 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
533 * Local variables: |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
534 * c-indentation-style: k&r |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
535 * c-basic-offset: 8 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
536 * indent-tabs-mode: notnil |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
537 * End: |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
538 * |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
539 * vim: shiftwidth=8: |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
540 */ |