Root/
| 1 | /* |
| 2 | * chr.h - Part characteristics |
| 3 | * |
| 4 | * Copyright 2012 by Werner Almesberger |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | */ |
| 11 | |
| 12 | |
| 13 | #ifndef CHR_H |
| 14 | #define CHR_H |
| 15 | |
| 16 | #include <stdio.h> |
| 17 | |
| 18 | #include "param.h" |
| 19 | |
| 20 | |
| 21 | struct field; |
| 22 | |
| 23 | struct action { |
| 24 | struct field *fields; |
| 25 | struct field *rules; |
| 26 | }; |
| 27 | |
| 28 | struct condition { |
| 29 | struct value value; |
| 30 | enum relop relop; |
| 31 | struct condition *next; |
| 32 | }; |
| 33 | |
| 34 | struct selector { |
| 35 | struct condition *cond; |
| 36 | struct action act; |
| 37 | struct selector *next; |
| 38 | }; |
| 39 | |
| 40 | struct field { |
| 41 | const char *name; |
| 42 | const struct format *fmt; |
| 43 | struct selector *sel; |
| 44 | struct action any; |
| 45 | struct field *next; |
| 46 | const struct field *prev; |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | const struct format *field_find(const char *name, const struct field *tail); |
| 51 | struct field *new_field(const char *name, const struct format *fmt, |
| 52 | const struct field *prev); |
| 53 | struct selector *new_selector(void); |
| 54 | struct condition *new_condition(enum relop relop, const char *word); |
| 55 | void field_finalize(struct field *field); |
| 56 | void fields_dump(FILE *file, const struct field *field); |
| 57 | void rules_dump(FILE *file, const struct field *field); |
| 58 | |
| 59 | #endif /* !CHR_H */ |
| 60 |
Branches:
master
