lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r464372 - in /lucene/lucy/trunk/charmonizer/src: ./ Charmonizer/
Date Mon, 16 Oct 2006 04:04:56 GMT
Author: marvin
Date: Sun Oct 15 21:04:53 2006
New Revision: 464372

URL: http://svn.apache.org/viewvc?view=rev&rev=464372
Log:
Add a verbosity setting and a few printf's narrating normal behavior.

Modified:
    lucene/lucy/trunk/charmonizer/src/Charmonizer.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer.harm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Core.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Core.harm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/FuncMacro.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Integers.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/LargeFiles.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/UnusedVars.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/VariadicMacros.charm

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer.charm?view=diff&rev=464372&r1=464371&r2=464372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer.charm Sun Oct 15 21:04:53 2006
@@ -15,6 +15,8 @@
 void
 chaz_clean_up()
 {
+    if (verbosity)
+        printf("Cleaning up...\n");
     remove("_charm.h");
 }
 
@@ -47,6 +49,12 @@
     macro_prefix     = strdup(macro_pre);
     typedef_prefix   = strdup(typedef_pre);
     function_prefix  = strdup(function_pre);
+}
+
+void
+chaz_set_verbosity(int level)
+{
+    verbosity = level;
 }
 
 char*

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer.harm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer.harm?view=diff&rev=464372&r1=464371&r2=464372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer.harm Sun Oct 15 21:04:53 2006
@@ -32,6 +32,14 @@
 chaz_set_prefixes(char *constant_prefix, char *macro_prefix, 
                   char *typedef_prefix,  char *function_prefix);
 
+/* Determine how much feedback Charmonizer provides.  
+ * 0 - silent
+ * 1 - normal
+ * 2 - debugging
+ */
+void
+chaz_set_verbosity(int level);
+
 /* Read an entire file into memory.
  */
 char*

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core.charm?view=diff&rev=464372&r1=464371&r2=464372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core.charm Sun Oct 15 21:04:53 2006
@@ -12,6 +12,7 @@
 char *macro_prefix    = NULL;
 char *typedef_prefix  = NULL;
 char *function_prefix = NULL;
+int   verbosity       = 1;
 
 static char *command_buf = NULL;
 static size_t command_buf_len = 0;

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core.harm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core.harm?view=diff&rev=464372&r1=464371&r2=464372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core.harm Sun Oct 15 21:04:53 2006
@@ -27,6 +27,7 @@
 extern char *chaz_Core_macro_prefix;
 extern char *chaz_Core_typedef_prefix;
 extern char *chaz_Core_function_prefix;
+extern int chaz_Core_verbosity;
 
 /* Write the "_charm.h" file used by every probe.
  */
@@ -77,8 +78,13 @@
 
 /* Print a "chapter heading" when starting a module. 
  */
-#define Chaz_Core_Start_Run(filehandle) \
-    fprintf(filehandle, "\n/* %s */\n", __FILE__)
+#define Chaz_Core_Start_Run(filehandle, module_name) \
+    do { \
+        fprintf(filehandle, "\n/* %s */\n", module_name); \
+        if (verbosity > 0) \
+            printf("Running %s module...\n", module_name); \
+    } while (0)
+
 
 /* Leave a little whitespace at the end of each module.
  */
@@ -95,6 +101,7 @@
 # define macro_prefix           chaz_Core_macro_prefix
 # define typedef_prefix         chaz_Core_typedef_prefix
 # define function_prefix        chaz_Core_function_prefix
+# define verbosity              chaz_Core_verbosity
 # define write_charm_h          chaz_Core_write_charm_h
 # define capture_output         chaz_Core_capture_output 
 # define slurp_file             chaz_Core_slurp_file 

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/FuncMacro.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/FuncMacro.charm?view=diff&rev=464372&r1=464371&r2=464372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/FuncMacro.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/FuncMacro.charm Sun Oct 15 21:04:53 2006
@@ -34,7 +34,7 @@
     chaz_bool_t has_iso_funcmac  = false;
     chaz_bool_t has_gnuc_funcmac = false;
 
-    Start_Run(conf_fh);
+    Start_Run(conf_fh, "FuncMacro");
     
     /* check for ISO func macro */
     output = capture_output(iso_func_code, strlen(iso_func_code), 

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Integers.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Integers.charm?view=diff&rev=464372&r1=464371&r2=464372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Integers.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Integers.charm Sun Oct 15 21:04:53 2006
@@ -60,7 +60,7 @@
     chaz_bool_t has_long_long = false;
     chaz_bool_t has_inttypes  = false;
 
-    Start_Run(conf_fh);
+    Start_Run(conf_fh, "Integers");
 
     /* Record sizeof() for several common integer types. */
     output = capture_output(sizes_code, strlen(sizes_code), &output_len);

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/LargeFiles.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/LargeFiles.charm?view=diff&rev=464372&r1=464371&r2=464372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/LargeFiles.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/LargeFiles.charm Sun Oct 15 21:04:53 2006
@@ -52,7 +52,7 @@
     int sizeof_long = -1;
     chaz_bool_t success = false;
 
-    Start_Run(conf_fh);
+    Start_Run(conf_fh, "LargeFiles");
 
     /* check for ftello, fseeko, and 64-bit off_t */
     output = capture_output(ftello_code, strlen(ftello_code), &output_len);

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/UnusedVars.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/UnusedVars.charm?view=diff&rev=464372&r1=464371&r2=464372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/UnusedVars.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/UnusedVars.charm Sun Oct 15 21:04:53 2006
@@ -9,7 +9,7 @@
 void
 chaz_UnusedVars_run(FILE *conf_fh) 
 {
-    Start_Run(conf_fh);
+    Start_Run(conf_fh, "UnusedVars");
     
     fprintf(conf_fh, 
         "#define %sUnused_Var(x) ((void)x)\n"

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/VariadicMacros.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/VariadicMacros.charm?view=diff&rev=464372&r1=464371&r2=464372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/VariadicMacros.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/VariadicMacros.charm Sun Oct 15 21:04:53
2006
@@ -35,7 +35,7 @@
     size_t output_len;
     chaz_bool_t has_varmacros      = false;
 
-    Start_Run(conf_fh);
+    Start_Run(conf_fh, "VariadicMacros");
 
     /* test for ISO-style variadic macros */
     output = capture_output(iso_code, strlen(iso_code), &output_len);



Mime
View raw message