2011-10-11 14:26:48 -04:00
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright ( C ) 2011 Colin Walters < walters @ verbum . org >
*
2011-11-10 13:17:04 -05:00
* 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 .
2011-10-11 14:26:48 -04:00
*
2011-11-10 13:17:04 -05:00
* This library is distributed in the hope that it will be useful ,
2011-10-11 14:26:48 -04:00
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
2011-11-10 13:17:04 -05:00
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
* Lesser General Public License for more details .
2011-10-11 14:26:48 -04:00
*
2011-11-10 13:17:04 -05:00
* 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 .
2011-10-11 14:26:48 -04:00
*
* Author : Colin Walters < walters @ verbum . org >
*/
2011-10-18 14:44:48 -04:00
# ifndef _OSTREE_REPO
# define _OSTREE_REPO
2011-10-11 14:26:48 -04:00
2011-11-08 19:38:42 -05:00
# include "ostree-core.h"
2011-10-11 14:26:48 -04:00
G_BEGIN_DECLS
2011-10-18 14:44:48 -04:00
# define OSTREE_TYPE_REPO ostree_repo_get_type()
# define OSTREE_REPO(obj) \
( G_TYPE_CHECK_INSTANCE_CAST ( ( obj ) , OSTREE_TYPE_REPO , OstreeRepo ) )
# define OSTREE_REPO_CLASS(klass) \
( G_TYPE_CHECK_CLASS_CAST ( ( klass ) , OSTREE_TYPE_REPO , OstreeRepoClass ) )
# define OSTREE_IS_REPO(obj) \
( G_TYPE_CHECK_INSTANCE_TYPE ( ( obj ) , OSTREE_TYPE_REPO ) )
# define OSTREE_IS_REPO_CLASS(klass) \
( G_TYPE_CHECK_CLASS_TYPE ( ( klass ) , OSTREE_TYPE_REPO ) )
# define OSTREE_REPO_GET_CLASS(obj) \
( G_TYPE_INSTANCE_GET_CLASS ( ( obj ) , OSTREE_TYPE_REPO , OstreeRepoClass ) )
2011-10-11 14:26:48 -04:00
typedef struct {
GObject parent ;
2011-10-18 14:44:48 -04:00
} OstreeRepo ;
2011-10-11 14:26:48 -04:00
typedef struct {
GObjectClass parent_class ;
2011-10-18 14:44:48 -04:00
} OstreeRepoClass ;
2011-10-11 14:26:48 -04:00
2011-10-18 14:44:48 -04:00
GType ostree_repo_get_type ( void ) ;
2011-10-11 14:26:48 -04:00
2011-10-18 14:44:48 -04:00
OstreeRepo * ostree_repo_new ( const char * path ) ;
2011-10-11 14:26:48 -04:00
2011-10-18 14:44:48 -04:00
gboolean ostree_repo_check ( OstreeRepo * self , GError * * error ) ;
2011-10-11 20:58:50 -04:00
2011-10-31 20:24:38 -04:00
const char * ostree_repo_get_path ( OstreeRepo * self ) ;
gboolean ostree_repo_is_archive ( OstreeRepo * self ) ;
GKeyFile * ostree_repo_get_config ( OstreeRepo * self ) ;
GKeyFile * ostree_repo_copy_config ( OstreeRepo * self ) ;
gboolean ostree_repo_write_config ( OstreeRepo * self ,
GKeyFile * new_config ,
GError * * error ) ;
2011-11-08 19:38:42 -05:00
char * ostree_repo_get_object_path ( OstreeRepo * self ,
const char * object ,
OstreeObjectType type ) ;
2011-10-31 20:24:38 -04:00
gboolean ostree_repo_store_packfile ( OstreeRepo * self ,
const char * expected_checksum ,
const char * path ,
OstreeObjectType objtype ,
GError * * error ) ;
gboolean ostree_repo_store_object_trusted ( OstreeRepo * self ,
const char * path ,
const char * checksum ,
OstreeObjectType objtype ,
gboolean ignore_exists ,
gboolean force ,
gboolean * did_exist ,
GError * * error ) ;
2011-10-14 22:09:44 -04:00
2011-10-27 09:21:07 -04:00
gboolean ostree_repo_resolve_rev ( OstreeRepo * self ,
const char * rev ,
char * * out_resolved ,
GError * * error ) ;
2011-10-14 22:09:44 -04:00
2011-10-31 20:24:38 -04:00
gboolean ostree_repo_write_ref ( OstreeRepo * self ,
gboolean is_local ,
const char * name ,
const char * rev ,
GError * * error ) ;
2011-10-18 14:44:48 -04:00
gboolean ostree_repo_load_variant ( OstreeRepo * self ,
2011-10-14 22:09:44 -04:00
const char * sha256 ,
2011-10-18 14:44:48 -04:00
OstreeSerializedVariantType * out_type ,
2011-10-14 22:09:44 -04:00
GVariant * * out_variant ,
GError * * error ) ;
2011-10-11 14:26:48 -04:00
2011-11-02 13:22:13 -04:00
gboolean ostree_repo_load_variant_checked ( OstreeRepo * self ,
OstreeSerializedVariantType expected_type ,
const char * sha256 ,
GVariant * * out_variant ,
GError * * error ) ;
2011-10-27 21:40:42 -04:00
gboolean ostree_repo_commit_from_filelist_fd ( OstreeRepo * self ,
2011-10-27 09:21:07 -04:00
const char * branch ,
2011-10-27 21:40:42 -04:00
const char * parent ,
2011-10-27 09:21:07 -04:00
const char * subject ,
const char * body ,
GVariant * metadata ,
const char * base ,
int fd ,
char separator ,
GChecksum * * out_commit ,
GError * * error ) ;
2011-10-15 13:07:26 -04:00
2011-10-18 14:44:48 -04:00
gboolean ostree_repo_checkout ( OstreeRepo * self ,
2011-11-07 11:25:49 -05:00
const char * ref ,
const char * destination ,
GCancellable * cancellable ,
GError * * error ) ;
2011-10-14 23:24:51 -04:00
2011-11-10 09:27:22 -05:00
typedef struct {
guint content_differs : 1 ;
guint xattrs_differs : 1 ;
guint unused : 30 ;
GFileInfo * src_info ;
GFileInfo * target_info ;
char * src_file_checksum ;
char * target_file_checksum ;
GVariant * src_xattrs ;
GVariant * target_xattrs ;
} OstreeRepoDiffItem ;
gboolean ostree_repo_diff ( OstreeRepo * self ,
const char * ref ,
GFile * target ,
GPtrArray * * out_modified , /* OstreeRepoDiffItem */
GPtrArray * * out_removed , /* OstreeRepoDiffItem */
GPtrArray * * out_added , /* OstreeRepoDiffItem */
GCancellable * cancellable ,
GError * * error ) ;
2011-10-18 14:44:48 -04:00
typedef void ( * OstreeRepoObjectIter ) ( OstreeRepo * self , const char * path ,
2011-10-12 11:38:41 -04:00
GFileInfo * fileinfo , gpointer user_data ) ;
2011-10-18 14:44:48 -04:00
gboolean ostree_repo_iter_objects ( OstreeRepo * self ,
OstreeRepoObjectIter callback ,
2011-10-12 11:38:41 -04:00
gpointer user_data ,
GError * * error ) ;
2011-10-11 14:26:48 -04:00
G_END_DECLS
2011-10-18 14:44:48 -04:00
# endif /* _OSTREE_REPO */