Diff of /trunk/src/osm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 63 by harbaum, Fri Feb 6 12:06:30 2009 UTC revision 64 by harbaum, Mon Feb 9 13:23:17 2009 UTC
# Line 2191  void osm_node_attach(osm_t *osm, node_t Line 2191  void osm_node_attach(osm_t *osm, node_t
2191    *lnode = node;    *lnode = node;
2192  }  }
2193    
2194    void osm_node_restore(osm_t *osm, node_t *node) {
2195      printf("Restoring node\n");
2196    
2197      /* attach to end of node list */
2198      node_t **lnode = &osm->node;
2199      while(*lnode) lnode = &(*lnode)->next;
2200      *lnode = node;
2201    }
2202    
2203  way_t *osm_way_new(void) {  way_t *osm_way_new(void) {
2204    printf("Creating new way\n");    printf("Creating new way\n");
2205    
# Line 2627  char *osm_type_string(type_t type) { Line 2636  char *osm_type_string(type_t type) {
2636    return NULL;    return NULL;
2637  }  }
2638    
2639    char *osm_object_string(type_t type, void *object) {
2640      char *type_str = osm_type_string(type);
2641    
2642      if(!object)
2643        return g_strdup_printf("%s #<invalid>", type_str);
2644    
2645      switch(type) {
2646      case ILLEGAL:
2647        return g_strdup_printf("%s #<unspec>", type_str);
2648        break;
2649      case NODE:
2650        return g_strdup_printf("%s #%ld", type_str, ((node_t*)object)->id);
2651        break;
2652      case WAY:
2653        return g_strdup_printf("%s #%ld", type_str, ((way_t*)object)->id);
2654        break;
2655      case RELATION:
2656        return g_strdup_printf("%s #%ld", type_str, ((relation_t*)object)->id);
2657        break;
2658      case NODE_ID:
2659      case WAY_ID:
2660      case RELATION_ID:
2661        return g_strdup_printf("%s #%ld", type_str, *((item_id_t*)object));
2662        break;
2663      }
2664      return NULL;
2665    }
2666    
2667  // vim:et:ts=8:sw=2:sts=2:ai  // vim:et:ts=8:sw=2:sts=2:ai

Legend:
Removed from v.63  
changed lines
  Added in v.64