[hipl-commit] [tiny] Rev 3700: Print loaded modules at startup of hipd.

  • From: Tim Just <tim.just@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Fri, 19 Mar 2010 10:45:54 +0200

Committer: Tim Just <tim.just@xxxxxxxxxxxxxx>
Date: 19/03/2010 at 10:45:54
Revision: 3700
Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: tiny

Log:
  Print loaded modules at startup of hipd.

Modified:
  M  hipd/init.c
  M  lib/modularization/lmod.c
  M  lib/modularization/lmod.h

=== modified file 'hipd/init.c'
--- hipd/init.c 2010-03-18 17:03:04 +0000
+++ hipd/init.c 2010-03-19 08:45:27 +0000
@@ -946,6 +946,10 @@
                      "Module initialization failed.\n");
     }
 
+    printf("\nThe following modules were loaded:\n\n");
+    lmod_print_registered_modules();
+    printf("\n");
+
     hip_init_sockets();
 
 out_err:

=== modified file 'lib/modularization/lmod.c'
--- lib/modularization/lmod.c   2010-03-19 08:30:24 +0000
+++ lib/modularization/lmod.c   2010-03-19 08:45:27 +0000
@@ -8,6 +8,7 @@
  * @author Tim Just <tim.just@xxxxxxxxxxxxxx>
  *
  */
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -385,6 +386,20 @@
 }
 
 /**
+ * lmod_print_registered_modules
+ *
+ * Print all registered modules to stdout.
+ */
+void lmod_print_registered_modules(void)
+{
+    unsigned int i;
+
+    for (i = 0; i < num_modules; i++) {
+        printf("%s\n", module_list[i]);
+    }
+}
+
+/**
  * lmod_uninit_module_list
  *
  * Free all allocated memory for storage of the module list.

=== modified file 'lib/modularization/lmod.h'
--- lib/modularization/lmod.h   2010-03-18 15:36:44 +0000
+++ lib/modularization/lmod.h   2010-03-19 08:45:27 +0000
@@ -52,6 +52,8 @@
 
 int lmod_module_exists(const char *module_id);
 
+void lmod_print_registered_modules(void);
+
 void lmod_uninit_module_list(void);
 
 int lmod_register_packet_type(const uint16_t packet_type,

Other related posts:

  • » [hipl-commit] [tiny] Rev 3700: Print loaded modules at startup of hipd. - Tim Just