|
Lines 571-578
Link Here
|
| 571 |
|
571 |
|
| 572 |
/* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */ |
572 |
/* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */ |
| 573 |
static u_int8_t |
573 |
static u_int8_t |
| 574 |
precsize_aton(strptr) |
574 |
precsize_aton(char **strptr) |
| 575 |
char **strptr; |
575 |
/* char **strptr; */ |
| 576 |
{ |
576 |
{ |
| 577 |
unsigned int mval = 0, cmval = 0; |
577 |
unsigned int mval = 0, cmval = 0; |
| 578 |
u_int8_t retval = 0; |
578 |
u_int8_t retval = 0; |
|
Lines 613-627
Link Here
|
| 613 |
|
613 |
|
| 614 |
/* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */ |
614 |
/* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */ |
| 615 |
static u_int32_t |
615 |
static u_int32_t |
| 616 |
latlon2ul(latlonstrptr,which) |
616 |
latlon2ul(char *latlonstrptr,int *which) |
| 617 |
char **latlonstrptr; |
617 |
/* char **latlonstrptr; */ |
| 618 |
int *which; |
618 |
/* int *which; */ |
| 619 |
{ |
619 |
{ |
| 620 |
char *cp; |
620 |
char *cp; |
| 621 |
u_int32_t retval; |
621 |
u_int32_t retval; |
| 622 |
int deg = 0, min = 0, secs = 0, secsfrac = 0; |
622 |
int deg = 0, min = 0, secs = 0, secsfrac = 0; |
| 623 |
|
623 |
|
| 624 |
cp = *latlonstrptr; |
624 |
cp = latlonstrptr; |
| 625 |
|
625 |
|
| 626 |
while (isdigit((unsigned char)*cp)) |
626 |
while (isdigit((unsigned char)*cp)) |
| 627 |
deg = deg * 10 + (*cp++ - '0'); |
627 |
deg = deg * 10 + (*cp++ - '0'); |
|
Lines 704-710
Link Here
|
| 704 |
while (isspace((unsigned char)*cp)) /* move to next field */ |
704 |
while (isspace((unsigned char)*cp)) /* move to next field */ |
| 705 |
cp++; |
705 |
cp++; |
| 706 |
|
706 |
|
| 707 |
*latlonstrptr = cp; |
707 |
latlonstrptr = cp; |
| 708 |
|
708 |
|
| 709 |
return (retval); |
709 |
return (retval); |
| 710 |
} |
710 |
} |
|
Lines 716-722
Link Here
|
| 716 |
const char *ascii; |
716 |
const char *ascii; |
| 717 |
u_char *binary; |
717 |
u_char *binary; |
| 718 |
{ |
718 |
{ |
| 719 |
const char *cp, *maxcp; |
719 |
char *cp; |
|
|
720 |
char *maxcp; |
| 720 |
u_char *bcp; |
721 |
u_char *bcp; |
| 721 |
|
722 |
|
| 722 |
u_int32_t latit = 0, longit = 0, alt = 0; |
723 |
u_int32_t latit = 0, longit = 0, alt = 0; |
|
Lines 725-745
Link Here
|
| 725 |
u_int8_t hp = 0x16; /* default = 1e6 cm = 10000.00m = 10km */ |
726 |
u_int8_t hp = 0x16; /* default = 1e6 cm = 10000.00m = 10km */ |
| 726 |
u_int8_t vp = 0x13; /* default = 1e3 cm = 10.00m */ |
727 |
u_int8_t vp = 0x13; /* default = 1e3 cm = 10.00m */ |
| 727 |
u_int8_t siz = 0x12; /* default = 1e2 cm = 1.00m */ |
728 |
u_int8_t siz = 0x12; /* default = 1e2 cm = 1.00m */ |
| 728 |
int which1 = 0, which2 = 0; |
729 |
int *which1 = 0, *which2 = 0; |
| 729 |
|
730 |
|
| 730 |
cp = ascii; |
731 |
*cp = *ascii; |
| 731 |
maxcp = cp + strlen(ascii); |
732 |
*maxcp = *cp + strlen(ascii); |
| 732 |
|
733 |
|
| 733 |
lltemp1 = latlon2ul(&cp, &which1); |
734 |
lltemp1 = latlon2ul(cp, which1); |
| 734 |
|
735 |
|
| 735 |
lltemp2 = latlon2ul(&cp, &which2); |
736 |
lltemp2 = latlon2ul(cp, which2); |
| 736 |
|
737 |
|
| 737 |
switch (which1 + which2) { |
738 |
switch (*which1 + *which2) { |
| 738 |
case 3: /* 1 + 2, the only valid combination */ |
739 |
case 3: /* 1 + 2, the only valid combination */ |
| 739 |
if ((which1 == 1) && (which2 == 2)) { /* normal case */ |
740 |
if ((*which1 == 1) && (*which2 == 2)) { /* normal case */ |
| 740 |
latit = lltemp1; |
741 |
latit = lltemp1; |
| 741 |
longit = lltemp2; |
742 |
longit = lltemp2; |
| 742 |
} else if ((which1 == 2) && (which2 == 1)) { /* reversed */ |
743 |
} else if ((*which1 == 2) && (*which2 == 1)) { /* reversed |
|
|
744 |
*/ |
| 743 |
longit = lltemp1; |
745 |
longit = lltemp1; |
| 744 |
latit = lltemp2; |
746 |
latit = lltemp2; |
| 745 |
} else { /* some kind of brokenness */ |
747 |
} else { /* some kind of brokenness */ |