Diff for /libelwix/inc/elwix.h between versions 1.24 and 1.26

version 1.24, 2024/08/14 16:05:42 version 1.26, 2025/08/21 15:43:00
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004 - 2024Copyright 2004 - 2025
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 47  SUCH DAMAGE. Line 47  SUCH DAMAGE.
 #define __ELWIX_H  #define __ELWIX_H
   
   
   #include <stdio.h>
 #include <assert.h>  #include <assert.h>
 #include <syslog.h>  #include <syslog.h>
 #include <stdarg.h>  #include <stdarg.h>
Line 181  SUCH DAMAGE. Line 182  SUCH DAMAGE.
   
 extern int __isthreaded;  extern int __isthreaded;
   
   #ifdef __cplusplus
   extern "C" {
   #endif
   
 // elwix_SetProg() Set program memory pool name  // elwix_SetProg() Set program memory pool name
 void elwix_SetProg(const char *csProgName);  void elwix_SetProg(const char *csProgName);
Line 258  extern int elwix_Verbose; Line 262  extern int elwix_Verbose;
 #define EVERBS(x)               if ((x) <= elwix_Verbose)  #define EVERBS(x)               if ((x) <= elwix_Verbose)
 #define EVERBOSE(x, fmt, ...)   do { assert((fmt)); \  #define EVERBOSE(x, fmt, ...)   do { assert((fmt)); \
                                         if ((x) <= elwix_Verbose) { \                                          if ((x) <= elwix_Verbose) { \
                                                char __str[BUFSIZ] = { [0 ... BUFSIZ - 1] = 0 }; \                                                char __str[BUFSIZ] = { 0 }; \
                                                 snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \                                                  snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \
                                                 syslog(LOG_INFO, "Verbose(%d):%s(%d): %s\n", \                                                  syslog(LOG_INFO, "Verbose(%d):%s(%d): %s\n", \
                                                                 (x), __func__, __LINE__, __str); \                                                                  (x), __func__, __LINE__, __str); \
Line 266  extern int elwix_Verbose; Line 270  extern int elwix_Verbose;
                                 } while (0)                                  } while (0)
 #define EVERBOSE2(x, fmt, ...)  do { assert((fmt)); \  #define EVERBOSE2(x, fmt, ...)  do { assert((fmt)); \
                                         if ((x) <= elwix_Verbose) { \                                          if ((x) <= elwix_Verbose) { \
                                                char __str[0x10000] = { [0 ... 0xffff] = 0 }; \                                                char __str[0x10000] = { 0 }; \
                                                 snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \                                                  snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \
                                                 syslog(LOG_INFO, "Verbose(%d):%s(%d): %s\n", \                                                  syslog(LOG_INFO, "Verbose(%d):%s(%d): %s\n", \
                                                                 (x), __func__, __LINE__, __str); \                                                                  (x), __func__, __LINE__, __str); \
Line 295  extern int elwix_Debug; Line 299  extern int elwix_Debug;
                                            syslog(LOG_DEBUG, "I'm in %s(%d)\n", __func__, __LINE__)                                             syslog(LOG_DEBUG, "I'm in %s(%d)\n", __func__, __LINE__)
 #define EDEBUG(x, fmt, ...)     do { assert((fmt)); \  #define EDEBUG(x, fmt, ...)     do { assert((fmt)); \
                                         if ((x) & elwix_Debug) { \                                          if ((x) & elwix_Debug) { \
                                                char __str[BUFSIZ] = { [0 ... BUFSIZ - 1] = 0 }; \                                                char __str[BUFSIZ] = { 0 }; \
                                                 snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \                                                  snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \
                                                 syslog(LOG_DEBUG, "Debug(%d):%s(%d): %s\n", \                                                  syslog(LOG_DEBUG, "Debug(%d):%s(%d): %s\n", \
                                                                 (x), __func__, __LINE__, __str); \                                                                  (x), __func__, __LINE__, __str); \
Line 304  extern int elwix_Debug; Line 308  extern int elwix_Debug;
   
 /* Logger macro */  /* Logger macro */
 #define ELOGGER(x, fmt, ...)    do { assert((fmt)); \  #define ELOGGER(x, fmt, ...)    do { assert((fmt)); \
                                        char __str[BUFSIZ] = { [0 ... BUFSIZ - 1] = 0 }; \                                        char __str[BUFSIZ] = { 0 }; \
                                         snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \                                          snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \
                                        syslog((x), "Logger:%s(%d): %s\n", \                                        syslog((x), "Log:%s(%d): %s\n", \
                                                                 __func__, __LINE__, __str); \                                                                  __func__, __LINE__, __str); \
                                 } while (0)                                  } while (0)
   
 #define EWARNING(x, fmt, ...)   do { assert((fmt)); \  #define EWARNING(x, fmt, ...)   do { assert((fmt)); \
                                        char __str[BUFSIZ] = { [0 ... BUFSIZ - 1] = 0 }; \                                        char __str[BUFSIZ] = { 0 }; \
                                         snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \                                          snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \
                                         syslog(LOG_WARNING, "Warning:%s(%d): #%d - %s\n", \                                          syslog(LOG_WARNING, "Warning:%s(%d): #%d - %s\n", \
                                                          __func__, __LINE__, (x), __str); \                                                           __func__, __LINE__, (x), __str); \
                                 } while (0)                                  } while (0)
 /* Error state macros */  /* Error state macros */
 #define EERROR(x, fmt, ...)     do { assert((fmt)); \  #define EERROR(x, fmt, ...)     do { assert((fmt)); \
                                        char __str[BUFSIZ] = { [0 ... BUFSIZ - 1] = 0 }; \                                        char __str[BUFSIZ] = { 0 }; \
                                         snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \                                          snprintf(__str, sizeof __str, (fmt), ##__VA_ARGS__); \
                                         syslog(LOG_ERR, "Error:%s(%d): #%d - %s\n", \                                          syslog(LOG_ERR, "Error:%s(%d): #%d - %s\n", \
                                                          __func__, __LINE__, (x), __str); \                                                           __func__, __LINE__, (x), __str); \
Line 339  extern int elwix_Debug; Line 343  extern int elwix_Debug;
                                                                 ait##_GetError()); \                                                                  ait##_GetError()); \
                                 } while (0)                                  } while (0)
   
   
   #ifdef __cplusplus
   }
   #endif
   
 #endif  #endif

Removed from v.1.24  
changed lines
  Added in v.1.26


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>