Sfoglia il codice sorgente

Rename shell plugin to script plugin

Serj Kalichev 2 anni fa
parent
commit
fea459504e

+ 2 - 2
plugins/Makefile.am

@@ -4,8 +4,8 @@ plugin_LTLIBRARIES =
 EXTRA_DIST += \
 	plugins/klish/Makefile.am \
 	plugins/lua/Makefile.am \
-	plugins/shell/Makefile.am
+	plugins/script/Makefile.am
 
 include $(top_srcdir)/plugins/klish/Makefile.am
 include $(top_srcdir)/plugins/lua/Makefile.am
-include $(top_srcdir)/plugins/shell/Makefile.am
+include $(top_srcdir)/plugins/script/Makefile.am

+ 11 - 0
plugins/script/Makefile.am

@@ -0,0 +1,11 @@
+plugin_LTLIBRARIES += kplugin-script.la
+kplugin_script_la_SOURCES =
+kplugin_script_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -module
+kplugin_script_la_LIBS =
+kplugin_script_la_CFLAGS = $(AM_LDFLAGS)
+kplugin_script_la_LIBADD = libklish.la
+
+kplugin_script_la_SOURCES += \
+	plugins/script/private.h \
+	plugins/script/plugin_init.c \
+	plugins/script/script.c

+ 6 - 6
plugins/shell/plugin_init.c → plugins/script/plugin_init.c

@@ -13,11 +13,11 @@
 #include "private.h"
 
 
-const uint8_t kplugin_shell_major = KPLUGIN_MAJOR;
-const uint8_t kplugin_shell_minor = KPLUGIN_MINOR;
+const uint8_t kplugin_script_major = KPLUGIN_MAJOR;
+const uint8_t kplugin_script_minor = KPLUGIN_MINOR;
 
 
-int kplugin_shell_init(kcontext_t *context)
+int kplugin_script_init(kcontext_t *context)
 {
 	kplugin_t *plugin = NULL;
 	ksym_t *sym = NULL;
@@ -26,15 +26,15 @@ int kplugin_shell_init(kcontext_t *context)
 	plugin = kcontext_plugin(context);
 	assert(plugin);
 
-	kplugin_add_syms(plugin, ksym_new("shell", shell_shell));
+	kplugin_add_syms(plugin, ksym_new("script", script_script));
 
 	return 0;
 }
 
 
-int kplugin_shell_fini(kcontext_t *context)
+int kplugin_script_fini(kcontext_t *context)
 {
-//	fprintf(stderr, "Plugin 'shell' fini\n");
+//	fprintf(stderr, "Plugin 'script' fini\n");
 	context = context;
 
 	return 0;

+ 19 - 0
plugins/script/private.h

@@ -0,0 +1,19 @@
+/*
+ * private.h
+ */
+
+#ifndef _plugins_script_h
+#define _plugins_script_h
+
+#include <faux/faux.h>
+#include <klish/kcontext_base.h>
+
+
+C_DECL_BEGIN
+
+int script_script(kcontext_t *context);
+
+C_DECL_END
+
+
+#endif // _plugins_script_h

+ 4 - 4
plugins/shell/shell.c → plugins/script/script.c

@@ -20,7 +20,7 @@
 #include <klish/ksession.h>
 
 
-static char *shell_mkfifo(void)
+static char *script_mkfifo(void)
 {
 	int res = 0;
 	char *name = NULL;
@@ -151,8 +151,8 @@ static char *find_out_shebang(const char *script)
 }
 
 
-// Execute shell script
-int shell_shell(kcontext_t *context)
+// Execute script
+int script_script(kcontext_t *context)
 {
 	const char *script = NULL;
 	pid_t cpid = -1;
@@ -167,7 +167,7 @@ int shell_shell(kcontext_t *context)
 		return 0;
 
 	// Create FIFO
-	if (!(fifo_name = shell_mkfifo())) {
+	if (!(fifo_name = script_mkfifo())) {
 		fprintf(stderr, "Error: Can't create temporary FIFO.\n"
 			"Error: The ACTION will be not executed.\n");
 		return -1;

+ 0 - 11
plugins/shell/Makefile.am

@@ -1,11 +0,0 @@
-plugin_LTLIBRARIES += kplugin-shell.la
-kplugin_shell_la_SOURCES =
-kplugin_shell_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -module
-kplugin_shell_la_LIBS =
-kplugin_shell_la_CFLAGS = $(AM_LDFLAGS)
-kplugin_shell_la_LIBADD = libklish.la
-
-kplugin_shell_la_SOURCES += \
-	plugins/shell/private.h \
-	plugins/shell/plugin_init.c \
-	plugins/shell/shell.c

+ 0 - 19
plugins/shell/private.h

@@ -1,19 +0,0 @@
-/*
- * private.h
- */
-
-#ifndef _plugins_shell_h
-#define _plugins_shell_h
-
-#include <faux/faux.h>
-#include <klish/kcontext_base.h>
-
-
-C_DECL_BEGIN
-
-int shell_shell(kcontext_t *context);
-
-C_DECL_END
-
-
-#endif // _plugins_shell_h