aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/mimesh/libg3d-0.0.8/include/g3d/read.h
blob: 08211e37f5d73ba8a0fc99bab7f28ffbef81dc26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/* $Id$ */

/*
    libg3d - 3D object loading library

    Copyright (C) 2005-2009  Markus Dahms <mad@automagically.de>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef __G3D_READ_H__
#define __G3D_READ_H__

#ifndef G3D_DISABLE_DEPRECATED

#include <stdio.h>
#include <glib.h>

#ifdef __cplusplus
extern "C" {
#endif /* ifdef __cplusplus */

/**
 * SECTION:read
 * @short_description: file reading abstraction (deprecated)
 * @see_also: g3d_stream_open_file
 * @include: g3d/read.h
 *
 * The g3d_read_* family of functions is deprecated in favour of the #G3DStream
 * interface.
 */


/**
 * g3d_read_int8:
 * @f: the file to read from
 *
 * Read a 1 byte signed integer from file.
 *
 * Returns: The read value, 0 in case of error
 */
gint32 g3d_read_int8(FILE *f);

/**
 * g3d_read_int16_be:
 * @f: the file to read from
 *
 * Read a 2 byte big-endian signed integer from file.
 *
 * Returns: The read value, 0 in case of error
 */
gint32 g3d_read_int16_be(FILE *f);

/**
 * g3d_read_int16_le:
 * @f: the file to read from
 *
 * Read a 2 byte little-endian signed integer from file.
 *
 * Returns: The read value, 0 in case of error
 */
gint32 g3d_read_int16_le(FILE *f);

/**
 * g3d_read_int32_be:
 * @f: the file to read from
 *
 * Read a 4 byte big-endian signed integer from file.
 *
 * Returns: The read value, 0 in case of error
 */
gint32 g3d_read_int32_be(FILE *f);

/**
 * g3d_read_int32_le:
 * @f: the file to read from
 *
 * Read a 4 byte little-endian signed integer from file.
 *
 * Returns: The read value, 0 in case of error
 */
gint32 g3d_read_int32_le(FILE *f);

/**
 * g3d_read_float_be:
 * @f: the file to read from
 *
 * Read a 4 byte big-endian floating point number from file.
 *
 * Returns: The read value, 0 in case of error
 */
G3DFloat g3d_read_float_be(FILE *f);

/**
 * g3d_read_float_le:
 * @f: the file to read from
 *
 * Read a 4 byte little-endian floating point number from file.
 *
 * Returns: The read value, 0 in case of error
 */
G3DFloat g3d_read_float_le(FILE *f);

/**
 * g3d_read_double_be:
 * @f: the file to read from
 *
 * Read a 8 byte big-endian double-precision floating point number from file.
 *
 * Returns: The read value, 0 in case of error
 */
G3DDouble g3d_read_double_be(FILE *f);

/**
 * g3d_read_double_le:
 * @f: the file to read from
 *
 * Read a 8 byte little-endian double-precision floating point number from
 * file.
 *
 * Returns: The read value, 0 in case of error
 */
G3DDouble g3d_read_double_le(FILE *f);

/**
 * g3d_read_cstr:
 * @f: the file to read from
 * @buffer: the buffer to store line in
 * @max_len: maximum length of string including termination character
 *
 * Read a zero-terminated string from file.
 *
 * Returns: number of bytes read from file.
 */
gint32 g3d_read_cstr(FILE *f, gchar *buffer, gint32 max_len);

#ifdef __cplusplus
}
#endif /* ifdef __cplusplus */

#endif /* G3D_DISABLE_DEPRECATED */

#endif /* __G3D_READ_H__ */