Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    recffae6 rd427f08  
    524524 */
    525525#ifdef HAVE_LIBZEPHYR
    526 CALLER_OWN char *owl_zephyr_get_field(const ZNotice_t *n, int j)
     526G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_get_field(const ZNotice_t *n, int j)
    527527{
    528528  int i, count, save;
     
    552552}
    553553
    554 CALLER_OWN char *owl_zephyr_get_field_as_utf8(const ZNotice_t *n, int j)
     554G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_get_field_as_utf8(const ZNotice_t *n, int j)
    555555{
    556556  int i, count, save;
     
    584584}
    585585#else
    586 CALLER_OWN char *owl_zephyr_get_field(void *n, int j)
     586G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_get_field(void *n, int j)
    587587{
    588588  return(g_strdup(""));
    589589}
    590 CALLER_OWN char *owl_zephyr_get_field_as_utf8(void *n, int j)
     590G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_get_field_as_utf8(void *n, int j)
    591591{
    592592  return owl_zephyr_get_field(n, j);
     
    621621 * caller must free the return
    622622 */
    623 CALLER_OWN char *owl_zephyr_get_message(const ZNotice_t *n, const owl_message *m)
     623G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_get_message(const ZNotice_t *n, const owl_message *m)
    624624{
    625625#define OWL_NFIELDS     5
     
    838838      zw.opcode = g_strdup(retnotice->z_opcode);
    839839      zw.zsig   = g_strdup("");
    840       zw.recips = g_ptr_array_new();
    841       g_ptr_array_add(zw.recips, g_strdup(retnotice->z_recipient));
     840      owl_list_create(&(zw.recips));
     841      owl_list_append_element(&(zw.recips), g_strdup(retnotice->z_recipient));
    842842
    843843      owl_log_outgoing_zephyr_error(&zw, buff);
     
    942942#endif
    943943
    944 CALLER_OWN char *owl_zephyr_zlocate(const char *user, int auth)
     944G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_zlocate(const char *user, int auth)
    945945{
    946946#ifdef HAVE_LIBZEPHYR
     
    10421042
    10431043/* caller must free the return */
    1044 CALLER_OWN char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip)
     1044G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip)
    10451045{
    10461046  return g_strdup_printf("%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip);
     
    11221122 * free the return.
    11231123 */
    1124 CALLER_OWN char *owl_zephyr_getsubs(void)
     1124G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_getsubs(void)
    11251125{
    11261126#ifdef HAVE_LIBZEPHYR
     
    12421242 * The caller must free the return
    12431243 */
    1244 CALLER_OWN char *short_zuser(const char *in)
     1244G_GNUC_WARN_UNUSED_RESULT char *short_zuser(const char *in)
    12451245{
    12461246  char *ptr = strrchr(in, '@');
     
    12541254 * The caller must free the return.
    12551255 */
    1256 CALLER_OWN char *long_zuser(const char *in)
     1256G_GNUC_WARN_UNUSED_RESULT char *long_zuser(const char *in)
    12571257{
    12581258  char *ptr = strrchr(in, '@');
     
    12821282 * caller must free the return.
    12831283 */
    1284 CALLER_OWN char *owl_zephyr_smartstripped_user(const char *in)
     1284G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_smartstripped_user(const char *in)
    12851285{
    12861286  char *slash, *dot, *realm, *out;
     
    13241324}
    13251325
    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.
     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.
    13291330 */
    1330 GPtrArray *owl_zephyr_get_anyone_list(const char *filename)
     1331int owl_zephyr_get_anyone_list(owl_list *in, const char *filename)
    13311332{
    13321333#ifdef HAVE_LIBZEPHYR
    13331334  char *ourfile, *tmp, *s = NULL;
    13341335  FILE *f;
    1335   GPtrArray *list;
    13361336
    13371337  ourfile = owl_zephyr_dotfile(".anyone", filename);
     
    13411341    owl_function_error("Error opening file %s: %s", ourfile, strerror(errno) ? strerror(errno) : "");
    13421342    g_free(ourfile);
    1343     return NULL;
     1343    return -1;
    13441344  }
    13451345  g_free(ourfile);
    13461346
    1347   list = g_ptr_array_new();
    13481347  while (owl_getline_chomp(&s, f)) {
    13491348    /* ignore comments, blank lines etc. */
     
    13611360      tmp[0] = '\0';
    13621361
    1363     g_ptr_array_add(list, long_zuser(s));
     1362    owl_list_append_element(in, long_zuser(s));
    13641363  }
    13651364  g_free(s);
    13661365  fclose(f);
    1367   return list;
    1368 #else
    1369   return NULL;
     1366  return 0;
     1367#else
     1368  return -1;
    13701369#endif
    13711370}
Note: See TracChangeset for help on using the changeset viewer.