1 /**************************************************************************** 2 * 3 * Open Watcom Project 4 * 5 * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. 6 * 7 * ======================================================================== 8 * 9 * This file contains Original Code and/or Modifications of Original 10 * Code as defined in and that are subject to the Sybase Open Watcom 11 * Public License version 1.0 (the 'License'). You may not use this file 12 * except in compliance with the License. BY USING THIS FILE YOU AGREE TO 13 * ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is 14 * provided with the Original Code and Modifications, and is also 15 * available at www.sybase.com/developer/opensource. 16 * 17 * The Original Code and all software distributed under the License are 18 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 19 * EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM 20 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF 21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR 22 * NON-INFRINGEMENT. Please see the License for the specific language 23 * governing rights and limitations under the License. 24 * 25 * ======================================================================== 26 * 27 * Description: prototypes for input queueing/processing procedures 28 * 29 ****************************************************************************/ 30 31 #ifndef _INPUT_H_INCLUDED 32 #define _INPUT_H_INCLUDED 33 34 struct macro_instance { 35 struct srcline *currline; 36 struct srcline *startline; 37 uint_32 localstart; 38 char * *parm_array; 39 struct asym *macro; 40 unsigned parmcnt; 41 }; 42 43 /* for line numbers, the source files have to be stored 44 * in a list in the very same order as they appear in 45 * the input stream. 46 */ 47 struct file_seq { 48 struct file_seq *next; 49 uint_16 file; /* index of file in FNames */ 50 }; 51 52 struct input_status { 53 char *token_stringbuf; 54 char *currsource; 55 char *CurrComment; 56 int token_count; 57 char line_flags;/* v2.08: added */ 58 #ifdef __I86__ 59 char *stringbufferend; 60 struct asm_tok *tokenarray; 61 #endif 62 }; 63 64 extern uint_32 GetLineNumber( void ); 65 //#define LineNumber GetLineNumber() 66 67 extern const char *GetFNamePart( const char *fname ); 68 extern char *GetExtPart( const char *fname ); 69 70 extern FILE *SearchFile( const char *path, bool ); 71 extern char *GetTextLine( char *buffer ); 72 extern void PushMacro( struct macro_instance * ); 73 extern void SetLineNumber( unsigned ); 74 #if FASTMEM==0 75 extern bool MacroInUse( struct dsym * ); 76 #endif 77 extern void AddStringToIncludePath( const char *string ); 78 extern void InputInit( void ); 79 extern void InputPassInit( void ); 80 extern void InputFini( void ); 81 extern struct asm_tok *PushInputStatus( struct input_status * ); 82 extern void PopInputStatus( struct input_status * ); 83 extern int GetCurrSrcPos( char * ); 84 extern void ClearSrcStack( void ); 85 extern unsigned get_curr_srcfile( void ); 86 #if FASTPASS 87 extern void set_curr_srcfile( unsigned, uint_32 ); 88 #endif 89 extern const struct fname_item *GetFName( unsigned ); 90 #ifdef DEBUG_OUT 91 extern char *GetTopLine( char * ); 92 extern char *GetTopSrcName( void ); 93 #endif 94 95 #define GetAlignedPointer( x, size ) ( x + ( ( size + 1 + sizeof(void *) - 1 ) & ~( sizeof(void *) - 1 ) ) ) 96 97 #endif 98