[MOD/FIX] Licensewerk, start counting by codepoint

XEP-0426 came out of the blue, and it *hit* me!
This commit is contained in:
LDA 2024-09-21 18:26:35 +02:00
commit c2ea3807ec
7 changed files with 100 additions and 8 deletions

View file

@ -286,6 +286,10 @@ extern void ParseeCleanup(void *data);
/* Finds the offset of the first line without a '>' at its start. */
extern int ParseeFindDatastart(char *data);
/* Finds the offset of the first line without a '>' at its start(as
* Unicode codepoints). */
extern int ParseeFindDatastartU(char *data);
/* XMPP-ifies a message event to XEP-0393 if possible. */
extern char * ParseeXMPPify(HashMap *event);

View file

@ -39,6 +39,13 @@ extern uint32_t UnistrGetch(Unistr *unistr, size_t i);
* Modifies: unistr */
extern void UnistrAddch(Unistr *unistr, uint32_t u);
/** Concats N unistrings into a new, separate unistring.
* ---------------------
* Returns: a new unistring[HEAP]
* Modifies: NOTHING
* Thrasher: UnistrFree */
extern Unistr * UnistrConcat(size_t n, ...);
/** Encodes a unistring into a C UTF-8 string
* --------------
* Returns: a valid NULL-terminated string[HEAP] | NULL
@ -64,4 +71,9 @@ typedef bool (*UnistrFilterFunc)(uint32_t u);
* Returns: a new unistring with filtered characters removed */
extern Unistr * UnistrFilter(Unistr *str, UnistrFilterFunc filter);
/** Finds the offset of the first line not starting with a specific
* characters in terms of Unicode codepoints.
* --------
* Returns: an offset of the first line to not start by {c} | 0 */
extern size_t UnistrGetOffset(Unistr *str, uint32_t sep);
#endif