2021-06-27 09:32:03 +03:00
|
|
|
#pragma once
|
2020-10-11 17:05:00 +03:00
|
|
|
|
|
|
|
#include "cBackend.h"
|
2024-03-21 15:32:37 +03:00
|
|
|
#include "casts.h"
|
2020-10-11 17:05:00 +03:00
|
|
|
|
2024-03-21 15:32:37 +03:00
|
|
|
/* stringLength : String -> Int64!? WTH!. do you have over 4Gbytes text on
|
|
|
|
* memory!? */
|
|
|
|
#define stringLength(x) (idris2_mkInt64(strlen(((Value_String *)(x))->str)))
|
|
|
|
#define head(x) (idris2_cast_String_to_Char(x))
|
2020-10-11 17:05:00 +03:00
|
|
|
Value *tail(Value *str);
|
|
|
|
Value *reverse(Value *str);
|
|
|
|
Value *strIndex(Value *str, Value *i);
|
|
|
|
Value *strCons(Value *c, Value *str);
|
|
|
|
Value *strAppend(Value *a, Value *b);
|
|
|
|
Value *strSubstr(Value *s, Value *start, Value *len);
|
2021-05-17 13:48:46 +03:00
|
|
|
char *fastPack(Value *charList);
|
|
|
|
Value *fastUnpack(char *str);
|
|
|
|
char *fastConcat(Value *strList);
|
2020-10-11 17:05:00 +03:00
|
|
|
|
2021-05-17 16:30:00 +03:00
|
|
|
Value *stringIteratorNew(char *str);
|
|
|
|
Value *onCollectStringIterator(Value_Pointer *ptr, void *null);
|
2022-09-21 13:13:15 +03:00
|
|
|
Value *stringIteratorToString(void *a, char *str, Value *it_p,
|
|
|
|
Value_Closure *f);
|
2021-05-17 16:30:00 +03:00
|
|
|
Value *stringIteratorNext(char *s, Value *it_p);
|