Expunge revision histories in files.
[become] / src / rule.c
index 2a40a73..9d59549 100644 (file)
@@ -1,10 +1,10 @@
 /* -*-c-*-
  *
- * $Id: rule.c,v 1.4 1997/09/17 10:27:17 mdw Exp $
+ * $Id: rule.c,v 1.8 2004/04/08 01:36:20 mdw Exp $
  *
  * Managing rule sets
  *
- * (c) 1997 EBI
+ * (c) 1998 EBI
  */
 
 /*----- Licensing notice --------------------------------------------------*
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: rule.c,v $
- * Revision 1.4  1997/09/17 10:27:17  mdw
- * Use rewritten class handler.
- *
- * Revision 1.3  1997/08/20  16:22:36  mdw
- * Rename `rule_reinit' to `rule_end' for more sensible restart.  Don't try
- * to trace when tracing's turned off.
- *
- * Revision 1.2  1997/08/04 10:24:25  mdw
- * Sources placed under CVS control.
- *
- * Revision 1.1  1997/07/21  13:47:45  mdw
- * Initial revision
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 /* --- ANSI headers --- */
 #include <netdb.h>
 #include <unistd.h>
 
+/* --- mLib headers --- */
+
+#include <mLib/alloc.h>
+#include <mLib/report.h>
+#include <mLib/trace.h>
+
 /* --- Local headers --- */
 
 #include "become.h"
 #include "class.h"
 #include "rule.h"
 #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 --------------------------------------------------*/
 
@@ -128,6 +103,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
@@ -140,7 +129,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));