Browse Source

resurrect -spam

David Rose 23 years ago
parent
commit
c77fcbe00a

+ 16 - 0
dtool/src/interrogate/interfaceMaker.cxx

@@ -754,3 +754,19 @@ hash_function_signature(FunctionRemap *remap) {
 
   remap->_hash = hash;
 }
+
+////////////////////////////////////////////////////////////////////
+//     Function: InterfaceMaker::write_spam_message
+//       Access: Protected
+//  Description: Generates a string to output a spammy message to
+//               notify indicating we have just called this function.
+////////////////////////////////////////////////////////////////////
+void InterfaceMaker::
+write_spam_message(ostream &out, FunctionRemap *remap) const {
+  out <<
+    "  if (interrogatedb_cat.is_spam()) {\n"
+    "    interrogatedb_cat.spam() << \"";
+  remap->write_orig_prototype(out, 0);
+  out << "\\n\";\n"
+    "  }\n";
+}

+ 1 - 0
dtool/src/interrogate/interfaceMaker.h

@@ -138,6 +138,7 @@ protected:
 
   void output_ref(ostream &out, int indent_level, FunctionRemap *remap, 
                   const string &varname) const;
+  void write_spam_message(ostream &out, FunctionRemap *remap) const;
 
 protected:
   InterrogateModuleDef *_def;

+ 4 - 2
dtool/src/interrogate/interfaceMakerC.cxx

@@ -192,8 +192,10 @@ write_function_instance(ostream &out, InterfaceMaker::Function *func,
 
   write_function_header(out, func, remap, true);
   out << " {\n";
-    
-  //  write_spam_message(def_index, out);
+
+  if (generate_spam) {
+    write_spam_message(out, remap);
+  }
     
   string return_expr = 
     remap->call_function(out, 2, true, "param0");

+ 4 - 2
dtool/src/interrogate/interfaceMakerPythonSimple.cxx

@@ -233,8 +233,10 @@ write_function_instance(ostream &out, InterfaceMaker::Function *func,
 
   out << "PyObject *\n"
       << remap->_wrapper_name << "(PyObject *, PyObject *args) {\n";
-    
-  //  write_spam_message(def_index, out);
+
+  if (generate_spam) {
+    write_spam_message(out, remap);
+  }
 
   string format_specifiers;
   string parameter_list;