Changeset 8f95fc4 for perlconfig.c


Ignore:
Timestamp:
Dec 25, 2013, 2:45:30 PM (9 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Children:
58777e9
Parents:
7dcef03
git-author:
Anders Kaseorg <andersk@mit.edu> (12/25/13 12:17:55)
git-committer:
Anders Kaseorg <andersk@mit.edu> (12/25/13 14:45:30)
Message:
Use GData for message attributes

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlconfig.c

    r7dcef03 r8f95fc4  
    6969}
    7070
     71static void owl_perlconfig_store_attribute(GQuark key_id, gpointer data, gpointer h)
     72{
     73  (void)hv_store(h, g_quark_to_string(key_id), strlen(data),
     74                 owl_new_sv(data), 0);
     75}
     76
    7177CALLER_OWN SV *owl_perlconfig_message2hashref(const owl_message *m)
    7278{
     
    7682  char *ptr, *utype, *blessas;
    7783  const char *f;
    78   int i;
    79   const owl_pair *pair;
    8084  const owl_filter *wrap;
    8185
     
    112116  }
    113117
    114   for (i = 0; i < m->attributes->len; i++) {
    115     pair = m->attributes->pdata[i];
    116     (void)hv_store(h, owl_pair_get_key(pair), strlen(owl_pair_get_key(pair)),
    117                    owl_new_sv(owl_pair_get_value(pair)),0);
    118   }
     118  g_datalist_foreach(&((owl_message *)m)->attributes, owl_perlconfig_store_attribute, h);
    119119 
    120120  MSG2H(h, type);
Note: See TracChangeset for help on using the changeset viewer.