trivial: add missing gtk-doc fields for many files in src/

This commit is contained in:
Mario Limonciello 2019-11-25 19:44:53 -06:00 committed by Richard Hughes
parent 0bf1c330aa
commit 1a680f3b18
24 changed files with 1068 additions and 37 deletions

View File

@ -59,6 +59,8 @@ fu_archive_init (FuArchive *self)
* Finds the blob referenced by filename
*
* Returns: (transfer none): a #GBytes, or %NULL if the filename was not found
*
* Since: 1.2.2
**/
GBytes *
fu_archive_lookup_by_fn (FuArchive *self, const gchar *fn, GError **error)
@ -82,7 +84,7 @@ fu_archive_lookup_by_fn (FuArchive *self, const gchar *fn, GError **error)
/**
* fu_archive_iterate:
* @self: A #FuArchive
* @callback: A #FuArchiveIterateFunc.
* @callback: (scope call): A #FuArchiveIterateFunc.
* @user_data: User data.
* @error: A #GError, or %NULL
*
@ -90,6 +92,8 @@ fu_archive_lookup_by_fn (FuArchive *self, const gchar *fn, GError **error)
* of the files found. If any @callback returns %FALSE scanning is aborted.
*
* Returns: True if no @callback returned FALSE
*
* Since: 1.3.4
*/
gboolean
fu_archive_iterate (FuArchive *self,
@ -225,6 +229,8 @@ fu_archive_load (FuArchive *self, GBytes *blob, FuArchiveFlags flags, GError **e
* Parses @data as an archive and decompresses all files to memory blobs.
*
* Returns: a #FuArchive, or %NULL if the archive was invalid in any way.
*
* Since: 1.2.2
**/
FuArchive *
fu_archive_new (GBytes *data, FuArchiveFlags flags, GError **error)

View File

@ -12,6 +12,14 @@
#include "fu-chunk.h"
/**
* SECTION:fu-chunk
* @short_description: A packet of chunked data
*
* An object that represents a packet of data.
*
*/
/**
* fu_chunk_new:
* @idx: the packet number
@ -23,6 +31,8 @@
* Creates a new packet of chunked data.
*
* Return value: (transfer full): a #FuChunk
*
* Since: 1.1.2
**/
FuChunk *
fu_chunk_new (guint32 idx,
@ -47,6 +57,8 @@ fu_chunk_new (guint32 idx,
* Converts the chunked packet to a string representation.
*
* Return value: (transfer full): A string
*
* Since: 1.1.2
**/
gchar *
fu_chunk_to_string (FuChunk *item)
@ -76,6 +88,8 @@ fu_chunk_to_string (FuChunk *item)
* Converts all the chunked packets in an array to a string representation.
*
* Return value: (transfer full): A string
*
* Since: 1.0.1
**/
gchar *
fu_chunk_array_to_string (GPtrArray *chunks)
@ -101,6 +115,8 @@ fu_chunk_array_to_string (GPtrArray *chunks)
* cross a package boundary and is less that a specific transfer size.
*
* Return value: (element-type FuChunk): array of packets
*
* Since: 1.1.2
**/
GPtrArray *
fu_chunk_array_new (const guint8 *data,
@ -182,6 +198,8 @@ fu_chunk_array_new (const guint8 *data,
* cross a package boundary and is less that a specific transfer size.
*
* Return value: (element-type FuChunk): array of packets
*
* Since: 1.1.2
**/
GPtrArray *
fu_chunk_array_new_from_bytes (GBytes *blob,

View File

@ -383,6 +383,8 @@ fu_common_cab_set_container_checksum_cb (XbBuilderFixup *self,
* Create an AppStream silo from a cabinet archive.
*
* Returns: a #XbSilo, or %NULL on error
*
* Since: 1.2.0
**/
XbSilo *
fu_common_cab_build_silo (GBytes *blob, guint64 size_max, GError **error)

View File

@ -355,6 +355,18 @@ fu_common_version_convert_base (FwupdVersionFormat fmt)
return fmt;
}
/**
* fu_common_version_verify_format:
* @version: A string, e.g. "0x1234"
* @fmt: a #FwupdVersionFormat
* @error: A #GError or %NULL
*
* Verifies if a version matches the input format.
*
* Returns: TRUE or FALSE
*
* Since: 1.2.9
**/
gboolean
fu_common_version_verify_format (const gchar *version,
FwupdVersionFormat fmt,

View File

@ -39,6 +39,8 @@
* Recursively removes a directory.
*
* Returns: %TRUE for success, %FALSE otherwise
*
* Since: 0.9.7
**/
gboolean
fu_common_rmtree (const gchar *directory, GError **error)
@ -113,7 +115,9 @@ fu_common_get_file_list_internal (GPtrArray *files, const gchar *directory, GErr
* If any path under @directory cannot be accessed due to permissions an error
* will be returned.
*
* Returns: (element-type: utf8) (transfer container): array of files, or %NULL for error
* Returns: (transfer container): array of files, or %NULL for error
*
* Since: 1.0.6
**/
GPtrArray *
fu_common_get_files_recursive (const gchar *path, GError **error)
@ -131,6 +135,8 @@ fu_common_get_files_recursive (const gchar *path, GError **error)
* Creates any required directories, including any parent directories.
*
* Returns: %TRUE for success
*
* Since: 0.9.7
**/
gboolean
fu_common_mkdir_parent (const gchar *filename, GError **error)
@ -160,6 +166,8 @@ fu_common_mkdir_parent (const gchar *filename, GError **error)
* required.
*
* Returns: %TRUE for success
*
* Since: 0.9.5
**/
gboolean
fu_common_set_contents_bytes (const gchar *filename, GBytes *bytes, GError **error)
@ -188,6 +196,8 @@ fu_common_set_contents_bytes (const gchar *filename, GBytes *bytes, GError **err
* Reads a blob of data from a file.
*
* Returns: a #GBytes, or %NULL for failure
*
* Since: 0.9.7
**/
GBytes *
fu_common_get_contents_bytes (const gchar *filename, GError **error)
@ -211,6 +221,8 @@ fu_common_get_contents_bytes (const gchar *filename, GError **error)
* Note: this will close the fd when done
*
* Returns: (transfer full): a #GBytes, or %NULL
*
* Since: 0.9.5
**/
GBytes *
fu_common_get_contents_fd (gint fd, gsize count, GError **error)
@ -270,6 +282,8 @@ fu_common_extract_archive_entry (struct archive_entry *entry, const gchar *dir)
* Extracts an achive to a directory.
*
* Returns: %TRUE for success
*
* Since: 0.9.7
**/
gboolean
fu_common_extract_archive (GBytes *blob, const gchar *dir, GError **error)
@ -353,6 +367,17 @@ fu_common_add_argv (GPtrArray *argv, const gchar *fmt, ...)
g_ptr_array_add (argv, g_strdup (split[i]));
}
/**
* fu_common_find_program_in_path:
* @basename: The program to search
* @error: A #GError, or %NULL
*
* Looks for a program in the PATH variable
*
* Returns: a new #gchar, or %NULL for error
*
* Since: 1.1.2
**/
gchar *
fu_common_find_program_in_path (const gchar *basename, GError **error)
{
@ -411,6 +436,8 @@ fu_common_test_namespace_support (GError **error)
* 5. The temporary location is deleted
*
* Returns: a new #GBytes, or %NULL for error
*
* Since: 0.9.7
**/
GBytes *
fu_common_firmware_builder (GBytes *bytes,
@ -631,6 +658,8 @@ fu_common_spawn_cancelled_cb (GCancellable *cancellable, FuCommonSpawnHelper *he
* standard error will be forwarded to @handler_cb as whole lines.
*
* Returns: %TRUE for success
*
* Since: 0.9.7
**/
gboolean
fu_common_spawn_sync (const gchar * const * argv,
@ -688,6 +717,8 @@ fu_common_spawn_sync (const gchar * const * argv,
* @endian: A #FuEndianType, e.g. %G_LITTLE_ENDIAN
*
* Writes a value to a buffer using a specified endian.
*
* Since: 1.0.3
**/
void
fu_common_write_uint16 (guint8 *buf, guint16 val_native, FuEndianType endian)
@ -713,6 +744,8 @@ fu_common_write_uint16 (guint8 *buf, guint16 val_native, FuEndianType endian)
* @endian: A #FuEndianType, e.g. %G_LITTLE_ENDIAN
*
* Writes a value to a buffer using a specified endian.
*
* Since: 1.0.3
**/
void
fu_common_write_uint32 (guint8 *buf, guint32 val_native, FuEndianType endian)
@ -739,6 +772,8 @@ fu_common_write_uint32 (guint8 *buf, guint32 val_native, FuEndianType endian)
* Read a value from a buffer using a specified endian.
*
* Returns: a value in host byte-order
*
* Since: 1.0.3
**/
guint16
fu_common_read_uint16 (const guint8 *buf, FuEndianType endian)
@ -766,6 +801,8 @@ fu_common_read_uint16 (const guint8 *buf, FuEndianType endian)
* Read a value from a buffer using a specified endian.
*
* Returns: a value in host byte-order
*
* Since: 1.0.3
**/
guint32
fu_common_read_uint32 (const guint8 *buf, FuEndianType endian)
@ -793,6 +830,8 @@ fu_common_read_uint32 (const guint8 *buf, FuEndianType endian)
* prefixed with "0x" where they are parsed as base 16.
*
* Returns: integer value, or 0x0 for error
*
* Since: 1.1.2
**/
guint64
fu_common_strtoull (const gchar *str)
@ -814,6 +853,8 @@ fu_common_strtoull (const gchar *str)
* Removes leading and trailing whitespace from a constant string.
*
* Returns: newly allocated string
*
* Since: 1.1.2
**/
gchar *
fu_common_strstrip (const gchar *str)
@ -890,6 +931,8 @@ fu_common_error_array_matches_any (GPtrArray *errors, FwupdError *error_codes)
* completely bespoke error where required.
*
* Returns: (transfer full): a #GError, never %NULL
*
* Since: 1.0.8
**/
GError *
fu_common_error_array_get_best (GPtrArray *errors)
@ -948,6 +991,8 @@ fu_common_error_array_get_best (GPtrArray *errors)
* environment variables, for instance %FWUPD_DATADIR.
*
* Returns: a system path, or %NULL if invalid
*
* Since: 1.0.8
**/
gchar *
fu_common_get_path (FuPathKind path_kind)
@ -1154,6 +1199,17 @@ fu_common_strwidth (const gchar *text)
return width;
}
/**
* fu_common_string_append_kv:
* @str: A #GString
* @idt: The indent
* @key: A string to append
* @value: a string to append
*
* Appends a key and string value to a string
*
* Since: 1.2.4
*/
void
fu_common_string_append_kv (GString *str, guint idt, const gchar *key, const gchar *value)
{
@ -1192,6 +1248,17 @@ fu_common_string_append_kv (GString *str, guint idt, const gchar *key, const gch
}
}
/**
* fu_common_string_append_ku:
* @str: A #GString
* @idt: The indent
* @key: A string to append
* @value: guint64
*
* Appends a key and unsigned integer to a string
*
* Since: 1.2.4
*/
void
fu_common_string_append_ku (GString *str, guint idt, const gchar *key, guint64 value)
{
@ -1199,6 +1266,17 @@ fu_common_string_append_ku (GString *str, guint idt, const gchar *key, guint64 v
fu_common_string_append_kv (str, idt, key, tmp);
}
/**
* fu_common_string_append_kx:
* @str: A #GString
* @idt: The indent
* @key: A string to append
* @value: guint64
*
* Appends a key and hex integer to a string
*
* Since: 1.2.4
*/
void
fu_common_string_append_kx (GString *str, guint idt, const gchar *key, guint64 value)
{
@ -1206,6 +1284,17 @@ fu_common_string_append_kx (GString *str, guint idt, const gchar *key, guint64 v
fu_common_string_append_kv (str, idt, key, tmp);
}
/**
* fu_common_string_append_kb:
* @str: A #GString
* @idt: The indent
* @key: A string to append
* @value: Boolean
*
* Appends a key and boolean value to a string
*
* Since: 1.2.4
*/
void
fu_common_string_append_kb (GString *str, guint idt, const gchar *key, gboolean value)
{
@ -1368,6 +1457,8 @@ fu_common_bytes_align (GBytes *bytes, gsize blksz, gchar padval)
* Checks if a byte array are just empty (0xff) bytes.
*
* Return value: %TRUE if @bytes is empty
*
* Since: 1.2.6
**/
gboolean
fu_common_bytes_is_empty (GBytes *bytes)
@ -1392,6 +1483,8 @@ fu_common_bytes_is_empty (GBytes *bytes)
* Compares the buffers for equality.
*
* Return value: %TRUE if @buf1 and @buf2 are identical
*
* Since: 1.3.2
**/
gboolean
fu_common_bytes_compare_raw (const guint8 *buf1, gsize bufsz1,
@ -1437,6 +1530,8 @@ fu_common_bytes_compare_raw (const guint8 *buf1, gsize bufsz1,
* Compares the buffers for equality.
*
* Return value: %TRUE if @bytes1 and @bytes2 are identical
*
* Since: 1.2.6
**/
gboolean
fu_common_bytes_compare (GBytes *bytes1, GBytes *bytes2, GError **error)
@ -1463,6 +1558,8 @@ fu_common_bytes_compare (GBytes *bytes1, GBytes *bytes2, GError **error)
* Pads a GBytes to a given @sz with `0xff`.
*
* Return value: (transfer full): a #GBytes
*
* Since: 1.3.1
**/
GBytes *
fu_common_bytes_pad (GBytes *bytes, gsize sz)
@ -1493,6 +1590,8 @@ fu_common_bytes_pad (GBytes *bytes, gsize sz)
* Finds the canonicalized absolute filename for a path.
*
* Return value: A filename, or %NULL if invalid or not found
*
* Since: 1.2.6
**/
gchar *
fu_common_realpath (const gchar *filename, GError **error)
@ -1536,6 +1635,8 @@ fu_common_realpath (const gchar *filename, GError **error)
* to the last token.
*
* Return value: a newly-allocated NULL-terminated array of strings
*
* Since: 1.3.1
**/
gchar **
fu_common_strnsplit (const gchar *str, gsize sz,
@ -1571,6 +1672,8 @@ fu_common_strnsplit (const gchar *str, gsize sz,
* malicious data from a device or firmware could cause memory corruption.
*
* Return value: %TRUE if the bytes were copied, %FALSE otherwise
*
* Since: 1.3.1
**/
gboolean
fu_memcpy_safe (guint8 *dst, gsize dst_sz, gsize dst_offset,
@ -1633,6 +1736,8 @@ fu_memcpy_safe (guint8 *dst, gsize dst_sz, gsize dst_offset,
* malicious data from a device or firmware could cause memory corruption.
*
* Return value: %TRUE if @value was set, %FALSE otherwise
*
* Since: 1.3.3
**/
gboolean
fu_common_read_uint8_safe (const guint8 *buf,
@ -1667,6 +1772,8 @@ fu_common_read_uint8_safe (const guint8 *buf,
* malicious data from a device or firmware could cause memory corruption.
*
* Return value: %TRUE if @value was set, %FALSE otherwise
*
* Since: 1.3.3
**/
gboolean
fu_common_read_uint16_safe (const guint8 *buf,
@ -1702,6 +1809,8 @@ fu_common_read_uint16_safe (const guint8 *buf,
* malicious data from a device or firmware could cause memory corruption.
*
* Return value: %TRUE if @value was set, %FALSE otherwise
*
* Since: 1.3.3
**/
gboolean
fu_common_read_uint32_safe (const guint8 *buf,
@ -1721,12 +1830,31 @@ fu_common_read_uint32_safe (const guint8 *buf,
return TRUE;
}
/**
* fu_byte_array_append_uint8:
* @array: A #GByteArray
* @data: #guint8
*
* Adds a 8 bit integer to a byte array
*
* Since: 1.3.1
**/
void
fu_byte_array_append_uint8 (GByteArray *array, guint8 data)
{
g_byte_array_append (array, &data, sizeof(data));
}
/**
* fu_byte_array_append_uint16:
* @array: A #GByteArray
* @data: #guint16
* @endian: #FuEndianType
*
* Adds a 16 bit integer to a byte array
*
* Since: 1.3.1
**/
void
fu_byte_array_append_uint16 (GByteArray *array, guint16 data, FuEndianType endian)
{
@ -1735,6 +1863,16 @@ fu_byte_array_append_uint16 (GByteArray *array, guint16 data, FuEndianType endia
g_byte_array_append (array, buf, sizeof(buf));
}
/**
* fu_byte_array_append_uint32:
* @array: A #GByteArray
* @data: #guint32
* @endian: #FuEndianType
*
* Adds a 32 bit integer to a byte array
*
* Since: 1.3.1
**/
void
fu_byte_array_append_uint32 (GByteArray *array, guint32 data, FuEndianType endian)
{

View File

@ -84,6 +84,8 @@ fu_device_locker_init (FuDeviceLocker *self)
* Think of this object as the device ownership.
*
* Returns: a #FuDeviceLocker, or %NULL if the @open_func failed.
*
* Since: 1.0.0
**/
FuDeviceLocker *
fu_device_locker_new (gpointer device, GError **error)
@ -130,6 +132,8 @@ fu_device_locker_new (gpointer device, GError **error)
* Think of this object as the device ownership.
*
* Returns: a #FuDeviceLocker, or %NULL if the @open_func failed.
*
* Since: 1.0.0
**/
FuDeviceLocker *
fu_device_locker_new_full (gpointer device,

View File

@ -324,6 +324,16 @@ fu_device_set_priority (FuDevice *self, guint priority)
priv->priority = priority;
}
/**
* fu_device_get_equivalent_id:
* @self: A #FuDevice
*
* Gets any equivalent ID for a device
*
* Returns: (transfer none): a #gchar or NULL
*
* Since: 0.6.1
**/
const gchar *
fu_device_get_equivalent_id (FuDevice *self)
{
@ -332,6 +342,15 @@ fu_device_get_equivalent_id (FuDevice *self)
return priv->equivalent_id;
}
/**
* fu_device_set_equivalent_id:
* @self: A #FuDevice
* @equivalent_id: A string
*
* Sets any equivalent ID for a device
*
* Since: 0.6.1
**/
void
fu_device_set_equivalent_id (FuDevice *self, const gchar *equivalent_id)
{
@ -342,7 +361,7 @@ fu_device_set_equivalent_id (FuDevice *self, const gchar *equivalent_id)
}
/**
* fu_device_get_alternate:
* fu_device_get_alternate_id:
* @self: A #FuDevice
*
* Gets any alternate device ID. An alternate device may be linked to the primary
@ -361,9 +380,9 @@ fu_device_get_alternate_id (FuDevice *self)
}
/**
* fu_device_set_alternate:
* fu_device_set_alternate_id:
* @self: A #FuDevice
* @alternate: Another #FuDevice
* @alternate_id: Another #FuDevice
*
* Sets any alternate device ID. An alternate device may be linked to the primary
* device in some way.
@ -447,6 +466,19 @@ fu_device_get_parent (FuDevice *self)
return priv->parent;
}
/**
* fu_device_set_parent:
* @self: A #FuDevice
* @parent: A #FuDevice
*
* Sets any parent device. An parent device is logically "above" the current
* device and this may be reflected in client tools.
*
* This information also allows the plugin to optionally verify the parent
* device, for instance checking the parent device firmware version.
*
* Since: 1.0.8
**/
void
fu_device_set_parent (FuDevice *self, FuDevice *parent)
{
@ -795,6 +827,16 @@ fu_device_set_quirk_kv (FuDevice *self,
return FALSE;
}
/**
* fu_device_get_specialized_gtype:
* @self: A #FuDevice
*
* Gets the specialized type of the device
*
* Returns:#GType
*
* Since: 1.3.3
**/
GType
fu_device_get_specialized_gtype (FuDevice *self)
{
@ -948,7 +990,17 @@ fu_device_has_guid (FuDevice *self, const gchar *guid)
return fwupd_device_has_guid (FWUPD_DEVICE (self), guid);
}
/* private */
/**
* fu_device_add_instance_id_full:
* @self: A #FuDevice
* @instance_id: A Instance ID, e.g. `WacomAES`
* @flags: A #FuDeviceInstanceFlags
*
* Adds an instance ID with all paramters set
*
*
* Since: 1.2.9
**/
void
fu_device_add_instance_id_full (FuDevice *self,
const gchar *instance_id,
@ -1511,6 +1563,16 @@ fu_device_get_physical_id (FuDevice *self)
return priv->physical_id;
}
/**
* fu_device_add_flag:
* @self: A #FuDevice
* @flag: A #FwupdDeviceFlags
*
* Adds a device flag to the device
*
* Since: 0.1.0
**/
void
fu_device_add_flag (FuDevice *self, FwupdDeviceFlags flag)
{
@ -2126,6 +2188,7 @@ fu_device_reload (FuDevice *self, GError **error)
/**
* fu_device_prepare:
* @self: A #FuDevice
* @flags: A #FwupdInstallFlags
* @error: A #GError
*
* Prepares a device for update. A different plugin can handle each of
@ -2154,6 +2217,7 @@ fu_device_prepare (FuDevice *self, FwupdInstallFlags flags, GError **error)
/**
* fu_device_cleanup:
* @self: A #FuDevice
* @flags: A #FwupdInstallFlags
* @error: A #GError
*
* Cleans up a device after an update. A different plugin can handle each of
@ -2467,8 +2531,6 @@ fu_device_activate (FuDevice *self, GError **error)
* This should be done in case the backing device has changed, for instance if
* a USB device has been replugged.
*
* Returns: %TRUE for success
*
* Since: 1.1.2
**/
void
@ -2660,6 +2722,13 @@ fu_device_finalize (GObject *object)
G_OBJECT_CLASS (fu_device_parent_class)->finalize (object);
}
/**
* fu_device_new:
*
* Creates a new #Fudevice
*
* Since: 0.1.0
**/
FuDevice *
fu_device_new (void)
{

View File

@ -11,6 +11,15 @@
#include "fu-common.h"
#include "fu-dfu-firmware.h"
/**
* SECTION:fu-dfu-firmware
* @short_description: DFU firmware image
*
* An object that represents a DFU firmware image.
*
* See also: #FuFirmware
*/
typedef struct {
guint16 vid;
guint16 pid;
@ -39,6 +48,8 @@ fu_dfu_firmware_to_string (FuFirmware *firmware, guint idt, GString *str)
* Gets the vendor ID, or 0xffff for no restriction.
*
* Return value: integer
*
* Since: 1.3.3
**/
guint16
fu_dfu_firmware_get_vid (FuDfuFirmware *self)
@ -55,6 +66,8 @@ fu_dfu_firmware_get_vid (FuDfuFirmware *self)
* Gets the product ID, or 0xffff for no restriction.
*
* Return value: integer
*
* Since: 1.3.3
**/
guint16
fu_dfu_firmware_get_pid (FuDfuFirmware *self)
@ -71,6 +84,8 @@ fu_dfu_firmware_get_pid (FuDfuFirmware *self)
* Gets the device ID, or 0xffff for no restriction.
*
* Return value: integer
*
* Since: 1.3.3
**/
guint16
fu_dfu_firmware_get_release (FuDfuFirmware *self)
@ -87,6 +102,8 @@ fu_dfu_firmware_get_release (FuDfuFirmware *self)
* Gets the file format version with is 0x0100 by default.
*
* Return value: integer
*
* Since: 1.3.3
**/
guint16
fu_dfu_firmware_get_version (FuDfuFirmware *self)
@ -102,6 +119,8 @@ fu_dfu_firmware_get_version (FuDfuFirmware *self)
* @vid: vendor ID, or 0xffff if the firmware should match any vendor
*
* Sets the vendor ID.
*
* Since: 1.3.3
**/
void
fu_dfu_firmware_set_vid (FuDfuFirmware *self, guint16 vid)
@ -117,6 +136,8 @@ fu_dfu_firmware_set_vid (FuDfuFirmware *self, guint16 vid)
* @pid: product ID, or 0xffff if the firmware should match any product
*
* Sets the product ID.
*
* Since: 1.3.3
**/
void
fu_dfu_firmware_set_pid (FuDfuFirmware *self, guint16 pid)
@ -129,9 +150,11 @@ fu_dfu_firmware_set_pid (FuDfuFirmware *self, guint16 pid)
/**
* fu_dfu_firmware_set_release:
* @self: a #FuDfuFirmware
* @release: device ID, or 0xffff if the firmware should match any release
* @release: release, or 0xffff if the firmware should match any release
*
* Sets the device ID.
* Sets the release for the dfu firmware.
*
* Since: 1.3.3
**/
void
fu_dfu_firmware_set_release (FuDfuFirmware *self, guint16 release)
@ -147,6 +170,8 @@ fu_dfu_firmware_set_release (FuDfuFirmware *self, guint16 release)
* @version: integer
*
* Sets the file format version.
*
* Since: 1.3.3
**/
void
fu_dfu_firmware_set_version (FuDfuFirmware *self, guint16 version)
@ -366,6 +391,13 @@ fu_dfu_firmware_class_init (FuDfuFirmwareClass *klass)
klass_firmware->write = fu_dfu_firmware_write;
}
/**
* fu_dfu_firmware_new:
*
* Creates a new #FuFirmware of sub type Dfu
*
* Since: 1.3.3
**/
FuFirmware *
fu_dfu_firmware_new (void)
{

View File

@ -22,6 +22,8 @@
* length of @data. Checking the size must be done in the caller.
*
* Return value: A parsed value, or 0 for error
*
* Since: 1.3.1
**/
guint8
fu_firmware_strparse_uint4 (const gchar *data)
@ -42,6 +44,8 @@ fu_firmware_strparse_uint4 (const gchar *data)
* length of @data. Checking the size must be done in the caller.
*
* Return value: A parsed value, or 0 for error
*
* Since: 1.3.1
**/
guint8
fu_firmware_strparse_uint8 (const gchar *data)
@ -62,6 +66,8 @@ fu_firmware_strparse_uint8 (const gchar *data)
* length of @data. Checking the size must be done in the caller.
*
* Return value: A parsed value, or 0 for error
*
* Since: 1.3.1
**/
guint16
fu_firmware_strparse_uint16 (const gchar *data)
@ -82,6 +88,8 @@ fu_firmware_strparse_uint16 (const gchar *data)
* length of @data. Checking the size must be done in the caller.
*
* Return value: A parsed value, or 0 for error
*
* Since: 1.3.1
**/
guint32
fu_firmware_strparse_uint24 (const gchar *data)
@ -102,6 +110,8 @@ fu_firmware_strparse_uint24 (const gchar *data)
* length of @data. Checking the size must be done in the caller.
*
* Return value: A parsed value, or 0 for error
*
* Since: 1.3.1
**/
guint32
fu_firmware_strparse_uint32 (const gchar *data)

View File

@ -354,7 +354,6 @@ fu_firmware_image_class_init (FuFirmwareImageClass *klass)
/**
* fu_firmware_image_new:
* @id: Optional ID
* @bytes: Optional #GBytes
*
* Creates an empty firmware_image object.

View File

@ -17,6 +17,7 @@
* @short_description: a firmware file
*
* An object that represents a firmware file.
* See also: #FuDfuFirmware, #FuIhexFirmware, #FuSrecFirmware
*/
typedef struct {
@ -66,7 +67,7 @@ fu_firmware_set_version (FuFirmware *self, const gchar *version)
/**
* fu_firmware_tokenize:
* @self: A #FuFirmware
* @image: A #GBytes
* @fw: A #GBytes
* @flags: some #FwupdInstallFlags, e.g. %FWUPD_INSTALL_FLAG_FORCE
* @error: A #GError, or %NULL
*
@ -98,7 +99,7 @@ fu_firmware_tokenize (FuFirmware *self, GBytes *fw,
/**
* fu_firmware_parse_full:
* @self: A #FuFirmware
* @image: A #GBytes
* @fw: A #GBytes
* @addr_start: Start address, useful for ignoring a bootloader
* @addr_end: End address, useful for ignoring config bytes
* @flags: some #FwupdInstallFlags, e.g. %FWUPD_INSTALL_FLAG_FORCE
@ -142,7 +143,7 @@ fu_firmware_parse_full (FuFirmware *self,
/**
* fu_firmware_parse:
* @self: A #FuFirmware
* @image: A #GBytes
* @fw: A #GBytes
* @flags: some #FwupdInstallFlags, e.g. %FWUPD_INSTALL_FLAG_FORCE
* @error: A #GError, or %NULL
*
@ -259,7 +260,7 @@ fu_firmware_add_image (FuFirmware *self, FuFirmwareImage *img)
/**
* fu_firmware_get_images:
* @self: a #FuPlugin
* @self: a #FuFirmware
*
* Returns all the images in the firmware.
*
@ -520,7 +521,7 @@ fu_firmware_new (void)
/**
* fu_firmware_new_from_bytes:
* @self: A #GBytes image
* @fw: A #GBytes image
*
* Creates a firmware object with the provided image set as default.
*

View File

@ -68,7 +68,7 @@ gboolean fu_firmware_write_file (FuFirmware *self,
GError **error);
void fu_firmware_add_image (FuFirmware *self,
FuFirmwareImage *image);
FuFirmwareImage *img);
GPtrArray *fu_firmware_get_images (FuFirmware *self);
FuFirmwareImage *fu_firmware_get_image_by_id (FuFirmware *self,
const gchar *id,

View File

@ -457,6 +457,18 @@ fu_history_get_device_flags_filtered (FuDevice *device)
return flags;
}
/**
* fu_history_modify_device:
* @self: A #FuHistory
* @device: A #FuDevice
* @error: A #GError or NULL
*
* Modify a device in the history database
*
* Returns: @TRUE if successful, @FALSE for failure
*
* Since: 1.0.4
**/
gboolean
fu_history_modify_device (FuHistory *self, FuDevice *device, GError **error)
{
@ -505,6 +517,19 @@ fu_history_modify_device (FuHistory *self, FuDevice *device, GError **error)
return fu_history_stmt_exec (self, stmt, NULL, error);
}
/**
* fu_history_add_device:
* @self: A #FuHistory
* @device: A #FuDevice
* @release: A #FuRelease
* @error: A #GError or NULL
*
* Adds a device to the history database
*
* Returns: @TRUE if successful, @FALSE for failure
*
* Since: 1.0.4
**/
gboolean
fu_history_add_device (FuHistory *self, FuDevice *device, FwupdRelease *release, GError **error)
{
@ -586,6 +611,19 @@ fu_history_add_device (FuHistory *self, FuDevice *device, FwupdRelease *release,
return fu_history_stmt_exec (self, stmt, NULL, error);
}
/**
* fu_history_remove_all_with_state:
* @self: A #FuHistory
* @update_state: A #FwupdUpdateState
* @error: A #GError or NULL
*
* Remove all devices from the history database that match
* state update_state
*
* Returns: @TRUE if successful, @FALSE for failure
*
* Since: 1.0.4
**/
gboolean
fu_history_remove_all_with_state (FuHistory *self,
FwupdUpdateState update_state,
@ -619,6 +657,17 @@ fu_history_remove_all_with_state (FuHistory *self,
return fu_history_stmt_exec (self, stmt, NULL, error);
}
/**
* fu_history_remove_all:
* @self: A #FuHistory
* @error: A #GError or NULL
*
* Remove all devices from the history database
*
* Returns: @TRUE if successful, @FALSE for failure
*
* Since: 1.0.4
**/
gboolean
fu_history_remove_all (FuHistory *self, GError **error)
{
@ -646,6 +695,18 @@ fu_history_remove_all (FuHistory *self, GError **error)
return fu_history_stmt_exec (self, stmt, NULL, error);
}
/**
* fu_history_remove_device:
* @self: A #FuHistory
* @device: A #FuDevice
* @error: A #GError or NULL
*
* Remove a device from the history database
*
* Returns: @TRUE if successful, @FALSE for failure
*
* Since: 1.0.4
**/
gboolean
fu_history_remove_device (FuHistory *self, FuDevice *device, GError **error)
{
@ -678,6 +739,19 @@ fu_history_remove_device (FuHistory *self, FuDevice *device, GError **error)
return fu_history_stmt_exec (self, stmt, NULL, error);
}
/**
* fu_history_get_device_by_id:
* @self: A #FuHistory
* @device_id: A string
* @error: A #GError or NULL
*
* Returns the device from the history database or NULL if not found
*
* Returns: (transfer full): a #FuDevice
*
* Since: 1.0.4
**/
FuDevice *
fu_history_get_device_by_id (FuHistory *self, const gchar *device_id, GError **error)
{
@ -735,7 +809,17 @@ fu_history_get_device_by_id (FuHistory *self, const gchar *device_id, GError **e
}
return g_object_ref (g_ptr_array_index (array_tmp, 0));
}
/**
* fu_history_get_devices:
* @self: A #FuHistory
* @error: A #GError or NULL
*
* Gets the devices in the history database.
*
* Returns: (element-type #FuDevice) (transfer container): devices
*
* Since: 1.0.4
**/
GPtrArray *
fu_history_get_devices (FuHistory *self, GError **error)
{
@ -788,6 +872,17 @@ fu_history_get_devices (FuHistory *self, GError **error)
return array;
}
/**
* fu_history_get_approved_firmware:
* @self: A #FuHistory
* @error: A #GError or NULL
*
* Returns approved firmware records.
*
* Returns: (transfer full) (element-type gchar *): records
*
* Since: 1.2.6
**/
GPtrArray *
fu_history_get_approved_firmware (FuHistory *self, GError **error)
{
@ -830,6 +925,17 @@ fu_history_get_approved_firmware (FuHistory *self, GError **error)
return g_steal_pointer (&array);
}
/**
* fu_history_clear_approved_firmware:
* @self: A #FuHistory
* @error: A #GError or NULL
*
* Clear all approved firmware records
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.2.6
**/
gboolean
fu_history_clear_approved_firmware (FuHistory *self, GError **error)
{
@ -858,6 +964,18 @@ fu_history_clear_approved_firmware (FuHistory *self, GError **error)
return fu_history_stmt_exec (self, stmt, NULL, error);
}
/**
* fu_history_add_approved_firmware:
* @self: A #FuHistory
* @checksum: a string
* @error: A #GError or NULL
*
* Add an approved firmware record to the database
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.2.6
**/
gboolean
fu_history_add_approved_firmware (FuHistory *self,
const gchar *checksum,
@ -915,6 +1033,13 @@ fu_history_finalize (GObject *object)
G_OBJECT_CLASS (fu_history_parent_class)->finalize (object);
}
/**
* fu_history_new:
*
* Creates a new #FuHistory
*
* Since: 1.0.4
**/
FuHistory *
fu_history_new (void)
{

View File

@ -36,6 +36,8 @@ G_DEFINE_TYPE (FuHwids, fu_hwids, G_TYPE_OBJECT)
* for display.
*
* Returns: the string, e.g. `1.2.3`, or %NULL if not found
*
* Since: 0.9.3
**/
const gchar *
fu_hwids_get_value (FuHwids *self, const gchar *key)
@ -51,6 +53,8 @@ fu_hwids_get_value (FuHwids *self, const gchar *key)
* Finds out if a hardware GUID exists.
*
* Returns: %TRUE if the GUID exists
*
* Since: 0.9.3
**/
gboolean
fu_hwids_has_guid (FuHwids *self, const gchar *guid)
@ -65,6 +69,8 @@ fu_hwids_has_guid (FuHwids *self, const gchar *guid)
* Returns all the defined HWIDs
*
* Returns: (transfer none) (element-type utf-8): An array of GUIDs
*
* Since: 0.9.3
**/
GPtrArray *
fu_hwids_get_guids (FuHwids *self)
@ -108,6 +114,8 @@ fu_hwids_get_guid_for_str (const gchar *str, GError **error)
* Gets the replacement key for a well known value.
*
* Returns: the replacement value, e.g. `Manufacturer&ProductName`, or %NULL for error.
*
* Since: 0.9.3
**/
const gchar *
fu_hwids_get_replace_keys (FuHwids *self, const gchar *key)
@ -197,6 +205,8 @@ fu_hwids_get_replace_keys (FuHwids *self, const gchar *key)
* Gets the replacement values for a HardwareID key or plain key.
*
* Returns: a string, e.g. `LENOVO&ThinkPad T440s`, or %NULL for error.
*
* Since: 0.9.3
**/
gchar *
fu_hwids_get_replace_values (FuHwids *self, const gchar *keys, GError **error)
@ -235,6 +245,8 @@ fu_hwids_get_replace_values (FuHwids *self, const gchar *keys, GError **error)
* Gets the GUID for a specific key.
*
* Returns: a string, or %NULL for error.
*
* Since: 0.9.3
**/
gchar *
fu_hwids_get_guid (FuHwids *self, const gchar *keys, GError **error)
@ -316,6 +328,8 @@ fu_hwids_convert_integer_cb (FuSmbios *smbios,
* Reads all the SMBIOS values from the hardware.
*
* Returns: %TRUE for success
*
* Since: 0.9.3
**/
gboolean
fu_hwids_setup (FuHwids *self, FuSmbios *smbios, GError **error)
@ -440,6 +454,13 @@ fu_hwids_init (FuHwids *self)
self->array_guids = g_ptr_array_new_with_free_func (g_free);
}
/**
* fu_hwids_new:
*
* Creates a new #FuHwids
*
* Since: 0.9.3
**/
FuHwids *
fu_hwids_new (void)
{

View File

@ -14,6 +14,15 @@
#include "fu-firmware-common.h"
#include "fu-ihex-firmware.h"
/**
* SECTION:fu-ihex-firmware
* @short_description: Ihex firmware image
*
* An object that represents a Ihex firmware image.
*
* See also: #FuFirmware
*/
struct _FuIhexFirmware {
FuFirmware parent_instance;
GPtrArray *records;
@ -434,6 +443,13 @@ fu_ihex_firmware_class_init (FuIhexFirmwareClass *klass)
klass_firmware->write = fu_ihex_firmware_write;
}
/**
* fu_ihex_firmware_new:
*
* Creates a new #FuFirmware of sub type Ihex
*
* Since: 1.3.1
**/
FuFirmware *
fu_ihex_firmware_new (void)
{

View File

@ -461,6 +461,8 @@ fu_io_channel_init (FuIOChannel *self)
* Creates a new object to write and read from.
*
* Returns: a #FuIOChannel
*
* Since: 1.2.2
**/
FuIOChannel *
fu_io_channel_unix_new (gint fd)
@ -479,6 +481,8 @@ fu_io_channel_unix_new (gint fd)
* Creates a new object to write and read from.
*
* Returns: a #FuIOChannel
*
* Since: 1.2.2
**/
FuIOChannel *
fu_io_channel_new_file (const gchar *filename, GError **error)

View File

@ -141,6 +141,15 @@ fu_plugin_get_name (FuPlugin *self)
return priv->name;
}
/**
* fu_plugin_set_name:
* @self: A #FuPlugin
* @name: A string
*
* Sets the plugin name.
*
* Since: 0.8.0
**/
void
fu_plugin_set_name (FuPlugin *self, const gchar *name)
{
@ -171,6 +180,16 @@ fu_plugin_set_build_hash (FuPlugin *self, const gchar *build_hash)
priv->build_hash = g_strdup (build_hash);
}
/**
* fu_plugin_get_build_hash:
* @self: A #FuPlugin
*
* Gets the build hash a plugin was generated with.
*
* Returns: (transfer none): a #gchar, or %NULL for unset.
*
* Since: 1.2.4
**/
const gchar *
fu_plugin_get_build_hash (FuPlugin *self)
{
@ -303,6 +322,15 @@ fu_plugin_get_usb_context (FuPlugin *self)
return priv->usb_ctx;
}
/**
* fu_plugin_set_usb_context:
* @self: A #FuPlugin
* @usb_ctx: A #FGUsbContext
*
* Sets the shared USB context for a plugin
*
* Since: 0.8.0
**/
void
fu_plugin_set_usb_context (FuPlugin *self, GUsbContext *usb_ctx)
{
@ -346,6 +374,16 @@ fu_plugin_set_enabled (FuPlugin *self, gboolean enabled)
priv->enabled = enabled;
}
/**
* fu_plugin_guess_name_from_fn:
* @filename: filename to guess
*
* Tries to guess the name of the plugin from a filename
*
* Returns: (transfer full): the guessed name of the plugin
*
* Since: 1.0.8
**/
gchar *
fu_plugin_guess_name_from_fn (const gchar *filename)
{
@ -359,6 +397,18 @@ fu_plugin_guess_name_from_fn (const gchar *filename)
return name;
}
/**
* fu_plugin_open:
* @self: A #FuPlugin
* @filename: The shared object filename to open
* @error: A #GError or NULL
*
* Opens the plugin module
*
* Returns: TRUE for success, FALSE for fail
*
* Since: 0.8.0
**/
gboolean
fu_plugin_open (FuPlugin *self, const gchar *filename, GError **error)
{
@ -557,7 +607,7 @@ fu_plugin_get_hwid_replace_value (FuPlugin *self, const gchar *keys, GError **er
* Returns all the HWIDs defined in the system. All hardware IDs on a
* specific system can be shown using the `fwupdmgr hwids` command.
*
* Returns: (transfer none) (element-type utf-8): An array of GUIDs
* Returns: (transfer none) (element-type utf8): An array of GUIDs
*
* Since: 1.1.1
**/
@ -695,6 +745,15 @@ fu_plugin_get_smbios_data (FuPlugin *self, guint8 structure_type)
return fu_smbios_get_data (priv->smbios, structure_type, NULL);
}
/**
* fu_plugin_set_hwids:
* @self: A #FuPlugin
* @hwids: A #FuHwids
*
* Sets the hwids for a plugin
*
* Since: 0.9.7
**/
void
fu_plugin_set_hwids (FuPlugin *self, FuHwids *hwids)
{
@ -702,6 +761,15 @@ fu_plugin_set_hwids (FuPlugin *self, FuHwids *hwids)
g_set_object (&priv->hwids, hwids);
}
/**
* fu_plugin_set_udev_subsystems:
* @self: A #FuPlugin
* @udev_subsystems: A #GPtrArray
*
* Sets the udev subsystems used by a plugin
*
* Since: 1.1.2
**/
void
fu_plugin_set_udev_subsystems (FuPlugin *self, GPtrArray *udev_subsystems)
{
@ -711,6 +779,15 @@ fu_plugin_set_udev_subsystems (FuPlugin *self, GPtrArray *udev_subsystems)
priv->udev_subsystems = g_ptr_array_ref (udev_subsystems);
}
/**
* fu_plugin_set_quirks:
* @self: A #FuPlugin
* @quirks: A #FuQuirks
*
* Sets the quirks for a plugin
*
* Since: 1.0.1
**/
void
fu_plugin_set_quirks (FuPlugin *self, FuQuirks *quirks)
{
@ -736,6 +813,15 @@ fu_plugin_get_quirks (FuPlugin *self)
return priv->quirks;
}
/**
* fu_plugin_set_runtime_versions:
* @self: A #FuPlugin
* @runtime_versions: A #GHashTables
*
* Sets the runtime versions for a plugin
*
* Since: 1.0.7
**/
void
fu_plugin_set_runtime_versions (FuPlugin *self, GHashTable *runtime_versions)
{
@ -766,6 +852,15 @@ fu_plugin_add_runtime_version (FuPlugin *self,
g_strdup (version));
}
/**
* fu_plugin_set_compile_versions:
* @self: A #FuPlugin
* @compile_versions: A #GHashTables
*
* Sets the compile time versions for a plugin
*
* Since: 1.0.7
**/
void
fu_plugin_set_compile_versions (FuPlugin *self, GHashTable *compile_versions)
{
@ -828,7 +923,7 @@ fu_plugin_lookup_quirk_by_id (FuPlugin *self, const gchar *group, const gchar *k
* an integer value. Values are assumed base 10, unless prefixed with "0x"
* where they are parsed as base 16.
*
* Returns: (transfer none): value from the database, or 0 if not found
* Returns: guint64 id or 0 if not found
*
* Since: 1.1.2
**/
@ -838,6 +933,15 @@ fu_plugin_lookup_quirk_by_id_as_uint64 (FuPlugin *self, const gchar *group, cons
return fu_common_strtoull (fu_plugin_lookup_quirk_by_id (self, group, key));
}
/**
* fu_plugin_set_smbios:
* @self: A #FuPlugin
* @smbios: A #FuSmbios
*
* Sets the smbios for a plugin
*
* Since: 1.0.0
**/
void
fu_plugin_set_smbios (FuPlugin *self, FuSmbios *smbios)
{
@ -971,6 +1075,17 @@ fu_plugin_device_read_firmware (FuPlugin *self, FuDevice *device, GError **error
return fu_device_attach (device, error);
}
/**
* fu_plugin_runner_startup:
* @self: a #FuPlugin
* @error: a #GError or NULL
*
* Runs the startup routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 0.8.0
**/
gboolean
fu_plugin_runner_startup (FuPlugin *self, GError **error)
{
@ -1188,6 +1303,17 @@ fu_plugin_runner_device_array_generic (FuPlugin *self, GPtrArray *devices,
return TRUE;
}
/**
* fu_plugin_runner_coldplug:
* @self: a #FuPlugin
* @error: a #GError or NULL
*
* Runs the coldplug routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 0.8.0
**/
gboolean
fu_plugin_runner_coldplug (FuPlugin *self, GError **error)
{
@ -1224,6 +1350,17 @@ fu_plugin_runner_coldplug (FuPlugin *self, GError **error)
return TRUE;
}
/**
* fu_plugin_runner_recoldplug:
* @self: a #FuPlugin
* @error: a #GError or NULL
*
* Runs the recoldplug routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.0.4
**/
gboolean
fu_plugin_runner_recoldplug (FuPlugin *self, GError **error)
{
@ -1261,6 +1398,17 @@ fu_plugin_runner_recoldplug (FuPlugin *self, GError **error)
return TRUE;
}
/**
* fu_plugin_runner_coldplug_prepare:
* @self: a #FuPlugin
* @error: a #GError or NULL
*
* Runs the coldplug_prepare routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 0.8.0
**/
gboolean
fu_plugin_runner_coldplug_prepare (FuPlugin *self, GError **error)
{
@ -1298,6 +1446,17 @@ fu_plugin_runner_coldplug_prepare (FuPlugin *self, GError **error)
return TRUE;
}
/**
* fu_plugin_runner_coldplug_cleanup:
* @self: a #FuPlugin
* @error: a #GError or NULL
*
* Runs the coldplug_cleanup routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 0.8.0
**/
gboolean
fu_plugin_runner_coldplug_cleanup (FuPlugin *self, GError **error)
{
@ -1335,6 +1494,18 @@ fu_plugin_runner_coldplug_cleanup (FuPlugin *self, GError **error)
return TRUE;
}
/**
* fu_plugin_runner_composite_prepare:
* @self: a #FuPlugin
* @devices: a #GPtrArray of devices
* @error: a #GError or NULL
*
* Runs the composite_prepare routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.0.9
**/
gboolean
fu_plugin_runner_composite_prepare (FuPlugin *self, GPtrArray *devices, GError **error)
{
@ -1343,6 +1514,18 @@ fu_plugin_runner_composite_prepare (FuPlugin *self, GPtrArray *devices, GError *
error);
}
/**
* fu_plugin_runner_composite_cleanup:
* @self: a #FuPlugin
* @devices: a #GPtrArray of devices
* @error: a #GError or NULL
*
* Runs the composite_cleanup routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.0.9
**/
gboolean
fu_plugin_runner_composite_cleanup (FuPlugin *self, GPtrArray *devices, GError **error)
{
@ -1351,6 +1534,17 @@ fu_plugin_runner_composite_cleanup (FuPlugin *self, GPtrArray *devices, GError *
error);
}
/**
* fu_plugin_runner_update_prepare:
* @self: a #FuPlugin
* @error: a #GError or NULL
*
* Runs the update_prepare routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.1.2
**/
gboolean
fu_plugin_runner_update_prepare (FuPlugin *self, FwupdInstallFlags flags, FuDevice *device,
GError **error)
@ -1360,6 +1554,17 @@ fu_plugin_runner_update_prepare (FuPlugin *self, FwupdInstallFlags flags, FuDevi
error);
}
/**
* fu_plugin_runner_update_cleanup:
* @self: a #FuPlugin
* @error: a #GError or NULL
*
* Runs the update_cleanup routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.1.2
**/
gboolean
fu_plugin_runner_update_cleanup (FuPlugin *self, FwupdInstallFlags flags, FuDevice *device,
GError **error)
@ -1369,6 +1574,18 @@ fu_plugin_runner_update_cleanup (FuPlugin *self, FwupdInstallFlags flags, FuDevi
error);
}
/**
* fu_plugin_runner_update_attach:
* @self: a #FuPlugin
* @device: a #FuDevice
* @error: a #GError or NULL
*
* Runs the update_attach routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.1.2
**/
gboolean
fu_plugin_runner_update_attach (FuPlugin *self, FuDevice *device, GError **error)
{
@ -1378,6 +1595,18 @@ fu_plugin_runner_update_attach (FuPlugin *self, FuDevice *device, GError **error
error);
}
/**
* fu_plugin_runner_update_detach:
* @self: a #FuPlugin
* @device: A #FuDevice
* @error: a #GError or NULL
*
* Runs the update_detach routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.1.2
**/
gboolean
fu_plugin_runner_update_detach (FuPlugin *self, FuDevice *device, GError **error)
{
@ -1387,6 +1616,17 @@ fu_plugin_runner_update_detach (FuPlugin *self, FuDevice *device, GError **error
error);
}
/**
* fu_plugin_runner_update_reload:
* @self: a #FuPlugin
* @error: a #GError or NULL
*
* Runs reload routine for a device
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.1.2
**/
gboolean
fu_plugin_runner_update_reload (FuPlugin *self, FuDevice *device, GError **error)
{
@ -1412,6 +1652,8 @@ fu_plugin_runner_update_reload (FuPlugin *self, FuDevice *device, GError **error
* Registers the udev subsystem to be watched by the daemon.
*
* Plugins can use this method only in fu_plugin_init()
*
* Since: 1.1.2
**/
void
fu_plugin_add_udev_subsystem (FuPlugin *self, const gchar *subsystem)
@ -1447,6 +1689,18 @@ fu_plugin_set_device_gtype (FuPlugin *self, GType device_gtype)
priv->device_gtype = device_gtype;
}
/**
* fu_plugin_add_firmware_gtype:
* @self: a #FuPlugin
* @id: A string describing the type
* @gtype: a #GType `FU_TYPE_DEVICE`
*
* Adds a firmware #GType which is used when creating devices.
* *
* Plugins can use this method only in fu_plugin_init()
*
* Since: 1.3.3
**/
void
fu_plugin_add_firmware_gtype (FuPlugin *self, const gchar *id, GType gtype)
{
@ -1540,6 +1794,18 @@ fu_plugin_udev_device_added (FuPlugin *self, FuUdevDevice *device, GError **erro
return TRUE;
}
/**
* fu_plugin_runner_usb_device_added:
* @self: a #FuPlugin
* @device: a #FuUsbDevice
* @error: a #GError or NULL
*
* Call the usb_device_added routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.0.2
**/
gboolean
fu_plugin_runner_usb_device_added (FuPlugin *self, FuUsbDevice *device, GError **error)
{
@ -1583,6 +1849,18 @@ fu_plugin_runner_usb_device_added (FuPlugin *self, FuUsbDevice *device, GError *
return TRUE;
}
/**
* fu_plugin_runner_udev_device_added:
* @self: a #FuPlugin
* @device: a #FuUdevDevice
* @error: a #GError or NULL
*
* Call the udev_device_added routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.0.2
**/
gboolean
fu_plugin_runner_udev_device_added (FuPlugin *self, FuUdevDevice *device, GError **error)
{
@ -1626,6 +1904,18 @@ fu_plugin_runner_udev_device_added (FuPlugin *self, FuUdevDevice *device, GError
return TRUE;
}
/**
* fu_plugin_runner_udev_device_changed:
* @self: a #FuPlugin
* @device: a #FuUdevDevice
* @error: a #GError or NULL
*
* Call the udev_device_changed routine for the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.0.2
**/
gboolean
fu_plugin_runner_udev_device_changed (FuPlugin *self, FuUdevDevice *device, GError **error)
{
@ -1663,6 +1953,15 @@ fu_plugin_runner_udev_device_changed (FuPlugin *self, FuUdevDevice *device, GErr
return TRUE;
}
/**
* fu_plugin_runner_device_removed:
* @self: a #FuPlugin
* @device: a #FuDevice
*
* Call the device_removed routine for the plugin
*
* Since: 1.1.2
**/
void
fu_plugin_runner_device_removed (FuPlugin *self, FuDevice *device)
{
@ -1675,6 +1974,15 @@ fu_plugin_runner_device_removed (FuPlugin *self, FuDevice *device)
g_warning ("%s", error_local->message);
}
/**
* fu_plugin_runner_device_register:
* @self: a #FuPlugin
* @device: a #FuDevice
*
* Call the device_registered routine for the plugin
*
* Since: 0.9.7
**/
void
fu_plugin_runner_device_register (FuPlugin *self, FuDevice *device)
{
@ -1699,6 +2007,21 @@ fu_plugin_runner_device_register (FuPlugin *self, FuDevice *device)
}
}
/**
* fu_plugin_runner_schedule_update:
* @self: a #FuPlugin
* @device: a #FuDevice
* @release: A #FwupdRelease
* @blob_cab: A #GBytes
* @flags: #FwupdInstallFlags
* @error: A #GError or NULL
*
* Schedule an offline update with the plugin
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 0.8.0
**/
gboolean
fu_plugin_runner_schedule_update (FuPlugin *self,
FuDevice *device,
@ -1766,6 +2089,19 @@ fu_plugin_runner_schedule_update (FuPlugin *self,
return fu_plugin_runner_offline_setup (error);
}
/**
* fu_plugin_runner_verify:
* @self: a #FuPlugin
* @device: a #FuDevice
* @flags: #FuPluginVerifyFlags
* @error: A #GError or NULL
*
* Call into the plugin's verify routine
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 0.8.0
**/
gboolean
fu_plugin_runner_verify (FuPlugin *self,
FuDevice *device,
@ -1839,6 +2175,18 @@ fu_plugin_runner_verify (FuPlugin *self,
return TRUE;
}
/**
* fu_plugin_runner_activate:
* @self: a #FuPlugin
* @device: a #FuDevice
* @error: A #GError or NULL
*
* Call into the plugin's activate routine
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 1.2.6
**/
gboolean
fu_plugin_runner_activate (FuPlugin *self, FuDevice *device, GError **error)
{
@ -1868,6 +2216,18 @@ fu_plugin_runner_activate (FuPlugin *self, FuDevice *device, GError **error)
return TRUE;
}
/**
* fu_plugin_runner_unlock:
* @self: a #FuPlugin
* @device: a #FuDevice
* @error: A #GError or NULL
*
* Call into the plugin's unlock routine
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 0.8.0
**/
gboolean
fu_plugin_runner_unlock (FuPlugin *self, FuDevice *device, GError **error)
{
@ -1898,6 +2258,20 @@ fu_plugin_runner_unlock (FuPlugin *self, FuDevice *device, GError **error)
return TRUE;
}
/**
* fu_plugin_runner_update:
* @self: a #FuPlugin
* @device: a #FuDevice
* @blob_fw: A #GBytes
* @flags: A #FwupdInstallFlags
* @error: A #GError or NULL
*
* Call into the plugin's update routine
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 0.8.0
**/
gboolean
fu_plugin_runner_update (FuPlugin *self,
FuDevice *device,
@ -1989,6 +2363,18 @@ fu_plugin_runner_update (FuPlugin *self,
return TRUE;
}
/**
* fu_plugin_runner_clear_results:
* @self: a #FuPlugin
* @device: a #FuDevice
* @error: A #GError or NULL
*
* Call into the plugin's clear results routine
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 0.8.0
**/
gboolean
fu_plugin_runner_clear_results (FuPlugin *self, FuDevice *device, GError **error)
{
@ -2026,6 +2412,18 @@ fu_plugin_runner_clear_results (FuPlugin *self, FuDevice *device, GError **error
return TRUE;
}
/**
* fu_plugin_runner_get_results:
* @self: a #FuPlugin
* @device: a #FuDevice
* @error: A #GError or NULL
*
* Call into the plugin's get results routine
*
* Returns: #TRUE for success, #FALSE for failure
*
* Since: 0.8.0
**/
gboolean
fu_plugin_runner_get_results (FuPlugin *self, FuDevice *device, GError **error)
{
@ -2071,6 +2469,8 @@ fu_plugin_runner_get_results (FuPlugin *self, FuDevice *device, GError **error)
* numbers.
*
* Returns: the integer value
*
* Since: 1.0.0
**/
guint
fu_plugin_get_order (FuPlugin *self)
@ -2086,6 +2486,8 @@ fu_plugin_get_order (FuPlugin *self)
*
* Sets the plugin order, where higher numbers are run after lower
* numbers.
*
* Since: 1.0.0
**/
void
fu_plugin_set_order (FuPlugin *self, guint order)
@ -2101,6 +2503,8 @@ fu_plugin_set_order (FuPlugin *self, guint order)
* Gets the plugin priority, where higher numbers are better.
*
* Returns: the integer value
*
* Since: 1.1.1
**/
guint
fu_plugin_get_priority (FuPlugin *self)
@ -2115,6 +2519,8 @@ fu_plugin_get_priority (FuPlugin *self)
* @priority: a integer value
*
* Sets the plugin priority, where higher numbers are better.
*
* Since: 1.0.0
**/
void
fu_plugin_set_priority (FuPlugin *self, guint priority)
@ -2135,6 +2541,8 @@ fu_plugin_set_priority (FuPlugin *self, guint priority)
*
* NOTE: The depsolver is iterative and may not solve overly-complicated rules;
* If depsolving fails then fwupd will not start.
*
* Since: 1.0.0
**/
void
fu_plugin_add_rule (FuPlugin *self, FuPluginRule rule, const gchar *name)
@ -2152,6 +2560,8 @@ fu_plugin_add_rule (FuPlugin *self, FuPluginRule rule, const gchar *name)
* Gets the plugin IDs that should be run after this plugin.
*
* Returns: (element-type utf8) (transfer none): the list of plugin names, e.g. ['appstream']
*
* Since: 1.0.0
**/
GPtrArray *
fu_plugin_get_rules (FuPlugin *self, FuPluginRule rule)
@ -2169,6 +2579,8 @@ fu_plugin_get_rules (FuPlugin *self, FuPluginRule rule)
* Gets the plugin IDs that should be run after this plugin.
*
* Returns: %TRUE if the name exists for the specific rule
*
* Since: 1.0.0
**/
gboolean
fu_plugin_has_rule (FuPlugin *self, FuPluginRule rule, const gchar *name)
@ -2193,6 +2605,8 @@ fu_plugin_has_rule (FuPlugin *self, FuPluginRule rule, const gchar *name)
*
* Any data included here will be sent to the metadata server after user
* confirmation.
*
* Since: 1.0.4
**/
void
fu_plugin_add_report_metadata (FuPlugin *self, const gchar *key, const gchar *value)
@ -2208,6 +2622,8 @@ fu_plugin_add_report_metadata (FuPlugin *self, const gchar *key, const gchar *va
* Returns the list of additional metadata to be added when filing a report.
*
* Returns: (transfer none): the map of report metadata
*
* Since: 1.0.4
**/
GHashTable *
fu_plugin_get_report_metadata (FuPlugin *self)
@ -2255,6 +2671,8 @@ fu_plugin_get_config_value (FuPlugin *self, const gchar *key)
* Compares two plugins by their names.
*
* Returns: 1, 0 or -1 if @plugin1 is greater, equal, or less than @plugin2.
*
* Since: 1.0.8
**/
gint
fu_plugin_name_compare (FuPlugin *plugin1, FuPlugin *plugin2)
@ -2272,6 +2690,8 @@ fu_plugin_name_compare (FuPlugin *plugin1, FuPlugin *plugin2)
* Compares two plugins by their depsolved order.
*
* Returns: 1, 0 or -1 if @plugin1 is greater, equal, or less than @plugin2.
*
* Since: 1.0.8
**/
gint
fu_plugin_order_compare (FuPlugin *plugin1, FuPlugin *plugin2)
@ -2403,6 +2823,13 @@ fu_plugin_finalize (GObject *object)
G_OBJECT_CLASS (fu_plugin_parent_class)->finalize (object);
}
/**
* fu_plugin_new:
*
* Creates a new #FuPlugin
*
* Since: 0.8.0
**/
FuPlugin *
fu_plugin_new (void)
{

View File

@ -109,7 +109,7 @@ void fu_plugin_set_coldplug_delay (FuPlugin *self,
guint duration);
void fu_plugin_set_device_gtype (FuPlugin *self,
GType device_gtype);
void fu_plugin_add_firmware_gtype (FuPlugin *plugin,
void fu_plugin_add_firmware_gtype (FuPlugin *self,
const gchar *id,
GType gtype);
gpointer fu_plugin_cache_lookup (FuPlugin *self,

View File

@ -200,6 +200,15 @@ fu_progressbar_refresh (FuProgressbar *self, FwupdStatus status, guint percentag
}
}
/**
* fu_progressbar_set_title:
* @self: A #FuProgressbar
* @title: A string
*
* Sets progressbar title
*
* Since: 0.9.7
**/
void
fu_progressbar_set_title (FuProgressbar *self, const gchar *title)
{
@ -266,6 +275,16 @@ fu_progressbar_spin_start (FuProgressbar *self)
self->timer_id = g_timeout_add (40, fu_progressbar_spin_cb, self);
}
/**
* fu_progressbar_update:
* @self: A #FuProgressbar
* @status: A #FwupdStatus
* @percentage: unsigned integer
*
* Refreshes a progressbar
*
* Since: 0.9.7
**/
void
fu_progressbar_update (FuProgressbar *self, FwupdStatus status, guint percentage)
{
@ -314,6 +333,15 @@ fu_progressbar_update (FuProgressbar *self, FwupdStatus status, guint percentage
self->percentage = percentage;
}
/**
* fu_progressbar_set_interactive:
* @self: A #FuProgressbar
* @interactive: #gboolean
*
* Marks the progressbar as interactive or not
*
* Since: 0.9.7
**/
void
fu_progressbar_set_interactive (FuProgressbar *self, gboolean interactive)
{
@ -321,6 +349,15 @@ fu_progressbar_set_interactive (FuProgressbar *self, gboolean interactive)
self->interactive = interactive;
}
/**
* fu_progressbar_set_length_status:
* @self: A #FuProgressbar
* @len: unsigned integer
*
* Sets the length of the progressbar status
*
* Since: 0.9.7
**/
void
fu_progressbar_set_length_status (FuProgressbar *self, guint len)
{
@ -329,6 +366,15 @@ fu_progressbar_set_length_status (FuProgressbar *self, guint len)
self->length_status = len;
}
/**
* fu_progressbar_set_length_percentage:
* @self: A #FuProgressbar
* @len: unsigned integer
*
* Sets the length of the progressba percentage
*
* Since: 0.9.7
**/
void
fu_progressbar_set_length_percentage (FuProgressbar *self, guint len)
{
@ -366,6 +412,13 @@ fu_progressbar_finalize (GObject *obj)
G_OBJECT_CLASS (fu_progressbar_parent_class)->finalize (obj);
}
/**
* fu_progressbar_new:
*
* Creates a new #FuProgressbar
*
* Since: 0.9.7
**/
FuProgressbar *
fu_progressbar_new (void)
{

View File

@ -300,9 +300,9 @@ fu_quirks_lookup_by_id (FuQuirks *self, const gchar *group, const gchar *key)
/**
* fu_quirks_lookup_by_id_iter:
* @self: A #FuPlugin
* @guid: a GUID
* @iter_cb: A #FuQuirksIter
* @self: A #FuQuirks
* @group: string of group to lookup
* @iter_cb: (scope async): A #FuQuirksIter
* @user_data: user data passed to @iter_cb
*
* Looks up all entries in the hardware database using a GUID value.
@ -370,6 +370,7 @@ fu_quirks_lookup_by_id_iter (FuQuirks *self, const gchar *group,
/**
* fu_quirks_load: (skip)
* @self: A #FuQuirks
* @load_flags: A #FuQuirksLoadFlags
* @error: A #GError, or %NULL
*
* Loads the various files that define the hardware quirks used in plugins.
@ -413,6 +414,8 @@ fu_quirks_finalize (GObject *obj)
* Creates a new quirks object.
*
* Return value: a new #FuQuirks
*
* Since: 1.0.1
**/
FuQuirks *
fu_quirks_new (void)

View File

@ -127,6 +127,8 @@ fu_smbios_setup_from_data (FuSmbios *self, const guint8 *buf, gsize sz, GError *
* Reads all the SMBIOS values from a DMI blob.
*
* Returns: %TRUE for success
*
* Since: 1.0.0
**/
gboolean
fu_smbios_setup_from_file (FuSmbios *self, const gchar *filename, GError **error)
@ -228,7 +230,7 @@ fu_smbios_parse_ep64 (FuSmbios *self, const gchar *buf, gsize sz, GError **error
}
/**
* fu_smbios_setup:
* fu_smbios_setup_from_path:
* @self: A #FuSmbios
* @path: A path, e.g. `/sys/firmware/dmi/tables`
* @error: A #GError or %NULL
@ -236,6 +238,8 @@ fu_smbios_parse_ep64 (FuSmbios *self, const gchar *buf, gsize sz, GError **error
* Reads all the SMBIOS values from a specific path.
*
* Returns: %TRUE for success
*
* Since: 1.0.0
**/
gboolean
fu_smbios_setup_from_path (FuSmbios *self, const gchar *path, GError **error)
@ -308,6 +312,8 @@ fu_smbios_setup_from_path (FuSmbios *self, const gchar *path, GError **error)
* Reads all the SMBIOS values from the hardware.
*
* Returns: %TRUE for success
*
* Since: 1.0.0
**/
gboolean
fu_smbios_setup (FuSmbios *self, GError **error)
@ -327,6 +333,8 @@ fu_smbios_setup (FuSmbios *self, GError **error)
* Dumps the parsed SMBIOS data to a string.
*
* Returns: a UTF-8 string
*
* Since: 1.0.0
**/
gchar *
fu_smbios_to_string (FuSmbios *self)
@ -371,6 +379,8 @@ fu_smbios_get_item_for_type (FuSmbios *self, guint8 type)
* Reads a SMBIOS data blob, which includes the SMBIOS section header.
*
* Returns: (transfer full): a #GBytes, or %NULL if invalid or not found
*
* Since: 1.0.0
**/
GBytes *
fu_smbios_get_data (FuSmbios *self, guint8 type, GError **error)
@ -401,6 +411,8 @@ fu_smbios_get_data (FuSmbios *self, guint8 type, GError **error)
* https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.1.1.pdf
*
* Returns: a string, or %NULL if invalid or not found
*
* Since: 1.0.0
**/
const gchar *
fu_smbios_get_string (FuSmbios *self, guint8 type, guint8 offset, GError **error)
@ -486,6 +498,8 @@ fu_smbios_init (FuSmbios *self)
* Creates a new object to parse SMBIOS data.
*
* Returns: a #FuSmbios
*
* Since: 1.0.0
**/
FuSmbios *
fu_smbios_new (void)

View File

@ -14,6 +14,15 @@
#include "fu-firmware-common.h"
#include "fu-srec-firmware.h"
/**
* SECTION:fu-srec-firmware
* @short_description: SREC firmware image
*
* An object that represents a SREC firmware image.
*
* See also: #FuFirmware
*/
struct _FuSrecFirmware {
FuFirmware parent_instance;
GPtrArray *records;
@ -48,6 +57,18 @@ fu_srec_firmware_record_free (FuSrecFirmwareRecord *rcd)
g_free (rcd);
}
/**
* fu_srec_firmware_record_new:
* @ln: unsigned integer
* @kind: #FuFirmwareSrecRecordKind
* @addr: unsigned integer
*
* Returns a single firmware record
*
* Returns: (transfer full) (element-type FuSrecFirmwareRecord): records
*
* Since: 1.3.2
**/
FuSrecFirmwareRecord *
fu_srec_firmware_record_new (guint ln, FuFirmareSrecRecordKind kind, guint32 addr)
{
@ -372,6 +393,13 @@ fu_srec_firmware_class_init (FuSrecFirmwareClass *klass)
klass_firmware->tokenize = fu_srec_firmware_tokenize;
}
/**
* fu_srec_firmware_new:
*
* Creates a new #FuFirmware of sub type Srec
*
* Since: 1.3.2
**/
FuFirmware *
fu_srec_firmware_new (void)
{

View File

@ -26,6 +26,14 @@ fu_test_hang_check_cb (gpointer user_data)
return G_SOURCE_REMOVE;
}
/**
* fu_test_loop_run_with_timeout:
* @timeout_ms: The timeout in milliseconds
*
* Quits the test loop after a timeout
*
* Since: 0.9.1
**/
void
fu_test_loop_run_with_timeout (guint timeout_ms)
{
@ -36,6 +44,13 @@ fu_test_loop_run_with_timeout (guint timeout_ms)
g_main_loop_run (_test_loop);
}
/**
* fu_test_loop_quit:
*
* Quits the test loop
*
* Since: 0.9.1
**/
void
fu_test_loop_quit (void)
{
@ -50,6 +65,17 @@ fu_test_loop_quit (void)
}
}
/**
* fu_test_get_filename:
* @testdatadirs: semicolon delimitted list of directories
* @filename: the filename to look for
*
* Returns the first path that matches filename in testdatadirs
*
* Returns: (transfer full): full path to file or NULL
*
* Since: 0.9.1
**/
gchar *
fu_test_get_filename (const gchar *testdatadirs, const gchar *filename)
{
@ -65,6 +91,18 @@ fu_test_get_filename (const gchar *testdatadirs, const gchar *filename)
return NULL;
}
/**
* fu_test_compare_lines:
* @txt1: First line to compare
* @txt2: second line to compare
* @error: A #GError or #NULL
*
* Compare two lines.
*
* Returns: #TRUE if identical, #FALSE if not (diff is set in error)
*
* Since: 1.0.4
**/
gboolean
fu_test_compare_lines (const gchar *txt1, const gchar *txt2, GError **error)
{

View File

@ -345,6 +345,17 @@ fu_udev_device_set_dev (FuUdevDevice *self, GUdevDevice *udev_device)
#endif
}
/**
* fu_udev_device_get_slot_depth:
* @self: A #FuUdevDevice
* @subsystem: a subsystem
*
* Determine how far up a chain a given device is
*
* Returns: unsigned integer
*
* Since: 1.2.4
**/
guint
fu_udev_device_get_slot_depth (FuUdevDevice *self, const gchar *subsystem)
{