[ostree] main: Use macro to reduce duplication among builtin prototypes
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] main: Use macro to reduce duplication among builtin prototypes
- Date: Mon, 19 Aug 2013 14:33:55 +0000 (UTC)
commit 16c36fbc34c8761689811799da2a5d7225591584
Author: Colin Walters <walters verbum org>
Date: Mon Aug 19 09:00:02 2013 -0400
main: Use macro to reduce duplication among builtin prototypes
Just less code.
src/ostree/ot-builtins.h | 46 +++++++++++++++++++++++++---------------------
1 files changed, 25 insertions(+), 21 deletions(-)
---
diff --git a/src/ostree/ot-builtins.h b/src/ostree/ot-builtins.h
index 4fbb4c1..2231150 100644
--- a/src/ostree/ot-builtins.h
+++ b/src/ostree/ot-builtins.h
@@ -26,27 +26,31 @@
G_BEGIN_DECLS
-gboolean ostree_builtin_admin (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_cat (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_config (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_checksum (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_diff (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_init (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_log (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_pull (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_pull_local (int argc, char **argv, GFile *repo_path, GCancellable *cancellable,
GError **error);
-gboolean ostree_builtin_ls (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_prune (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_refs (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_reset (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_fsck (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_show (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_rev_parse (int argc, char **argv, GFile *repo_path, GCancellable *cancellable,
GError **error);
-gboolean ostree_builtin_remote (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError
**error);
-gboolean ostree_builtin_write_refs (int argc, char **argv, GFile *repo_path, GCancellable *cancellable,
GError **error);
-gboolean ostree_builtin_trivial_httpd (int argc, char **argv, GFile *repo_path, GCancellable *cancellable,
GError **error);
+#define BUILTINPROTO(name) gboolean ostree_builtin_ ## name (int argc, char **argv, GFile *repo_path,
GCancellable *cancellable, GError **error)
+
+BUILTINPROTO(admin);
+BUILTINPROTO(cat);
+BUILTINPROTO(config);
+BUILTINPROTO(checkout);
+BUILTINPROTO(checksum);
+BUILTINPROTO(commit);
+BUILTINPROTO(diff);
+BUILTINPROTO(init);
+BUILTINPROTO(log);
+BUILTINPROTO(pull);
+BUILTINPROTO(pull_local);
+BUILTINPROTO(ls);
+BUILTINPROTO(prune);
+BUILTINPROTO(refs);
+BUILTINPROTO(reset);
+BUILTINPROTO(fsck);
+BUILTINPROTO(show);
+BUILTINPROTO(rev_parse);
+BUILTINPROTO(remote);
+BUILTINPROTO(write_refs);
+BUILTINPROTO(trivial_httpd);
+
+#undef BUILTINPROTO
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]