diff options
author | Colin Walters <walters@verbum.org> | 2021-04-09 00:35:54 +0000 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2021-04-09 21:54:44 +0000 |
commit | 6f84aff0ae72b6b6b8b0b1c388c6a937c32160c8 (patch) | |
tree | 657b47c548e8980556b731288291b4b8ad7069f9 /src/libostree/ostree-content-writer.h | |
parent | 020f6cb6521c2b237871d194488cc59079beed6a (diff) | |
download | ostree-6f84aff0ae72b6b6b8b0b1c388c6a937c32160c8.tar.gz |
repo: Add ostree_repo_write_regfile
This API is push rather than pull, which makes it much more
suitable to use cases like parsing a tar file from external
code.
Now, we have a large mess in this area internally because
the original file writing code was pull based, but static
deltas hit the same problem of wanting a push API, so I added
this special `OstreeRepoBareContent` just for writing regular
files from a push API.
Eventually...I'd like to deprecate the pull based API,
and rework things so that for regular files the push API
is the default, and then `write_content_object()` would
be split up into archive/bare cases.
In this world the `ostree_repo_write_content()` API would
then need to hackily bridge pull to push and it'd be
less efficient.
Anyways for now due to this bifurcation, this API only
works on non-archive repositories, but that's fine for
now because that's what I want for the `ostree-ext-container`
bits.
Diffstat (limited to 'src/libostree/ostree-content-writer.h')
-rw-r--r-- | src/libostree/ostree-content-writer.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/libostree/ostree-content-writer.h b/src/libostree/ostree-content-writer.h new file mode 100644 index 00000000..87a85aa0 --- /dev/null +++ b/src/libostree/ostree-content-writer.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2021 Red Hat, Inc. + * + * SPDX-License-Identifier: LGPL-2.0+ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#pragma once + +#include <gio/gio.h> + +G_BEGIN_DECLS + +#define OSTREE_TYPE_CONTENT_WRITER (ostree_content_writer_get_type ()) +_OSTREE_PUBLIC G_DECLARE_FINAL_TYPE (OstreeContentWriter, ostree_content_writer, OSTREE, CONTENT_WRITER, GOutputStream) + +_OSTREE_PUBLIC +char * ostree_content_writer_finish (OstreeContentWriter *self, + GCancellable *cancellable, + GError **error); + +G_END_DECLS |