allow -L option to be used for stack size (in SWI compatibility).

This commit is contained in:
Vitor Santos Costa 2008-08-23 17:48:38 +01:00
parent 88759dbb33
commit e0f108ee55

View File

@ -397,6 +397,7 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
#endif #endif
case 's': case 's':
case 'S': case 'S':
stack_mode:
ssize = &(iap->StackSize); ssize = &(iap->StackSize);
#if defined(ENV_COPY) || defined(ACOW) || defined(SBA) #if defined(ENV_COPY) || defined(ACOW) || defined(SBA)
if (p[1] == 'l') { if (p[1] == 'l') {
@ -428,6 +429,22 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
int i = 0, ch; int i = 0, ch;
while ((ch = *p++) >= '0' && ch <= '9') while ((ch = *p++) >= '0' && ch <= '9')
i = i * 10 + ch - '0'; i = i * 10 + ch - '0';
switch(ch) {
case 'M':
case 'm':
i *= 1024;
ch = *p++;
break;
case 'g':
case 'G':
i *= 1024*1024;
ch = *p++;
break;
case 'k':
case 'K':
ch = *p++;
break;
}
if (ch) { if (ch) {
iap->YapPrologTopLevelGoal = add_end_dot(*argv); iap->YapPrologTopLevelGoal = add_end_dot(*argv);
} else { } else {
@ -456,6 +473,22 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
int i = 0, ch; int i = 0, ch;
while ((ch = *p++) >= '0' && ch <= '9') while ((ch = *p++) >= '0' && ch <= '9')
i = i * 10 + ch - '0'; i = i * 10 + ch - '0';
switch(ch) {
case 'M':
case 'm':
i *= 1024;
ch = *p++;
break;
case 'g':
case 'G':
i *= 1024*1024;
ch = *p++;
break;
case 'k':
case 'K':
ch = *p++;
break;
}
if (ch) if (ch)
{ {
fprintf(stderr,"[ YAP unrecoverable error: illegal size specification %s ]", argv[-1]); fprintf(stderr,"[ YAP unrecoverable error: illegal size specification %s ]", argv[-1]);
@ -471,6 +504,8 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
break; break;
#endif #endif
case 'L': case 'L':
if (p[0])
goto stack_mode;
iap->QuietMode = TRUE; iap->QuietMode = TRUE;
iap->HaltAfterConsult = TRUE; iap->HaltAfterConsult = TRUE;
case 'l': case 'l':