Loading...
Searching...
No Matches
mod2.h File Reference
`#include "singularconfig.h"`
`#include "misc/auxiliary.h"`

Go to the source code of this file.

## Macros

#define | SINGULAR_MAJOR_VERSION 4
#define | SINGULAR_MINOR_VERSION 4
#define | SINGULAR_SUB_VERSION 1
#define | SINGULAR_PATCHLEVEL 5
#define | S_ROOT_DIR ""
#define | HAVE_GETTIMEOFDAY 1
#define | TIME_WITH_SYS_TIME 1
#define | HAVE_SYS_TIME_H 1
#define | TIMER_RESOLUTION 1
#define | SIQ 1
#define | FAST_AND_DIRTY
#define | HAVE_EIGENVAL 1
#define | HAVE_GMS 1
#define | HAVE_SIMPLEIPC 1
#define | HAVE_PCV 1
#define | HAVE_UNITS
#define | HAVE_LIBPARSER
#define | HAVE_VSPACE 1
#define | PROFILER
#define | HAVE_SPECTRUM 1
#define | SINGULAR_VERSION ((SINGULAR_MAJOR_VERSION*10000 + SINGULAR_MINOR_VERSION*1000 + SINGULAR_SUB_VERSION*100)+SINGULAR_PATCHLEVEL)
#define | YYLPDEBUG 1
#define | SEEK_END 2
#define | SEEK_SET 0
#define | LINKAGE
#define | NO_INLINE
#define | MDEBUG 0
#define | OM_TRACK 4
#define | OM_CHECK 1
#define | OM_KEEP 0
#define | OM_SING_KEEP 1000
#define | KDEBUG 0
#define | LDEBUG
#define | RDEBUG
#define | TEST
#define | YYDEBUG 1
#define | assume_violation(s, f, l)
#define | assume(x)
#define | r_assume(x)
#define | _assume(x, f, l)
#define | _r_assume(x, f, l)
#define | __attribute__(x)
#define | STRINGIFY(name)
#define | EXPANDED_STRINGIFY(name)

## Functions

void | m2_end (int i)
static void | HALT (void)
int | dReportError (const char *fmt,...)
void | dErrorBreak (void)

## Macro Definition Documentation

## __attribute__

#define __attribute__ | ( |  | x | ) |

Value:
/*NOTHING*/

Definition at line 429 of file mod2.h.

## _assume

#define _assume | ( |  | x,
|  |  | f,
|  |  | l )

Value:
do \
{ \
if (! (x)) \
{ \
assume_violation(#x, f, l); \
} \
} \
while (0)
l
int l
Definition cfEzgcd.cc:100
x
Variable x
Definition cfModGcd.cc:4090
f
FILE * f
Definition checklibs.c:9

Definition at line 392 of file mod2.h.

#define _assume(x, f, l) \
do \
{ \
if (! (x)) \
{ \
assume_violation(#x, f, l); \
} \
} \
while (0)

## _r_assume

#define _r_assume | ( |  | x,
|  |  | f,
|  |  | l )

Value:
do \
{ \
if (! (x)) \
{ \
assume_violation(#x, f, l); \
return 0; \
} \
} \
while (0)

Definition at line 402 of file mod2.h.

#define _r_assume(x, f, l) \
do \
{ \
if (! (x)) \
{ \
assume_violation(#x, f, l); \
return 0; \
} \
} \
while (0)

## assume

#define assume | ( |  | x | ) |

Value:
_assume(x, __FILE__, __LINE__)
_assume
#define _assume(x, f, l)
Definition mod2.h:392

Definition at line 389 of file mod2.h.

## assume_violation

#define assume_violation | ( |  | s,
|  |  | f,
|  |  | l )

Value:
dReportError("assume violation at %s:%d condition: %s", f,l,s)
s
const CanonicalForm int s
Definition facAbsFact.cc:51
dReportError
int dReportError(const char *fmt,...)
Definition dError.cc:44

Definition at line 386 of file mod2.h.

#define assume_violation(s,f,l) \
dReportError("assume violation at %s:%d condition: %s", f,l,s)

## EXPANDED_STRINGIFY

#define EXPANDED_STRINGIFY | ( |  | name | ) |

Value:
STRINGIFY(name)
name
char name(const Variable &v)
Definition factory.h:189
STRINGIFY
#define STRINGIFY(name)
Definition mod2.h:432

Definition at line 433 of file mod2.h.

## FAST_AND_DIRTY

#define FAST_AND_DIRTY

Definition at line 41 of file mod2.h.

## HAVE_EIGENVAL

#define HAVE_EIGENVAL 1

Definition at line 44 of file mod2.h.

## HAVE_GETTIMEOFDAY

#define HAVE_GETTIMEOFDAY 1

Definition at line 30 of file mod2.h.

## HAVE_GMS

#define HAVE_GMS 1

Definition at line 47 of file mod2.h.

## HAVE_LIBPARSER

#define HAVE_LIBPARSER

Definition at line 60 of file mod2.h.

## HAVE_PCV

#define HAVE_PCV 1

Definition at line 54 of file mod2.h.

## HAVE_SIMPLEIPC

#define HAVE_SIMPLEIPC 1

Definition at line 50 of file mod2.h.

## HAVE_SPECTRUM

#define HAVE_SPECTRUM 1

Definition at line 80 of file mod2.h.

## HAVE_SYS_TIME_H

#define HAVE_SYS_TIME_H 1

Definition at line 32 of file mod2.h.

## HAVE_UNITS

#define HAVE_UNITS

Definition at line 57 of file mod2.h.

## HAVE_VSPACE

#define HAVE_VSPACE 1

Definition at line 65 of file mod2.h.

## KDEBUG

#define KDEBUG 0

Definition at line 304 of file mod2.h.

## LDEBUG

#define LDEBUG

Definition at line 307 of file mod2.h.

## LINKAGE

#define LINKAGE

Definition at line 140 of file mod2.h.

## MDEBUG

#define MDEBUG 0

Definition at line 180 of file mod2.h.

## NO_INLINE

#define NO_INLINE

Definition at line 153 of file mod2.h.

## OM_CHECK

#define OM_CHECK 1

Definition at line 278 of file mod2.h.

## OM_KEEP

#define OM_KEEP 0

Definition at line 284 of file mod2.h.

## OM_SING_KEEP

#define OM_SING_KEEP 1000

Definition at line 290 of file mod2.h.

## OM_TRACK

#define OM_TRACK 4

Definition at line 274 of file mod2.h.

## PROFILER

#define PROFILER

Definition at line 73 of file mod2.h.

## r_assume

#define r_assume | ( |  | x | ) |

Value:
_r_assume(x, __FILE__, __LINE__)
_r_assume
#define _r_assume(x, f, l)
Definition mod2.h:402

Definition at line 390 of file mod2.h.

## RDEBUG

#define RDEBUG

Definition at line 309 of file mod2.h.

## S_ROOT_DIR

#define S_ROOT_DIR ""

Definition at line 23 of file mod2.h.

## SEEK_END

#define SEEK_END 2

Definition at line 111 of file mod2.h.

## SEEK_SET

#define SEEK_SET 0

Definition at line 115 of file mod2.h.

## SINGULAR_MAJOR_VERSION

#define SINGULAR_MAJOR_VERSION 4

Definition at line 19 of file mod2.h.

## SINGULAR_MINOR_VERSION

#define SINGULAR_MINOR_VERSION 4

Definition at line 20 of file mod2.h.

## SINGULAR_PATCHLEVEL

#define SINGULAR_PATCHLEVEL 5

Definition at line 22 of file mod2.h.

## SINGULAR_SUB_VERSION

#define SINGULAR_SUB_VERSION 1

Definition at line 21 of file mod2.h.

## SINGULAR_VERSION

#define SINGULAR_VERSION ((SINGULAR_MAJOR_VERSION*10000 + SINGULAR_MINOR_VERSION*1000 + SINGULAR_SUB_VERSION*100)+SINGULAR_PATCHLEVEL)

Definition at line 87 of file mod2.h.

## SIQ

#define SIQ 1

Definition at line 38 of file mod2.h.

## STRINGIFY

#define STRINGIFY | ( |  | name | ) |

Value:
#name

Definition at line 432 of file mod2.h.

## TEST

#define TEST

Definition at line 311 of file mod2.h.

## TIME_WITH_SYS_TIME

#define TIME_WITH_SYS_TIME 1

Definition at line 31 of file mod2.h.

## TIMER_RESOLUTION

#define TIMER_RESOLUTION 1

Definition at line 35 of file mod2.h.

## YYDEBUG

#define YYDEBUG 1

Definition at line 316 of file mod2.h.

## YYLPDEBUG

#define YYLPDEBUG 1

Definition at line 95 of file mod2.h.

## Function Documentation

## dErrorBreak()

void dErrorBreak | ( | void |  | ) |

extern

Definition at line 140 of file dError.cc.

{}

## dReportError()

int dReportError | ( | const char * | fmt,
|  |  | ... )

extern

Definition at line 44 of file dError.cc.

{
#if 0
#ifdef HAVE_EXECINFO_H
#define SIZE 50
void *buffer[SIZE+1]; int ret;
#endif
#endif
va_list ap;
va_start(ap, fmt);
#ifndef MAKE_DISTRIBUTION
fprintf(stderr, "\n// ***dError: ");
vfprintf(stderr, fmt, ap);
#if !defined(OM_NDEBUG)
#ifdef omPrintCurrentBackTraceMax
fprintf(stderr, " occurred at: \n");
omPrintCurrentBackTraceMax(stderr, 8);
#endif
#endif
#if 0
#ifdef HAVE_EXECINFO_H
ret = backtrace( buffer, SIZE ); // execinfo.h
fprintf(stderr, "\nExecinfo backtrace (with %zd stack frames): \n", ret);
#ifndef HAVE_GCC_ABI_DEMANGLE
backtrace_symbols_fd(buffer, ret, STDERR_FILENO); // execinfo.h
#else
char **ptr = backtrace_symbols( buffer, ret ); // execinfo.h
int status;
char *demangledName;
char *s;
char *ss;
for (int i = 0; i < ret; i++)
{
status = -1;
s = ptr[i];
// fprintf (stderr, " #%02d: %s\n", i, s);
ss = index(s, '(');
ss[0] = 0;
fprintf (stderr, " #%02d: '%s': ", i, s);
ss[0] = '('; s = ss + 1;
ss = index(s, '+');
if ( ss != NULL )
{
ss[0] = 0;
demangledName = abi::__cxa_demangle( s, NULL, NULL, &status ); // cxxabi.h!
if( status == 0 && demangledName != NULL )
fprintf (stderr, " '%s'", (demangledName[0] != 0)? demangledName: s);
else
fprintf (stderr, " '%s'", s);
malloc_free( demangledName );
ss[0] = '+';
s = ss + 1;
}
ss = index(s, ')');
if( s != ss)
{
ss[0] = 0;
fprintf (stderr, " + %s", s);
ss[0] = ')';
}
fprintf (stderr, " %s\n", ss + 2);
}
malloc_free (ptr);
#endif
#endif
#undef SIZE
#endif
dErrorBreak();
#else
fprintf(stderr, "\n// !!! YOU HAVE FOUND A BUG IN SINGULAR.");
fprintf(stderr, "// !!! Please, email the input\n// and the following error message to singular@mathematik.uni-kl.de");
vfprintf(stderr, fmt, ap);
#endif
return 0;
}
i
int i
Definition cfEzgcd.cc:132
malloc_free
static void malloc_free(void *ptr)
Definition dError.cc:23
dErrorBreak
void dErrorBreak()
Definition dError.cc:140
ap
Definition ap.h:40
NULL
#define NULL
Definition omList.c:12
index
static int index(p_Length length, p_Ord ord)
Definition p_Procs_Impl.h:592
status
int * status
Definition si_signals.h:61
omPrintCurrentBackTraceMax
#define omPrintCurrentBackTraceMax(A, B)
Definition xalloc.h:265

## HALT()

void HALT | ( | void |  | ) |

inline static

Definition at line 126 of file mod2.h.

{ m2_end(2);}
m2_end
void m2_end(int i)
Definition misc_ip.cc:1104

## m2_end()

void m2_end | ( | int | i | ) |

Definition at line 1104 of file misc_ip.cc.

{
if (!m2_end_called)
{
EXTERN_VAR FILE* File_Profiling;
EXTERN_VAR FILE* File_Log;
EXTERN_VAR BOOLEAN File_Log_written;
if (File_Profiling!=NULL) { fclose(File_Profiling); File_Profiling=NULL; }
if (File_Log!=NULL)
{
fclose(File_Log);
File_Log=NULL;
if (File_Log_written==FALSE) // remove empty logs
{
int pid=getpid();
char buf[20];
snprintf(buf,20,"/tmp/sing_log.%d",pid);
remove(buf);
}
}
m2_end_called = TRUE;
#ifdef HAVE_SIMPLEIPC
for (int j = SIPC_MAX_SEMAPHORES-1; j >= 0; j--)
{
if (semaphore[j] != NULL)
{
while (sem_acquired[j] > 0)
{
#if PORTABLE_SEMAPHORES
sem_post(semaphore[j]->sig);
#else
sem_post(semaphore[j]);
#endif
sem_acquired[j]--;
}
}
}
#endif // HAVE_SIMPLEIPC
monitor(NULL,0);
if (ssiToBeClosed_inactive)
{
link_list hh=ssiToBeClosed;
while(hh!=NULL)
{
//Print("close %s\n",hh->l->name);
slPrepClose(hh->l);
hh=(link_list)hh->next;
}
ssiToBeClosed_inactive=FALSE;
idhdl h = currPack->idroot;
while(h != NULL)
{
if(IDTYP(h) == LINK_CMD)
{
idhdl hh=h->next;
//Print("kill %s\n",IDID(h));
killhdl(h, currPack);
h = hh;
}
else
{
h = h->next;
}
}
hh=ssiToBeClosed;
while(hh!=NULL)
{
//Print("close %s\n",hh->l->name);
slClose(hh->l);
hh=ssiToBeClosed;
}
}
#ifdef PAGE_TEST
mmEndStat();
#endif
fe_reset_input_mode();
if (!singular_in_batchmode)
{
if (TEST_V_QUIET)
{
if ((i==0)||(i==1))
printf("Auf Wiedersehen.\n");
}
if (i>1)
{
printf("\nhalt %d\n",i);
}
}
if (i>1) exit(i);
else if (i==1) exit(0);
else if (i<0) _exit(0);
}
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
singular_in_batchmode
VAR BOOLEAN singular_in_batchmode
Definition cntrlc.cc:62
j
int j
Definition facHensel.cc:110
monitor
void monitor(void *F, int mode)
Definition febase.cc:68
fe_reset_input_mode
void fe_reset_input_mode()
Definition fereadl.c:831
File_Profiling
VAR FILE * File_Profiling
Definition fevoices.cc:32
File_Log_written
VAR BOOLEAN File_Log_written
Definition fevoices.cc:34
File_Log
VAR FILE * File_Log
Definition fevoices.cc:33
EXTERN_VAR
#define EXTERN_VAR
Definition globaldefs.h:6
currPack
VAR package currPack
Definition ipid.cc:55
killhdl
void killhdl(idhdl h, package proot)
Definition ipid.cc:414
IDTYP
#define IDTYP(a)
Definition ipid.h:119
h
STATIC_VAR Poly * h
Definition janet.cc:971
m2_end_called
volatile BOOLEAN m2_end_called
Definition misc_ip.cc:1097
TEST_V_QUIET
#define TEST_V_QUIET
Definition options.h:135
idhdl
idrec * idhdl
Definition ring.h:22
semaphore
VAR sipc_sem_t * semaphore[SIPC_MAX_SEMAPHORES]
Definition semaphore.c:24
sem_acquired
VAR int sem_acquired[SIPC_MAX_SEMAPHORES]
Definition semaphore.c:25
buf
int status int void * buf
Definition si_signals.h:69
slPrepClose
BOOLEAN slPrepClose(si_link l)
Definition silink.cc:223
slClose
BOOLEAN slClose(si_link l)
Definition silink.cc:240
ssiToBeClosed_inactive
EXTERN_VAR volatile BOOLEAN ssiToBeClosed_inactive
Definition silink.h:131
link_list
link_struct * link_list
Definition silink.h:128
link_struct::next
void * next
Definition silink.h:125
link_struct::l
si_link l
Definition silink.h:124
ssiToBeClosed
EXTERN_VAR link_list ssiToBeClosed
Definition silink.h:130
SIPC_MAX_SEMAPHORES
#define SIPC_MAX_SEMAPHORES
Definition simpleipc.h:10
LINK_CMD
@ LINK_CMD
Definition tok.h:117