OSDN Git Service

[pf3gnuchains/gcc-fork.git] / gcc / cpplib.h
index 65cb5da..3ff0c92 100644 (file)
@@ -19,14 +19,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  In other words, you are welcome to use, share and improve this program.
  You are forbidden to forbid anyone else to use, share and improve
  what you give them.   Help stamp out software-hoarding!  */
+#ifndef __GCC_CPPLIB__
+#define __GCC_CPPLIB__
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
 
 #ifdef __cplusplus
 extern "C" {
@@ -182,7 +179,7 @@ struct cpp_reader {
   /* A buffer used for both for cpp_get_token's output, and also internally. */
   unsigned char *token_buffer;
   /* Allocated size of token_buffer.  CPP_RESERVE allocates space.  */
-  int token_buffer_size;
+  unsigned int token_buffer_size;
   /* End of the written part of token_buffer. */
   unsigned char *limit;
 
@@ -282,12 +279,12 @@ struct cpp_reader {
 #define CPP_OUT_BUFFER(PFILE) ((PFILE)->token_buffer)
 
 /* Number of characters currently in PFILE's output buffer. */
-#define CPP_WRITTEN(PFILE) ((PFILE)->limit - (PFILE)->token_buffer)
+#define CPP_WRITTEN(PFILE) ((size_t)((PFILE)->limit - (PFILE)->token_buffer))
 #define CPP_PWRITTEN(PFILE) ((PFILE)->limit)
 
 /* Make sure PFILE->token_buffer has space for at least N more characters. */
 #define CPP_RESERVE(PFILE, N) \
-  (CPP_WRITTEN (PFILE) + N > (PFILE)->token_buffer_size \
+  (CPP_WRITTEN (PFILE) + (size_t)(N) > (PFILE)->token_buffer_size \
    && (cpp_grow_buffer (PFILE, N), 0))
 
 /* Append string STR (of length N) to PFILE's output buffer.
@@ -513,6 +510,27 @@ struct cpp_options {
 #define CPP_PEDANTIC(PFILE) (CPP_OPTIONS (PFILE)->pedantic)
 #define CPP_PRINT_DEPS(PFILE) (CPP_OPTIONS (PFILE)->print_deps)
 
+struct file_name_list
+  {
+    struct file_name_list *next;
+    char *fname;
+    /* If the following is nonzero, it is a macro name.
+       Don't include the file again if that macro is defined.  */
+    U_CHAR *control_macro;
+    /* If the following is nonzero, it is a C-language system include
+       directory.  */
+    int c_system_include_path;
+    /* Mapping of file names for this directory.  */
+    struct file_name_map *name_map;
+    /* Non-zero if name_map is valid.  */
+    int got_name_map;
+  };
+
+/* If a buffer's dir field is SELF_DIR_DUMMY, it means the file was found
+   via the same directory as the file that #included it.  */
+#define SELF_DIR_DUMMY ((struct file_name_list *) (~0))
+
+    
 /* Name under which this program was invoked.  */
 
 extern char *progname;
@@ -626,6 +644,8 @@ struct definition {
 };
 
 extern unsigned char is_idchar[256];
+extern unsigned char is_hor_space[256];
+extern unsigned char is_space[256];
 
 /* Stack of conditionals currently in progress
    (including both successful and failing conditionals).  */
@@ -688,6 +708,27 @@ extern void cpp_pfatal_with_name PROTO ((cpp_reader *, const char *));
 extern void cpp_file_line_for_message PROTO ((cpp_reader *, char *, int, int));
 extern void cpp_print_containing_files PROTO ((cpp_reader *));
 
+/* In cppfiles.c */
+extern void append_include_chain       PROTO ((cpp_reader *,
+                                               struct file_name_list *,
+                                               struct file_name_list *));
+extern int finclude                    PROTO ((cpp_reader *, int, char *,
+                                               int, struct file_name_list *));
+extern int find_include_file           PROTO ((cpp_reader *, char *,
+                                               unsigned long, char *, int,
+                                               struct file_name_list *,
+                                               struct file_name_list **));
+extern void deps_output                        PROTO ((cpp_reader *, char *, int));
+
+/* Bleargh. */
+extern char *savestring                        PROTO ((char *));
+#ifndef INCLUDE_LEN_FUDGE
+#define INCLUDE_LEN_FUDGE 0
+#endif
+
+    
 #ifdef __cplusplus
 }
 #endif
+#endif /* __GCC_CPPLIB__ */
+