diff ie-docker.h @ 19:fe7095c365cf

WIP: Cleanup source code
author atton
date Tue, 24 Nov 2015 17:22:12 +0900
parents c64a640558ba
children 8a086917cf1a
line wrap: on
line diff
--- a/ie-docker.h	Tue Nov 24 16:59:54 2015 +0900
+++ b/ie-docker.h	Tue Nov 24 17:22:12 2015 +0900
@@ -1,26 +1,27 @@
 /* Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License */
 #ifndef IE_DOCKER
 
-#define command "/usr/bin/docker"
-#define ps_command "/usr/bin/docker ps -a"
+#define base_exec_command "/usr/bin/docker"
+#define ps_exec_command   "/usr/bin/docker ps -a"
+
 #define run_command "run"
-#define build_command "build"
+#define build_command ""
 #define attach_command "attach"
 // #define pull_command "pull" /* download docker image command */
-#define images_command "images" /* list images command */
-#define commit_command "commit" /* make image command */
+#define images_command "" /* list images command */
+#define commit_command "" /* make image command */
 #define rm_command "rm" /* remove container command */
 #define rmi_command "rmi" /* remove image command */
-#define start_command "start" 
-#define stop_command "stop" 
+#define start_command "start"
+#define stop_command "stop"
 #define exec_command "exec"
+#define cp_command "cp"
+#define ps_command "ps"
 
-#define create_command "create"
+#define create_command ""
 
 /* Define global variables */
 
-static char bad_name[] = "Bad process name. Try students_e11_e115711_01 or teachers_kono_02\n";
-
 const char *guests[] = {"mata"};
 const char *managers[] = {"taira"};
 const char students_sym[] = "students";
@@ -29,7 +30,7 @@
 const char delimiter[] = "_";
 const char portlist_file[] = "/etc/iedocker/iedockerport.list";
 
-enum { 
+enum {
     NAME_LENGTH = 50,
     PS_NAME_LENGTH = 50,
     RUN_COMMAND_LENGTH = 1024,
@@ -37,7 +38,7 @@
     BUFF_SIZE = 50
 };
 
-enum { 
+enum {
     STUDENTS,
     GUESTS,
     MANAGERS
@@ -58,7 +59,7 @@
  * -v volume
  * -m memory
  * image name
- * -i skeep open tdin 
+ * -i skeep open tdin
  */
 
 enum {
@@ -82,7 +83,7 @@
     int dettach; // true = 1; false = 0
     int interactive; // true = 1; false = 0
     char ps_name[64]; // user decide name
-    char exec_ps_command[64]; // 
+    char exec_ps_command[64]; //
     char volume[128];
     char image_name[16];
 } run_command_opt;