| 1 | /* rng/file.c |
| 2 | * |
| 3 | * Copyright (C) 2003 Olaf Lenz |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #include "gsl__config.h"cxx . . $ `<file>/external/gsl/gsl__config.h`/ |
| 21 | #include <stdio.h> |
| 22 | #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/ |
| 23 | #include "gsl_rng.h"cxx . . $ `<file>/external/gsl/gsl_rng.h`/ |
| 24 | |
| 25 | int |
| 26 | gsl_rng_freadcxx . . $ gsl_rng_fread(992e6c1e38bb36cd). (FILEcxx . . $ FILE# * stream, gsl_rngcxx . . $ gsl_rng# * r) |
| 27 | { |
| 28 | size_tcxx . . $ size_t# n = r->typecxx . . $ $anonymous_type_ec10d0a94d738359_1#type.->sizecxx . . $ $anonymous_type_ec10d0a94d738359_0#size. ; |
| 29 | |
| 30 | char * state = (char *) r->statecxx . . $ $anonymous_type_ec10d0a94d738359_1#state.; |
| 31 | |
| 32 | size_tcxx . . $ size_t# items = freadcxx . . $ fread(738fc8ac1d711e58). (state, 1, n, stream); |
| 33 | |
| 34 | if (items != n) |
| 35 | { |
| 36 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fread failed", GSL_EFAILED); |
| 37 | } |
| 38 | |
| 39 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 40 | } |
| 41 | |
| 42 | int |
| 43 | gsl_rng_fwritecxx . . $ gsl_rng_fwrite(7c53b1dd1aa0738a). (FILEcxx . . $ FILE# * stream, const gsl_rngcxx . . $ gsl_rng# * r) |
| 44 | { |
| 45 | size_tcxx . . $ size_t# n = r->typecxx . . $ $anonymous_type_ec10d0a94d738359_1#type.->sizecxx . . $ $anonymous_type_ec10d0a94d738359_0#size. ; |
| 46 | |
| 47 | char * state = (char *) r->statecxx . . $ $anonymous_type_ec10d0a94d738359_1#state.; |
| 48 | |
| 49 | size_tcxx . . $ size_t# items = fwritecxx . . $ fwrite(ab0609fa07c47d6e). (state, 1, n, stream); |
| 50 | |
| 51 | if (items != n) |
| 52 | { |
| 53 | GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fwrite failed", GSL_EFAILED); |
| 54 | } |
| 55 | |
| 56 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 57 | } |