Diff of /trunk/src/osm.h

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

revision 155 by harbaum, Tue Mar 31 10:19:50 2009 UTC revision 161 by harbaum, Sat Apr 11 11:28:56 2009 UTC
# Line 29  Line 29 
29    
30  /* item_id_t needs to be signed as osm2go uses negative ids for items */  /* item_id_t needs to be signed as osm2go uses negative ids for items */
31  /* not yet registered with the main osm database */  /* not yet registered with the main osm database */
32  typedef glong item_id_t;  #if 1
33  #define G_TYPE_ITEM_ID_T G_TYPE_LONG  /* currently 31 bit is still sufficient since there are less than */
34    /* 2 billion nodes or changesets */
35    typedef gint32 item_id_t;
36    #define G_TYPE_ITEM_ID_T G_TYPE_INT
37    #define ITEM_ID_FORMAT  "%" G_GINT32_FORMAT
38    #else
39    /* the future may require us to switch to 64 bits */
40    typedef gint64 item_id_t;
41    #define G_TYPE_ITEM_ID_T G_TYPE_INT64
42    #define ITEM_ID_FORMAT  "%" G_GINT64_FORMAT
43    #endif
44    
45  #define ID_ILLEGAL  ((item_id_t)0)  #define ID_ILLEGAL  ((item_id_t)0)
46    
# Line 56  typedef struct tag_s { Line 66  typedef struct tag_s {
66    
67  typedef struct node_s {  typedef struct node_s {
68    item_id_t id;    item_id_t id;
69      item_id_t version;
70    pos_t pos;    pos_t pos;
71    lpos_t lpos;    lpos_t lpos;
72    user_t *user;    user_t *user;
# Line 85  typedef struct node_chain { Line 96  typedef struct node_chain {
96    
97  typedef struct way_s {  typedef struct way_s {
98    item_id_t id;    item_id_t id;
99      item_id_t version;
100      item_id_t changeset;
101    user_t *user;    user_t *user;
102    gboolean visible;    gboolean visible;
103    time_t time;    time_t time;
# Line 126  typedef struct way_chain { Line 139  typedef struct way_chain {
139    
140  typedef struct relation_s {  typedef struct relation_s {
141    item_id_t id;    item_id_t id;
142      item_id_t version;
143      item_id_t changeset;
144    user_t *user;    user_t *user;
145    gboolean visible;    gboolean visible;
146    time_t time;    time_t time;
# Line 148  typedef struct relation_chain_s { Line 163  typedef struct relation_chain_s {
163  /* the current hash table uses 16 bits. each table thus is */  /* the current hash table uses 16 bits. each table thus is */
164  /* 256 kbytes (2^16 * sizeof(void*)) in size */  /* 256 kbytes (2^16 * sizeof(void*)) in size */
165  #define ID2HASH(a) ((unsigned short)(a) ^ (unsigned short)((a)>>16))  #define ID2HASH(a) ((unsigned short)(a) ^ (unsigned short)((a)>>16))
   
166  typedef struct hash_item_s {  typedef struct hash_item_s {
167    union {    union {
168      node_t *node;      node_t *node;
# Line 238  gboolean osm_is_creator_tag(tag_t *tag); Line 252  gboolean osm_is_creator_tag(tag_t *tag);
252  gboolean osm_tag_key_and_value_present(tag_t *haystack, tag_t *tag);  gboolean osm_tag_key_and_value_present(tag_t *haystack, tag_t *tag);
253  gboolean osm_tag_key_other_value_present(tag_t *haystack, tag_t *tag);  gboolean osm_tag_key_other_value_present(tag_t *haystack, tag_t *tag);
254    
255  char *osm_generate_xml_node(osm_t *osm, node_t *node);  char *osm_generate_xml_changeset(osm_t *osm, char *comment);
256  char *osm_generate_xml_way(osm_t *osm, way_t *way);  char *osm_generate_xml_node(osm_t *osm, item_id_t changeset, node_t *node);
257  char *osm_generate_xml_relation(osm_t *osm, relation_t *relation);  char *osm_generate_xml_way(osm_t *osm, item_id_t changeset, way_t *way);
258    char *osm_generate_xml_relation(osm_t *osm, item_id_t changeset,
259                                    relation_t *relation);
260    
261  node_t *osm_get_node_by_id(osm_t *osm, item_id_t id);  node_t *osm_get_node_by_id(osm_t *osm, item_id_t id);
262  way_t *osm_get_way_by_id(osm_t *osm, item_id_t id);  way_t *osm_get_way_by_id(osm_t *osm, item_id_t id);

Legend:
Removed from v.155  
changed lines
  Added in v.161