OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
include
ossim
vpfutil
vpfio.h
Go to the documentation of this file.
1
/* SCCS_ID[] = @(#) vpfio.h 1.6 8/13/91 */
2
3
/* ========================================================================
4
5
Environmental Systems Research Institute (ESRI) Applications Programming
6
7
Project: Conversion from ARC/INFO to VPF
8
Original Coding: David Flinn July 1991
9
Modifications:
10
11
======================================================================== */
12
13
#ifndef _VPF_IO_
14
#define _VPF_IO_
15
16
#include <stdio.h>
17
#ifdef __cplusplus
18
extern
"C"
{
19
#endif
20
#include <
ossim/base/ossimConstants.h
>
21
/* These are all the metacharacters used to parse out input text files */
22
23
#define COMPONENT_SEPERATOR ';'
24
#define LINE_CONTINUE '\\'
25
#define SPACE ' '
26
#define TEXT_NULL "-"
27
#define COMMENT_CHAR '"'
28
#define FIELD_COUNT '='
29
#define FIELD_SEPERATOR ','
30
#define END_OF_FIELD ':'
31
#define FIELD_PARTITION '^'
32
#define NEXT_ELEMENT '|'
33
#define COMMENT '#'
34
#define NEW_LINE '\n'
35
#define VARIABLE_COUNT '*'
36
#define TAB '\t'
37
38
/* Now set up the macros to read in data from disk and to write */
39
40
/* #if __MSDOS__ */
41
#if 0
42
43
#define Read_Vpf_Char(tobuffer,fromtable,count)\
44
fread(tobuffer,sizeof(char),count,fromtable)
45
46
#define Read_Vpf_Short(tobuffer,fromtable,count)\
47
fread(tobuffer,sizeof(short int),count,fromtable)
48
49
#define Read_Vpf_Int(tobuffer,fromtable,count)\
50
fread(tobuffer,sizeof(ossim_int32),count,fromtable)
51
52
#define Read_Vpf_Float(tobuffer,fromtable,count)\
53
fread(tobuffer,sizeof(float),count,fromtable)
54
55
#define Read_Vpf_Double(tobuffer,fromtable,count)\
56
fread(tobuffer,sizeof(double),count,fromtable)
57
58
#define Read_Vpf_Date(tobuffer,fromtable,count)\
59
fread(tobuffer,sizeof(date_type)-1,count,fromtable)
60
61
#define Read_Vpf_Coordinate(tobuffer,fromtable,count)\
62
fread(tobuffer,sizeof(coordinate_type),count,fromtable)
63
64
#define Read_Vpf_CoordinateZ(tobuffer,fromtable,count)\
65
fread(tobuffer,sizeof(tri_coordinate_type),count,fromtable)
66
67
#define Read_Vpf_DoubleCoordinate(tobuffer,fromtable,count)\
68
fread(tobuffer,sizeof(double_coordinate_type),count,fromtable)
69
70
#define Read_Vpf_DoubleCoordinateZ(tobuffer,fromtable,count)\
71
fread(tobuffer,sizeof(double_tri_coordinate_type), \
72
count,fromtable)
73
74
#define Write_Vpf_Char(tobuffer,fromfile,count)\
75
fwrite(tobuffer,sizeof(char),count,fromfile)
76
77
#define Write_Vpf_Short(tobuffer,fromfile,count)\
78
fwrite(tobuffer,sizeof(short int),count,fromfile)
79
80
#define Write_Vpf_Int(tobuffer,fromfile,count)\
81
fwrite(tobuffer,sizeof(ossim_int32),count,fromfile)
82
83
#define Write_Vpf_Float(tobuffer,fromfile,count)\
84
fwrite(tobuffer,sizeof(float),count,fromfile)
85
86
#define Write_Vpf_Double(tobuffer,fromfile,count)\
87
fwrite(tobuffer,sizeof(double),count,fromfile)
88
89
#define Write_Vpf_Date(tobuffer,fromfile,count)\
90
fwrite(tobuffer,sizeof(char)*20,count,fromfile)
91
92
#define Write_Vpf_Coordinate(tobuffer,fromfile,count)\
93
fwrite(tobuffer,sizeof(float)*2,count,fromfile)
94
95
#define Write_Vpf_CoordinateZ(tobuffer,fromfile,count)\
96
fwrite(tobuffer,sizeof(float)*3,count,fromfile)
97
98
#define Write_Vpf_DoubleCoordinate(tobuffer,fromfile,count)\
99
fwrite(tobuffer,sizeof(double)*2,count,fromfile)
100
101
#define Write_Vpf_DoubleCoordinateZ(tobuffer,fromfile,count)\
102
fwrite(tobuffer,sizeof(double)*3,count,fromfile)
103
104
#else
/* Now the UNIX subroutine calls */
105
106
107
/* types */
108
typedef
enum
{
109
VpfNull
,
110
VpfChar
,
111
VpfShort
,
112
VpfInteger
,
113
VpfFloat
,
114
VpfDouble
,
115
VpfDate
,
116
VpfKey
,
117
VpfCoordinate
,
118
VpfTriCoordinate
,
119
VpfDoubleCoordinate
,
120
VpfDoubleTriCoordinate
,
121
VpfUndefined
122
}
VpfDataType
;
123
124
#define Read_Vpf_Char(tobuffer,fromfile,count)\
125
VpfRead(tobuffer,VpfChar,count,fromfile)
126
127
#define Read_Vpf_Short(tobuffer,fromfile,count)\
128
VpfRead(tobuffer,VpfShort,count,fromfile)
129
130
#define Read_Vpf_Int(tobuffer,fromfile,count)\
131
VpfRead(tobuffer,VpfInteger,count,fromfile)
132
133
#define Read_Vpf_Float(tobuffer,fromfile,count)\
134
VpfRead(tobuffer,VpfFloat,count,fromfile)
135
136
#define Read_Vpf_Double(tobuffer,fromfile,count)\
137
VpfRead(tobuffer,VpfDouble,count,fromfile)
138
139
#define Read_Vpf_Date(tobuffer,fromfile,count)\
140
VpfRead(tobuffer,VpfDate,count,fromfile)
141
142
#define Read_Vpf_Coordinate(tobuffer,fromfile,count)\
143
VpfRead(tobuffer,VpfCoordinate,count,fromfile)
144
145
#define Read_Vpf_CoordinateZ(tobuffer,fromfile,count)\
146
VpfRead(tobuffer,VpfTriCoordinate,count,fromfile)
147
148
#define Read_Vpf_DoubleCoordinate(tobuffer,fromfile,count)\
149
VpfRead(tobuffer,VpfDoubleCoordinate,count,fromfile)
150
151
#define Read_Vpf_DoubleCoordinateZ(tobuffer,fromfile,count)\
152
VpfRead(tobuffer,VpfDoubleTriCoordinate,count,fromfile)
153
154
#define Write_Vpf_Char(tobuffer,fromfile,count)\
155
VpfWrite(tobuffer,VpfChar,count,fromfile)
156
157
#define Write_Vpf_Short(tobuffer,fromfile,count)\
158
VpfWrite(tobuffer,VpfShort,count,fromfile)
159
160
#define Write_Vpf_Int(tobuffer,fromfile,count)\
161
VpfWrite(tobuffer,VpfInteger,count,fromfile)
162
163
#define Write_Vpf_Float(tobuffer,fromfile,count)\
164
VpfWrite(tobuffer,VpfFloat,count,fromfile)
165
166
#define Write_Vpf_Double(tobuffer,fromfile,count)\
167
VpfWrite(tobuffer,VpfDouble,count,fromfile)
168
169
#define Write_Vpf_Date(tobuffer,fromfile,count)\
170
VpfWrite(tobuffer,VpfDate,count,fromfile)
171
172
#define Write_Vpf_Coordinate(tobuffer,fromfile,count)\
173
VpfWrite(tobuffer,VpfCoordinate,count,fromfile)
174
175
#define Write_Vpf_CoordinateZ(tobuffer,fromfile,count)\
176
VpfWrite(tobuffer,VpfTriCoordinate,count,fromfile)
177
178
#define Write_Vpf_DoubleCoordinate(tobuffer,fromfile,count)\
179
VpfWrite(tobuffer,VpfDoubleCoordinate,count,fromfile)
180
181
#define Write_Vpf_DoubleCoordinateZ(tobuffer,fromfile,count)\
182
VpfWrite(tobuffer,VpfDoubleTriCoordinate,count,fromfile)
183
184
/* subroutines */
185
186
ossim_int32
VpfRead
(
void
*to,
VpfDataType
type,
ossim_int32
count, FILE *from ) ;
187
188
ossim_int32
VpfWrite
(
void
*from,
VpfDataType
type,
ossim_int32
count, FILE *to );
189
190
#ifdef __cplusplus
191
}
192
#endif
193
194
#endif
/* if __MSDOS__ */
195
#endif
/* ifndef _VPF_IO_ */
196
197
198
199
200
201
202
203
VpfInteger
Definition:
vpfio.h:112
VpfDate
Definition:
vpfio.h:115
VpfDouble
Definition:
vpfio.h:114
VpfChar
Definition:
vpfio.h:110
VpfFloat
Definition:
vpfio.h:113
VpfKey
Definition:
vpfio.h:116
ossimConstants.h
VpfTriCoordinate
Definition:
vpfio.h:118
VpfDataType
VpfDataType
Definition:
vpfio.h:108
VpfShort
Definition:
vpfio.h:111
VpfDoubleTriCoordinate
Definition:
vpfio.h:120
VpfCoordinate
Definition:
vpfio.h:117
VpfDoubleCoordinate
Definition:
vpfio.h:119
VpfNull
Definition:
vpfio.h:109
VpfUndefined
Definition:
vpfio.h:121
VpfWrite
ossim_int32 VpfWrite(void *from, VpfDataType type, ossim_int32 count, FILE *to)
VpfRead
ossim_int32 VpfRead(void *to, VpfDataType type, ossim_int32 count, FILE *from)
ossim_int32
int ossim_int32
Definition:
ossimConstants.h:234
Generated on Fri Aug 3 2018 08:46:55 for OSSIM - Open Source Software Image Map by
1.8.14