p2
0.0
|
internals of utf-8 and byte strings More...
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "p2.h"
#include "internal.h"
#include "khash.h"
#include "table.h"
Go to the source code of this file.
Macros | |
#define | BYTES_FACTOR 1 / 8 * 9 |
#define | BYTES_CHUNK 32 |
#define | BYTES_ALIGN(len) PN_ALIGN(len + sizeof(struct PNBytes), BYTES_CHUNK) - sizeof(struct PNBytes) |
Functions | |
void | potion_add_str (Potion *P, PN s) |
PN | potion_lookup_str (Potion *P, const char *str) |
PN | potion_str (Potion *P, const char *str) |
PN | potion_str2 (Potion *P, char *str, size_t len) |
PN | potion_strcat (Potion *P, char *str, char *str2) |
PN | potion_str_format (Potion *P, const char *format,...) |
static size_t | potion_utf8char_offset (const char *s, size_t index) |
returns byte position of the index-th utf8 char More... | |
static size_t | potion_utf8char_nextchar (const char *s, size_t offset) |
returns byte position of next utf8 char after s[offset] More... | |
static unsigned long | potion_utf8char_decode (const char *s) |
decode the utf8 codepoint at s, i.e. ord More... | |
static PN | potion_str_slice_index (PN index, size_t len, int nilvalue) |
helper function for potion_str_slice to fix index. More... | |
PN | potion_byte_str (Potion *P, const char *str) |
PN | potion_byte_str2 (Potion *P, const char *str, size_t len) |
PN | potion_bytes (Potion *P, size_t len) |
PN_SIZE | pn_printf (Potion *P, PN bytes, const char *format,...) |
void | potion_bytes_obj_string (Potion *P, PN bytes, PN obj) |
void | potion_str_hash_init (Potion *P) |
void | potion_str_init (Potion *P) |
Variables | |
static const uint8_t | utf8d [] |
internals of utf-8 and byte strings
Definition in file string.c.
#define BYTES_ALIGN | ( | len | ) | PN_ALIGN(len + sizeof(struct PNBytes), BYTES_CHUNK) - sizeof(struct PNBytes) |
|
static |
|
static |
|
static |
|
static |