summaryrefslogtreecommitdiff
path: root/src/include/keytab.h
blob: 7e156430f996175b3d3d7e9ab2c104490a60cd40 (plain)
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
#ifndef KEYTAB_H
#define KEYTAB_H

#define TABLEN 1024

union value {
  char *str;
  double num;
  unsigned int b : 1;
};

struct keytab {
  char *key;
  int flag;
  union value v;
};

struct keytablist {
  struct keytab tab[TABLEN];
};

int *getkeys(struct keytablist *list, int id);
struct keytab getkey(struct keytablist *list, int id, char *key);
void setkey(struct keytablist **list, int *len, int id, char *pair);
void delkey(struct keytablist *list, int id, char *key);

#endif