ERROR(srv,"expire: error parsing rule \"%s\", <type> must be one of 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months' or 'years'",val->data.string->str);
returnNULL;
if(!num){
g_slice_free(expire_rule,rule);
ERROR(srv,"expire: error parsing rule \"%s\", <num> must be a positive integer",val->data.string->str);
returnNULL;
}
/* parse <type> */
if(g_str_has_prefix(str," second")){
num*=1;
str+=sizeof(" second")-1;
}elseif(g_str_has_prefix(str," minute")){
num*=60;
str+=sizeof(" minute")-1;
}elseif(g_str_has_prefix(str," hour")){
num*=3600;
str+=sizeof(" hour")-1;
}elseif(g_str_has_prefix(str," day")){
num*=3600*24;
str+=sizeof(" day")-1;
}elseif(g_str_has_prefix(str," week")){
num*=3600*24*7;
str+=sizeof(" week")-1;
}elseif(g_str_has_prefix(str," month")){
num*=3600*24*30;
str+=sizeof(" month")-1;
}elseif(g_str_has_prefix(str," year")){
num*=3600*24*365;
str+=sizeof(" year")-1;
}else{
g_slice_free(expire_rule,rule);
ERROR(srv,"expire: error parsing rule \"%s\", <type> must be one of 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months' or 'years'",val->data.string->str);
returnNULL;
}
rule->num+=num;
if(*str=='s')
str++;
if(*str=='')
str++;
elseif(*str){
g_slice_free(expire_rule,rule);
ERROR(srv,"expire: error parsing rule \"%s\", <type> must be one of 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months' or 'years'",val->data.string->str);