File: parse_manifest.c

package info (click to toggle)
gxr 0.15.1-2~bpo10+1
  • links: PTS, VCS
  • area: main
  • in suites: buster-backports
  • size: 1,728 kB
  • sloc: ansic: 15,256; sh: 72; xml: 71; awk: 35; makefile: 12
file content (43 lines) | stat: -rw-r--r-- 1,093 bytes parent folder | download | duplicates (4)
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
/*
 * gxr
 * Copyright 2019 Collabora Ltd.
 * Author: Christoph Haag <christoph.haag@collabora.com>
 * SPDX-License-Identifier: MIT
 */

#include <gxr.h>

int
main ()
{
  GError *error = NULL;
  GInputStream *actions_stream =
    g_resources_open_stream ("/res/bindings/actions.json",
                             G_RESOURCE_LOOKUP_FLAGS_NONE,
                             &error);
    if (error)
      {
        g_print ("Unable to load action resource: %s\n", error->message);
        g_error_free (error);
        return 1;
      }

    GInputStream *bindings_stream =
      g_resources_open_stream ("/res/bindings/bindings_knuckles_controller.json",
                               G_RESOURCE_LOOKUP_FLAGS_NONE,
                               &error);
      if (error)
      {
        g_print ("Unable to load binding resource: %s\n", error->message);
        g_error_free (error);
        return 1;
      }


  GxrManifest *manifest = gxr_manifest_new ();
  gxr_manifest_load (manifest, actions_stream, bindings_stream);

  g_object_unref (actions_stream);

  g_object_unref (manifest);
}