Imported Upstream version 1.5
[routino] / src / types.c
index 3670992..22183db 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/types.c,v 1.3 2010/05/27 17:25:23 amb Exp $
+ $Header: /home/amb/routino/src/RCS/types.c,v 1.6 2010/09/17 17:43:41 amb Exp $
 
  Functions for handling the data types.
 
@@ -43,6 +43,10 @@ Highway HighwayType(const char *highway)
     if(!strcmp(highway,"cycleway")) return(Way_Cycleway);
     return(Way_Count);
 
+   case 'f':
+    if(!strcmp(highway,"ferry")) return(Way_Ferry);
+    return(Way_Count);
+
    case 'm':
     if(!strcmp(highway,"motorway")) return(Way_Motorway);
     return(Way_Count);
@@ -154,10 +158,18 @@ Property PropertyType(const char *property)
  switch(*property)
    {
    case 'b':
+    if(!strcmp(property,"bicycleroute"))
+       return(Property_BicycleRoute);
+
     if(!strcmp(property,"bridge"))
        return(Property_Bridge);
     break;
 
+   case 'f':
+    if(!strcmp(property,"footroute"))
+       return(Property_FootRoute);
+    break;
+
    case 'm':
     if(!strcmp(property,"multilane"))
        return(Property_Multilane);
@@ -217,6 +229,8 @@ const char *HighwayName(Highway highway)
     return("path");
    case Way_Steps:
     return("steps");
+   case Way_Ferry:
+    return("ferry");
 
    case Way_Count:
     ;
@@ -301,6 +315,12 @@ const char *PropertyName(Property property)
    case Property_Tunnel:
     return("tunnel");
 
+   case Property_FootRoute:
+    return("footroute");
+
+   case Property_BicycleRoute:
+    return("bicycleroute");
+
    case Property_Count:
     ;
   }
@@ -314,10 +334,10 @@ const char *PropertyName(Property property)
 
   const char *AllowedNameList Returns the list of names.
 
-  wayallow_t allowed The allowed type.
+  allow_t allowed The allowed type.
   ++++++++++++++++++++++++++++++++++++++*/
 
-const char *AllowedNameList(wayallow_t allowed)
+const char *AllowedNameList(allow_t allowed)
 {
  static char string[256];
 
@@ -422,6 +442,18 @@ const char *PropertiesNameList(wayprop_t properties)
     strcat(string,"tunnel");
    }
 
+ if(properties & Properties_FootRoute)
+   {
+    if(*string) strcat(string,", ");
+    strcat(string,"footroute");
+   }
+
+ if(properties & Properties_BicycleRoute)
+   {
+    if(*string) strcat(string,", ");
+    strcat(string,"bicycleroute");
+   }
+
  return(string);
 }
 
@@ -446,6 +478,7 @@ const char *HighwayList(void)
         "    cycleway     = Cycleway\n"
         "    path         = Path\n"
         "    steps        = Steps\n"
+        "    ferry        = Ferry\n"
         ;
 }
 
@@ -480,9 +513,11 @@ const char *TransportList(void)
 
 const char *PropertyList(void)
 {
- return "    paved     = Paved (suitable for normal wheels)\n"
-        "    multilane = Multiple lanes\n"
-        "    bridge    = Bridge\n"
-        "    Tunnel    = Tunnel\n"
+ return "    paved        = Paved (suitable for normal wheels)\n"
+        "    multilane    = Multiple lanes\n"
+        "    bridge       = Bridge\n"
+        "    tunnel       = Tunnel\n"
+        "    footroute    = A route marked for foot travel\n"
+        "    bicycleroute = A route marked for bicycle travel\n"
         ;
 }