Debian Codegraph @

external/gsl/gsl_histogram__file.c

raw symbols SCIP
1 /* histogram/file.c
2 *
3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough
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_block.h"cxx . . $ `<file>/external/gsl/gsl_block.h`/
24 #include "gsl_histogram.h"cxx . . $ `<file>/external/gsl/gsl_histogram.h`/
25
26 int
27 gsl_histogram_freadcxx . . $ gsl_histogram_fread(ce1e69d28581fa11). (FILEcxx . . $ FILE# * stream, gsl_histogramcxx . . $ gsl_histogram# * h)
28 {
29 int status = gsl_block_raw_freadcxx . . $ gsl_block_raw_fread(3ebb93b8a1b35676). (stream, h->rangecxx . . $ $anonymous_type_62a17a7d119001a7_0#range., h->ncxx . . $ $anonymous_type_62a17a7d119001a7_0#n. + 1, 1);
30
31 if (status)
32 return status;
33
34 status = gsl_block_raw_freadcxx . . $ gsl_block_raw_fread(3ebb93b8a1b35676). (stream, h->bincxx . . $ $anonymous_type_62a17a7d119001a7_0#bin., h->ncxx . . $ $anonymous_type_62a17a7d119001a7_0#n., 1);
35 return status;
36 }
37
38 int
39 gsl_histogram_fwritecxx . . $ gsl_histogram_fwrite(fa59e2b4b5219286). (FILEcxx . . $ FILE# * stream, const gsl_histogramcxx . . $ gsl_histogram# * h)
40 {
41 int status = gsl_block_raw_fwritecxx . . $ gsl_block_raw_fwrite(15b6124729fbb84f). (stream, h->rangecxx . . $ $anonymous_type_62a17a7d119001a7_0#range., h->ncxx . . $ $anonymous_type_62a17a7d119001a7_0#n. + 1, 1);
42
43 if (status)
44 return status;
45
46 status = gsl_block_raw_fwritecxx . . $ gsl_block_raw_fwrite(15b6124729fbb84f). (stream, h->bincxx . . $ $anonymous_type_62a17a7d119001a7_0#bin., h->ncxx . . $ $anonymous_type_62a17a7d119001a7_0#n., 1);
47 return status;
48 }
49
50 int
51 gsl_histogram_fprintfcxx . . $ gsl_histogram_fprintf(cef49262b0e4926a). (FILEcxx . . $ FILE# * stream, const gsl_histogramcxx . . $ gsl_histogram# * h,
52 const char *range_format, const char *bin_format)
53 {
54 size_t i;
55 const size_t n = h->ncxx . . $ $anonymous_type_62a17a7d119001a7_0#n.;
56
57 for (i = 0; i < n; i++)
58 {
59 int status = fprintfcxx . . $ fprintf(bc216f8e5b1ebeac). (stream, range_format, h->rangecxx . . $ $anonymous_type_62a17a7d119001a7_0#range.[i]);
60
61 if (status < 0)
62 {
63 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fprintf failed", GSL_EFAILED);
64 }
65
66 status = putccxx . . $ putc(b1cd03d6c470d1bd). (' ', stream);
67
68 if (status == EOFcxx . . $ `<external>/232824719582829767/stdio.h:105:9`!)
69 {
70 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("putc failed", GSL_EFAILED);
71 }
72
73 status = fprintfcxx . . $ fprintf(bc216f8e5b1ebeac). (stream, range_format, h->rangecxx . . $ $anonymous_type_62a17a7d119001a7_0#range.[i + 1]);
74
75 if (status < 0)
76 {
77 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fprintf failed", GSL_EFAILED);
78 }
79
80 status = putccxx . . $ putc(b1cd03d6c470d1bd). (' ', stream);
81
82 if (status == EOFcxx . . $ `<external>/232824719582829767/stdio.h:105:9`!)
83 {
84 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("putc failed", GSL_EFAILED);
85 }
86
87 status = fprintfcxx . . $ fprintf(bc216f8e5b1ebeac). (stream, bin_format, h->bincxx . . $ $anonymous_type_62a17a7d119001a7_0#bin.[i]);
88
89 if (status < 0)
90 {
91 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fprintf failed", GSL_EFAILED);
92 }
93
94 status = putccxx . . $ putc(b1cd03d6c470d1bd). ('\n', stream);
95
96 if (status == EOFcxx . . $ `<external>/232824719582829767/stdio.h:105:9`!)
97 {
98 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("putc failed", GSL_EFAILED);
99 }
100 }
101
102 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
103 }
104
105 int
106 gsl_histogram_fscanfcxx . . $ gsl_histogram_fscanf(ce1e69d28581fa11). (FILEcxx . . $ FILE# * stream, gsl_histogramcxx . . $ gsl_histogram# * h)
107 {
108 size_t i;
109 const size_t n = h->ncxx . . $ $anonymous_type_62a17a7d119001a7_0#n.;
110 double upper;
111
112 for (i = 0; i < n; i++)
113 {
114 int status = fscanfcxx . . $ fscanf(bc216f8e5b1ebeac). (stream,
115 "%lg %lg %lg", h->rangecxx . . $ $anonymous_type_62a17a7d119001a7_0#range. + i, &upper,
116 h->bincxx . . $ $anonymous_type_62a17a7d119001a7_0#bin. + i);
117
118 if (status != 3)
119 {
120 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fscanf failed", GSL_EFAILED);
121 }
122 }
123
124 h->rangecxx . . $ $anonymous_type_62a17a7d119001a7_0#range.[n] = upper;
125
126 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
127 }