20 lines
475 B
C
20 lines
475 B
C
|
|
#pragma once
|
||
|
|
#include <stdio.h>
|
||
|
|
#include "buf.h"
|
||
|
|
|
||
|
|
/* JSON micro-parser */
|
||
|
|
char *json_str(const char *json, const char *key);
|
||
|
|
char **json_array(const char *json, int *n);
|
||
|
|
|
||
|
|
/* URL helpers */
|
||
|
|
void urldecode(char *s);
|
||
|
|
char *qparam(const char *qs, const char *key);
|
||
|
|
|
||
|
|
/* Escaping */
|
||
|
|
void html_esc(Buf *b, const char *s);
|
||
|
|
void js_esc(Buf *b, const char *s);
|
||
|
|
void fwrite_json_str(FILE *f, const char *s);
|
||
|
|
|
||
|
|
/* String utils */
|
||
|
|
int str_icontains(const char *hay, const char *needle);
|