EE445M RTOS
Taken at the University of Texas Spring 2015
system.h
Go to the documentation of this file.
1 /* -*- mode: c; c-basic-offset: 4; -*- */
2 /* Created by Eric Crosson 2015-02-10 */
3 #ifndef __SYSTEM__
4 #define __SYSTEM__
5 
6 #include <stdbool.h>
7 #include "libstd/nexus.h"
8 
14 #define SYSTEM_MAX_COMMAND_NAME_LENGTH 16
15 
17 #define SYSTEM_MAX_COMMANDS 16
18 
21 typedef uint8_t system_iterator;
22 
24 typedef uint8_t exit_status_t;
25 
27 struct system_command;
28 typedef struct system_command {
29 
30  /* TODO: document members of the struct */
31  bool valid;
33  int(*command)();
34 
38 
41 void system_init();
42 
46 bool system_register_command(const char*, int(*)());
47 
51 bool system_deregister_command(const char*);
52 
57 exit_status_t system_exec(const char*, const char**);
58 
61 system_command* _system_command_from_name(const char* command_name);
62 
63 #endif
64 
char name[16]
Definition: system.h:32
exit_status_t system_exec(const char *, const char **)
Definition: system.c:69
system_command * _system_command_from_name(const char *command_name)
Definition: system.c:58
#define SYSTEM_MAX_COMMAND_NAME_LENGTH
Definition: system.h:14
struct system_command * next
Definition: system.h:35
struct system_command system_command
bool system_deregister_command(const char *)
Definition: system.c:45
int(* command)()
Definition: system.h:33
struct system_command * prev
Definition: system.h:36
bool valid
Definition: system.h:31
uint8_t exit_status_t
Definition: system.h:24
uint8_t system_iterator
Definition: system.h:21
void system_init()
Definition: system.c:19
bool system_register_command(const char *, int(*)())
Definition: system.c:29