X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fincpath.c;h=fdbca2a078e4b768334bca85e16d998a9f99aea0;hb=7aefd9b4e7b67908b7b3c38b6003c7f1a8d3ee2d;hp=937a0d9bf64d80ef0eeda5bf6b4e6090d14d6be3;hpb=cb688729aff5f1b77b7c4d60f6f69cd728f8dc06;p=cc65 diff --git a/src/cc65/incpath.c b/src/cc65/incpath.c index 937a0d9bf..fdbca2a07 100644 --- a/src/cc65/incpath.c +++ b/src/cc65/incpath.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2000-2009, Ullrich von Bassewitz */ +/* (C) 2000-2010, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -33,42 +33,33 @@ -/* common */ -#include "searchpath.h" - /* cc65 */ #include "incpath.h" /*****************************************************************************/ -/* Code */ +/* Data */ /*****************************************************************************/ -void AddIncludePath (const char* NewPath, unsigned Where) -/* Add a new include path to the existing one */ -{ - AddSearchPath (NewPath, Where); -} +SearchPath* SysIncSearchPath; /* System include path */ +SearchPath* UsrIncSearchPath; /* User include path */ -char* FindInclude (const char* Name, unsigned Where) -/* Find an include file. Return a pointer to a malloced area that contains - * the complete path, if found, return 0 otherwise. - */ -{ - return SearchFile (Name, Where); -} +/*****************************************************************************/ +/* Code */ +/*****************************************************************************/ void ForgetAllIncludePaths (void) /* Remove all include search paths. */ { - ForgetAllSearchPaths (INC_SYS | INC_USER); + ForgetSearchPath (SysIncSearchPath); + ForgetSearchPath (UsrIncSearchPath); } @@ -76,19 +67,24 @@ void ForgetAllIncludePaths (void) void InitIncludePaths (void) /* Initialize the include path search list */ { - /* Add some standard paths to the include search path */ - AddSearchPath ("", INC_USER); /* Current directory */ + /* Create the search path lists */ + SysIncSearchPath = NewSearchPath (); + UsrIncSearchPath = NewSearchPath (); + + /* Add the current path to the user search path list */ + AddSearchPath (UsrIncSearchPath, ""); /* Add some compiled in search paths if defined at compile time */ #ifdef CC65_INC - AddSearchPath (CC65_INC, INC_SYS); + AddSearchPath (SysIncSearchPath, CC65_INC); #endif /* Add specific paths from the environment */ - AddSearchPathFromEnv ("CC65_INC", INC_SYS | INC_USER); + AddSearchPathFromEnv (SysIncSearchPath, "CC65_INC"); + AddSearchPathFromEnv (UsrIncSearchPath, "CC65_INC"); /* Add paths relative to a main directory defined in an env var */ - AddSubSearchPathFromEnv ("CC65_HOME", "include", INC_SYS); + AddSubSearchPathFromEnv (SysIncSearchPath, "CC65_HOME", "include"); }