Просмотр исходного кода

ncd: modules: synchronous_process: rename to spawn

ambrop7 14 лет назад
Родитель
Сommit
8d752d8bd6

+ 1 - 1
blog_channels.txt

@@ -20,7 +20,7 @@ ncd_blocker 4
 ncd_ip_in_network 4
 ncd_run 4
 ncd_runonce 4
-ncd_synchronous_process 4
+ncd_spawn 4
 ncd_call 4
 ncd_ref 4
 ncd_process_manager 4

+ 4 - 0
generated/blog_channel_ncd_spawn.h

@@ -0,0 +1,4 @@
+#ifdef BLOG_CURRENT_CHANNEL
+#undef BLOG_CURRENT_CHANNEL
+#endif
+#define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_spawn

+ 0 - 4
generated/blog_channel_ncd_synchronous_process.h

@@ -1,4 +0,0 @@
-#ifdef BLOG_CURRENT_CHANNEL
-#undef BLOG_CURRENT_CHANNEL
-#endif
-#define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_synchronous_process

+ 1 - 1
generated/blog_channels_defines.h

@@ -20,7 +20,7 @@
 #define BLOG_CHANNEL_ncd_ip_in_network 19
 #define BLOG_CHANNEL_ncd_run 20
 #define BLOG_CHANNEL_ncd_runonce 21
-#define BLOG_CHANNEL_ncd_synchronous_process 22
+#define BLOG_CHANNEL_ncd_spawn 22
 #define BLOG_CHANNEL_ncd_call 23
 #define BLOG_CHANNEL_ncd_ref 24
 #define BLOG_CHANNEL_ncd_process_manager 25

+ 1 - 1
generated/blog_channels_list.h

@@ -20,7 +20,7 @@
 {.name = "ncd_ip_in_network", .loglevel = 4},
 {.name = "ncd_run", .loglevel = 4},
 {.name = "ncd_runonce", .loglevel = 4},
-{.name = "ncd_synchronous_process", .loglevel = 4},
+{.name = "ncd_spawn", .loglevel = 4},
 {.name = "ncd_call", .loglevel = 4},
 {.name = "ncd_ref", .loglevel = 4},
 {.name = "ncd_process_manager", .loglevel = 4},

+ 1 - 1
ncd/CMakeLists.txt

@@ -54,7 +54,7 @@ add_executable(badvpn-ncd
     modules/ip_in_network.c
     modules/run.c
     modules/runonce.c
-    modules/synchronous_process.c
+    modules/spawn.c
     modules/call.c
     modules/ref.c
     modules/process_manager.c

+ 2 - 2
ncd/modules/modules.h

@@ -44,7 +44,7 @@ extern const struct NCDModuleGroup ncdmodule_blocker;
 extern const struct NCDModuleGroup ncdmodule_ip_in_network;
 extern const struct NCDModuleGroup ncdmodule_run;
 extern const struct NCDModuleGroup ncdmodule_runonce;
-extern const struct NCDModuleGroup ncdmodule_synchronous_process;
+extern const struct NCDModuleGroup ncdmodule_spawn;
 extern const struct NCDModuleGroup ncdmodule_call;
 extern const struct NCDModuleGroup ncdmodule_ref;
 extern const struct NCDModuleGroup ncdmodule_process_manager;
@@ -88,7 +88,7 @@ static const struct NCDModuleGroup *ncd_modules[] = {
     &ncdmodule_ip_in_network,
     &ncdmodule_run,
     &ncdmodule_runonce,
-    &ncdmodule_synchronous_process,
+    &ncdmodule_spawn,
     &ncdmodule_call,
     &ncdmodule_ref,
     &ncdmodule_process_manager,

+ 9 - 5
ncd/modules/synchronous_process.c → ncd/modules/spawn.c

@@ -1,5 +1,5 @@
 /**
- * @file synchronous_process.c
+ * @file spawn.c
  * @author Ambroz Bizjak <ambrop7@gmail.com>
  * 
  * @section LICENSE
@@ -24,7 +24,7 @@
  * Module which starts a process from a process template on initialization, and
  * stops it on deinitialization.
  * 
- * Synopsis: synchronous_process(string template_name, list args)
+ * Synopsis: spawn(string template_name, list args)
  * Description: on initialization, creates a new process from the template named
  *   template_name, with arguments args. On deinitialization, initiates termination
  *   of the process and waits for it to terminate.
@@ -34,7 +34,7 @@
 
 #include <ncd/NCDModule.h>
 
-#include <generated/blog_channel_ncd_synchronous_process.h>
+#include <generated/blog_channel_ncd_spawn.h>
 
 #define ModuleLog(i, ...) NCDModuleInst_Backend_Log((i), BLOG_CURRENT_CHANNEL, __VA_ARGS__)
 
@@ -163,7 +163,11 @@ static void func_die (void *vo)
 
 static const struct NCDModule modules[] = {
     {
-        .type = "synchronous_process",
+        .type = "spawn",
+        .func_new = func_new,
+        .func_die = func_die
+    }, {
+        .type = "synchronous_process", // deprecated name
         .func_new = func_new,
         .func_die = func_die
     }, {
@@ -171,6 +175,6 @@ static const struct NCDModule modules[] = {
     }
 };
 
-const struct NCDModuleGroup ncdmodule_synchronous_process = {
+const struct NCDModuleGroup ncdmodule_spawn = {
     .modules = modules
 };