support parms.h

pass argv[0]
This commit is contained in:
Vitor Santos Costa
2009-10-23 09:09:16 +01:00
parent da0186a0aa
commit 253444d7ca
11 changed files with 154 additions and 41 deletions

View File

@@ -292,6 +292,11 @@ add_end_dot(char arg[])
return arg;
}
static int
dump_runtime_variables(void)
{
}
/*
* proccess command line arguments: valid switches are: -b boot -s
* stack area size (K) -h heap area size -a aux stack size -e
@@ -336,8 +341,13 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
ssize = &(iap->NumberWorkers);
goto GetSize;
case 'd':
if (!strcmp("dump-runtime-variables",p))
return dump_runtime_variables();
ssize = &(iap->DelayedReleaseLoad);
goto GetSize;
#else
if (!strcmp("dump-runtime-variables",p))
return dump_runtime_variables();
#endif /* ENV_COPY || ACOW || SBA */
#ifdef USE_SOCKET
case 'c': /* running as client */
@@ -746,14 +756,15 @@ init_standard_system(int argc, char *argv[], YAP_init_args *iap)
iap->ErrorNo = 0;
iap->ErrorCause = NULL;
iap->QuietMode = FALSE;
iap->Argv0 = argv[0];
BootMode = parse_yap_arguments(argc,argv,iap);
if (BootMode == YAP_FULL_BOOT_FROM_PROLOG) {
#if HAVE_STRNCAT
strncpy(boot_file, PL_SRC_DIR, 256);
strncpy(boot_file, YAP_PL_SRCDIR, 256);
#else
strcpy(boot_file, PL_SRC_DIR);
strcpy(boot_file, YAP_PL_SRCDIR);
#endif
#if HAVE_STRNCAT
strncat(boot_file, BootFile, 255);
@@ -805,9 +816,9 @@ exec_top_level(int BootMode, YAP_init_args *iap)
YAP_Term goal, as[2];
#if HAVE_STRNCAT
strncpy(init_file, PL_SRC_DIR, 256);
strncpy(init_file, YAP_PL_SRCDIR, 256);
#else
strcpy(init_file, PL_SRC_DIR);
strcpy(init_file, YAP_PL_SRCDIR);
#endif
#if HAVE_STRNCAT
strncat(init_file, InitFile, 255);