X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fhelper%2Ffileio.h;h=17fc40b311afe703c5ad1284fcd68dbd80dfcde6;hb=a78762e786bd21d6fc855e23bf87036369582316;hp=55e6f32313aa1504517bc7d2feae0a2ff00dc202;hpb=237e894805dd757cc24029af1b4b1e824c51712b;p=openocd diff --git a/src/helper/fileio.h b/src/helper/fileio.h index 55e6f323..17fc40b3 100644 --- a/src/helper/fileio.h +++ b/src/helper/fileio.h @@ -38,18 +38,6 @@ enum fileio_type FILEIO_BINARY, }; -enum fileio_location -{ - FILEIO_LOCAL, -/* - * Possible future enhancements: - * FILEIO_NFS, - * FILEIO_BOOTP, - * FILEIO_[XYZ]MODEM, - * FILEIO_HTTP, - * FILEIO_FTP, - */ -}; enum fileio_access { @@ -63,25 +51,20 @@ enum fileio_access typedef struct fileio_s { char *url; - char error_str[FILEIO_MAX_ERROR_STRING]; long long size; enum fileio_type type; - enum fileio_location location; enum fileio_access access; - void *location_private; -} fileio_t; - -typedef struct fileio_local_s -{ FILE *file; - struct stat file_stat; -} fileio_local_t; +} fileio_t; extern int fileio_write(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_written); extern int fileio_read(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_read); +extern int fileio_fgets(fileio_t *fileio, u32 size, char *buffer); extern int fileio_seek(fileio_t *fileio, u32 position); extern int fileio_close(fileio_t *fileio); extern int fileio_open(fileio_t *fileio, char *url, enum fileio_access access, enum fileio_type type); +extern int fileio_read_u32(fileio_t *fileio, u32 *data); +extern int fileio_write_u32(fileio_t *fileio, u32 data); #define ERROR_FILEIO_LOCATION_UNKNOWN (-1200) #define ERROR_FILEIO_NOT_FOUND (-1201)