blob: db4c184ae4f5ff802a54895cc8f634d1f0a029d4 [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001/****************************************************************************\
2Copyright (c) 2002, NVIDIA Corporation.
3
4NVIDIA Corporation("NVIDIA") supplies this software to you in
5consideration of your agreement to the following terms, and your use,
6installation, modification or redistribution of this NVIDIA software
7constitutes acceptance of these terms. If you do not agree with these
8terms, please do not use, install, modify or redistribute this NVIDIA
9software.
10
11In consideration of your agreement to abide by the following terms, and
12subject to these terms, NVIDIA grants you a personal, non-exclusive
13license, under NVIDIA's copyrights in this original NVIDIA software (the
14"NVIDIA Software"), to use, reproduce, modify and redistribute the
15NVIDIA Software, with or without modifications, in source and/or binary
16forms; provided that if you redistribute the NVIDIA Software, you must
17retain the copyright notice of NVIDIA, this notice and the following
18text and disclaimers in all such redistributions of the NVIDIA Software.
19Neither the name, trademarks, service marks nor logos of NVIDIA
20Corporation may be used to endorse or promote products derived from the
21NVIDIA Software without specific prior written permission from NVIDIA.
22Except as expressly stated in this notice, no other rights or licenses
23express or implied, are granted by NVIDIA herein, including but not
24limited to any patent rights that may be infringed by your derivative
25works or by other works in which the NVIDIA Software may be
26incorporated. No hardware is licensed hereunder.
27
28THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
29WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
30INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
31NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
32ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
33PRODUCTS.
34
35IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
36INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
37TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
38USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
39OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
40NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
41TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
42NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43\****************************************************************************/
44//
45// cpp.h
46//
47
48#if !defined(__CPP_H)
49#define __CPP_H 1
50
daniel@transgaming.come6842292010-04-20 18:52:50 +000051#include "compiler/preprocessor/parser.h"
52#include "compiler/preprocessor/tokens.h"
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000053
54int InitCPP(void);
55int FinalCPP(void);
56int readCPPline(yystypepp * yylvalpp);
57int MacroExpand(int atom, yystypepp * yylvalpp);
58int ChkCorrectElseNesting(void);
59
60typedef struct MacroSymbol {
61 int argc;
62 int *args;
63 TokenStream *body;
64 unsigned busy:1;
65 unsigned undef:1;
66} MacroSymbol;
67
68void FreeMacro(MacroSymbol *);
daniel@transgaming.comcd0a9a82010-05-18 18:51:59 +000069void PredefineIntMacro(const char *name, int value);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000070
71void CPPDebugLogMsg(const char *msg); // Prints information into debug log
72void CPPShInfoLogMsg(const char*); // Store cpp Err Msg into Sh.Info.Log
73void CPPWarningToInfoLog(const char *msg); // Prints warning messages into info log
74void HandlePragma(const char**, int numTokens); // #pragma directive container.
75void ResetTString(void); // #error Message as TString.
76void CPPErrorToInfoLog(char*); // Stick all cpp errors into Sh.Info.log .
77void StoreStr(char*); // Store the TString in Parse Context.
78void SetLineNumber(int); // Set line number.
79void SetStringNumber(int); // Set string number.
80int GetLineNumber(void); // Get the current String Number.
81int GetStringNumber(void); // Get the current String Number.
82const char* GetStrfromTStr(void); // Convert TString to String.
83void updateExtensionBehavior(const char* extName, const char* behavior);
84int FreeCPP(void);
85
86#endif // !(defined(__CPP_H)