From a08b44e1c6fbd8b56011a969f8c11bcc630e1ee0 Mon Sep 17 00:00:00 2001 From: bpc2003 Date: Wed, 21 May 2025 11:07:50 -0400 Subject: Decrease visibilty in encode and decode functions --- src/include/xml/encode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/include/xml/encode.c') 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)); -- cgit v1.2.3