summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-inf.h
blob: ba99184c8ca223fd1c6d314129acad2ec545e656 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 *
 * Copyright (C) 2014 Richard Hughes <richard@hughsie.com>
 *
 * Licensed under the GNU Lesser General Public License Version 2.1
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 */

#if !defined (__APPSTREAM_GLIB_H) && !defined (AS_COMPILATION)
#error "Only <appstream-glib.h> can be included directly."
#endif

#ifndef __AS_INF_H
#define __AS_INF_H

#include <glib.h>

G_BEGIN_DECLS

/**
 * AsInfError:
 * @AS_INF_ERROR_FAILED:			Generic failure
 * @AS_INF_ERROR_INVALID_TYPE:			Invalid type
 * @AS_INF_ERROR_NOT_FOUND:			Data not found
 *
 * The error type.
 **/
typedef enum {
	AS_INF_ERROR_FAILED,
	AS_INF_ERROR_INVALID_TYPE,
	AS_INF_ERROR_NOT_FOUND,
	/*< private >*/
	AS_INF_ERROR_LAST
} AsInfError;

#define	AS_INF_ERROR				as_inf_error_quark ()

/**
 * AsInfLoadFlags:
 * @AS_INF_LOAD_FLAG_NONE:			No flags set
 * @AS_INF_LOAD_FLAG_STRICT:			Be strict when loading the file
 * @AS_INF_LOAD_FLAG_CASE_INSENSITIVE:		Load keys and groups case insensitive
 *
 * The flags used when loading INF files.
 **/
typedef enum {
	AS_INF_LOAD_FLAG_NONE			= 0,
	AS_INF_LOAD_FLAG_STRICT			= 1 << 0,
	AS_INF_LOAD_FLAG_CASE_INSENSITIVE	= 1 << 1,
	/*< private >*/
	AS_INF_LOAD_FLAG_LAST
} AsInfLoadFlags;

GQuark		 as_inf_error_quark		(void);
gboolean	 as_inf_load_data		(GKeyFile	*keyfile,
						 const gchar	*data,
						 AsInfLoadFlags	 flags,
						 GError		**error)
G_DEPRECATED;
gboolean	 as_inf_load_file		(GKeyFile	*keyfile,
						 const gchar	*filename,
						 AsInfLoadFlags	 flags,
						 GError		**error)
G_DEPRECATED;
gchar		*as_inf_get_driver_version	(GKeyFile	*keyfile,
						 guint64	*timestamp,
						 GError		**error)
G_DEPRECATED;

G_END_DECLS

#endif /* __AS_INF_H */