From c130e597b013e37c94afd6651be1e8859ba7e5ac Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 3 Aug 2003 11:58:11 +0000 Subject: [PATCH] New option --forget-inc-paths git-svn-id: svn://svn.cc65.org/cc65/trunk@2243 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/incpath.c | 8 ++++++++ src/cc65/incpath.h | 3 +++ src/cc65/main.c | 13 ++++++++++++- src/cl65/main.c | 10 ++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/cc65/incpath.c b/src/cc65/incpath.c index b9e8d517a..62ca365b4 100644 --- a/src/cc65/incpath.c +++ b/src/cc65/incpath.c @@ -65,6 +65,14 @@ 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 */ { diff --git a/src/cc65/incpath.h b/src/cc65/incpath.h index 2554900c7..df3be913e 100644 --- a/src/cc65/incpath.h +++ b/src/cc65/incpath.h @@ -63,6 +63,9 @@ char* FindInclude (const char* Name, unsigned Where); * the complete path, if found, return 0 otherwise. */ +void ForgetAllIncludePaths (void); +/* Remove all include search paths. */ + void InitIncludePaths (void); /* Initialize the include path search list */ diff --git a/src/cc65/main.c b/src/cc65/main.c index d21733ba6..e7a68d502 100644 --- a/src/cc65/main.c +++ b/src/cc65/main.c @@ -112,6 +112,7 @@ static void Usage (void) " --debug-opt name\tDebug optimization steps\n" " --disable-opt name\tDisable an optimization step\n" " --enable-opt name\tEnable an optimization step\n" + " --forget-inc-paths\tForget include search paths\n" " --help\t\tHelp (this text)\n" " --include-dir dir\tSet an include directory search path\n" " --list-opt-steps\tList all optimizer steps and exit\n" @@ -503,6 +504,15 @@ static void OptEnableOpt (const char* Opt attribute ((unused)), const char* Arg) +static void OptForgetIncPaths (const char* Opt attribute ((unused)), + const char* Arg attribute ((unused))) +/* Forget all currently defined include paths */ +{ + ForgetAllIncludePaths (); +} + + + static void OptHelp (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print usage information and exit */ @@ -629,7 +639,8 @@ int main (int argc, char* argv[]) { "--debug-info", 0, OptDebugInfo }, { "--debug-opt", 1, OptDebugOpt }, { "--disable-opt", 1, OptDisableOpt }, - { "--enable-opt", 1, OptEnableOpt, }, + { "--enable-opt", 1, OptEnableOpt }, + { "--forget-inc-paths", 0, OptForgetIncPaths }, { "--help", 0, OptHelp }, { "--include-dir", 1, OptIncludeDir }, { "--list-opt-steps", 0, OptListOptSteps }, diff --git a/src/cl65/main.c b/src/cl65/main.c index b79d4833e..1156b7e50 100644 --- a/src/cl65/main.c +++ b/src/cl65/main.c @@ -636,6 +636,7 @@ static void Usage (void) " --debug\t\tDebug mode\n" " --debug-info\t\tAdd debug info\n" " --feature name\tSet an emulation feature\n" + " --forget-inc-paths\tForget include search paths (compiler)\n" " --help\t\tHelp (this text)\n" " --include-dir dir\tSet a compiler include directory path\n" " --lib file\t\tLink this library\n" @@ -822,6 +823,14 @@ static void OptFeature (const char* Opt attribute ((unused)), const char* Arg) +static void OptForgetIncPaths (const char* Opt attribute ((unused)), const char* Arg) +/* Forget all currently defined include paths */ +{ + CmdAddArg2 (&CC65, "--forget-inc-paths", Arg); +} + + + static void OptHelp (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Print help - cl65 */ @@ -1042,6 +1051,7 @@ int main (int argc, char* argv []) { "--debug", 0, OptDebug }, { "--debug-info", 0, OptDebugInfo }, { "--feature", 1, OptFeature }, + { "--forget-inc-paths", 0, OptForgetIncPaths }, { "--help", 0, OptHelp }, { "--include-dir", 1, OptIncludeDir }, { "--lib", 1, OptLib }, -- 2.39.5