OlinCoin
Test
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
22typedef struct {
23 char *name;
24 int (*func)(char **);
25 size_t num_args;
26 char *help;
27} Command;
28
29typedef struct {
30 Command *cmd;
31 UT_hash_handle hh;
33
34size_t arg_len(char **args);
35void str_to_buf(
36 unsigned char *dest, char *hex_str,
37 size_t dest_len, size_t src_len
38);
39
40int shell_mine(char **args);
41int shell_build_tx(char **args);
42int shell_print_chain(char **args);
43int shell_print_block(char **args);
44int shell_exit(char **args);
45int shell_help(char **args);
46
47char *shell_read_line();
48char **shell_tokenize(char *line);
49int shell_execute(size_t num_args, char **args);
50void shell_loop();
51
52void shell_init_globals();
53void shell_init_commands();
54void shell_init();
55
56CommandPool *shell_command_pool;
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
Definition: shell.h:29
Definition: shell.h:22