mcabber/src/roster.c
changeset 336 eb994ee40029
parent 331 1510dda4ad71
child 364 33b8e801ffa6
equal deleted inserted replaced
335:3ec329a1c621 336:eb994ee40029
    50 
    50 
    51 
    51 
    52 /* ### Roster functions ### */
    52 /* ### Roster functions ### */
    53 
    53 
    54 // Comparison function used to search in the roster (compares jids and types)
    54 // Comparison function used to search in the roster (compares jids and types)
    55 gint roster_compare_jid_type(roster *a, roster *b) {
    55 static gint roster_compare_jid_type(roster *a, roster *b) {
    56   if (! (a->type & b->type))
    56   if (! (a->type & b->type))
    57     return -1; // arbitrary (but should be != , of course)
    57     return -1; // arbitrary (but should be != , of course)
    58   return strcasecmp(a->jid, b->jid);
    58   return strcasecmp(a->jid, b->jid);
    59 }
    59 }
    60 
    60 
    61 // Comparison function used to sort the roster (by name)
    61 // Comparison function used to sort the roster (by name)
    62 gint roster_compare_name(roster *a, roster *b) {
    62 static gint roster_compare_name(roster *a, roster *b) {
    63   return strcasecmp(a->name, b->name);
    63   return strcasecmp(a->name, b->name);
    64 }
    64 }
    65 
    65 
    66 // Finds a roster element (user, group, agent...), by jid or name
    66 // Finds a roster element (user, group, agent...), by jid or name
    67 // If roster_type is 0, returns match of any type.
    67 // If roster_type is 0, returns match of any type.