| 1 | /* |
| 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 | * |
| 6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
| 7 | */ |
| 8 | |
| 9 | #ifndef __string_H__ |
| 10 | #define __string_H__ |
| 11 | #include "gdk.h" |
| 12 | #include "mal.h" |
| 13 | #include "mal_exception.h" |
| 14 | #include <ctype.h> |
| 15 | |
| 16 | mal_export str strPrelude(void *ret); |
| 17 | mal_export str strEpilogue(void *ret); |
| 18 | mal_export str STRtostr(str *res, const str *src); |
| 19 | mal_export str STRConcat(str *res, const str *val1, const str *val2); |
| 20 | mal_export str STRLength(int *res, const str *arg1); |
| 21 | mal_export str STRBytes(int *res, const str *arg1); |
| 22 | mal_export str STRTail(str *res, const str *arg1, const int *offset); |
| 23 | mal_export str STRSubString(str *res, const str *arg1, const int *offset, const int *length); |
| 24 | mal_export str STRFromWChr(str *res, const int *at); |
| 25 | mal_export str STRWChrAt(int *res, const str *arg1, const int *at); |
| 26 | mal_export str STRPrefix(bit *res, const str *arg1, const str *arg2); |
| 27 | mal_export str STRSuffix(bit *res, const str *arg1, const str *arg2); |
| 28 | mal_export str STRLower(str *res, const str *arg1); |
| 29 | mal_export str STRUpper(str *res, const str *arg1); |
| 30 | mal_export str STRstrSearch(int *res, const str *arg1, const str *arg2); |
| 31 | mal_export str STRReverseStrSearch(int *res, const str *arg1, const str *arg2); |
| 32 | mal_export str STRsplitpart(str *res, str *haystack, str *needle, int *field); |
| 33 | mal_export str STRStrip(str *res, const str *arg1); |
| 34 | mal_export str STRLtrim(str *res, const str *arg1); |
| 35 | mal_export str STRRtrim(str *res, const str *arg1); |
| 36 | mal_export str STRStrip2(str *res, const str *arg1, const str *arg2); |
| 37 | mal_export str STRLtrim2(str *res, const str *arg1, const str *arg2); |
| 38 | mal_export str STRRtrim2(str *res, const str *arg1, const str *arg2); |
| 39 | mal_export str STRLpad(str *res, const str *arg1, const int *len); |
| 40 | mal_export str STRRpad(str *res, const str *arg1, const int *len); |
| 41 | mal_export str STRLpad2(str *res, const str *arg1, const int *len, const str *arg2); |
| 42 | mal_export str STRRpad2(str *res, const str *arg1, const int *len, const str *arg2); |
| 43 | mal_export str STRSubstitute(str *res, const str *arg1, const str *arg2, const str *arg3, const bit *g); |
| 44 | |
| 45 | mal_export str STRsubstringTail(str *ret, const str *s, const int *start); |
| 46 | mal_export str STRsubstring(str *ret, const str *s, const int *start, const int *l); |
| 47 | mal_export str STRlikewrap2(bit *ret, const str *s, const str *pat); |
| 48 | mal_export str STRlikewrap(bit *ret, const str *s, const str *pat, const str *esc); |
| 49 | mal_export str STRascii(int *ret, const str *s); |
| 50 | mal_export str STRprefix(str *ret, const str *s, const int *l); |
| 51 | mal_export str STRsuffix(str *ret, const str *s, const int *l); |
| 52 | mal_export str STRlocate(int *ret, const str *s1, const str *s2); |
| 53 | mal_export str STRlocate2(int *ret, const str *s1, const str *s2, const int *start); |
| 54 | mal_export str STRinsert(str *ret, const str *s, const int *start, const int *l, const str *s2); |
| 55 | mal_export str STRreplace(str *ret, const str *s1, const str *s2, const str *s3); |
| 56 | mal_export str STRrepeat(str *ret, const str *s, const int *c); |
| 57 | mal_export str STRspace(str *ret, const int *l); |
| 58 | |
| 59 | #endif /* __string_H__ */ |
| 60 | |