trivial: Add three public 'setters' for FuChunk

This commit is contained in:
Richard Hughes 2021-01-29 09:31:36 +00:00
parent 318944f322
commit bc8678ef13
3 changed files with 57 additions and 0 deletions

View File

@ -31,6 +31,22 @@ struct _FuChunk {
G_DEFINE_TYPE (FuChunk, fu_chunk, G_TYPE_OBJECT)
/**
* fu_chunk_set_idx:
* @self: a #FuChunk
* @idx: index, starting at 0
*
* Sets the index of the chunk.
*
* Since: 1.5.6
**/
void
fu_chunk_set_idx (FuChunk *self, guint32 idx)
{
g_return_if_fail (FU_IS_CHUNK (self));
self->idx = idx;
}
/**
* fu_chunk_get_idx:
* @self: a #FuChunk
@ -48,6 +64,22 @@ fu_chunk_get_idx (FuChunk *self)
return self->idx;
}
/**
* fu_chunk_set_page:
* @self: a #FuChunk
* @page: page number, starting at 0
*
* Sets the page of the chunk.
*
* Since: 1.5.6
**/
void
fu_chunk_set_page (FuChunk *self, guint32 page)
{
g_return_if_fail (FU_IS_CHUNK (self));
self->page = page;
}
/**
* fu_chunk_get_page:
* @self: a #FuChunk
@ -65,6 +97,22 @@ fu_chunk_get_page (FuChunk *self)
return self->page;
}
/**
* fu_chunk_set_address:
* @self: a #FuChunk
* @address: memory address
*
* Sets the address of the chunk.
*
* Since: 1.5.6
**/
void
fu_chunk_set_address (FuChunk *self, guint32 address)
{
g_return_if_fail (FU_IS_CHUNK (self));
self->address = address;
}
/**
* fu_chunk_get_address:
* @self: a #FuChunk

View File

@ -12,8 +12,14 @@
G_DECLARE_FINAL_TYPE (FuChunk, fu_chunk, FU, CHUNK, GObject)
void fu_chunk_set_idx (FuChunk *self,
guint32 idx);
guint32 fu_chunk_get_idx (FuChunk *self);
void fu_chunk_set_page (FuChunk *self,
guint32 page);
guint32 fu_chunk_get_page (FuChunk *self);
void fu_chunk_set_address (FuChunk *self,
guint32 address);
guint32 fu_chunk_get_address (FuChunk *self);
const guint8 *fu_chunk_get_data (FuChunk *self);
guint8 *fu_chunk_get_data_out (FuChunk *self);

View File

@ -732,6 +732,9 @@ LIBFWUPDPLUGIN_1.5.6 {
fu_chunk_get_idx;
fu_chunk_get_page;
fu_chunk_get_type;
fu_chunk_set_address;
fu_chunk_set_idx;
fu_chunk_set_page;
fu_common_get_memory_size;
fu_common_strjoin_array;
fu_common_uri_get_scheme;