You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/07/06 01:43:14 UTC
[lucy-commits] svn commit: r1143226 - in /incubator/lucy/trunk/clownfish:
lib/Clownfish/Binding/Core/Class.pm src/CFCBindClass.c
Author: marvin
Date: Tue Jul 5 23:43:14 2011
New Revision: 1143226
URL: http://svn.apache.org/viewvc?rev=1143226&view=rev
Log:
Add comments to Clownfish autogenerated files.
Put comments into the .c and .h files which are automatically generated by
Clownfish when it processes a .cfh file.
Modified:
incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/Class.pm
incubator/lucy/trunk/clownfish/src/CFCBindClass.c
Modified: incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/Class.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/Class.pm?rev=1143226&r1=1143225&r2=1143226&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/Class.pm (original)
+++ incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/Class.pm Tue Jul 5 23:43:14 2011
@@ -75,10 +75,19 @@ sub to_c_header {
#include "boil.h"
$parent_include
+/* Declare this class's inert variables.
+ */
+
$inert_var_defs
+/* Declare this class's inert functions.
+ */
+
$sub_declarations
+/* Define "short names" for this class's symbols.
+ */
+
$short_names
END_INERT
@@ -89,22 +98,55 @@ END_INERT
#include "charmony.h"
#include "boil.h"
+
+/* Include the header for this class's parent.
+ */
+
$parent_include
+/* Define the struct layout for instances of this class.
+ */
+
#ifdef $c_file_sym
$struct_def
#endif /* $c_file_sym */
+/* Declare this class's inert variables.
+ */
+
$inert_var_defs
+/* Declare both this class's inert functions and the C functions which
+ * implement this class's dynamic methods.
+ */
+
$sub_declarations
+
+/* Declare the cfish_Callback objects which provide the introspection
+ * information needed to perform method overriding at runtime.
+ */
+
$callback_declarations
+/* Define typedefs for each dynamic method, allowing us to cast generic
+ * pointers to the appropriate function pointer type more cleanly.
+ */
+
$method_typedefs
+/* Define the inline functions which implement this class's virtual methods.
+ */
+
$method_defs
+/* Define the VTable singleton for this class.
+ */
+
$vt_singleton_def
+
+/* Define "short names" for this class's symbols.
+ */
+
$short_names
END_STUFF
Modified: incubator/lucy/trunk/clownfish/src/CFCBindClass.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCBindClass.c?rev=1143226&r1=1143225&r2=1143226&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCBindClass.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCBindClass.c Tue Jul 5 23:43:14 2011
@@ -175,12 +175,43 @@ CFCBindClass_to_c(CFCBindClass *self) {
const char pattern[] =
"#include \"%s\"\n"
"\n"
+ "/* Offsets for method pointers, measured in bytes, from the top\n"
+ " * of this class's vtable.\n"
+ " */\n"
+ "\n"
"%s\n"
+ "\n"
+ "/* Define functions which implement host callbacks for the methods\n"
+ " * of this class which can be overridden via the host.\n"
+ " */\n"
+ "\n"
"%s\n"
+ "\n"
+ "/* Define the cfish_Callback objects which provide introspection\n"
+ " * information and allow runtime overriding of dynamic methods.\n"
+ " */\n"
+ "\n"
"%s\n"
+ "\n"
+ "/* Assemble all the cfish_Callback objects for this class so that\n"
+ " * they can be searched when performing method overriding.\n"
+ " */\n"
+ "\n"
"%s\n"
+ "\n"
+ "/* Define the variable which holds this class's class name.\n"
+ " */\n"
+ "\n"
"%s\n"
+ "\n"
+ "/* Define this class's VTable.\n"
+ " */\n"
+ "\n"
"%s\n"
+ "\n"
+ "/* Include auxilary automatically generated code for this class.\n"
+ " */\n"
+ "\n"
"%s\n"
"\n";
size_t size = sizeof(pattern)