Changeset 8324
- Timestamp:
- 02/08/13 05:12:08 (11 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cscrypt/cscrypt.h
r8199 r8324 7 7 8 8 #include "../config.h" 9 #include "../config-funcs.h"10 9 11 10 #if defined(WITH_SSL) || defined(WITH_LIBCRYPTO) -
trunk/globals.h
r8323 r8324 37 37 #include "cscrypt/idea.h" 38 38 39 /* 40 * The following hack is taken from Linux: include/linux/kconfig.h 41 * Original comment follows: 42 * Getting something that works in C and CPP for an arg that may or may 43 * not be defined is tricky. Here, if we have "#define CONFIG_BOOGER 1" 44 * we match on the placeholder define, insert the "0," for arg1 and generate 45 * the triplet (0, 1, 0). Then the last step cherry picks the 2nd arg (a one). 46 * When CONFIG_BOOGER is not defined, we generate a (... 1, 0) pair, and when 47 * the last step cherry picks the 2nd arg, we get a zero. 48 */ 49 #define __ARG_PLACEHOLDER_1 0, 50 #define config_enabled(cfg) _config_enabled(cfg) 51 #define _config_enabled(value) __config_enabled(__ARG_PLACEHOLDER_##value) 52 #define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0) 53 #define ___config_enabled(__ignored, val, ...) val 54 39 55 #include "config.h" 40 56 … … 71 87 #endif 72 88 73 #include "config-funcs.h"74 89 #include "cscrypt/cscrypt.h" 75 90 -
trunk/module-webif-lib.c
r8307 r8324 224 224 225 225 #define check_conf(CONFIG_VAR, text) \ 226 if (config_##CONFIG_VAR() && strncmp(#CONFIG_VAR, text, len) == 0) {ok = 1; break;}226 if (config_enabled(CONFIG_VAR) && strncmp(#CONFIG_VAR, text, len) == 0) {ok = 1; break;} 227 227 228 228 /* Returns an unparsed template either from disk or from internal templates. -
trunk/oscam-config-global.c
r8285 r8324 337 337 if (value[0]) { 338 338 if (value[0] == '+') { 339 if (config_ WITH_SSL()) {339 if (config_enabled(WITH_SSL)) { 340 340 cfg.http_use_ssl = 1; 341 341 } else { -
trunk/oscam-ecm.h
r8242 r8324 26 26 #define debug_ecm(mask, args...) \ 27 27 do { \ 28 if (config_ WITH_DEBUG() && ((mask) & cs_dblevel)) { \28 if (config_enabled(WITH_DEBUG) && ((mask) & cs_dblevel)) { \ 29 29 char buf[ECM_FMT_LEN]; \ 30 30 format_ecm(er, buf, ECM_FMT_LEN); \ -
trunk/oscam-log-reader.c
r8292 r8324 72 72 73 73 void rdr_debug_mask(struct s_reader * reader, uint16_t mask, char *fmt, ...) { 74 if (config_ WITH_DEBUG()) {74 if (config_enabled(WITH_DEBUG)) { 75 75 char txt[2048]; 76 76 va_list args; … … 83 83 84 84 void rdr_debug_mask_sensitive(struct s_reader * reader, uint16_t mask, char *fmt, ...) { 85 if (config_ WITH_DEBUG()) {85 if (config_enabled(WITH_DEBUG)) { 86 86 char txt[2048]; 87 87 va_list args; … … 95 95 96 96 void rdr_ddump_mask(struct s_reader * reader, uint16_t mask, const uint8_t * buf, int n, char *fmt, ...) { 97 if (config_ WITH_DEBUG()) {97 if (config_enabled(WITH_DEBUG)) { 98 98 char txt[2048]; 99 99 va_list args; -
trunk/oscam-log.h
r8278 r8324 16 16 #define cs_dump(buf, n, ...) cs_log_int(0, 1, buf, n, ##__VA_ARGS__) 17 17 18 #define cs_debug_mask(mask, ...) do { if (config_ WITH_DEBUG() && ((mask) & cs_dblevel)) cs_log_int(mask, 1, NULL, 0, ##__VA_ARGS__); } while(0)19 #define cs_debug_mask_nolock(mask, ...) do { if (config_ WITH_DEBUG() && ((mask) & cs_dblevel)) cs_log_int(mask, 0, NULL, 0, ##__VA_ARGS__); } while(0)20 #define cs_ddump_mask(mask, buf, n, ...) do { if (config_ WITH_DEBUG() && ((mask) & cs_dblevel)) cs_log_int(mask, 1, buf , n, ##__VA_ARGS__); } while(0)18 #define cs_debug_mask(mask, ...) do { if (config_enabled(WITH_DEBUG) && ((mask) & cs_dblevel)) cs_log_int(mask, 1, NULL, 0, ##__VA_ARGS__); } while(0) 19 #define cs_debug_mask_nolock(mask, ...) do { if (config_enabled(WITH_DEBUG) && ((mask) & cs_dblevel)) cs_log_int(mask, 0, NULL, 0, ##__VA_ARGS__); } while(0) 20 #define cs_ddump_mask(mask, buf, n, ...) do { if (config_enabled(WITH_DEBUG) && ((mask) & cs_dblevel)) cs_log_int(mask, 1, buf , n, ##__VA_ARGS__); } while(0) 21 21 22 22 void logCWtoFile(ECM_REQUEST *er, uchar *cw); -
trunk/oscam.c
r8317 r8324 90 90 #define _check(CONFIG_VAR, text) \ 91 91 do { \ 92 if (config_ ##CONFIG_VAR()) \92 if (config_enabled(CONFIG_VAR)) \ 93 93 printf(" %s", text); \ 94 94 } while(0) … … 114 114 _check(MODULE_MONITOR, "monitor"); 115 115 _check(WITH_SSL, "ssl"); 116 if (!config_ WITH_STAPI())116 if (!config_enabled(WITH_STAPI)) 117 117 _check(HAVE_DVBAPI, "dvbapi"); 118 118 else … … 185 185 printf(" -b, --daemon | Start in the background as daemon.\n"); 186 186 printf(" -B, --pidfile <pidfile> | Create pidfile when starting.\n"); 187 if (config_ WEBIF()) {187 if (config_enabled(WEBIF)) { 188 188 printf(" -r, --restart <level> | Set restart level:\n"); 189 189 printf(" . 0 - Restart disabled (exit on restart request).\n"); … … 214 214 printf(" -p, --pending-ecm <num> | Set the maximum number of pending ECM packets.\n"); 215 215 printf(" . Default: 32 Max: 255\n"); 216 if (config_ WEBIF()) {216 if (config_enabled(WEBIF)) { 217 217 printf(" -u, --utf8 | Enable WebIf support for UTF-8 charset.\n"); 218 218 } … … 292 292 break; 293 293 case 'r': // --restart 294 if (config_ WEBIF()) {294 if (config_enabled(WEBIF)) { 295 295 cs_restart_mode = atoi(optarg); 296 296 } … … 314 314 } 315 315 case 'u': // --utf8 316 if (config_ WEBIF()) {316 if (config_enabled(WEBIF)) { 317 317 cs_http_use_utf8 = 1; 318 318 printf("WARNING: Web interface UTF-8 mode enabled. Carefully read documentation as bugs may arise.\n"); … … 331 331 332 332 #define write_conf(CONFIG_VAR, text) \ 333 fprintf(fp, "%-30s %s\n", text ":", config_ ##CONFIG_VAR() ? "yes" : "no")333 fprintf(fp, "%-30s %s\n", text ":", config_enabled(CONFIG_VAR) ? "yes" : "no") 334 334 335 335 #define write_readerconf(CONFIG_VAR, text) \ 336 fprintf(fp, "%-30s %s\n", text ":", config_ ##CONFIG_VAR() ? "yes" : "no - no EMM support!")336 fprintf(fp, "%-30s %s\n", text ":", config_enabled(CONFIG_VAR) ? "yes" : "no - no EMM support!") 337 337 338 338 #define write_cardreaderconf(CONFIG_VAR, text) \ 339 fprintf(fp, "%s%-19s %s\n", "cardreader_", text ":", config_ ##CONFIG_VAR() ? "yes" : "no")339 fprintf(fp, "%s%-19s %s\n", "cardreader_", text ":", config_enabled(CONFIG_VAR) ? "yes" : "no") 340 340 341 341 static void write_versionfile(bool use_stdout) { … … 365 365 write_conf(WITH_SSL, "SSL support"); 366 366 write_conf(HAVE_DVBAPI, "DVB API support"); 367 if (config_ HAVE_DVBAPI()) {367 if (config_enabled(HAVE_DVBAPI)) { 368 368 write_conf(WITH_AZBOX, "DVB API with AZBOX support"); 369 369 write_conf(WITH_MCA, "DVB API with MCA support"); … … 397 397 fprintf(fp, "\n"); 398 398 write_conf(WITH_CARDREADER, "Reader support"); 399 if (config_ WITH_CARDREADER()) {399 if (config_enabled(WITH_CARDREADER)) { 400 400 fprintf(fp, "\n"); 401 401 write_readerconf(READER_NAGRA, "Nagra"); … … 440 440 #define report_emm_support(CONFIG_VAR, text) \ 441 441 do { \ 442 if (!config_ ##CONFIG_VAR()) \442 if (!config_enabled(CONFIG_VAR)) \ 443 443 cs_log("Binary without %s module - no EMM processing for %s possible!", text, text); \ 444 444 } while(0) 445 445 446 446 static void do_report_emm_support(void) { 447 if (!config_ WITH_CARDREADER()) {447 if (!config_enabled(WITH_CARDREADER)) { 448 448 cs_log("Binary without Cardreader Support! No EMM processing possible!"); 449 449 } else {
Note:
See TracChangeset
for help on using the changeset viewer.