]> www.wagner.pp.ru Git - oss/fgis.git/blob - include/eppl.h
First checked in version
[oss/fgis.git] / include / eppl.h
1 /**********************************************************************/
2 /*           Common include file for epp and dgt file access          */
3 /**********************************************************************/
4 #ifndef EPPL_H
5 # define EPPL_H
6
7 /* attempt to make epp.c portable to machines with non-intel CPU */
8 # define LSB_FIRST 
9 /* if defined, get_row and put_row thinks, that least significant byte
10    is first in int variable */ 
11
12 /* Area unit definition */
13 # define AREA_NO_UNIT 0
14 # define AREA_SQ_FOOT 1
15 # define AREA_SQ_METER 2
16 # define AREA_SQ_KM 3
17 # define AREA_SQ_MILE 4
18 # define AREA_HECTARE 5
19 # define AREA_ACRE 6
20
21 /* Coordinate system definition */
22 # define COORD_NONE 0
23 # define COORD_UTM 1
24 # define COORD_STPLANE 2
25 # define COORD_LL 3                        
26
27 /* values for mode field of EPP */
28 # define MAP_INPUT 1
29 # define MAP_OUTPUT 2
30 # define MAP_LOADED 4 
31 # define MAP_CACHED 8
32 # define MAP_MODIFIED 128
33 /* this structure defines 128-byte header of EPP file. 
34    it assumes that all numeric types are in Intel format
35    short  - 16-bit, lsb first,
36    long  32-bit, lsb first
37    double - 64-bit IEEE conforming */
38 typedef struct EPPHEADER { short int fr,lr,fc,lc;/* last and first row/column */
39                            double fry,lry,fcx,lcx;/*corresponding alternative 
40                                                     coordinates*/
41                            short int kind;/* 8 or 16 bit file */
42                            short int base,scale;
43                            unsigned short int offsite; /* blank class */
44                            double sfact; /* cell area */
45                            long access_ptr; /* file offset of width table */
46                            unsigned short  minclass, maxclass; /* class limits. unused in
47                                                               8-bit files */
48                            char area_unit;
49                            char coord_sys;                                   
50                            char Reserved[6];
51                            char date[16], time[8];/* ASCII date and time */
52                            char comment[32]; } EPPHEADER;
53 typedef struct DGTHEADER {double  xleft,ybottom,xright,ytop;
54                           long    maxpt,maxline;
55                           short   kind;
56                           char    coord_sys;
57                           char reserved[85];
58                           } DGTHEADER;
59                           
60 #ifndef LSB_FIRST
61                           
62  short swapshort(short x);
63  long  swaplong(long x);
64  double swapdouble(double x);
65 #else
66 # define swapshort(x) (x)
67 # define swaplong(x) (x)
68 # define swapdouble(x) (x)   
69 #endif
70  
71 #endif
72  
73 /* Here is the end of this file */   
74