aboutsummaryrefslogtreecommitdiff
path: root/ports/rply/export_functions.patch
blob: e8652216774a36f68d81a5fe7cf581ea66541ca0 (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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
diff --git a/rply.h b/rply.h
index 9fa6da9..2e2a0c5 100644
--- a/rply.h
+++ b/rply.h
@@ -1,5 +1,5 @@
-#ifndef RPLY_H
-#define RPLY_H
+#pragma once
+
 /* ----------------------------------------------------------------------
  * RPly library, read/write PLY files
  * Diego Nehab, IMPA
@@ -9,6 +9,19 @@
  * at the end of this file.
  * ---------------------------------------------------------------------- */
 
+#ifdef RPLY_SHARED_LIB
+
+#ifdef RPLY_BUILD_LIB
+#define RPLY_DLL_DEF __declspec(dllexport)
+#else
+#define RPLY_DLL_DEF __declspec(dllimport)
+#endif // RPLY_BUILD_LIB
+
+#else
+#define RPLY_DLL_DEF
+#endif // RPLY_SHARED_LIB
+
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -57,6 +70,8 @@ typedef void (*p_ply_error_cb)(p_ply ply, const char *message);
  * ply: handle returned by ply_open or ply_create
  * idata,pdata: contextual information set in ply_open or ply_create
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_get_ply_user_data(p_ply ply, void **pdata, long *idata);
 
 /* ----------------------------------------------------------------------
@@ -68,6 +83,8 @@ int ply_get_ply_user_data(p_ply ply, void **pdata, long *idata);
  *
  * Returns 1 if successful, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 p_ply ply_open(const char *name, p_ply_error_cb error_cb, long idata,
         void *pdata);
 
@@ -78,6 +95,8 @@ p_ply ply_open(const char *name, p_ply_error_cb error_cb, long idata,
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_read_header(p_ply ply);
 
 /* ----------------------------------------------------------------------
@@ -101,6 +120,8 @@ typedef int (*p_ply_read_cb)(p_ply_argument argument);
  * Returns 0 if no element or no property in element, returns the
  * number of element instances otherwise.
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 long ply_set_read_cb(p_ply ply, const char *element_name,
         const char *property_name, p_ply_read_cb read_cb,
         void *pdata, long idata);
@@ -115,6 +136,8 @@ long ply_set_read_cb(p_ply ply, const char *element_name,
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_get_argument_element(p_ply_argument argument,
         p_ply_element *element, long *instance_index);
 
@@ -128,6 +151,8 @@ int ply_get_argument_element(p_ply_argument argument,
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_get_argument_property(p_ply_argument argument,
         p_ply_property *property, long *length, long *value_index);
 
@@ -139,6 +164,8 @@ int ply_get_argument_property(p_ply_argument argument,
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_get_argument_user_data(p_ply_argument argument, void **pdata,
         long *idata);
 
@@ -149,6 +176,8 @@ int ply_get_argument_user_data(p_ply_argument argument, void **pdata,
  *
  * Returns the current data item
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 double ply_get_argument_value(p_ply_argument argument);
 
 /* ----------------------------------------------------------------------
@@ -159,6 +188,8 @@ double ply_get_argument_value(p_ply_argument argument);
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_read(p_ply ply);
 
 /* ----------------------------------------------------------------------
@@ -170,6 +201,8 @@ int ply_read(p_ply ply);
  *
  * Returns element if successfull or NULL if no more elements
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 p_ply_element ply_get_next_element(p_ply ply, p_ply_element last);
 
 /* ----------------------------------------------------------------------
@@ -181,6 +214,8 @@ p_ply_element ply_get_next_element(p_ply ply, p_ply_element last);
  *
  * Returns comment if successfull or NULL if no more comments
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 const char *ply_get_next_comment(p_ply ply, const char *last);
 
 /* ----------------------------------------------------------------------
@@ -192,6 +227,8 @@ const char *ply_get_next_comment(p_ply ply, const char *last);
  *
  * Returns obj_info if successfull or NULL if no more obj_infos
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 const char *ply_get_next_obj_info(p_ply ply, const char *last);
 
 /* ----------------------------------------------------------------------
@@ -203,6 +240,8 @@ const char *ply_get_next_obj_info(p_ply ply, const char *last);
  *
  * Returns 1 if successfull or 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_get_element_info(p_ply_element element, const char** name,
         long *ninstances);
 
@@ -215,6 +254,8 @@ int ply_get_element_info(p_ply_element element, const char** name,
  *
  * Returns element if successfull or NULL if no more properties
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 p_ply_property ply_get_next_property(p_ply_element element,
         p_ply_property last);
 
@@ -231,6 +272,8 @@ p_ply_property ply_get_next_property(p_ply_element element,
  *
  * Returns 1 if successfull or 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_get_property_info(p_ply_property property, const char** name,
         e_ply_type *type, e_ply_type *length_type, e_ply_type *value_type);
 
@@ -244,6 +287,8 @@ int ply_get_property_info(p_ply_property property, const char** name,
  *
  * Returns handle to PLY file if successfull, NULL otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 p_ply ply_create(const char *name, e_ply_storage_mode storage_mode,
         p_ply_error_cb error_cb, long idata, void *pdata);
 
@@ -256,6 +301,8 @@ p_ply ply_create(const char *name, e_ply_storage_mode storage_mode,
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_add_element(p_ply ply, const char *name, long ninstances);
 
 /* ----------------------------------------------------------------------
@@ -269,6 +316,8 @@ int ply_add_element(p_ply ply, const char *name, long ninstances);
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_add_property(p_ply ply, const char *name, e_ply_type type,
         e_ply_type length_type, e_ply_type value_type);
 
@@ -282,6 +331,8 @@ int ply_add_property(p_ply ply, const char *name, e_ply_type type,
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_add_list_property(p_ply ply, const char *name,
         e_ply_type length_type, e_ply_type value_type);
 
@@ -294,6 +345,8 @@ int ply_add_list_property(p_ply ply, const char *name,
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_add_scalar_property(p_ply ply, const char *name, e_ply_type type);
 
 /* ----------------------------------------------------------------------
@@ -304,6 +357,8 @@ int ply_add_scalar_property(p_ply ply, const char *name, e_ply_type type);
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_add_comment(p_ply ply, const char *comment);
 
 /* ----------------------------------------------------------------------
@@ -314,6 +369,8 @@ int ply_add_comment(p_ply ply, const char *comment);
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_add_obj_info(p_ply ply, const char *obj_info);
 
 /* ----------------------------------------------------------------------
@@ -324,6 +381,8 @@ int ply_add_obj_info(p_ply ply, const char *obj_info);
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_write_header(p_ply ply);
 
 /* ----------------------------------------------------------------------
@@ -337,6 +396,8 @@ int ply_write_header(p_ply ply);
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_write(p_ply ply, double value);
 
 /* ----------------------------------------------------------------------
@@ -346,13 +407,14 @@ int ply_write(p_ply ply, double value);
  *
  * Returns 1 if successfull, 0 otherwise
  * ---------------------------------------------------------------------- */
+
+RPLY_DLL_DEF
 int ply_close(p_ply ply);
 
 #ifdef __cplusplus
-}
+} // extern 'C'
 #endif
 
-#endif /* RPLY_H */
 
 /* ----------------------------------------------------------------------
  * Copyright (C) 2003-2015 Diego Nehab. All rights reserved.
diff --git a/rplyfile.h b/rplyfile.h
index 206e716..1b5a40e 100644
--- a/rplyfile.h
+++ b/rplyfile.h
@@ -9,6 +9,19 @@
  * at the end of this file.
  * ---------------------------------------------------------------------- */
 
+#ifdef RPLY_SHARED_LIB
+
+#ifdef RPLY_BUILD_LIB
+#define RPLY_DLL_DEF __declspec(dllexport)
+#else
+#define RPLY_DLL_DEF __declspec(dllimport)
+#endif // RPLY_BUILD_LIB
+
+#else
+#define RPLY_DLL_DEF  
+#endif // RPLY_SHARED_LIB
+
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -22,6 +35,7 @@ extern "C" {
  *
  * Returns 1 if successful, 0 otherwise
  * ---------------------------------------------------------------------- */
+RPLY_DLL_DEF
 p_ply ply_open_from_file(FILE *file_pointer, p_ply_error_cb error_cb,
     long idata, void *pdata);
 
@@ -35,6 +49,7 @@ p_ply ply_open_from_file(FILE *file_pointer, p_ply_error_cb error_cb,
  *
  * Returns handle to PLY file if successfull, NULL otherwise
  * ---------------------------------------------------------------------- */
+RPLY_DLL_DEF
 p_ply ply_create_to_file(FILE *file_pointer, e_ply_storage_mode storage_mode,
         p_ply_error_cb error_cb, long idata, void *pdata);