Diff for /libelwix/inc/elwix.h between versions 1.24.2.1 and 1.30.10.1

version 1.24.2.1, 2024/10/10 23:53:00 version 1.30.10.1, 2026/03/31 15:25:23
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 - 2026
         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 51  SUCH DAMAGE. Line 51  SUCH DAMAGE.
 #include <assert.h>  #include <assert.h>
 #include <syslog.h>  #include <syslog.h>
 #include <stdarg.h>  #include <stdarg.h>
   #include <stdalign.h>
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/param.h>  #include <sys/param.h>
 #include <sys/socket.h>  #include <sys/socket.h>
 #include <sys/un.h>  #include <sys/un.h>
   #include <stdatomic.h>
 #ifndef __linux__  #ifndef __linux__
 #include <sys/limits.h>  #include <sys/limits.h>
 #include <sys/endian.h>  #include <sys/endian.h>
Line 82  SUCH DAMAGE. Line 84  SUCH DAMAGE.
 #include <elwix/ajson.h>  #include <elwix/ajson.h>
 #include <elwix/aiov.h>  #include <elwix/aiov.h>
 #include <elwix/aindex.h>  #include <elwix/aindex.h>
   #include <elwix/aring.h>
   #include <elwix/auuid.h>
   
   
 #ifndef STRSIZ  #ifndef STRSIZ
Line 180  SUCH DAMAGE. Line 184  SUCH DAMAGE.
 #define VACUUM_BETWEEN          2  #define VACUUM_BETWEEN          2
   
   
extern int __isthreaded;typedef struct {
         E_ATOMIC_ALIGN int    value;
 } e_atomic_int;
   
   #ifdef __cplusplus
   extern "C" {
   #endif
   
   extern int __isthreaded;
   
 // 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);
 // elwix_GetProg() Get program memory pool name  // elwix_GetProg() Get program memory pool name
Line 259  extern int elwix_Verbose; Line 270  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 267  extern int elwix_Verbose; Line 278  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 288  extern int elwix_Debug; Line 299  extern int elwix_Debug;
 #define ELWIX_DEBUG_LOCK        0x20  #define ELWIX_DEBUG_LOCK        0x20
 #define ELWIX_DEBUG_SYS         0x40  #define ELWIX_DEBUG_SYS         0x40
 #define ELWIX_DEBUG_NET         0x80  #define ELWIX_DEBUG_NET         0x80
   #define ELWIX_DEBUG_1           0x100
   #define ELWIX_DEBUG_2           0x200
   #define ELWIX_DEBUG_3           0x400
   #define ELWIX_DEBUG_4           0x800
 #define ELWIX_DEBUG_ANY         0xFFFFFFFF  #define ELWIX_DEBUG_ANY         0xFFFFFFFF
   
 #define EDBG(x)                 (elwix_Debug & (x))  #define EDBG(x)                 (elwix_Debug & (x))
Line 296  extern int elwix_Debug; Line 311  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 305  extern int elwix_Debug; Line 320  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 340  extern int elwix_Debug; Line 355  extern int elwix_Debug;
                                                                 ait##_GetError()); \                                                                  ait##_GetError()); \
                                 } while (0)                                  } while (0)
   
   
   #ifdef __cplusplus
   }
   #endif
   
 #endif  #endif

Removed from v.1.24.2.1  
changed lines
  Added in v.1.30.10.1


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