aboutsummaryrefslogtreecommitdiff
path: root/json.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-12 21:28:44 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-12 21:28:44 -0800
commit5811ff4554da3d980ff32a83efa35ea1a4512484 (patch)
tree752ee83bb6b671f8686809f04df0f63b5a0b1a82 /json.c
parentb27b71608b3ba4715d629c597efd17c124a8cc22 (diff)
Adding comments
Diffstat (limited to 'json.c')
-rw-r--r--json.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/json.c b/json.c
index f7e34fe..22a3ae2 100644
--- a/json.c
+++ b/json.c
@@ -7,7 +7,9 @@
#include "types.h"
//
-// Print a match as JSON
+// Helper function for json_match().
+// `comma` is used to track whether a comma will need to be printed before the
+// next object or not.
//
static int _json_match(const char *text, match_t *m, int comma, int verbose)
{
@@ -41,6 +43,9 @@ static int _json_match(const char *text, match_t *m, int comma, int verbose)
return 1;
}
+//
+// Print a match object as a JSON object.
+//
void json_match(const char *text, match_t *m, int verbose)
{
_json_match(text, m, 0, verbose);