* [SEMANAGE] Annotate objects
@ 2005-12-23 6:34 Ivan Gyurdiev
2006-01-02 18:50 ` Joshua Brindle
0 siblings, 1 reply; 3+ messages in thread
From: Ivan Gyurdiev @ 2005-12-23 6:34 UTC (permalink / raw)
To: SELinux List; +Cc: Stephen Smalley
[-- Attachment #1: Type: text/plain, Size: 89 bytes --]
This patch adds comments that explain the object relationships, to avoid
confusion...
[-- Attachment #2: libsemanage2.annotate_oop.diff --]
[-- Type: text/x-patch, Size: 4674 bytes --]
diff -Naurp --exclude-from excludes old/libsemanage/src/boolean_record.c new/libsemanage/src/boolean_record.c
--- old/libsemanage/src/boolean_record.c 2005-12-14 11:04:24.000000000 -0500
+++ new/libsemanage/src/boolean_record.c 2005-12-23 00:34:37.000000000 -0500
@@ -1,5 +1,11 @@
/* Copyright (C) 2005 Red Hat, Inc. */
+/* Object: semanage_bool_t (Policy Boolean)
+ * Object: semanage_bool_key_t (Policy Boolean Key)
+ * Implements: record_t (Database Record)
+ * Implements: record_key_t (Database Record Key)
+ */
+
#include <sepol/boolean_record.h>
typedef sepol_bool_t semanage_bool_t;
diff -Naurp --exclude-from excludes old/libsemanage/src/database_file.c new/libsemanage/src/database_file.c
--- old/libsemanage/src/database_file.c 2005-12-23 00:05:59.000000000 -0500
+++ new/libsemanage/src/database_file.c 2005-12-23 00:29:12.000000000 -0500
@@ -1,5 +1,10 @@
/* Copyright (C) 2005 Red Hat, Inc. */
+/* Object: dbase_file_t (File)
+ * Extends: dbase_llist_t (Linked List)
+ * Implements: dbase_t (Database)
+ */
+
struct dbase_file;
typedef struct dbase_file dbase_t;
#define DBASE_DEFINED
diff -Naurp --exclude-from excludes old/libsemanage/src/database_llist.c new/libsemanage/src/database_llist.c
--- old/libsemanage/src/database_llist.c 2005-12-23 00:06:00.000000000 -0500
+++ new/libsemanage/src/database_llist.c 2005-12-23 00:35:38.000000000 -0500
@@ -1,5 +1,9 @@
/* Copyright (C) 2005 Red Hat, Inc. */
+/* Object: dbase_llist_t (Linked List)
+ * Partially Implements: dbase_t (Database)
+ */
+
struct dbase_llist;
typedef struct dbase_llist dbase_t;
#define DBASE_DEFINED
@@ -30,7 +34,6 @@ hidden int dbase_llist_cache_prepend(
if (dbase->cache_tail == NULL)
dbase->cache_tail = entry;
dbase->cache = entry;
-
dbase->cache_sz++;
return STATUS_SUCCESS;
diff -Naurp --exclude-from excludes old/libsemanage/src/database_policydb.c new/libsemanage/src/database_policydb.c
--- old/libsemanage/src/database_policydb.c 2005-12-13 11:08:25.000000000 -0500
+++ new/libsemanage/src/database_policydb.c 2005-12-23 00:28:46.000000000 -0500
@@ -1,5 +1,9 @@
/* Copyright (C) 2005 Red Hat, Inc. */
+/* Object: dbase_policydb_t (Policy)
+ * Implements: dbase_t (Database)
+ */
+
struct dbase_policydb;
typedef struct dbase_policydb dbase_t;
#define DBASE_DEFINED
diff -Naurp --exclude-from excludes old/libsemanage/src/iface_record.c new/libsemanage/src/iface_record.c
--- old/libsemanage/src/iface_record.c 2005-12-14 11:04:24.000000000 -0500
+++ new/libsemanage/src/iface_record.c 2005-12-23 00:34:04.000000000 -0500
@@ -1,5 +1,11 @@
/* Copyright (C) 2005 Red Hat, Inc. */
+/* Object: semanage_iface_t (Network Interface)
+ * Object: semanage_iface_key_t (Network Interface Key)
+ * Implements: record_t (Database Record)
+ * Implements: record_key_t (Database Record Key)
+ */
+
#include <sepol/context_record.h>
#include <sepol/iface_record.h>
diff -Naurp --exclude-from excludes old/libsemanage/src/port_record.c new/libsemanage/src/port_record.c
--- old/libsemanage/src/port_record.c 2005-12-14 11:04:24.000000000 -0500
+++ new/libsemanage/src/port_record.c 2005-12-23 00:34:28.000000000 -0500
@@ -1,5 +1,11 @@
/* Copyright (C) 2005 Red Hat, Inc. */
+/* Object: semanage_port_t (Network Port)
+ * Object: semanage_port_key_t (Network Port Key)
+ * Implements: record_t (Database Record)
+ * Implements: record_key_t (Database Record Key)
+ */
+
#include <sepol/context_record.h>
#include <sepol/port_record.h>
diff -Naurp --exclude-from excludes old/libsemanage/src/seuser_record.c new/libsemanage/src/seuser_record.c
--- old/libsemanage/src/seuser_record.c 2005-12-14 11:04:25.000000000 -0500
+++ new/libsemanage/src/seuser_record.c 2005-12-23 00:32:07.000000000 -0500
@@ -1,5 +1,11 @@
/* Copyright (C) 2005 Red Hat, Inc. */
+/* Object: semanage_seuser_t (Unix User)
+ * Object: semanage_seuser_key_t (Unix User Key)
+ * Implements: record_t (Database Record)
+ * Implements: record_key_t (Database Record Key)
+ */
+
struct semanage_seuser;
struct semanage_seuser_key;
typedef struct semanage_seuser record_t;
diff -Naurp --exclude-from excludes old/libsemanage/src/user_record.c new/libsemanage/src/user_record.c
--- old/libsemanage/src/user_record.c 2005-12-14 11:04:25.000000000 -0500
+++ new/libsemanage/src/user_record.c 2005-12-23 00:34:53.000000000 -0500
@@ -1,5 +1,11 @@
/* Copyright (C) 2005 Red Hat, Inc. */
+/* Object: semanage_user_t (SELinux User/Class)
+ * Object: semanage_user_key_t (SELinux User/Class Key)
+ * Implements: record_t (Database Record)
+ * Implements: record_key_t (Database Record Key)
+ */
+
#include <sepol/user_record.h>
typedef sepol_user_t semanage_user_t;
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [SEMANAGE] Annotate objects
2005-12-23 6:34 [SEMANAGE] Annotate objects Ivan Gyurdiev
@ 2006-01-02 18:50 ` Joshua Brindle
2006-01-02 17:08 ` Ivan Gyurdiev
0 siblings, 1 reply; 3+ messages in thread
From: Joshua Brindle @ 2006-01-02 18:50 UTC (permalink / raw)
To: Ivan Gyurdiev; +Cc: SELinux List, Stephen Smalley
Ivan Gyurdiev wrote:
> This patch adds comments that explain the object relationships, to avoid
> confusion...
>
I don't think this avoids confusion at all. This isn't Java and C
programmers aren't going to automatically understand Implements,
Extends, etc.
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [SEMANAGE] Annotate objects
2006-01-02 18:50 ` Joshua Brindle
@ 2006-01-02 17:08 ` Ivan Gyurdiev
0 siblings, 0 replies; 3+ messages in thread
From: Ivan Gyurdiev @ 2006-01-02 17:08 UTC (permalink / raw)
To: Joshua Brindle; +Cc: SELinux List, Stephen Smalley
>> This patch adds comments that explain the object relationships, to
>> avoid confusion...
>>
>
> I don't think this avoids confusion at all. This isn't Java and C
> programmers aren't going to automatically understand Implements,
> Extends, etc.
Yes, the vocabulary draws from Java, because I have some Java background
- feel free to suggest something different, and I'll change the
comments. Implements -> interface (?) Extends -> inherits from (?)
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-01-02 18:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-23 6:34 [SEMANAGE] Annotate objects Ivan Gyurdiev
2006-01-02 18:50 ` Joshua Brindle
2006-01-02 17:08 ` Ivan Gyurdiev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.