|
int | clock_gettime (int clk_id, struct mach_timespec *t) |
|
|
int | init_00CORE () |
|
int | printRED (char *string) |
| Print string in red. More...
|
|
int | printWARNING (const char *file, const char *func, int line, char *warnmessage) |
| Print warning and continue. More...
|
|
int | printERROR (const char *file, const char *func, int line, char *errmessage) |
| Print error (in red) and continue. More...
|
|
static void | CORE_logFunctionCall (const int funclevel, const int loglevel, const int logfuncMODE, const char *FileName, const char *FunctionName, const long line, char *comments) |
|
int | set_precision (int vp) |
|
int | CLIinfoPrint () |
|
int | CLIWritePid () |
|
struct timespec | timespec_diff (struct timespec start, struct timespec end) |
|
double | timespec_diff_double (struct timespec start, struct timespec end) |
|
int | file_exist (char *filename) |
|
core functions
Functions frequently used by modules
- Author
- O. Guyon
- Date
- Aug 2, 2017
- Bug:
- No known bugs.
static void CORE_logFunctionCall |
( |
const int |
funclevel, |
|
|
const int |
loglevel, |
|
|
const int |
logfuncMODE, |
|
|
const char * |
FileName, |
|
|
const char * |
FunctionName, |
|
|
const long |
line, |
|
|
char * |
comments |
|
) |
| |
|
static |
Purpose
Log function call (for testing / debugging only).
Function calls are logged if to file .FileName.funccalls.log
Variable AOLOOPCONTROL_logfunc_level keeps track of function depth:
it is incremented when entering a function
decremented when exiting a function
Variable AOLOOPCONTROL_logfunc_level_max sets the max depth of logging
At the beginning of each function, insert this code:
1 #ifdef AOLOOPCONTROL_LOGFUNC
2 AOloopControl_logFunctionCall( 0, __FUNCTION__, __LINE__, "");
and at the end of each function:
1 #ifdef AOLOOPCONTROL_LOGFUNC
2 AOloopControl_logFunctionCall( 1, __FUNCTION__, __LINE__, "");
Arguments
- Parameters
-
[in] | funclevel | INT Function level (0: top level, always log) |
[in] | loglevel | INT Log level: log all function with level =< loglevel |
logfuncMODE INT Log mode, 0:entering function, 1:exiting function
- Parameters
-
[in] | FileName | char* Name of source file, usually FILE so that preprocessor fills this parameter. |
[in] | FunctionName | char* Name of function, usually FUNCTION so that preprocessor fills this parameter. |
[in] | line | char* Line in cource code, usually LINE so that preprocessor fills this parameter. |
[in] | comments | char* comment string |
- Returns
- void
- Note
- Carefully set depth value to avoid large output file.
- Warning
- May slow down code. Only use for debugging. Output file may grow very quickly.