#include <PalmOS.h>
#include <CharAttr.h>
#include <stdio.h>
#include "MathLib.h"
#include "Garmin.h"
#include "types.h"
#include "log.h"
#include "gpsutil.h"
#include <TxtGlue.h>
Defines | |
| #define | min(a, b) (((a) < (b)) ? (a) : (b)) |
| #define | TxtGlueCharIsDigit(c) (((c)<='9') && ((c)>='0')) |
Functions | |
| void | DebugPrintf (char *formatStr,...) |
| Internal use. | |
| void | SetMathLibRef (UInt16 ref) |
| void | StrNCatSafe (char *dstp, char *srcp, UInt16 dstsize, UInt16 srcsize) |
| Concatenation of a string and a char array. | |
| char * | StrNCopySafe (char *dstp, char *srcp, UInt16 dstsize) |
| Copy at most dstsize-1 bytes from source to destination string. | |
| void | StrNToField (char *str, UInt16 length, UInt16 fieldid) |
| copy a char array into a field, replacing the text handle of the field. | |
| void | DrawCharsInWidth (char *string, Int16 x, Int16 y, UInt16 w, Boolean RightAligned) |
| Draws a string at given place and width. | |
| void | Canonicalize (char *p, UInt16 l) |
| Canonization of a string (all upper case, no non-alphanum,...). | |
| void * | GetObjPtr (UInt16 ObjID) |
| Get object form pointer from object ID. | |
| void | HideObject (UInt16 objID) |
| Hides given object in current form. | |
| void | ShowObject (UInt16 objID) |
| Show given object in current form. | |
| void | SetControlValue (UInt16 objID, short value) |
| Set a control's values. | |
| short | GetControlValue (UInt16 objID) |
| Get a control's (push button or check box) state. | |
| void | GetObjectBounds (UInt16 objID, RectanglePtr rp) |
| Get an object's bounds. | |
| 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). | |
| UInt32 | GetRecordID (DmOpenRef DB, UInt16 index) |
| Get unique ID of a record given it's index. | |
| char * | DToA (double x, UInt16 digits, UInt16 precision) |
| Conversion of a double to a string (fixed precision) of the form [-]ddd.ffff. | |
| double | StrToD (char *p, char **endp) |
| Conversion ascii floating point number ([+-]M[M...][.F[F...]][+-]eX[X]) to double. | |
| double | ReadCoord (char *string, Boolean *longitude) |
| Converts ASCII coordinate to double. | |
| char * | DegreToChars (double coord, Boolean longitude, DisplayFormat DisplayMode) |
| Converts coordinate to string in current format (specified in DisplayMode). | |
| 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. | |
| char * | DegreToDMS (double coord, Boolean longitude) |
| degrees to string [D]DD°MM'SS.S"L | |
| char * | DegreToD (double coord, Boolean longitude) |
| degrees to string [D]DD.DDDDD°L | |
| void | DegreToSemi (double latitude, double longitude, Semicircle_Type *p) |
| conversion of degree coordinates to Semicircle_Type | |
| void | SemiToDegre (Semicircle_Type *p, double *latitude, double *longitude) |
| Conversion of coordinates from Semicircle_Type to degree. | |
| void | DistBearToSemi (double dist, UInt16 bearing, Semicircle_Type *p) |
| Computes Semicircle_Type coordinates from distance and bearing from a given point. | |
| UInt16 | Bearing (long slat1, long slon1, long slat2, long slon2) |
| Bearing of point 2 from point 1. | |
| Int16 | DistComp (long lat1, long lon1, long lat2, long lon2, long reflat, long reflon) |
| Distance comparison of two points against a reference point. | |
| double | Distance (long lat1, long lon1, long lat2, long lon2, DistanceUnit unit) |
| Computes distance between two points given their coordinates. | |
| double | PDistance (long lat1, long lon1, long lat2, long lon2) |
| Pseudo distance between 2 points. | |
| void | GpsutilSetDebugLevel (UInt16 debuglevel, LogProcPtr logprocp) |
| Sets the debugging level (no effect if compiled without DEBUG). | |
| Boolean | WptHit (Custom_Wpt_Type *wptp, Semicircle_Type *position) |
| Test if position is inside waypoint's proximity distance. | |
Variables | |
| char | rcsid [] = "$Id: gpsutil.c,v 1.11 2004/11/17 21:15:01 clavelei Exp $" |
| int | DebugLevel |
| int | DebugIndentLevel |
| LogProcPtr | LogOutput |
|
||||||||||||||||||||
|
Bearing of point 2 from point 1.
|
|
||||||||||||
|
Canonization of a string (all upper case, no non-alphanum,...).
|
|
||||||||||||
|
Internal use. Writes "printf" formatted messages to debug log
|
|
||||||||||||||||
|
Converts coordinate to string in current format (specified in DisplayMode).
|
|
||||||||||||
|
degrees to string [D]DD.DDDDD°L
|
|
||||||||||||||||
|
Conversion of coordinate in degrees to ascii format [D]DD°MM.fff'L or [D]DDMM.fff,L if nmea.
|
|
||||||||||||
|
degrees to string [D]DD°MM'SS.S"L
|
|
||||||||||||||||
|
conversion of degree coordinates to Semicircle_Type
|
|
||||||||||||||||||||||||
|
Computes distance between two points given their coordinates.
|
|
||||||||||||||||
|
Computes Semicircle_Type coordinates from distance and bearing from a given point.
|
|
||||||||||||||||||||||||||||
|
Distance comparison of two points against a reference point.
|
|
||||||||||||||||||||||||
|
Draws a string at given place and width. If the string don't fit in given width an ellipsis is drawn (...) at the end.
|
|
||||||||||||||||
|
Conversion of a double to a string (fixed precision) of the form [-]ddd.ffff.
|
|
|
Get a control's (push button or check box) state.
|
|
||||||||||||
|
Get an object's bounds.
|
|
|
Get object form pointer from object ID.
|
|
||||||||||||
|
Get unique ID of a record given it's index.
|
|
||||||||||||
|
Sets the debugging level (no effect if compiled without DEBUG).
|
|
|
Hides given object in current form.
|
|
||||||||||||||||||||
|
Pseudo distance between 2 points. This is approximate but fast !
|
|
||||||||||||
|
Converts ASCII coordinate to double. Any format (D.DD, DM.MM, DMS) is accepted.
|
|
||||||||||||||||||||
|
Returns a record position in it's category and index given it's ID (avoids DmFindRecordByID pitfalls).
|
|
||||||||||||||||
|
Conversion of coordinates from Semicircle_Type to degree.
|
|
||||||||||||
|
Set a control's values.
|
|
|
Show given object in current form.
|
|
||||||||||||||||||||
|
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)
|
|
||||||||||||||||
|
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
|
|
||||||||||||||||
|
copy a char array into a field, replacing the text handle of the field.
|
|
||||||||||||
|
Conversion ascii floating point number ([+-]M[M...][.F[F...]][+-]eX[X]) to double.
|
|
||||||||||||
|
Test if position is inside waypoint's proximity distance.
|
1.3.6