Instrument Neutral Distributed Interface INDI 2.2.5

Macros

#define DSP_MAX_STARS   200
#define dsp_t_max   255
#define dsp_t_min   -dsp_t_max
#define DSP_NAME_SIZE   128
#define DSP_DEBUG
#define DSP_DEBUG_INFO   0
#define DSP_DEBUG_ERROR   1
#define DSP_DEBUG_WARNING   2
#define DSP_DEBUG_DEBUG   3
#define pdbg(x, ...)
#define pinfo(...)
#define perr(...)
#define pwarn(...)
#define pgarb(...)
#define pfunc   pgarb("%s\n", __func__)
#define start_gettime
#define end_gettime
#define Min(a, b)
 if min() is not present you can use this one
#define Max(a, b)
 if max() is not present you can use this one
#define Log(a, b)
 Logarithm of a with arbitrary base b.
#define DSP_ALIGN_TRANSLATED   1
 The stream is translated by the reference.
#define DSP_ALIGN_SCALED   2
 The stream is scaled by the reference.
#define DSP_ALIGN_ROTATED   4
 The stream is rotated by the reference.
#define DSP_ALIGN_NO_MATCH   8
 No matches were found during comparison.

Typedefs

typedef double dsp_t
typedef double complex_t[2]

Functions

DLL_EXPORT unsigned long int dsp_max_threads (unsigned long value)
 get/set the maximum number of threads allowed
DLL_EXPORT void dsp_set_debug_level (int value)
 set the debug level
DLL_EXPORT int dsp_get_debug_level ()
 get the debug level
DLL_EXPORT void dsp_set_app_name (char *name)
 set the application name
DLL_EXPORT char * dsp_get_app_name ()
 get the application name
DLL_EXPORT void dsp_set_stdout (FILE *f)
 set the output log streeam
DLL_EXPORT void dsp_set_stderr (FILE *f)
 set the error log streeam
DLL_EXPORT void dsp_print (int x, char *str)
 log a message to the error or output streams

Detailed Description

Macro Definition Documentation

◆ DSP_ALIGN_NO_MATCH

#define DSP_ALIGN_NO_MATCH   8

No matches were found during comparison.

Definition at line 211 of file dsp.h.

◆ DSP_ALIGN_ROTATED

#define DSP_ALIGN_ROTATED   4

The stream is rotated by the reference.

Definition at line 207 of file dsp.h.

◆ DSP_ALIGN_SCALED

#define DSP_ALIGN_SCALED   2

The stream is scaled by the reference.

Definition at line 203 of file dsp.h.

◆ DSP_ALIGN_TRANSLATED

#define DSP_ALIGN_TRANSLATED   1

The stream is translated by the reference.

Definition at line 199 of file dsp.h.

◆ DSP_DEBUG

#define DSP_DEBUG

Definition at line 90 of file dsp.h.

◆ DSP_DEBUG_DEBUG

#define DSP_DEBUG_DEBUG   3

Definition at line 132 of file dsp.h.

◆ DSP_DEBUG_ERROR

#define DSP_DEBUG_ERROR   1

Definition at line 130 of file dsp.h.

◆ DSP_DEBUG_INFO

#define DSP_DEBUG_INFO   0

Definition at line 129 of file dsp.h.

◆ DSP_DEBUG_WARNING

#define DSP_DEBUG_WARNING   2

Definition at line 131 of file dsp.h.

◆ DSP_MAX_STARS

#define DSP_MAX_STARS   200

Definition at line 75 of file dsp.h.

◆ DSP_NAME_SIZE

#define DSP_NAME_SIZE   128

Definition at line 80 of file dsp.h.

◆ dsp_t_max

#define dsp_t_max   255

Definition at line 78 of file dsp.h.

◆ dsp_t_min

#define dsp_t_min   -dsp_t_max

Definition at line 79 of file dsp.h.

◆ end_gettime

#define end_gettime

Definition at line 166 of file dsp.h.

◆ Log

#define Log ( a,
b )
Value:
( log(a) / log(b) )
void log(const std::string &log)
Definition Utils.cpp:161

Logarithm of a with arbitrary base b.

Definition at line 194 of file dsp.h.

◆ Max

#define Max ( a,
b )
Value:
({ __typeof (a) _a = (a); \
__typeof (a) _b = (b); \
_a > _b ? _a : _b; })

if max() is not present you can use this one

Definition at line 187 of file dsp.h.

◆ Min

#define Min ( a,
b )
Value:
({ __typeof (a) _a = (a); \
__typeof (a) _b = (b); \
_a < _b ? _a : _b; })

if min() is not present you can use this one

Definition at line 180 of file dsp.h.

◆ pdbg

#define pdbg ( x,
... )
Value:
({ \
char str[500]; \
struct timespec ts; \
time_t t = time(NULL); \
struct tm tm = *localtime(&t); \
clock_gettime(CLOCK_REALTIME, &ts); \
sprintf(str, "[%04d-%02d-%02dT%02d:%02d:%02d.%03ld ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec/1000000); \
switch(x) { \
sprintf(&str[strlen(str)], "ERRO]"); \
break; \
sprintf(&str[strlen(str)], "WARN]"); \
break; \
sprintf(&str[strlen(str)], "DEBG]"); \
break; \
default: \
sprintf(&str[strlen(str)], "INFO]"); \
break; \
} \
if(dsp_get_app_name() != NULL) \
sprintf(&str[strlen(str)], "[%s]", dsp_get_app_name()); \
sprintf(&str[strlen(str)], " "); \
sprintf(&str[strlen(str)], __VA_ARGS__); \
dsp_print(x, str); \
})
#define DSP_DEBUG_ERROR
Definition dsp.h:130
#define DSP_DEBUG_WARNING
Definition dsp.h:131
DLL_EXPORT char * dsp_get_app_name()
get the application name
Definition stream.c:73
#define DSP_DEBUG_DEBUG
Definition dsp.h:132

Definition at line 133 of file dsp.h.

◆ perr

#define perr ( ...)
Value:
pdbg(DSP_DEBUG_ERROR, __VA_ARGS__)
#define pdbg(x,...)
Definition dsp.h:133

Definition at line 161 of file dsp.h.

◆ pfunc

#define pfunc   pgarb("%s\n", __func__)

Definition at line 164 of file dsp.h.

◆ pgarb

#define pgarb ( ...)
Value:
pdbg(DSP_DEBUG_DEBUG, __VA_ARGS__)

Definition at line 163 of file dsp.h.

◆ pinfo

#define pinfo ( ...)
Value:
pdbg(DSP_DEBUG_INFO, __VA_ARGS__)
#define DSP_DEBUG_INFO
Definition dsp.h:129

Definition at line 160 of file dsp.h.

◆ pwarn

#define pwarn ( ...)
Value:
pdbg(DSP_DEBUG_WARNING, __VA_ARGS__)

Definition at line 162 of file dsp.h.

◆ start_gettime

#define start_gettime

Definition at line 165 of file dsp.h.

Typedef Documentation

◆ complex_t

typedef double complex_t[2]

Definition at line 77 of file dsp.h.

◆ dsp_t

typedef double dsp_t

Definition at line 76 of file dsp.h.

Function Documentation

◆ dsp_get_app_name()

DLL_EXPORT char * dsp_get_app_name ( )

get the application name

Returns
The current application name printed on logs

Definition at line 73 of file stream.c.

◆ dsp_get_debug_level()

DLL_EXPORT int dsp_get_debug_level ( )

get the debug level

Returns
The current debug level

Definition at line 68 of file stream.c.

◆ dsp_max_threads()

DLL_EXPORT unsigned long int dsp_max_threads ( unsigned long value)

get/set the maximum number of threads allowed

Parameters
valueif greater than 1, set a maximum number of threads allowed
Returns
The current or new number of threads allowed during runtime

Definition at line 31 of file stream.c.

◆ dsp_print()

DLL_EXPORT void dsp_print ( int x,
char * str )

log a message to the error or output streams

Parameters
xThe log level
strThe string to print

Definition at line 50 of file stream.c.

◆ dsp_set_app_name()

DLL_EXPORT void dsp_set_app_name ( char * name)

set the application name

Parameters
namethe application name to be printed on logs

Definition at line 63 of file stream.c.

◆ dsp_set_debug_level()

DLL_EXPORT void dsp_set_debug_level ( int value)

set the debug level

Parameters
valuethe debug level

Definition at line 58 of file stream.c.

◆ dsp_set_stderr()

DLL_EXPORT void dsp_set_stderr ( FILE * f)

set the error log streeam

Parameters
fThe FILE stream pointer to set as standard error

Definition at line 45 of file stream.c.

◆ dsp_set_stdout()

DLL_EXPORT void dsp_set_stdout ( FILE * f)

set the output log streeam

Parameters
fThe FILE stream pointer to set as standard output

Definition at line 40 of file stream.c.