mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
interpret-trailers: access trailer_info with new helpers
Instead of directly accessing trailer_info members, access them indirectly through new helper functions exposed by the trailer API. This is the first of two preparatory commits which will allow us to use the so-called "pimpl" (pointer to implementation) idiom for the trailer API, by making the trailer_info struct private to the trailer implementation (and thus hidden from the API). Helped-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Linus Arver <linus@ucla.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2ade05431e
commit
655eb65d48
21
trailer.c
21
trailer.c
@@ -952,6 +952,12 @@ static void unfold_value(struct strbuf *val)
|
||||
strbuf_release(&out);
|
||||
}
|
||||
|
||||
struct trailer_info *trailer_info_new(void)
|
||||
{
|
||||
struct trailer_info *info = xcalloc(1, sizeof(*info));
|
||||
return info;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse trailers in "str", populating the trailer info and "head"
|
||||
* linked list structure.
|
||||
@@ -1000,6 +1006,21 @@ void free_trailers(struct list_head *trailers)
|
||||
}
|
||||
}
|
||||
|
||||
size_t trailer_block_start(struct trailer_info *info)
|
||||
{
|
||||
return info->trailer_block_start;
|
||||
}
|
||||
|
||||
size_t trailer_block_end(struct trailer_info *info)
|
||||
{
|
||||
return info->trailer_block_end;
|
||||
}
|
||||
|
||||
int blank_line_before_trailer_block(struct trailer_info *info)
|
||||
{
|
||||
return info->blank_line_before_trailer;
|
||||
}
|
||||
|
||||
void trailer_info_get(const struct process_trailer_options *opts,
|
||||
const char *str,
|
||||
struct trailer_info *info)
|
||||
|
||||
Reference in New Issue
Block a user