comparison src/xs_support.c @ 226:858c09f59011

Moved some functions from xs_length.c here.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 19 Dec 2004 15:25:03 +0000
parents df4cb5115322
children 608f31f6c095
comparison
equal deleted inserted replaced
225:2986069309c6 226:858c09f59011
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */ 21 */
22 #include "xmms-sid.h" 22 #include "xmms-sid.h"
23 #include "xs_support.h" 23 #include "xs_support.h"
24 #include <ctype.h> 24 #include <ctype.h>
25
26
27 /* Bigendian file reading functions
28 */
29 guint16 xs_rd_be16(FILE *f)
30 {
31 return (((guint16) fgetc(f)) << 8) |
32 ((guint16) fgetc(f));
33 }
34
35
36 guint32 xs_rd_be32(FILE *f)
37 {
38 return (((guint32) fgetc(f)) << 24) |
39 (((guint32) fgetc(f)) << 16) |
40 (((guint32) fgetc(f)) << 8) |
41 ((guint32) fgetc(f));
42 }
43
44
45 size_t xs_rd_str(FILE *f, gchar *s, size_t l)
46 {
47 return fread(s, sizeof(gchar), l, f);
48 }
49
25 50
26 /* Copy a string 51 /* Copy a string
27 */ 52 */
28 gchar *xs_strncpy(gchar *pDest, gchar *pSource, size_t n) 53 gchar *xs_strncpy(gchar *pDest, gchar *pSource, size_t n)
29 { 54 {