comparison src/xs_support.c @ 866:6b47d9813067

Add xs_fsize() helper function.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 09 Nov 2012 03:57:59 +0200
parents bee1f36efc16
children 051ef70d0123
comparison
equal deleted inserted replaced
865:9052d9096c59 866:6b47d9813067
25 -- 25 --
26 */ 26 */
27 #include "xs_support.h" 27 #include "xs_support.h"
28 #include <ctype.h> 28 #include <ctype.h>
29 #include <glib.h> 29 #include <glib.h>
30
31 #ifdef __AUDACIOUS_NEWVFS__
32 off_t xs_fsize(XSFile *f)
33 {
34 off_t pos;
35 if (fseeko(f, 0, SEEK_END) < 0)
36 return -1;
37
38 pos = ftello(f);
39
40 if (fseeko(f, 0, SEEK_SET) < 0)
41 return -1;
42
43 return pos;
44 }
45 #endif
30 46
31 47
32 guint16 xs_fread_be16(XSFile *f) 48 guint16 xs_fread_be16(XSFile *f)
33 { 49 {
34 return (((guint16) xs_fgetc(f)) << 8) | ((guint16) xs_fgetc(f)); 50 return (((guint16) xs_fgetc(f)) << 8) | ((guint16) xs_fgetc(f));