Export structure of the rule list, for `bcquery's benefit.
authormdw <mdw>
Thu, 23 Apr 1998 13:27:31 +0000 (13:27 +0000)
committermdw <mdw>
Thu, 23 Apr 1998 13:27:31 +0000 (13:27 +0000)
src/rule.c
src/rule.h

index 83fe6f4..7f1e9f7 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: rule.c,v 1.5 1998/01/12 16:46:25 mdw Exp $
+ * $Id: rule.c,v 1.6 1998/04/23 13:27:31 mdw Exp $
  *
  * Managing rule sets
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------*
  *
  * $Log: rule.c,v $
+ * Revision 1.6  1998/04/23 13:27:31  mdw
+ * Export structure of the rule list, for `bcquery's benefit.
+ *
  * Revision 1.5  1998/01/12 16:46:25  mdw
  * Fix copyright date.
  *
 #include "userdb.h"
 #include "utils.h"
 
-/*----- Type definitions --------------------------------------------------*/
-
-/* --- Rule block --- */
-
-typedef struct rule {
-  struct rule *next;                   /* Next rule in the list */
-  class_node *host;                    /* Hosts this rule applies to */
-  class_node *from;                    /* From users in this class */
-  class_node *to;                              /* To users in this class */
-  class_node *cmd;                     /* To run commands in this class */
-} rule;
-
 /*----- Static variables --------------------------------------------------*/
 
 static rule *rule__list;               /* List of rules */
@@ -131,6 +122,20 @@ void rule_end(void)
   }
 }
 
+/* --- @rule_list@ --- *
+ *
+ * Arguments:  ---
+ *
+ * Returns:    The list of rules.
+ *
+ * Use:                Returns the address of the first node in the rule list.
+ */
+
+rule *rule_list(void)
+{
+  return (rule__list);
+}
+
 /* --- @rule_add@ --- *
  *
  * Arguments:  @class_node *host@ = class of hosts this rule applies to
@@ -143,7 +148,8 @@ void rule_end(void)
  * Use:                Registers another rule.
  */
 
-void rule_add(class_node *host, class_node *from, class_node *to, class_node *cmd)
+void rule_add(class_node *host, class_node *from,
+             class_node *to, class_node *cmd)
 {
   rule *r = xmalloc(sizeof(*r));
 
index fb6f816..0594d87 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: rule.h,v 1.5 1998/01/12 16:46:26 mdw Exp $
+ * $Id: rule.h,v 1.6 1998/04/23 13:27:31 mdw Exp $
  *
  * Managing rule sets
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------*
  *
  * $Log: rule.h,v $
+ * Revision 1.6  1998/04/23 13:27:31  mdw
+ * Export structure of the rule list, for `bcquery's benefit.
+ *
  * Revision 1.5  1998/01/12 16:46:26  mdw
  * Fix copyright date.
  *
 #  include "class.h"
 #endif
 
+/*----- Type definitions --------------------------------------------------*/
+
+/* --- Rule block --- */
+
+typedef struct rule {
+  struct rule *next;                   /* Next rule in the list */
+  class_node *host;                    /* Hosts this rule applies to */
+  class_node *from;                    /* From users in this class */
+  class_node *to;                      /* To users in this class */
+  class_node *cmd;                     /* To run commands in this class */
+} rule;
+
 /*----- Functions provided ------------------------------------------------*/
 
 /* --- @rule_init@ --- *
@@ -92,6 +107,17 @@ extern void rule_init(void);
 
 extern void rule_end(void);
 
+/* --- @rule_list@ --- *
+ *
+ * Arguments:  ---
+ *
+ * Returns:    The list of rules.
+ *
+ * Use:                Returns the address of the first node in the rule list.
+ */
+
+extern rule *rule_list(void);
+
 /* --- @rule_add@ --- *
  *
  * Arguments:  @class_node *host@ = class of hosts this rule applies to