diff options
author | FreeArtMan <dos21h@gmail.com> | 2016-05-23 21:51:44 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2016-05-23 21:51:44 +0100 |
commit | cb141140579d796ae5cafe6da52b4f0b87be6a84 (patch) | |
tree | 61e0130a1581e1ba99dabed32c82782699db064c /cmd | |
parent | 4baa01f8cd595cb0517d8f7f665d5be92528b6c2 (diff) | |
download | ihe-cb141140579d796ae5cafe6da52b4f0b87be6a84.tar.gz ihe-cb141140579d796ae5cafe6da52b4f0b87be6a84.zip |
Simplifying logic. Removing buffer features
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/cmd_blk.c | 20 | ||||
-rw-r--r-- | cmd/cmd_info.c | 11 |
2 files changed, 18 insertions, 13 deletions
diff --git a/cmd/cmd_blk.c b/cmd/cmd_blk.c index db64f42..e497780 100644 --- a/cmd/cmd_blk.c +++ b/cmd/cmd_blk.c @@ -8,10 +8,26 @@ extern file_t *g_file; extern buf_t *g_buf; extern int g_flags; +/* + * blk - show block size + * blk <num> - set block size + */ int c_blk( cmd_arg_t *arg ) { - printf("FILE BLOCK SIZE %u\n", g_file->blk_size ); - printf("BUFFER BLOCK SIZE %d (MAX %d)\n", g_buf->size, g_buf->buf_size ); + int argc = arg->argc; + char **argv = arg->argv; + int *type = arg->type; + if ( argc == 0) + { + printf("FILE BLOCK SIZE %u\n", g_file->blk_size ); + } else if ( argc == 1 ) + { + if ((type[0] == CMDT_INT) || (type[0] == CMDT_HEX)) + g_file->blk_size = atoi( argv[0] ); + } else + { + return -1; + } return 0; }
\ No newline at end of file diff --git a/cmd/cmd_info.c b/cmd/cmd_info.c index b06f8bc..8744efe 100644 --- a/cmd/cmd_info.c +++ b/cmd/cmd_info.c @@ -30,16 +30,5 @@ int c_info( cmd_arg_t *arg ) printf("BLOCK : %u\n", g_file->blk_size ); } - if ( g_buf == NULL ) - { - printf("buffer not initialised\n"); - } else - { - printf("BUF:\n"); - printf("ADDR : %p\n", g_buf->buf); - printf("SIZE : %d\n", g_buf->size); - printf("BUFSIZE: %d\n", g_buf->buf_size); - } - return 0; }
\ No newline at end of file |