TaPAS  0.2
genepi-io.h
Go to the documentation of this file.
1 /*
2  * genepi-io.h -- Header for serialization routines
3  *
4  * This file is a part of the GENEric Presburger programming Interface.
5  *
6  * Copyright (C) 2010 CNRS UMR 5800 & Université Bordeaux I (see AUTHORS file).
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  */
38 #ifndef __GENEPI_IO_H__
39 # define __GENEPI_IO_H__
40 
41 # include <stdio.h>
42 # include <genepi/genepi-common.h>
43 
44 BEGIN_C_DECLS
45 
56 extern int
57 genepi_io_write_uint8 (FILE *out, uint8_t i, int *perr);
58 
69 extern int
70 genepi_io_write_int8 (FILE *out, int8_t i, int *perr);
71 
82 extern int
83 genepi_io_write_uint16 (FILE *out, uint16_t i, int *perr);
84 
95 extern int
96 genepi_io_write_int16 (FILE *out, int16_t i, int *perr);
97 
108 extern int
109 genepi_io_write_uint32 (FILE *out, uint32_t i, int *perr);
110 
121 extern int
122 genepi_io_write_int32 (FILE *out, int32_t i, int *perr);
123 
137 extern int
138 genepi_io_write_string (FILE *out, const char *s, int *perr);
139 
154 extern int
155 genepi_io_write_buffer (FILE *out, const void *buf, size_t size, int *perr);
156 
169 extern int
170 genepi_io_read_uint8 (FILE *in, uint8_t *pi, int *perr);
171 
184 extern int
185 genepi_io_read_int8 (FILE *in, int8_t *pi, int *perr);
186 
199 extern int
200 genepi_io_read_uint16 (FILE *in, uint16_t *pi, int *perr);
201 
214 extern int
215 genepi_io_read_int16 (FILE *in, int16_t *pi, int *perr);
216 
229 extern int
230 genepi_io_read_uint32 (FILE *in, uint32_t *pi, int *perr);
231 
244 extern int
245 genepi_io_read_int32 (FILE *in, int32_t *pi, int *perr);
246 
258 extern int
259 genepi_io_read_string (FILE *in, char **ps, int *perr);
260 
273 extern int
274 genepi_io_read_buffer (FILE *in, void *buf, size_t size, int *perr);
275 
276 END_C_DECLS
277 
278 #endif /* ! __GENEPI_IO_H__ */
int genepi_io_write_int32(FILE *out, int32_t i, int *perr)
Write a 32-bit signed integer on the out stream.
int genepi_io_read_uint16(FILE *in, uint16_t *pi, int *perr)
Read a 16-bit unsigned integer on the in stream. The signedness of the integer is not checked...
int genepi_io_write_uint16(FILE *out, uint16_t i, int *perr)
Write a 16-bit unsigned integer on the out stream.
int genepi_io_read_int32(FILE *in, int32_t *pi, int *perr)
Read a 32-bit signed integer on the in stream. The signedness of the integer is not checked...
int genepi_io_write_buffer(FILE *out, const void *buf, size_t size, int *perr)
Write the content of the buffer buf on the out stream. Oppositely to strings the given buffer must no...
int genepi_io_read_uint32(FILE *in, uint32_t *pi, int *perr)
Read a 32-bit unsigned integer on the in stream. The signedness of the integer is not checked...
int genepi_io_write_int16(FILE *out, int16_t i, int *perr)
Write a 16-bit signed integer on the out stream.
int genepi_io_write_uint8(FILE *out, uint8_t i, int *perr)
Write an 8-bit unsigned integer on the out stream.
int genepi_io_read_int8(FILE *in, int8_t *pi, int *perr)
Read an 8-bit signed integer on the in stream. The signedness of the integer is not checked...
int genepi_io_read_string(FILE *in, char **ps, int *perr)
Read a string on the in stream. The readed string might be NULL.
int genepi_io_write_string(FILE *out, const char *s, int *perr)
Write a string on the out stream. The string s can be null in which case the NULL value will be reloa...
int genepi_io_read_buffer(FILE *in, void *buf, size_t size, int *perr)
Read size bytes the in stream.
int genepi_io_write_int8(FILE *out, int8_t i, int *perr)
Write an 8-bit signed integer on the out stream.
int genepi_io_write_uint32(FILE *out, uint32_t i, int *perr)
Write a 32-bit unsigned integer on the out stream.
int genepi_io_read_uint8(FILE *in, uint8_t *pi, int *perr)
Read an 8-bit unsigned integer on the in stream. The signedness of the integer is not checked...
int genepi_io_read_int16(FILE *in, int16_t *pi, int *perr)
Read a 16-bit signed integer on the in stream. The signedness of the integer is not checked...