fwupd/libfwupdplugin/fu-context-private.h
Richard Hughes b333e0045c Split out a shared system context
There is a lot of code in fwupd that just assigns a shared object type to
a FuPlugin, and then for each device on that plugin assigns that same shared
object to each FuDevice.

Rather than proxy several kinds of information stores over two different levels
of abstraction create a 'context' which contains the shared *system* state
between the daemon, the plugins and the daemon.

This will allow us to hold other per-machine state in the future, for instance
the system battery level or AC state.
2021-04-01 21:11:29 +01:00

30 lines
931 B
C

/*
* Copyright (C) 2021 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include "fu-context.h"
#include "fu-hwids.h"
#include "fu-quirks.h"
FuContext *fu_context_new (void);
gboolean fu_context_load_hwinfo (FuContext *self,
GError **error);
gboolean fu_context_load_quirks (FuContext *self,
FuQuirksLoadFlags flags,
GError **error);
void fu_context_set_runtime_versions (FuContext *self,
GHashTable *runtime_versions);
void fu_context_set_compile_versions (FuContext *self,
GHashTable *compile_versions);
void fu_context_add_firmware_gtype (FuContext *self,
const gchar *id,
GType gtype);
GPtrArray *fu_context_get_firmware_gtype_ids (FuContext *self);
GType fu_context_get_firmware_gtype_by_id (FuContext *self,
const gchar *id);
GPtrArray *fu_context_get_udev_subsystems (FuContext *self);