static-delta: Add show subcommand
Right now though, almost all of the details of deltas are private, so we can't do the "honest thing" and have the command line just use the shared library. Eventually some of this should appear in the API, but for now add command line which is useful for debugging.
This commit is contained in:
1 parent
944b3abab1
commit
98d5f6e3db
7 files changed
+172
-1
No files matched your search
@@ -154,6 +154,28 @@ ot_util_variant_map (GFile *src,
|
||||
return ret;
|
||||
}
|
||||
|
||||
gboolean
|
||||
ot_util_variant_map_at (int dfd,
|
||||
const char *path,
|
||||
const GVariantType *type,
|
||||
gboolean trusted,
|
||||
GVariant **out_variant,
|
||||
GError **error)
|
||||
{
|
||||
glnx_fd_close int fd = -1;
|
||||
g_autoptr(GVariant) ret_variant = NULL;
|
||||
|
||||
fd = openat (dfd, path, O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
{
|
||||
glnx_set_error_from_errno (error);
|
||||
g_prefix_error (error, "Opening %s: ", path);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return ot_util_variant_map_fd (fd, 0, type, trusted, out_variant, error);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
gpointer addr;
|
||||
gsize len;
|
||||
|
||||
@@ -48,6 +48,13 @@ gboolean ot_util_variant_map (GFile *src,
|
||||
GVariant **out_variant,
|
||||
GError **error);
|
||||
|
||||
gboolean ot_util_variant_map_at (int dfd,
|
||||
const char *path,
|
||||
const GVariantType *type,
|
||||
gboolean trusted,
|
||||
GVariant **out_variant,
|
||||
GError **error);
|
||||
|
||||
gboolean ot_util_variant_map_fd (int fd,
|
||||
goffset offset,
|
||||
const GVariantType *type,
|
||||
|
||||
Reference in new issue
Block a user