source: subversion/applications/utils/export/osm2pgsql-intarray/keyvals.h @ 28719

Last change on this file since 28719 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
Line 
1/* Common key-value list processing
2 *
3 * Used as a small general purpose store for
4 * tags, segment lists etc
5 *
6 */
7
8#ifndef KEYVAL_H
9#define KEYVAL_H
10
11struct keyval {
12    char *key;
13    char *value;
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;
19    struct keyval *next;
20    struct keyval *prev;
21};
22
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);
28struct keyval *getTag(struct keyval *head, const char *name);
29void removeTag(struct keyval *tag);
30struct keyval *firstItem(struct keyval *head);
31struct keyval *nextItem(struct keyval *head, struct keyval *item);
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);
36struct keyval *getMatches(struct keyval *head, const char *name);
37void updateItem(struct keyval *head, const char *name, const char *value);
38void cloneList( struct keyval *target, struct keyval *source );
39void keyval2hstore(char *hstring, struct keyval *tags);
40void keyval2hstore_manual(char *hstring, char *key, char *value);
41#endif
Note: See TracBrowser for help on using the repository browser.