diff options
-rw-r--r-- | bcc/proto.h | 3 | ||||
-rw-r--r-- | bcc/table.c | 18 | ||||
-rw-r--r-- | bcc/type.c | 8 |
3 files changed, 29 insertions, 0 deletions
diff --git a/bcc/proto.h b/bcc/proto.h index baee0c3..bffc42b 100644 --- a/bcc/proto.h +++ b/bcc/proto.h @@ -366,6 +366,9 @@ struct symstruct *findstrm P((struct typestruct *type, char *name)); /* type.c */ struct typestruct *addstruct P((char *structname)); +#ifndef VERY_SMALL_MEMORY +void laststruct P((char *sname)); +#endif struct typestruct *iscalartotype P((scalar_pt scalar)); struct typestruct *newtype P((void)); void outntypechar P((struct typestruct *type)); diff --git a/bcc/table.c b/bcc/table.c index e863fb5..ae34839 100644 --- a/bcc/table.c +++ b/bcc/table.c @@ -726,6 +726,24 @@ char *name; return symptr; } } + +#ifndef VERY_SMALL_MEMORY + /* In ancient UNIX, C structure members were global */ + if (!ancient) + return NULL; + + /* Find any structure member of given name */ + laststruct(name); + while (name[0]) { + if ((symptr = findlorg(name)) != NULL) + return symptr; + if (--name[1] == 0) { + name[1] = 255; + name[0]--; + } + } +#endif + return NULL; } #endif @@ -56,6 +56,14 @@ ts_s_structname += namelength + 1; return structype; } +#ifndef VERY_SMALL_MEMORY +PUBLIC void laststruct(char *sname) +{ + sname[0] = skey0; + sname[1] = skey1; +} +#endif + PUBLIC struct typestruct *iscalartotype(scalar) scalar_pt scalar; { |