MCPcopy Create free account
hub / github.com/Singular/Singular / feOptAction

Function feOptAction

Singular/feOpt.cc:202–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202static const char* feOptAction(feOptIndex opt)
203{
204 // do some special actions
205 switch(opt)
206 {
207 case FE_OPT_BATCH:
208 if (feOptSpec[FE_OPT_BATCH].value)
209 fe_fgets_stdin=fe_fgets_dummy;
210 return NULL;
211
212 case FE_OPT_HELP:
213 feOptHelp(feArgv0);
214 return NULL;
215
216 case FE_OPT_PROFILE:
217 traceit=1024;
218 return NULL;
219
220 case FE_OPT_QUIET:
221 if (feOptSpec[FE_OPT_QUIET].value)
222 si_opt_2 &= ~(Sy_bit(0)|Sy_bit(V_LOAD_LIB));
223 else
224 si_opt_2 |= Sy_bit(V_LOAD_LIB)|Sy_bit(0);
225 return NULL;
226
227 case FE_OPT_NO_TTY:
228 if (feOptSpec[FE_OPT_NO_TTY].value)
229 fe_fgets_stdin=fe_fgets;
230 return NULL;
231
232 case FE_OPT_SDB:
233 #ifdef HAVE_SDB
234 if (feOptSpec[FE_OPT_SDB].value)
235 sdb_flags = 1;
236 else
237 sdb_flags = 0;
238 #endif
239 return NULL;
240
241 case FE_OPT_VERSION:
242 {
243 char *s=versionString();
244 printf("%s",s);
245 omFree(s);
246 return NULL;
247 }
248
249 case FE_OPT_ECHO:
250 si_echo = (int) ((long)(feOptSpec[FE_OPT_ECHO].value));
251 if (si_echo < 0 || si_echo > 9)
252 return "argument of option is not in valid range 0..9";
253 return NULL;
254
255 case FE_OPT_RANDOM:
256 siRandomStart = (unsigned int) ((unsigned long)
257 (feOptSpec[FE_OPT_RANDOM].value));
258 siSeed=siRandomStart;
259 factoryseed(siRandomStart);

Callers 1

feSetOptValueFunction · 0.85

Calls 9

feOptHelpFunction · 0.85
versionStringFunction · 0.85
factoryseedFunction · 0.85
WarnFunction · 0.85
feResourceFunction · 0.85
SetMinDisplayTimeFunction · 0.85
feHelpBrowserFunction · 0.85
SetTimerResolutionFunction · 0.85
feOptDumpVersionTupleFunction · 0.85

Tested by

no test coverage detected