struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / sdas / linksrc / lklibr.h
blob21f21264309e25286b899f0d9abb3a1399999f45
1 /* lklibr.h
3 Copyright (C) 1989-1995 Alan R. Baldwin
4 721 Berkeley St., Kent, Ohio 44240
5 Copyright (C) 2008 Borut Razem, borut dot razem at siol dot net
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3, or (at your option) any
10 later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 * With contributions for the
22 * object libraries from
23 * Ken Hornstein
24 * kenh@cmf.nrl.navy.mil
29 * Extensions: P. Felber
32 #ifndef __LKLIBR_H
33 #define __LKLIBR_H
35 #include <stdio.h>
37 #ifdef INDEXLIB
38 typedef struct slibrarysymbol mlibrarysymbol;
39 typedef struct slibrarysymbol *pmlibrarysymbol;
41 struct slibrarysymbol
43 char *name; /* Warning: allocate memory before using */
44 pmlibrarysymbol next;
47 typedef struct slibraryfile mlibraryfile;
48 typedef struct slibraryfile *pmlibraryfile;
50 struct slibraryfile
52 int loaded;
53 char *libspc;
54 char *relfil; /* Warning: allocate memory before using */
55 char *filspc; /* Warning: allocate memory before using */
56 long offset; /* The embedded file offset in the library file libspc */
57 unsigned int type;
58 pmlibrarysymbol symbols;
59 pmlibraryfile next;
62 extern pmlibraryfile libr;
64 pmlibrarysymbol add_rel_index (FILE * fp, long size, pmlibraryfile This);
65 #else
66 int is_module_loaded (const char *filspc);
67 int add_rel_file (const char *name, struct lbname *lbnh, const char *relfil,
68 const char *filspc, int offset, FILE * fp, long size, int type);
69 #endif
71 struct aslib_target
73 int (*is_lib) (FILE * libfp);
74 #ifdef INDEXLIB
75 pmlibraryfile (*buildlibraryindex) (struct lbname * lbnh, FILE * libfp, pmlibraryfile This, int type);
76 #else
77 int (*fndsym) (const char *name, struct lbname * lbnh, FILE * libfp, int type);
78 #endif
79 void (*loadfile) (struct lbfile * lbfh);
82 extern struct aslib_target aslib_target_sdcclib;
83 extern struct aslib_target aslib_target_ar;
84 extern struct aslib_target aslib_target_lib;
86 ////
87 //#define DEBUG_PRINT
89 #ifdef DEBUG_PRINT
90 # define D printf
91 #else
92 # define D 1 ? (void)0 : (*(void (*)(const char *, ...))0)
93 #endif
95 #endif /* __LKLIBR_H */