summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-inf.h
blob: ec6e7a625aa1608e9903b0964dcd7eb3b189157b (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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 *
 * Copyright (C) 2014 Richard Hughes <richard@hughsie.com>
 *
 * SPDX-License-Identifier: LGPL-2.1+
 */

#pragma once

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

#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