aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/command.h3
-rw-r--r--src/include/general.h1
-rw-r--r--src/include/target.h15
3 files changed, 15 insertions, 4 deletions
diff --git a/src/include/command.h b/src/include/command.h
index 34db13d..a44ed13 100644
--- a/src/include/command.h
+++ b/src/include/command.h
@@ -22,9 +22,10 @@
#define __COMMAND_H
#include "general.h"
+#include "target.h"
int command_process(char *cmd);
-typedef void (*cmd_handler)(int argc, const char **argv);
+typedef bool (*cmd_handler)(target *t, int argc, const char **argv);
struct command_s {
const char *cmd;
diff --git a/src/include/general.h b/src/include/general.h
index 65ec2af..b0721ac 100644
--- a/src/include/general.h
+++ b/src/include/general.h
@@ -29,6 +29,7 @@
#endif
#include <stdint.h>
+#include <stdbool.h>
#endif
diff --git a/src/include/target.h b/src/include/target.h
index 5f3a5ab..dc602aa 100644
--- a/src/include/target.h
+++ b/src/include/target.h
@@ -27,9 +27,6 @@
typedef struct target_s target;
-target *target_new(unsigned size);
-void target_list_free(void);
-
/* Halt/resume functions */
#define target_attach(target) \
(target)->attach(target)
@@ -164,13 +161,25 @@ struct target_s {
const uint8_t *src, int len);
const char *driver;
+ struct target_command_s *commands;
int size;
struct target_s *next;
+
+};
+
+struct target_command_s {
+ const char *specific_name;
+ const struct command_s *cmds;
+ struct target_command_s *next;
};
extern target *target_list, *cur_target, *last_target;
+target *target_new(unsigned size);
+void target_list_free(void);
+void target_add_commands(target *t, const struct command_s *cmds, const char *name);
+
/* Probe for various targets.
* Actual functions implemented in their respective drivers.
*/