diff options
Diffstat (limited to 'support/dktools/dk4membf.c')
-rw-r--r-- | support/dktools/dk4membf.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/support/dktools/dk4membf.c b/support/dktools/dk4membf.c deleted file mode 100644 index 2f45e782cc..0000000000 --- a/support/dktools/dk4membf.c +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright (C) 2015-2020, Dirk Krause -SPDX-License-Identifier: BSD-3-Clause -*/ - -/* - WARNING: This file was generated by the dkct program (see - http://dktools.sourceforge.net/ for details). - Changes you make here will be lost if dkct is run again! - You should modify the original source and run dkct on it. - Original source: dk4membf.ctr -*/ - -/** @file dk4membf.c The dk4membf module. -*/ - - -#line 61 "dk4membf.ctr" - -#include "dk4conf.h" -#include "dk4membf.h" - -#if DK4_HAVE_ERRNO_H -#ifndef ERRNO_H_INCLUDED -#include <errno.h> -#define ERRNO_H_INCLUDED 1 -#endif -#endif - -#if DK4_HAVE_ASSERT_H -#ifndef ASSERT_H_INCLUDED -#include <assert.h> -#define ASSERT_H_INCLUDED 1 -#endif -#endif - - -int -dk4membuf_to_file(FILE *fipo, dk4_membuf_t const *mbptr, dk4_er_t *erp) -{ - dk4_membuf_cell_t *pc = NULL; - dk4_membuf_cell_t *pn = NULL; - size_t wrb = 0; - int back = 0; - -#if DK4_USE_ASSERT - assert(NULL != fipo); - assert(NULL != mbptr); -#endif - if ((NULL != fipo) && (NULL != mbptr)) { - back = 1; - pc = mbptr->first; - while (NULL != pc) { - pn = pc->next; - if (0 < pc->used) { - errno = 0; - wrb = fwrite(pc->buf, 1, pc->used, fipo); - if (wrb != pc->used) { - back = 0; - dk4error_set_idetails(erp, DK4_E_WRITE_FAILED, errno); - } - } - pc = pn; - } - } else { - dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS); - } - return back; -} - - |