]> git.sur5r.net Git - cc65/blobdiff - src/cc65/input.h
Fixed two compiler warnings.
[cc65] / src / cc65 / input.h
index 662ab2f599ad604c97787380df15f1f1ac68ebc8..dfa0ad03b92eaabd56bfa7b863fde985cc1682cc 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000      Ullrich von Bassewitz                                       */
-/*               Wacholderweg 14                                             */
-/*               D-70597 Stuttgart                                           */
-/* EMail:        uz@musoftware.de                                            */
+/* (C) 2000-2010, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 
 
 
+#include <stdio.h>
+
+/* common */
+#include "strbuf.h"
+
+
+
 /*****************************************************************************/
-/*                                  data                                    */
+/*                                  data                                    */
 /*****************************************************************************/
 
 
 
-/* Maximum length of an input line and the corresponding char array */
-#define LINEMAX                4095
-#define LINESIZE       LINEMAX+1
+/* An enum that describes different types of input files. The members are
+ * choosen so that it is possible to combine them to bitsets
+ */
+typedef enum {
+    IT_MAIN     = 0x01,         /* Main input file */
+    IT_SYSINC   = 0x02,         /* System include file (using <>) */
+    IT_USRINC  = 0x04,          /* User include file (using "") */
+} InputType;
+
+/* Forward for an IFile structure */
+struct IFile;
 
-/* Input line stuff */
-extern char* line;
-extern char* lptr;
+/* The current input line */
+extern StrBuf* Line;
+
+/* Current and next input character */
+extern char CurC;
+extern char NextC;
 
 
 
 /*****************************************************************************/
-/*                                  Code                                    */
+/*                                          Code                                    */
 /*****************************************************************************/
 
 
@@ -63,35 +81,37 @@ extern char* lptr;
 void OpenMainFile (const char* Name);
 /* Open the main file. Will call Fatal() in case of failures. */
 
-void OpenIncludeFile (const char* Name, unsigned DirSpec);
+void OpenIncludeFile (const char* Name, InputType IT);
 /* Open an include file and insert it into the tables. */
 
-int NextLine (void);
-/* Get a line from the current input. Returns 0 on end of file. */
+void NextChar (void);
+/* Read the next character from the input stream and make CurC and NextC
+ * valid. If end of line is reached, both are set to NUL, no more lines
+ * are read by this function.
+ */
 
 void ClearLine (void);
 /* Clear the current input line */
 
+StrBuf* InitLine (StrBuf* Buf);
+/* Initialize Line from Buf and read CurC and NextC from the new input line.
+ * The function returns the old input line.
+ */
+
+int NextLine (void);
+/* Get a line from the current input. Returns 0 on end of file. */
+
+const char* GetInputFile (const struct IFile* IF);
+/* Return a filename from an IFile struct */
+
 const char* GetCurrentFile (void);
 /* Return the name of the current input file */
 
 unsigned GetCurrentLine (void);
 /* Return the line number in the current input file */
 
-int nch (void);
-/* Get the next char in input stream (the one behind the current one) */
-
-int cgch (void);
-/* Get the current character in the input stream and advance line
- * pointer (unless already at end of line).
- */
-
-int gch (void);
-/* Get the current character in the input stream and advance line
- * pointer (no end of line check is performed).
- */
-
-
+void CreateDependencies (void);
+/* Create dependency files requested by the user */