2021-03-25 09:21:13 +00:00
|
|
|
#ifndef COSMOPOLITAN_NET_HTTP_ESCAPE_H_
|
|
|
|
#define COSMOPOLITAN_NET_HTTP_ESCAPE_H_
|
2021-04-23 17:45:19 +00:00
|
|
|
|
|
|
|
#define kControlWs 1
|
|
|
|
#define kControlC0 2
|
|
|
|
#define kControlC1 4
|
|
|
|
|
2021-03-25 09:21:13 +00:00
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
2021-04-21 02:14:21 +00:00
|
|
|
extern const char kEscapeAuthority[256];
|
|
|
|
extern const char kEscapeIp[256];
|
|
|
|
extern const char kEscapePath[256];
|
|
|
|
extern const char kEscapeSegment[256];
|
|
|
|
extern const char kEscapeParam[256];
|
|
|
|
extern const char kEscapeFragment[256];
|
|
|
|
|
2021-04-23 17:45:19 +00:00
|
|
|
char *EscapeHtml(const char *, size_t, size_t *);
|
|
|
|
char *EscapeUrl(const char *, size_t, size_t *, const char[256]);
|
|
|
|
char *EscapeUser(const char *, size_t, size_t *);
|
|
|
|
char *EscapePass(const char *, size_t, size_t *);
|
|
|
|
char *EscapeIp(const char *, size_t, size_t *);
|
|
|
|
char *EscapeHost(const char *, size_t, size_t *);
|
|
|
|
char *EscapePath(const char *, size_t, size_t *);
|
|
|
|
char *EscapeParam(const char *, size_t, size_t *);
|
|
|
|
char *EscapeFragment(const char *, size_t, size_t *);
|
|
|
|
char *EscapeSegment(const char *, size_t, size_t *);
|
2022-07-13 06:31:06 +00:00
|
|
|
char *EscapeJsStringLiteral(char **, size_t *, const char *, size_t, size_t *);
|
2021-04-23 17:45:19 +00:00
|
|
|
|
2021-05-02 18:11:26 +00:00
|
|
|
ssize_t HasControlCodes(const char *, size_t, int);
|
2021-04-23 17:45:19 +00:00
|
|
|
char *Underlong(const char *, size_t, size_t *);
|
|
|
|
char *DecodeLatin1(const char *, size_t, size_t *);
|
|
|
|
char *EncodeLatin1(const char *, size_t, size_t *, int);
|
|
|
|
char *EncodeHttpHeaderValue(const char *, size_t, size_t *);
|
|
|
|
char *VisualizeControlCodes(const char *, size_t, size_t *);
|
|
|
|
char *IndentLines(const char *, size_t, size_t *, size_t);
|
2023-10-12 03:06:20 +00:00
|
|
|
char *EncodeBase32(const char *, size_t, const char *, size_t, size_t *);
|
|
|
|
char *DecodeBase32(const char *, size_t, const char *, size_t, size_t *);
|
2021-04-23 17:45:19 +00:00
|
|
|
char *EncodeBase64(const char *, size_t, size_t *);
|
|
|
|
char *DecodeBase64(const char *, size_t, size_t *);
|
2021-03-25 09:21:13 +00:00
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
|
|
#endif /* COSMOPOLITAN_NET_HTTP_ESCAPE_H_ */
|