source: subversion/applications/utils/export/osm2pgsql/keyvals.h @ 25786

Last change on this file since 25786 was 25786, checked in by giggls, 9 years ago

Fix bug in hstore rework.

Bad idea to remove the k/v pairs from the linked list after
writing their colum, as write_wkts is called more than once.

So flag them to have their own column.

Afterwords check this flag to see if a given
k/v pair should be written to the hstore or not.

File size: 1.4 KB
[2309]1/* Common key-value list processing
2 *
3 * Used as a small general purpose store for
4 * tags, segment lists etc
5 *
6 */
8#ifndef KEYVAL_H
9#define KEYVAL_H
11struct keyval {
12    char *key;
13    char *value;
[25786]14    /* if a hstore column is requested we need a flag to store if a key
15       has its own column because it should not be added to the hstore
16       in this case
17    */
18    int has_column;
[2309]19    struct keyval *next;
20    struct keyval *prev;
23void initList(struct keyval *head);
24void freeItem(struct keyval *p);
25unsigned int countList(struct keyval *head);
26int listHasData(struct keyval *head);
27char *getItem(struct keyval *head, const char *name);
[25689]28struct keyval *getTag(struct keyval *head, const char *name);
29void removeTag(struct keyval *tag);
[14843]30struct keyval *firstItem(struct keyval *head);
31struct keyval *nextItem(struct keyval *head, struct keyval *item);
[2309]32struct keyval *popItem(struct keyval *head);
33void pushItem(struct keyval *head, struct keyval *item);
34int addItem(struct keyval *head, const char *name, const char *value, int noDupe);
35void resetList(struct keyval *head);
[3826]36struct keyval *getMatches(struct keyval *head, const char *name);
37void updateItem(struct keyval *head, const char *name, const char *value);
[7331]38void cloneList( struct keyval *target, struct keyval *source );
[24099]39void keyval2hstore(char *hstring, struct keyval *tags);
[22371]40void keyval2hstore_manual(char *hstring, char *key, char *value);
Note: See TracBrowser for help on using the repository browser.