4.104.115
Line | |
---|
1 | /* |
---|
2 | * Copyright (c) 2006 Kolja Waschk rtemsdev/ixo.de |
---|
3 | * |
---|
4 | * The license and distribution terms for this file may be |
---|
5 | * found in the file LICENSE in this distribution or at |
---|
6 | * http://www.rtems.com/license/LICENSE. |
---|
7 | * |
---|
8 | * $Id$ |
---|
9 | */ |
---|
10 | |
---|
11 | #if !defined(__PTF_H) |
---|
12 | #define __PTF_H 1 |
---|
13 | |
---|
14 | #include <stdio.h> |
---|
15 | |
---|
16 | #define MAX_SECTION_NESTING 20 |
---|
17 | |
---|
18 | typedef enum |
---|
19 | { |
---|
20 | item, section |
---|
21 | } |
---|
22 | ptf_item_type; |
---|
23 | |
---|
24 | struct ptf |
---|
25 | { |
---|
26 | ptf_item_type type; |
---|
27 | char *name; |
---|
28 | char *value; |
---|
29 | struct ptf *sub; |
---|
30 | struct ptf *next; |
---|
31 | }; |
---|
32 | |
---|
33 | struct ptf_item |
---|
34 | { |
---|
35 | int level; |
---|
36 | struct ptf *item[MAX_SECTION_NESTING]; |
---|
37 | }; |
---|
38 | |
---|
39 | |
---|
40 | typedef void (*ptf_match_action)(struct ptf_item *x, void *arg); |
---|
41 | |
---|
42 | struct ptf *ptf_parse_file(char *filename); |
---|
43 | struct ptf *ptf_concat(struct ptf *a, struct ptf *b); |
---|
44 | struct ptf *ptf_alloc_item(ptf_item_type t, char *name, char *value); |
---|
45 | void ptf_printf(FILE *s, struct ptf *tree, char *prefix); |
---|
46 | void ptf_dump_ptf_item(FILE *s, struct ptf_item *pi); |
---|
47 | |
---|
48 | struct ptf *ptf_find( |
---|
49 | struct ptf *tree, |
---|
50 | struct ptf_item *item, |
---|
51 | ptf_item_type ttype, |
---|
52 | char *name, |
---|
53 | char *value); |
---|
54 | |
---|
55 | struct ptf *ptf_next( |
---|
56 | struct ptf_item *item, |
---|
57 | ptf_item_type ttype, |
---|
58 | char *name, |
---|
59 | char *value); |
---|
60 | |
---|
61 | int ptf_match( |
---|
62 | struct ptf *const ptf, |
---|
63 | struct ptf_item *const match, |
---|
64 | const ptf_match_action action, |
---|
65 | void *arg); |
---|
66 | |
---|
67 | char *ptf_defused_name(char *); |
---|
68 | |
---|
69 | |
---|
70 | #endif /* !defined(__PTF_H) */ |
---|
71 | |
---|
Note: See
TracBrowser
for help on using the repository browser.