00001
00010
00011
00012 #ifndef __TYPES_H__
00013 #define __TYPES_H__
00014
00015 #if defined __palmos__ // types used are PalmOS' ones
00016 # define PACKED
00017 #elif defined GLIB_MAJOR_VERSION // type castings for glib
00018 typedef guint32 UInt32 ;
00019 typedef gint32 Int32 ;
00020 typedef guint32 ULong;
00021 typedef guint16 UInt;
00022 typedef guint16 UInt16;
00023 typedef gint16 Int16;
00024 typedef guint16 Err;
00025 typedef guint16 Word;
00026 typedef gint16 SWord;
00027 typedef char Char;
00028 typedef unsigned char Boolean;
00029 typedef void *FieldPtr;
00030 typedef void *MemHandle;
00031 typedef void *DmOpenRef;
00032 typedef void *RectanglePtr;
00033 typedef void *MemPtr;
00034 # define MemSet(dst,num,value) memset(dst,value,num)
00035 # define MemMove memmove
00036 # define StrLen strlen
00037 # define MemHandleLock(h) (h)
00038 # define MemHandleUnlock(h)
00039 # define min(a, b) (((a) < (b)) ? (a) : (b))
00040 # define PACKED __attribute__ ((packed))
00041 #else // default
00042 typedef unsigned int UInt16;
00043 typedef int Int16;
00044 typedef unsigned long UInt32;
00045 typedef long Int32;
00046 # define PACKED __attribute__ ((packed))
00047 #endif
00048
00051 enum DistanceUnit
00052 {
00053 metric, nautical, statute
00054 };
00055 typedef enum DistanceUnit DistanceUnit;
00056
00059 typedef enum
00060 {
00061 DMM, DMS, DDD
00062 }
00063 DisplayFormat;
00064
00067 typedef struct
00068 {
00069 char ident[51];
00070 Semicircle_Type posn;
00071 char cmnt[51];
00072 float dst;
00073 float alt;
00074 Int16 smbl;
00075 byte dspl;
00076 byte color;
00077 }
00078 Custom_Wpt_Type;
00079
00082 typedef struct
00083 {
00084 Raw_D108_Wpt_Type w;
00085 char ident[51];
00086 char comment[51];
00087 char facility[31];
00088 char city[25];
00089 char addr[51];
00090 char cross_road[51];
00091 }
00092 B108_Wpt_Type;
00093
00096 typedef struct
00097 {
00098 Raw_D109_Wpt_Type w;
00099 char ident[51];
00100 char comment[51];
00101 char facility[31];
00102 char city[25];
00103 char addr[51];
00104 char cross_road[51];
00105 }
00106 B109_Wpt_Type;
00107
00108
00109
00110
00111
00112
00113
00116 typedef struct
00117 {
00118 byte nmbr;
00119 char cmnt[128];
00120 }
00121 Custom_Rte_Hdr_Type;
00122
00125 typedef struct
00126 {
00127 char name[256];
00128 byte dspl;
00129 byte color;
00130 LocalFormatID type;
00131 unsigned char unused;
00132 UInt16 number;
00133 Int32 latmin,
00134
00135 latmax,
00136
00137 lonmin,
00138
00139 lonmax;
00140 unsigned char unused2;
00141 } PACKED
00142 Custom_Trk_Hdr_Type;
00143
00146 typedef struct
00147 {
00148 Semicircle_Type posn;
00149 UInt32 time;
00150 float alt;
00151 boolean new_trk;
00152 unsigned char unused;
00153 } PACKED
00154 Custom_Trk_Point_Type;
00155
00158 typedef struct
00159 {
00160 Semicircle_Type posn;
00161 boolean new_trk;
00162 unsigned char unused;
00163 } PACKED
00164 Compact_Trk_Point_Type;
00165
00168 typedef struct
00169 {
00170 struct
00171 {
00172 LocalFormatID type;
00173 UInt16 size;
00174 Int32 version;
00175 }
00176 header;
00177 union
00178 {
00179 GarminObject g;
00180
00181
00182
00183
00184
00185
00186 B108_Wpt_Type b108;
00187 B109_Wpt_Type b109;
00188
00189
00190
00191
00192
00193 Custom_Wpt_Type CustWpt;
00194 Custom_Rte_Hdr_Type CustRteHdr;
00195 Custom_Trk_Hdr_Type CustTrkHdr;
00196 }
00197 d;
00198 byte pad[3];
00199 }
00200 Object;
00201
00202 union TrkPts
00203 {
00204 Custom_Trk_Point_Type custom;
00205 Compact_Trk_Point_Type compact;
00206 };
00207 typedef union TrkPts TrkPts;
00208
00209 typedef Object *ObjectPtr;
00210 typedef ObjectPtr *ObjectHandle;
00211
00212
00213 #endif