summaryrefslogtreecommitdiffstats
path: root/plugins/utils_disk.c
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2006-07-12 12:15:42 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2006-07-12 12:15:42 (GMT)
commitee03f1415acc9f4f8901593d9045244fbb3bbbb0 (patch)
tree32faccd0a0ac25373fec4823499969e62c2541ae /plugins/utils_disk.c
parentdf23fd75267c830f85a74cfde3020981c37e82a5 (diff)
downloadmonitoring-plugins-ee03f1415acc9f4f8901593d9045244fbb3bbbb0.tar.gz
Moving check_disk functions into utils_disk.c and testing them
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1447 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/utils_disk.c')
-rw-r--r--plugins/utils_disk.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/plugins/utils_disk.c b/plugins/utils_disk.c
new file mode 100644
index 0000000..6380df3
--- /dev/null
+++ b/plugins/utils_disk.c
@@ -0,0 +1,62 @@
1/****************************************************************************
2* Utils for check_disk
3*
4* License: GPL
5* Copyright (c) 1999-2006 nagios-plugins team
6*
7* Last Modified: $Date$
8*
9* Description:
10*
11* This file contains utilities for check_disk. These are tested by libtap
12*
13* License Information:
14*
15* This program is free software; you can redistribute it and/or modify
16* it under the terms of the GNU General Public License as published by
17* the Free Software Foundation; either version 2 of the License, or
18* (at your option) any later version.
19*
20* This program is distributed in the hope that it will be useful,
21* but WITHOUT ANY WARRANTY; without even the implied warranty of
22* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23* GNU General Public License for more details.
24*
25* You should have received a copy of the GNU General Public License
26* along with this program; if not, write to the Free Software
27* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28*
29* $Id$
30*
31*****************************************************************************/
32
33#include "common.h"
34#include "utils_disk.h"
35
36void
37np_add_name (struct name_list **list, const char *name)
38{
39 struct name_list *new_entry;
40 new_entry = (struct name_list *) malloc (sizeof *new_entry);
41 new_entry->name = (char *) name;
42 new_entry->next = *list;
43 *list = new_entry;
44}
45
46/* Returns TRUE if name is in list */
47int
48np_find_name (struct name_list *list, const char *name)
49{
50 const struct name_list *n;
51
52 if (list == NULL || name == NULL) {
53 return FALSE;
54 }
55 for (n = list; n; n = n->next) {
56 if (!strcmp(name, n->name)) {
57 return TRUE;
58 }
59 }
60 return FALSE;
61}
62