You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/06/25 17:47:31 UTC

[7/8] git commit: Documentation for CFCPerlPod

Documentation for CFCPerlPod


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/2f193bc7
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/2f193bc7
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/2f193bc7

Branch: refs/heads/cfc-pod-wip2
Commit: 2f193bc70142de5e2d40033d1de9b1566471def8
Parents: 2473af7
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sat Jul 20 20:12:03 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Jun 25 17:45:00 2014 +0200

----------------------------------------------------------------------
 .../buildlib/Clownfish/CFC/Build/Binding.pm     | 26 ++++++++++++++++++++
 compiler/src/CFCPerlPod.h                       |  6 +++++
 2 files changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2f193bc7/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm b/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
index 8c5d9a4..16d4d80 100644
--- a/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
+++ b/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
@@ -19,6 +19,7 @@ use strict;
 sub bind_all {
     my $class = shift;
     $class->bind_perlclass;
+    $class->bind_perlpod;
 }
 
 sub bind_perlclass {
@@ -60,6 +61,31 @@ sub bind_perlclass {
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
+sub bind_perlpod {
+    class_from_c('CFCPerlPod', 'Clownfish::CFC::Binding::Perl::Pod');
+
+    my @exposed = qw(
+        Add_Method
+        Add_Constructor
+        Set_Synopsis
+        Get_Synopsis
+        Set_Description
+        Get_Description
+    );
+
+    my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new;
+    $pod_spec->add_constructor( alias => 'new' );
+    $pod_spec->add_method( method => $_, alias => lc($_) ) for @exposed;
+
+    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
+        parcel     => 'Clownfish',
+        class_name => 'Clownfish::CFC::Binding::Perl::Pod',
+    );
+    $binding->set_pod_spec($pod_spec);
+
+    Clownfish::CFC::Binding::Perl::Class->register($binding);
+}
+
 # Quick and dirty hack to create a CFC class from a C header.
 sub class_from_c {
     my ($cfc_class_name, $class_name) = @_;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2f193bc7/compiler/src/CFCPerlPod.h
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerlPod.h b/compiler/src/CFCPerlPod.h
index 3fb94eb..4d4a476 100644
--- a/compiler/src/CFCPerlPod.h
+++ b/compiler/src/CFCPerlPod.h
@@ -28,6 +28,8 @@ typedef struct CFCPerlPod CFCPerlPod;
 struct CFCFunction;
 struct CFCClass;
 
+/** Constructor
+ */
 CFCPerlPod*
 CFCPerlPod_new(void);
 
@@ -79,6 +81,8 @@ char*
 CFCPerlPod_constructors_pod(CFCPerlPod *self, struct CFCClass *klass);
 
 /** Supply a SYNOPSIS section.
+ *
+ * @param synopsis A string containing the synopsis.
  */
 void
 CFCPerlPod_set_synopsis(CFCPerlPod *self, const char *synopsis);
@@ -89,6 +93,8 @@ const char*
 CFCPerlPod_get_synopsis(CFCPerlPod *self);
 
 /** Supply a DESCRIPTION section.
+ *
+ * @param description A string containing the description.
  */
 void
 CFCPerlPod_set_description(CFCPerlPod *self, const char *description);