]> git.ipfire.org Git - thirdparty/git.git/commit - pkt-line.c
pkt-line: extern packet_length()
authorDenton Liu <liu.denton@gmail.com>
Tue, 19 May 2020 10:53:57 +0000 (06:53 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 May 2020 22:40:26 +0000 (15:40 -0700)
commit101736a14c9ad734fe24efed7513189849cd22eb
treef1c6dbb47c3997920415831dd8264282efddafb4
parentdde72f94bcba8f84f4ea6523b67302df6638c9c0
pkt-line: extern packet_length()

In a future commit, we will be manually processing packets and we will
need to access the length header. In order to simplify this, extern
packet_length() so that the logic can be reused.

Change the function parameter from `const char *linelen` to
`const char lenbuf_hex[4]`. Even though these two types behave
identically as function parameters, use the array notation to
semantically indicate exactly what this function is expecting as an
argument. Also, rename it from linelen to lenbuf_hex as the former
sounds like it should be an integral type which is misleading.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pkt-line.c
pkt-line.h