server/modules/selva/module/subscriptions.c
static int field_match(const char *list, const char *field_str, size_t field_len) {
    int match = 0;

    if (list[0] == '\0') {
        /* Empty string equals to a wildcard */
        match = 1;
    } else {
        /* Test if field matches to any of the fields in list. */
        const char *sep = ".";
        char *p;

        match = stringlist_searchn(list, field_str, field_len);

        /* Test for each subfield if there was no exact match. */
        if (!match && (p = strstr(field_str, sep))) {
            do {
                const size_t len = (ptrdiff_t)p++ - (ptrdiff_t)field_str;

                match = stringlist_searchn(list, field_str, len);
            } while (!match && p && (p = strstr(p, sep)));
        }
    }

    return match;
}
/**
 * Check if the field matches to one of fields in list.
 * @param field_str is a nul-terminated field name.
 */
Check if the field matches to one of fields in list.
@param field_str is a nul-terminated field name.
Check if the field matches to one of fields in list . @param field_str is a nul - terminated field name .
static int field_match(const char *list, const char *field_str, size_t field_len) {
    int match = 0;
    if (list[0] == '\0') {
        match = 1;
    } else {
        const char *sep = ".";
        char *p;
        match = stringlist_searchn(list, field_str, field_len);
        if (!match && (p = strstr(field_str, sep))) {
            do {
                const size_t len = (ptrdiff_t)p++ - (ptrdiff_t)field_str;
                match = stringlist_searchn(list, field_str, len);
            } while (!match && p && (p = strstr(p, sep)));
        }
    }
    return match;
}
static int field_match ( const char * list , const char * field_str , size_t field_len ) { int match = 0 ; if ( list [ 0 ] == ' \0 ' ) { match = 1 ; } else { const char * sep = " " ; char * p ; match = stringlist_searchn ( list , field_str , field_len ) ; if ( ! match && ( p = strstr ( field_str , sep ) ) ) { do { const size_t len = ( ptrdiff_t ) p ++ - ( ptrdiff_t ) field_str ; match = stringlist_searchn ( list , field_str , len ) ; } while ( ! match && p && ( p = strstr ( p , sep ) ) ) ; } } return match ; }
Check if the field matches to one of fields in list.
Check if the field matches to one of fields in list .
/* Empty string equals to a wildcard */ /* Test if field matches to any of the fields in list. */ /* Test for each subfield if there was no exact match. */