|
From: Carlo W. <li...@us...> - 2002-02-08 22:33:38
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-01-08 22:33:38 UTC
Added files:
libcwd/environ.cc libcwd/include/libcw/private_environ.h
Log message:
And the two new files that go with it...
---------------------- diff included ----------------------
Index: src/libcwd/environ.cc
diff -u /dev/null src/libcwd/environ.cc:1.1
--- /dev/null Fri Feb 8 14:33:38 2002
+++ src/libcwd/environ.cc Fri Feb 8 14:33:27 2002
@@ -0,0 +1,33 @@
+// $Header: /cvsroot/l/li/libcw/src/libcwd/environ.cc,v 1.1 2002/02/08 22:33:27 libcw Exp $
+//
+// Copyright (C) 2002, by
+//
+// Carlo Wood, Run on IRC <ca...@al...>
+// RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt
+// Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61
+//
+// This file may be distributed under the terms of the Q Public License
+// version 1.0 as appearing in the file LICENSE.QPL included in the
+// packaging of this file.
+//
+
+#include "sys.h"
+#include <cstdlib>
+#include "cwd_debug.h"
+
+namespace libcw {
+ namespace debug {
+ namespace _private_ {
+
+bool always_print_loading = false;
+bool suppress_startup_msgs = false;
+
+void process_environment_variables(void)
+{
+ always_print_loading = (getenv("LIBCWD_PRINT_LOADING") != NULL);
+ suppress_startup_msgs = (getenv("LIBCWD_NO_STARTUP_MSGS") != NULL);
+}
+
+ } // namespace _private_
+ } // namespace debug
+} // namespace libcw
Index: src/libcwd/include/libcw/private_environ.h
diff -u /dev/null src/libcwd/include/libcw/private_environ.h:1.1
--- /dev/null Fri Feb 8 14:33:38 2002
+++ src/libcwd/include/libcw/private_environ.h Fri Feb 8 14:33:28 2002
@@ -0,0 +1,43 @@
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/private_environ.h,v 1.1 2002/02/08 22:33:28 libcw Exp $
+//
+// Copyright (C) 2002, by
+//
+// Carlo Wood, Run on IRC <ca...@al...>
+// RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt
+// Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61
+//
+// This file may be distributed under the terms of the Q Public License
+// version 1.0 as appearing in the file LICENSE.QPL included in the
+// packaging of this file.
+//
+
+#ifndef LIBCW_PRIVATE_FUNCTIONS_H
+#define LIBCW_PRIVATE_FUNCTIONS_H
+
+#ifndef LIBCW_SYSD_H
+#error "You need to #include "sys.h" at the top of every source file (which in turn should #include <libcw/sysd.h>)."
+#endif
+
+namespace libcw {
+ namespace debug {
+ namespace _private_ {
+
+extern void process_environment_variables(void);
+
+// Environment variable: LIBCWD_PRINT_LOADING
+// Print the list with "BFD : Loading debug info from /lib/libc.so.6 (0x40271000) ... done (4189 symbols)" etc.
+// at the start of the program *even* when this happens before main() is reached and libcw_do and dc::bfd are
+// still turned off.
+extern bool always_print_loading;
+
+// Environment variable: LIBCWD_NO_STARTUP_MSGS
+// This will suppress all messages that normally could be printed
+// before reaching main, including warning messages.
+// This overrides LIBCWD_PRINT_LOADING.
+extern bool suppress_startup_msgs;
+
+ } // namespace _private_
+ } // namespace debug
+} // namespace libcw
+
+#endif // LIBCW_PRIVATE_FUNCTIONS_H
----------------------- End of diff -----------------------
|