1 /*
2  * virfirmware.h: Declaration of firmware object and supporting functions
3  *
4  * Copyright (C) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library.  If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
21 #pragma once
22 
23 #include "internal.h"
24 
25 typedef struct _virFirmware virFirmware;
26 struct _virFirmware {
27     char *name;
28     char *nvram;
29 };
30 
31 
32 void
33 virFirmwareFree(virFirmware *firmware);
34 
35 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFirmware, virFirmwareFree);
36 
37 void
38 virFirmwareFreeList(virFirmware **firmwares, size_t nfirmwares);
39 
40 int
41 virFirmwareParse(const char *str, virFirmware *firmware)
42     ATTRIBUTE_NONNULL(2);
43 
44 int
45 virFirmwareParseList(const char *list,
46                      virFirmware ***firmwares,
47                      size_t *nfirmwares)
48     ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
49