mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-23 06:37:13 +02:00
eeshow/lib-parse.c (lib_parse_file): separate "core" from lib_parse
This commit is contained in:
parent
4a2177e041
commit
ab613fcc86
@ -258,15 +258,22 @@ static bool lib_parse_line(const struct file *file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool lib_parse_file(struct lib *lib, struct file *file)
|
||||||
|
{
|
||||||
|
lib->state = lib_skip;
|
||||||
|
return file_read(file, lib_parse_line, lib);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool lib_parse(struct lib *lib, const char *name, const struct file *related)
|
bool lib_parse(struct lib *lib, const char *name, const struct file *related)
|
||||||
{
|
{
|
||||||
struct file file;
|
struct file file;
|
||||||
bool res;
|
bool res;
|
||||||
|
|
||||||
lib->state = lib_skip;
|
|
||||||
if (!file_open(&file, name, related))
|
if (!file_open(&file, name, related))
|
||||||
return 0;
|
return 0;
|
||||||
res = file_read(&file, lib_parse_line, lib);
|
res = lib_parse_file(lib, &file);
|
||||||
file_close(&file);
|
file_close(&file);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -119,6 +119,7 @@ const struct comp *lib_find(const struct lib *lib, const char *name);
|
|||||||
bool lib_field_visible(const struct comp *comp, int n);
|
bool lib_field_visible(const struct comp *comp, int n);
|
||||||
void lib_render(const struct comp *comp, unsigned unit, const int m[6]);
|
void lib_render(const struct comp *comp, unsigned unit, const int m[6]);
|
||||||
|
|
||||||
|
bool lib_parse_file(struct lib *lib, struct file *file);
|
||||||
bool lib_parse(struct lib *lib, const char *name, const struct file *related);
|
bool lib_parse(struct lib *lib, const char *name, const struct file *related);
|
||||||
void lib_init(struct lib *lib);
|
void lib_init(struct lib *lib);
|
||||||
void lib_free(struct lib *lib);
|
void lib_free(struct lib *lib);
|
||||||
|
Loading…
Reference in New Issue
Block a user