Add some missing includes
[blerg.git] / database / util.c
1 /* Blerg is (C) 2011 The Dominion of Awesome, and is distributed under a
2  * BSD-style license.  Please see the COPYING file for details.
3  */
4
5 #include "database.h"
6 #include "config.h"
7
8 int valid_name_len(const char *name, int maxlength) {
9         int i;
10
11         for (i = 0; i < maxlength; i++) {
12                 if (name[i] == 0) break;
13                 if (!VALID_CHAR(name[i])) return 0;
14         }
15
16         if (i >= maxlength)
17                 return 0;
18
19         return 1;
20 }
21
22 int valid_tag_name(const char *name) {
23         return valid_name_len(name, MAX_TAG_LENGTH);
24 }
25
26 int valid_name(const char *name) {
27         return valid_name_len(name, 32);
28 }