# include "lclintMacros.nf"
# include "llbasic.h"
# include "lcllib.h"
-# include "cpp.h"
# include "cpplib.h"
# include "cpperror.h"
# include "cpphash.h"
static enum cpp_token cpp_handleComment (cppReader *p_pfile,
struct parse_marker *p_smark)
- /*@modifies *p_pfile, *p_smark@*/;
+ /*@modifies p_pfile, p_smark@*/;
static bool cpp_shouldCheckMacro (cppReader *p_pfile, char *p_p) /*@*/ ;
}
}
+cstring
+cppReader_getIncludePath ()
+{
+ cppReader *pfile = &g_cppState;
+ struct file_name_list *dirs = CPPOPTIONS (pfile)->include;
+ cstring res = cstring_undefined;
+
+ if (dirs != NULL)
+ {
+ while (dirs != NULL)
+ {
+ res = message ("%q%c%s", res, PATH_SEPARATOR, dirs->fname);
+ dirs = dirs->next;
+ }
+ }
+ else
+ {
+ res = cstring_makeLiteral ("<no include path>");
+ }
+
+ return res;
+}
+
void
cppReader_addIncludeChain (cppReader *pfile, struct file_name_list *dir)
{
opts->for_lint = 0;
opts->chill = 0;
opts->pedantic_errors = 0;
- opts->inhibit_warnings = 0;
opts->warn_comments = 0;
opts->warnings_are_errors = 0;
if (limit - p >= 2 && p[0] == '#' && p[1] == '#') {
cppReader_errorLit (pfile,
- cstring_makeLiteralTemp ("`##' at start of macro definition"));
+ cstring_makeLiteralTemp ("`##' at start of macro definition"));
p += 2;
}
void cppReader_initializeReader (cppReader *pfile) /* Must be done after library is loaded. */
{
struct cppOptions *opts = CPPOPTIONS (pfile);
- char *xp;
+ cstring xp;
/* The code looks at the defaults through this pointer, rather than through
the constant structure above. This pointer gets changed if an environment
but that seems pointless: it comes before them, so it overrides them
anyway. */
- xp = (char *) getenv ("CPATH");
+ xp = osd_getEnvironmentVariable (INCLUDEPATH_VAR);
- if (xp != 0 && ! opts->no_standard_includes)
+ if (cstring_isDefined (xp) && !opts->no_standard_includes)
{
- path_include (pfile, xp);
+ path_include (pfile, cstring_toCharsSafe (xp));
}
/* Now that dollars_in_ident is known, initialize is_idchar. */
if (start[i] == '/'
&& i < len - 1
&& start[i + 1] == '*') {
- /*@i32 make vgenopterror work in cpp... @*/
- if (context_getFlag (FLG_NESTCOMMENT))
- {
- cppReader_warning
- (pfile,
- message ("Comment starts inside comment"));
- }
+ (void) cppoptgenerror (FLG_NESTCOMMENT,
+ message ("Comment starts inside comment"),
+ pfile);
}
if (start[i] != '\n')