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/02/20 05:49:20 UTC

[lucy-commits] svn commit: r1072495 - in /incubator/lucy/trunk/clownfish: lib/Clownfish.xs lib/Clownfish/Class.pm src/CFCClass.c src/CFCClass.h

Author: marvin
Date: Sun Feb 20 04:49:20 2011
New Revision: 1072495

URL: http://svn.apache.org/viewvc?rev=1072495&view=rev
Log:
Start moving member variables for CFCClass from Perl to C, beginning with
'cnick'.

Modified:
    incubator/lucy/trunk/clownfish/lib/Clownfish.xs
    incubator/lucy/trunk/clownfish/lib/Clownfish/Class.pm
    incubator/lucy/trunk/clownfish/src/CFCClass.c
    incubator/lucy/trunk/clownfish/src/CFCClass.h

Modified: incubator/lucy/trunk/clownfish/lib/Clownfish.xs
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/lib/Clownfish.xs?rev=1072495&r1=1072494&r2=1072495&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/lib/Clownfish.xs (original)
+++ incubator/lucy/trunk/clownfish/lib/Clownfish.xs Sun Feb 20 04:49:20 2011
@@ -111,6 +111,22 @@ _destroy(self)
 PPCODE:
     CFCClass_destroy(self);
 
+void
+_set_or_get(self, ...)
+    CFCClass *self;
+ALIAS:
+    get_cnick = 2
+PPCODE:
+{
+    START_SET_OR_GET_SWITCH
+        case 2: {
+                const char *value = CFCClass_get_cnick(self);
+                retval = newSVpvn(value, strlen(value));
+            }
+            break;
+    END_SET_OR_GET_SWITCH
+}
+
 
 MODULE = Clownfish    PACKAGE = Clownfish::DocuComment
 

Modified: incubator/lucy/trunk/clownfish/lib/Clownfish/Class.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/lib/Clownfish/Class.pm?rev=1072495&r1=1072494&r2=1072495&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/lib/Clownfish/Class.pm (original)
+++ incubator/lucy/trunk/clownfish/lib/Clownfish/Class.pm Sun Feb 20 04:49:20 2011
@@ -167,7 +167,6 @@ sub create {
     my $self = $either->_new(
         @args{qw( parcel exposure class_name class_cnick micro_sym )} );
 
-    $cnick{$self}             = $self->get_class_cnick;
     $struct_sym{$self}        = $struct_sym;
     $parent_class_name{$self} = $parent_class_name;
     $source_class{$self}      = $source_class;
@@ -202,7 +201,6 @@ sub create {
 
 sub DESTROY {
     my $self = shift;
-    delete $cnick{$self};
     delete $struct_sym{$self};
     delete $parent_class_name{$self};
     delete $source_class{$self};
@@ -242,7 +240,6 @@ sub include_h {
 
 sub has_attribute { exists $_[0]->_get_attributes->{ $_[1] } }
 
-sub get_cnick             { $cnick{ +shift } }
 sub get_struct_sym        { $struct_sym{ +shift } }
 sub get_parent_class_name { $parent_class_name{ +shift } }
 sub get_source_class      { $source_class{ +shift } }

Modified: incubator/lucy/trunk/clownfish/src/CFCClass.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCClass.c?rev=1072495&r1=1072494&r2=1072495&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCClass.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCClass.c Sun Feb 20 04:49:20 2011
@@ -63,3 +63,9 @@ CFCClass_destroy(CFCClass *self)
     CFCSymbol_destroy((CFCSymbol*)self);
 }
 
+const char*
+CFCClass_get_cnick(CFCClass *self)
+{
+    return CFCSymbol_get_class_cnick((CFCSymbol*)self);
+}
+

Modified: incubator/lucy/trunk/clownfish/src/CFCClass.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCClass.h?rev=1072495&r1=1072494&r2=1072495&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCClass.h (original)
+++ incubator/lucy/trunk/clownfish/src/CFCClass.h Sun Feb 20 04:49:20 2011
@@ -32,5 +32,8 @@ CFCClass_init(CFCClass *self, struct CFC
 void
 CFCClass_destroy(CFCClass *self);
 
+const char*
+CFCClass_get_cnick(CFCClass *self);
+
 #endif /* H_CFCCLASS */