13#include "factory/factory.h"
15#define FE_OPT_STRUCTURE
18#if !defined(GENERATE_OPTION_INDEX) && !defined(ESINGULAR) && !defined(TSINGULAR)
26#include <flint/flint.h>
35#ifdef GENERATE_OPTION_INDEX
44 fd = fopen(
"feOptES.xx",
"w");
45#elif defined(TSINGULAR)
46 fd = fopen(
"feOptTS.xx",
"w");
48 fd = fopen(
"feOpt.xx",
"w");
55 fputs(
"typedef enum\n{\n",
fd);
67 else if (*
name >= 97 && *
name <= 122)
85 fprintf(
fd,
"FE_OPT_UNDEF\n} feOptIndex;\n");
88 rename(
"feOptES.xx",
"feOptES.inc");
89#elif defined(TSINGULAR)
90 rename(
"feOptTS.xx",
"feOptTS.inc");
92 rename(
"feOpt.xx",
"feOpt.inc");
139#if !defined(ESINGULAR) && !defined(TSINGULAR)
166 if (errno)
return "invalid integer argument";
195 return "option value needs to be an integer";
251 if (si_echo < 0 || si_echo > 9)
252 return "argument of option is not in valid range 0..9";
288 case FE_OPT_MIN_TIME:
291 if (
mintime <= 0)
return "invalid float argument";
299 case FE_OPT_TICKS_PER_SEC:
301 int ticks = (int) ((
long)(
feOptSpec[FE_OPT_TICKS_PER_SEC].
value));
303 return "integer argument must be larger than 0";
308 case FE_OPT_DUMP_VERSIONTUPLE:
315 #if __FLINT_RELEASE >= 20503
316 case FE_OPT_FLINT_THREADS:
319 nthreads = FLINT_MAX(nthreads, WORD(1));
320 flint_set_num_threads(nthreads);
321 int * cpu_affinities =
new int[nthreads];
322 for (
slong i = 0;
i < nthreads;
i++)
323 cpu_affinities[
i] = (
int)
i;
324 flint_set_thread_affinity(cpu_affinities, nthreads);
325 delete[] cpu_affinities;
376#if defined(ESINGULAR)
377 printf(
"ESingular starts up Singular within emacs;\n");
378#elif defined(TSINGULAR)
379 printf(
"TSingular starts up Singular within a terminal window;\n");
381 printf(
"Singular is a Computer Algebra System (CAS) for Polynomial Computations.\n");
382 printf(
"Usage: %s [options] [file1 [file2 ...]]\n",
name);
383 printf(
"Options:\n");
400 printf(
" %c%c --%-20s %s\n",
408 printf(
" %c%c --%-20s %s\n",
418 printf(
"\nFor more information, type `help;' from within Singular or visit\n");
419 printf(
"https://www.singular.uni-kl.de or consult the\n");
420 printf(
"Singular manual (available as on-line info or html manual).\n");
425 printf(
"%s\n",VERSION);
void factoryseed(int s)
random seed initializer
const CanonicalForm int s
#define LONG_OPTION_RETURN
const char SHORT_OPTS_STRING[]
feOptIndex feGetOptIndex(const char *name)
const char * feSetOptValue(feOptIndex opt, char *optarg)
static const char * feOptAction(feOptIndex opt)
void feOptDumpVersionTuple(void)
void feOptHelp(const char *name)
EXTERN_VAR struct fe_option feOptSpec[]
static char * feResource(feResourceConfig config, int warn)
const char * feHelpBrowser(char *which, int warn)
char * fe_fgets_dummy(const char *, char *, int)
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
char * fe_fgets(const char *pr, char *s, int size)
int name
New type name for int.
void SetMinDisplayTime(double mtime)
STATIC_VAR double mintime
void SetTimerResolution(int res)