/** Predicate function used to find an option by id. */ static int pred_find_auid_by_id(const tsk_list_item_t *item, const void *id) { if(item && item->data){ txcap_auid_t *auid = item->data; return tsk_stricmp(auid->id, (const char*)id); } return -1; }
/* Predicate function used to find a parameter by name (case-insensitive). */ static int pred_find_param_by_name(const tsk_list_item_t *item, const void *name) { if(item && item->data){ tsk_param_t *param = item->data; return tsk_stricmp(param->name, name); } return -1; }
/*== Predicate function to find thttp_header_t object by name. */ static int pred_find_header_by_name(const tsk_list_item_t *item, const void *name) { if(item && item->data) { thttp_header_t *header = item->data; return tsk_stricmp(thttp_header_get_nameex(header), name); } return -1; }
static int pred_find_string_by_value(const tsk_list_item_t *item, const void *stringVal) { if(item && item->data) { tsk_string_t *string = item->data; return tsk_stricmp(string->value, stringVal); } return -1; }
static int tsk_string_cmp(const tsk_object_t *_s1, const tsk_object_t *_s2) { const tsk_string_t *s1 = _s1; const tsk_string_t *s2 = _s2; if(s1 && s2){ return tsk_stricmp(s1->value, s2->value); } else if(!s1 && !s2) return 0; else return -1; }
static int txcap_auid_cmp(const tsk_object_t *_a1, const tsk_object_t *_a2) { const txcap_auid_t *a1 = _a1; const txcap_auid_t *a2 = _a2; if(a1 && a2){ return tsk_stricmp(a1->id, a2->id); } else{ return -1; } }
/**@ingroup tmedia_codec_group * Generic function to compare two codecs. * @param codec1 The first codec to compare. * @param codec2 The second codec to compare. * @retval Returns an integral value indicating the relationship between the two codecs: * <0 : @a codec1 less than @a codec2.<br> * 0 : @a codec1 identical to @a codec2.<br> * >0 : @a codec1 greater than @a codec2.<br> */ int tmedia_codec_cmp(const tsk_object_t* codec1, const tsk_object_t* codec2) { const tmedia_codec_t* _c1 = codec1; const tmedia_codec_t* _c2 = codec2; if((_c1 && _c2) && (_c1->type == _c2->type)) { /* Do not compare names. For example, H264 base profile 1.0 will have the * same name than H264 base profile 3.0. */ return tsk_stricmp(_c1->format, _c2->format); } else { return -1; } }