Instrument Neutral Distributed Interface INDI  2.0.2
Macros | Typedefs | Functions

Macros

#define DSP_MAX_STARS   200
 
#define dsp_t_max   255
 
#define dsp_t_min   -dsp_t_max
 
#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(...)   pdbg(DSP_DEBUG_INFO, __VA_ARGS__)
 
#define perr(...)   pdbg(DSP_DEBUG_ERROR, __VA_ARGS__)
 
#define pwarn(...)   pdbg(DSP_DEBUG_WARNING, __VA_ARGS__)
 
#define pgarb(...)   pdbg(DSP_DEBUG_DEBUG, __VA_ARGS__)
 
#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 More...
 
#define Max(a, b)
 if max() is not present you can use this one More...
 
#define Log(a, b)   ( log(a) / log(b) )
 Logarithm of a with arbitrary base b. More...
 
#define DSP_ALIGN_TRANSLATED   1
 The stream is translated by the reference. More...
 
#define DSP_ALIGN_SCALED   2
 The stream is scaled by the reference. More...
 
#define DSP_ALIGN_ROTATED   4
 The stream is rotated by the reference. More...
 
#define DSP_ALIGN_NO_MATCH   8
 No matches were found during comparison. More...
 

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 More...
 
DLL_EXPORT void dsp_set_debug_level (int value)
 set the debug level More...
 
DLL_EXPORT int dsp_get_debug_level ()
 get the debug level More...
 
DLL_EXPORT void dsp_set_app_name (char *name)
 set the application name More...
 
DLL_EXPORT char * dsp_get_app_name ()
 get the application name More...
 
DLL_EXPORT void dsp_set_stdout (FILE *f)
 set the output log streeam More...
 
DLL_EXPORT void dsp_set_stderr (FILE *f)
 set the error log streeam More...
 
DLL_EXPORT void dsp_print (int x, char *str)
 log a message to the error or output streams More...
 

Detailed Description

Macro Definition Documentation

◆ DSP_ALIGN_NO_MATCH

#define DSP_ALIGN_NO_MATCH   8

No matches were found during comparison.

Definition at line 203 of file dsp.h.

◆ DSP_ALIGN_ROTATED

#define DSP_ALIGN_ROTATED   4

The stream is rotated by the reference.

Definition at line 199 of file dsp.h.

◆ DSP_ALIGN_SCALED

#define DSP_ALIGN_SCALED   2

The stream is scaled by the reference.

Definition at line 195 of file dsp.h.

◆ DSP_ALIGN_TRANSLATED

#define DSP_ALIGN_TRANSLATED   1

The stream is translated by the reference.

Definition at line 191 of file dsp.h.

◆ DSP_DEBUG

#define DSP_DEBUG

Definition at line 82 of file dsp.h.

◆ DSP_DEBUG_DEBUG

#define DSP_DEBUG_DEBUG   3

Definition at line 124 of file dsp.h.

◆ DSP_DEBUG_ERROR

#define DSP_DEBUG_ERROR   1

Definition at line 122 of file dsp.h.

◆ DSP_DEBUG_INFO

#define DSP_DEBUG_INFO   0

Definition at line 121 of file dsp.h.

◆ DSP_DEBUG_WARNING

#define DSP_DEBUG_WARNING   2

Definition at line 123 of file dsp.h.

◆ DSP_MAX_STARS

#define DSP_MAX_STARS   200

Definition at line 68 of file dsp.h.

◆ dsp_t_max

#define dsp_t_max   255

Definition at line 71 of file dsp.h.

◆ dsp_t_min

#define dsp_t_min   -dsp_t_max

Definition at line 72 of file dsp.h.

◆ end_gettime

#define end_gettime

Definition at line 158 of file dsp.h.

◆ Log

#define Log (   a,
 
)    ( log(a) / log(b) )

Logarithm of a with arbitrary base b.

Definition at line 186 of file dsp.h.

◆ Max

#define Max (   a,
 
)
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 179 of file dsp.h.

◆ Min

#define Min (   a,
 
)
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 172 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:122
#define DSP_DEBUG_WARNING
Definition: dsp.h:123
#define DSP_DEBUG_DEBUG
Definition: dsp.h:124
DLL_EXPORT char * dsp_get_app_name()
get the application name
Definition: stream.c:73

Definition at line 125 of file dsp.h.

◆ perr

#define perr (   ...)    pdbg(DSP_DEBUG_ERROR, __VA_ARGS__)

Definition at line 153 of file dsp.h.

◆ pfunc

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

Definition at line 156 of file dsp.h.

◆ pgarb

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

Definition at line 155 of file dsp.h.

◆ pinfo

#define pinfo (   ...)    pdbg(DSP_DEBUG_INFO, __VA_ARGS__)

Definition at line 152 of file dsp.h.

◆ pwarn

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

Definition at line 154 of file dsp.h.

◆ start_gettime

#define start_gettime

Definition at line 157 of file dsp.h.

Typedef Documentation

◆ complex_t

typedef double complex_t[2]

Definition at line 70 of file dsp.h.

◆ dsp_t

typedef double dsp_t

Definition at line 69 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.