source: protocols/yahoo/yahoo2_types.h @ e046390

Last change on this file since e046390 was 4fefb77, checked in by Wilmer van der Gaast <wilmer@…>, at 2009-10-03T19:27:50Z

Yahoo! can log in again. This code still needs major cleanups, use it only
if you're very desparate.

  • Property mode set to 100644
File size: 5.5 KB
Line 
1/*
2 * libyahoo2: yahoo2_types.h
3 *
4 * Copyright (C) 2002-2004, Philip S Tellis <philip.tellis AT gmx.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 *
20 */
21
22#ifndef YAHOO2_TYPES_H
23#define YAHOO2_TYPES_H
24
25#include "yahoo_list.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31enum yahoo_status {
32        YAHOO_STATUS_DISCONNECTED = -1,
33        YAHOO_STATUS_AVAILABLE = 0,
34        YAHOO_STATUS_BRB,
35        YAHOO_STATUS_BUSY,
36        YAHOO_STATUS_NOTATHOME,
37        YAHOO_STATUS_NOTATDESK,
38        YAHOO_STATUS_NOTINOFFICE,
39        YAHOO_STATUS_ONPHONE,
40        YAHOO_STATUS_ONVACATION,
41        YAHOO_STATUS_OUTTOLUNCH,
42        YAHOO_STATUS_STEPPEDOUT,
43        YAHOO_STATUS_INVISIBLE = 12,
44        YAHOO_STATUS_CUSTOM = 99,
45        YAHOO_STATUS_IDLE = 999,
46        YAHOO_STATUS_WEBLOGIN = 0x5a55aa55,
47        YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */
48        YAHOO_STATUS_NOTIFY = 0x16 /* TYPING */
49};
50#define YAHOO_STATUS_GAME       0x2             /* Games don't fit into the regular status model */
51
52enum yahoo_login_status {
53        YAHOO_LOGIN_OK = 0,
54        YAHOO_LOGIN_LOGOFF = 2,
55        YAHOO_LOGIN_UNAME = 3,
56        YAHOO_LOGIN_PASSWD = 13,
57        YAHOO_LOGIN_LOCK = 14,
58        YAHOO_LOGIN_DUPL = 99,
59        YAHOO_LOGIN_SOCK = -1
60};
61
62enum yahoo_error {
63        E_UNKNOWN = -1,
64        E_CONNECTION = -2,
65        E_SYSTEM = -3,
66        E_CUSTOM = 0,
67
68        /* responses from ignore buddy */
69        E_IGNOREDUP = 2,
70        E_IGNORENONE = 3,
71        E_IGNORECONF = 12,
72       
73        /* conference */
74        E_CONFNOTAVAIL = 20
75};
76
77enum yahoo_log_level {
78        YAHOO_LOG_NONE = 0,
79        YAHOO_LOG_FATAL,
80        YAHOO_LOG_ERR,
81        YAHOO_LOG_WARNING,
82        YAHOO_LOG_NOTICE,
83        YAHOO_LOG_INFO,
84        YAHOO_LOG_DEBUG
85};
86
87#define YAHOO_PROTO_VER 0x0010
88
89/* Yahoo style/color directives */
90#define YAHOO_COLOR_BLACK "\033[30m"
91#define YAHOO_COLOR_BLUE "\033[31m"
92#define YAHOO_COLOR_LIGHTBLUE "\033[32m"
93#define YAHOO_COLOR_GRAY "\033[33m"
94#define YAHOO_COLOR_GREEN "\033[34m"
95#define YAHOO_COLOR_PINK "\033[35m"
96#define YAHOO_COLOR_PURPLE "\033[36m"
97#define YAHOO_COLOR_ORANGE "\033[37m"
98#define YAHOO_COLOR_RED "\033[38m"
99#define YAHOO_COLOR_OLIVE "\033[39m"
100#define YAHOO_COLOR_ANY "\033[#"
101#define YAHOO_STYLE_ITALICON "\033[2m"
102#define YAHOO_STYLE_ITALICOFF "\033[x2m"
103#define YAHOO_STYLE_BOLDON "\033[1m"
104#define YAHOO_STYLE_BOLDOFF "\033[x1m"
105#define YAHOO_STYLE_UNDERLINEON "\033[4m"
106#define YAHOO_STYLE_UNDERLINEOFF "\033[x4m"
107#define YAHOO_STYLE_URLON "\033[lm"
108#define YAHOO_STYLE_URLOFF "\033[xlm"
109
110enum yahoo_connection_type {
111        YAHOO_CONNECTION_PAGER=0,
112        YAHOO_CONNECTION_FT,
113        YAHOO_CONNECTION_YAB,
114        YAHOO_CONNECTION_WEBCAM_MASTER,
115        YAHOO_CONNECTION_WEBCAM,
116        YAHOO_CONNECTION_CHATCAT,
117        YAHOO_CONNECTION_SEARCH,
118        YAHOO_CONNECTION_AUTH,
119};
120
121enum yahoo_webcam_direction_type {
122        YAHOO_WEBCAM_DOWNLOAD=0,
123        YAHOO_WEBCAM_UPLOAD
124};
125
126enum yahoo_stealth_visibility_type {
127        YAHOO_STEALTH_DEFAULT = 0,
128        YAHOO_STEALTH_ONLINE,
129        YAHOO_STEALTH_PERM_OFFLINE
130};
131
132/* chat member attribs */
133#define YAHOO_CHAT_MALE 0x8000
134#define YAHOO_CHAT_FEMALE 0x10000
135#define YAHOO_CHAT_FEMALE 0x10000
136#define YAHOO_CHAT_DUNNO 0x400
137#define YAHOO_CHAT_WEBCAM 0x10
138
139enum yahoo_webcam_conn_type { Y_WCM_DIALUP, Y_WCM_DSL, Y_WCM_T1 };
140
141struct yahoo_webcam {
142        int direction;     /* Uploading or downloading */
143        int conn_type;     /* 0=Dialup, 1=DSL/Cable, 2=T1/Lan */
144
145        char *user;        /* user we are viewing */
146        char *server;      /* webcam server to connect to */
147        int   port;        /* webcam port to connect on */
148        char *key;         /* key to connect to the server with */
149        char *description; /* webcam description */
150        char *my_ip;       /* own ip number */
151};
152
153struct yahoo_webcam_data {
154        unsigned int data_size;
155        unsigned int to_read;
156        unsigned int timestamp;
157        unsigned char packet_type;
158};
159
160struct yahoo_data {
161        char  *user;
162        char  *password;
163
164        char  *cookie_y;
165        char  *cookie_t;
166        char  *cookie_c;
167        char  *login_cookie;
168
169        YList *buddies;
170        YList *ignore;
171        YList *identities;
172        char  *login_id;
173
174        int   current_status;
175        int   initial_status;
176        int   logged_in;
177
178        int   session_id;
179
180        int   client_id;
181
182        char  *rawbuddylist;
183        char  *ignorelist;
184
185        void  *server_settings;
186};
187
188struct yab {
189        char *id;
190        char *fname;
191        char *lname;
192        char *nname;
193        char *email;
194        char *hphone;
195        char *wphone;
196        char *mphone;
197        int  dbid;
198};
199
200struct yahoo_buddy {
201        char *group;
202        char *id;
203        char *real_name;
204        struct yab *yab_entry;
205};
206
207enum yahoo_search_type {
208        YAHOO_SEARCH_KEYWORD = 0,
209        YAHOO_SEARCH_YID,
210        YAHOO_SEARCH_NAME
211};
212
213enum yahoo_search_gender {
214        YAHOO_GENDER_NONE = 0,
215        YAHOO_GENDER_MALE,
216        YAHOO_GENDER_FEMALE
217};
218
219enum yahoo_search_agerange {
220        YAHOO_AGERANGE_NONE = 0
221};
222
223struct yahoo_found_contact {
224        char *id;
225        char *gender;
226        char *location;
227        int age;
228        int online;
229};
230
231/*
232 * Function pointer to be passed to http get/post and send file
233 */
234typedef void (*yahoo_get_fd_callback)(int id, int fd, int error, void *data);
235
236/*
237 * Function pointer to be passed to yahoo_get_url_handle
238 */
239typedef void (*yahoo_get_url_handle_callback)(int id, int fd, int error,
240                const char *filename, unsigned long size, void *data);
241
242
243struct yahoo_chat_member {
244        char *id;
245        int  age;
246        int  attribs;
247        char *alias;
248        char *location;
249};
250
251#ifdef __cplusplus
252}
253#endif
254
255#endif
Note: See TracBrowser for help on using the repository browser.