/* */
/* */
/* */
-/* (C) 2000-2009, Ullrich von Bassewitz */
+/* (C) 2000-2010, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
-/* common */
-#include "searchpath.h"
-
/* ca65 */
#include "incpath.h"
-#define INC_STD 0x0001U
+SearchPath* IncSearchPath; /* Standard include path */
+SearchPath* BinSearchPath; /* Binary include path */
-void AddIncludePath (const char* NewPath)
-/* Add a new include path to the existing one */
-{
- AddSearchPath (NewPath, INC_STD);
-}
-
-
-
-char* FindInclude (const char* Name)
-/* Find an include file. Return a pointer to a malloced area that contains
- * the complete path, if found, return 0 otherwise.
- */
-{
- /* Search in the include directories */
- return SearchFile (Name, INC_STD);
-}
-
-
-
void ForgetAllIncludePaths (void)
/* Remove all include search paths. */
{
- ForgetAllSearchPaths (INC_STD);
+ ForgetSearchPath (IncSearchPath);
+ ForgetSearchPath (BinSearchPath);
}
void InitIncludePaths (void)
/* Initialize the include path search list */
{
- /* Add some standard paths to the include search path */
- AddSearchPath ("", INC_STD); /* Current directory */
+ /* Create the search path lists */
+ IncSearchPath = NewSearchPath ();
+ BinSearchPath = NewSearchPath ();
+
+ /* Add the current directory to the search paths */
+ AddSearchPath (IncSearchPath, "");
+ AddSearchPath (BinSearchPath, "");
/* Add some compiled in search paths if defined at compile time */
#ifdef CA65_INC
- AddSearchPath (CA65_INC, INC_STD);
+ AddSearchPath (IncSearchPath, CA65_INC);
#endif
/* Add specific paths from the environment */
- AddSearchPathFromEnv ("CA65_INC", INC_STD);
+ AddSearchPathFromEnv (IncSearchPath, "CA65_INC");
/* Add paths relative to a main directory defined in an env var */
- AddSubSearchPathFromEnv ("CC65_HOME", "asminc", INC_STD);
+ AddSubSearchPathFromEnv (IncSearchPath, "CC65_HOME", "asminc");
}