src/core/config/parser.c
/**
 * Here we will handle the create of a simple numeric value
 */
Here we will handle the create of a simple numeric value
Here we will handle the create of a simple numeric value
static struct config_value *parser_parse_number(const struct parser *parser, char *value)
{
        intmax_t number = 0;
        enum natwm_error err = string_to_number(value, &number);
        if (err != NO_ERROR) {
                LOG_ERROR(natwm_logger,
                          "Invalid numeric value '%s' found - Line %zu",
                          value,
                          parser->line_num);
                return NULL;
        }
        struct config_value *config_value = config_value_create_number(number);
        if (config_value == NULL) {
                return NULL;
        }
        free(value);
        return config_value;
}
static struct config_value * parser_parse_number ( const struct parser * parser , char * value ) { intmax_t number = 0 ; enum natwm_error err = string_to_number ( value , & number ) ; if ( err != NO_ERROR ) { LOG_ERROR ( natwm_logger , " " , value , parser -> line_num ) ; return NULL ; } struct config_value * config_value = config_value_create_number ( number ) ; if ( config_value == NULL ) { return NULL ; } free ( value ) ; return config_value ; }
Here we will handle the create of a simple numeric value
Here we will handle the create of a simple numeric value
// We no longer need this value