summaryrefslogtreecommitdiff
path: root/src/include/xml/encode.c
diff options
context:
space:
mode:
authorbpc2003 <wpesfriendnva@gmail.com>2025-05-21 11:07:50 -0400
committerbpc2003 <wpesfriendnva@gmail.com>2025-05-21 11:07:50 -0400
commita08b44e1c6fbd8b56011a969f8c11bcc630e1ee0 (patch)
tree5a4337c8993f1bee673d4de819a5b64fe0aa1f95 /src/include/xml/encode.c
parent3c07894d658c3fa75f1cd1fd524e7464d9d95f1d (diff)
Decrease visibilty in encode and decode functions
Diffstat (limited to 'src/include/xml/encode.c')
-rw-r--r--src/include/xml/encode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/include/xml/encode.c b/src/include/xml/encode.c
index 60e418d..6ed753e 100644
--- a/src/include/xml/encode.c
+++ b/src/include/xml/encode.c
@@ -5,8 +5,11 @@
#include "xml.h"
static void check(char **str, int *len, int *used, int n);
+static char *encode_helper(map_t *map, int len);
-char *encode(map_t *map, int len) {
+char *encode(map_t *map) { return encode_helper(map, 1); }
+
+static char *encode_helper(map_t *map, int len) {
int slen = 128, used = 0;
char *str = calloc(slen, sizeof(char));
@@ -25,7 +28,7 @@ char *encode(map_t *map, int len) {
check(&str, &slen, &used, 1);
strcat(str, ">");
if (map[i].size == sizeof(map_t)) {
- char *rt = encode((map_t *)map[i].payload, map[i].n);
+ char *rt = encode_helper((map_t *)map[i].payload, map[i].n);
if (rt == NULL)
return NULL;
check(&str, &slen, &used, strlen(rt));