Changeset 862371b for libfaim/search.c
- Timestamp:
- Jun 29, 2003, 1:47:04 PM (22 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:
- e016fc2
- Parents:
- 03ad7b2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfaim/search.c
r5e53c4a r862371b 1 2 1 /* 3 * aim_search.c2 * Family 0x000a - User Search. 4 3 * 5 4 * TODO: Add aim_usersearch_name() … … 10 9 #include <aim.h> 11 10 12 faim_export int aim_usersearch_address(aim_session_t *sess, aim_conn_t *conn, const char *address) 13 { 14 aim_frame_t *fr; 15 aim_snacid_t snacid; 16 17 if (!sess || !conn || !address) 18 return -EINVAL; 19 20 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+strlen(address)))) 21 return -ENOMEM; 22 23 snacid = aim_cachesnac(sess, 0x000a, 0x0002, 0x0000, strdup(address), strlen(address)+1); 24 aim_putsnac(&fr->data, 0x000a, 0x0002, 0x0000, snacid); 25 26 aimbs_putraw(&fr->data, address, strlen(address)); 27 28 aim_tx_enqueue(sess, fr); 29 30 return 0; 31 } 32 33 /* XXX can this be integrated with the rest of the error handling? */ 11 /* 12 * Subtype 0x0001 13 * 14 * XXX can this be integrated with the rest of the error handling? 15 */ 34 16 static int error(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) 35 17 { … … 55 37 } 56 38 39 /* 40 * Subtype 0x0002 41 * 42 */ 43 faim_export int aim_usersearch_address(aim_session_t *sess, aim_conn_t *conn, const char *address) 44 { 45 aim_frame_t *fr; 46 aim_snacid_t snacid; 47 48 if (!sess || !conn || !address) 49 return -EINVAL; 50 51 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+strlen(address)))) 52 return -ENOMEM; 53 54 snacid = aim_cachesnac(sess, 0x000a, 0x0002, 0x0000, strdup(address), strlen(address)+1); 55 aim_putsnac(&fr->data, 0x000a, 0x0002, 0x0000, snacid); 56 57 aimbs_putraw(&fr->data, address, strlen(address)); 58 59 aim_tx_enqueue(sess, fr); 60 61 return 0; 62 } 63 64 /* 65 * Subtype 0x0003 66 * 67 */ 57 68 static int reply(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) 58 69 { … … 119 130 return 0; 120 131 } 121 122
Note: See TracChangeset
for help on using the changeset viewer.