Diff of /trunk/src/osm.c

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

revision 73 by harbaum, Thu Feb 12 14:27:52 2009 UTC revision 75 by harbaum, Thu Feb 12 19:58:20 2009 UTC
# Line 2592  void osm_way_delete(osm_t *osm, icon_t * Line 2592  void osm_way_delete(osm_t *osm, icon_t *
2592    }    }
2593  }  }
2594    
2595    void osm_relation_delete(osm_t *osm, relation_t *relation,
2596                             gboolean permanently) {
2597    
2598      /* new relations aren't stored on the server and are just */
2599      /* deleted permanently */
2600      if(relation->flags & OSM_FLAG_NEW) {
2601        printf("About to delete NEW relation #%ld -> force permanent delete\n",
2602               relation->id);
2603        permanently = TRUE;
2604      }
2605    
2606      /* the deletion of a relation doesn't affect the members as they */
2607      /* don't have any reference to the relation they are part of */
2608    
2609      if(!permanently) {
2610        printf("mark relation #%ld as deleted\n", relation->id);
2611        relation->flags |= OSM_FLAG_DELETED;
2612      } else {
2613        printf("permanently delete relation #%ld\n", relation->id);
2614    
2615        /* remove it from the chain */
2616        relation_t **crelation = &osm->relation;
2617        int found = 0;
2618    
2619        while(*crelation) {
2620          if(*crelation == relation) {
2621            found++;
2622            *crelation = (*crelation)->next;
2623    
2624            osm_relation_free(relation);
2625          } else
2626            crelation = &((*crelation)->next);
2627        }
2628        g_assert(found == 1);
2629      }
2630    }
2631    
2632  void osm_way_revert(way_t *way) {  void osm_way_revert(way_t *way) {
2633    node_chain_t *new = NULL;    node_chain_t *new = NULL;
2634    

Legend:
Removed from v.73  
changed lines
  Added in v.75