Akifumi Takahashi / StrCommandHandler

Dependents:   Interference_Simple StrCommandHandler_Demo

Revision:
2:a4873d38a32c
Parent:
1:1d46d90eb7bf
Child:
3:049a5f083f32
--- a/StrCommandHandler.h	Thu Oct 31 18:57:43 2019 +0000
+++ b/StrCommandHandler.h	Thu Nov 14 00:40:03 2019 +0000
@@ -18,16 +18,16 @@
     /** Maps strings and functions
      *
      *  This maps strings(commands) and functions receiving no arguments,
-     *  returning int.
+     *  returning something of pointer.
      */
-    int map(
+    void map(
         const char * const   arg_command,
-        int (*arg_pfunc)(void)
+        void * (*arg_pfunc)(void)
     );
 
     /** Analyzes a command input and executs a function corresponding to it.
      *
-     *  This analyze a string(commands) and executs a corresponding function.
+     *  This analyzes a string(commands) and executs a corresponding function.
      *  If an error occur, the function returns an error code
      *  Error code:
      *  -   Exception of NULL pointer           returns 0xFFFFFFFF
@@ -35,7 +35,7 @@
      *  -   Exception of Over length            returns 0xFFFFFFFD
      *  -   Exception of Not registered Command returns 0xFFFFFFFC;
      */
-    int exe(
+    void * exe(
         const char* const   arg_command
     );
 
@@ -56,7 +56,7 @@
      *
      *   The length should be within 15 without last '\0'
      */
-    int (**m_function)(void);
+    void * (**m_function)(void);
 
     /** Numbers of commands registered in this.
      *
@@ -64,5 +64,11 @@
      *  this value increase by 5, and arrays get reallocated.
      */
     int m_num_ofcommands;
+    
+    /** Result code of exe()
+     *  
+     *  This is supposed to be offered by pointer
+     */
+    int m_rescode;
 };
 #endif
\ No newline at end of file