2012-07-12 04:27:22 +03:00
|
|
|
/*
|
|
|
|
* 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;
|
2012-07-12 04:45:40 +03:00
|
|
|
const struct file *file;
|
2012-07-12 04:27:22 +03:00
|
|
|
struct entry *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct file {
|
|
|
|
const char *path;
|
|
|
|
struct entry *entries;
|
2012-07-12 05:11:08 +03:00
|
|
|
const struct lib *lib;
|
2012-07-12 04:27:22 +03:00
|
|
|
struct file *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct lib {
|
2012-07-12 06:25:43 +03:00
|
|
|
const char *ext; /* file extension, ".lib" or ".fpd" */
|
2012-07-12 04:27:22 +03:00
|
|
|
void (*add_lib)(struct lib *lib, const char *path);
|
2012-07-12 05:16:03 +03:00
|
|
|
void (*ps_entry)(FILE *file, const struct lib *lib,
|
2012-07-12 08:41:42 +03:00
|
|
|
const struct entry *e, int unit, int landscape);
|
2012-07-12 04:27:22 +03:00
|
|
|
struct file *files;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern struct lib comp_lib;
|
2012-07-12 06:58:12 +03:00
|
|
|
extern struct lib fped_lib;
|
2012-07-12 04:27:22 +03:00
|
|
|
|
|
|
|
|
2012-07-12 04:54:07 +03:00
|
|
|
const struct entry *lookup_sym(const struct lib *lib, const char *name);
|
2012-07-12 04:27:22 +03:00
|
|
|
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 */
|