~ubuntu-branches/ubuntu/raring/geotranz/raring

« back to all changes in this revision

Viewing changes to geotrans2/src/strtoval.h

  • Committer: Bazaar Package Importer
  • Author(s): Roberto Lumbreras
  • Date: 2008-10-17 14:43:09 UTC
  • Revision ID: james.westby@ubuntu.com-20081017144309-jb7uzfi1y1lvez8j
Tags: upstream-2.4.2
ImportĀ upstreamĀ versionĀ 2.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __strtoval_h__
 
2
#define __strtoval_h__
 
3
 
 
4
#include "comphack.h"
 
5
#include "engine.h"
 
6
 
 
7
   
 
8
#ifdef __cplusplus
 
9
extern "C" {
 
10
#endif
 
11
 
 
12
/* Begin enum declarations */
 
13
 
 
14
typedef enum Range_Enum
 
15
{
 
16
  _180_180,
 
17
  _0_360
 
18
} Range;
 
19
 
 
20
/* SVC_Status is the status-reporting code used by functions in this module. */
 
21
 
 
22
typedef enum String_to_Value_Conversion_Status
 
23
{
 
24
   /* Success */
 
25
   SVC_Success = 0,
 
26
 
 
27
      /* String_to_<Type> and errors */
 
28
      SVC_String_to_Long = -1,
 
29
      SVC_String_to_Double = -2,
 
30
 
 
31
      /* String_to_Longitude errors */
 
32
      SVC_Degrees_out_of_Bounds = -11,
 
33
      SVC_Minutes_out_of_Bounds = -12,
 
34
      SVC_Seconds_out_of_Bounds = -13,
 
35
      SVC_Minutes_or_Seconds_Overflow = -14,
 
36
      SVC_Inappropriate_Hemisphere = -15,
 
37
      SVC_Sign_and_Hemisphere = -16,
 
38
      SVC_Misplaced_Hemisphere = -17,
 
39
 
 
40
      /* <Degrees>_to_String errors */
 
41
 
 
42
      SVC_DMS_to_String = -21,
 
43
      SVC_DM_to_String = -22,
 
44
      SVC_D_to_String = -23,
 
45
 
 
46
      /* <Parameter>_to_String errors */
 
47
 
 
48
      SVC_Easting_to_String = -31,
 
49
      SVC_Northing_to_String = -32,
 
50
      SVC_False_Easting_to_String = -33,
 
51
      SVC_False_Northing_to_String = -34,
 
52
      SVC_Central_Meridian_to_String = -35,
 
53
      SVC_Standard_Parallel_to_String = -36,
 
54
      SVC_Standard_Parallel_Two_to_String = -37,
 
55
      SVC_Zone_to_String = -38,
 
56
      SVC_Ellipsoidal_Height_to_String = -39,
 
57
      SVC_Origin_Latitude_to_String = -40,
 
58
      SVC_Scale_Factor_to_String = -41,
 
59
      SVC_X_to_String = -42,
 
60
      SVC_Y_to_String = -43,
 
61
      SVC_Z_to_String = -44,
 
62
      SVC_Meter_to_String = -45,
 
63
 
 
64
      /* Parameter Specific errors */
 
65
 
 
66
      SVC_Zone_out_of_Bounds = -71,
 
67
      SVC_Scale_Factor_out_of_Bounds = -72,
 
68
 
 
69
      /* Projection Specific errors */
 
70
      SVC_Invalid_Projection_String = -81,
 
71
      SVC_Invalid_Projection_Value = -82,
 
72
 
 
73
   /* General error */
 
74
   SVC_Error = -1000
 
75
 
 
76
} SVC_Status;
 
77
 
 
78
/* End enum declarations */
 
79
 
 
80
/********/
 
81
 
 
82
/* Begin function declarations */
 
83
void Show_Leading_Zeros(int lz);
 
84
 
 
85
void Set_Separator(char sep);
 
86
 
 
87
void Set_Long_Range(Range range);
 
88
 
 
89
char Get_Separator();
 
90
 
 
91
Range Get_Long_Range();                                                
 
92
 
 
93
void Set_Lat_Long_Precision(long precis);
 
94
 
 
95
void Degrees_to_String(double degrees, char *str, boole use_Minutes, boole use_Seconds, long Type);
 
96
 
 
97
SVC_Status String_to_Projection(const char *str, Coordinate_Type *val);
 
98
SVC_Status Projection_to_String(const Coordinate_Type val, char str[32]);
 
99
 
 
100
SVC_Status String_to_Double(const char *str, double *val);
 
101
 
 
102
long Valid_Number(const char *str);
 
103
 
 
104
SVC_Status Meter_to_String(const double meters, char str[15]);
 
105
 
 
106
SVC_Status Long_Meter_to_String(const double meters, char str[15]);
 
107
 
 
108
SVC_Status String_to_Long(const char *str, long *val);
 
109
 
 
110
SVC_Status String_to_Longitude(const char *str, double *longitude);
 
111
 
 
112
/* Force usage of fixed length strings to alleviate checkless C. */
 
113
SVC_Status Longitude_to_String(const double longitude, char str[15], boole use_NSEW,  
 
114
                         boole use_Minutes, boole use_Seconds);
 
115
 
 
116
SVC_Status String_to_Latitude(const char *str, double *latitude);
 
117
SVC_Status Latitude_to_String(const double latitude, char str[14], boole use_NSEW, 
 
118
                        boole use_Minutes, boole use_Seconds);
 
119
 
 
120
SVC_Status Zone_to_String(const long zone, char str[3]);
 
121
 
 
122
SVC_Status Ellipsoidal_Height_to_String(const double ellipsoidal_Height, char str[15]);
 
123
 
 
124
SVC_Status Scale_Factor_to_String(const double scale_Factor, char str[8]);
 
125
 
 
126
void Error_Prefix ( const Input_or_Output Direction,
 
127
  const Coordinate_Type System, char *Separator, char *String);
 
128
 
 
129
void Error_Append ( char *New_String, char *Separator, char *String);
 
130
 
 
131
#ifdef __cplusplus
 
132
}
 
133
#endif
 
134
 
 
135
#endif