Root/genkicat/libs.h

1/*
2 * libs.h - Component or module libraries
3 *
4 * Copyright 2012 by Werner Almesberger
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef LIBS_H
13#define LIBS_H
14
15struct name {
16    const char *s;
17    struct name *next;
18};
19
20struct entry {
21    struct name *names;
22    int units;
23    const struct file *file;
24    struct entry *next;
25};
26
27struct file {
28    const char *path;
29    struct entry *entries;
30    const struct lib *lib;
31    struct file *next;
32};
33
34struct lib {
35    const char *ext; /* file extension, ".lib" or ".fpd" */
36    void (*add_lib)(struct lib *lib, const char *path);
37    void (*ps_entry)(FILE *file, const struct lib *lib,
38        const struct entry *e, int unit, int landscape);
39    struct file *files;
40};
41
42
43extern struct lib comp_lib;
44extern struct lib fped_lib;
45
46
47const struct entry *lookup_sym(const struct lib *lib, const char *name);
48void add_name(struct entry *e, char *s);
49struct entry *new_entry(struct lib *lib, int units);
50void add_lib(struct lib *lib, const char *path);
51void add_libdir(struct lib *lib, const char *path);
52
53#endif /* !LIBS_H */
54

Archive Download this file

Branches:
master



interactive