/*
- * Copyright (c) 1982 Regents of the University of California
- * @(#)asscan.h 4.4 %G%
+ * Copyright (c) 1982 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ * @(#)asscan.h 5.1 (Berkeley) %G%
*/
+
/*
* The character scanner is called to fill up one token buffer
*
* following tokens.
*/
-#define TOKBUFLG BUFSIZ
+#define TOKBUFLG 4096
#define MAXVAX 32
#define SAFETY 16
typedef char bytetoktype;
typedef char *ptrall; /*all uses will be type cast*/
-typedef short lgtype; /*for storing length of strings or skiping*/
+typedef u_short lgtype; /*for storing length of strings or skiping*/
/*
* defintions for putting various typed values
* into the intermediate buffers
#define puchar(ptr,val) *ptr++ = val
#define pshort(ptr,val) *(short *)ptr=val, ptr += sizeof(short)
+#define plgtype(ptr,val) *(lgtype *)ptr=val, ptr += sizeof(lgtype)
#define pushort(ptr,val) *(u_short *)ptr=val, ptr += sizeof(short)
#define pint(ptr,val) *(int *)ptr = val, ptr += sizeof(int)
#define puint(ptr,val) *(u_int int *)ptr=val, ptr += sizeof(int)
#define pptr(ptr,val) *(int *)ptr = (val), ptr += sizeof(ptrall)
#define ptoken(ptr,val) *ptr++ = val
-#define pstrlg(ptr,val) *(lgtype *)ptr = val, ptr += sizeof(short)
#define pskiplg(ptr,val) *(lgtype *)ptr = val, ptr += sizeof(short)
#define gchar(val, ptr) val = *ptr++
#define guchar(val, ptr) val = *ptr++
#define gshort(val, ptr) val = *(short *)ptr , ptr += sizeof (short)
+#define glgtype(val, ptr) val = *(lgtype *)ptr , ptr += sizeof (lgtype)
#define gushort(val, ptr) val = *(u_short *)ptr , ptr += sizeof (short)
#define gint(val, ptr) val = *(int *)ptr, ptr += sizeof (int)
#define guint(val, ptr) val = *(u_int *)ptr, ptr += sizeof (int)
#define gptr(val, ptr) val = *(int *)ptr, ptr += sizeof (ptrall)
#define gtoken(val, ptr) val = *ptr++
-#define gstrlg(val, ptr) val = *(lgtype *)ptr, ptr += sizeof (short)
#define gskiplg(val, ptr) val = *(lgtype *)ptr, ptr += sizeof (short)
-
extern ptrall tokptr; /*the next token to consume, call by copy*/
extern ptrall tokub; /*current upper bound in the current buffer*/
-
-/*
- * Strings are known for their characters and for their length.
- * We cannot use a normal zero termination byte, because strings
- * can contain anything.
- *
- * We have two "strings", so that an input string that is too long can be
- * split across two string buffers, and not confuse the yacc grammar.
- * (This is probably superflous)
- *
- * We have a third string of nulls so that the .skip can be
- * handled in the same way as strings.
- */
-#define MAXSTRLG 127
-
-struct strdesc{
- char str_lg;
- char str[MAXSTRLG];
-};
-
-extern struct strdesc strbuf[3];
-extern struct strdesc *strptr; /*points to the current string*/
-extern int strno; /*the current string being filled*/
-char *savestr();