view src/dmresw.c @ 2576:812b16ee49db

I had been living under apparent false impression that "realfft.c" on which the FFT implementation in DMLIB was basically copied from was released in public domain at some point, but it could very well be that it never was. Correct license is (or seems to be) GNU GPL. Thus I removing the code from DMLIB, and profusely apologize to the author, Philip Van Baren. It was never my intention to distribute code based on his original work under a more liberal license than originally intended.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 11 Mar 2022 16:32:50 +0200
parents 73545a442ffe
children 9807ae37ad69
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