Files | |
| file | eg_macros.c |
implementation of some macros. | |
| file | eg_macros.h |
Defines | |
| #define | ADVCHECKRVAL(__A, __B) |
| this macro test if a value is non zero, if it is it print where is it and return __B. The idea is to use it to check return values of functions | |
| #define | ADVTESTL(__L, __A, __RVAL,...) |
| This macro test a condition '__A' when the debug level used at compile time is at least '__L'. If the condition is true, it print the message and return the '__RVAL' value. | |
| #define | CHECKRVAL(__A) |
| this macro test if a value is non zero, if it is it print where is it and return 1. The idea is to use it to check return values of functions | |
| #define | CHECKRVALG(__A, __B) do{if(__A){__EG_PRINTLOC2__;goto __B;}}while(0) |
| this function, if the input is non zero, print a message of function, file and line and then goto the second parameter | |
| #define | EG_RETURN(__A) |
| return value macro, if the value is non-zero, write to standard error the returning code and where this happen | |
| #define | EGcall(__rval__, __cleanup__, __myfunc__) do{const int __EGrval__=__myfunc__;(__rval__)=__EGrval__;TESTG(__EGrval__,__cleanup__,"Function " #__myfunc__ " failed with code %d ",__EGrval__);}while(0) |
| Call macro. The idea is to replace the following call: rval = myfunction(mypar); CHECKRVALG(rval,mygoto); with the call EGcall(rval,mygoto,myfunction(mypar)); this should help simplify calls and clean-up the code. | |
| #define | EGcallD(__myfunc2__) EGcall(rval,CLEANUP,__myfunc2__) |
| call macro with default arguments, it assumes that rval is an integer variable to be used to store return value, and CLEANUP is a valid label for an exit point in the code | |
| #define | EGcontainerOf(__ptr, __type, __member) |
| given a pointer to a member of a structure, return the pointer to the head of the structure. (idea taken from Linux Kernel). | |
| #define | EGoffsetOf(__type, __member) ((size_t) &((__type *)0)->__member) |
| return the offset of a member inside a structure. | |
| #define | EGosGetData(__DATA, __OFFS, __TYPE) (*((__TYPE*)(((char*)__DATA)+__OFFS))) |
| retrieve the data of type '__TYPE' in the structure '__DATA' that is located in the offset '__OFFS'. | |
| #define | EGosSetData(__DATA, __OFFS, __TYPE, val) (EGosGetData(__DATA,__OFFS,__TYPE)=val) |
| set the data of type '__TYPE' in the structure '__DATA' that is located in the offset '__OFFS' to the value 'val'. | |
| #define | EGsigSet(__status__, __LABEL__) do{MESSAGE(0,"setjmp here");if((__status__=setjmp(__EGljmp))) goto __LABEL__;__EGsigSetSignal();}while(0) |
| set the jump point, and the sginal handler. it must receive a label where to jump, and where to save the returning status, typically this will be the clean-up section of the main function and the status variable in the mian program. | |
| #define | EXIT(__A,...) |
| This macro is to print error messages and exit the program with code one from the current function, it also print the file and line where this happend. | |
| #define | EXITL(__L, __A,...) |
| This macro is to print error messages and to return with value one from the current function, it also print the file and line where this happend, but the condition is looked only if the debug level is at least __L. | |
| #define | EXITRVAL(__A) |
| this macro test if a value is non zero, if it is it print where is it and exit EXIT_FAILURE. The idea is to use it to check return values of functions, and the calling function can't return a status, and then we are forced to exit. | |
| #define | FTEST(__A,...) |
| This macro is to print error messages and to return with value one from the current function, it also print the file and line where this happend. | |
| #define | FTESTG(__A, __B,...) |
| This macro is to print error messages and to return with value one from the current function, it also print the file and line where this happend. | |
| #define | IFMESSAGE(__display,...) |
| if the given display level is over the given treshold, display the given message and location information | |
| #define | MESSAGE(__A,...) |
| This macro print messages to the screen when the debug level is as big as the first parameter, if the debug level is zero we eliminate the code and reduce it to the empty instruction. | |
| #define | MESSAGEF(__A, __F,...) |
| This macro print messages to the screen when the debug level is as big as the first parameter, if the debug level is zero we eliminate the code and reduce it to the empty instruction. | |
| #define | nullCopy ((EGcopy_f)0) |
| Define a null copy function. | |
| #define | OUTPUT(__A,...) |
| This macro print messages to the screen when the verbose level is as big as the first parameter, if the verbose level is zero we eliminate the code and reduce it to the empty instruction. | |
| #define | PTRTEST(__PTR, __RVAL) |
| this macro check if the value of a pointer is not bellow the first 64Kb, if so it return the given value | |
| #define | TEST(__A,...) |
| This macro is to print error messages and to return with value one from the current function, it also print the file and line where this happend. | |
| #define | TESTERRNOIF(__value) |
| , if a non-zero value is given as an argument, check the errno stored in the system, print the related message, and return the non-zero given parameter, otherwise, do nothing. | |
| #define | TESTG(__A, __B,...) |
| This macro is to print error messages and jump to the given point in the code, it also print the file and line where this happend. | |
| #define | TESTGL(__L, __A, __B,...) |
| This macro is to print error messages and jump to the given point in the code, it also print the file and line where this happend. | |
| #define | TESTL(__L, __A,...) |
| This macro is to print error messages and to return with value one from the current function, it also print the file and line where this happend, but the condition is looked only if the debug level is at least __L. | |
| #define | WARNIF(__L__) |
| if return value is non-zero warn on screen | |
| #define | WARNING(__A,...) |
| This macro print messages to the screen when the condition __A is true. | |
| #define | WARNINGL(__L, __A,...) |
| This macro print messages to the screen when the condition __A is true .if the debug level is one we don't print any warning message. if the debug level is zero we eliminate the code and reduce it to the empty instruction. | |
Typedefs | |
| typedef void *(* | EGcopy_f )(void *p) |
| Defione copy functions, these functions return copy of objects but with independent storage space, there are two versions, one that require a memory pool from where to look for memory, and another where we don't care about that.... the place from where the memory was asked for depend on the function, se the function definition for details. Note that if the is no more memory available the function should call exit(EXIT_FAILURE). This is only intended as a readibility help. | |
Functions | |
| void | __EGsigSetSignal (void) |
| use EGsighandler for SIGXCPU, SIGINT and SIGSEGV as signal handler. | |
| void | EGlib_info (void) |
| Display information about the library and the running process. | |
| void | EGlib_version (void) |
| print versioning info of the library | |
| void | EGsetLimits (double max_rtime, unsigned long memlimit) |
| set memory and run-time limits (soft and hard); if the current limits are bellow the porposed limits, it will warn on screen, but will not fail. Note that this function will set RLMIT_CORE to zero. | |
| void | EGsighandler (int s) |
| a generic signal handler, it can handle SIGXCPU, SIGINT and SIGSEGV signals by displaying a proper indication to stderr; note that a call to EGsigSetjmp should be performed at the very beggining of the main function for this to be robust. When receiving a SIGXCPU, SIGINT signal, the function report the signal and jump-back to the setjmp position. When receiving a SIGINT signal, the function report the signal and jump-back | |
Variables | |
| jmp_buf | __EGljmp |
| needed global jump-control variable | |
Code Location Utility: | |
this are utility macros to print information about where we are.
| |
| #define | __EG_PRINTLOCF__(__F) fprintf(((__F==((FILE*)0))?stderr:__F),", in %s (%s:%d)\n",__func__,__FILE__,__LINE__) |
| #define | __EG_PRINTLOC__ __EG_PRINTLOCF__(stderr) |
| #define | __EG_PRINTLOC2F__(__F) fprintf(((__F==((FILE*)0))?stderr:__F),"in %s (%s:%d)\n",__func__,__FILE__,__LINE__) |
| #define | __EG_PRINTLOC2__ __EG_PRINTLOC2F__(stderr) |
Algorithms Return Status | |
Here we define some general status for algorithms, the exact meaning should be sought in the actual algorithm definition, but the definitions here provide a first overview of their meaning. | |
| #define | EG_ALGSTAT_SUCCESS 0 |
| the algorithm finish successfully. | |
| #define | EG_ALGSTAT_PARTIAL 1 |
| the algorithm could only partially finish | |
| #define | EG_ALGSTAT_NUMERROR 2 |
| the algorithm stop because of some numerical problem | |
| #define | EG_ALGSTAT_ERROR 3 |
| the algorithm stop because of some unforeseen error | |
Mathematical Constants | |
Here we define some mathematical constants needed in some parts of the code that are of general use | |
| #define | EG_M_PI 3.1415926535897932384626433832795029L |
definition of as a constant, suitable for quad-IEEE operations. | |
global macros and types for EGlib
| #define __EG_PRINTLOC2__ __EG_PRINTLOC2F__(stderr) |
Definition at line 146 of file eg_macros.h.
| #define __EG_PRINTLOC2F__ | ( | __F | ) | fprintf(((__F==((FILE*)0))?stderr:__F),"in %s (%s:%d)\n",__func__,__FILE__,__LINE__) |
Definition at line 145 of file eg_macros.h.
| #define __EG_PRINTLOC__ __EG_PRINTLOCF__(stderr) |
Definition at line 144 of file eg_macros.h.
| #define __EG_PRINTLOCF__ | ( | __F | ) | fprintf(((__F==((FILE*)0))?stderr:__F),", in %s (%s:%d)\n",__func__,__FILE__,__LINE__) |
Definition at line 143 of file eg_macros.h.
| #define ADVCHECKRVAL | ( | __A, | ||
| __B | ||||
| ) |
({\
if(__A){\
__EG_PRINTLOC2__;\
return __B;}})
this macro test if a value is non zero, if it is it print where is it and return __B. The idea is to use it to check return values of functions
Definition at line 337 of file eg_macros.h.
| #define ADVTESTL | ( | __L, | ||
| __A, | ||||
| __RVAL, | ||||
| ... | ||||
| ) |
({\
if((DEBUG>=__L)&&(__A)){\
fprintf(stderr,__VA_ARGS__);\
__EG_PRINTLOC__;\
return __RVAL;}})
This macro test a condition '__A' when the debug level used at compile time is at least '__L'. If the condition is true, it print the message and return the '__RVAL' value.
Definition at line 346 of file eg_macros.h.
| #define CHECKRVAL | ( | __A | ) |
({\
if(__A){\
__EG_PRINTLOC2__;\
return __A;}})
this macro test if a value is non zero, if it is it print where is it and return 1. The idea is to use it to check return values of functions
Definition at line 356 of file eg_macros.h.
Referenced by EGalgPRglobalRelabel(), EGalgPRpreprocess(), and main().
| #define CHECKRVALG | ( | __A, | ||
| __B | ||||
| ) | do{if(__A){__EG_PRINTLOC2__;goto __B;}}while(0) |
this function, if the input is non zero, print a message of function, file and line and then goto the second parameter
Definition at line 376 of file eg_macros.h.
Referenced by EGalgMCtestNode(), EGalgPRmaxSTflow(), EGalgPRminSTcut(), EGalgPRoptimalityTest(), EGsimNewEvent(), and main().
| #define EG_ALGSTAT_ERROR 3 |
the algorithm stop because of some unforeseen error
Definition at line 417 of file eg_macros.h.
| #define EG_ALGSTAT_NUMERROR 2 |
the algorithm stop because of some numerical problem
Definition at line 415 of file eg_macros.h.
| #define EG_ALGSTAT_PARTIAL 1 |
the algorithm could only partially finish
Definition at line 413 of file eg_macros.h.
| #define EG_ALGSTAT_SUCCESS 0 |
the algorithm finish successfully.
Definition at line 411 of file eg_macros.h.
| #define EG_M_PI 3.1415926535897932384626433832795029L |
definition of
as a constant, suitable for quad-IEEE operations.
Definition at line 427 of file eg_macros.h.
| #define EG_RETURN | ( | __A | ) |
{\
const int __RVAL__ = (__A);\
if(__RVAL__){\
fprintf(stderr,"rval %d",__RVAL__);\
__EG_PRINTLOC__;}\
return __RVAL__;}
return value macro, if the value is non-zero, write to standard error the returning code and where this happen
Definition at line 206 of file eg_macros.h.
| #define EGcall | ( | __rval__, | ||
| __cleanup__, | ||||
| __myfunc__ | ||||
| ) | do{const int __EGrval__=__myfunc__;(__rval__)=__EGrval__;TESTG(__EGrval__,__cleanup__,"Function " #__myfunc__ " failed with code %d ",__EGrval__);}while(0) |
Call macro. The idea is to replace the following call: rval = myfunction(mypar); CHECKRVALG(rval,mygoto); with the call EGcall(rval,mygoto,myfunction(mypar)); this should help simplify calls and clean-up the code.
Definition at line 439 of file eg_macros.h.
Referenced by EGalgMaxClosure_PR(), and main().
| #define EGcallD | ( | __myfunc2__ | ) | EGcall(rval,CLEANUP,__myfunc2__) |
call macro with default arguments, it assumes that rval is an integer variable to be used to store return value, and CLEANUP is a valid label for an exit point in the code
Definition at line 444 of file eg_macros.h.
Referenced by main().
| #define EGcontainerOf | ( | __ptr, | ||
| __type, | ||||
| __member | ||||
| ) |
({\
typeof(((__type *)0)->__member) *const __EGcOf_ptr = (__ptr);\
(__type *)( (char*)__EGcOf_ptr - ((size_t) &((__type *)0)->__member));})
given a pointer to a member of a structure, return the pointer to the head of the structure. (idea taken from Linux Kernel).
| __ptr | pointer to the member of the containing structure. | |
| __type | name type of the containing structure. | |
| __member | name of the given member in the containing structure. |
Definition at line 133 of file eg_macros.h.
Referenced by display_DG(), display_srkG(), display_UG(), EGalgMCbuildPRgraph(), EGalgMCcomputeT(), EGalgMCexpandNode(), EGalgPRcomputeLabels(), EGalgPRglobalRelabel(), EGalgPRmaxSTflow(), EGalgPRminSTcut(), EGalgPRnumb(), EGalgPRoptimalityTest(), EGalgPRpreprocess(), EGalgPRpush(), EGalgPRpushRelabel(), and main().
| #define EGoffsetOf | ( | __type, | ||
| __member | ||||
| ) | ((size_t) &((__type *)0)->__member) |
return the offset of a member inside a structure.
| type | the type of the containing structure. | |
| member | the name of the member that we are interested in compute the offset. |
Definition at line 123 of file eg_macros.h.
| #define EGosGetData | ( | __DATA, | ||
| __OFFS, | ||||
| __TYPE | ||||
| ) | (*((__TYPE*)(((char*)__DATA)+__OFFS))) |
retrieve the data of type '__TYPE' in the structure '__DATA' that is located in the offset '__OFFS'.
Definition at line 381 of file eg_macros.h.
| #define EGosSetData | ( | __DATA, | ||
| __OFFS, | ||||
| __TYPE, | ||||
| val | ||||
| ) | (EGosGetData(__DATA,__OFFS,__TYPE)=val) |
set the data of type '__TYPE' in the structure '__DATA' that is located in the offset '__OFFS' to the value 'val'.
Definition at line 386 of file eg_macros.h.
| #define EGsigSet | ( | __status__, | ||
| __LABEL__ | ||||
| ) | do{MESSAGE(0,"setjmp here");if((__status__=setjmp(__EGljmp))) goto __LABEL__;__EGsigSetSignal();}while(0) |
set the jump point, and the sginal handler. it must receive a label where to jump, and where to save the returning status, typically this will be the clean-up section of the main function and the status variable in the mian program.
| __status__ | the returning status of the call, zero when set, non-zero when comming back from a long-jump. | |
| __LABEL__ | where to jump when returning from a long-jump. |
Definition at line 477 of file eg_macros.h.
Referenced by main().
| #define EXIT | ( | __A, | ||
| ... | ||||
| ) |
({if(__A){\
fprintf(stderr,"EXIT: ");\
fprintf(stderr,__VA_ARGS__);\
__EG_PRINTLOC__;\
exit(EXIT_FAILURE);}})
This macro is to print error messages and exit the program with code one from the current function, it also print the file and line where this happend.
Definition at line 327 of file eg_macros.h.
Referenced by EGbitNext(), EGbitPrev(), and main().
| #define EXITL | ( | __L, | ||
| __A, | ||||
| ... | ||||
| ) |
({\
if(__L<=DEBUG){\
if(__A){\
fprintf(stderr,__VA_ARGS__);\
__EG_PRINTLOC__;\
_exit(1);}}})
This macro is to print error messages and to return with value one from the current function, it also print the file and line where this happend, but the condition is looked only if the debug level is at least __L.
Definition at line 167 of file eg_macros.h.
Referenced by EGalgPRpush(), and EGalgPRpushRelabel().
| #define EXITRVAL | ( | __A | ) |
({\
if(__A){\
__EG_PRINTLOC2__;\
exit(EXIT_FAILURE);}})
this macro test if a value is non zero, if it is it print where is it and exit EXIT_FAILURE. The idea is to use it to check return values of functions, and the calling function can't return a status, and then we are forced to exit.
Definition at line 318 of file eg_macros.h.
| #define FTEST | ( | __A, | ||
| ... | ||||
| ) |
({\
if(__A){\
fprintf(stderr,__VA_ARGS__);\
__EG_PRINTLOC__;\
return 1;}})
This macro is to print error messages and to return with value one from the current function, it also print the file and line where this happend.
Definition at line 289 of file eg_macros.h.
| #define FTESTG | ( | __A, | ||
| __B, | ||||
| ... | ||||
| ) |
({\
if(__A){\
fprintf(stderr,"ERROR: " __VA_ARGS__);\
__EG_PRINTLOC__;\
goto __B;}})
This macro is to print error messages and to return with value one from the current function, it also print the file and line where this happend.
Definition at line 299 of file eg_macros.h.
| #define IFMESSAGE | ( | __display, | ||
| ... | ||||
| ) |
do{\ if((__display)>0){\ fprintf(stderr,__VA_ARGS__);\ __EG_PRINTLOC__;}}while(0)
if the given display level is over the given treshold, display the given message and location information
Definition at line 151 of file eg_macros.h.
Referenced by EGalgMaxClosure_PR(), and main().
| #define MESSAGE | ( | __A, | ||
| ... | ||||
| ) |
({\
if(__A <= DEBUG ){\
fprintf(stderr,__VA_ARGS__);\
__EG_PRINTLOC__;}})
This macro print messages to the screen when the debug level is as big as the first parameter, if the debug level is zero we eliminate the code and reduce it to the empty instruction.
Definition at line 244 of file eg_macros.h.
Referenced by EGalgMCbuildPRgraph(), EGalgMCcomputeT(), EGalgMCtestNode(), EGalgPRcomputeLabels(), EGalgPRglobalRelabel(), EGalgPRmaxSTflow(), EGalgPRminSTcut(), EGalgPRnumb(), EGalgPRoptimalityTest(), EGalgPRpreprocess(), EGalgPRpush(), EGalgPRpushRelabel(), EGbitSet(), EGbitTest(), EGbitUnset(), EGsetLimits(), EGsimNewEvent(), main(), and parseargs().
| #define MESSAGEF | ( | __A, | ||
| __F, | ||||
| ... | ||||
| ) |
({\
if(__A <= DEBUG ){\
fprintf(((__F==0)?stderr:__F),__VA_ARGS__);\
__EG_PRINTLOCF__(__F);}})
This macro print messages to the screen when the debug level is as big as the first parameter, if the debug level is zero we eliminate the code and reduce it to the empty instruction.
Definition at line 235 of file eg_macros.h.
| #define nullCopy ((EGcopy_f)0) |
Define a null copy function.
Definition at line 402 of file eg_macros.h.
| #define OUTPUT | ( | __A, | ||
| ... | ||||
| ) |
({\
if(__A <= VERBOSE_LEVEL ){\
fprintf(stderr,__VA_ARGS__);}})
This macro print messages to the screen when the verbose level is as big as the first parameter, if the verbose level is zero we eliminate the code and reduce it to the empty instruction.
Definition at line 254 of file eg_macros.h.
| #define PTRTEST | ( | __PTR, | ||
| __RVAL | ||||
| ) |
{\
if(__PTR) ADVTESTL(0,((size_t)(__PTR)) < (1U<<16),__RVAL, \
"%s=%p is not a valid pointer",\
#__PTR, (void*)(__PTR));}
this macro check if the value of a pointer is not bellow the first 64Kb, if so it return the given value
Definition at line 189 of file eg_macros.h.
| #define TEST | ( | __A, | ||
| ... | ||||
| ) |
({\
if(__A){\
fprintf(stderr,__VA_ARGS__);\
__EG_PRINTLOC__;\
return 1;}})
This macro is to print error messages and to return with value one from the current function, it also print the file and line where this happend.
Definition at line 225 of file eg_macros.h.
Referenced by CheckSeed(), and main().
| #define TESTERRNOIF | ( | __value | ) |
do{\ if(__value){\ const int __EGserrno = errno;\ fprintf(stderr,"failed with errno %d, %s\n",__EGserrno, strerror(__EGserrno));\ __EG_PRINTLOC2__;\ return __value;}}while(0)
, if a non-zero value is given as an argument, check the errno stored in the system, print the related message, and return the non-zero given parameter, otherwise, do nothing.
| __value | if non-zero check systems errors, and return this value |
Definition at line 367 of file eg_macros.h.
| #define TESTG | ( | __A, | ||
| __B, | ||||
| ... | ||||
| ) |
({\
if(__A){\
fprintf(stderr,"ERROR: " __VA_ARGS__);\
__EG_PRINTLOC__;\
goto __B;}})
This macro is to print error messages and jump to the given point in the code, it also print the file and line where this happend.
Definition at line 215 of file eg_macros.h.
Referenced by EGalgMCbuildPRgraph(), and main().
| #define TESTGL | ( | __L, | ||
| __A, | ||||
| __B, | ||||
| ... | ||||
| ) |
({\
if((__L)<=DEBUG && (__A)){\
fprintf(stderr,"ERROR: " __VA_ARGS__);\
__EG_PRINTLOC__;\
goto __B;}})
This macro is to print error messages and jump to the given point in the code, it also print the file and line where this happend.
Definition at line 197 of file eg_macros.h.
| #define TESTL | ( | __L, | ||
| __A, | ||||
| ... | ||||
| ) |
({\
if(__L<=DEBUG){\
if(__A){\
fprintf(stderr,__VA_ARGS__);\
__EG_PRINTLOC__;\
return 1;}}})
This macro is to print error messages and to return with value one from the current function, it also print the file and line where this happend, but the condition is looked only if the debug level is at least __L.
Definition at line 179 of file eg_macros.h.
Referenced by EGalgMCtestNode().
| #define WARNIF | ( | __L__ | ) |
do{\ const int __Wval__= (__L__);\ if(__Wval__){fprintf(stderr,"WARNING: In %s (%s:%d) "#__L__" = %d\n",__func__,__FILE__,__LINE__,__Wval__);}}while(0)
if return value is non-zero warn on screen
Definition at line 158 of file eg_macros.h.
Referenced by EGsetLimits().
| #define WARNING | ( | __A, | ||
| ... | ||||
| ) |
({if(__A){\
fprintf(stderr,"WARNING: ");\
fprintf(stderr,__VA_ARGS__);\
__EG_PRINTLOC__;}})
This macro print messages to the screen when the condition __A is true.
Definition at line 308 of file eg_macros.h.
| #define WARNINGL | ( | __L, | ||
| __A, | ||||
| ... | ||||
| ) |
({\
if((__A)&&(DEBUG>=__L)){\
fprintf(stderr,"WARNING: ");\
fprintf(stderr,__VA_ARGS__);\
__EG_PRINTLOC__;}})
This macro print messages to the screen when the condition __A is true .if the debug level is one we don't print any warning message. if the debug level is zero we eliminate the code and reduce it to the empty instruction.
Definition at line 266 of file eg_macros.h.
| typedef void*(* EGcopy_f)(void *p) |
Defione copy functions, these functions return copy of objects but with independent storage space, there are two versions, one that require a memory pool from where to look for memory, and another where we don't care about that.... the place from where the memory was asked for depend on the function, se the function definition for details. Note that if the is no more memory available the function should call exit(EXIT_FAILURE). This is only intended as a readibility help.
Definition at line 398 of file eg_macros.h.
| void __EGsigSetSignal | ( | void | ) |
use EGsighandler for SIGXCPU, SIGINT and SIGSEGV as signal handler.
Definition at line 83 of file eg_macros.c.
References EGsighandler().

| void EGlib_info | ( | void | ) |
Display information about the library and the running process.
Referenced by main().
| void EGlib_version | ( | void | ) |
print versioning info of the library
Referenced by main().
| void EGsetLimits | ( | double | max_rtime, | |
| unsigned long | memlimit | |||
| ) |
set memory and run-time limits (soft and hard); if the current limits are bellow the porposed limits, it will warn on screen, but will not fail. Note that this function will set RLMIT_CORE to zero.
| max_rtime | maximum running time. | |
| mem_limit | maximum memory allowed for the process, this include RLIMIT_AS and RLIMIT_DATA. |
Definition at line 90 of file eg_macros.c.
References MESSAGE, and WARNIF.
Referenced by main().
| void EGsighandler | ( | int | s | ) |
a generic signal handler, it can handle SIGXCPU, SIGINT and SIGSEGV signals by displaying a proper indication to stderr; note that a call to EGsigSetjmp should be performed at the very beggining of the main function for this to be robust. When receiving a SIGXCPU, SIGINT signal, the function report the signal and jump-back to the setjmp position. When receiving a SIGINT signal, the function report the signal and jump-back
| s | the signal number received |
Definition at line 55 of file eg_macros.c.
Referenced by __EGsigSetSignal().
| jmp_buf __EGljmp |
needed global jump-control variable
Definition at line 53 of file eg_macros.c.
1.7.1