Mercurial > pidgin.yaz
annotate src/protocols/gg/libgg.h @ 9807:0c170246a9ec
[gaim-migrate @ 10675]
Get rid of AIM_IMFLAGS_UNICODE and AIM_IMFLAGS_ISO_8859_1.
Use AIM_IMCHARSET_ASCII, AIM_IMCHARSET_UNICODE, and
AIM_IMCHARSET_CUSTOM instead. And compare these values
directly to aim_incomingim_ch1_args->charset or
aim_mpmsg_section_t->charset
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 21 Aug 2004 22:24:50 +0000 |
parents | 318d14658f95 |
children | 0e3a84f18467 |
rev | line source |
---|---|
9663 | 1 /* $Id: libgg.h 10513 2004-08-04 18:27:09Z lschiere $ */ |
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 |
9265 | 32 #ifdef HAVE_STDINT_H |
33 # include <stdint.h> | |
34 #endif | |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
35 #include <sys/types.h> |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
36 |
2393 | 37 /* |
38 * typ zmiennej określającej numerek danej osoby. | |
39 */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
40 typedef unsigned long uin_t; |
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 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
43 * struktura opisująca daną sesję. tworzona przez gg_login(). |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
44 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
45 struct gg_session { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
46 int fd; /* podglądany deskryptor */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
47 int check; /* sprawdzamy zapis czy odczyt */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
48 int state; /* aktualny stan maszynki */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
49 int error; /* kod błędu dla GG_STATE_ERROR */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
50 int type; /* rodzaj sesji. == GG_SESSION_GG */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
51 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
52 int async; /* czy połączenie jest asynchroniczne */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
53 int pid; /* pid procesu resolvera */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
54 int port; /* port, z którym się łączymy */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
55 int seq; /* numer sekwencyjny ostatniej wiadomości */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
56 int last_pong; /* czas otrzymania ostatniego ping/pong */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
57 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
58 unsigned int server_ip; /* adres serwera */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
59 unsigned int client_ip; /* adres klienta */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
60 int client_port; /* port, na którym klient słucha */ |
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 uin_t uin; /* numerek klienta */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
63 char *password; /* i jego hasło. zwalniane automagicznie */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
64 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
65 int initial_status; /* początkowy stan klienta */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
66 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
67 char *recv_buf; /* bufor na otrzymywane pakiety */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
68 int recv_done; /* ile już wczytano do bufora */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
69 int recv_left; /* i ile jeszcze trzeba wczytać */ |
8775 | 70 |
71 char *userlist_reply; /* fragment odpowiedzi listy kontaktów */ | |
72 | |
73 int userlist_blocks; /* na ile kawałków podzielono listę kontaktów */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
74 }; |
2393 | 75 |
76 /* | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
77 * ogólna struktura opisująca stan wszystkich operacji http. |
2393 | 78 */ |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
79 struct gg_http { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
80 int fd; /* podglądany deskryptor */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
81 int check; /* sprawdzamy zapis czy odczyt */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
82 int state; /* aktualny stan maszynki */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
83 int error; /* kod błędu dla GG_STATE_ERROR */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
84 int type; /* rodzaj sesji. == GG_SESSION_HTTP */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
85 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
86 int async; /* czy połączenie asynchroniczne */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
87 int pid; /* pid procesu resolvera */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
88 int port; /* port, z którym się łączymy */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
89 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
90 char *query; /* bufor zapytania http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
91 char *header; /* bufor nagłówka */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
92 int header_size; /* rozmiar wczytanego nagłówka */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
93 char *body; /* bufor otrzymanych informacji */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
94 int body_size; /* ilość informacji */ |
2393 | 95 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
96 void *data; /* dane danej operacji http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
97 }; |
2393 | 98 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
99 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
100 * ogólna struktura opisująca różne sesje. przydatna w klientach. |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
101 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
102 struct gg_common { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
103 int fd; /* podglądany deskryptor */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
104 int check; /* sprawdzamy zapis czy odczyt */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
105 int state; /* aktualny stan maszynki */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
106 int error; /* kod błędu dla GG_STATE_ERROR */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
107 int type; /* rodzaj sesji */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
108 }; |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
109 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
110 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
111 * rodzaje sesji. |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
112 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
113 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
114 GG_SESSION_GG = 1, /* połączenie z serwerem gg */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
115 GG_SESSION_HTTP, /* ogólna sesja http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
116 GG_SESSION_SEARCH, /* szukanie */ |
6063 | 117 GG_SESSION_REGISTER /* rejestrowanie */ |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
118 }; |
2393 | 119 |
120 /* | |
121 * różne stany asynchronicznej maszynki. | |
122 */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
123 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
124 /* wspólne */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
125 GG_STATE_IDLE = 0, /* nie powinno wystąpić. */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
126 GG_STATE_RESOLVING, /* wywołał gethostbyname() */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
127 GG_STATE_CONNECTING, /* wywołał connect() */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
128 GG_STATE_READING_DATA, /* czeka na dane http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
129 GG_STATE_ERROR, /* wystąpił błąd. kod w x->error */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
130 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
131 /* gg_session */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
132 GG_STATE_CONNECTING_GG, /* wywołał connect() */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
133 GG_STATE_READING_KEY, /* czeka na klucz */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
134 GG_STATE_READING_REPLY, /* czeka na odpowiedź */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
135 GG_STATE_CONNECTED, /* połączył się */ |
2393 | 136 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
137 /* gg_http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
138 GG_STATE_READING_HEADER, /* czeka na nagłówek http */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
139 GG_STATE_PARSING, /* przetwarza dane */ |
6063 | 140 GG_STATE_DONE /* skończył */ |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
141 }; |
2393 | 142 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
143 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
144 * 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
|
145 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
146 #define GG_STATE_WRITING_HTTP GG_STATE_READING_DATA |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
147 #define GG_STATE_WAITING_FOR_KEY GG_STATE_READING_KEY |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
148 #define GG_STATE_SENDING_KEY GG_STATE_READING_REPLY |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
149 #define GG_STATE_FINISHED GG_STATE_DONE |
2393 | 150 |
151 /* | |
152 * co proces klienta powinien sprawdzać w deskryptorach? | |
153 */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
154 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
155 GG_CHECK_NONE = 0, /* nic. nie powinno wystąpić */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
156 GG_CHECK_WRITE = 1, /* sprawdzamy możliwość zapisu */ |
6063 | 157 GG_CHECK_READ = 2 /* sprawdzamy możliwość odczytu */ |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
158 }; |
2393 | 159 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
160 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
|
161 void gg_free_session(struct gg_session *sess); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
162 void gg_logoff(struct gg_session *sess); |
8775 | 163 int gg_write(struct gg_session *sess, const char *buf, int length); |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
164 int gg_change_status(struct gg_session *sess, int status); |
9415 | 165 int gg_change_status_descr(struct gg_session *sess, int status, const char *descr); |
8775 | 166 int gg_send_message(struct gg_session *sess, int msgclass, uin_t recipient, const unsigned char *message); |
167 int gg_send_message_richtext(struct gg_session *sess, int msgclass, uin_t recipient, const unsigned char *message, const unsigned char *format, int formatlen); | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
168 int gg_ping(struct gg_session *sess); |
8775 | 169 int gg_userlist_request(struct gg_session *sess, char type, const char *request); |
2393 | 170 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
171 struct gg_notify_reply { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
172 uin_t uin; /* numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
173 unsigned long status; /* status danej osoby */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
174 unsigned long remote_ip; /* adres ip delikwenta */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
175 unsigned short remote_port; /* port, na którym słucha klient */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
176 unsigned long version; /* == 0x0b */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
177 unsigned short dunno2; /* znowu port? */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
178 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
179 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
180 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
181 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
182 ; |
2393 | 183 |
8775 | 184 #define GG_NOTIFY_REPLY60 0x0011 |
185 | |
186 struct gg_notify_reply60 { | |
187 uint32_t uin; /* numerek plus flagi w MSB */ | |
188 uint8_t status; /* status danej osoby */ | |
189 uint32_t remote_ip; /* adres ip delikwenta */ | |
190 uint16_t remote_port; /* port, na którym słucha klient */ | |
191 uint8_t version; /* wersja klienta */ | |
192 uint8_t image_size; /* maksymalny rozmiar grafiki w KiB */ | |
193 uint8_t dunno1; /* 0x00 */ | |
194 } | |
195 #ifdef __GNUC__ | |
196 __attribute__ ((packed)) | |
197 #endif | |
198 ; | |
199 | |
200 #define GG_STATUS60 0x000f | |
201 | |
202 struct gg_status60 { | |
203 uint32_t uin; /* numerek plus flagi w MSB */ | |
204 uint8_t status; /* status danej osoby */ | |
205 uint32_t remote_ip; /* adres ip delikwenta */ | |
206 uint16_t remote_port; /* port, na którym słucha klient */ | |
207 uint8_t version; /* wersja klienta */ | |
208 uint8_t image_size; /* maksymalny rozmiar grafiki w KiB */ | |
209 uint8_t dunno1; /* 0x00 */ | |
210 } | |
211 #ifdef __GNUC__ | |
212 __attribute__ ((packed)) | |
213 #endif | |
214 ; | |
215 | |
216 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
217 struct gg_status { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
218 uin_t uin; /* numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
219 unsigned long status; /* nowy stan */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
220 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
221 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
222 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
223 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
224 ; |
2393 | 225 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
226 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
227 GG_EVENT_NONE = 0, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
228 GG_EVENT_MSG, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
229 GG_EVENT_NOTIFY, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
230 GG_EVENT_STATUS, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
231 GG_EVENT_ACK, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
232 GG_EVENT_CONN_FAILED, |
8775 | 233 GG_EVENT_CONN_SUCCESS, |
234 GG_EVENT_STATUS60, /* ktoś zmienił stan w GG 6.0 */ | |
235 GG_EVENT_NOTIFY60, /* ktoś się pojawił w GG 6.0 */ | |
236 GG_EVENT_USERLIST, /* odpowiedź listy kontaktów w GG 6.0 */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
237 }; |
2393 | 238 |
2846
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 * 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
|
241 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
242 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
243 GG_FAILURE_RESOLVING = 1, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
244 GG_FAILURE_CONNECTING, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
245 GG_FAILURE_INVALID, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
246 GG_FAILURE_READING, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
247 GG_FAILURE_WRITING, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
248 GG_FAILURE_PASSWORD, |
6063 | 249 GG_FAILURE_404 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
250 }; |
2393 | 251 |
2846
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 * 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
|
254 * 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
|
255 * 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
|
256 * 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
|
257 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
258 enum { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
259 GG_ERROR_RESOLVING = 1, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
260 GG_ERROR_CONNECTING, |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
261 GG_ERROR_READING, |
6063 | 262 GG_ERROR_WRITING |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
263 }; |
2393 | 264 |
265 /* | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
266 * struktura opisująca rodzaj zdarzenia. wychodzi z gg_watch_fd() |
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 struct gg_event { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
269 int type; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
270 union { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
271 struct { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
272 uin_t sender; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
273 int msgclass; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
274 time_t time; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
275 unsigned char *message; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
276 } msg; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
277 struct gg_notify_reply *notify; |
8775 | 278 struct { /* @notify60 informacja o liście kontaktów -- GG_EVENT_NOTIFY60 */ |
279 uin_t uin; /* numer */ | |
280 int status; /* stan */ | |
281 uint32_t remote_ip; /* adres ip */ | |
282 uint16_t remote_port; /* port */ | |
283 int version; /* wersja klienta */ | |
284 int image_size; /* maksymalny rozmiar grafiki w KiB */ | |
285 char *descr; /* opis stanu */ | |
286 time_t time; /* czas powrotu */ | |
287 } *notify60; | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
288 struct gg_status status; |
8775 | 289 struct { /* @status60 zmiana stanu -- GG_EVENT_STATUS60 */ |
290 uin_t uin; /* numer */ | |
291 int status; /* nowy stan */ | |
292 uint32_t remote_ip; /* adres ip */ | |
293 uint16_t remote_port; /* port */ | |
294 int version; /* wersja klienta */ | |
295 int image_size; /* maksymalny rozmiar grafiki w KiB */ | |
296 char *descr; /* opis stanu */ | |
297 time_t time; /* czas powrotu */ | |
298 } status60; | |
299 struct { /* @userlist odpowiedź listy kontaktów serwera */ | |
300 char type; /* rodzaj odpowiedzi */ | |
301 char *reply; /* treść odpowiedzi */ | |
302 } userlist; | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
303 struct { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
304 uin_t recipient; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
305 int status; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
306 int seq; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
307 } ack; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
308 int failure; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
309 } event; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
310 }; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
311 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
312 struct gg_event *gg_watch_fd(struct gg_session *sess); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
313 void gg_free_event(struct gg_event *e); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
314 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
315 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
|
316 int gg_add_notify(struct gg_session *sess, uin_t uin); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
317 int gg_remove_notify(struct gg_session *sess, uin_t uin); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
318 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
319 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
320 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
321 * OBSŁUGA HTTP |
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 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
324 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
|
325 int gg_http_watch_fd(struct gg_http *h); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
326 void gg_http_stop(struct gg_http *h); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
327 void gg_free_http(struct gg_http *h); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
328 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
329 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
330 * SZUKANIE UŻYTKOWNIKÓW |
2393 | 331 */ |
332 | |
2846
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 * struktura opisująca kryteria wyszukiwania. argument gg_search(). |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
335 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
336 struct gg_search_request { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
337 int active; /* czy ma szukać tylko aktywnych? */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
338 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
339 /* mode 0 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
340 char *nickname; /* pseudonim */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
341 char *first_name; /* imię */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
342 char *last_name; /* nazwisko */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
343 char *city; /* miasto */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
344 int gender; /* płeć */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
345 int min_birth; /* urodzony od roku... */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
346 int max_birth; /* urodzony do roku... */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
347 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
348 /* mode 1 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
349 char *email; /* adres e-mail */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
350 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
351 /* mode 2 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
352 char *phone; /* numer telefonu */ |
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 /* mode 3 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
355 uin_t uin; /* numerek */ |
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 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
359 * struktura opisująca rezultat wyszukiwania. pole gg_http. |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
360 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
361 struct gg_search { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
362 int count; /* ilość znalezionych */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
363 struct gg_search_result *results; /* tabelka z nimi */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
364 }; |
2393 | 365 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
366 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
367 * pojedynczy rezultat wyszukiwania. |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
368 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
369 struct gg_search_result { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
370 uin_t uin; /* numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
371 char *first_name; /* imię */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
372 char *last_name; /* nazwisko */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
373 char *nickname; /* pseudonim */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
374 int born; /* rok urodzenia */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
375 int gender; /* płeć */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
376 char *city; /* miasto */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
377 int active; /* czy jest aktywny */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
378 }; |
2393 | 379 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
380 #define GG_GENDER_NONE 0 /* nie podano lub bez znaczenia */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
381 #define GG_GENDER_FEMALE 1 /* kobieta */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
382 #define GG_GENDER_MALE 2 /* mężczyzna */ |
2393 | 383 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
384 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
|
385 int gg_search_watch_fd(struct gg_http *f); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
386 void gg_free_search(struct gg_http *f); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
387 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
388 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
|
389 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
|
390 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
|
391 struct gg_search_request *gg_search_request_mode_3(uin_t uin, int active); |
2393 | 392 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
393 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
394 * OPERACJE NA KATALOGU PUBLICZNYM |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
395 */ |
2393 | 396 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
397 struct gg_pubdir { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
398 int success; /* czy się udało */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
399 uin_t uin; /* otrzymany numerek. 0 jeśli błąd */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
400 }; |
2393 | 401 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
402 struct gg_http *gg_register(char *email, char *password, int async); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
403 void gg_free_register(struct gg_http *f); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
404 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
405 int gg_pubdir_watch_fd(struct gg_http *f); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
406 #define gg_register_watch_fd gg_pubdir_watch_fd |
2393 | 407 |
408 /* | |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
409 * jeśli chcemy sobie podebugować, wystarczy ustawić `gg_debug_level'. |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
410 * 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
|
411 * się ustawiać odpowiednich leveli, więc większość szła do _MISC. |
2393 | 412 */ |
413 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
414 extern int gg_debug_level; |
2393 | 415 |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
416 #define GG_DEBUG_NET 1 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
417 #define GG_DEBUG_TRAFFIC 2 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
418 #define GG_DEBUG_DUMP 4 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
419 #define GG_DEBUG_FUNCTION 8 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
420 #define GG_DEBUG_MISC 16 |
2393 | 421 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
422 void gg_debug(int level, char *format, ...); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
423 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
424 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
425 * Pare małych zmiennych do obsługi "http proxy" |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
426 * |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
427 */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
428 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
429 extern int gg_http_use_proxy; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
430 extern char *gg_http_proxy_host; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
431 extern int gg_http_proxy_port; |
2393 | 432 |
433 /* | |
434 * ------------------------------------------------------------------------- | |
435 * poniżej znajdują się wewnętrzne sprawy biblioteki. zwykły klient nie | |
436 * powinien ich w ogóle ruszać, bo i nie ma po co. wszystko można załatwić | |
437 * procedurami wyższego poziomu, których definicje znajdują się na początku | |
438 * tego pliku. | |
439 * ------------------------------------------------------------------------- | |
440 */ | |
441 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
442 int gg_resolve(int *fd, int *pid, char *hostname); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
443 void gg_debug(int level, char *format, ...); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
444 char *gg_alloc_sprintf(char *format, ...); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
445 char *gg_get_line(char **ptr); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
446 int gg_connect(void *addr, int port, int async); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
447 void gg_read_line(int sock, char *buf, int length); |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
448 void gg_chomp(char *line); |
3466 | 449 char *gg_urlencode(const char *str); |
450 int gg_http_hash(const unsigned char *email, const unsigned char *password); | |
2393 | 451 |
9663 | 452 #define GG_APPMSG_HOST "appmsg.gadu-gadu.pl" |
2393 | 453 #define GG_APPMSG_PORT 80 |
9663 | 454 #define GG_PUBDIR_HOST "pubdir.gadu-gadu.pl" |
2393 | 455 #define GG_PUBDIR_PORT 80 |
9663 | 456 #define GG_REGISTER_HOST "register.gadu-gadu.pl" |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
457 #define GG_REGISTER_PORT 80 |
2393 | 458 #define GG_DEFAULT_PORT 8074 |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
459 #define GG_HTTPS_PORT 443 |
8160 | 460 #define GG_HTTP_USERAGENT "Mozilla/4.0 (compatible MSIE 5.0; Windows 98; I)" |
8775 | 461 #define GG_HAS_AUDIO_MASK 0x40000000 |
9663 | 462 #define GG_DEFAULT_CLIENT_VERSION "6, 0, 0, 132" |
2393 | 463 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
464 struct gg_header { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
465 unsigned long type; /* typ pakietu */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
466 unsigned long length; /* długość reszty pakietu */ |
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_WELCOME 0x0001 | |
474 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
475 struct gg_welcome { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
476 unsigned long key; /* klucz szyfrowania hasła */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
477 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
478 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
479 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
480 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
481 ; |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
482 |
2393 | 483 #define GG_LOGIN 0x000c |
484 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
485 struct gg_login { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
486 uin_t uin; /* twój numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
487 unsigned long hash; /* hash hasła */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
488 unsigned long status; /* status na dzień dobry */ |
8775 | 489 unsigned long version; /* == 0x20 */ |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
490 unsigned long local_ip; /* mój adres ip */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
491 unsigned short local_port; /* port, na którym słucham */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
492 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
493 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
494 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
495 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
496 ; |
2393 | 497 |
8775 | 498 #define GG_LOGIN60 0x0015 |
499 | |
500 struct gg_login60 { | |
501 uint32_t uin; /* mój numerek */ | |
502 uint32_t hash; /* hash hasła */ | |
503 uint32_t status; /* status na dzień dobry */ | |
504 uint32_t version; /* moja wersja klienta */ | |
505 uint8_t dunno1; /* 0x00 */ | |
506 uint32_t local_ip; /* mój adres ip */ | |
507 uint16_t local_port; /* port, na którym słucham */ | |
508 uint32_t external_ip; /* zewnętrzny adres ip */ | |
509 uint16_t external_port; /* zewnętrzny port */ | |
510 uint8_t image_size; /* maksymalny rozmiar grafiki w KiB */ | |
511 uint8_t dunno2; /* 0xbe */ | |
512 } | |
513 #ifdef __GNUC__ | |
514 __attribute__ ((packed)) | |
515 #endif | |
516 ; | |
517 | |
2393 | 518 #define GG_LOGIN_OK 0x0003 |
519 | |
520 #define GG_LOGIN_FAILED 0x0009 | |
521 | |
522 #define GG_NEW_STATUS 0x0002 | |
523 | |
8775 | 524 #define GG_STATUS_NOT_AVAIL 0x0001 /* niedostępny */ |
525 #define GG_STATUS_NOT_AVAIL_DESCR 0x0015 /* niedostępny z opisem (4.8) */ | |
526 #define GG_STATUS_AVAIL 0x0002 /* dostępny */ | |
527 #define GG_STATUS_AVAIL_DESCR 0x0004 /* dostępny z opisem (4.9) */ | |
528 #define GG_STATUS_BUSY 0x0003 /* zajęty */ | |
529 #define GG_STATUS_BUSY_DESCR 0x0005 /* zajęty z opisem (4.8) */ | |
530 #define GG_STATUS_INVISIBLE 0x0014 /* niewidoczny (4.6) */ | |
531 #define GG_STATUS_INVISIBLE_DESCR 0x0016 /* niewidoczny z opisem (4.9) */ | |
532 #define GG_STATUS_BLOCKED 0x0006 /* zablokowany */ | |
2393 | 533 |
8775 | 534 #define GG_STATUS_FRIENDS_MASK 0x8000 /* tylko dla znajomych (4.6) */ |
535 | |
9415 | 536 #define GG_STATUS_DESCR_MAXSIZE 70 |
537 | |
8775 | 538 /* GG_S() stan bez uwzględnienia trybu tylko dla znajomych */ |
539 #define GG_S(x) ((x) & ~GG_STATUS_FRIENDS_MASK) | |
540 | |
541 /* GG_S_D() stan opisowy */ | |
542 #define GG_S_D(x) (GG_S(x) == GG_STATUS_NOT_AVAIL_DESCR || GG_S(x) == GG_STATUS_AVAIL_DESCR || GG_S(x) == GG_STATUS_BUSY_DESCR || GG_S(x) == GG_STATUS_INVISIBLE_DESCR) | |
2393 | 543 |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
544 struct gg_new_status { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
545 unsigned long status; /* na jaki zmienić? */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
546 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
547 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
548 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
549 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
550 ; |
2393 | 551 |
552 #define GG_NOTIFY 0x0010 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
553 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
554 struct gg_notify { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
555 uin_t uin; /* numerek danej osoby */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
556 char dunno1; /* == 3 */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
557 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
558 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
559 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
560 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
561 ; |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
562 |
2393 | 563 #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
|
564 |
2393 | 565 /* struct gg_notify_reply zadeklarowane wyżej */ |
566 | |
567 #define GG_ADD_NOTIFY 0x000d | |
568 #define GG_REMOVE_NOTIFY 0x000e | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
569 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
570 struct gg_add_remove { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
571 uin_t uin; /* numerek */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
572 char dunno1; /* == 3 */ |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
573 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
574 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
575 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
576 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
577 ; |
2393 | 578 |
579 #define GG_STATUS 0x0002 | |
580 | |
581 /* struct gg_status zadeklarowane wcześniej */ | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
582 |
2393 | 583 #define GG_SEND_MSG 0x000b |
584 | |
2792
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
585 #define GG_CLASS_QUEUED 0x0001 |
9123abd0db92
[gaim-migrate @ 2805]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2510
diff
changeset
|
586 #define GG_CLASS_OFFLINE GG_CLASS_QUEUED |
2393 | 587 #define GG_CLASS_MSG 0x0004 |
588 #define GG_CLASS_CHAT 0x0008 | |
589 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
590 struct gg_send_msg { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
591 unsigned long recipient; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
592 unsigned long seq; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
593 unsigned long msgclass; |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
594 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
595 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
596 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
597 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
598 ; |
2393 | 599 |
600 #define GG_SEND_MSG_ACK 0x0005 | |
601 | |
602 #define GG_ACK_DELIVERED 0x0002 | |
603 #define GG_ACK_QUEUED 0x0003 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
604 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
605 struct gg_send_msg_ack { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
606 unsigned long status; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
607 unsigned long recipient; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
608 unsigned long seq; |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
609 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
610 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
611 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
612 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
613 ; |
2393 | 614 |
615 #define GG_RECV_MSG 0x000a | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
616 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
617 struct gg_recv_msg { |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
618 unsigned long sender; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
619 unsigned long seq; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
620 unsigned long time; |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
621 unsigned long msgclass; |
2884
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
622 } |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
623 #ifdef __GNUC__ |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
624 __attribute__ ((packed)) |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
625 #endif |
12309c877020
[gaim-migrate @ 2897]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2846
diff
changeset
|
626 ; |
2393 | 627 |
628 #define GG_PING 0x0008 | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
629 |
2393 | 630 #define GG_PONG 0x0007 |
631 | |
8775 | 632 #define GG_USERLIST_REQUEST 0x0016 |
633 | |
634 #define GG_USERLIST_PUT 0x00 | |
635 #define GG_USERLIST_PUT_MORE 0x01 | |
636 #define GG_USERLIST_GET 0x02 | |
637 | |
638 struct gg_userlist_request { | |
639 uint8_t type; | |
640 } | |
641 #ifdef __GNUC__ | |
642 __attribute__ ((packed)) | |
643 #endif | |
644 ; | |
645 | |
646 #define GG_USERLIST_REPLY 0x0010 | |
647 | |
648 #define GG_USERLIST_PUT_REPLY 0x00 | |
649 #define GG_USERLIST_PUT_MORE_REPLY 0x02 | |
650 #define GG_USERLIST_GET_REPLY 0x06 | |
651 #define GG_USERLIST_GET_MORE_REPLY 0x04 | |
652 | |
653 struct gg_userlist_reply { | |
654 uint8_t type; | |
655 } | |
656 #ifdef __GNUC__ | |
657 __attribute__ ((packed)) | |
658 #endif | |
659 ; | |
660 | |
661 /* listy */ | |
662 | |
663 struct list { | |
664 void *data; | |
665 struct list *next; | |
666 }; | |
667 | |
668 typedef struct list * list_t; | |
669 | |
670 | |
2393 | 671 #ifdef __cplusplus |
672 } | |
673 #endif | |
2846
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
674 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
675 #endif /* __GG_LIBGG_H */ |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
676 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
677 /* |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
678 * Local variables: |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
679 * c-indentation-style: k&r |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
680 * c-basic-offset: 8 |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
681 * indent-tabs-mode: notnil |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
682 * End: |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
683 * |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
684 * vim: shiftwidth=8: |
4b3f17ca66bf
[gaim-migrate @ 2859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2792
diff
changeset
|
685 */ |