2
* libdpkg - Debian packaging suite library routines
3
* namevalue.h - name value structure handling
5
* Copyright © 1994,1995 Ian Jackson <ian@chiark.greenend.org.uk>
6
* Copyright © 2009-2011 Guillem Jover <guillem@debian.org>
8
* This is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
#ifndef LIBDPKG_NAMEVALUE_H
23
#define LIBDPKG_NAMEVALUE_H
25
#include <dpkg/macros.h>
35
#define NAMEVALUE_DEF(n, v) \
36
[v] = { .name = n, .value = v, .length = sizeof(n) - 1 }
37
#define NAMEVALUE_FALLBACK_DEF(n, v) \
38
[v] = { .name = n, .value = v, .length = 0 }
40
const struct namevalue *namevalue_find_by_name(const struct namevalue *head,
45
#endif /* LIBDPKG_NAMEVALUE_H */