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/06/25 03:00:23 UTC

[lucy-commits] svn commit: r1139474 - in /incubator/lucy/trunk/clownfish/src: CFCClass.c CFCClass.h CFCMethod.c CFCMethod.h CFCVariable.c CFCVariable.h

Author: marvin
Date: Sat Jun 25 01:00:22 2011
New Revision: 1139474

URL: http://svn.apache.org/viewvc?rev=1139474&view=rev
Log:
Add a few accessors, wrappers, and cached string values.

Modified:
    incubator/lucy/trunk/clownfish/src/CFCClass.c
    incubator/lucy/trunk/clownfish/src/CFCClass.h
    incubator/lucy/trunk/clownfish/src/CFCMethod.c
    incubator/lucy/trunk/clownfish/src/CFCMethod.h
    incubator/lucy/trunk/clownfish/src/CFCVariable.c
    incubator/lucy/trunk/clownfish/src/CFCVariable.h

Modified: incubator/lucy/trunk/clownfish/src/CFCClass.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCClass.c?rev=1139474&r1=1139473&r2=1139474&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCClass.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCClass.c Sat Jun 25 01:00:22 2011
@@ -79,6 +79,7 @@ struct CFCClass {
     char *full_struct_sym;
     char *short_vtable_var;
     char *full_vtable_var;
+    char *full_vtable_hidden;
     char *full_vtable_type;
     char *include_h;
 };
@@ -160,10 +161,11 @@ CFCClass_do_create(CFCClass *self, struc
     const char *prefix = CFCClass_get_prefix(self);
     size_t prefix_len = strlen(prefix);
     size_t struct_sym_len = strlen(self->struct_sym);
-    self->short_vtable_var = (char*)MALLOCATE(struct_sym_len + 1);
-    self->full_struct_sym  = (char*)MALLOCATE(prefix_len + struct_sym_len + 1);
-    self->full_vtable_var  = (char*)MALLOCATE(prefix_len + struct_sym_len + 1);
-    self->full_vtable_type = (char*)MALLOCATE(prefix_len + struct_sym_len + 3 + 1);
+    self->short_vtable_var   = (char*)MALLOCATE(struct_sym_len + 1);
+    self->full_struct_sym    = (char*)MALLOCATE(prefix_len + struct_sym_len + 1);
+    self->full_vtable_var    = (char*)MALLOCATE(prefix_len + struct_sym_len + 1);
+    self->full_vtable_hidden = (char*)MALLOCATE(prefix_len + struct_sym_len + 3 + 1);
+    self->full_vtable_type   = (char*)MALLOCATE(prefix_len + struct_sym_len + 3 + 1);
     size_t i;
     for (i = 0; i < struct_sym_len; i++) {
         self->short_vtable_var[i] = toupper(self->struct_sym[i]);
@@ -175,6 +177,7 @@ CFCClass_do_create(CFCClass *self, struc
     }
     self->full_vtable_var[i] = '\0';
     sprintf(self->full_vtable_type, "%s_VT", self->full_vtable_var);
+    sprintf(self->full_vtable_hidden, "%s_vt", self->full_vtable_var);
 
     // Cache the relative path to the autogenerated C header file.
     size_t source_class_len = strlen(self->source_class);
@@ -240,6 +243,7 @@ CFCClass_destroy(CFCClass *self) {
     FREEMEM(self->short_vtable_var);
     FREEMEM(self->full_struct_sym);
     FREEMEM(self->full_vtable_var);
+    FREEMEM(self->full_vtable_hidden);
     FREEMEM(self->full_vtable_type);
     CFCSymbol_destroy((CFCSymbol*)self);
 }
@@ -660,6 +664,11 @@ CFCClass_methods(CFCClass *self) {
     return self->methods;
 }
 
+size_t
+CFCClass_num_methods(CFCClass *self) {
+    return self->num_methods;
+}
+
 CFCVariable**
 CFCClass_member_vars(CFCClass *self) {
     return self->member_vars;
@@ -739,6 +748,11 @@ CFCClass_full_vtable_var(CFCClass *self)
 }
 
 const char*
+CFCClass_full_vtable_hidden(CFCClass *self) {
+    return self->full_vtable_hidden;
+}
+
+const char*
 CFCClass_full_vtable_type(CFCClass *self) {
     return self->full_vtable_type;
 }

Modified: incubator/lucy/trunk/clownfish/src/CFCClass.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCClass.h?rev=1139474&r1=1139473&r2=1139474&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCClass.h (original)
+++ incubator/lucy/trunk/clownfish/src/CFCClass.h Sat Jun 25 01:00:22 2011
@@ -106,6 +106,9 @@ CFCClass_functions(CFCClass *self);
 struct CFCMethod**
 CFCClass_methods(CFCClass *self);
 
+size_t
+CFCClass_num_methods(CFCClass *self);
+
 struct CFCVariable**
 CFCClass_member_vars(CFCClass *self);
 
@@ -152,6 +155,9 @@ const char*
 CFCClass_full_vtable_var(CFCClass *self);
 
 const char*
+CFCClass_full_vtable_hidden(CFCClass *self);
+
+const char*
 CFCClass_full_vtable_type(CFCClass *self);
 
 const char*

Modified: incubator/lucy/trunk/clownfish/src/CFCMethod.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCMethod.c?rev=1139474&r1=1139473&r2=1139474&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCMethod.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCMethod.c Sat Jun 25 01:00:22 2011
@@ -395,3 +395,8 @@ CFCMethod_implementing_func_sym(CFCMetho
     return CFCFunction_full_func_sym((CFCFunction*)self);
 }
 
+const char*
+CFCMethod_short_implementing_func_sym(CFCMethod *self) {
+    return CFCFunction_short_func_sym((CFCFunction*)self);
+}
+

Modified: incubator/lucy/trunk/clownfish/src/CFCMethod.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCMethod.h?rev=1139474&r1=1139473&r2=1139474&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCMethod.h (original)
+++ incubator/lucy/trunk/clownfish/src/CFCMethod.h Sat Jun 25 01:00:22 2011
@@ -133,6 +133,9 @@ CFCMethod_get_param_list(CFCMethod *self
 const char*
 CFCMethod_implementing_func_sym(CFCMethod *self);
 
+const char*
+CFCMethod_short_implementing_func_sym(CFCMethod *self);
+
 #ifdef __cplusplus
 }
 #endif

Modified: incubator/lucy/trunk/clownfish/src/CFCVariable.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCVariable.c?rev=1139474&r1=1139473&r2=1139474&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCVariable.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCVariable.c Sat Jun 25 01:00:22 2011
@@ -137,6 +137,11 @@ CFCVariable_micro_sym(CFCVariable *self)
 }
 
 const char*
+CFCVariable_short_sym(CFCVariable *self) {
+    return CFCSymbol_short_sym((CFCSymbol*)self);
+}
+
+const char*
 CFCVariable_full_sym(CFCVariable *self) {
     return CFCSymbol_full_sym((CFCSymbol*)self);
 }

Modified: incubator/lucy/trunk/clownfish/src/CFCVariable.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCVariable.h?rev=1139474&r1=1139473&r2=1139474&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCVariable.h (original)
+++ incubator/lucy/trunk/clownfish/src/CFCVariable.h Sat Jun 25 01:00:22 2011
@@ -58,6 +58,9 @@ const char*
 CFCVariable_micro_sym(CFCVariable *self);
 
 const char*
+CFCVariable_short_sym(CFCVariable *self);
+
+const char*
 CFCVariable_full_sym(CFCVariable *self);
 
 #ifdef __cplusplus