2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2011-2012 Free Software Foundation Europe e.V.
6 The main author of Bacula is Kern Sibbald, with contributions from
7 many others, a complete list can be found in the file AUTHORS.
8 This program is Free Software; you can redistribute it and/or
9 modify it under the terms of version three of the GNU Affero General Public
10 License as published by the Free Software Foundation and included
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU Affero General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 Bacula(R) is a registered trademark of Kern Sibbald.
24 The licensor of Bacula is the Free Software Foundation Europe
25 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
26 Switzerland, email:ftf@fsfeurope.org.
29 * Kern Sibbald, January MMXII
31 * Selection list. A string of integers separated by commas
32 * representing items selected. Ranges of the form nn-mm
37 * Loop var through each member of list
39 #define foreach_sellist(var, list) \
40 for((var)=(list)->first(); (var)>=0; (var)=(list)->next() )
43 class sellist : public SMARTALLOC {
54 bool set_string(char *string, bool scan);
58 /* size() valid only if scan enabled on string */
59 int size() const { return num_items; };
60 char *get_list() { return str; };
61 /* if errmsg == NULL, no error */
62 const char *get_errmsg() { return errmsg; };
66 * Initialize the list structure
68 inline sellist::sellist()
80 inline sellist::~sellist()
90 * error if returns -1 and errmsg set
91 * end of items if returns -1 and errmsg NULL
93 inline int64_t sellist::first()
100 * Reset to walk list from beginning
102 inline void sellist::begin()