mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-08-25 07:30:14 +03:00
64 lines
1.3 KiB
C
64 lines
1.3 KiB
C
/*
|
|
* sch.h - Parse Eeschema .sch file
|
|
*
|
|
* Written 2016 by Werner Almesberger
|
|
* Copyright 2016 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 SCH_H
|
|
#define SCH_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "text.h"
|
|
#include "lib.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 */
|
|
|
|
const struct comp *comp; /* current component */
|
|
unsigned unit; /* unit of current component */
|
|
struct sch_field *fields;
|
|
|
|
unsigned lineno;
|
|
};
|
|
|
|
|
|
void decode_alignment(struct text *txt, char hor, char vert);
|
|
|
|
bool sch_parse(struct sch_ctx *ctx, const char *line);
|
|
void sch_init(struct sch_ctx *ctx);
|
|
|
|
#endif /* !SCH_H */
|