File: keyvals.h

package info (click to toggle)
osm2pgsql 0.52.20080408-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 348 kB
  • ctags: 440
  • sloc: ansic: 3,963; sh: 469; cpp: 339; makefile: 125
file content (30 lines) | stat: -rw-r--r-- 835 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Common key-value list processing
 *
 * Used as a small general purpose store for 
 * tags, segment lists etc 
 *
 */

#ifndef KEYVAL_H
#define KEYVAL_H

struct keyval {
    char *key;
    char *value;
    struct keyval *next;
    struct keyval *prev;
};

void initList(struct keyval *head);
void freeItem(struct keyval *p);
unsigned int countList(struct keyval *head);
int listHasData(struct keyval *head);
char *getItem(struct keyval *head, const char *name);
struct keyval *popItem(struct keyval *head);
void pushItem(struct keyval *head, struct keyval *item);
int addItem(struct keyval *head, const char *name, const char *value, int noDupe);
void resetList(struct keyval *head);
struct keyval *getMatches(struct keyval *head, const char *name);
void updateItem(struct keyval *head, const char *name, const char *value);

#endif