Ignore:
Timestamp:
2015-02-20T22:50:54Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
0b9daac, 3d45471, 7733b8c
Parents:
af359b4
git-author:
Indent <please@…> (19-02-15 05:47:20)
git-committer:
dequis <dx@…> (20-02-15 22:50:54)
Message:

Reindent everything to K&R style with tabs

Used uncrustify, with the configuration file in ./doc/uncrustify.cfg

Commit author set to "Indent <please@…>" so that it's easier to
skip while doing git blame.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.h

    raf359b4 r5ebff60  
    3333extern GSList *jabber_connections;
    3434
    35 typedef enum
    36 {
     35typedef enum {
    3736        JFLAG_STREAM_STARTED = 1,       /* Set when we detected the beginning of the stream
    3837                                           and want to do auth. */
     
    4039        JFLAG_STREAM_RESTART = 4,       /* Set when we want to restart the stream (after
    4140                                           SASL or TLS). */
    42         JFLAG_WANT_SESSION = 8,         /* Set if the server wants a <session/> tag
     41        JFLAG_WANT_SESSION = 8,         /* Set if the server wants a <session/> tag
    4342                                           before we continue. */
    4443        JFLAG_WANT_BIND = 16,           /* ... for <bind> tag. */
     
    5352} jabber_flags_t;
    5453
    55 typedef enum
    56 {
     54typedef enum {
    5755        JBFLAG_PROBED_XEP85 = 1,        /* Set this when we sent our probe packet to make
    5856                                           sure it gets sent only once. */
     
    6866
    6967/* Stores a streamhost's (a.k.a. proxy) data */
    70 typedef struct
    71 {
     68typedef struct {
    7269        char *jid;
    7370        char *host;
     
    7572} jabber_streamhost_t;
    7673
    77 typedef enum
    78 {
     74typedef enum {
    7975        JCFLAG_MESSAGE_SENT = 1,        /* Set this after sending the first message, so
    8076                                           we can detect echoes/backlogs. */
    8177} jabber_chat_flags_t;
    8278
    83 struct jabber_data
    84 {
     79struct jabber_data {
    8580        struct im_connection *ic;
    86        
     81
    8782        int fd;
    8883        void *ssl;
     
    9085        int tx_len;
    9186        int r_inpa, w_inpa;
    92        
     87
    9388        struct xt_parser *xt;
    9489        jabber_flags_t flags;
    95        
    96         char *username;         /* USERNAME@server */
    97         char *server;           /* username@SERVER -=> server/domain, not hostname */
    98         char *me;               /* bare jid */
     90
     91        char *username;         /* USERNAME@server */
     92        char *server;           /* username@SERVER -=> server/domain, not hostname */
     93        char *me;               /* bare jid */
    9994        char *internal_jid;
    100        
     95
    10196        const struct oauth2_service *oauth2_service;
    10297        char *oauth2_access_token;
    103        
     98
    10499        /* After changing one of these two (or the priority setting), call
    105100           presence_send_update() to inform the server about the changes. */
    106101        const struct jabber_away_state *away_state;
    107102        char *away_message;
    108        
     103
    109104        md5_state_t cached_id_prefix;
    110105        GHashTable *node_cache;
     
    116111};
    117112
    118 struct jabber_away_state
    119 {
     113struct jabber_away_state {
    120114        char code[5];
    121115        char *full_name;
    122116};
    123117
    124 typedef xt_status (*jabber_cache_event) ( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
    125 
    126 struct jabber_cache_entry
    127 {
     118typedef xt_status (*jabber_cache_event) (struct im_connection *ic, struct xt_node *node, struct xt_node *orig);
     119
     120struct jabber_cache_entry {
    128121        time_t saved_at;
    129122        struct xt_node *node;
     
    138131   refer to a real session and should only be used for operations that
    139132   support incomplete JIDs. */
    140 struct jabber_buddy
    141 {
     133struct jabber_buddy {
    142134        char *bare_jid;
    143135        char *full_jid;
    144136        char *resource;
    145        
     137
    146138        char *ext_jid; /* The JID to use in BitlBee. The real JID if possible, */
    147139                       /* otherwise something similar to the conference JID. */
    148        
     140
    149141        int priority;
    150142        struct jabber_away_state *away_state;
    151143        char *away_message;
    152144        GSList *features;
    153        
     145
    154146        time_t last_msg;
    155147        jabber_buddy_flags_t flags;
    156        
     148
    157149        struct jabber_buddy *next;
    158150};
    159151
    160 struct jabber_chat
    161 {
     152struct jabber_chat {
    162153        int flags;
    163154        char *name;
     
    167158};
    168159
    169 struct jabber_transfer
    170 {
     160struct jabber_transfer {
    171161        /* bitlbee's handle for this transfer */
    172162        file_transfer_t *ft;
     
    246236
    247237/* jabber.c */
    248 void jabber_connect( struct im_connection *ic );
     238void jabber_connect(struct im_connection *ic);
    249239
    250240/* iq.c */
    251 xt_status jabber_pkt_iq( struct xt_node *node, gpointer data );
    252 int jabber_init_iq_auth( struct im_connection *ic );
    253 xt_status jabber_pkt_bind_sess( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
    254 int jabber_get_roster( struct im_connection *ic );
    255 int jabber_get_vcard( struct im_connection *ic, char *bare_jid );
    256 int jabber_add_to_roster( struct im_connection *ic, const char *handle, const char *name, const char *group );
    257 int jabber_remove_from_roster( struct im_connection *ic, char *handle );
    258 xt_status jabber_iq_query_features( struct im_connection *ic, char *bare_jid );
    259 xt_status jabber_iq_query_server( struct im_connection *ic, char *jid, char *xmlns );
    260 void jabber_iq_version_send( struct im_connection *ic, struct jabber_buddy *bud, void *data );
     241xt_status jabber_pkt_iq(struct xt_node *node, gpointer data);
     242int jabber_init_iq_auth(struct im_connection *ic);
     243xt_status jabber_pkt_bind_sess(struct im_connection *ic, struct xt_node *node, struct xt_node *orig);
     244int jabber_get_roster(struct im_connection *ic);
     245int jabber_get_vcard(struct im_connection *ic, char *bare_jid);
     246int jabber_add_to_roster(struct im_connection *ic, const char *handle, const char *name, const char *group);
     247int jabber_remove_from_roster(struct im_connection *ic, char *handle);
     248xt_status jabber_iq_query_features(struct im_connection *ic, char *bare_jid);
     249xt_status jabber_iq_query_server(struct im_connection *ic, char *jid, char *xmlns);
     250void jabber_iq_version_send(struct im_connection *ic, struct jabber_buddy *bud, void *data);
    261251
    262252/* si.c */
    263 int jabber_si_handle_request( struct im_connection *ic, struct xt_node *node, struct xt_node *sinode );
    264 void jabber_si_transfer_request( struct im_connection *ic, file_transfer_t *ft, char *who );
    265 void jabber_si_free_transfer( file_transfer_t *ft);
     253int jabber_si_handle_request(struct im_connection *ic, struct xt_node *node, struct xt_node *sinode);
     254void jabber_si_transfer_request(struct im_connection *ic, file_transfer_t *ft, char *who);
     255void jabber_si_free_transfer(file_transfer_t *ft);
    266256
    267257/* s5bytestream.c */
    268 int jabber_bs_recv_request( struct im_connection *ic, struct xt_node *node, struct xt_node *qnode);
    269 gboolean jabber_bs_send_start( struct jabber_transfer *tf );
    270 gboolean jabber_bs_send_write( file_transfer_t *ft, char *buffer, unsigned int len );
     258int jabber_bs_recv_request(struct im_connection *ic, struct xt_node *node, struct xt_node *qnode);
     259gboolean jabber_bs_send_start(struct jabber_transfer *tf);
     260gboolean jabber_bs_send_write(file_transfer_t *ft, char *buffer, unsigned int len);
    271261
    272262/* message.c */
    273 xt_status jabber_pkt_message( struct xt_node *node, gpointer data );
     263xt_status jabber_pkt_message(struct xt_node *node, gpointer data);
    274264
    275265/* presence.c */
    276 xt_status jabber_pkt_presence( struct xt_node *node, gpointer data );
    277 int presence_send_update( struct im_connection *ic );
    278 int presence_send_request( struct im_connection *ic, char *handle, char *request );
     266xt_status jabber_pkt_presence(struct xt_node *node, gpointer data);
     267int presence_send_update(struct im_connection *ic);
     268int presence_send_request(struct im_connection *ic, char *handle, char *request);
    279269
    280270/* jabber_util.c */
    281 char *set_eval_priority( set_t *set, char *value );
    282 char *set_eval_tls( set_t *set, char *value );
    283 struct xt_node *jabber_make_packet( char *name, char *type, char *to, struct xt_node *children );
    284 struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond, char *err_type, char *err_code );
    285 void jabber_cache_add( struct im_connection *ic, struct xt_node *node, jabber_cache_event func );
    286 struct xt_node *jabber_cache_get( struct im_connection *ic, char *id );
    287 void jabber_cache_entry_free( gpointer entry );
    288 void jabber_cache_clean( struct im_connection *ic );
    289 xt_status jabber_cache_handle_packet( struct im_connection *ic, struct xt_node *node );
    290 const struct jabber_away_state *jabber_away_state_by_code( char *code );
    291 const struct jabber_away_state *jabber_away_state_by_name( char *name );
    292 void jabber_buddy_ask( struct im_connection *ic, char *handle );
    293 int jabber_compare_jid( const char *jid1, const char *jid2 );
    294 char *jabber_normalize( const char *orig );
    295 
    296 typedef enum
    297 {
    298         GET_BUDDY_CREAT = 1,    /* Try to create it, if necessary. */
    299         GET_BUDDY_EXACT = 2,    /* Get an exact match (only makes sense with bare JIDs). */
    300         GET_BUDDY_FIRST = 4,    /* No selection, simply get the first resource for this JID. */
    301         GET_BUDDY_BARE = 8,     /* Get the bare version of the JID (possibly inexistent). */
    302         GET_BUDDY_BARE_OK = 16, /* Allow returning a bare JID if that seems better. */
     271char *set_eval_priority(set_t *set, char *value);
     272char *set_eval_tls(set_t *set, char *value);
     273struct xt_node *jabber_make_packet(char *name, char *type, char *to, struct xt_node *children);
     274struct xt_node *jabber_make_error_packet(struct xt_node *orig, char *err_cond, char *err_type, char *err_code);
     275void jabber_cache_add(struct im_connection *ic, struct xt_node *node, jabber_cache_event func);
     276struct xt_node *jabber_cache_get(struct im_connection *ic, char *id);
     277void jabber_cache_entry_free(gpointer entry);
     278void jabber_cache_clean(struct im_connection *ic);
     279xt_status jabber_cache_handle_packet(struct im_connection *ic, struct xt_node *node);
     280const struct jabber_away_state *jabber_away_state_by_code(char *code);
     281const struct jabber_away_state *jabber_away_state_by_name(char *name);
     282void jabber_buddy_ask(struct im_connection *ic, char *handle);
     283int jabber_compare_jid(const char *jid1, const char *jid2);
     284char *jabber_normalize(const char *orig);
     285
     286typedef enum {
     287        GET_BUDDY_CREAT = 1,    /* Try to create it, if necessary. */
     288        GET_BUDDY_EXACT = 2,    /* Get an exact match (only makes sense with bare JIDs). */
     289        GET_BUDDY_FIRST = 4,    /* No selection, simply get the first resource for this JID. */
     290        GET_BUDDY_BARE = 8,     /* Get the bare version of the JID (possibly inexistent). */
     291        GET_BUDDY_BARE_OK = 16, /* Allow returning a bare JID if that seems better. */
    303292} get_buddy_flags_t;
    304293
    305 struct jabber_error
    306 {
     294struct jabber_error {
    307295        char *code, *text, *type;
    308296};
    309297
    310 struct jabber_buddy *jabber_buddy_add( struct im_connection *ic, char *full_jid );
    311 struct jabber_buddy *jabber_buddy_by_jid( struct im_connection *ic, char *jid, get_buddy_flags_t flags );
    312 struct jabber_buddy *jabber_buddy_by_ext_jid( struct im_connection *ic, char *jid, get_buddy_flags_t flags );
    313 int jabber_buddy_remove( struct im_connection *ic, char *full_jid );
    314 int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid );
    315 void jabber_buddy_remove_all( struct im_connection *ic );
    316 time_t jabber_get_timestamp( struct xt_node *xt );
    317 struct jabber_error *jabber_error_parse( struct xt_node *node, char *xmlns );
    318 void jabber_error_free( struct jabber_error *err );
    319 gboolean jabber_set_me( struct im_connection *ic, const char *me );
     298struct jabber_buddy *jabber_buddy_add(struct im_connection *ic, char *full_jid);
     299struct jabber_buddy *jabber_buddy_by_jid(struct im_connection *ic, char *jid, get_buddy_flags_t flags);
     300struct jabber_buddy *jabber_buddy_by_ext_jid(struct im_connection *ic, char *jid, get_buddy_flags_t flags);
     301int jabber_buddy_remove(struct im_connection *ic, char *full_jid);
     302int jabber_buddy_remove_bare(struct im_connection *ic, char *bare_jid);
     303void jabber_buddy_remove_all(struct im_connection *ic);
     304time_t jabber_get_timestamp(struct xt_node *xt);
     305struct jabber_error *jabber_error_parse(struct xt_node *node, char *xmlns);
     306void jabber_error_free(struct jabber_error *err);
     307gboolean jabber_set_me(struct im_connection *ic, const char *me);
    320308
    321309extern const struct jabber_away_state jabber_away_state_list[];
    322310
    323311/* io.c */
    324 int jabber_write_packet( struct im_connection *ic, struct xt_node *node );
    325 int jabber_write( struct im_connection *ic, char *buf, int len );
    326 gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond );
    327 gboolean jabber_connected_ssl( gpointer data, int returncode, void *source, b_input_condition cond );
    328 gboolean jabber_start_stream( struct im_connection *ic );
    329 void jabber_end_stream( struct im_connection *ic );
     312int jabber_write_packet(struct im_connection *ic, struct xt_node *node);
     313int jabber_write(struct im_connection *ic, char *buf, int len);
     314gboolean jabber_connected_plain(gpointer data, gint source, b_input_condition cond);
     315gboolean jabber_connected_ssl(gpointer data, int returncode, void *source, b_input_condition cond);
     316gboolean jabber_start_stream(struct im_connection *ic);
     317void jabber_end_stream(struct im_connection *ic);
    330318
    331319/* sasl.c */
    332 xt_status sasl_pkt_mechanisms( struct xt_node *node, gpointer data );
    333 xt_status sasl_pkt_challenge( struct xt_node *node, gpointer data );
    334 xt_status sasl_pkt_result( struct xt_node *node, gpointer data );
    335 gboolean sasl_supported( struct im_connection *ic );
    336 void sasl_oauth2_init( struct im_connection *ic );
    337 int sasl_oauth2_get_refresh_token( struct im_connection *ic, const char *msg );
    338 int sasl_oauth2_refresh( struct im_connection *ic, const char *refresh_token );
     320xt_status sasl_pkt_mechanisms(struct xt_node *node, gpointer data);
     321xt_status sasl_pkt_challenge(struct xt_node *node, gpointer data);
     322xt_status sasl_pkt_result(struct xt_node *node, gpointer data);
     323gboolean sasl_supported(struct im_connection *ic);
     324void sasl_oauth2_init(struct im_connection *ic);
     325int sasl_oauth2_get_refresh_token(struct im_connection *ic, const char *msg);
     326int sasl_oauth2_refresh(struct im_connection *ic, const char *refresh_token);
    339327
    340328extern const struct oauth2_service oauth2_service_google;
     
    342330
    343331/* conference.c */
    344 struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password );
    345 struct groupchat *jabber_chat_with( struct im_connection *ic, char *who );
    346 struct groupchat *jabber_chat_by_jid( struct im_connection *ic, const char *name );
    347 void jabber_chat_free( struct groupchat *c );
    348 int jabber_chat_msg( struct groupchat *ic, char *message, int flags );
    349 int jabber_chat_topic( struct groupchat *c, char *topic );
    350 int jabber_chat_leave( struct groupchat *c, const char *reason );
    351 void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
    352 void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
    353 void jabber_chat_invite( struct groupchat *c, char *who, char *message );
     332struct groupchat *jabber_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password);
     333struct groupchat *jabber_chat_with(struct im_connection *ic, char *who);
     334struct groupchat *jabber_chat_by_jid(struct im_connection *ic, const char *name);
     335void jabber_chat_free(struct groupchat *c);
     336int jabber_chat_msg(struct groupchat *ic, char *message, int flags);
     337int jabber_chat_topic(struct groupchat *c, char *topic);
     338int jabber_chat_leave(struct groupchat *c, const char *reason);
     339void jabber_chat_pkt_presence(struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node);
     340void jabber_chat_pkt_message(struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node);
     341void jabber_chat_invite(struct groupchat *c, char *who, char *message);
    354342
    355343#endif
Note: See TracChangeset for help on using the changeset viewer.