Changeset cf02dd6 for libfaim/odir.c
- Timestamp:
- Dec 10, 2003, 3:20:45 PM (21 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- b1fe407
- Parents:
- 8c46404
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfaim/odir.c
r07ab1cb rcf02dd6 31 31 32 32 /* Create a TLV chain, write it to the outgoing frame, then free the chain */ 33 aim_ addtlvtochain_raw(&tl, 0x001c, strlen(region), region);34 aim_ addtlvtochain16(&tl, 0x000a, 0x0001); /* Type of search */35 aim_ addtlvtochain_raw(&tl, 0x0005, strlen(email), email);36 37 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_ sizetlvchain(&tl))))33 aim_tlvlist_add_raw(&tl, 0x001c, strlen(region), region); 34 aim_tlvlist_add_16(&tl, 0x000a, 0x0001); /* Type of search */ 35 aim_tlvlist_add_raw(&tl, 0x0005, strlen(email), email); 36 37 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_tlvlist_size(&tl)))) 38 38 return -ENOMEM; 39 39 snacid = aim_cachesnac(sess, 0x000f, 0x0002, 0x0000, NULL, 0); 40 40 aim_putsnac(&fr->data, 0x000f, 0x0002, 0x0000, snacid); 41 41 42 aim_ writetlvchain(&fr->data, &tl);43 aim_ freetlvchain(&tl);42 aim_tlvlist_write(&fr->data, &tl); 43 aim_tlvlist_free(&tl); 44 44 45 45 aim_tx_enqueue(sess, fr); … … 80 80 81 81 /* Create a TLV chain, write it to the outgoing frame, then free the chain */ 82 aim_ addtlvtochain_raw(&tl, 0x001c, strlen(region), region);83 aim_ addtlvtochain16(&tl, 0x000a, 0x0000); /* Type of search */82 aim_tlvlist_add_raw(&tl, 0x001c, strlen(region), region); 83 aim_tlvlist_add_16(&tl, 0x000a, 0x0000); /* Type of search */ 84 84 if (first) 85 aim_ addtlvtochain_raw(&tl, 0x0001, strlen(first), first);85 aim_tlvlist_add_raw(&tl, 0x0001, strlen(first), first); 86 86 if (last) 87 aim_ addtlvtochain_raw(&tl, 0x0002, strlen(last), last);87 aim_tlvlist_add_raw(&tl, 0x0002, strlen(last), last); 88 88 if (middle) 89 aim_ addtlvtochain_raw(&tl, 0x0003, strlen(middle), middle);89 aim_tlvlist_add_raw(&tl, 0x0003, strlen(middle), middle); 90 90 if (maiden) 91 aim_ addtlvtochain_raw(&tl, 0x0004, strlen(maiden), maiden);91 aim_tlvlist_add_raw(&tl, 0x0004, strlen(maiden), maiden); 92 92 if (country) 93 aim_ addtlvtochain_raw(&tl, 0x0006, strlen(country), country);93 aim_tlvlist_add_raw(&tl, 0x0006, strlen(country), country); 94 94 if (state) 95 aim_ addtlvtochain_raw(&tl, 0x0007, strlen(state), state);95 aim_tlvlist_add_raw(&tl, 0x0007, strlen(state), state); 96 96 if (city) 97 aim_ addtlvtochain_raw(&tl, 0x0008, strlen(city), city);97 aim_tlvlist_add_raw(&tl, 0x0008, strlen(city), city); 98 98 if (nick) 99 aim_ addtlvtochain_raw(&tl, 0x000c, strlen(nick), nick);99 aim_tlvlist_add_raw(&tl, 0x000c, strlen(nick), nick); 100 100 if (zip) 101 aim_ addtlvtochain_raw(&tl, 0x000d, strlen(zip), zip);101 aim_tlvlist_add_raw(&tl, 0x000d, strlen(zip), zip); 102 102 if (address) 103 aim_ addtlvtochain_raw(&tl, 0x0021, strlen(address), address);104 105 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_ sizetlvchain(&tl))))103 aim_tlvlist_add_raw(&tl, 0x0021, strlen(address), address); 104 105 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_tlvlist_size(&tl)))) 106 106 return -ENOMEM; 107 107 snacid = aim_cachesnac(sess, 0x000f, 0x0002, 0x0000, NULL, 0); 108 108 aim_putsnac(&fr->data, 0x000f, 0x0002, 0x0000, snacid); 109 109 110 aim_ writetlvchain(&fr->data, &tl);111 aim_ freetlvchain(&tl);110 aim_tlvlist_write(&fr->data, &tl); 111 aim_tlvlist_free(&tl); 112 112 113 113 aim_tx_enqueue(sess, fr); … … 135 135 136 136 /* Create a TLV chain, write it to the outgoing frame, then free the chain */ 137 aim_ addtlvtochain_raw(&tl, 0x001c, strlen(region), region);138 aim_ addtlvtochain16(&tl, 0x000a, 0x0001); /* Type of search */137 aim_tlvlist_add_raw(&tl, 0x001c, strlen(region), region); 138 aim_tlvlist_add_16(&tl, 0x000a, 0x0001); /* Type of search */ 139 139 if (interest) 140 aim_ addtlvtochain_raw(&tl, 0x0001, strlen(interest), interest);141 142 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_ sizetlvchain(&tl))))140 aim_tlvlist_add_raw(&tl, 0x0001, strlen(interest), interest); 141 142 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_tlvlist_size(&tl)))) 143 143 return -ENOMEM; 144 144 snacid = aim_cachesnac(sess, 0x000f, 0x0002, 0x0000, NULL, 0); 145 145 aim_putsnac(&fr->data, 0x000f, 0x0002, 0x0000, snacid); 146 146 147 aim_ writetlvchain(&fr->data, &tl);148 aim_ freetlvchain(&tl);147 aim_tlvlist_write(&fr->data, &tl); 148 aim_tlvlist_free(&tl); 149 149 150 150 aim_tx_enqueue(sess, fr); … … 174 174 while (numresults) { 175 175 struct aim_odir *new; 176 aim_tlvlist_t *tl = aim_ readtlvchain_num(bs, aimbs_get16(bs));176 aim_tlvlist_t *tl = aim_tlvlist_readnum(bs, aimbs_get16(bs)); 177 177 new = (struct aim_odir *)malloc(sizeof(struct aim_odir)); 178 new->first = aim_ gettlv_str(tl, 0x0001, 1);179 new->last = aim_ gettlv_str(tl, 0x0002, 1);180 new->middle = aim_ gettlv_str(tl, 0x0003, 1);181 new->maiden = aim_ gettlv_str(tl, 0x0004, 1);182 new->email = aim_ gettlv_str(tl, 0x0005, 1);183 new->country = aim_ gettlv_str(tl, 0x0006, 1);184 new->state = aim_ gettlv_str(tl, 0x0007, 1);185 new->city = aim_ gettlv_str(tl, 0x0008, 1);186 new->sn = aim_ gettlv_str(tl, 0x0009, 1);187 new->interest = aim_ gettlv_str(tl, 0x000b, 1);188 new->nick = aim_ gettlv_str(tl, 0x000c, 1);189 new->zip = aim_ gettlv_str(tl, 0x000d, 1);190 new->region = aim_ gettlv_str(tl, 0x001c, 1);191 new->address = aim_ gettlv_str(tl, 0x0021, 1);178 new->first = aim_tlv_getstr(tl, 0x0001, 1); 179 new->last = aim_tlv_getstr(tl, 0x0002, 1); 180 new->middle = aim_tlv_getstr(tl, 0x0003, 1); 181 new->maiden = aim_tlv_getstr(tl, 0x0004, 1); 182 new->email = aim_tlv_getstr(tl, 0x0005, 1); 183 new->country = aim_tlv_getstr(tl, 0x0006, 1); 184 new->state = aim_tlv_getstr(tl, 0x0007, 1); 185 new->city = aim_tlv_getstr(tl, 0x0008, 1); 186 new->sn = aim_tlv_getstr(tl, 0x0009, 1); 187 new->interest = aim_tlv_getstr(tl, 0x000b, 1); 188 new->nick = aim_tlv_getstr(tl, 0x000c, 1); 189 new->zip = aim_tlv_getstr(tl, 0x000d, 1); 190 new->region = aim_tlv_getstr(tl, 0x001c, 1); 191 new->address = aim_tlv_getstr(tl, 0x0021, 1); 192 192 new->next = results; 193 193 results = new;
Note: See TracChangeset
for help on using the changeset viewer.