cScm Configuration Daemon

cScm – is a tool to convert SCM configuration files into binary format and store its in shared memory for reading by cSvn-ui and cGit-ui CGI scripts

2 Commits   0 Branches   1 Tag
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  1) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  2) /**********************************************************************
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  3) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  4)   Copyright 2019 Andrey V.Kosteltsev
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  5) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  6)   Licensed under the Radix.pro License, Version 1.0 (the "License");
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  7)   you may not use this file  except  in compliance with the License.
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  8)   You may obtain a copy of the License at
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  9) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 10)      https://radix.pro/licenses/LICENSE-1.0-en_US.txt
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 11) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 12)   Unless required by applicable law or agreed to in writing, software
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 13)   distributed under the License is distributed on an "AS IS" BASIS,
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 14)   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 15)   implied.
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 16) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 17)  **********************************************************************/
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 18) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 19) #ifndef _MSG_LOG_H_
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 20) #define _MSG_LOG_H_
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 21) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 22) #ifdef __cplusplus
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 23) extern "C" {
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 24) #endif
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 25) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 26) extern FILE *errlog;
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 27) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 28) extern void (*fatal_error_hook)( void );
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 29) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 30) extern char *program;
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 31) extern int   exit_status;
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 32) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 33) enum _msg_type
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 34) {
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 35)   MSG_FATAL = 0,
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 36)   MSG_ERROR,
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 37)   MSG_WARNING,
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 38)   MSG_NOTICE,
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 39)   MSG_INFO,
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 40)   MSG_DEBUG,
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 41) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 42)   MSG_LOG
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 43) };
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 44) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 45) #define FATAL_ERROR( ... )                    \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 46)   do                                          \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 47)   {                                           \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 48)     logmsg( errlog, MSG_FATAL, __VA_ARGS__ ); \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 49)     if( fatal_error_hook) fatal_error_hook(); \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 50)     exit( EXIT_FAILURE );                     \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 51)   } while (0)
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 52) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 53) #define ERROR( ... )                          \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 54)   do                                          \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 55)   {                                           \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 56)     logmsg( errlog, MSG_ERROR, __VA_ARGS__ ); \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 57)     ++exit_status;                            \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 58)   } while (0)
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 59) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 60) #define WARNING( ... )                          \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 61)   do                                            \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 62)   {                                             \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 63)     logmsg( errlog, MSG_WARNING, __VA_ARGS__ ); \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 64)   } while (0)
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 65) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 66) #define NOTICE( ... )                          \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 67)   do                                           \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 68)   {                                            \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 69)     logmsg( errlog, MSG_NOTICE, __VA_ARGS__ ); \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 70)   } while (0)
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 71) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 72) #define INFO( ... )                          \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 73)   do                                         \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 74)   {                                          \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 75)     logmsg( errlog, MSG_INFO, __VA_ARGS__ ); \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 76)   } while (0)
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 77) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 78) #define DEBUG( ... )                          \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 79)   do                                          \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 80)   {                                           \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 81)     logmsg( errlog, MSG_DEBUG, __VA_ARGS__ ); \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 82)   } while (0)
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 83) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 84) #define LOG( ... )                          \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 85)   do                                        \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 86)   {                                         \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 87)     logmsg( errlog, MSG_LOG, __VA_ARGS__ ); \
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 88)   } while (0)
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 89) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 90) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 91) extern void logmsg( FILE *logfile, enum _msg_type type, char *format, ... );
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 92) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 93) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 94) #ifdef __cplusplus
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 95) }  /* ... extern "C" */
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 96) #endif
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 97) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 98) #endif /* _MSG_LOG_H_ */