X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fincpath.c;h=937a0d9bf64d80ef0eeda5bf6b4e6090d14d6be3;hb=9b7c16ec4cbb5282642c377272224e3fc825f860;hp=abac35c3aefe562ae13c48b4f8cecc3676983379;hpb=fc78f797ee81c01d0898189244983a2e7d31bb21;p=cc65 diff --git a/src/cc65/incpath.c b/src/cc65/incpath.c index abac35c3a..937a0d9bf 100644 --- a/src/cc65/incpath.c +++ b/src/cc65/incpath.c @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 2000-2003 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ -/* D-70794 Filderstadt */ -/* EMail: uz@cc65.org */ +/* (C) 2000-2009, Ullrich von Bassewitz */ +/* Roemerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -33,8 +33,6 @@ -#include - /* common */ #include "searchpath.h" @@ -67,23 +65,30 @@ char* FindInclude (const char* Name, unsigned Where) +void ForgetAllIncludePaths (void) +/* Remove all include search paths. */ +{ + ForgetAllSearchPaths (INC_SYS | INC_USER); +} + + + void InitIncludePaths (void) /* Initialize the include path search list */ { - const char* Path; - /* Add some standard paths to the include search path */ - AddIncludePath ("", INC_USER); /* Current directory */ - AddIncludePath ("include", INC_SYS); + AddSearchPath ("", INC_USER); /* Current directory */ + + /* Add some compiled in search paths if defined at compile time */ #ifdef CC65_INC - AddIncludePath (CC65_INC, INC_SYS); -#else - AddIncludePath ("/usr/lib/cc65/include", INC_SYS); + AddSearchPath (CC65_INC, INC_SYS); #endif - Path = getenv ("CC65_INC"); - if (Path) { - AddIncludePath (Path, INC_SYS | INC_USER); - } + + /* Add specific paths from the environment */ + AddSearchPathFromEnv ("CC65_INC", INC_SYS | INC_USER); + + /* Add paths relative to a main directory defined in an env var */ + AddSubSearchPathFromEnv ("CC65_HOME", "include", INC_SYS); }