};
void
-gras_init(int argc, char **argv) {
+gras_init(int *argc, char **argv) {
gras_init_defaultlog(argc, argv, NULL);
}
* Initialize the gras mecanisms.
*/
void
-gras_init_defaultlog(int argc,char **argv, const char *defaultlog) {
- int i;
+gras_init_defaultlog(int *argc,char **argv, const char *defaultlog) {
+ int i,j;
char *opt;
gras_error_t errcode;
int found=0;
INFO0("Initialize GRAS");
/** Set logs and init log submodule */
- for (i=1; i<argc; i++) {
+ for (i=1; i<*argc; i++) {
if (!strncmp(argv[i],"--gras-log=",strlen("--gras-log="))) {
found = 1;
opt=strchr(argv[i],'=');
opt++;
TRYFAIL(gras_log_control_set(opt));
+ DEBUG1("Did apply '%s' as log setting",opt);
+ /*remove this from argv*/
+ for (j=i+1; j<*argc; j++) {
+ argv[j-1] = argv[j];
+ }
+ argv[j-1] = NULL;
+ (*argc)--;
+ i--; /* compensate effect of next loop incrementation */
+ WARN1("argc %d",*argc);
}
}
if (!found && defaultlog) {
}
/** init other submodules */
+ gras_msg_init();
gras_trp_init();
+ gras_datadesc_init();
}
/**
* gras_exit:
- * @argc:
- * @argv:
*
* Finalize the gras mecanisms.
*/
void
gras_exit(){
+ INFO0("Exiting GRAS");
+ gras_msg_exit();
gras_trp_exit();
+ gras_datadesc_exit();
gras_log_exit();
+ DEBUG0("Exited GRAS");
}