summaryrefslogtreecommitdiff
path: root/src/helper/fileio.h
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-09-28 15:37:56 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-09-29 08:43:27 +0200
commit3a693ef526575633cc350a69aa1a5d1f08e64c46 (patch)
tree6af64277137ac59254bf20d7d3ca175728a709bd /src/helper/fileio.h
parentecad76061f6edff5db67ad05e6514dff6cd6efc7 (diff)
downloadopenocd+libswd-3a693ef526575633cc350a69aa1a5d1f08e64c46.tar.gz
openocd+libswd-3a693ef526575633cc350a69aa1a5d1f08e64c46.tar.bz2
openocd+libswd-3a693ef526575633cc350a69aa1a5d1f08e64c46.tar.xz
openocd+libswd-3a693ef526575633cc350a69aa1a5d1f08e64c46.zip
fileio: refactor struct fileio to be an opaque structure
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/helper/fileio.h')
-rw-r--r--src/helper/fileio.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/helper/fileio.h b/src/helper/fileio.h
index 597bafc0..40c4ef0e 100644
--- a/src/helper/fileio.h
+++ b/src/helper/fileio.h
@@ -46,12 +46,10 @@ enum fileio_access
FILEIO_APPENDREAD, /* open for writing, position at end, allow reading */
};
-struct fileio {
- const char *url;
- ssize_t size;
- enum fileio_type type;
- enum fileio_access access;
- FILE *file;
+struct fileio
+{
+ /* The structure is opaque */
+ struct fileio_internal *fp;
};
int fileio_open(struct fileio *fileio,
@@ -68,6 +66,7 @@ int fileio_write(struct fileio *fileio,
int fileio_read_u32(struct fileio *fileio, uint32_t *data);
int fileio_write_u32(struct fileio *fileio, uint32_t data);
+int fileio_size(struct fileio *fileio);
#define ERROR_FILEIO_LOCATION_UNKNOWN (-1200)
#define ERROR_FILEIO_NOT_FOUND (-1201)