Browse code

core: new command line option -I

- print details about default internal attributes

Daniel-Constantin Mierla authored on 27/10/2011 03:09:03
Showing 1 changed files
... ...
@@ -282,6 +282,34 @@ void print_ct_constants()
282 282
 #endif
283 283
 }
284 284
 
285
+/* print compile-time constants */
286
+void print_internals()
287
+{
288
+	printf("Print out of %s internals\n", NAME);
289
+	printf("  Version: %s\n", full_version);
290
+	printf("  Default config: %s\n", CFG_FILE);
291
+	printf("  Default paths to modules: %s\n", MODS_DIR);
292
+	printf("  Compile flags: %s\n", ver_flags );
293
+	printf("  MAX_RECV_BUFFER_SIZE=%d\n", MAX_RECV_BUFFER_SIZE);
294
+	printf("  MAX_LISTEN=%d\n", MAX_LISTEN);
295
+	printf("  MAX_URI_SIZE=%d\n", MAX_URI_SIZE);
296
+	printf("  BUF_SIZE=%d\n", BUF_SIZE);
297
+	printf("  DEFAULT PKG_SIZE=%uMB\n", PKG_MEM_SIZE);
298
+#ifdef SHM_MEM
299
+	printf("  DEFAULT SHM_SIZE=%uMB\n", SHM_MEM_SIZE);
300
+#endif
301
+#ifdef ADAPTIVE_WAIT
302
+	printf("  ADAPTIVE_WAIT_LOOPS=%d\n", ADAPTIVE_WAIT_LOOPS);
303
+#endif
304
+#ifdef USE_TCP
305
+	printf("  TCP poll methods: %s\n", poll_support);
306
+#endif
307
+	printf("  Source code revision ID: %s\n", ver_id);
308
+	printf("  Compiled with: %s\n", ver_compiler);
309
+	printf("  Compiled on: %s\n", ver_compiled_time);
310
+	printf("Thank you for flying %s!\n", NAME);
311
+}
312
+
285 313
 /* debugging function */
286 314
 /*
287 315
 void receive_stdin_loop()
... ...
@@ -1788,7 +1816,7 @@ int main(int argc, char** argv)
1788 1788
 
1789 1789
 	daemon_status_init();
1790 1790
 	/* command line options */
1791
-	options=  ":f:cm:M:dVhEb:l:L:n:vrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:"
1791
+	options=  ":f:cm:M:dVIhEb:l:L:n:vrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:"
1792 1792
 #ifdef STATS
1793 1793
 		"s:"
1794 1794
 #endif
... ...
@@ -1898,6 +1926,10 @@ int main(int argc, char** argv)
1898 1898
 
1899 1899
 					exit(0);
1900 1900
 					break;
1901
+			case 'I':
1902
+					print_internals();
1903
+					exit(0);
1904
+					break;
1901 1905
 			case 'E':
1902 1906
 					/* ignore it, was parsed immediately after startup */
1903 1907
 					break;
... ...
@@ -2048,6 +2080,7 @@ try_again:
2048 2048
 			case 'M':
2049 2049
 			case 'd':
2050 2050
 			case 'V':
2051
+			case 'I':
2051 2052
 			case 'h':
2052 2053
 			case 'O':
2053 2054
 			case 'A':