|
CNDP 22.08.0
|
Go to the source code of this file.
Enumerations | |
| enum | { } |
Functions | |
| static int | is_file_set (uint32_t opt, uint32_t cmpflags) |
| static int | is_file_rd (uint32_t opt) |
| static int | is_file_wr (uint32_t opt) |
| static int | is_file_append (uint32_t opt) |
| static int | is_file_open (uint32_t opt) |
| static int | is_file_close (uint32_t opt) |
| static int | is_data_rdonly (uint32_t flags) |
| static int | is_file_eq (uint32_t opt, uint32_t cmpflags) |
| static int | is_seek_set (uint32_t opt) |
| static int | is_seek_cur (uint32_t opt) |
| static int | is_seek_end (uint32_t opt) |
| CNDP_API struct cli_node * | cli_file_open (const char *path, const char *type) |
| CNDP_API int | cli_file_close (struct cli_node *node) |
| CNDP_API int | cli_file_read (struct cli_node *node, char *buff, int len) |
| CNDP_API int | cli_file_write (struct cli_node *node, char *buff, int len) |
| CNDP_API int | cli_file_seek (struct cli_node *node, int offset, uint32_t whence) |
| CNDP_API int | cli_readline (struct cli_node *node, char *buff, int len) |
| CNDP_API struct cli_node * | cli_file_create (const char *path, const char *type) |
| CNDP_API int | cli_file_handler (struct cli_node *node, char *buff, int len, uint32_t opt) |
| CNDP_API int | cli_system (char *p) |
CNE Command line interface
Definition in file cli_file.h.
| anonymous enum |
Definition at line 28 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file type
| opt | The option flags read/write/excutable/... |
| cmpflags | The option flags to compare with |
Definition at line 68 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file readable
| opt | The option flags |
Definition at line 82 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file writeable
| opt | The option flags |
Definition at line 96 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file appendable
| opt | The option flags |
Definition at line 110 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file open
| opt | The option flags |
Definition at line 124 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file closed
| opt | The option flags |
Definition at line 138 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file read only
| flags | The option flags |
Definition at line 158 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file and matches the options
| opt | The option flags |
| cmpflags | The compare option flags, which must match exactly |
Definition at line 174 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file Seek flag is set
| opt | The option flags |
Definition at line 188 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file is seek current
| opt | The option flags |
Definition at line 202 of file cli_file.h.
|
inlinestatic |
Test to see if a CLI node is a file seek at end
| opt | The option flags |
Definition at line 216 of file cli_file.h.
| CNDP_API struct cli_node * cli_file_open | ( | const char * | path, |
| const char * | type ) |
Open a file.
| path | Path string for file |
| type | Type of open string r, w, and/or + characters |
| CNDP_API int cli_file_close | ( | struct cli_node * | node | ) |
Close a file
| node | Pointer to file node |
| CNDP_API int cli_file_read | ( | struct cli_node * | node, |
| char * | buff, | ||
| int | len ) |
read data from a file
| node | Pointer to file node |
| buff | Pointer to place to put the data |
| len | Max Number of bytes to read |
| CNDP_API int cli_file_write | ( | struct cli_node * | node, |
| char * | buff, | ||
| int | len ) |
write data to a file
| node | Pointer to file node |
| buff | Pointer to place to get the data |
| len | Max Number of bytes to write |
| CNDP_API int cli_file_seek | ( | struct cli_node * | node, |
| int | offset, | ||
| uint32_t | whence ) |
write data to a file
| node | Pointer to file node |
| offset | Offset to move in file |
| whence | Type of seek operation CLI_SEEK_SET, CLI_SEEK_CUR and CLI_SEEK_END |
| CNDP_API int cli_readline | ( | struct cli_node * | node, |
| char * | buff, | ||
| int | len ) |
write data to a file
| node | Pointer to file node |
| buff | place to put the line data. |
| len | Max buff size |
| CNDP_API struct cli_node * cli_file_create | ( | const char * | path, |
| const char * | type ) |
create a data file in memory will be lost at reset.
| path | Path string for file |
| type | Type of open string r, w, and/or + characters |
| CNDP_API int cli_file_handler | ( | struct cli_node * | node, |
| char * | buff, | ||
| int | len, | ||
| uint32_t | opt ) |
Generic file function for basic file handling
| node | Pointer to file node |
| buff | place to put the line data. |
| len | Max buff size |
| opt | Flags for file handling |
| CNDP_API int cli_system | ( | char * | p | ) |
Generic file function for basic file handling
| p | Pointer to file node |