2016-07-22 06:04:42 +03:00
|
|
|
/*
|
|
|
|
* lib.h - Parse Eeschema .lib 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2016-07-22 05:54:32 +03:00
|
|
|
#ifndef LIB_H
|
|
|
|
#define LIB_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
|
|
|
enum lib_state {
|
|
|
|
lib_skip, /* before a definition */
|
|
|
|
lib_def, /* in definition */
|
|
|
|
lib_draw, /* in drawings */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct lib_ctx {
|
|
|
|
enum lib_state state;
|
|
|
|
unsigned lineno;
|
|
|
|
};
|
|
|
|
|
2016-07-24 04:52:15 +03:00
|
|
|
struct comp;
|
2016-07-22 05:54:32 +03:00
|
|
|
|
2016-07-24 04:52:15 +03:00
|
|
|
|
|
|
|
const struct comp *lib_find(const char *name);
|
|
|
|
bool lib_field_visible(const struct comp *comp, int n);
|
|
|
|
void lib_exec(const struct comp *comp, unsigned unit, int m[6]);
|
2016-07-22 05:54:32 +03:00
|
|
|
|
|
|
|
bool lib_parse(struct lib_ctx *ctx, const char *line);
|
|
|
|
void lib_init(struct lib_ctx *ctx);
|
|
|
|
|
|
|
|
#endif /* !LIB_H */
|