OlinCoin
Test
src
runtime
includes
shell.h
Go to the documentation of this file.
1
16
#pragma once
17
18
#include <uthash.h>
19
20
#define COMMAND_NAME_LEN 128
21
22
typedef
struct
{
23
char
*name;
24
int (*func)(
char
**);
25
size_t
num_args;
26
char
*help;
27
}
Command
;
28
29
typedef
struct
{
30
Command
*cmd;
31
UT_hash_handle hh;
32
}
CommandPool
;
33
34
size_t
arg_len(
char
**args);
35
void
str_to_buf
(
36
unsigned
char
*dest,
char
*hex_str,
37
size_t
dest_len,
size_t
src_len
38
);
39
40
int
shell_mine(
char
**args);
41
int
shell_build_tx(
char
**args);
42
int
shell_print_chain(
char
**args);
43
int
shell_print_block(
char
**args);
44
int
shell_exit(
char
**args);
45
int
shell_help(
char
**args);
46
47
char
*shell_read_line();
48
char
**shell_tokenize(
char
*line);
49
int
shell_execute(
size_t
num_args,
char
**args);
50
void
shell_loop();
51
52
void
shell_init_globals();
53
void
shell_init_commands();
54
void
shell_init();
55
56
CommandPool
*shell_command_pool;
str_to_buf
void str_to_buf(unsigned char *dest, char *hex_str, size_t dest_len, size_t src_len)
Converts a string of hex values to a buffer.
Definition:
shell.c:72
CommandPool
Definition:
shell.h:29
Command
Definition:
shell.h:22
Generated by
1.9.3