Mercurial > hg > dmlib
view src/dmresw.c @ 2601:8b99ddcc9fde
Bump copyright year.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 19 Nov 2023 15:43:31 +0200 |
parents | 9807ae37ad69 |
children |
line wrap: on
line source
/* * DMLib * -- Resource management * Programmed and designed by Matti 'ccr' Hamalainen * (C) Copyright 2011-2015 Tecnic Software productions (TNSP) */ #include "dmres.h" bool dmf_write_str(DMResource *fh, const void *data, const size_t len) { return dmfwrite(data, len, 1, fh) == 1; } bool dmf_write_byte(DMResource *fh, const Uint8 val) { return dmfputc(val, fh) == val; } #define DM_DEFINE_FFUNC(xname, xtype, xmacro) \ bool dmf_write_ ## xname (DMResource *f, const xtype v) { \ xtype result = DM_NATIVE_TO_ ## xmacro (v); \ if (dmfwrite(&result, sizeof( xtype ), 1, f) != 1) \ return false; \ return true; \ } #include "dmfiletmpl.h" #undef DM_DEFINE_FFUNC