]> andersk Git - splint.git/blobdiff - src/Headers/cpplib.h
Fixed problem with russian characters.
[splint.git] / src / Headers / cpplib.h
index cf8529bbfbc7837ad6d6ee790c74a6fcbc8bb8a7..bc44c01b8d344c57b8b70f3f63527c242477ce38 100644 (file)
@@ -155,7 +155,7 @@ struct cppReader {
 
   /* Current maximum length of directory names in the search path
      for include files.  (Altered as we get more of them.)  */
-  int max_include_len;
+  size_t max_include_len;
 
   /*@null@*/ struct if_stack *if_stack;
 
@@ -189,10 +189,6 @@ struct cppReader {
   int lineno;
 
   /*@null@*/ /*@observer@*/ struct tm *timebuf;
-
-#ifdef __cplusplus
-  ~cppReader () { cppCleanup (this); }
-#endif
 };
 
 /*@constant int cppReader_fatalErrorLimit; @*/
@@ -226,8 +222,7 @@ cpplib_createDefinition (/*@dependent@*/ cstring p_def, fileloc p_loc,
 
 extern void cpplib_reserve (/*@sef@*/ cppReader *, /*@sef@*/ size_t);
 #define cpplib_reserve(PFILE, N) \
-  (cpplib_getWritten (PFILE) + (N) > (PFILE)->token_buffer_size \
-   && (cppReader_growBuffer (PFILE, (N)), 0))
+  (((cpplib_getWritten (PFILE) + (N) > (PFILE)->token_buffer_size)) ? cppReader_growBuffer (PFILE, (N)) : (void) 0)
 
 /* Append string STR (of length N) to PFILE's output buffer.
    Assume there is enough space. */
@@ -273,7 +268,7 @@ struct cppOptions {
   /* Name of output file, for error messages.  */
   /*@dependent@*/ cstring out_fname;
 
-  struct file_name_map_list *map_list;
+  /*@only@*/ struct file_name_map_list *map_list;
 
   /* Non-0 means -v, so print the full set of include dirs.  */
   bool verbose;
@@ -358,6 +353,7 @@ struct cppOptions {
 
   /* First dir to search */
   /*@owned@*/ struct file_name_list *include;
+
   /* First dir to search for <file> */
   /* This is the first element to use for #include <...>.
      If it is 0, use the entire chain for such includes.  */
@@ -406,7 +402,7 @@ extern bool cppReader_isTraditional (/*@special@*/ cppReader *p_pfile)
     /*@uses p_pfile->opts@*/
    /*@modifies nothing@*/ ; 
 
-#define cppReader_isTraditional(PFILE) (CPPOPTIONS(PFILE)-> traditional)
+#define cppReader_isTraditional(PFILE) (CPPOPTIONS(PFILE)->traditional)
 
 extern bool cppReader_isPedantic (cppReader *) /*@*/; 
 #define cppReader_isPedantic(PFILE) (CPPOPTIONS (PFILE)->pedantic)
@@ -421,37 +417,38 @@ extern bool cppReader_isPedantic (cppReader *) /*@*/;
 /* different flavors of hash nodes --- also used in keyword table */
 enum node_type {
  T_NONE = 0,
- T_DEFINE = 1, /* the `#define' keyword */
- T_INCLUDE,    /* the `#include' keyword */
- T_INCLUDE_NEXT, /* the `#include_next' keyword */
- T_IFDEF,      /* the `#ifdef' keyword */
- T_IFNDEF,     /* the `#ifndef' keyword */
- T_IF,         /* the `#if' keyword */
- T_ELSE,       /* `#else' */
- T_PRAGMA,     /* `#pragma' */
- T_ELIF,       /* `#elif' */
- T_UNDEF,      /* `#undef' */
- T_LINE,       /* `#line' */
- T_ERROR,      /* `#error' */
- T_WARNING,    /* `#warning' */
- T_ENDIF,      /* `#endif' */
- T_IDENT,      /* `#ident', used on system V.  */
- T_SPECLINE,   /* special symbol `__LINE__' */
- T_DATE,       /* `__DATE__' */
- T_FILE,       /* `__FILE__' */
- T_BASE_FILE,  /* `__BASE_FILE__' */
- T_INCLUDE_LEVEL, /* `__INCLUDE_LEVEL__' */
- T_VERSION,    /* `__VERSION__' */
- T_SIZE_TYPE,   /* `__SIZE_TYPE__' */
- T_PTRDIFF_TYPE,   /* `__PTRDIFF_TYPE__' */
- T_WCHAR_TYPE,   /* `__WCHAR_TYPE__' */
- T_USER_LABEL_PREFIX_TYPE, /* `__USER_LABEL_PREFIX__' */
- T_REGISTER_PREFIX_TYPE,   /* `__REGISTER_PREFIX__' */
- T_TIME,       /* `__TIME__' */
- T_CONST,      /* Constant value, used by `__STDC__' */
- T_MACRO,      /* macro defined by `#define' */
+ T_DEFINE = 1, /* the #define keyword */
+ T_INCLUDE,    /* the #include keyword */
+ T_INCLUDE_NEXT, /* the #include_next keyword */
+ T_IFDEF,      /* the #ifdef keyword */
+ T_IFNDEF,     /* the #ifndef keyword */
+ T_IF,         /* the #if keyword */
+ T_ELSE,       /* #else */
+ T_PRAGMA,     /* #pragma */
+ T_ELIF,       /* #elif */
+ T_UNDEF,      /* #undef */
+ T_LINE,       /* #line */
+ T_ERROR,      /* #error */
+ T_WARNING,    /* #warning */
+ T_ENDIF,      /* #endif */
+ T_IDENT,      /* #ident, used on system V.  */
+ T_SPECLINE,   /* special symbol __LINE__ */
+ T_DATE,       /* __DATE__ */
+ T_FILE,       /* __FILE__ */
+ T_BASE_FILE,  /* __BASE_FILE__ */
+ T_INCLUDE_LEVEL, /* __INCLUDE_LEVEL__ */
+ T_FUNC,        /* __func__ */
+ T_VERSION,    /* __VERSION__ */
+ T_SIZE_TYPE,   /* __SIZE_TYPE__ */
+ T_PTRDIFF_TYPE,   /* __PTRDIFF_TYPE__ */
+ T_WCHAR_TYPE,   /* __WCHAR_TYPE__ */
+ T_USER_LABEL_PREFIX_TYPE, /* __USER_LABEL_PREFIX__ */
+ T_REGISTER_PREFIX_TYPE,   /* __REGISTER_PREFIX__ */
+ T_TIME,       /* __TIME__ */
+ T_CONST,      /* Constant value, used by __STDC__ */
+ T_MACRO,      /* macro defined by #define */
  T_DISABLED,   /* macro temporarily turned off for rescan */
- T_SPEC_DEFINED, /* special `defined' macro for use in #if statements */
+ T_SPEC_DEFINED, /* special defined macro for use in #if statements */
  T_PCSTRING,   /* precompiled string (hashval is KEYDEF *) */
  T_UNUSED      /* Used for something not defined.  */
 } ;
@@ -537,8 +534,8 @@ struct if_stack {
 };
 typedef struct if_stack cppIfStackFrame;
 
-extern void cppBuffer_lineAndColumn (/*@null@*/ cppBuffer *, /*@out@*/ int *,
-                                    /*@out@*/ /*@null@*/ int *);
+extern void cppBuffer_getLineAndColumn (/*@null@*/ cppBuffer *, /*@out@*/ int *,
+                                       /*@out@*/ /*@null@*/ int *);
 extern /*@exposed@*/ /*@null@*/ cppBuffer *cppReader_fileBuffer (cppReader *);
 
 extern void cppReader_growBuffer (cppReader *, size_t);
@@ -583,7 +580,7 @@ struct file_name_list
 };
 
 extern void cppReader_addIncludeChain (/*@special@*/ cppReader *p_pfile, 
-                                      /*@keep@*/ struct file_name_list *p_dir)
+                                      /*@only@*/ struct file_name_list *p_dir)
      /*@uses p_pfile->opts, p_pfile->max_include_len@*/
      /*@modifies p_pfile, p_dir@*/ ;
 
This page took 0.058855 seconds and 4 git commands to generate.