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

Last change on this file since 21054 was 20775, checked in by giggls, 10 years ago

change "char sql[2048]" to "static char *sql" and do dynamic allocation

the reason is, that hstore rows can get really long,

thus dynamic allocation prevents them to get cut and (hopefully)
also prevents likely buffer overflows as well.

File size: 1.0 KB
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;
14    struct keyval *next;
15    struct keyval *prev;
18void initList(struct keyval *head);
19void freeItem(struct keyval *p);
20unsigned int countList(struct keyval *head);
21int listHasData(struct keyval *head);
22char *getItem(struct keyval *head, const char *name);
23struct keyval *firstItem(struct keyval *head);
24struct keyval *nextItem(struct keyval *head, struct keyval *item);
25struct keyval *popItem(struct keyval *head);
26void pushItem(struct keyval *head, struct keyval *item);
27int addItem(struct keyval *head, const char *name, const char *value, int noDupe);
28void resetList(struct keyval *head);
29struct keyval *getMatches(struct keyval *head, const char *name);
30void updateItem(struct keyval *head, const char *name, const char *value);
31void cloneList( struct keyval *target, struct keyval *source );
32void keyval2hstore(char *hstring, struct keyval *tags);
Note: See TracBrowser for help on using the repository browser.