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/yahoo/yahoo2_callbacks.h

    raf359b4 r5ebff60  
    4545 */
    4646
    47         typedef enum {
    48                 YAHOO_INPUT_READ = 1 << 0,
    49                 YAHOO_INPUT_WRITE = 1 << 1,
    50                 YAHOO_INPUT_EXCEPTION = 1 << 2
    51         } yahoo_input_condition;
     47typedef enum {
     48        YAHOO_INPUT_READ = 1 << 0,
     49                YAHOO_INPUT_WRITE = 1 << 1,
     50                YAHOO_INPUT_EXCEPTION = 1 << 2
     51} yahoo_input_condition;
    5252
    5353/*
    5454 * A callback function called when an asynchronous connect completes.
    55  * 
    56  * Params:
    57  *     fd    - The file descriptor object that has been connected, or NULL on 
     55 *
     56 * Params:
     57 *     fd    - The file descriptor object that has been connected, or NULL on
    5858 *             error
    5959 *     error - The value of errno set by the call to connect or 0 if no error
     
    6363 *             function
    6464 */
    65         typedef void (*yahoo_connect_callback) (void *fd, int error,
    66                 void *callback_data);
     65typedef void (*yahoo_connect_callback) (void *fd, int error,
     66                                        void *callback_data);
    6767
    6868/*
     
    7272 */
    7373
    74 /* 
     74/*
    7575 * should we use a callback structure or directly call functions
    7676 * if you want the structure, you *must* define USE_STRUCT_CALLBACKS
     
    8080
    8181#ifdef USE_STRUCT_CALLBACKS
    82 #define YAHOO_CALLBACK_TYPE(x)  (*x)
     82#define YAHOO_CALLBACK_TYPE(x)  (*x)
    8383struct yahoo_callbacks {
    8484#else
    85 #define YAHOO_CALLBACK_TYPE(x)  x
     85#define YAHOO_CALLBACK_TYPE(x)  x
    8686#endif
    8787
    8888/*
    8989 * Name: ext_yahoo_login_response
    90  *      Called when the login process is complete
    91  * Params:
    92  *      id   - the id that identifies the server connection
    93  *      succ - enum yahoo_login_status
    94  *      url  - url to reactivate account if locked
     90 *      Called when the login process is complete
     91 * Params:
     92 *      id   - the id that identifies the server connection
     93 *      succ - enum yahoo_login_status
     94 *      url  - url to reactivate account if locked
    9595 */
    9696        void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response) (int id, int succ,
    97                 const char *url);
     97                                                            const char *url);
    9898
    9999/*
    100100 * Name: ext_yahoo_got_buddies
    101  *      Called when the contact list is got from the server
    102  * Params:
    103  *      id   - the id that identifies the server connection
    104  *      buds - the buddy list
     101 *      Called when the contact list is got from the server
     102 * Params:
     103 *      id   - the id that identifies the server connection
     104 *      buds - the buddy list
    105105 */
    106106        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddies) (int id, YList *buds);
     
    108108/*
    109109 * Name: ext_yahoo_got_ignore
    110  *      Called when the ignore list is got from the server
    111  * Params:
    112  *      id   - the id that identifies the server connection
    113  *      igns - the ignore list
     110 *      Called when the ignore list is got from the server
     111 * Params:
     112 *      id   - the id that identifies the server connection
     113 *      igns - the ignore list
    114114 */
    115115//      void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ignore) (int id, YList *igns);
     
    117117/*
    118118 * Name: ext_yahoo_got_identities
    119  *      Called when the contact list is got from the server
    120  * Params:
    121  *      id   - the id that identifies the server connection
    122  *      ids  - the identity list
     119 *      Called when the contact list is got from the server
     120 * Params:
     121 *      id   - the id that identifies the server connection
     122 *      ids  - the identity list
    123123 */
    124124        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_identities) (int id, YList *ids);
     
    126126/*
    127127 * Name: ext_yahoo_got_cookies
    128  *      Called when the cookie list is got from the server
    129  * Params:
    130  *      id   - the id that identifies the server connection
     128 *      Called when the cookie list is got from the server
     129 * Params:
     130 *      id   - the id that identifies the server connection
    131131 */
    132132        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_cookies) (int id);
     
    134134/*
    135135 * Name: ext_yahoo_got_ping
    136  *      Called when the ping packet is received from the server
    137  * Params:
    138  *      id   - the id that identifies the server connection
     136 *      Called when the ping packet is received from the server
     137 * Params:
     138 *      id   - the id that identifies the server connection
    139139 *  errormsg - optional error message
    140140 */
    141141        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ping) (int id,
    142                 const char *errormsg);
     142                                                      const char *errormsg);
    143143
    144144/*
    145145 * Name: ext_yahoo_status_changed
    146  *      Called when remote user's status changes.
    147  * Params:
    148  *      id   - the id that identifies the server connection
    149  *      who  - the handle of the remote user
    150  *      stat - status code (enum yahoo_status)
    151  *      msg  - the message if stat == YAHOO_STATUS_CUSTOM
    152  *      away - whether the contact is away or not (YAHOO_STATUS_CUSTOM)
    153  *      idle - this is the number of seconds he is idle [if he is idle]
     146 *      Called when remote user's status changes.
     147 * Params:
     148 *      id   - the id that identifies the server connection
     149 *      who  - the handle of the remote user
     150 *      stat - status code (enum yahoo_status)
     151 *      msg  - the message if stat == YAHOO_STATUS_CUSTOM
     152 *      away - whether the contact is away or not (YAHOO_STATUS_CUSTOM)
     153 *      idle - this is the number of seconds he is idle [if he is idle]
    154154 *      mobile - this is set for mobile users/buddies
    155155 *      TODO: add support for pager, chat, and game states
    156156 */
    157157        void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed) (int id,
    158                 const char *who, int stat, const char *msg, int away, int idle,
    159                 int mobile);
     158                                                            const char *who, int stat, const char *msg, int away,
     159                                                            int idle,
     160                                                            int mobile);
    160161
    161162/*
    162163 * Name: ext_yahoo_got_buzz
    163  *      Called when remote user sends you a buzz.
    164  * Params:
    165  *      id   - the id that identifies the server connection
    166  *      me   - the identity the message was sent to
    167  *      who  - the handle of the remote user
    168  *      tm   - timestamp of message if offline
     164 *      Called when remote user sends you a buzz.
     165 * Params:
     166 *      id   - the id that identifies the server connection
     167 *      me   - the identity the message was sent to
     168 *      who  - the handle of the remote user
     169 *      tm   - timestamp of message if offline
    169170 */
    170171        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buzz) (int id, const char *me,
    171                 const char *who, long tm);
     172                                                      const char *who, long tm);
    172173
    173174/*
    174175 * Name: ext_yahoo_got_im
    175  *      Called when remote user sends you a message.
    176  * Params:
    177  *      id   - the id that identifies the server connection
    178  *      me   - the identity the message was sent to
    179  *      who  - the handle of the remote user
    180  *      msg  - the message - NULL if stat == 2
    181  *      tm   - timestamp of message if offline
    182  *      stat - message status - 0
    183  *                              1
    184  *                              2 == error sending message
    185  *                              5
    186  *      utf8 - whether the message is encoded as utf8 or not
     176 *      Called when remote user sends you a message.
     177 * Params:
     178 *      id   - the id that identifies the server connection
     179 *      me   - the identity the message was sent to
     180 *      who  - the handle of the remote user
     181 *      msg  - the message - NULL if stat == 2
     182 *      tm   - timestamp of message if offline
     183 *      stat - message status - 0
     184 *                              1
     185 *                              2 == error sending message
     186 *                              5
     187 *      utf8 - whether the message is encoded as utf8 or not
    187188 */
    188189        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_im) (int id, const char *me,
    189                 const char *who, const char *msg, long tm, int stat, int utf8);
     190                                                    const char *who, const char *msg, long tm, int stat, int utf8);
    190191
    191192/*
    192193 * Name: ext_yahoo_got_conf_invite
    193  *      Called when remote user sends you a conference invitation.
    194  * Params:
    195  *      id   - the id that identifies the server connection
    196  *      me   - the identity the invitation was sent to
    197  *      who  - the user inviting you
    198  *      room - the room to join
    199  *      msg  - the message
     194 *      Called when remote user sends you a conference invitation.
     195 * Params:
     196 *      id   - the id that identifies the server connection
     197 *      me   - the identity the invitation was sent to
     198 *      who  - the user inviting you
     199 *      room - the room to join
     200 *      msg  - the message
    200201 *      members - the initial members of the conference (null terminated list)
    201202 */
    202203        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_conf_invite) (int id,
    203                 const char *me, const char *who, const char *room,
    204                 const char *msg, YList *members);
     204                                                             const char *me, const char *who, const char *room,
     205                                                             const char *msg, YList *members);
    205206
    206207/*
    207208 * Name: ext_yahoo_conf_userdecline
    208  *      Called when someone declines to join the conference.
    209  * Params:
    210  *      id   - the id that identifies the server connection
    211  *      me   - the identity in the conference
    212  *      who  - the user who has declined
    213  *      room - the room
    214  *      msg  - the declining message
     209 *      Called when someone declines to join the conference.
     210 * Params:
     211 *      id   - the id that identifies the server connection
     212 *      me   - the identity in the conference
     213 *      who  - the user who has declined
     214 *      room - the room
     215 *      msg  - the declining message
    215216 */
    216217        void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline) (int id,
    217                 const char *me, const char *who, const char *room,
    218                 const char *msg);
     218                                                              const char *me, const char *who, const char *room,
     219                                                              const char *msg);
    219220
    220221/*
    221222 * Name: ext_yahoo_conf_userjoin
    222  *      Called when someone joins the conference.
    223  * Params:
    224  *      id   - the id that identifies the server connection
    225  *      me   - the identity in the conference
    226  *      who  - the user who has joined
    227  *      room - the room joined
     223 *      Called when someone joins the conference.
     224 * Params:
     225 *      id   - the id that identifies the server connection
     226 *      me   - the identity in the conference
     227 *      who  - the user who has joined
     228 *      room - the room joined
    228229 */
    229230        void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin) (int id,
    230                 const char *me, const char *who, const char *room);
     231                                                           const char *me, const char *who, const char *room);
    231232
    232233/*
    233234 * Name: ext_yahoo_conf_userleave
    234  *      Called when someone leaves the conference.
    235  * Params:
    236  *      id   - the id that identifies the server connection
    237  *      me   - the identity in the conference
    238  *      who  - the user who has left
    239  *      room - the room left
     235 *      Called when someone leaves the conference.
     236 * Params:
     237 *      id   - the id that identifies the server connection
     238 *      me   - the identity in the conference
     239 *      who  - the user who has left
     240 *      room - the room left
    240241 */
    241242        void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave) (int id,
    242                 const char *me, const char *who, const char *room);
     243                                                            const char *me, const char *who, const char *room);
    243244
    244245/*
    245246 * Name: ext_yahoo_chat_cat_xml
    246  *      Called when ?
    247  * Params:
    248  *      id      - the id that identifies the server connection
    249  *      xml     - ?
     247 *      Called when ?
     248 * Params:
     249 *      id      - the id that identifies the server connection
     250 *      xml     - ?
    250251 */
    251252        void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml) (int id,
    252                 const char *xml);
     253                                                          const char *xml);
    253254
    254255/*
    255256 * Name: ext_yahoo_chat_join
    256  *      Called when joining the chatroom.
    257  * Params:
    258  *      id      - the id that identifies the server connection
    259  *      me   - the identity in the chatroom
    260  *      room    - the room joined, used in all other chat calls, freed by
    261  *                library after call
    262  *      topic   - the topic of the room, freed by library after call
    263  *      members - the initial members of the chatroom (null terminated YList 
     257 *      Called when joining the chatroom.
     258 * Params:
     259 *      id      - the id that identifies the server connection
     260 *      me   - the identity in the chatroom
     261 *      room    - the room joined, used in all other chat calls, freed by
     262 *                library after call
     263 *      topic   - the topic of the room, freed by library after call
     264 *      members - the initial members of the chatroom (null terminated YList
    264265 *                of yahoo_chat_member's) Must be freed by the client
    265266 *      fd      - the object where the connection is coming from (for tracking)
    266267 */
    267268        void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join) (int id, const char *me,
    268                 const char *room, const char *topic, YList *members, void *fd);
     269                                                       const char *room, const char *topic, YList *members, void *fd);
    269270
    270271/*
    271272 * Name: ext_yahoo_chat_userjoin
    272  *      Called when someone joins the chatroom.
    273  * Params:
    274  *      id   - the id that identifies the server connection
    275  *      me   - the identity in the chatroom
    276  *      room - the room joined
    277  *      who  - the user who has joined, Must be freed by the client
     273 *      Called when someone joins the chatroom.
     274 * Params:
     275 *      id   - the id that identifies the server connection
     276 *      me   - the identity in the chatroom
     277 *      room - the room joined
     278 *      who  - the user who has joined, Must be freed by the client
    278279 */
    279280        void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin) (int id,
    280                 const char *me, const char *room,
    281                 struct yahoo_chat_member *who);
     281                                                           const char *me, const char *room,
     282                                                           struct yahoo_chat_member *who);
    282283
    283284/*
    284285 * Name: ext_yahoo_chat_userleave
    285  *      Called when someone leaves the chatroom.
    286  * Params:
    287  *      id   - the id that identifies the server connection
    288  *      me   - the identity in the chatroom
    289  *      room - the room left
    290  *      who  - the user who has left (Just the User ID)
     286 *      Called when someone leaves the chatroom.
     287 * Params:
     288 *      id   - the id that identifies the server connection
     289 *      me   - the identity in the chatroom
     290 *      room - the room left
     291 *      who  - the user who has left (Just the User ID)
    291292 */
    292293        void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave) (int id,
    293                 const char *me, const char *room, const char *who);
     294                                                            const char *me, const char *room, const char *who);
    294295
    295296/*
    296297 * Name: ext_yahoo_chat_message
    297  *      Called when someone messages in the chatroom.
    298  * Params:
    299  *      id   - the id that identifies the server connection
    300  *      me   - the identity in the chatroom
    301  *      room - the room
    302  *      who  - the user who messaged (Just the user id)
    303  *      msg  - the message
    304  *      msgtype  - 1 = Normal message
    305  *                 2 = /me type message
    306  *      utf8 - whether the message is utf8 encoded or not
     298 *      Called when someone messages in the chatroom.
     299 * Params:
     300 *      id   - the id that identifies the server connection
     301 *      me   - the identity in the chatroom
     302 *      room - the room
     303 *      who  - the user who messaged (Just the user id)
     304 *      msg  - the message
     305 *      msgtype  - 1 = Normal message
     306 *                 2 = /me type message
     307 *      utf8 - whether the message is utf8 encoded or not
    307308 */
    308309        void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_message) (int id,
    309                 const char *me, const char *who, const char *room,
    310                 const char *msg, int msgtype, int utf8);
     310                                                          const char *me, const char *who, const char *room,
     311                                                          const char *msg, int msgtype, int utf8);
    311312
    312313/*
     
    315316 *      called when yahoo disconnects your chat session
    316317 *      Note this is called whenver a disconnect happens, client or server
    317  *      requested. Care should be taken to make sure you know the origin 
     318 *      requested. Care should be taken to make sure you know the origin
    318319 *      of the disconnect request before doing anything here (auto-join's etc)
    319320 * Params:
    320321 *      id   - the id that identifies this connection
    321  *      me   - the identity in the chatroom
     322 *      me   - the identity in the chatroom
    322323 * Returns:
    323324 *      nothing.
    324325 */
    325326        void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout) (int id,
    326                 const char *me);
     327                                                              const char *me);
    327328
    328329/*
     
    332333 *      Note this is called whenver chat message is sent into a room
    333334 *      in error (fd not connected, room doesn't exists etc)
    334  *      Care should be taken to make sure you know the origin 
     335 *      Care should be taken to make sure you know the origin
    335336 *      of the error before doing anything about it.
    336337 * Params:
    337338 *      id   - the id that identifies this connection
    338  *      me   - the identity in the chatroom
     339 *      me   - the identity in the chatroom
    339340 * Returns:
    340341 *      nothing.
    341342 */
    342343        void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror) (int id,
    343                 const char *me);
     344                                                             const char *me);
    344345
    345346/*
    346347 * Name: ext_yahoo_conf_message
    347  *      Called when someone messages in the conference.
    348  * Params:
    349  *      id   - the id that identifies the server connection
    350  *      me   - the identity the conf message was sent to
    351  *      who  - the user who messaged
    352  *      room - the room
    353  *      msg  - the message
    354  *      utf8 - whether the message is utf8 encoded or not
     348 *      Called when someone messages in the conference.
     349 * Params:
     350 *      id   - the id that identifies the server connection
     351 *      me   - the identity the conf message was sent to
     352 *      who  - the user who messaged
     353 *      room - the room
     354 *      msg  - the message
     355 *      utf8 - whether the message is utf8 encoded or not
    355356 */
    356357        void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message) (int id,
    357                 const char *me, const char *who, const char *room,
    358                 const char *msg, int utf8);
     358                                                          const char *me, const char *who, const char *room,
     359                                                          const char *msg, int utf8);
    359360
    360361/*
    361362 * Name: ext_yahoo_got_file
    362  *      Called when someone sends you a file
    363  * Params:
    364  *      id   - the id that identifies the server connection
    365  *      me   - the identity the file was sent to
    366  *      who  - the user who sent the file
    367  *      msg  - the message
    368  *      fname- the file name if direct transfer
    369  *      fsize- the file size if direct transfer
    370  *      trid - transfer id. Unique for this transfer
     363 *      Called when someone sends you a file
     364 * Params:
     365 *      id   - the id that identifies the server connection
     366 *      me   - the identity the file was sent to
     367 *      who  - the user who sent the file
     368 *      msg  - the message
     369 *      fname- the file name if direct transfer
     370 *      fsize- the file size if direct transfer
     371 *      trid - transfer id. Unique for this transfer
    371372 *
    372373 * NOTE: Subsequent callbacks for file transfer do not send all of this
     
    376377 */
    377378        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_file) (int id, const char *me,
    378                 const char *who, const char *msg, const char *fname,
    379                 unsigned long fesize, char *trid);
     379                                                      const char *who, const char *msg, const char *fname,
     380                                                      unsigned long fesize, char *trid);
    380381
    381382/*
    382383 * Name: ext_yahoo_got_ft_data
    383  *      Called multiple times when parts of the file are received
    384  * Params:
    385  *      id   - the id that identifies the server connection
    386  *      in   - The data
    387  *      len  - Length of the data
    388  *      data - callback data
     384 *      Called multiple times when parts of the file are received
     385 * Params:
     386 *      id   - the id that identifies the server connection
     387 *      in   - The data
     388 *      len  - Length of the data
     389 *      data - callback data
    389390 */
    390391        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ft_data) (int id,
    391                 const unsigned char *in, int len, void *data);
     392                                                         const unsigned char *in, int len, void *data);
    392393
    393394/*
    394395 * Name: ext_yahoo_file_transfer_done
    395  *      File transfer is done
    396  * Params:
    397  *      id     - the id that identifies the server connection
    398  *      result - To notify if it finished successfully or with a failure
    399  *      data   - callback data
     396 *      File transfer is done
     397 * Params:
     398 *      id     - the id that identifies the server connection
     399 *      result - To notify if it finished successfully or with a failure
     400 *      data   - callback data
    400401 */
    401402        void YAHOO_CALLBACK_TYPE(ext_yahoo_file_transfer_done) (int id,
    402                 int result, void *data);
     403                                                                int result, void *data);
    403404
    404405/*
    405406 * Name: ext_yahoo_contact_added
    406  *      Called when a contact is added to your list
    407  * Params:
    408  *      id   - the id that identifies the server connection
    409  *      myid - the identity he was added to
    410  *      who  - who was added
    411  *      msg  - any message sent
     407 *      Called when a contact is added to your list
     408 * Params:
     409 *      id   - the id that identifies the server connection
     410 *      myid - the identity he was added to
     411 *      who  - who was added
     412 *      msg  - any message sent
    412413 */
    413414        void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added) (int id,
    414                 const char *myid, const char *who, const char *msg);
     415                                                           const char *myid, const char *who, const char *msg);
    415416
    416417/*
    417418 * Name: ext_yahoo_rejected
    418  *      Called when a contact rejects your add
    419  * Params:
    420  *      id   - the id that identifies the server connection
    421  *      who  - who rejected you
    422  *      msg  - any message sent
     419 *      Called when a contact rejects your add
     420 * Params:
     421 *      id   - the id that identifies the server connection
     422 *      who  - who rejected you
     423 *      msg  - any message sent
    423424 */
    424425        void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected) (int id, const char *who,
    425                 const char *msg);
     426                                                      const char *msg);
    426427
    427428/*
    428429 * Name: ext_yahoo_typing_notify
    429  *      Called when remote user starts or stops typing.
    430  * Params:
    431  *      id   - the id that identifies the server connection
    432  *      me   - the handle of the identity the notification is sent to
    433  *      who  - the handle of the remote user
    434  *      stat - 1 if typing, 0 if stopped typing
     430 *      Called when remote user starts or stops typing.
     431 * Params:
     432 *      id   - the id that identifies the server connection
     433 *      me   - the handle of the identity the notification is sent to
     434 *      who  - the handle of the remote user
     435 *      stat - 1 if typing, 0 if stopped typing
    435436 */
    436437        void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify) (int id,
    437                 const char *me, const char *who, int stat);
     438                                                           const char *me, const char *who, int stat);
    438439
    439440/*
    440441 * Name: ext_yahoo_game_notify
    441  *      Called when remote user starts or stops a game.
    442  * Params:
    443  *      id   - the id that identifies the server connection
    444  *      me   - the handle of the identity the notification is sent to
    445  *      who  - the handle of the remote user
    446  *      stat - 1 if game, 0 if stopped gaming
    447  *      msg  - game description and/or other text
     442 *      Called when remote user starts or stops a game.
     443 * Params:
     444 *      id   - the id that identifies the server connection
     445 *      me   - the handle of the identity the notification is sent to
     446 *      who  - the handle of the remote user
     447 *      stat - 1 if game, 0 if stopped gaming
     448 *      msg  - game description and/or other text
    448449 */
    449450        void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify) (int id, const char *me,
    450                 const char *who, int stat, const char *msg);
     451                                                         const char *who, int stat, const char *msg);
    451452
    452453/*
    453454 * Name: ext_yahoo_mail_notify
    454  *      Called when you receive mail, or with number of messages
    455  * Params:
    456  *      id   - the id that identifies the server connection
    457  *      from - who the mail is from - NULL if only mail count
    458  *      subj - the subject of the mail - NULL if only mail count
    459  *      cnt  - mail count - 0 if new mail notification
     455 *      Called when you receive mail, or with number of messages
     456 * Params:
     457 *      id   - the id that identifies the server connection
     458 *      from - who the mail is from - NULL if only mail count
     459 *      subj - the subject of the mail - NULL if only mail count
     460 *      cnt  - mail count - 0 if new mail notification
    460461 */
    461462        void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify) (int id,
    462                 const char *from, const char *subj, int cnt);
     463                                                         const char *from, const char *subj, int cnt);
    463464
    464465/*
    465466 * Name: ext_yahoo_system_message
    466  *      System message
    467  * Params:
    468  *      id   - the id that identifies the server connection
    469  *      me   - the handle of the identity the notification is sent to
    470  *      who  - the source of the system message (there are different types)
    471  *      msg  - the message
     467 *      System message
     468 * Params:
     469 *      id   - the id that identifies the server connection
     470 *      me   - the handle of the identity the notification is sent to
     471 *      who  - the source of the system message (there are different types)
     472 *      msg  - the message
    472473 */
    473474        void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message) (int id,
    474                 const char *me, const char *who, const char *msg);
     475                                                            const char *me, const char *who, const char *msg);
    475476
    476477/*
    477478 * Name: ext_yahoo_got_buddyicon
    478  *      Buddy icon received
    479  * Params:
    480  *      id - the id that identifies the server connection
    481  *      me - the handle of the identity the notification is sent to
    482  *      who - the person the buddy icon is for
    483  *      url - the url to use to load the icon
    484  *      checksum - the checksum of the icon content
     479 *      Buddy icon received
     480 * Params:
     481 *      id - the id that identifies the server connection
     482 *      me - the handle of the identity the notification is sent to
     483 *      who - the person the buddy icon is for
     484 *      url - the url to use to load the icon
     485 *      checksum - the checksum of the icon content
    485486 */
    486487        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon) (int id,
    487                 const char *me, const char *who, const char *url, int checksum);
     488                                                           const char *me, const char *who, const char *url,
     489                                                           int checksum);
    488490
    489491/*
    490492 * Name: ext_yahoo_got_buddyicon_checksum
    491  *      Buddy icon checksum received
    492  * Params:
    493  *      id - the id that identifies the server connection
    494  *      me - the handle of the identity the notification is sent to
    495  *      who - the yahoo id of the buddy icon checksum is for
    496  *      checksum - the checksum of the icon content
     493 *      Buddy icon checksum received
     494 * Params:
     495 *      id - the id that identifies the server connection
     496 *      me - the handle of the identity the notification is sent to
     497 *      who - the yahoo id of the buddy icon checksum is for
     498 *      checksum - the checksum of the icon content
    497499 */
    498500        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_checksum) (int id,
    499                 const char *me, const char *who, int checksum);
     501                                                                    const char *me, const char *who, int checksum);
    500502
    501503/*
    502504 * Name: ext_yahoo_got_buddyicon_request
    503  *      Buddy icon request received
    504  * Params:
    505  *      id - the id that identifies the server connection
    506  *      me - the handle of the identity the notification is sent to
    507  *      who - the yahoo id of the buddy that requested the buddy icon
     505 *      Buddy icon request received
     506 * Params:
     507 *      id - the id that identifies the server connection
     508 *      me - the handle of the identity the notification is sent to
     509 *      who - the yahoo id of the buddy that requested the buddy icon
    508510 */
    509511        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_request) (int id,
    510                 const char *me, const char *who);
     512                                                                   const char *me, const char *who);
    511513
    512514/*
    513515 * Name: ext_yahoo_got_buddyicon_request
    514  *      Buddy icon request received
    515  * Params:
    516  *      id - the id that identifies the server connection
    517  *      url - remote url, the uploaded buddy icon can be fetched from
     516 *      Buddy icon request received
     517 * Params:
     518 *      id - the id that identifies the server connection
     519 *      url - remote url, the uploaded buddy icon can be fetched from
    518520 */
    519521        void YAHOO_CALLBACK_TYPE(ext_yahoo_buddyicon_uploaded) (int id,
    520                 const char *url);
     522                                                                const char *url);
    521523
    522524/*
    523525 * Name: ext_yahoo_got_webcam_image
    524  *      Called when you get a webcam update
     526 *      Called when you get a webcam update
    525527 *      An update can either be receiving an image, a part of an image or
    526528 *      just an update with a timestamp
    527529 * Params:
    528  *      id         - the id that identifies the server connection
    529  *      who        - the user who's webcam we're viewing
     530 *      id         - the id that identifies the server connection
     531 *      who        - the user who's webcam we're viewing
    530532 *      image      - image data
    531533 *      image_size - length of the image in bytes
     
    544546 */
    545547        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_webcam_image) (int id,
    546                 const char *who, const unsigned char *image,
    547                 unsigned int image_size, unsigned int real_size,
    548                 unsigned int timestamp);
     548                                                              const char *who, const unsigned char *image,
     549                                                              unsigned int image_size, unsigned int real_size,
     550                                                              unsigned int timestamp);
    549551
    550552/*
    551553 * Name: ext_yahoo_webcam_invite
    552  *      Called when you get a webcam invitation
    553  * Params:
    554  *      id   - the id that identifies the server connection
    555  *      me   - identity the invitation is to
    556  *      from - who the invitation is from
     554 *      Called when you get a webcam invitation
     555 * Params:
     556 *      id   - the id that identifies the server connection
     557 *      me   - identity the invitation is to
     558 *      from - who the invitation is from
    557559 */
    558560        void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite) (int id,
    559                 const char *me, const char *from);
     561                                                           const char *me, const char *from);
    560562
    561563/*
    562564 * Name: ext_yahoo_webcam_invite_reply
    563  *      Called when you get a response to a webcam invitation
    564  * Params:
    565  *      id   - the id that identifies the server connection
    566  *      me   - identity the invitation response is to
    567  *      from - who the invitation response is from
     565 *      Called when you get a response to a webcam invitation
     566 * Params:
     567 *      id   - the id that identifies the server connection
     568 *      me   - identity the invitation response is to
     569 *      from - who the invitation response is from
    568570 *      accept - 0 (decline), 1 (accept)
    569571 */
    570572        void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply) (int id,
    571                 const char *me, const char *from, int accept);
     573                                                                 const char *me, const char *from, int accept);
    572574
    573575/*
    574576 * Name: ext_yahoo_webcam_closed
    575  *      Called when the webcam connection closed
    576  * Params:
    577  *      id   - the id that identifies the server connection
    578  *      who  - the user who we where connected to
     577 *      Called when the webcam connection closed
     578 * Params:
     579 *      id   - the id that identifies the server connection
     580 *      who  - the user who we where connected to
    579581 *      reason - reason why the connection closed
    580582 *               1 = user stopped broadcasting
     
    584586 */
    585587        void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed) (int id,
    586                 const char *who, int reason);
     588                                                           const char *who, int reason);
    587589
    588590/*
     
    590592 *      Called when the search result received from server
    591593 * Params:
    592  *      id      - the id that identifies the server connection
    593  *      found    - total number of results returned in the current result set
    594  *      start    - offset from where the current result set starts
    595  *      total    - total number of results available (start + found <= total)
    596  *      contacts - the list of results as a YList of yahoo_found_contact
    597  *                 these will be freed after this function returns, so
    598  *                 if you need to use the information, make a copy
     594 *      id      - the id that identifies the server connection
     595 *      found    - total number of results returned in the current result set
     596 *      start    - offset from where the current result set starts
     597 *      total    - total number of results available (start + found <= total)
     598 *      contacts - the list of results as a YList of yahoo_found_contact
     599 *                 these will be freed after this function returns, so
     600 *                 if you need to use the information, make a copy
    599601 */
    600602        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_search_result) (int id,
    601                 int found, int start, int total, YList *contacts);
     603                                                               int found, int start, int total, YList *contacts);
    602604
    603605/*
    604606 * Name: ext_yahoo_error
    605  *      Called on error.
    606  * Params:
    607  *      id   - the id that identifies the server connection
    608  *      err  - the error message
    609  *      fatal- whether this error is fatal to the connection or not
    610  *      num  - Which error is this
     607 *      Called on error.
     608 * Params:
     609 *      id   - the id that identifies the server connection
     610 *      err  - the error message
     611 *      fatal- whether this error is fatal to the connection or not
     612 *      num  - Which error is this
    611613 */
    612614        void YAHOO_CALLBACK_TYPE(ext_yahoo_error) (int id, const char *err,
    613                 int fatal, int num);
     615                                                   int fatal, int num);
    614616
    615617/*
     
    622624 */
    623625        void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer) (int id,
    624                 const char *who, int connect);
     626                                                           const char *who, int connect);
    625627
    626628/*
     
    632634 */
    633635        void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request) (int id,
    634                 int send);
     636                                                                 int send);
    635637
    636638/*
    637639 * Name: ext_yahoo_log
    638  *      Called to log a message.
    639  * Params:
    640  *      fmt  - the printf formatted message
    641  * Returns:
    642  *      0
     640 *      Called to log a message.
     641 * Params:
     642 *      fmt  - the printf formatted message
     643 * Returns:
     644 *      0
    643645 */
    644646        int YAHOO_CALLBACK_TYPE(ext_yahoo_log) (const char *fmt, ...);
     
    646648/*
    647649 * Name: ext_yahoo_add_handler
    648  *      Add a listener for the fd.  Must call yahoo_read_ready
    649  *      when a YAHOO_INPUT_READ fd is ready and yahoo_write_ready
    650  *      when a YAHOO_INPUT_WRITE fd is ready.
    651  * Params:
    652  *      id   - the id that identifies the server connection
    653  *      fd   - the fd object on which to listen
    654  *      cond - the condition on which to call the callback
    655  *      data - callback data to pass to yahoo_*_ready
    656  *     
     650 *      Add a listener for the fd.  Must call yahoo_read_ready
     651 *      when a YAHOO_INPUT_READ fd is ready and yahoo_write_ready
     652 *      when a YAHOO_INPUT_WRITE fd is ready.
     653 * Params:
     654 *      id   - the id that identifies the server connection
     655 *      fd   - the fd object on which to listen
     656 *      cond - the condition on which to call the callback
     657 *      data - callback data to pass to yahoo_*_ready
     658 *
    657659 * Returns: a tag to be used when removing the handler
    658660 */
    659661        int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler) (int id, void *fd,
    660                 yahoo_input_condition cond, void *data);
     662                                                        yahoo_input_condition cond, void *data);
    661663
    662664/*
    663665 * Name: ext_yahoo_remove_handler
    664  *      Remove the listener for the fd.
    665  * Params:
    666  *      id   - the id that identifies the connection
    667  *      tag  - the handler tag to remove
     666 *      Remove the listener for the fd.
     667 * Params:
     668 *      id   - the id that identifies the connection
     669 *      tag  - the handler tag to remove
    668670 */
    669671        void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler) (int id, int tag);
     
    671673/*
    672674 * Name: ext_yahoo_connect
    673  *      Connect to a host:port
    674  * Params:
    675  *      host - the host to connect to
    676  *      port - the port to connect on
    677  * Returns:
    678  *      a unix file descriptor to the socket
     675 *      Connect to a host:port
     676 * Params:
     677 *      host - the host to connect to
     678 *      port - the port to connect on
     679 * Returns:
     680 *      a unix file descriptor to the socket
    679681 */
    680682//      int YAHOO_CALLBACK_TYPE(ext_yahoo_connect) (const char *host, int port);
     
    682684/*
    683685 * Name: ext_yahoo_connect_async
    684  *      Connect to a host:port asynchronously. This function should return
    685  *      immediately returing a tag used to identify the connection handler,
    686  *      or a pre-connect error (eg: host name lookup failure).
    687  *      Once the connect completes (successfully or unsuccessfully), callback
    688  *      should be called (see the signature for yahoo_connect_callback).
    689  *      The callback may safely be called before this function returns, but
    690  *      it should not be called twice.
    691  * Params:
    692  *      id   - the id that identifies this connection
    693  *      host - the host to connect to
    694  *      port - the port to connect on
    695  *      callback - function to call when connect completes
    696  *      callback_data - data to pass to the callback function
    697  *      use_ssl - Whether we need an SSL connection
    698  * Returns:
    699  *      a tag signifying the connection attempt
     686 *      Connect to a host:port asynchronously. This function should return
     687 *      immediately returing a tag used to identify the connection handler,
     688 *      or a pre-connect error (eg: host name lookup failure).
     689 *      Once the connect completes (successfully or unsuccessfully), callback
     690 *      should be called (see the signature for yahoo_connect_callback).
     691 *      The callback may safely be called before this function returns, but
     692 *      it should not be called twice.
     693 * Params:
     694 *      id   - the id that identifies this connection
     695 *      host - the host to connect to
     696 *      port - the port to connect on
     697 *      callback - function to call when connect completes
     698 *      callback_data - data to pass to the callback function
     699 *      use_ssl - Whether we need an SSL connection
     700 * Returns:
     701 *      a tag signifying the connection attempt
    700702 */
    701703        int YAHOO_CALLBACK_TYPE(ext_yahoo_connect_async) (int id,
    702                 const char *host, int port, yahoo_connect_callback callback,
    703                 void *callback_data, int use_ssl);
     704                                                          const char *host, int port, yahoo_connect_callback callback,
     705                                                          void *callback_data, int use_ssl);
    704706
    705707/*
    706708 * Name: ext_yahoo_get_ip_addr
    707  *      get IP Address for a domain name
    708  * Params:
    709  *      domain - Domain name
    710  * Returns:
    711  *      Newly allocated string containing the IP Address in IPv4 notation
     709 *      get IP Address for a domain name
     710 * Params:
     711 *      domain - Domain name
     712 * Returns:
     713 *      Newly allocated string containing the IP Address in IPv4 notation
    712714 */
    713715        char *YAHOO_CALLBACK_TYPE(ext_yahoo_get_ip_addr) (const char *domain);
     
    715717/*
    716718 * Name: ext_yahoo_write
    717  *      Write data from the buffer into the socket for the specified connection
    718  * Params:
    719  *      fd  - the file descriptor object that identifies this connection
    720  *      buf - Buffer to write the data from
    721  *      len - Length of the data
    722  * Returns:
    723  *      Number of bytes written or -1 for error
     719 *      Write data from the buffer into the socket for the specified connection
     720 * Params:
     721 *      fd  - the file descriptor object that identifies this connection
     722 *      buf - Buffer to write the data from
     723 *      len - Length of the data
     724 * Returns:
     725 *      Number of bytes written or -1 for error
    724726 */
    725727        int YAHOO_CALLBACK_TYPE(ext_yahoo_write) (void *fd, char *buf, int len);
     
    727729/*
    728730 * Name: ext_yahoo_read
    729  *      Read data into a buffer from socket for the specified connection
    730  * Params:
    731  *      fd  - the file descriptor object that identifies this connection
    732  *      buf - Buffer to read the data into
    733  *      len - Max length to read
    734  * Returns:
    735  *      Number of bytes read or -1 for error
     731 *      Read data into a buffer from socket for the specified connection
     732 * Params:
     733 *      fd  - the file descriptor object that identifies this connection
     734 *      buf - Buffer to read the data into
     735 *      len - Max length to read
     736 * Returns:
     737 *      Number of bytes read or -1 for error
    736738 */
    737739        int YAHOO_CALLBACK_TYPE(ext_yahoo_read) (void *fd, char *buf, int len);
     
    739741/*
    740742 * Name: ext_yahoo_close
    741  *      Close the file descriptor object and free its resources. Libyahoo2 will not
    742  *      use this object again.
    743  * Params:
    744  *      fd  - the file descriptor object that identifies this connection
    745  * Returns:
    746  *      Nothing
     743 *      Close the file descriptor object and free its resources. Libyahoo2 will not
     744 *      use this object again.
     745 * Params:
     746 *      fd  - the file descriptor object that identifies this connection
     747 * Returns:
     748 *      Nothing
    747749 */
    748750        void YAHOO_CALLBACK_TYPE(ext_yahoo_close) (void *fd);
     
    750752/*
    751753 * Name: ext_yahoo_got_buddy_change_group
    752  *      Acknowledgement of buddy changing group
    753  * Params:
    754  *      id: client id
    755  *      me: The user
    756  *      who: Buddy name
    757  *      old_group: Old group name
    758  *      new_group: New group name
    759  * Returns:
    760  *      Nothing
     754 *      Acknowledgement of buddy changing group
     755 * Params:
     756 *      id: client id
     757 *      me: The user
     758 *      who: Buddy name
     759 *      old_group: Old group name
     760 *      new_group: New group name
     761 * Returns:
     762 *      Nothing
    761763 */
    762764        void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddy_change_group) (int id,
    763                 const char *me, const char *who, const char *old_group,
    764                 const char *new_group);
     765                                                                    const char *me, const char *who,
     766                                                                    const char *old_group,
     767                                                                    const char *new_group);
    765768
    766769#ifdef USE_STRUCT_CALLBACKS
Note: See TracChangeset for help on using the changeset viewer.