aboutsummaryrefslogtreecommitdiffstats
path: root/cmd.h
blob: 436feac2ea745ac0b339e9f5bbbf84f3d6906ebd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef __IHE_CMD_H
#define __IHE_CMD_H

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>

typedef struct cmd_arg
{
	int argc;
	char **argv;
} cmd_arg;


typedef struct cmd_table
{
	char *cmd;
	int (*clb)(cmd_arg*);
} cmd_table;


int cnt_sep( char *s );
char* cmd_line(  char *prompt );
cmd_arg* cmd_parse( char *str );
int cmd_exec( cmd_arg *cmd, cmd_table *table );
void cmd_arg_free( cmd_arg *arg );
void cmd_sub_arg_free( cmd_arg *arg );
cmd_arg* sub_cmd( cmd_arg *arg );


#endif