/* * libyahoo2: yahoo2.h * * Copyright (C) 2002-2004, Philip S Tellis * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef YAHOO2_H #define YAHOO2_H #ifdef __cplusplus extern "C" { #endif /* *** BitlBee: *** */ #include "bitlbee.h" #undef free #define free(x) g_free(x) #undef malloc #define malloc(x) g_malloc(x) #undef realloc #define realloc(x, y) g_realloc(x, y) #undef strdup #define strdup(x) g_strdup(x) #undef strndup #define strndup(x, y) g_strndup(x, y) #undef snprintf // #define snprintf( x... ) g_snprintf( x ) #undef strcasecmp #define strcasecmp(x, y) g_strcasecmp(x, y) #undef strncasecmp #define strncasecmp(x, y, z) g_strncasecmp(x, y, z) #include "yahoo2_types.h" /* returns the socket descriptor object for a given pager connection. shouldn't be needed */ void *yahoo_get_fd(int id); /* says how much logging to do */ /* see yahoo2_types.h for the different values */ int yahoo_set_log_level(enum yahoo_log_level level); enum yahoo_log_level yahoo_get_log_level(void); /* these functions should be self explanatory */ /* who always means the buddy you're acting on */ /* id is the successful value returned by yahoo_init */ /* init returns a connection id used to identify the connection hereon */ /* or 0 on failure */ /* you must call init before calling any other function */ /* * The optional parameters to init are key/value pairs that specify * server settings to use. This list must be NULL terminated - even * if the list is empty. If a parameter isn't set, a default value * will be used. Parameter keys are strings, parameter values are * either strings or ints, depending on the key. Values passed in * are copied, so you can use const/auto/static/pointers/whatever * you want. Parameters are: * NAME TYPE DEFAULT * pager_host char * scs.msg.yahoo.com * pager_port int 5050 * filetransfer_host char * filetransfer.msg.yahoo.com * filetransfer_port int 80 * webcam_host char * webcam.yahoo.com * webcam_port int 5100 * webcam_description char * "" * local_host char * "" * conn_type int Y_WCM_DSL * * You should set at least local_host if you intend to use webcams */ int yahoo_init_with_attributes(const char *username, const char *password, ...); /* yahoo_init does the same as yahoo_init_with_attributes, assuming defaults * for all attributes */ int yahoo_init(const char *username, const char *password); /* release all resources held by this session */ /* you need to call yahoo_close for a session only if * yahoo_logoff is never called for it (ie, it was never logged in) */ void yahoo_close(int id); /* login logs in to the server */ /* initial is of type enum yahoo_status. see yahoo2_types.h */ void yahoo_login(int id, int initial); void yahoo_logoff(int id); /* reloads status of all buddies */ void yahoo_refresh(int id); /* activates/deactivates an identity */ void yahoo_set_identity_status(int id, const char *identity, int active); /* regets the entire buddy list from the server */ void yahoo_get_list(int id); /* download buddy contact information from your yahoo addressbook */ void yahoo_get_yab(int id); /* add/modify an address book entry. if yab->dbid is set, it will */ /* modify that entry else it creates a new entry */ void yahoo_set_yab(int id, struct yab *yab); void yahoo_keepalive(int id); void yahoo_chat_keepalive(int id); /* from is the identity you're sending from. if NULL, the default is used */ /* utf8 is whether msg is a utf8 string or not. */ void yahoo_send_im(int id, const char *from, const char *who, const char *msg, int utf8, int picture); // void yahoo_send_buzz(int id, const char *from, const char *who); /* if type is true, send typing notice, else send stopped typing notice */ void yahoo_send_typing(int id, const char *from, const char *who, int typ); /* used to set away/back status. */ /* away says whether the custom message is an away message or a sig */ void yahoo_set_away(int id, enum yahoo_status state, const char *msg, int away); void yahoo_add_buddy(int id, const char *who, const char *group, const char *msg); void yahoo_remove_buddy(int id, const char *who