Main Page | Alphabetical List | Data Structures | File List | Globals | Related Pages

types.h

Go to the documentation of this file.
00001 
00010 // $Id: types.h,v 1.7 2004/11/17 21:28:05 clavelei Exp $
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; /* unites de distance */
00056 
00059 typedef enum                           /* display mode (warning : other structures use it) */
00060 {
00061     DMM, DMS, DDD
00062 }
00063 DisplayFormat;
00064 
00067 typedef struct                         /* structure de waypoint "interne" */
00068 {
00069     char ident[51];                    /* identifier (50 + '0') */
00070     Semicircle_Type posn;              /* position (common to all Garmin types) */
00071     char cmnt[51];                     /* comment (50 + '0') */
00072     float dst;                         /* proximity distance */
00073     float alt;                         /* altitude */
00074     Int16 smbl;                        /* symbol id */
00075     byte dspl;                         /* display option */
00076     byte color;                        /* color */
00077 }
00078 Custom_Wpt_Type;                       /* size : 124 bytes */
00079 
00082 typedef struct                         /* super D108 with place for full strings */
00083 {
00084     Raw_D108_Wpt_Type w;
00085     char ident[51];                    /* variable length string   1-51 */
00086     char comment[51];                  /* waypoint user comment    1-51 */
00087     char facility[31];                 /* facility name            1-31 */
00088     char city[25];                     /* city name                1-25 */
00089     char addr[51];                     /* address number           1-51 */
00090     char cross_road[51];               /* intersecting road label  1-51 */
00091 }
00092 B108_Wpt_Type;                         /* size : 308 bytes */
00093 
00096 typedef struct                         /* super D109 with place for full strings (size = 312) */
00097 {
00098     Raw_D109_Wpt_Type w;               /*                           52 */
00099     char ident[51];                    /* variable length string  1-51 */
00100     char comment[51];                  /* waypoint user comment   1-51 */
00101     char facility[31];                 /* facility name           1-31 */
00102     char city[25];                     /* city name               1-25 */
00103     char addr[51];                     /* address number          1-51 */
00104     char cross_road[51];               /* intersecting road label 1-51 */
00105 }
00106 B109_Wpt_Type;                         /* size : 312 bytes */
00107 
00108 // typedef struct
00109 // {                                   /* super D202 with place for full string */
00110 //     char rte_ident[255];            /* null-terminated string */
00111 // }
00112 // B202_Rte_Hdr_Type;
00113 
00116 typedef struct                         /* internal route header */
00117 {
00118     byte nmbr;                         /* route number */
00119     char cmnt[128];                    /* comment or ident */
00120 }
00121 Custom_Rte_Hdr_Type;                   /* size : 129 bytes */
00122 
00125 typedef struct                         /* internal track header */
00126 {
00127     char name[256];                    /* nom du groupe de trackpoints */
00128     byte dspl;                         /* display on the map ? */
00129     byte color;                        /* color */
00130     LocalFormatID type;                /* type of following track points */
00131     unsigned char unused;              /* padding to align size of struct between platforms */
00132     UInt16 number;             /* number of track points */
00133     Int32 latmin,                      /* latitude min */
00134 
00135       latmax,                          /* latitude max */
00136 
00137       lonmin,                          /* longitude min */
00138 
00139       lonmax;                          /* longitude max */
00140     unsigned char unused2;              /* padding to align size of struct between platforms */
00141 } PACKED
00142 Custom_Trk_Hdr_Type;                   /* size : 278 bytes */
00143 
00146 typedef struct
00147 {
00148     Semicircle_Type posn;              /* position */
00149     UInt32 time;                       /* time */
00150     float alt;                         /* altitude in meters */
00151     boolean new_trk;                   /* new track segment? */
00152     unsigned char unused;              /* padding to align size of struct between platforms */
00153 } PACKED
00154 Custom_Trk_Point_Type;                /* size : 18 bytes */
00155 
00158 typedef struct                         /* custom compact track point type */
00159 {
00160     Semicircle_Type posn;              /* position */
00161     boolean new_trk;                   /* new track segment? */
00162     unsigned char unused;              /* padding to align size of struct between platforms */
00163 } PACKED
00164 Compact_Trk_Point_Type;                /* size : 10 bytes */
00165 
00168 typedef struct                         /* structure of objects stored in records (324 bytes) */
00169 {
00170     struct
00171     {
00172         LocalFormatID type;            /* type of following datas */
00173         UInt16 size;           /* size of following datas */
00174         Int32 version;                 /* version and spare room */
00175     }
00176     header;
00177     union
00178     {
00179       GarminObject g;  /* all Garmin objects (254 bytes) */
00180 /*      Raw_D100_Wpt_Type d100; */
00181 /*      Raw_D102_Wpt_Type d102; */
00182 /*      Raw_D103_Wpt_Type d103; */
00183 /*      Raw_D104_Wpt_Type d104; */
00184 /*      Raw_D107_Wpt_Type d107; */
00185 /*      Raw_D108_Wpt_Type d108; */
00186       B108_Wpt_Type b108;
00187       B109_Wpt_Type b109;  /* 312 bytes */
00188 /*      Raw_D300_Trk_Point_Type d300; */
00189 /*      D200_Rte_Hdr_Type d200; */
00190 /*      D201_Rte_Hdr_Type d201; */
00191 /*      D202_Rte_Hdr_Type d202; */
00192 /*      B202_Rte_Hdr_Type b202; */
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;                  /* size : 324 bytes */
00201 
00202 union TrkPts
00203 {
00204     Custom_Trk_Point_Type custom;
00205     Compact_Trk_Point_Type compact;
00206 };                                     /* union of internal track points formats */
00207 typedef union TrkPts TrkPts;
00208 
00209 typedef Object *ObjectPtr;             // 
00210 typedef ObjectPtr *ObjectHandle;       // Object Handle
00211 
00212 
00213 #endif

Generated on Sun Mar 13 09:36:01 2005 for GPilotS by doxygen 1.3.6