Make possible to #include <object.h>.
This header declares functions in libobject. Our programs never included object.h, but called functions in libobject without declaring them. So, our build system never put object.h in the include path; any #include <object.h> would fail to find the header. With this commit, a program may #include <object.h> if it has modules/src/object+lib in its deps. Declare structs in object.h so we can use them in prototypes without gcc warning, "'struct whatever' declared inside parameter list". Remove inclusion of ansi.h from object.h. Programs would need to depend on modules+headers to get ansi.h in the include path.
This commit is contained in:
parent
88c2ea63aa
commit
19310d2521
|
@ -1,6 +1,7 @@
|
||||||
clibrary {
|
clibrary {
|
||||||
name = "lib",
|
name = "lib",
|
||||||
srcs = { "./*.c" },
|
srcs = { "./*.c" },
|
||||||
|
hdrs = { "./object.h" },
|
||||||
deps = {
|
deps = {
|
||||||
"modules+headers",
|
"modules+headers",
|
||||||
"h+local",
|
"h+local",
|
||||||
|
|
|
@ -4,42 +4,46 @@
|
||||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ansi.h>
|
|
||||||
|
|
||||||
#ifndef __OBJECT_INCLUDED__
|
#ifndef __OBJECT_INCLUDED__
|
||||||
#define __OBJECT_INCLUDED__
|
#define __OBJECT_INCLUDED__
|
||||||
|
|
||||||
_PROTOTYPE(int wr_open, (char *f));
|
struct ar_hdr;
|
||||||
_PROTOTYPE(void wr_close, (void));
|
struct outhead;
|
||||||
_PROTOTYPE(void wr_ohead, (struct outhead *h));
|
struct outrelo;
|
||||||
_PROTOTYPE(void wr_sect, (struct outsect *s, unsigned int c));
|
struct outsect;
|
||||||
_PROTOTYPE(void wr_outsect, (int sectno));
|
struct ranlib;
|
||||||
_PROTOTYPE(void wr_emit, (char *b, long c));
|
|
||||||
_PROTOTYPE(void wr_putc, (int c));
|
int wr_open(char *f);
|
||||||
_PROTOTYPE(void wr_relo, (struct outrelo *r, unsigned int c));
|
void wr_close(void);
|
||||||
_PROTOTYPE(void wr_name, (struct outname *n, unsigned int c));
|
void wr_ohead(struct outhead *h);
|
||||||
_PROTOTYPE(void wr_string, (char *s, long c));
|
void wr_sect(struct outsect *s, unsigned int c);
|
||||||
_PROTOTYPE(void wr_arhdr, (int fd, struct ar_hdr *a));
|
void wr_outsect(int sectno);
|
||||||
_PROTOTYPE(void wr_ranlib, (int fd, struct ranlib *r, long cnt));
|
void wr_emit(char *b, long c);
|
||||||
_PROTOTYPE(void wr_int2, (int fd, int i));
|
void wr_putc(int c);
|
||||||
_PROTOTYPE(void wr_long, (int fd, long l));
|
void wr_relo(struct outrelo *r, unsigned int c);
|
||||||
_PROTOTYPE(void wr_bytes, (int fd, char *buf, long l));
|
void wr_name(struct outname *n, unsigned int c);
|
||||||
_PROTOTYPE(int rd_open, (char *f));
|
void wr_string(char *s, long c);
|
||||||
_PROTOTYPE(int rd_fdopen, (int f));
|
void wr_arhdr(int fd, struct ar_hdr *a);
|
||||||
_PROTOTYPE(void rd_close, (void));
|
void wr_ranlib(int fd, struct ranlib *r, long cnt);
|
||||||
_PROTOTYPE(void rd_ohead, (struct outhead *h));
|
void wr_int2(int fd, int i);
|
||||||
_PROTOTYPE(void rd_sect, (struct outsect *s, unsigned int c));
|
void wr_long(int fd, long l);
|
||||||
_PROTOTYPE(void rd_outsect, (int sectno));
|
void wr_bytes(int fd, char *buf, long l);
|
||||||
_PROTOTYPE(void rd_emit, (char *b, long c));
|
int rd_open(char *f);
|
||||||
_PROTOTYPE(void rd_relo, (struct outrelo *r, unsigned int c));
|
int rd_fdopen(int f);
|
||||||
_PROTOTYPE(void rd_rew_relo, (struct outhead *head));
|
void rd_close(void);
|
||||||
_PROTOTYPE(void rd_name, (struct outname *n, unsigned int c));
|
void rd_ohead(struct outhead *h);
|
||||||
_PROTOTYPE(void rd_string, (char *s, long c));
|
void rd_sect(struct outsect *s, unsigned int c);
|
||||||
_PROTOTYPE(int rd_arhdr, (int fd, struct ar_hdr *a));
|
void rd_outsect(int sectno);
|
||||||
_PROTOTYPE(void rd_ranlib, (int fd, struct ranlib *r, long cnt));
|
void rd_emit(char *b, long c);
|
||||||
_PROTOTYPE(int rd_int2, (int fd));
|
void rd_relo(struct outrelo *r, unsigned int c);
|
||||||
_PROTOTYPE(long rd_long, (int fd));
|
void rd_rew_relo(struct outhead *head);
|
||||||
_PROTOTYPE(void rd_bytes, (int fd, char *buf, long l));
|
void rd_name(struct outname *n, unsigned int c);
|
||||||
_PROTOTYPE(int rd_fd, (void));
|
void rd_string(char *s, long c);
|
||||||
|
int rd_arhdr(int fd, struct ar_hdr *a);
|
||||||
|
void rd_ranlib(int fd, struct ranlib *r, long cnt);
|
||||||
|
int rd_int2(int fd);
|
||||||
|
long rd_long(int fd);
|
||||||
|
void rd_bytes(int fd, char *buf, long l);
|
||||||
|
int rd_fd(void);
|
||||||
|
|
||||||
#endif /* __OBJECT_INCLUDED__ */
|
#endif /* __OBJECT_INCLUDED__ */
|
||||||
|
|
Loading…
Reference in a new issue