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

gpsutil.h File Reference

include file of gpsutil.c More...

Go to the source code of this file.

Defines

#define PI   3.14159265358979323846
#define GPSUDBG_INFOS   128
#define GPSUDBG_CALLS   32
#define GPSUDBG_UNEXP   8
#define BadCoordinate   -1000. /* returned if error in coordinates conversion */
#define OBJECTVERSION   2 /* object format version */
#define NextObject(o)   ( (char *)o + SizeOfObject(o) )

Typedefs

typedef void LogProc (char *p)
typedef LogProc * LogProcPtr

Functions

UInt16 SizeOfObject (Object *p) UTIL_SECTION
UInt16 ObjectsInRec (MemHandle RecH) UTIL_SECTION
 Returns number of Object type objects in a record.

UInt16 OffsetOfObjectInRec (MemHandle RecH, UInt16 n) UTIL_SECTION
 Computes offset of nth object in a record.

UInt16 G100ToCustom (Raw_D100_Wpt_Type *p100, Custom_Wpt_Type *pcust) UTIL_SECTION
 Converts a D100 waypoint to GPilotS' internal format.

UInt16 G102ToCustom (Raw_D102_Wpt_Type *p102, Custom_Wpt_Type *pcust) UTIL_SECTION
 Converts a D102 waypoint to GPilotS' internal format.

UInt16 G103ToCustom (Raw_D103_Wpt_Type *p103, Custom_Wpt_Type *pcust) UTIL_SECTION
 Converts a D103 waypoint to GPilotS' internal format.

UInt16 G104ToCustom (Raw_D104_Wpt_Type *p104, Custom_Wpt_Type *pcust) UTIL_SECTION
 Converts a D104 waypoint to GPilotS' internal format.

UInt16 G105ToCustom (Raw_D105_Wpt_Type *p105, Custom_Wpt_Type *pcust) UTIL_SECTION
 Converts a D105 waypoint to GPilotS' internal format.

UInt16 G107ToCustom (Raw_D107_Wpt_Type *p107, Custom_Wpt_Type *pcust) UTIL_SECTION
 Converts a D107 waypoint to GPilotS' internal format.

UInt16 G108ToCustom (Raw_D108_Wpt_Type *p108, Custom_Wpt_Type *pcust) UTIL_SECTION
 Converts a D108 waypoint to GPilotS' internal format.

UInt16 G109ToCustom (Raw_D109_Wpt_Type *p109, Custom_Wpt_Type *pcust) UTIL_SECTION
 Converts a D109 waypoint to GPilotS' internal format.

UInt16 CustomToG100 (Custom_Wpt_Type *pcust, Raw_D100_Wpt_Type *p100) UTIL_SECTION
 Converts a GPilotS' internal format waypoint to a D100 one.

UInt16 CustomToG102 (Custom_Wpt_Type *pcust, Raw_D102_Wpt_Type *p102) UTIL_SECTION
 Converts a GPilotS' internal format waypoint to a D102 one.

UInt16 CustomToG103 (Custom_Wpt_Type *pcust, Raw_D103_Wpt_Type *p103) UTIL_SECTION
 Converts a GPilotS' internal format waypoint to a D103 one.

UInt16 CustomToG104 (Custom_Wpt_Type *pcust, Raw_D104_Wpt_Type *p104) UTIL_SECTION
 Converts a GPilotS' internal format waypoint to a D104 one.

UInt16 CustomToG105 (Custom_Wpt_Type *pcust, Raw_D105_Wpt_Type *p105) UTIL_SECTION
 Converts a GPilotS' internal format waypoint to a D105 one.

UInt16 CustomToG107 (Custom_Wpt_Type *pcust, Raw_D107_Wpt_Type *p107) UTIL_SECTION
 Converts a GPilotS' internal format waypoint to a D107 one.

UInt16 CustomToB108 (Custom_Wpt_Type *pcust, B108_Wpt_Type *p108, Boolean merge) UTIL_SECTION
 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 CustomToB109 (Custom_Wpt_Type *pcust, B109_Wpt_Type *p109, Boolean merge) UTIL_SECTION
 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 (Object *recp, Custom_Wpt_Type *pcust) UTIL_SECTION
LocalFormatID HandleToCustomWpt (ObjectHandle RecH, Custom_Wpt_Type *pcust) UTIL_SECTION
 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) UTIL_SECTION
 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) UTIL_SECTION
 Converts a Custom_Wpt_Type waypoint to an object of given format.

ObjectAnyToAnyWpt (Object *from, Object *to, LocalFormatID toformat) UTIL_SECTION
UInt16 WptsInRteDB (MemHandle RecH) UTIL_SECTION
 Computes number of waypoints in route record.

LocalFormatID PtrToCustomRteHdr (Object *recp, Custom_Rte_Hdr_Type *pcust) UTIL_SECTION
LocalFormatID HandleToCustomRteHdr (MemHandle RecH, Custom_Rte_Hdr_Type *pcust) UTIL_SECTION
 Converts route header object, given a handle on it, to Custom_Rte_Hdr_Type GPilotS' internal format.

ObjectCustomToRteHdrObj (Custom_Rte_Hdr_Type *pcust, Object *o, LocalFormatID toformat) UTIL_SECTION
ObjectAnyToAnyRteHdr (Object *from, Object *to, LocalFormatID toformat) UTIL_SECTION
UInt16 TrkptsInTrkDB (MemHandle rech) UTIL_SECTION
 Returns number of track points in a track (should use number stored in track header).

void CustomToRawD301TrkPt (Custom_Trk_Point_Type *from, Raw_D301_Trk_Point_Type *to) UTIL_SECTION
 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) UTIL_SECTION
 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) UTIL_SECTION
 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) UTIL_SECTION
 Converts a GPilotS' compact format track point to a raw D300 one.

UInt16 AnyRawToAnyTrkPt (LocalFormatID in_format, LocalFormatID out_format, GarminObject *from, TrkPts *to) UTIL_SECTION
 Converts all known raw track point format to any internal format.

void CustomTrkHdrToD310 (Object *trkhdr, D310_Trk_Hdr_Type *d310) UTIL_SECTION
Symbol_Type smblToSymbolType (byte smbl) UTIL_SECTION
 Converts a D103 symbol type into a Symbol_Type one.

byte SymbolTypeTosmbl (Symbol_Type smbl) UTIL_SECTION
 Converts a Symbol_Type into a D103 symbol type.

UInt16 symb_gid2lid (Symbol_Type gid) UTIL_SECTION
 Maps a garmin Symbol_Type value into a local bitmap index.

Symbol_Type symb_lid2gid (UInt16 lid) UTIL_SECTION
 Maps a local bitmap index to a garmin Symbol_Type value.

void * GetObjPtr (UInt16 objindex) UTIL_SECTION
 Get object form pointer from object ID.

void HideObject (UInt16 objID) UTIL_SECTION
 Hides given object in current form.

void ShowObject (UInt16 objID) UTIL_SECTION
 Show given object in current form.

Int16 RecIdToPosition (DmOpenRef DB, UInt16 category, UInt32 recid, UInt16 *indexp) UTIL_SECTION
 Returns a record position in it's category and index given it's ID (avoids DmFindRecordByID pitfalls).

UInt32 GetRecordID (DmOpenRef DB, UInt16 index) UTIL_SECTION
 Get unique ID of a record given it's index.

char * DegreToDM (double coord, Boolean longitude, Boolean nmea) UTIL_SECTION
 Conversion of coordinate in degrees to ascii format [D]DD°MM.fff'L or [D]DDMM.fff,L if nmea.

char * DegreToDMS (double coord, Boolean longitude) UTIL_SECTION
 degrees to string [D]DD°MM'SS.S"L

char * DegreToD (double coord, Boolean longitude) UTIL_SECTION
 degrees to string [D]DD.DDDDD°L

char * DegreToChars (double coord, Boolean longitude, DisplayFormat DispMode) UTIL_SECTION
 Converts coordinate to string in current format (specified in DisplayMode).

double ReadCoord (char *string, Boolean *longitude) UTIL_SECTION
 Converts ASCII coordinate to double.

void SemiToDegre (Semicircle_Type *p, double *latitude, double *longitude) UTIL_SECTION
 Conversion of coordinates from Semicircle_Type to degree.

void DegreToSemi (double latitude, double longitude, Semicircle_Type *p) UTIL_SECTION
 conversion of degree coordinates to Semicircle_Type

void DistBearToSemi (double dist, UInt16 bearing, Semicircle_Type *p) UTIL_SECTION
 Computes Semicircle_Type coordinates from distance and bearing from a given point.

char * StrNCopySafe (char *dstp, char *srcp, UInt16 dstsize) UTIL_SECTION
 Copy at most dstsize-1 bytes from source to destination string.

void StrNCatSafe (char *dstp, char *srcp, UInt16 dstsize, UInt16 srcsize) UTIL_SECTION
 Concatenation of a string and a char array.

double StrToD (char *p, char **endp) UTIL_SECTION
 Conversion ascii floating point number ([+-]M[M...][.F[F...]][+-]eX[X]) to double.

void StrNToField (char *str, UInt16 length, UInt16 fieldid) UTIL_SECTION
 copy a char array into a field, replacing the text handle of the field.

void Canonicalize (char *p, UInt16 l) UTIL_SECTION
 Canonization of a string (all upper case, no non-alphanum,...).

double Distance (long lat1, long lon1, long lat2, long lon2, DistanceUnit unit) UTIL_SECTION
 Computes distance between two points given their coordinates.

double PDistance (long lat1, long lon1, long lat2, long lon2) UTIL_SECTION
 Pseudo distance between 2 points.

UInt16 Bearing (long slat1, long slon1, long slat2, long slon2) UTIL_SECTION
 Bearing of point 2 from point 1.

char * DToA (double x, UInt16 digits, UInt16 precision) UTIL_SECTION
 Conversion of a double to a string (fixed precision) of the form [-]ddd.ffff.

void DrawCharsInWidth (char *string, Int16 x, Int16 y, UInt16 w, Boolean RightAligned) UTIL_SECTION
 Draws a string at given place and width.

Int16 DistComp (long lat1, long lon1, long lat2, long lon2, long reflat, long reflon) UTIL_SECTION
 Distance comparison of two points against a reference point.

void SetMathLibRef (UInt16 ref) UTIL_SECTION
void GpsutilSetDebugLevel (UInt16 debuglevel, LogProcPtr logprocp) UTIL_SECTION
 Sets the debugging level (no effect if compiled without DEBUG).

Boolean WptHit (Custom_Wpt_Type *wptp, Semicircle_Type *position) UTIL_SECTION
 Test if position is inside waypoint's proximity distance.

void SetControlValue (UInt16 objID, short value) UTIL_SECTION
 Set a control's values.

short GetControlValue (UInt16 objID) UTIL_SECTION
 Get a control's (push button or check box) state.

void GetObjectBounds (UInt16 objID, RectanglePtr rp) UTIL_SECTION
 Get an object's bounds.


Variables

const UInt32 OnePower31 = (1UL << 31)
const UInt32 OnePower31Pi = (1UL << 31) / PI


Detailed Description

include file of gpsutil.c

Author:
C. Claveleira
Date:
1999-2004

Function Documentation

UInt16 AnyRawToAnyTrkPt LocalFormatID  in_format,
LocalFormatID  out_format,
GarminObject *  from,
TrkPts *  to
 

Converts all known raw track point format to any internal format.

Parameters:
in_format format of raw track point to convert
out_format format to convert to
from pointer on raw track point to convert
to pointer on buffer to receive converted track point
Returns:
size of converted track point, 0 if error

UInt16 Bearing long  slat1,
long  slon1,
long  slat2,
long  slon2
 

Bearing of point 2 from point 1.

Parameters:
slat1 latitude of point 1
slon1 longitude of point 1
slat2 latitude of point 2
slon2 longitude of point 2
Returns:
bearing in degrees

void Canonicalize char *  p,
UInt16  l
 

Canonization of a string (all upper case, no non-alphanum,...).

Parameters:
p string to canonicalise
l length of string
Returns:
nothing

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.

Parameters:
from pointer on a Compact_Trk_Point_Type struct to convert
to pointer on raw D300 track point to receive result of conversion
Returns:
nothing

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.

Parameters:
from pointer on a Compact_Trk_Point_Type struct to convert
to pointer on raw D301 track point to receive result of conversion
Returns:
nothing

Err CustomToAnyWpt Custom_Wpt_Type pcust,
LocalFormatID  format,
ObjectPtr  newp,
Boolean  merge
 

Converts a Custom_Wpt_Type waypoint to an object of given format.

Parameters:
pcust pointeur on Custom_Wpt_Type waypoint type
format format to convert to
newp pointeur on object to receive converted waypoint
merge If != 0 the Custom_Wpt_Type waypoint is to be merged with the content of *newp
Returns:
0 if OK

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.

Parameters:
pcust pointer on the Custom_Wpt_Type waypoint to convert
p108 pointer on the destination B108_Wpt_Type waypoint (may contain a valid Raw_D108_Wpt_Type waypoint)
merge if != 0 the source waypoint is merged to the Raw_D108_Wpt_Type waypoint ccntained in the destination waypoint
Returns:
the size of the corresponding Raw_D108_Wpt_Type

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.

Parameters:
pcust pointer on the Custom_Wpt_Type waypoint to convert
p109 pointer on the destination B109_Wpt_Type waypoint (may contain a valid Raw_D109_Wpt_Type waypoint)
merge if != 0 the source waypoint is merged to the Raw_D109_Wpt_Type waypoint ccntained in the destination waypoint
Returns:
the size of the corresponding Raw_D109_Wpt_Type

UInt16 CustomToG100 Custom_Wpt_Type pcust,
Raw_D100_Wpt_Type *  p100
 

Converts a GPilotS' internal format waypoint to a D100 one.

Parameters:
pcust pointer on the custom waypoint to convert
p100 pointer on a raw D100 waypoint to receive result of conversion
Returns:
size of converted waypoint

UInt16 CustomToG102 Custom_Wpt_Type pcust,
Raw_D102_Wpt_Type *  p102
 

Converts a GPilotS' internal format waypoint to a D102 one.

Parameters:
pcust pointer on the custom waypoint to convert
p102 pointer on a raw D102 waypoint to receive result of conversion
Returns:
size of converted waypoint

UInt16 CustomToG103 Custom_Wpt_Type pcust,
Raw_D103_Wpt_Type *  p103
 

Converts a GPilotS' internal format waypoint to a D103 one.

Parameters:
pcust pointer on the custom waypoint to convert
p103 pointer on a raw D103 waypoint to receive result of conversion
Returns:
size of converted waypoint

UInt16 CustomToG104 Custom_Wpt_Type pcust,
Raw_D104_Wpt_Type *  p104
 

Converts a GPilotS' internal format waypoint to a D104 one.

Parameters:
pcust pointer on the custom waypoint to convert
p104 pointer on a raw D104 waypoint to receive result of conversion
Returns:
size of converted waypoint

UInt16 CustomToG105 Custom_Wpt_Type pcust,
Raw_D105_Wpt_Type *  p105
 

Converts a GPilotS' internal format waypoint to a D105 one.

Parameters:
pcust pointer on the custom waypoint to convert
p105 pointer on a raw D105 waypoint to receive result of conversion
Returns:
size of converted waypoint

UInt16 CustomToG107 Custom_Wpt_Type pcust,
Raw_D107_Wpt_Type *  p107
 

Converts a GPilotS' internal format waypoint to a D107 one.

Parameters:
pcust pointer on the custom waypoint to convert
p107 pointer on a raw D107 waypoint to receive result of conversion
Returns:
size of converted waypoint

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.

Parameters:
from pointer on a Custom_Trk_Point_Type struct to convert
to pointer on raw D300 track point to receive result of conversion
Returns:
nothing

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.

Parameters:
from pointer on a Custom_Trk_Point_Type struct to convert
to pointer on raw D301 track point to receive result of conversion
Returns:
nothing

char* DegreToChars double  coord,
Boolean  longitude,
DisplayFormat  DisplayMode
 

Converts coordinate to string in current format (specified in DisplayMode).

Parameters:
coord coordinate in degrees
longitude true indicates coordinate is a longitude
DisplayMode display format wanted
Returns:
converted string

char* DegreToD double  coord,
Boolean  longitude
 

degrees to string [D]DD.DDDDD°L

Parameters:
coord coordinate in degrees
longitude true indicates coord is a longitude
Returns:
result string

char* DegreToDM double  coord,
Boolean  longitude,
Boolean  nmea
 

Conversion of coordinate in degrees to ascii format [D]DD°MM.fff'L or [D]DDMM.fff,L if nmea.

Parameters:
coord coordinate in degrees
longitude true if longitude coordinate
nmea true if nmea format wanted
Returns:
pointer on resulting string

char* DegreToDMS double  coord,
Boolean  longitude
 

degrees to string [D]DD°MM'SS.S"L

Parameters:
coord coordinate in degrees
longitude true indicates coord is a longitude
Returns:
result string

void DegreToSemi double  latitude,
double  longitude,
Semicircle_Type *  p
 

conversion of degree coordinates to Semicircle_Type

Parameters:
latitude latitude in degrees
longitude longitude in degrees
p pointer to store the result
Returns:
nothing

double Distance long  lat1,
long  lon1,
long  lat2,
long  lon2,
DistanceUnit  unit
 

Computes distance between two points given their coordinates.

Parameters:
lat1 latitude WGS84 of point 1
lon1 longitude WGS84 of point 1
lat2 latitude WGS84 of point 2
lon2 longitude WGS84 of point 2
unit unit wanted
Returns:
distance in km, nm or mi

void DistBearToSemi double  dist,
UInt16  bearing,
Semicircle_Type *  p
 

Computes Semicircle_Type coordinates from distance and bearing from a given point.

Parameters:
dist distance in nm
bearing bearing in degrees
p address of origin then result coordinates
Returns:
nothing

Int16 DistComp long  lat1,
long  lon1,
long  lat2,
long  lon2,
long  reflat,
long  reflon
 

Distance comparison of two points against a reference point.

Parameters:
lat1 latitude of first point
lon1 longitude of first point
lat2 latitude of second point
lon2 longitude of second point
reflat latitude of reference point
reflon longitude of reference point
Returns:
-1, 0 or 1

void DrawCharsInWidth char *  string,
Int16  x,
Int16  y,
UInt16  w,
Boolean  RightAligned
 

Draws a string at given place and width.

If the string don't fit in given width an ellipsis is drawn (...) at the end.

Parameters:
string string to draw
x left coordinate to start
y top coordinate to start
w max width to draw into
RightAligned the string is right aligned if true, left aligned otherwise
Returns:
nothing

char* DToA double  x,
UInt16  digits,
UInt16  precision
 

Conversion of a double to a string (fixed precision) of the form [-]ddd.ffff.

Parameters:
x value to convert (we suppose x < 1e9)
digits number of digits of integer part (ddd), negative sign included. Must be <=9. Exemple : x=-34, digits=3 => "-34." If digits is 0 the necessary number of digits is returned.
precision number of digits of fractional part (ffff). Must be <=9
Returns:
the string containing value converted

UInt16 G100ToCustom Raw_D100_Wpt_Type *  p100,
Custom_Wpt_Type pcust
 

Converts a D100 waypoint to GPilotS' internal format.

Parameters:
p100 pointer on a raw D100 waypoint (as received from gps) to convert
pcust pointer on a custom (internal) waypoint to receive result of conversion
Returns:
size of custom waypoint type

UInt16 G102ToCustom Raw_D102_Wpt_Type *  p102,
Custom_Wpt_Type pcust
 

Converts a D102 waypoint to GPilotS' internal format.

Parameters:
p102 pointer on a raw D102 waypoint (as received from gps) to convert
pcust pointer on a custom (internal) waypoint to receive result of conversion
Returns:
size of custom waypoint type

UInt16 G103ToCustom Raw_D103_Wpt_Type *  p103,
Custom_Wpt_Type pcust
 

Converts a D103 waypoint to GPilotS' internal format.

Parameters:
p103 pointer on a raw D103 waypoint (as received from gps) to convert
pcust pointer on a custom (internal) waypoint to receive result of conversion
Returns:
size of custom waypoint type

UInt16 G104ToCustom Raw_D104_Wpt_Type *  p104,
Custom_Wpt_Type pcust
 

Converts a D104 waypoint to GPilotS' internal format.

Parameters:
p104 pointer on a raw D104 waypoint (as received from gps) to convert
pcust pointer on a custom (internal) waypoint to receive result of conversion
Returns:
size of custom waypoint type

UInt16 G105ToCustom Raw_D105_Wpt_Type *  p105,
Custom_Wpt_Type pcust
 

Converts a D105 waypoint to GPilotS' internal format.

Parameters:
p105 pointer on a raw D105 waypoint (as received from gps) to convert
pcust pointer on a custom (internal) waypoint to receive result of conversion
Returns:
size of custom waypoint type

UInt16 G107ToCustom Raw_D107_Wpt_Type *  p107,
Custom_Wpt_Type pcust
 

Converts a D107 waypoint to GPilotS' internal format.

Parameters:
p107 pointer on a raw D107 waypoint (as received from gps) to convert
pcust pointer on a custom (internal) waypoint to receive result of conversion
Returns:
size of custom waypoint type

UInt16 G108ToCustom Raw_D108_Wpt_Type *  p108,
Custom_Wpt_Type pcust
 

Converts a D108 waypoint to GPilotS' internal format.

Parameters:
p108 pointer on a raw D108 waypoint (as received from gps) to convert
pcust pointer on a custom (internal) waypoint to receive result of conversion
Returns:
size of custom waypoint type

UInt16 G109ToCustom Raw_D109_Wpt_Type *  p109,
Custom_Wpt_Type pcust
 

Converts a D109 waypoint to GPilotS' internal format.

Parameters:
p109 pointer on a raw D109 waypoint (as received from gps) to convert
pcust pointer on a custom (internal) waypoint to receive result of conversion
Returns:
size of custom waypoint type

short GetControlValue UInt16  objID  ) 
 

Get a control's (push button or check box) state.

Parameters:
objID id of the control
Returns:
the state of the control

void GetObjectBounds UInt16  objID,
RectanglePtr  rp
 

Get an object's bounds.

Parameters:
objID object's ID in the form
rp pointer on a RectangleType struct to store bounds into
Returns:
nothing

void* GetObjPtr UInt16  ObjID  ) 
 

Get object form pointer from object ID.

Parameters:
ObjID object id
Returns:
pointer on form object

UInt32 GetRecordID DmOpenRef  DB,
UInt16  index
 

Get unique ID of a record given it's index.

Parameters:
DB reference to data base to search
index index of the record
Returns:
UID of the record or 0 if record not found and OS not crashed

void GpsutilSetDebugLevel UInt16  debuglevel,
LogProcPtr  logprocp
 

Sets the debugging level (no effect if compiled without DEBUG).

Parameters:
debuglevel level of debugging (see values near top of nokialib.c)
logprocp procedure to call to log traces
Returns:
nothing

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.

Parameters:
RecH handle on route header object
pcust pointer on a Custom_Rte_Hdr_Type structure
Returns:
format of origin object

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.

Parameters:
RecH Handle to a waypoint record
pcust pointer on a Custom_Wpt_Type waypoint
Returns:
the local format id of the original record waypoint

void HideObject UInt16  objID  ) 
 

Hides given object in current form.

Parameters:
objID object index to hide
Returns:
nothing

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.

Parameters:
index index of waypoint
DB pointer on data base containing the waypoint
pcust pointer on a Custom_Wpt_Type waypoint
Returns:
the local format id of the original record waypoint

UInt16 ObjectsInRec MemHandle  RecH  ) 
 

Returns number of Object type objects in a record.

Parameters:
RecH Handle on a data base record
Returns:
number of objects or 0

UInt16 OffsetOfObjectInRec MemHandle  RecH,
UInt16  n
 

Computes offset of nth object in a record.

Parameters:
RecH Handle on record containing objects
n index of object (first =0) to know offset of
Returns:
offset in bytes from **RecH

double PDistance long  lat1,
long  lon1,
long  lat2,
long  lon2
 

Pseudo distance between 2 points.

This is approximate but fast !

Parameters:
lat1 latitude of first point
lon1 longitute of first point
lat2 latitude of second point
lon2 longitute of second point
Returns:
pseudo-distance

double ReadCoord char *  string,
Boolean *  longitude
 

Converts ASCII coordinate to double.

Any format (D.DD, DM.MM, DMS) is accepted.

Parameters:
string pointer on coordinates
longitude pointer on boolean set to true if it's a longitude coordinate, false otherwise. If no indication in string, value passed is used.
Returns:
coordinate if conversion ok, BadCoordinate otherwise

Int16 RecIdToPosition DmOpenRef  DB,
UInt16  category,
UInt32  recid,
UInt16 *  indexp
 

Returns a record position in it's category and index given it's ID (avoids DmFindRecordByID pitfalls).

Parameters:
DB data base to search
category category to search into
recid id of record to search
indexp pointer on index to return if found, unchanged otherwise. May be null
Returns:
position value if found (and *indexp updated), -1 otherwise

void SemiToDegre Semicircle_Type *  p,
double *  latitude,
double *  longitude
 

Conversion of coordinates from Semicircle_Type to degree.

Parameters:
p address of source coordinate
latitude pointer to store latitude
longitude pointer to store longitude
Returns:
nothing

void SetControlValue UInt16  objID,
short  value
 

Set a control's values.

Parameters:
objID id of the control
value value to set
Returns:
nothing

void ShowObject UInt16  objID  ) 
 

Show given object in current form.

Parameters:
objID object index to show
Returns:
nothing

Symbol_Type smblToSymbolType byte  smbl  ) 
 

Converts a D103 symbol type into a Symbol_Type one.

Parameters:
smbl value of symbol type
Returns:
the corresponding Symbol_Type value

void StrNCatSafe char *  dstp,
char *  srcp,
UInt16  dstsize,
UInt16  srcsize
 

Concatenation of a string and a char array.

The array don't need to be null terminated and, in all cases, the resulting string is null terminated (contrary to StrNCat)

Parameters:
dstp null terminated destination string
srcp source string/array to catenate to dstp
dstsize allocated size of the destination string
srcsize number of chars to copy
Returns:
nothing

char* StrNCopySafe char *  dstp,
char *  srcp,
UInt16  dstsize
 

Copy at most dstsize-1 bytes from source to destination string.

Ensures that the destination string is null terminated (dstsize'th byte is 0) except if dstsize=0

Parameters:
dstp pointer on destination string
srcp pointer on source string
dstsize size to fill (including null)
Returns:
addr of next char after last char copied

void StrNToField char *  str,
UInt16  length,
UInt16  fieldid
 

copy a char array into a field, replacing the text handle of the field.

Parameters:
str string to put in the field (not necessarily terminated by 0)
length number of bytes to copy
fieldid id of the field
Returns:
nothing

double StrToD char *  p,
char **  endp
 

Conversion ascii floating point number ([+-]M[M...][.F[F...]][+-]eX[X]) to double.

Parameters:
p string to parse
endp si non null address of a pointer to store where the conversion has stopped
Returns:
result of conversion

UInt16 symb_gid2lid Symbol_Type  gid  ) 
 

Maps a garmin Symbol_Type value into a local bitmap index.

Parameters:
gid Garmin symbol value
Returns:
local bitmap index

Symbol_Type symb_lid2gid UInt16  lid  ) 
 

Maps a local bitmap index to a garmin Symbol_Type value.

Parameters:
lid local bitmap index
Returns:
Garmin symbol value

byte SymbolTypeTosmbl Symbol_Type  smbl  ) 
 

Converts a Symbol_Type into a D103 symbol type.

A default value is returned if the source value has no corresponding value.

Parameters:
smbl symbol value to convert
Returns:

UInt16 TrkptsInTrkDB MemHandle  rech  ) 
 

Returns number of track points in a track (should use number stored in track header).

Parameters:
rech handle on a record containing a track
Returns:
number of track points in the trace

Boolean WptHit Custom_Wpt_Type wptp,
Semicircle_Type *  position
 

Test if position is inside waypoint's proximity distance.

Parameters:
wptp pointer on a Custom_Wpt_Type waypoint
position pointer on a position
Returns:
true if position is inside proximity circle, flase otherwise

UInt16 WptsInRteDB MemHandle  RecH  ) 
 

Computes number of waypoints in route record.

The route is supposed to contain only waypoints.

Parameters:
RecH Handle on route record
Returns:
number of waypoints


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