Changeset 7b23afd for protocols/nogaim.h


Ignore:
Timestamp:
2005-11-07T16:16:18Z (17 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
f7f3ada
Parents:
fe51bcf
Message:

Migrate my pluginable branch to use Wilmers' branch as parent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.h

    rfe51bcf r7b23afd  
    7272        /* we need to do either oscar or TOC */
    7373        /* we make this as an int in case if we want to add more protocols later */
    74         int protocol;
    7574        struct prpl *prpl;
    7675        guint32 flags;
     
    152151        char user_info[2048];
    153152        int options;
    154         int protocol;
     153        struct prpl *prpl;
    155154        /* prpls can use this to save information about the user,
    156155         * like which server to connect to, etc */
     
    161160};
    162161
     162struct ft
     163{
     164        const char *filename;
     165       
     166        /* Total number of bytes in file */
     167        size_t total_bytes;
     168       
     169        /* Current number of bytes received */
     170        size_t cur_bytes;
     171};
     172
     173struct ft_request
     174{
     175        const char *filename;
     176        struct gaim_connection *gc;
     177};
     178
     179typedef void (*ft_recv_handler) (struct ft *, void *data, size_t len);
     180
    163181struct prpl {
    164         int protocol;
    165182        int options;
    166         char *(* name)();
     183        const char *name;
    167184
    168185        /* for ICQ and Yahoo, who have off/on per-conversation options */
     
    217234        void (* group_buddy)    (struct gaim_connection *, char *who, char *old_group, char *new_group);
    218235
     236        /* file transfers */
     237        struct ft_send_req *(* req_send_file) (struct gaim_connection *, const char *file);
     238        void (* send_file_part) (struct gaim_connection *, struct ft*, void *data, size_t length);
     239        void (* accept_recv_file) (struct gaim_connection *, struct ft*, ft_recv_handler);
     240
    219241        void (* buddy_free)     (struct buddy *);
    220242
    221243        char *(* get_status_string) (struct gaim_connection *gc, int stat);
    222244};
    223 
    224 #define PROTO_TOC       0
    225 #define PROTO_OSCAR     1
    226 #define PROTO_YAHOO     2
    227 #define PROTO_ICQ       3
    228 #define PROTO_MSN       4
    229 #define PROTO_IRC       5
    230 #define PROTO_FTP       6
    231 #define PROTO_VGATE     7
    232 #define PROTO_JABBER    8
    233 #define PROTO_NAPSTER   9
    234 #define PROTO_ZEPHYR    10
    235 #define PROTO_GADUGADU  11
    236 #define PROTO_MAX       16
    237 
    238 extern char proto_name[PROTO_MAX][8];
    239245
    240246#define UC_UNAVAILABLE  1
     
    247253
    248254G_MODULE_EXPORT GSList *get_connections();
    249 extern struct prpl *proto_prpl[16];
     255G_MODULE_EXPORT struct prpl *find_protocol(const char *name);
     256G_MODULE_EXPORT void register_protocol(struct prpl *);
    250257
    251258/* nogaim.c */
     
    259266int proto_away( struct gaim_connection *gc, char *away );
    260267char *set_eval_away_devoice( irc_t *irc, set_t *set, char *value );
    261 int handle_cmp( char *a, char *b, int protocol );
     268int handle_cmp( char *a, char *b, struct prpl *protocol );
    262269
    263270gboolean auto_reconnect( gpointer data );
     
    318325G_MODULE_EXPORT void info_string_append(GString *str, char *newline, char *name, char *value);
    319326
    320 #ifdef WITH_MSN
    321 /* msn.c */
    322 G_MODULE_EXPORT void msn_init( struct prpl *ret );
    323 #endif
    324 
    325 #ifdef WITH_OSCAR
    326 /* oscar.c */
    327 G_MODULE_EXPORT void oscar_init( struct prpl *ret );
    328 #endif
    329 
    330 #ifdef WITH_JABBER
    331 /* jabber.c */
    332 G_MODULE_EXPORT void jabber_init( struct prpl *ret );
    333 #endif
    334 
    335 #ifdef WITH_YAHOO
    336 /* yahoo.c */
    337 G_MODULE_EXPORT void byahoo_init( struct prpl *ret );
    338 #endif
     327/* file transfers */
     328G_MODULE_EXPORT void ft_progress( struct ft *, int);
     329G_MODULE_EXPORT void ft_incoming( struct ft_request * );
     330G_MODULE_EXPORT void ft_accepted( struct ft_request *, struct ft *);
     331G_MODULE_EXPORT void ft_denied( struct ft_request *, const char *reason);
    339332
    340333/* prefs.c */
Note: See TracChangeset for help on using the changeset viewer.