Author: nwellnhof
Date: Sat Mar 24 11:13:22 2012
New Revision: 1304765

URL: http://svn.apache.org/viewvc?rev=1304765&view=rev
Log:
Process included classes

Modified:
    incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCBindCore.c
    incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCHierarchy.c
    incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCPerl.c
    
incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCPerlTypeMap.c

Modified: 
incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCBindCore.c
URL: 
http://svn.apache.org/viewvc/incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCBindCore.c?rev=1304765&r1=1304764&r2=1304765&view=diff
==============================================================================
--- incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCBindCore.c 
(original)
+++ incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCBindCore.c 
Sat Mar 24 11:13:22 2012
@@ -253,21 +253,24 @@ S_write_parcel_c(CFCBindCore *self) {
         CFCBase **blocks = CFCFile_blocks(file);
         for (int j = 0; blocks[j] != NULL; j++) {
             const char *cfc_class = CFCBase_get_cfc_class(blocks[j]);
-            if (strcmp(cfc_class, "Clownfish::CFC::Model::Class") == 0) {
-                CFCClass *klass = (CFCClass*)blocks[j];
-
-                CFCBindClass *class_binding = CFCBindClass_new(klass);
-                char *c_code = CFCBindClass_to_c(class_binding);
-                content = CFCUtil_cat(content, c_code, "\n", NULL);
-                FREEMEM(c_code);
-                CFCBase_decref((CFCBase*)class_binding);
-                const char *privacy_sym = CFCClass_privacy_symbol(klass);
-                privacy_syms = CFCUtil_cat(privacy_syms, "#define ",
-                                           privacy_sym, "\n", NULL);
-                const char *include_h = CFCClass_include_h(klass);
-                includes = CFCUtil_cat(includes, "#include \"", include_h,
-                                       "\"\n", NULL);
+            if (strcmp(cfc_class, "Clownfish::CFC::Model::Class") != 0) {
+                continue;
             }
+
+            CFCClass *klass = (CFCClass*)blocks[j];
+            if (CFCClass_included(klass)) { continue; }
+
+            CFCBindClass *class_binding = CFCBindClass_new(klass);
+            char *c_code = CFCBindClass_to_c(class_binding);
+            content = CFCUtil_cat(content, c_code, "\n", NULL);
+            FREEMEM(c_code);
+            CFCBase_decref((CFCBase*)class_binding);
+            const char *privacy_sym = CFCClass_privacy_symbol(klass);
+            privacy_syms = CFCUtil_cat(privacy_syms, "#define ",
+                                       privacy_sym, "\n", NULL);
+            const char *include_h = CFCClass_include_h(klass);
+            includes = CFCUtil_cat(includes, "#include \"", include_h,
+                                   "\"\n", NULL);
         }
     }
 

Modified: 
incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCHierarchy.c
URL: 
http://svn.apache.org/viewvc/incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCHierarchy.c?rev=1304765&r1=1304764&r2=1304765&view=diff
==============================================================================
--- incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCHierarchy.c 
(original)
+++ incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCHierarchy.c 
Sat Mar 24 11:13:22 2012
@@ -155,6 +155,9 @@ CFCHierarchy_build(CFCHierarchy *self) {
     for (size_t i = 0; self->sources[i] != NULL; i++) {
         S_parse_cf_files(self, self->sources[i], 0);
     }
+    for (size_t i = 0; self->includes[i] != NULL; i++) {
+        S_parse_cf_files(self, self->includes[i], 1);
+    }
     S_connect_classes(self);
     for (size_t i = 0; self->trees[i] != NULL; i++) {
         CFCClass_grow_tree(self->trees[i]);

Modified: incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCPerl.c
URL: 
http://svn.apache.org/viewvc/incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCPerl.c?rev=1304765&r1=1304764&r2=1304765&view=diff
==============================================================================
--- incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCPerl.c 
(original)
+++ incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCPerl.c Sat 
Mar 24 11:13:22 2012
@@ -253,7 +253,7 @@ S_write_boot_c(CFCPerl *self) {
         pound_includes = CFCUtil_cat(pound_includes, "#include \"",
                                      include_h, "\"\n", NULL);
 
-        if (CFCClass_inert(klass)) { continue; }
+        if (CFCClass_inert(klass) || CFCClass_included(klass)) { continue; }
 
         // Ignore return value from VTable_add_to_registry, since it's OK if
         // multiple threads contend for adding these permanent VTables and some

Modified: 
incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCPerlTypeMap.c
URL: 
http://svn.apache.org/viewvc/incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCPerlTypeMap.c?rev=1304765&r1=1304764&r2=1304765&view=diff
==============================================================================
--- 
incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCPerlTypeMap.c 
(original)
+++ 
incubator/lucy/branches/LUCY-215-cf-extensions/clownfish/src/CFCPerlTypeMap.c 
Sat Mar 24 11:13:22 2012
@@ -273,6 +273,8 @@ CFCPerlTypeMap_write_xs_typemap(CFCHiera
     char *output = CFCUtil_strdup("");
     for (int i = 0; classes[i] != NULL; i++) {
         CFCClass *klass = classes[i];
+        if (CFCClass_included(klass)) { continue; }
+
         const char *full_struct_sym = CFCClass_full_struct_sym(klass);
         const char *vtable_var      = CFCClass_full_vtable_var(klass);
 


Reply via email to