Add CFCClass_in_parcel and CFCClass_in_same_parcel

Simple but useful helper functions.


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

Branch: refs/heads/master
Commit: bfd19d209bb8d7088aa42c7cd26b539c283a1005
Parents: 7ce20fd
Author: Nick Wellnhofer <wellnho...@aevum.de>
Authored: Tue Feb 28 16:25:15 2017 +0100
Committer: Nick Wellnhofer <wellnho...@aevum.de>
Committed: Thu Mar 2 20:08:02 2017 +0100

----------------------------------------------------------------------
 compiler/src/CFCClass.c | 10 ++++++++++
 compiler/src/CFCClass.h |  6 ++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/bfd19d20/compiler/src/CFCClass.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCClass.c b/compiler/src/CFCClass.c
index 360630a..e7a1aa1 100644
--- a/compiler/src/CFCClass.c
+++ b/compiler/src/CFCClass.c
@@ -885,6 +885,16 @@ CFCClass_needs_documentation(CFCClass *self) {
            && CFCParcel_is_installed(self->parcel);
 }
 
+int
+CFCClass_in_parcel(CFCClass *self, struct CFCParcel *parcel) {
+    return CFCClass_get_parcel(self) == parcel;
+}
+
+int
+CFCClass_in_same_parcel(CFCClass *self, CFCClass *other) {
+    return CFCClass_get_parcel(self) == CFCClass_get_parcel(other);
+}
+
 const char*
 CFCClass_get_struct_sym(CFCClass *self) {
     return self->struct_sym;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/bfd19d20/compiler/src/CFCClass.h
----------------------------------------------------------------------
diff --git a/compiler/src/CFCClass.h b/compiler/src/CFCClass.h
index bf86f61..223306d 100644
--- a/compiler/src/CFCClass.h
+++ b/compiler/src/CFCClass.h
@@ -258,6 +258,12 @@ CFCClass_abstract(CFCClass *self);
 int
 CFCClass_needs_documentation(CFCClass *self);
 
+int
+CFCClass_in_parcel(CFCClass *self, struct CFCParcel *parcel);
+
+int
+CFCClass_in_same_parcel(CFCClass *self, CFCClass *other);
+
 const char*
 CFCClass_get_struct_sym(CFCClass *self);
 

Reply via email to