Mercurial > hg > dmlib
diff dmresw.c @ 437:3d9c044ec08d
Add dmf_{write,read}_byte() convenience functions.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 04 Nov 2012 03:15:35 +0200 |
parents | be6160981428 |
children | b60220fd1669 |
line wrap: on
line diff
--- a/dmresw.c Sun Nov 04 02:50:03 2012 +0200 +++ b/dmresw.c Sun Nov 04 03:15:35 2012 +0200 @@ -6,14 +6,18 @@ */ #include "dmresw.h" -/* Helper resource access routines - */ int dmf_write_str(DMResource *f, Uint8 *s, size_t l) { return dmfwrite(s, sizeof(Uint8), l, f) == l; } +BOOL dmf_write_byte(DMResource *f, const Uint8 val) +{ + return dmfputc(val, f) == val; +} + + #define DM_DEFINE_FUNC(xname, xtype, xmacro) \ BOOL dmf_write_ ## xname (DMResource *f, xtype v) { \ xtype result = DM_NATIVE_TO_ ## xmacro (v); \