git: 064f91f65f82 - stable/13 - hesiod: Modernize.

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Wed, 13 Dec 2023 20:06:28 UTC
The branch stable/13 has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=064f91f65f82a486efc35c843d23d092e46204c8

commit 064f91f65f82a486efc35c843d23d092e46204c8
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-10-18 14:05:37 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-12-13 16:39:37 +0000

    hesiod: Modernize.
    
    Reviewed by:    zlei
    Differential Revision:  https://reviews.freebsd.org/D42190
    
    (cherry picked from commit 64fc8a936c868345a8f687fe2797474c5fcf35cb)
---
 lib/libc/net/hesiod.c | 42 +++++++++++++-----------------------------
 1 file changed, 13 insertions(+), 29 deletions(-)

diff --git a/lib/libc/net/hesiod.c b/lib/libc/net/hesiod.c
index fbead770730f..14ed2c7ce641 100644
--- a/lib/libc/net/hesiod.c
+++ b/lib/libc/net/hesiod.c
@@ -81,8 +81,7 @@ static void	  translate_errors(void);
  *	initialize a hesiod_p.
  */
 int 
-hesiod_init(context)
-	void	**context;
+hesiod_init(void **context)
 {
 	struct hesiod_p	*ctx;
 	const char	*p, *configname;
@@ -136,8 +135,7 @@ hesiod_init(context)
  *	Deallocates the hesiod_p.
  */
 void 
-hesiod_end(context)
-	void	*context;
+hesiod_end(void *context)
 {
 	struct hesiod_p *ctx = (struct hesiod_p *) context;
 
@@ -227,10 +225,7 @@ hesiod_to_bind(void *context, const char *name, const char *type)
  *	by the resolver.
  */
 char **
-hesiod_resolve(context, name, type)
-	void		*context;
-	const char	*name;
-	const char	*type;
+hesiod_resolve(void *context, const char *name, const char *type)
 {
 	struct hesiod_p	*ctx = (struct hesiod_p *) context;
 	char		*bindname, **retvec;
@@ -249,9 +244,7 @@ hesiod_resolve(context, name, type)
 
 /*ARGSUSED*/
 void 
-hesiod_free_list(context, list)
-	void	 *context;
-	char	**list;
+hesiod_free_list(void *context, char **list)
 {
 	char  **p;
 
@@ -269,9 +262,7 @@ hesiod_free_list(context, list)
  *	or ctx->rhs which need to be freed by the caller.
  */
 static int 
-read_config_file(ctx, filename)
-	struct hesiod_p	*ctx;
-	const char	*filename;
+read_config_file(struct hesiod_p *ctx, const char *filename)
 {
 	char	*key, *data, *p, **which;
 	char	 buf[MAXDNAME + 7];
@@ -363,9 +354,7 @@ read_config_file(ctx, filename)
  *	return a list of them.
  */
 static char **
-get_txt_records(qclass, name)
-	int		 qclass;
-	const char	*name;
+get_txt_records(int qclass, const char *name)
 {
 	HEADER		*hp;
 	unsigned char	 qbuf[PACKETSZ], abuf[MAX_HESRESP], *p, *eom, *eor;
@@ -489,16 +478,14 @@ static void	 *context;
 static int	  errval = HES_ER_UNINIT;
 
 int
-hes_init()
+hes_init(void)
 {
 	init_context();
 	return errval;
 }
 
 char *
-hes_to_bind(name, type)
-	const char	*name;
-	const char	*type;
+hes_to_bind(const char *name, const char *type)
 {
 	static	char	*bindname;
 	if (init_context() < 0)
@@ -512,9 +499,7 @@ hes_to_bind(name, type)
 }
 
 char **
-hes_resolve(name, type)
-	const char	*name;
-	const char	*type;
+hes_resolve(const char *name, const char *type)
 {
 	static char	**list;
 
@@ -535,20 +520,19 @@ hes_resolve(name, type)
 }
 
 int
-hes_error()
+hes_error(void)
 {
 	return errval;
 }
 
 void
-hes_free(hp)
-	char **hp;
+hes_free(char **hp)
 {
 	hesiod_free_list(context, hp);
 }
 
 static int
-init_context()
+init_context(void)
 {
 	if (!inited) {
 		inited = 1;
@@ -562,7 +546,7 @@ init_context()
 }
 
 static void
-translate_errors()
+translate_errors(void)
 {
 	switch (errno) {
 	case ENOENT: