Skip to content

Commit 8f7db6f

Browse files
10ne1gitster
authored andcommitted
hook: rename cb_data_free/alloc -> hook_data_free/alloc
Rename the hook callback function types to use the hook prefix. This is a style fix with no logic changes. Suggested-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent b06770e commit 8f7db6f

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

hook.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const char *find_hook(struct repository *r, const char *name)
5252
return path.buf;
5353
}
5454

55-
static void hook_clear(struct hook *h, cb_data_free_fn cb_data_free)
55+
static void hook_clear(struct hook *h, hook_data_free_fn cb_data_free)
5656
{
5757
if (!h)
5858
return;
@@ -70,7 +70,7 @@ static void hook_clear(struct hook *h, cb_data_free_fn cb_data_free)
7070
free(h);
7171
}
7272

73-
void hook_list_clear(struct string_list *hooks, cb_data_free_fn cb_data_free)
73+
void hook_list_clear(struct string_list *hooks, hook_data_free_fn cb_data_free)
7474
{
7575
struct string_list_item *item;
7676

hook.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ struct hook {
4343
void *feed_pipe_cb_data;
4444
};
4545

46-
typedef void (*cb_data_free_fn)(void *data);
47-
typedef void *(*cb_data_alloc_fn)(void *init_ctx);
46+
typedef void (*hook_data_free_fn)(void *data);
47+
typedef void *(*hook_data_alloc_fn)(void *init_ctx);
4848

4949
struct run_hooks_opt {
5050
/* Environment vars to be set for each hook */
@@ -131,14 +131,14 @@ struct run_hooks_opt {
131131
*
132132
* The `feed_pipe_ctx` pointer can be used to pass initialization data.
133133
*/
134-
cb_data_alloc_fn feed_pipe_cb_data_alloc;
134+
hook_data_alloc_fn feed_pipe_cb_data_alloc;
135135

136136
/**
137137
* Called to free the memory initialized by `feed_pipe_cb_data_alloc`.
138138
*
139139
* Must always be provided when `feed_pipe_cb_data_alloc` is provided.
140140
*/
141-
cb_data_free_fn feed_pipe_cb_data_free;
141+
hook_data_free_fn feed_pipe_cb_data_free;
142142
};
143143

144144
#define RUN_HOOKS_OPT_INIT { \
@@ -188,7 +188,7 @@ struct string_list *list_hooks(struct repository *r, const char *hookname,
188188
* Frees the memory allocated for the hook list, including the `struct hook`
189189
* items and their internal state.
190190
*/
191-
void hook_list_clear(struct string_list *hooks, cb_data_free_fn cb_data_free);
191+
void hook_list_clear(struct string_list *hooks, hook_data_free_fn cb_data_free);
192192

193193
/**
194194
* Frees the hook configuration cache stored in `struct repository`.

0 commit comments

Comments
 (0)