]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/edit.c
Remove SQLite2 scripts
[bacula/bacula] / bacula / src / lib / edit.c
index 480253920fb337ec8c61445f8b59ec36abff8ecb..a26ca61aba1a08f5bc0c08f7cde5a30a020bb48d 100644 (file)
@@ -1,14 +1,7 @@
-/*
- *   edit.c  edit string to ascii, and ascii to internal
- *
- *    Kern Sibbald, December MMII
- *
- *   Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2002-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2009 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *   edit.c  edit string to ascii, and ascii to internal
+ *
+ *    Kern Sibbald, December MMII
+ *
+ *   Version $Id$
+ */
 
 #include "bacula.h"
 #include <math.h>
@@ -406,6 +406,27 @@ bool is_a_number(const char *n)
    return digit_seen && *n==0;
 }
 
+/*
+ * Check if specified string is a list of numbers or not
+ */
+bool is_a_number_list(const char *n)
+{
+   bool previous_digit = false; 
+   bool digit_seen = false;
+   while (*n) {
+      if (B_ISDIGIT(*n)) {
+         previous_digit=true;
+         digit_seen = true;
+      } else if (*n == ',' && previous_digit) {
+         previous_digit = false;
+      } else {
+         return false;
+      }
+      n++;
+   }
+   return digit_seen && *n==0; 
+}
+
 /*
  * Check if the specified string is an integer
  */