src/log.c
int yaz_log_mask_str_x(const char *str, int level)
{
    const char *p;

    while (*str)
    {
        int negated = 0;
        for (p = str; *p && *p != ','; p++)
            ;
        if (*str=='-')
        {
            negated = 1;
            str++;
        }
        if (yaz_isdigit(*str))
        {
            level = atoi(str);
        }
        else
        {
            char clean[509];
            char *n = clean_name(str, (size_t) (p - str), clean, sizeof(clean));
            int mask = define_module_bit(n);
            if (!mask)
                level = 0;  /* 'none' clears them all */
            else if (negated)
                level &= ~mask;
            else
                level |= mask;
        }
        if (*p == ',')
            p++;
        str = p;
    }
    return level;
}
/* this function is called by yaz_log_init_globals & yaz_init_globals
   and, thus, may not call any of them indirectly */
this function is called by yaz_log_init_globals & yaz_init_globals
and, thus, may not call any of them indirectly
this function is called by yaz_log_init_globals & yaz_init_globals and thus may not call any of them indirectly
int yaz_log_mask_str_x(const char *str, int level)
{
    const char *p;
    while (*str)
    {
        int negated = 0;
        for (p = str; *p && *p != ','; p++)
            ;
        if (*str=='-')
        {
            negated = 1;
            str++;
        }
        if (yaz_isdigit(*str))
        {
            level = atoi(str);
        }
        else
        {
            char clean[509];
            char *n = clean_name(str, (size_t) (p - str), clean, sizeof(clean));
            int mask = define_module_bit(n);
            if (!mask)
                level = 0;  
            else if (negated)
                level &= ~mask;
            else
                level |= mask;
        }
        if (*p == ',')
            p++;
        str = p;
    }
    return level;
}
int yaz_log_mask_str_x ( const char * str , int level ) { const char * p ; while ( * str ) { int negated = 0 ; for ( p = str ; * p && * p != ' ' ; p ++ ) ; if ( * str == ' ' ) { negated = 1 ; str ++ ; } if ( yaz_isdigit ( * str ) ) { level = atoi ( str ) ; } else { char clean [ 509 ] ; char * n = clean_name ( str , ( size_t ) ( p - str ) , clean , sizeof ( clean ) ) ; int mask = define_module_bit ( n ) ; if ( ! mask ) level = 0 ; else if ( negated ) level &= ~ mask ; else level |= mask ; } if ( * p == ' ' ) p ++ ; str = p ; } return level ; }
this function is called by yaz_log_init_globals & yaz_init_globals
and, thus, may not call any of them indirectly
this function is called by yaz_log_init_globals & yaz_init_globals and thus may not call any of them indirectly
/* 'none' clears them all */