summaryrefslogtreecommitdiff
path: root/src/ostree/ot-admin-builtins.h
diff options
context:
space:
mode:
authorRuixin Bao <peter.bao@mail.utoronto.ca>2017-10-17 17:25:04 +0000
committerAtomic Bot <atomic-devel@projectatomic.io>2017-10-20 12:59:33 +0000
commit298c151fd8f78e6c3f6f199cd32981ae3d311828 (patch)
tree596d088bc885b26d540d5bdb91ba89aa7b20c5b4 /src/ostree/ot-admin-builtins.h
parent3c360a720ff1a8bf695365a79b3ac7975ffd25e8 (diff)
downloadostree-298c151fd8f78e6c3f6f199cd32981ae3d311828.tar.gz
ostree: move flags into command struct, pass down through builtins
This is a similar approach as https://github.com/projectatomic/rpm-ostree/commit/12c34bb2491a07079c911ef26401fee939e5573c. One thing to note is when we parse the admin related functions, we still keep the old admin related flags, and added a new parameter to represent the command struct. This allows us to identify the caller of the function, making it easier for us to possibly deduplicate the subcommand handling in the future. A similar approach is done in rpm-ostree: https://github.com/projectatomic/rpm-ostree/commit/83aeb018c1012c7a43783c09b74ec71bc9c45826 This also makes it easier for us to change the prototype of the function. If we want to add something new in the future, we won't need to touch every prototype. Closes: #1267 Approved by: cgwalters
Diffstat (limited to 'src/ostree/ot-admin-builtins.h')
-rw-r--r--src/ostree/ot-admin-builtins.h34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/ostree/ot-admin-builtins.h b/src/ostree/ot-admin-builtins.h
index 75cd1448..1d62daf8 100644
--- a/src/ostree/ot-admin-builtins.h
+++ b/src/ostree/ot-admin-builtins.h
@@ -25,19 +25,25 @@
G_BEGIN_DECLS
-gboolean ot_admin_builtin_selinux_ensure_labeled (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_os_init (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_install (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_instutil (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_init_fs (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_cleanup (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_unlock (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_switch (int argc, char **argv, GCancellable *cancellable, GError **error);
-gboolean ot_admin_builtin_upgrade (int argc, char **argv, GCancellable *cancellable, GError **error);
+#define BUILTINPROTO(name) gboolean ot_admin_builtin_ ## name (int argc, char **argv, \
+ OstreeCommandInvocation *invocation, \
+ GCancellable *cancellable, GError **error)
+
+BUILTINPROTO(selinux_ensure_labeled);
+BUILTINPROTO(os_init);
+BUILTINPROTO(install);
+BUILTINPROTO(instutil);
+BUILTINPROTO(init_fs);
+BUILTINPROTO(undeploy);
+BUILTINPROTO(deploy);
+BUILTINPROTO(cleanup);
+BUILTINPROTO(unlock);
+BUILTINPROTO(status);
+BUILTINPROTO(set_origin);
+BUILTINPROTO(diff);
+BUILTINPROTO(switch);
+BUILTINPROTO(upgrade);
+
+#undef BUILTINPROTO
G_END_DECLS