Page MenuHomePhorge

escape.h
No OneTemporary

Size
659 B
Referenced Files
None
Subscribers
None

escape.h

#ifndef STRINGS_H
#define STRINGS_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
static inline uint8_t unhex(uint8_t c) {
return (c & 0xF) + (c >> 6) * 9;
}
static inline bool is_xdigit(int c) {
return (unsigned)c < 256 && (
(c >= '0' && c <= '9') ||
(c >= 'a' && c <= 'f') ||
(c >= 'A' && c <= 'F')
);
}
static inline bool is_octal_escape(const uint8_t *in, size_t pos) {
uint8_t c = in[pos + 1];
return c >= '0' && c <= '7' && !(c == '0' && !(in[pos + 2] >= '0' && in[pos + 2] <= '7'));
}
size_t decode_escape(
const uint8_t *in, size_t pos, size_t end,
uint8_t *out, size_t *out_pos, uint8_t quote
);
#endif

File Metadata

Mime Type
text/x-c
Expires
Fri, Mar 27, 5:57 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
512098
Default Alt Text
escape.h (659 B)

Event Timeline