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/oscar/admin.c

    raf359b4 r5ebff60  
    2828                        len = aimbs_get16(bs);
    2929
    30                         if ((type == 0x0011) || (type == 0x0004))
     30                        if ((type == 0x0011) || (type == 0x0004)) {
    3131                                str = 1;
    32 
    33                         if (str)
    34                                 val = (guint8 *)aimbs_getstr(bs, len);
    35                         else
     32                        }
     33
     34                        if (str) {
     35                                val = (guint8 *) aimbs_getstr(bs, len);
     36                        } else {
    3637                                val = aimbs_getraw(bs, len);
     38                        }
    3739
    3840                        /* XXX fix so its only called once for the entire packet */
    39                         if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
     41                        if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) {
    4042                                userfunc(sess, rx, (snac->subtype == 0x0005) ? 1 : 0, perms, type, len, val, str);
     43                        }
    4144
    4245                        g_free(val);
     
    4952}
    5053
    51 static int accountconfirm(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
     54static int accountconfirm(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac,
     55                          aim_bstream_t *bs)
    5256{
    5357        aim_rxcallback_t userfunc;
     
    5660        status = aimbs_get16(bs);
    5761
    58         if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
     62        if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) {
    5963                return userfunc(sess, rx, status);
     64        }
    6065
    6166        return 0;
     
    6570{
    6671
    67         if ((snac->subtype == 0x0003) || (snac->subtype == 0x0005))
     72        if ((snac->subtype == 0x0003) || (snac->subtype == 0x0005)) {
    6873                return infochange(sess, mod, rx, snac, bs);
    69         else if (snac->subtype == 0x0007)
     74        } else if (snac->subtype == 0x0007) {
    7075                return accountconfirm(sess, mod, rx, snac, bs);
     76        }
    7177
    7278        return 0;
     
    7985        mod->version = 0x0001;
    8086        mod->toolid = AIM_TOOL_NEWWIN;
    81         mod->toolversion = 0x0629; 
     87        mod->toolversion = 0x0629;
    8288        mod->flags = 0;
    8389        strncpy(mod->name, "admin", sizeof(mod->name));
     
    9399        aim_snacid_t snacid;
    94100
    95         if (!(tx = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+4+strlen(curpw)+4+strlen(newpw))))
    96                 return -ENOMEM;
     101        if (!(tx = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + strlen(curpw) + 4 + strlen(newpw)))) {
     102                return -ENOMEM;
     103        }
    97104
    98105        snacid = aim_cachesnac(sess, 0x0007, 0x0004, 0x0000, NULL, 0);
     
    100107
    101108        /* new password TLV t(0002) */
    102         aim_addtlvtochain_raw(&tl, 0x0002, strlen(newpw), (guint8 *)newpw);
     109        aim_addtlvtochain_raw(&tl, 0x0002, strlen(newpw), (guint8 *) newpw);
    103110
    104111        /* current password TLV t(0012) */
    105         aim_addtlvtochain_raw(&tl, 0x0012, strlen(curpw), (guint8 *)curpw);
     112        aim_addtlvtochain_raw(&tl, 0x0012, strlen(curpw), (guint8 *) curpw);
    106113
    107114        aim_writetlvchain(&tx->data, &tl);
     
    114121
    115122/*
    116  * Request account confirmation. 
     123 * Request account confirmation.
    117124 *
    118125 * This will cause an email to be sent to the address associated with
     
    131138 * The only known valid tag is 0x0011 (email address).
    132139 *
    133  */ 
     140 */
    134141int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, guint16 info)
    135142{
     
    137144        aim_snacid_t snacid;
    138145
    139         if (!(tx = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 14)))
    140                 return -ENOMEM;
     146        if (!(tx = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 14))) {
     147                return -ENOMEM;
     148        }
    141149
    142150        snacid = aim_cachesnac(sess, 0x0002, 0x0002, 0x0000, NULL, 0);
     
    157165        aim_tlvlist_t *tl = NULL;
    158166
    159         if (!(tx = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+2+2+strlen(newemail))))
    160                 return -ENOMEM;
     167        if (!(tx = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 2 + 2 + strlen(newemail)))) {
     168                return -ENOMEM;
     169        }
    161170
    162171        snacid = aim_cachesnac(sess, 0x0007, 0x0004, 0x0000, NULL, 0);
    163172        aim_putsnac(&tx->data, 0x0007, 0x0004, 0x0000, snacid);
    164173
    165         aim_addtlvtochain_raw(&tl, 0x0011, strlen(newemail), (guint8 *)newemail);
    166        
     174        aim_addtlvtochain_raw(&tl, 0x0011, strlen(newemail), (guint8 *) newemail);
     175
    167176        aim_writetlvchain(&tx->data, &tl);
    168177        aim_freetlvchain(&tl);
    169        
     178
    170179        aim_tx_enqueue(sess, tx);
    171180
     
    179188        aim_tlvlist_t *tl = NULL;
    180189
    181         if (!(tx = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+2+2+strlen(newnick))))
    182                 return -ENOMEM;
     190        if (!(tx = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 2 + 2 + strlen(newnick)))) {
     191                return -ENOMEM;
     192        }
    183193
    184194        snacid = aim_cachesnac(sess, 0x0007, 0x0004, 0x0000, NULL, 0);
    185195        aim_putsnac(&tx->data, 0x0007, 0x0004, 0x0000, snacid);
    186196
    187         aim_addtlvtochain_raw(&tl, 0x0001, strlen(newnick), (guint8 *)newnick);
    188        
     197        aim_addtlvtochain_raw(&tl, 0x0001, strlen(newnick), (guint8 *) newnick);
     198
    189199        aim_writetlvchain(&tx->data, &tl);
    190200        aim_freetlvchain(&tl);
    191        
    192         aim_tx_enqueue(sess, tx);
    193 
    194 
    195         return 0;
    196 }
     201
     202        aim_tx_enqueue(sess, tx);
     203
     204
     205        return 0;
     206}
Note: See TracChangeset for help on using the changeset viewer.