1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-10 22:38:25 +02:00
eda-tools/b2/chr.h
Werner Almesberger b6a4a80652 separate dumping of hierchy rules from dumping of fields
With only one function, top-level fields definitions were printed in
a style as if they were rules and not fields.
2012-05-30 11:53:58 -03:00

60 lines
1.3 KiB
C

/*
* chr.h - Part characteristics
*
* Copyright 2012 by Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef CHR_H
#define CHR_H
#include <stdio.h>
#include "param.h"
struct field;
struct action {
struct field *fields;
struct field *rules;
};
struct condition {
struct value value;
enum relop relop;
struct condition *next;
};
struct selector {
struct condition *cond;
struct action act;
struct selector *next;
};
struct field {
const char *name;
const struct format *fmt;
struct selector *sel;
struct action any;
struct field *next;
const struct field *prev;
};
const struct format *field_find(const char *name, const struct field *tail);
struct field *new_field(const char *name, const struct format *fmt,
const struct field *prev);
struct selector *new_selector(void);
struct condition *new_condition(enum relop relop, const char *word);
void field_finalize(struct field *field);
void fields_dump(FILE *file, const struct field *field);
void rules_dump(FILE *file, const struct field *field);
#endif /* !CHR_H */