added hcl_getsynerrnum() and enhanced EOF handling
This commit is contained in:
		| @ -1674,6 +1674,7 @@ int main (int argc, char* argv[]) | ||||
| 		{ ":log",         'l' }, | ||||
| 		{ ":memsize",     'm' }, | ||||
| 		{ "large-pages",  '\0' }, | ||||
| 		{ "cli-mode",     '\0' }, | ||||
| #if defined(HCL_BUILD_DEBUG) | ||||
| 		{ ":debug",       '\0' }, /* NOTE: there is no short option for --debug */ | ||||
| #endif | ||||
| @ -1688,6 +1689,7 @@ int main (int argc, char* argv[]) | ||||
| 	const char* logopt = HCL_NULL; | ||||
| 	hcl_oow_t memsize = MIN_MEMSIZE; | ||||
| 	int large_pages = 0; | ||||
| 	int cli_mode = 0; | ||||
|  | ||||
| #if defined(HCL_BUILD_DEBUG) | ||||
| 	const char* dbgopt = HCL_NULL; | ||||
| @ -1722,6 +1724,11 @@ int main (int argc, char* argv[]) | ||||
| 					large_pages = 1; | ||||
| 					break; | ||||
| 				} | ||||
| 				else if (hcl_comp_bcstr(opt.lngopt, "cli-mode") == 0) | ||||
| 				{ | ||||
| 					cli_mode = 1; | ||||
| 					break; | ||||
| 				} | ||||
| 			#if defined(HCL_BUILD_DEBUG) | ||||
| 				else if (hcl_comp_bcstr(opt.lngopt, "debug") == 0) | ||||
| 				{ | ||||
| @ -1788,6 +1795,8 @@ int main (int argc, char* argv[]) | ||||
|  | ||||
| 		/*trait |= HCL_NOGC;*/ | ||||
| 		trait |= HCL_AWAIT_PROCS; | ||||
|  | ||||
| 		if (cli_mode) trait |= HCL_CLI_MODE; | ||||
| 		hcl_setoption (hcl, HCL_TRAIT, &trait); | ||||
|  | ||||
| 		/* disable GC logs */ | ||||
| @ -1879,7 +1888,7 @@ count++; | ||||
| 			else if (hcl->errnum == HCL_ESYNERR) | ||||
| 			{ | ||||
| 				print_synerr (hcl); | ||||
| 				if (xtn->reader_istty) continue; | ||||
| 				if (xtn->reader_istty && hcl_getsynerrnum(hcl) != HCL_SYNERR_EOF) continue; | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user