mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-02 19:42:28 +02:00
46 lines
824 B
C
46 lines
824 B
C
#ifndef SCH_H
|
|
#define SCH_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
enum sch_state {
|
|
sch_basic, /* basic state */
|
|
sch_descr, /* prelude and description */
|
|
sch_comp, /* component */
|
|
sch_sheet, /* sub-sheet */
|
|
sch_text, /* text or label */
|
|
sch_wire, /* wire */
|
|
};
|
|
|
|
struct sch_ctx {
|
|
enum sch_state state;
|
|
void (*wire)(int sx, int sy, int ex, int ey);
|
|
|
|
/* text and component */
|
|
|
|
int x, y; /* saved coordinates */
|
|
|
|
/* text */
|
|
|
|
void (*text)(int x, int y, const char *s, int dir, int dim,
|
|
enum fig_shape shape);
|
|
int dir; /* orientation */
|
|
int dim; /* dimension */
|
|
enum fig_shape shape;
|
|
|
|
/* component */
|
|
|
|
char *comp; /* current component */
|
|
unsigned unit; /* unit of current component */
|
|
|
|
|
|
unsigned lineno;
|
|
};
|
|
|
|
|
|
bool sch_parse(struct sch_ctx *ctx, const char *line);
|
|
void sch_init(struct sch_ctx *ctx);
|
|
|
|
#endif /* !SCH_H */
|