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

12 Commits   0 Branches   1 Tag
     5         kx 
     5         kx #ifdef HAVE_CONFIG_H
     5         kx #include <config.h>
     5         kx #endif
     5         kx 
     5         kx #include <stdlib.h>
     5         kx #include <stdio.h>
     5         kx #include <unistd.h>
     5         kx #include <string.h>
     5         kx #include <stdarg.h>
     5         kx #include <limits.h>
     5         kx #include <locale.h>
     5         kx #include <wchar.h>
     5         kx #include <wctype.h>
     5         kx 
     5         kx #include <defs.h>
     5         kx 
     5         kx #include <error.h>
     5         kx #include <msglog.h>
     5         kx #include <utf8ing.h>
     5         kx #include <lex.h>
     5         kx 
     5         kx 
     5         kx extern char *config_fname;
     5         kx 
     5         kx int errors   = 0;
     5         kx int warnings = 0;
     5         kx 
     5         kx 
     5         kx void error( char *fmt, ... )
     5         kx {
     5         kx   va_list arg_ptr;
     5         kx   char  buf[MAX_ERROR_MSG_SIZE];
     5         kx   char  msg[MAX_ERROR_MSG_SIZE];
     5         kx   char *format = "%s:%d:%d: %s";
     5         kx 
     5         kx   va_start( arg_ptr, fmt );
     5         kx 
     5         kx   vsnprintf( msg, MAX_ERROR_MSG_SIZE, (const void *)fmt, arg_ptr );
     5         kx 
     5         kx   va_end( arg_ptr ); /* Reset variable arguments. */
     5         kx 
     5         kx   snprintf( buf, MAX_ERROR_MSG_SIZE, format, config_fname, lineno, colno, msg );
     5         kx 
     5         kx   ERROR( "%s", buf );
     5         kx 
     5         kx   ++errors;
     5         kx }
     5         kx 
     5         kx void warning( char *fmt, ... )
     5         kx {
     5         kx   va_list arg_ptr;
     5         kx   char  buf[MAX_ERROR_MSG_SIZE];
     5         kx   char  msg[MAX_ERROR_MSG_SIZE];
     5         kx   char *format = "%s:%d:%d: %s";
     5         kx 
     5         kx   va_start( arg_ptr, fmt );
     5         kx 
     5         kx   vsnprintf( msg, MAX_ERROR_MSG_SIZE, (const void *)fmt, arg_ptr );
     5         kx 
     5         kx   va_end( arg_ptr ); /* Reset variable arguments. */
     5         kx 
     5         kx   snprintf( buf, MAX_ERROR_MSG_SIZE, format, config_fname, lineno, colno, msg );
     5         kx 
     5         kx   WARNING( "%s", buf );
     5         kx 
     5         kx   ++warnings;
     5         kx }
     5         kx 
     5         kx void no_space( void )
     5         kx {
     5         kx   char  buf[MAX_ERROR_MSG_SIZE];
     5         kx   char *format = "%s: Cannot allocate memory";
     5         kx 
     5         kx   snprintf( buf, MAX_ERROR_MSG_SIZE, format, config_fname );
     5         kx 
     5         kx   FATAL_ERROR( "%s", buf );
     5         kx 
     5         kx   ++errors;
     5         kx }
     5         kx 
     5         kx void unterminated_comment( void )
     5         kx {
     5         kx   char  buf[MAX_ERROR_MSG_SIZE];
     5         kx   char *format = "%s:%d:%d: Unterminated comment";
     5         kx 
     5         kx   snprintf( buf, MAX_ERROR_MSG_SIZE, format, config_fname, lineno, colno );
     5         kx 
     5         kx   ERROR( "%s", buf );
     5         kx 
     5         kx   ++errors;
     5         kx }