Changeset 1064 in MondoRescue for branches/stable/mondo/src/lib
- Timestamp:
- Jan 23, 2007, 1:09:32 AM (18 years ago)
- Location:
- branches/stable/mondo/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/lib/mr_conf.c
r1054 r1064 68 68 static size_t mr_conf_filesize(const char *name); 69 69 static void mr_conf_error_msg(int error_code, const char *add_line); 70 static void mr_conf_remove_comments( );70 static void mr_conf_remove_comments(void); 71 71 static int mr_conf_check_int_flag(const int flag); 72 72 static void mr_conf_set_int_flag(const int flag); … … 141 141 142 142 /*release all memory and prepare to the next possiable config file*/ 143 void mr_conf_close( ) {143 void mr_conf_close(void) { 144 144 /* if not opened => error */ 145 145 if (!mr_conf_check_int_flag(MRCONF_INTFLAG_OPEN)) { -
branches/stable/mondo/src/lib/mr_err.c
r1061 r1064 9 9 * Provided under the GPLv2 10 10 */ 11 12 #ifndef _GNU_SOURCE 13 #define _GNU_SOURCE 14 #endif 11 15 12 16 #include <stdio.h> -
branches/stable/mondo/src/lib/mr_mem.c
r1061 r1064 9 9 * Provided under the GPLv2 10 10 */ 11 12 #ifndef _GNU_SOURCE 13 #define _GNU_SOURCE 14 #endif 11 15 12 16 #include <stdio.h> … … 52 56 53 57 /* encapsulation function for asprintf */ 54 void mr_asprintf(char **strp, const char *fmt, va_list args) {58 void mr_asprintf(char **strp, const char *fmt, ...) { 55 59 56 60 int res = 0; 61 va_list args; 57 62 63 va_start(args,fmt); 58 64 res = vasprintf(strp, fmt, args); 59 65 if (res == -1) { 60 66 mr_log_exit(-1,"Unable to alloc memory in mr_asprintf\nExiting..."); 61 67 } 68 va_end(args); 62 69 } 63 70 -
branches/stable/mondo/src/lib/mr_msg.c
r1061 r1064 10 10 */ 11 11 12 #ifndef _GNU_SOURCE 13 #define _GNU_SOURCE 14 #endif 12 15 #include <stdio.h> 13 16 #include <stdarg.h> 17 #include <stdlib.h> 14 18 15 19 static int mr_loglevel = 0; … … 43 47 * but through other functions 44 48 */ 45 void _mr_msg(int debug, const char *file, const char *function, int line, const char *fmt, va_list args) {49 void _mr_msg(int debug, const char *file, const char *function, int line, const char *fmt, ...) { 46 50 47 51 int i = 0; 48 52 int res = 0; 49 53 FILE *fout = NULL; 54 va_list args; 50 55 51 56 if (mr_logfile == NULL) { … … 58 63 return; 59 64 } 65 va_start(args,fmt); 60 66 61 67 // add 2 spaces to distinguish log levels … … 67 73 if (vfprintf(fout, fmt, args) < 0) { 68 74 fprintf(stderr,"Unable to print to %s\n",mr_logfile); 69 return;70 75 } 71 76 … … 74 79 fprintf(stderr,"Unable to close %s\n",mr_logfile); 75 80 } 81 va_end(args); 76 82 } 77 83 } 78 84 79 void mr_msg(int level, const char *fmt, va_list args) {85 void mr_msg(int level, const char *fmt, ...) { 80 86 87 va_list args; 88 89 va_start(args,fmt); 81 90 _mr_msg(level, __FILE__, __FUNCTION__, __LINE__, fmt, args); 91 va_end(args); 82 92 }
Note:
See TracChangeset
for help on using the changeset viewer.