version 1.3, 2019/03/06 10:43:25 |
version 1.7, 2022/04/03 00:49:25 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2018/builtin/ctrl.c,v 1.2 2018/09/28 08:20:27 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2018/builtin/ctrl.c,v 1.6 2022/01/27 01:29:31 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
|
|
char *release; |
char *release; |
char *full; |
char *full; |
char *lang; |
char *lang; |
|
#if defined(VISUAL) |
|
int ver_major; |
|
int ver_minor; |
|
int ver_build; |
|
#endif |
} sysinfo; |
} sysinfo; |
|
|
void Pctrl(); |
void Pctrl(); |
Line 115 extern int ASIRLOADPATH_LEN; |
|
Line 120 extern int ASIRLOADPATH_LEN; |
|
extern int No_ox_reset; |
extern int No_ox_reset; |
extern int plot_by_bigfloat; |
extern int plot_by_bigfloat; |
extern int debug_plot; |
extern int debug_plot; |
|
extern int debug_pari; |
|
|
static struct keyval { |
static struct keyval { |
char *key; |
char *key; |
Line 136 static struct keyval { |
|
Line 142 static struct keyval { |
|
{"f4_nocheck",&f4_nocheck,"If set to 1, correctness check of the result of modular computation are omitted in nd_f4()."}, |
{"f4_nocheck",&f4_nocheck,"If set to 1, correctness check of the result of modular computation are omitted in nd_f4()."}, |
{"fake_ox_reset",&No_ox_reset,"Determines the treatment of OX reset request for a server which does not implement the reset protocol."}, |
{"fake_ox_reset",&No_ox_reset,"Determines the treatment of OX reset request for a server which does not implement the reset protocol."}, |
{"fortran_output",&fortran_output,"If set to 1, ** is used instead of ^ for representing the power."}, |
{"fortran_output",&fortran_output,"If set to 1, ** is used instead of ^ for representing the power."}, |
{"hex",&hex_output,"If set to 1, integers are printed by the hexadecimal notation."}, |
{"hex",&hex_output,"If set to 1 (to 2), integers are printed by the hexadecimal (binary) notation."}, |
{"hideargs",&hideargs,"If set to 1, the arguments of a function call are not printed."}, |
{"hideargs",&hideargs,"If set to 1, the arguments of a function call are not printed."}, |
{"message",&do_message,"If set to 1, an opening message is printed in ox_asir and ox_plot."}, |
{"message",&do_message,"If set to 1, an opening message is printed in ox_asir and ox_plot."}, |
{"new_hensel",&use_new_hensel,"If set to 1, a function hensel2() is used in the univariate factorizer over Q."}, |
{"new_hensel",&use_new_hensel,"If set to 1, a function hensel2() is used in the univariate factorizer over Q."}, |
Line 165 static struct keyval { |
|
Line 171 static struct keyval { |
|
{"zerorewrite",&zerorewrite,""}, |
{"zerorewrite",&zerorewrite,""}, |
{"itvplotsize",&Itvplot,""}, |
{"itvplotsize",&Itvplot,""}, |
#endif |
#endif |
|
{"debug_pari",&debug_pari,"If set to 1, ox_pari is executed with the message window."}, |
{0,0}, |
{0,0}, |
}; |
}; |
|
|
Line 434 static char *get_lang() |
|
Line 441 static char *get_lang() |
|
char *c, *p, *q; |
char *c, *p, *q; |
c = setlocale(LC_ALL, NULL); /* saving current locale */ |
c = setlocale(LC_ALL, NULL); /* saving current locale */ |
p = setlocale(LC_ALL, ""); |
p = setlocale(LC_ALL, ""); |
q = (char *)MALLOC(strlen(p)+1); |
if ( p != 0 ) { |
strcpy(q,p); |
q = (char *)MALLOC(strlen(p)+1); |
|
strcpy(q,p); |
|
} else { |
|
q = (char *)MALLOC(2); |
|
strcpy(q,"C"); |
|
} |
setlocale(LC_ALL, c); /* restoring current locale */ |
setlocale(LC_ALL, c); /* restoring current locale */ |
return q; |
return q; |
} |
} |
Line 519 static char *osnameNT(int major, int minor) |
|
Line 531 static char *osnameNT(int major, int minor) |
|
return "Windows8"; |
return "Windows8"; |
}else if (major == 6 && minor == 3) { |
}else if (major == 6 && minor == 3) { |
return "Windows8.1"; |
return "Windows8.1"; |
|
}else if (major == 10 && minor == 0) { |
|
return "Windows10"; |
} |
} |
return "unknown"; |
return "unknown"; |
} |
} |
Line 547 static char *get_lang() |
|
Line 561 static char *get_lang() |
|
return "en"; // English |
return "en"; // English |
} |
} |
|
|
|
void get_version_win8(int *major,int *minor,int *build) |
|
{ |
|
char *res; |
|
char fname[4096]; /* fullpath of kernel32.dll (_MAX_PATH==260)*/ |
|
char cmd[4096]; |
|
int size; |
|
char *version_string; |
|
struct LANGANDCODEPAGE { |
|
WORD language; |
|
WORD codepage; |
|
}* lang; |
|
sprintf(fname,"%s\\system32\\kernel32.dll", getenv("SYSTEMROOT")); |
|
size=GetFileVersionInfoSize(fname,0); |
|
res = (char *)MALLOC(size+1); |
|
if(GetFileVersionInfo(fname,0,size+1,res)) { |
|
VerQueryValue(res,"\\VarFileInfo\\Translation",&lang,&size); |
|
sprintf(cmd,"\\StringFileInfo\\%04x%04x\\ProductVersion",lang->language,lang->codepage); |
|
VerQueryValue(res,cmd,&version_string,&size); |
|
sscanf(version_string,"%d.%d.%d.",major,minor,build); |
|
} |
|
} |
|
|
static void get_sysinfo() |
static void get_sysinfo() |
{ |
{ |
int arch64 = 0; |
int arch64 = 0; |
Line 562 static void get_sysinfo() |
|
Line 598 static void get_sysinfo() |
|
|
|
v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); |
v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); |
GetVersionEx(&v); |
GetVersionEx(&v); |
|
/* Windows8 == version 6.2 */ |
|
if (v.dwPlatformId == VER_PLATFORM_WIN32_NT |
|
&& v.dwMajorVersion == 6 && v.dwMinorVersion >= 2) { |
|
get_version_win8(&v.dwMajorVersion, &v.dwMinorVersion, &v.dwBuildNumber); |
|
} |
|
sysinfo.ver_major=v.dwMajorVersion; |
|
sysinfo.ver_minor=v.dwMinorVersion; |
|
sysinfo.ver_build=v.dwBuildNumber; |
|
|
sysinfo.type = "windows"; |
sysinfo.type = "windows"; |
sysinfo.arch = "x86"; |
sysinfo.arch = "x86"; |