blob: 68dab148ed2c6df604f1a5a25980a0b9a789b0a6 (
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
34
|
#include "buf.h"
#include "core.h"
#include "libcmd/cmd.h"
#include "libcmd/cmd_parse.h"
extern file_t *g_file;
extern buf_t *g_buf;
extern int g_flags;
int c_read( cmd_arg_t *arg )
{
int ret;
if ( g_buf->buf == NULL )
{
buf_resize( g_buf, g_file->blk_size );
}
ret = file_read_blk( g_file, g_buf->buf );
printf("Readed %d bytes\n", ret);
if ( (ret >= 0) && (ret <= g_buf->buf_size) )
{
g_buf->size = ret;
}
return 0;
}
int h_read( cmd_arg_t *arg )
{
printf(" - read data from file");
return 0;
}
|