/* * libs.h - Component or module libraries * * 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 LIBS_H #define LIBS_H struct name { const char *s; struct name *next; }; struct entry { struct name *names; int units; const struct file *file; struct entry *next; }; struct file { const char *path; struct entry *entries; struct file *next; }; struct lib { const char *ext; /* file extension, ".lib" or ".mod" */ void (*add_lib)(struct lib *lib, const char *path); struct file *files; }; extern struct lib comp_lib; const char *lookup_sym(const struct lib *lib, const char *name, const struct name **names, int *units); void add_name(struct entry *e, char *s); struct entry *new_entry(struct lib *lib, int units); void add_lib(struct lib *lib, const char *path); void add_libdir(struct lib *lib, const char *path); #endif /* !LIBS_H */