]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/class.c
Remove imp.h and exp.h header files
[ngircd-alex.git] / src / ngircd / class.c
index 800e99353647f8758488a30db2d8f41259dc1129..df444fec115c9e3052982df102d18d8cfdc027c4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -16,7 +16,6 @@
  * User class management.
  */
 
-#include "imp.h"
 #include <assert.h>
 #include <string.h>
 
@@ -28,7 +27,6 @@
 #include "match.h"
 #include "stdio.h"
 
-#include "exp.h"
 #include "class.h"
 
 struct list_head My_Classes[CLASS_COUNT];
@@ -50,11 +48,13 @@ Class_Exit(void)
 GLOBAL bool
 Class_GetMemberReason(const int Class, CLIENT *Client, char *reason, size_t len)
 {
-       char str[COMMAND_LEN] = "listed";
+       char str[COMMAND_LEN];
 
        assert(Class < CLASS_COUNT);
        assert(Client != NULL);
 
+       strlcpy(str, "listed", sizeof(str));
+
        if (!Lists_CheckReason(&My_Classes[Class], Client, str, sizeof(str)))
                return false;
 
@@ -98,24 +98,30 @@ Class_HandleServerBans(CLIENT *Client)
 
 
 GLOBAL bool
-Class_AddMask(const int Class, const char *Mask, time_t ValidUntil,
+Class_AddMask(const int Class, const char *Pattern, time_t ValidUntil,
              const char *Reason)
 {
+       char mask[MASK_LEN];
+
        assert(Class < CLASS_COUNT);
-       assert(Mask != NULL);
+       assert(Pattern != NULL);
        assert(Reason != NULL);
 
-       return Lists_Add(&My_Classes[Class], Lists_MakeMask(Mask),
+       Lists_MakeMask(Pattern, mask, sizeof(mask));
+       return Lists_Add(&My_Classes[Class], mask,
                         ValidUntil, Reason);
 }
 
 GLOBAL void
-Class_DeleteMask(const int Class, const char *Mask)
+Class_DeleteMask(const int Class, const char *Pattern)
 {
+       char mask[MASK_LEN];
+
        assert(Class < CLASS_COUNT);
-       assert(Mask != NULL);
+       assert(Pattern != NULL);
 
-       Lists_Del(&My_Classes[Class], Lists_MakeMask(Mask));
+       Lists_MakeMask(Pattern, mask, sizeof(mask));
+       Lists_Del(&My_Classes[Class], mask);
 }
 
 GLOBAL struct list_head *