Description
A file API for the ionDB.
- Todo:
- Include support for other file systems (Arduino, Contiki).
- Copyright
- Copyright 2017 The University of British Columbia, IonDB Project Contributors (see AUTHORS.md)
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1.Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- 2.Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- 3.Neither the name of the copyright holder nor the names of its contributors
- may be used to endorse or promote products derived from this software without specific prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file ion_file.h.
Include dependency graph for ion_file.h:
This graph shows which files directly or indirectly include this file:
Macros | |
#define | ION_FILE_START SEEK_SET |
#define | ION_FILE_END SEEK_END |
#define | ION_NOFILE ((ion_file_handle_t) (NULL)) |
#define | ION_FILE_NULL -1 |
Typedefs | |
typedef long | ion_file_offset_t |
typedef FILE * | ion_file_handle_t |
Functions | |
ion_boolean_t | ion_fexists (char *name) |
ion_file_handle_t | ion_fopen (char *name) |
ion_err_t | ion_fclose (ion_file_handle_t file) |
ion_err_t | ion_fremove (char *name) |
ion_err_t | ion_fseek (ion_file_handle_t file, ion_file_offset_t seek_to, int origin) |
ion_file_offset_t | ion_ftell (ion_file_handle_t file) |
ion_file_offset_t | ion_fend (ion_file_handle_t file) |
ion_err_t | ion_fwrite (ion_file_handle_t file, unsigned int num_bytes, ion_byte_t *to_write) |
ion_err_t | ion_fwrite_at (ion_file_handle_t file, ion_file_offset_t offset, unsigned int num_bytes, ion_byte_t *to_write) |
ion_err_t | ion_fread (ion_file_handle_t file, unsigned int num_bytes, ion_byte_t *write_to) |
ion_err_t | ion_fread_at (ion_file_handle_t file, ion_file_offset_t offset, unsigned int num_bytes, ion_byte_t *write_to) |
Macro Definition Documentation
#define ION_FILE_END SEEK_END |
Definition at line 50 of file ion_file.h.
#define ION_FILE_NULL -1 |
Definition at line 75 of file ion_file.h.
#define ION_FILE_START SEEK_SET |
Definition at line 49 of file ion_file.h.
#define ION_NOFILE ((ion_file_handle_t) (NULL)) |
Definition at line 71 of file ion_file.h.
Typedef Documentation
typedef FILE* ion_file_handle_t |
Definition at line 69 of file ion_file.h.
typedef long ion_file_offset_t |
Definition at line 47 of file ion_file.h.
Function Documentation
ion_err_t ion_fclose | ( | ion_file_handle_t | file | ) |
Definition at line 80 of file ion_file.c.
Definition: kv_system.h:160
Here is the caller graph for this function:
ion_file_offset_t ion_fend | ( | ion_file_handle_t | file | ) |
Definition at line 143 of file ion_file.c.
ion_err_t ion_fseek(ion_file_handle_t file, ion_file_offset_t seek_to, int origin)
Definition: ion_file.c:109
Here is the call graph for this function:
Here is the caller graph for this function:
ion_boolean_t ion_fexists | ( | char * | name | ) |
Definition at line 40 of file ion_file.c.
Here is the call graph for this function:
Here is the caller graph for this function:
ion_file_handle_t ion_fopen | ( | char * | name | ) |
ion_err_t ion_fread | ( | ion_file_handle_t | file, |
unsigned int | num_bytes, | ||
ion_byte_t * | write_to | ||
) |
Definition at line 214 of file ion_file.c.
Definition: kv_system.h:160
Definition: kv_system.h:182
Here is the caller graph for this function:
ion_err_t ion_fread_at | ( | ion_file_handle_t | file, |
ion_file_offset_t | offset, | ||
unsigned int | num_bytes, | ||
ion_byte_t * | write_to | ||
) |
Definition at line 237 of file ion_file.c.
Definition: kv_system.h:160
ion_err_t ion_fseek(ion_file_handle_t file, ion_file_offset_t seek_to, int origin)
Definition: ion_file.c:109
ion_err_t ion_fread(ion_file_handle_t file, unsigned int num_bytes, ion_byte_t *write_to)
Definition: ion_file.c:214
Here is the call graph for this function:
Here is the caller graph for this function:
ion_err_t ion_fremove | ( | char * | name | ) |
Definition at line 93 of file ion_file.c.
Definition: kv_system.h:160
Definition: kv_system.h:191
Here is the caller graph for this function:
ion_err_t ion_fseek | ( | ion_file_handle_t | file, |
ion_file_offset_t | seek_to, | ||
int | origin | ||
) |
Definition at line 109 of file ion_file.c.
Definition: kv_system.h:160
Definition: kv_system.h:197
Here is the caller graph for this function:
ion_file_offset_t ion_ftell | ( | ion_file_handle_t | file | ) |
ion_err_t ion_fwrite | ( | ion_file_handle_t | file, |
unsigned int | num_bytes, | ||
ion_byte_t * | to_write | ||
) |
Definition at line 158 of file ion_file.c.
Definition: kv_system.h:160
Definition: kv_system.h:179
Here is the caller graph for this function:
ion_err_t ion_fwrite_at | ( | ion_file_handle_t | file, |
ion_file_offset_t | offset, | ||
unsigned int | num_bytes, | ||
ion_byte_t * | to_write | ||
) |
Definition at line 177 of file ion_file.c.
Definition: kv_system.h:160
ion_err_t ion_fseek(ion_file_handle_t file, ion_file_offset_t seek_to, int origin)
Definition: ion_file.c:109
ion_err_t ion_fwrite(ion_file_handle_t file, unsigned int num_bytes, ion_byte_t *to_write)
Definition: ion_file.c:158
Here is the call graph for this function:
Here is the caller graph for this function: