Message
[tobin.git] / struct.h
blob232ff2884ac13f1bcb774ce90e1357fddc9b99a6
1 /*********************************************************************
3 * Copyright (C) 2008, Simon Kagstrom
5 * Filename: struct.h
6 * Author: Simon Kagstrom <simon.kagstrom@gmail.com>
7 * Description: Exported stuff
9 * $Id:$
11 ********************************************************************/
12 #ifndef __STRUCT_H__
13 #define __STRUCT_H__
15 #include <stdio.h>
17 typedef enum
19 end_LITTLE_ENDIAN = 0,
20 end_BIG_ENDIAN = 1,
21 } endianness_t;
23 typedef struct
25 endianness_t endian;
26 endianness_t host_endian;
27 FILE *out, *in;
28 const char *fmt;
29 int p;
30 } struct_t;
33 extern const char *struct_fmt_options;
35 extern void init_struct_pack(struct_t *s, FILE *out, const char *fmt);
36 extern void init_struct_unpack(struct_t *s, FILE *in, FILE *out, const char *fmt);
37 extern void run_struct_pack(struct_t *s, int argc, const char *args[]);
38 extern void run_struct_unpack(struct_t *s);
40 #endif /* !__STRUCT_H__ */