Changes in zephyr.c [d427f08:ecffae6]
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
rd427f08 recffae6 524 524 */ 525 525 #ifdef HAVE_LIBZEPHYR 526 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_get_field(const ZNotice_t *n, int j)526 CALLER_OWN char *owl_zephyr_get_field(const ZNotice_t *n, int j) 527 527 { 528 528 int i, count, save; … … 552 552 } 553 553 554 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_get_field_as_utf8(const ZNotice_t *n, int j)554 CALLER_OWN char *owl_zephyr_get_field_as_utf8(const ZNotice_t *n, int j) 555 555 { 556 556 int i, count, save; … … 584 584 } 585 585 #else 586 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_get_field(void *n, int j)586 CALLER_OWN char *owl_zephyr_get_field(void *n, int j) 587 587 { 588 588 return(g_strdup("")); 589 589 } 590 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_get_field_as_utf8(void *n, int j)590 CALLER_OWN char *owl_zephyr_get_field_as_utf8(void *n, int j) 591 591 { 592 592 return owl_zephyr_get_field(n, j); … … 621 621 * caller must free the return 622 622 */ 623 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_get_message(const ZNotice_t *n, const owl_message *m)623 CALLER_OWN char *owl_zephyr_get_message(const ZNotice_t *n, const owl_message *m) 624 624 { 625 625 #define OWL_NFIELDS 5 … … 838 838 zw.opcode = g_strdup(retnotice->z_opcode); 839 839 zw.zsig = g_strdup(""); 840 owl_list_create(&(zw.recips));841 owl_list_append_element(&(zw.recips), g_strdup(retnotice->z_recipient));840 zw.recips = g_ptr_array_new(); 841 g_ptr_array_add(zw.recips, g_strdup(retnotice->z_recipient)); 842 842 843 843 owl_log_outgoing_zephyr_error(&zw, buff); … … 942 942 #endif 943 943 944 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_zlocate(const char *user, int auth)944 CALLER_OWN char *owl_zephyr_zlocate(const char *user, int auth) 945 945 { 946 946 #ifdef HAVE_LIBZEPHYR … … 1042 1042 1043 1043 /* caller must free the return */ 1044 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip)1044 CALLER_OWN char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip) 1045 1045 { 1046 1046 return g_strdup_printf("%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip); … … 1122 1122 * free the return. 1123 1123 */ 1124 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_getsubs(void)1124 CALLER_OWN char *owl_zephyr_getsubs(void) 1125 1125 { 1126 1126 #ifdef HAVE_LIBZEPHYR … … 1242 1242 * The caller must free the return 1243 1243 */ 1244 G_GNUC_WARN_UNUSED_RESULTchar *short_zuser(const char *in)1244 CALLER_OWN char *short_zuser(const char *in) 1245 1245 { 1246 1246 char *ptr = strrchr(in, '@'); … … 1254 1254 * The caller must free the return. 1255 1255 */ 1256 G_GNUC_WARN_UNUSED_RESULTchar *long_zuser(const char *in)1256 CALLER_OWN char *long_zuser(const char *in) 1257 1257 { 1258 1258 char *ptr = strrchr(in, '@'); … … 1282 1282 * caller must free the return. 1283 1283 */ 1284 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_smartstripped_user(const char *in)1284 CALLER_OWN char *owl_zephyr_smartstripped_user(const char *in) 1285 1285 { 1286 1286 char *slash, *dot, *realm, *out; … … 1324 1324 } 1325 1325 1326 /* read the list of users in 'filename' as a .anyone file, and put the 1327 * names of the zephyr users in the list 'in'. If 'filename' is NULL, 1328 * use the default .anyone file in the users home directory. Returns 1329 * -1 on failure, 0 on success. 1326 /* Read the list of users in 'filename' as a .anyone file, and return as a 1327 * GPtrArray of strings. If 'filename' is NULL, use the default .anyone file 1328 * in the users home directory. Returns NULL on failure. 1330 1329 */ 1331 int owl_zephyr_get_anyone_list(owl_list *in,const char *filename)1330 GPtrArray *owl_zephyr_get_anyone_list(const char *filename) 1332 1331 { 1333 1332 #ifdef HAVE_LIBZEPHYR 1334 1333 char *ourfile, *tmp, *s = NULL; 1335 1334 FILE *f; 1335 GPtrArray *list; 1336 1336 1337 1337 ourfile = owl_zephyr_dotfile(".anyone", filename); … … 1341 1341 owl_function_error("Error opening file %s: %s", ourfile, strerror(errno) ? strerror(errno) : ""); 1342 1342 g_free(ourfile); 1343 return -1;1343 return NULL; 1344 1344 } 1345 1345 g_free(ourfile); 1346 1346 1347 list = g_ptr_array_new(); 1347 1348 while (owl_getline_chomp(&s, f)) { 1348 1349 /* ignore comments, blank lines etc. */ … … 1360 1361 tmp[0] = '\0'; 1361 1362 1362 owl_list_append_element(in, long_zuser(s));1363 g_ptr_array_add(list, long_zuser(s)); 1363 1364 } 1364 1365 g_free(s); 1365 1366 fclose(f); 1366 return 0;1367 #else 1368 return -1;1367 return list; 1368 #else 1369 return NULL; 1369 1370 #endif 1370 1371 }
Note: See TracChangeset
for help on using the changeset viewer.