// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root // SPDX-License-Identifier: LGPL-2.1-or-later // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- // vi: set et ts=4 sw=2 sts=2: /*! \file bio.c * \ingroup low */ /** \addtogroup low * * @{ */ /****************************************************************************/ /* */ /* File: bio.c */ /* */ /* Purpose: basic input/output */ /* */ /* Author: Klaus Johannsen */ /* Institut fuer Computeranwendungen III */ /* Universitaet Stuttgart */ /* Pfaffenwaldring 27 */ /* 70550 Stuttgart */ /* email: ug@ica3.uni-stuttgart.de */ /* */ /* History: 09.12.96 begin, */ /* */ /* Remarks: */ /* */ /****************************************************************************/ /****************************************************************************/ /* */ /* include files */ /* system include files */ /* application include files */ /* */ /****************************************************************************/ #include #include #include #include "bio.h" USING_UG_NAMESPACE /****************************************************************************/ /* */ /* defines in the following order */ /* */ /* compile time constants defining static data size (i.e. arrays) */ /* other constants */ /* macros */ /* */ /****************************************************************************/ /****************************************************************************/ /* */ /* data structures used in this source file (exported data structures are */ /* in the corresponding include file!) */ /* */ /****************************************************************************/ typedef int (*R_mint_proc)(int n, int *intList); typedef int (*W_mint_proc)(int n, const int *intList); typedef int (*R_mdouble_proc)(int n, double *doubleList); typedef int (*W_mdouble_proc)(int n, const double *doubleList); typedef int (*R_string_proc)(char *string); typedef int (*W_string_proc)(const char *string); /****************************************************************************/ /* */ /* definition of exported global variables */ /* */ /****************************************************************************/ /****************************************************************************/ /* */ /* definition of variables global to this source file only (static!) */ /* */ /****************************************************************************/ /* file */ static FILE *stream; static int n_byte; static fpos_t pos; /* low level read/write functions */ static R_mint_proc Read_mint; static W_mint_proc Write_mint; static R_mdouble_proc Read_mdouble; static W_mdouble_proc Write_mdouble; static R_string_proc Read_string; static W_string_proc Write_string; /****************************************************************************/ /* */ /* forward declarations of functions used before they are defined */ /* */ /****************************************************************************/ /****************************************************************************/ /* */ /* ascii i/o */ /* */ /****************************************************************************/ static int ASCII_Read_mint (int n, int *intList) { int i; for (i=0; i0) { if (fgetc(stream)==EOF) return (1); jump--; } return (0); } /** @} */