Navigation


Changeset 770:27fef2ca2cf6 in freeDiameter


Ignore:
Timestamp:
Oct 30, 2011, 8:33:28 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Improved usability of fd_dict_getlistof for vendors and apps

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/dictionary.c

    r769 r770  
    19691969        new->dict_vendors.data.vendor.vendor_name = NO_VENDOR_NAME;
    19701970        new->dict_vendors.datastr_len = CONSTSTRLEN(NO_VENDOR_NAME);
    1971         new->dict_vendors.list[0].o = NULL; /* overwrite since element is also sentinel for this list. */
     1971        /* new->dict_vendors.list[0].o = NULL; *//* overwrite since element is also sentinel for this list. */
    19721972        new->dict_vendors.dico = new;
    19731973       
     
    19771977        new->dict_applications.data.application.application_name = APPLICATION_0_NAME;
    19781978        new->dict_applications.datastr_len = CONSTSTRLEN(APPLICATION_0_NAME);
    1979         new->dict_applications.list[0].o = NULL; /* overwrite since since element is also sentinel for this list. */
     1979        /* new->dict_applications.list[0].o = NULL; *//* overwrite since since element is also sentinel for this list. */
    19801980        new->dict_applications.dico = new;
    19811981                       
  • tests/testdict.c

    r769 r770  
    137137                struct dict_object * defvnd=NULL;
    138138                vendor_id_t vid = 0;
     139                int first = 1;
    139140               
    140141                CHECK( 0, fd_dict_getlistof(VENDOR_BY_ID, fd_g_config->cnf_dict, &sentinel));
    141142               
    142                 for (li = sentinel->next; li != sentinel; li = li->next) {
     143                for (li = sentinel; (li != sentinel) || (first != 0); li = li->next) {
     144                        first = 0;
    143145                        CHECK(0, fd_dict_gettype(li->o, &type));
    144146                        CHECK(DICT_VENDOR, type);
     147#if 0
     148                        struct dict_vendor_data data;
     149                        CHECK( 0, fd_dict_getval(li->o, &data) );
     150                        printf("%d : %s\n", data.vendor_id, data.vendor_name);
     151#endif
    145152                }
    146153               
Note: See TracChangeset for help on using the changeset viewer.