Browse Source

klish: File for intractive code

Serj Kalichev 1 year ago
parent
commit
8b808c1234
4 changed files with 24 additions and 3 deletions
  1. 1 0
      bin/klish/Makefile.am
  2. 16 0
      bin/klish/interactive.c
  3. 2 2
      bin/klish/klish.c
  4. 5 1
      bin/klish/private.h

+ 1 - 0
bin/klish/Makefile.am

@@ -4,6 +4,7 @@ bin_PROGRAMS += \
 bin_klish_klish_SOURCES = \
 	bin/klish/private.h \
 	bin/klish/opts.c \
+	bin/klish/interactive.c \
 	bin/klish/klish.c
 
 bin_klish_klish_LDADD = \

+ 16 - 0
bin/klish/interactive.c

@@ -0,0 +1,16 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <klish/ktp.h>
+#include <klish/ktp_session.h>
+
+
+int klish_interactive_shell(ktp_session_t *ktp)
+{
+
+
+
+
+	return 0;
+}
+

+ 2 - 2
bin/klish/klish.c

@@ -125,8 +125,8 @@ int main(int argc, char **argv)
 
 	// Interactive shell
 	} else {
-	
-	
+		// Interactive code is complex so move it to separate file
+		retcode = klish_interactive_shell(ktp);
 	}
 
 	retval = 0;

+ 5 - 1
bin/klish/private.h

@@ -1,5 +1,6 @@
 #include <faux/list.h>
-
+#include <klish/ktp.h>
+#include <klish/ktp_session.h>
 
 #ifndef VERSION
 #define VERSION "1.0.0"
@@ -23,3 +24,6 @@ void help(int status, const char *argv0);
 struct options *opts_init(void);
 void opts_free(struct options *opts);
 int opts_parse(int argc, char *argv[], struct options *opts);
+
+// Interactive shell
+int klish_interactive_shell(ktp_session_t *ktp);