common: mark hlq_append_* as static

Now that all the packing code is in one file, we can make these functions
static.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
2 files changed, 15 insertions(+), 62 deletions(-)

R common/hlq.h => 
M common/qso-pack.c
R common/hlq.h =>  +0 -47
@@ 1,47 0,0 @@ 
-/*
- * Copyright (c) 2020-2021,2023 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifndef __HLQ_H
-#define __HLQ_H
-
-#include <jeffpc/buffer.h>
-#include <jeffpc/uuid.h>
-#include <jeffpc/val.h>
-
-#include <hlog/qso-pack.h>
-
-extern int hlq_append_header(struct buffer *buf, const struct xuuid *uuid);
-
-extern int hlq_append_kv_null(struct buffer *buf, enum qso_ns ns,
-			      const char *key);
-extern int hlq_append_kv_int(struct buffer *buf, enum qso_ns ns,
-			     const char *key, uint64_t value);
-extern int hlq_append_kv_cstr(struct buffer *buf, enum qso_ns ns,
-			      const char *key, const char *value);
-extern int hlq_append_kv_time(struct buffer *buf, enum qso_ns ns,
-			      const char *key, const struct time *time);
-extern int hlq_append_kv_blob(struct buffer *buf, enum qso_ns ns,
-			      const char *key, const void *value, size_t length);
-extern int hlq_append_kv(struct buffer *buf, enum qso_ns ns, const char *key,
-			 struct val *val);
-
-#endif

          
M common/qso-pack.c +15 -15
@@ 31,7 31,6 @@ 
 #include <hlog/version.h>
 
 #include "qso-impl.h"
-#include "hlq.h"
 
 #define BASE64_LINE_LEN 76 /* when to line-wrap base64 content */
 

          
@@ 81,7 80,7 @@ static const char *get_ns_name(enum qso_
 	panic("unknown hlq namespace %d", ns);
 }
 
-int hlq_append_header(struct buffer *buf, const struct xuuid *uuid)
+static int hlq_append_header(struct buffer *buf, const struct xuuid *uuid)
 {
 	const int ver = HLQ_VERSION_CUR;
 	const uint64_t now = gettime();

          
@@ 124,7 123,8 @@ static int __append_key(struct buffer *b
 	return buffer_append_cstr(buf, key);
 }
 
-int hlq_append_kv_null(struct buffer *buf, enum qso_ns ns, const char *key)
+static int hlq_append_kv_null(struct buffer *buf, enum qso_ns ns,
+			      const char *key)
 {
 	int ret;
 

          
@@ 135,8 135,8 @@ int hlq_append_kv_null(struct buffer *bu
 	return buffer_append_cstr(buf, " nil\n");
 }
 
-int hlq_append_kv_int(struct buffer *buf, enum qso_ns ns, const char *key,
-		      uint64_t value)
+static int hlq_append_kv_int(struct buffer *buf, enum qso_ns ns,
+			     const char *key, uint64_t value)
 {
 	char strval[32];
 	int ret;

          
@@ 158,8 158,8 @@ int hlq_append_kv_int(struct buffer *buf
 	return buffer_append_c(buf, '\n');
 }
 
-int hlq_append_kv_bool(struct buffer *buf, enum qso_ns ns, const char *key,
-		       bool value)
+static int hlq_append_kv_bool(struct buffer *buf, enum qso_ns ns,
+			      const char *key, bool value)
 {
 	int ret;
 

          
@@ 171,8 171,8 @@ int hlq_append_kv_bool(struct buffer *bu
 				  value ? " bool true\n" : " bool false\n");
 }
 
-int hlq_append_kv_cstr(struct buffer *buf, enum qso_ns ns, const char *key,
-		       const char *value)
+static int hlq_append_kv_cstr(struct buffer *buf, enum qso_ns ns,
+			      const char *key, const char *value)
 {
 #define SENTINEL_SIZE	8
 	bool multiline = !!strchr(value, '\n');

          
@@ 241,8 241,8 @@ int hlq_append_kv_cstr(struct buffer *bu
 	return 0;
 }
 
-int hlq_append_kv_time(struct buffer *buf, enum qso_ns ns, const char *key,
-		       const struct time *time)
+static int hlq_append_kv_time(struct buffer *buf, enum qso_ns ns,
+			      const char *key, const struct time *time)
 {
 	char strval[32];
 	int ret;

          
@@ 267,8 267,8 @@ int hlq_append_kv_time(struct buffer *bu
 	return buffer_append_c(buf, '\n');
 }
 
-int hlq_append_kv_blob(struct buffer *buf, enum qso_ns ns, const char *key,
-		       const void *value, size_t length)
+static int hlq_append_kv_blob(struct buffer *buf, enum qso_ns ns,
+			      const char *key, const void *value, size_t length)
 {
 	char *out;
 	char *tmp;

          
@@ 319,8 319,8 @@ int hlq_append_kv_blob(struct buffer *bu
 	return buffer_append_cstr(buf, "blobend\n");
 }
 
-int hlq_append_kv(struct buffer *buf, enum qso_ns ns, const char *key,
-		  struct val *val)
+static int hlq_append_kv(struct buffer *buf, enum qso_ns ns, const char *key,
+			 struct val *val)
 {
 	if (!val)
 		return hlq_append_kv_null(buf, ns, key);