X-Git-Url: http://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/fa7c556d251ebcb41ef9709b4d85a2c820dee94b..de5aedcd0dc2f3cde14f069e7a28db47bca2a8c5:/src/fops.c diff --git a/src/fops.c b/src/fops.c index e546b10..2f35dc4 100644 --- a/src/fops.c +++ b/src/fops.c @@ -1,7 +1,7 @@ /* * 2ooM: The Master of Orion II Reverse Engineering Project * Default file operations structures for liblbx. - * Copyright (C) 2010 Nick Bowler + * Copyright © 2010, 2014 Nick Bowler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,6 +18,7 @@ */ #include #include +#include #include "misc.h" #include "error.h" @@ -39,11 +40,8 @@ static int file_seek(void *handle, long offset, int whence) lbx_error_raise(-errno); return -1; } -} -static long file_tell(void *handle) -{ - return ftell((FILE *)handle); + return 0; } static int file_eof(void *handle) @@ -54,7 +52,6 @@ static int file_eof(void *handle) const struct lbx_file_ops lbx_default_fops = { .read = file_read, .seek = file_seek, - .tell = file_tell, .eof = file_eof, }; @@ -85,6 +82,8 @@ static int pipe_seek(void *handle, long offset, int whence) case SEEK_END: distance = -1; break; + default: + assert(0); } if (distance < 0) @@ -105,13 +104,6 @@ static int pipe_seek(void *handle, long offset, int whence) return 0; } -static long pipe_tell(void *handle) -{ - struct lbx_pipe_state *state = handle; - - return state->offset; -} - static int pipe_eof(void *handle) { struct lbx_pipe_state *state = handle; @@ -122,7 +114,6 @@ static int pipe_eof(void *handle) const struct lbx_file_ops lbx_pipe_fops = { .read = pipe_read, .seek = pipe_seek, - .tell = pipe_tell, .eof = pipe_eof, }; @@ -136,11 +127,6 @@ static int lbx_seek(void *handle, long offset, int whence) return lbx_file_seek(handle, offset, whence); } -static long lbx_tell(void *handle) -{ - return lbx_file_tell(handle); -} - static int lbx_eof(void *handle) { return lbx_file_eof(handle); @@ -149,6 +135,5 @@ static int lbx_eof(void *handle) const struct lbx_file_ops lbx_arch_fops = { .read = lbx_read, .seek = lbx_seek, - .tell = lbx_tell, .eof = lbx_eof, };