f09f14cd4d
Also move the declarations of `incore` and `core_alloc` to "memory.h". Also correct SYMDEBUG to SYMDBUG. (I don't know if SYMDBUG works because our build system never defines it.) ind_t becomes an alias of size_t. ind_t becomes unsigned, so I edit some code that was using negative ind_t. Some casts disappear, like (long)sizeof(...) because the size is already a size_t. There are changes to overflow checks. Callers with a size too big for size_t must check it before calling the memory allocator. An overflow check of BASE + incr in memory.c sbreak() now happens on all platforms, not only when a pointer is smaller than a long. My build shows no changes in share/ack/examples (except hilo_bas.* changing with every build).
29 lines
1 KiB
C
29 lines
1 KiB
C
/*
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
*/
|
|
/* $Id$ */
|
|
|
|
/*
|
|
* Offsets of the pieces of the input module in core.
|
|
*/
|
|
|
|
#define IND_HEAD ((ind_t)0)
|
|
#define IND_SECT(x) (IND_HEAD + sizeof(struct outhead))
|
|
#define IND_NAME(x) (IND_SECT(x) + (x).oh_nsect * sizeof(struct outsect))
|
|
#define IND_CHAR(x) (IND_NAME(x) + (x).oh_nname * sizeof(struct outname))
|
|
#ifdef SYMDBUG
|
|
#define OFF_DBUG(x) (OFF_CHAR(x) + (x).oh_nchar)
|
|
#endif /* SYMDBUG */
|
|
|
|
extern void seek(long pos);
|
|
extern void closefile(char* filename);
|
|
extern void get_archive_header(struct ar_hdr* archive_header);
|
|
extern void get_modul(void);
|
|
extern void skip_modul(struct outhead* head);
|
|
extern void startrelo(struct outhead* head);
|
|
extern struct outrelo* nextrelo(void);
|
|
extern char* getemit(struct outhead* head, struct outsect* sects, int sectindex);
|
|
extern char* getblk(long totalsz, long* pblksz, int sectindex);
|
|
extern void endemit(char* emit);
|