#include <PalmOS.h>
#include "Garmin.h"
#include "types.h"
#include "log.h"
#include "gpsutil.h"
Defines | |
#define | min(a, b) (((a) < (b)) ? (a) : (b)) |
#define | S_BEGIN 0 |
#define | S_END 1 |
#define | S_LOCAL 2 |
#define | S_DEFAULT_LID sym_null |
#define | HOSTtoLE32(to, from) LEtoHOST32((to),(from)) |
#define | HOSTtoLE16(to, from) LEtoHOST16((to),(from)) |
Functions | |
void | RawD301ToCustomTrkPt (Raw_D301_Trk_Point_Type *from, Custom_Trk_Point_Type *to) UTIL_SECTION |
Converts a raw D301 track point to GPilotS standard custom internal format. | |
void | RawD301ToCompactTrkPt (Raw_D301_Trk_Point_Type *from, Compact_Trk_Point_Type *to) UTIL_SECTION |
Converts a raw D301 track point to GPilotS compact custom internal format. | |
void | RawD300ToCustomTrkPt (Raw_D300_Trk_Point_Type *from, Custom_Trk_Point_Type *to) UTIL_SECTION |
Converts a raw D300 track point to GPilotS standard custom internal format. | |
void | RawD300ToCompactTrkPt (Raw_D300_Trk_Point_Type *from, Compact_Trk_Point_Type *to) UTIL_SECTION |
Converts a raw D300 track point to GPilotS compact custom internal format. | |
void | LEtoHOST32 (byte *pto, byte *pfrom) UTIL_SECTION |
Converts a 32 bits word from Little Endian to local endian. | |
void | LEtoHOST16 (byte *pto, byte *pfrom) UTIL_SECTION |
Converts a 16 bits word from Little Endian to local endian. | |
UInt16 | SizeOfObject (ObjectPtr p) |
Compute size of GPilotS' objects. | |
UInt16 | ObjectsInRec (MemHandle RecH) |
Returns number of Object type objects in a record. | |
UInt16 | OffsetOfObjectInRec (MemHandle RecH, UInt16 n) |
Computes offset of nth object in a record. | |
UInt16 | G100ToCustom (Raw_D100_Wpt_Type *p100, Custom_Wpt_Type *pcust) |
Converts a D100 waypoint to GPilotS' internal format. | |
UInt16 | CustomToG100 (Custom_Wpt_Type *pcust, Raw_D100_Wpt_Type *p100) |
Converts a GPilotS' internal format waypoint to a D100 one. | |
UInt16 | G102ToCustom (Raw_D102_Wpt_Type *p102, Custom_Wpt_Type *pcust) |
Converts a D102 waypoint to GPilotS' internal format. | |
UInt16 | CustomToG102 (Custom_Wpt_Type *pcust, Raw_D102_Wpt_Type *p102) |
Converts a GPilotS' internal format waypoint to a D102 one. | |
UInt16 | G103ToCustom (Raw_D103_Wpt_Type *p103, Custom_Wpt_Type *pcust) |
Converts a D103 waypoint to GPilotS' internal format. | |
UInt16 | CustomToG103 (Custom_Wpt_Type *pcust, Raw_D103_Wpt_Type *p103) |
Converts a GPilotS' internal format waypoint to a D103 one. | |
UInt16 | G104ToCustom (Raw_D104_Wpt_Type *p104, Custom_Wpt_Type *pcust) |
Converts a D104 waypoint to GPilotS' internal format. | |
UInt16 | CustomToG104 (Custom_Wpt_Type *pcust, Raw_D104_Wpt_Type *p104) |
Converts a GPilotS' internal format waypoint to a D104 one. | |
UInt16 | G105ToCustom (Raw_D105_Wpt_Type *p105, Custom_Wpt_Type *pcust) |
Converts a D105 waypoint to GPilotS' internal format. | |
UInt16 | CustomToG105 (Custom_Wpt_Type *pcust, Raw_D105_Wpt_Type *p105) |
Converts a GPilotS' internal format waypoint to a D105 one. | |
UInt16 | G107ToCustom (Raw_D107_Wpt_Type *p107, Custom_Wpt_Type *pcust) |
Converts a D107 waypoint to GPilotS' internal format. | |
UInt16 | CustomToG107 (Custom_Wpt_Type *pcust, Raw_D107_Wpt_Type *p107) |
Converts a GPilotS' internal format waypoint to a D107 one. | |
UInt16 | G108ToCustom (Raw_D108_Wpt_Type *p108, Custom_Wpt_Type *pcust) |
Converts a D108 waypoint to GPilotS' internal format. | |
UInt16 | CustomToB108 (Custom_Wpt_Type *pcust, B108_Wpt_Type *p108, Boolean merge) |
Converts, and optionaly merge, a Custom_Wpt_Type waypoint to a B108_Wpt_Type one B108_Wpt_Type has the necessary size to hold a "full" Raw_D108_Wpt_Type. | |
UInt16 | G109ToCustom (Raw_D109_Wpt_Type *p109, Custom_Wpt_Type *pcust) |
Converts a D109 waypoint to GPilotS' internal format. | |
UInt16 | CustomToB109 (Custom_Wpt_Type *pcust, B109_Wpt_Type *p109, Boolean merge) |
Converts, and optionaly merge, a Custom_Wpt_Type waypoint to a B109_Wpt_Type one B109_Wpt_Type has the necessary size to hold a "full" Raw_D109_Wpt_Type. | |
LocalFormatID | PtrToCustomWpt (ObjectPtr recp, Custom_Wpt_Type *pcust) |
Converts a waypoint object record, given a pointer on it, to a Custom_Wpt_Type type waypoint. | |
LocalFormatID | HandleToCustomWpt (ObjectHandle RecH, Custom_Wpt_Type *pcust) |
Converts a waypoint object record, given a handle on it, to a Custom_Wpt_Type type waypoint. | |
LocalFormatID | IndexToCustomWpt (UInt16 index, DmOpenRef DB, Custom_Wpt_Type *pcust) |
Converts a waypoint object record, given its index in waypoint data base, to a Custom_Wpt_Type. | |
Err | CustomToAnyWpt (Custom_Wpt_Type *pcust, LocalFormatID format, ObjectPtr newp, Boolean merge) |
Converts a Custom_Wpt_Type waypoint to an object of given format. | |
ObjectPtr | AnyToAnyWpt (ObjectPtr from, ObjectPtr to, LocalFormatID toformat) |
Converts a waypoint contained in an object from any known format to any other format. | |
UInt16 | symb_gid2lid (Symbol_Type gid) |
Maps a garmin Symbol_Type value into a local bitmap index. | |
Symbol_Type | symb_lid2gid (UInt16 lid) |
Maps a local bitmap index to a garmin Symbol_Type value. | |
UInt16 | WptsInRteDB (MemHandle RecH) |
Computes number of waypoints in route record. | |
LocalFormatID | PtrToCustomRteHdr (ObjectPtr recp, Custom_Rte_Hdr_Type *pcust) |
Conversion of a route header object, given a pointer on it, to a Custom_Rte_Hdr_Type GPilotS' internal format. | |
LocalFormatID | HandleToCustomRteHdr (MemHandle RecH, Custom_Rte_Hdr_Type *pcust) |
Converts route header object, given a handle on it, to Custom_Rte_Hdr_Type GPilotS' internal format. | |
ObjectPtr | CustomToRteHdrObj (Custom_Rte_Hdr_Type *pcust, ObjectPtr o, LocalFormatID toformat) |
Converts a custom GPilotS internal format route header to a known Garmin type included in an object. | |
ObjectPtr | AnyToAnyRteHdr (ObjectPtr from, ObjectPtr to, LocalFormatID toformat) |
Converts object containing a route header from any known format to any other. | |
UInt16 | TrkptsInTrkDB (MemHandle rech) |
Returns number of track points in a track (should use number stored in track header). | |
UInt16 | AnyRawToAnyTrkPt (LocalFormatID in_format, LocalFormatID out_format, GarminObject *from, TrkPts *to) |
Converts all known raw track point format to any internal format. | |
void | CustomToRawD301TrkPt (Custom_Trk_Point_Type *from, Raw_D301_Trk_Point_Type *to) |
Converts a GPilotS' standard custom format track point to a raw D301 one. | |
void | CompactToRawD301TrkPt (Compact_Trk_Point_Type *from, Raw_D301_Trk_Point_Type *to) |
Converts a GPilotS' compact format track point to a raw D301 one. | |
void | CustomToRawD300TrkPt (Custom_Trk_Point_Type *from, Raw_D300_Trk_Point_Type *to) |
Converts a GPilotS' custom format track point to a raw D300 one. | |
void | CompactToRawD300TrkPt (Compact_Trk_Point_Type *from, Raw_D300_Trk_Point_Type *to) |
Converts a GPilotS' compact format track point to a raw D300 one. | |
void | CustomTrkHdrToD310 (ObjectPtr trkhdr, D310_Trk_Hdr_Type *d310) |
Converts a GPilotS' custom track header to a D310 one. | |
Symbol_Type | smblToSymbolType (byte smbl) |
Converts a D103 symbol type into a Symbol_Type one. | |
byte | SymbolTypeTosmbl (Symbol_Type smbl) |
Converts a Symbol_Type into a D103 symbol type. | |
Variables | |
char | vcid [] = "$Id: objects.c,v 1.9 2004/11/17 21:04:30 clavelei Exp $" |
const UInt16 | smbl2ST [16] |
const UInt16 | SymbolMap [][3] |
|
Converts all known raw track point format to any internal format.
|
|
Converts object containing a route header from any known format to any other.
|
|
Converts a waypoint contained in an object from any known format to any other format.
|
|
Converts a GPilotS' compact format track point to a raw D300 one.
|
|
Converts a GPilotS' compact format track point to a raw D301 one.
|
|
Converts a Custom_Wpt_Type waypoint to an object of given format.
|
|
Converts, and optionaly merge, a Custom_Wpt_Type waypoint to a B108_Wpt_Type one B108_Wpt_Type has the necessary size to hold a "full" Raw_D108_Wpt_Type.
|
|
Converts, and optionaly merge, a Custom_Wpt_Type waypoint to a B109_Wpt_Type one B109_Wpt_Type has the necessary size to hold a "full" Raw_D109_Wpt_Type.
|
|
Converts a GPilotS' internal format waypoint to a D100 one.
|
|
Converts a GPilotS' internal format waypoint to a D102 one.
|
|
Converts a GPilotS' internal format waypoint to a D103 one.
|
|
Converts a GPilotS' internal format waypoint to a D104 one.
|
|
Converts a GPilotS' internal format waypoint to a D105 one.
|
|
Converts a GPilotS' internal format waypoint to a D107 one.
|
|
Converts a GPilotS' custom format track point to a raw D300 one.
|
|
Converts a GPilotS' standard custom format track point to a raw D301 one.
|
|
Converts a custom GPilotS internal format route header to a known Garmin type included in an object.
|
|
Converts a GPilotS' custom track header to a D310 one.
|
|
Converts a D100 waypoint to GPilotS' internal format.
|
|
Converts a D102 waypoint to GPilotS' internal format.
|
|
Converts a D103 waypoint to GPilotS' internal format.
|
|
Converts a D104 waypoint to GPilotS' internal format.
|
|
Converts a D105 waypoint to GPilotS' internal format.
|
|
Converts a D107 waypoint to GPilotS' internal format.
|
|
Converts a D108 waypoint to GPilotS' internal format.
|
|
Converts a D109 waypoint to GPilotS' internal format.
|
|
Converts route header object, given a handle on it, to Custom_Rte_Hdr_Type GPilotS' internal format.
|
|
Converts a waypoint object record, given a handle on it, to a Custom_Wpt_Type type waypoint.
|
|
Converts a waypoint object record, given its index in waypoint data base, to a Custom_Wpt_Type.
|
|
Converts a 16 bits word from Little Endian to local endian.
|
|
Converts a 32 bits word from Little Endian to local endian.
|
|
Returns number of Object type objects in a record.
|
|
Computes offset of nth object in a record.
|
|
Conversion of a route header object, given a pointer on it, to a Custom_Rte_Hdr_Type GPilotS' internal format.
|
|
Converts a waypoint object record, given a pointer on it, to a Custom_Wpt_Type type waypoint.
|
|
Converts a raw D300 track point to GPilotS compact custom internal format.
|
|
Converts a raw D300 track point to GPilotS standard custom internal format.
|
|
Converts a raw D301 track point to GPilotS compact custom internal format.
|
|
Converts a raw D301 track point to GPilotS standard custom internal format.
|
|
Compute size of GPilotS' objects. The size is rounded modulo 4 to avoid alignment problems.
|
|
Converts a D103 symbol type into a Symbol_Type one.
|
|
Maps a garmin Symbol_Type value into a local bitmap index.
|
|
Maps a local bitmap index to a garmin Symbol_Type value.
|
|
Converts a Symbol_Type into a D103 symbol type. A default value is returned if the source value has no corresponding value.
|
|
Returns number of track points in a track (should use number stored in track header).
|
|
Computes number of waypoints in route record. The route is supposed to contain only waypoints.
|
|
Initial value: { sym_wpt_dot, sym_house, sym_fuel, sym_car, sym_fish, sym_wreck, sym_anchor, sym_wreck, sym_user_exit, sym_skull, sym_flag, sym_camp, sym_circle_x, sym_deer, sym_1st_aid, sym_trcbck } |
|
Initial value: { {sym_anchor, sym_rbcn, 0}, {sym_boat_ramp, sym_circle_x, 38}, {sym_is_hwy, sym_border, 68}, {sym_airport, sym_seaplane, 131} } |