Incorporated variable length identifiers.
Courtesy Johan Stevenson
This commit is contained in:
parent
7ac5028864
commit
d34532e79d
|
@ -187,9 +187,12 @@ offset *newrom() {
|
|||
return((offset *) newcore(MAXROM*sizeof(offset)));
|
||||
}
|
||||
|
||||
sym_p newsym() {
|
||||
|
||||
return((sym_p) newcore(sizeof(sym_t)));
|
||||
sym_p newsym(len) int len; {
|
||||
/*
|
||||
* sym_t includes a 2 character s_name at the end
|
||||
* extend this structure with len-2 characters
|
||||
*/
|
||||
return((sym_p) newcore(sizeof(sym_t) - 2 + len));
|
||||
}
|
||||
|
||||
argb_p newargb() {
|
||||
|
|
|
@ -37,6 +37,7 @@ unsigned hash(string) char *string; {
|
|||
|
||||
sym_p symlookup(name,status,flags) char *name; int status,flags; {
|
||||
register sym_p *spp,sp;
|
||||
register i;
|
||||
static short genfrag = 32767;
|
||||
|
||||
spp = &symhash[hash(name)%NSYMHASH];
|
||||
|
@ -58,8 +59,13 @@ sym_p symlookup(name,status,flags) char *name; int status,flags; {
|
|||
* symbol not found, enter in table
|
||||
*/
|
||||
|
||||
*spp = sp = newsym();
|
||||
strncpy(sp->s_name,name,IDL);
|
||||
i = strlen(name) + 1;
|
||||
if (i & 1)
|
||||
i++;
|
||||
if (i > IDL)
|
||||
i = IDL;
|
||||
*spp = sp = newsym(i);
|
||||
strncpy(sp->s_name,name,i);
|
||||
sp->s_flags = flags;
|
||||
if (status == DEFINING)
|
||||
sp->s_flags |= SYMDEF;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* $Header$ */
|
||||
|
||||
#define IDL 8
|
||||
#define IDL 100
|
||||
|
||||
struct sym {
|
||||
sym_p s_next;
|
||||
char s_name[IDL];
|
||||
offset *s_rom;
|
||||
short s_flags;
|
||||
short s_frag;
|
||||
offset s_value;
|
||||
char s_name[2]; /* to be extended up to IDL */
|
||||
};
|
||||
|
||||
/* contents of .s_flags */
|
||||
|
|
Loading…
Reference in a new issue