Skip to content
Snippets Groups Projects
Commit e0bd46c4 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

cosmetic change

parent c30543cd
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#include <stdint.h>
//#include <stdio.h> //#include <stdio.h>
#include <oblibs/error2.h> #include <oblibs/error2.h>
...@@ -34,56 +35,56 @@ ...@@ -34,56 +35,56 @@
#include <66/parser.h> #include <66/parser.h>
int parser(sv_alltype *service,stralloc *src,char const *file) int parser(sv_alltype *service,stralloc *src,char const *svname)
{ {
int r ; int r , svtype = -1 ;
int svtype = -1 ; size_t i = 0 ;
section_t sasection = SECTION_ZERO ; section_t sasection = SECTION_ZERO ;
genalloc ganocheck = GENALLOC_ZERO ; genalloc ganocheck = GENALLOC_ZERO ;
sasection.file = file ; sasection.file = svname ;
r = section_get_range(&sasection,src) ; r = section_get_range(&sasection,src) ;
if (r <= 0){ if (r <= 0){
strerr_warnwu2x("parse section of service file: ",file) ; strerr_warnwu2x("parse section of service file: ",svname) ;
goto err ; goto err ;
} }
if (!sasection.idx[MAIN]) if (!sasection.idx[MAIN])
{ {
VERBO1 strerr_warnw2x("missing section [main] in service file: ", file) ; VERBO1 strerr_warnw2x("missing section [main] in service file: ", svname) ;
goto err ; goto err ;
} }
if (!key_get_range(&ganocheck,&sasection,&svtype)) goto err ; if (!key_get_range(&ganocheck,&sasection,&svtype)) goto err ;
if (svtype < 0) if (svtype < 0)
{ {
VERBO1 strerr_warnw2x("invalid value for key: @type in service file: ",file) ; VERBO1 strerr_warnw4x("invalid value for key: ",get_keybyid(TYPE)," in service file: ",svname) ;
goto err ; goto err ;
} }
if (svtype != BUNDLE && !sasection.idx[START]) if (svtype != BUNDLE && !sasection.idx[START])
{ {
VERBO1 strerr_warnw2x("missing section [start] in service file: ", file) ; VERBO1 strerr_warnw2x("missing section [start] in service file: ", svname) ;
goto err ; goto err ;
} }
if (!genalloc_len(keynocheck,&ganocheck)){ if (!genalloc_len(keynocheck,&ganocheck)){
VERBO1 strerr_warnw2x("empty service file: ",file) ; VERBO1 strerr_warnw2x("empty service file: ",svname) ;
goto err ; goto err ;
} }
for (unsigned int i = 0;i < genalloc_len(keynocheck,&ganocheck);i++) for (i = 0;i < genalloc_len(keynocheck,&ganocheck);i++)
{ {
uint32_t idsec = genalloc_s(keynocheck,&ganocheck)[i].idsec ; uint32_t idsec = genalloc_s(keynocheck,&ganocheck)[i].idsec ;
for (int j = 0;j < total_list_el[idsec] && total_list[idsec].list > 0;j++) for (unsigned int j = 0;j < total_list_el[idsec] && total_list[idsec].list > 0;j++)
{ {
if (!get_mandatory(&ganocheck,idsec,j)) if (!get_mandatory(&ganocheck,idsec,j))
{ {
VERBO1 strerr_warnw2x("mandatory key is missing in service file: ",file) ; VERBO1 strerr_warnw2x("mandatory key is missing in service file: ",svname) ;
goto err ; goto err ;
} }
} }
} }
for (unsigned int i = 0;i < genalloc_len(keynocheck,&ganocheck);i++) for (i = 0;i < genalloc_len(keynocheck,&ganocheck);i++)
{ {
if (!nocheck_toservice(&(genalloc_s(keynocheck,&ganocheck)[i]),svtype,service)) if (!nocheck_toservice(&(genalloc_s(keynocheck,&ganocheck)[i]),svtype,service))
{ {
VERBO1 strerr_warnwu2x("keep information of service file: ",file) ; VERBO1 strerr_warnwu2x("keep information of service file: ",svname) ;
goto err ; goto err ;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment