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
16mal_export str strPrelude(void *ret);
17mal_export str strEpilogue(void *ret);
18mal_export str STRtostr(str *res, const str *src);
19mal_export str STRConcat(str *res, const str *val1, const str *val2);
20mal_export str STRLength(int *res, const str *arg1);
21mal_export str STRBytes(int *res, const str *arg1);
22mal_export str STRTail(str *res, const str *arg1, const int *offset);
23mal_export str STRSubString(str *res, const str *arg1, const int *offset, const int *length);
24mal_export str STRFromWChr(str *res, const int *at);
25mal_export str STRWChrAt(int *res, const str *arg1, const int *at);
26mal_export str STRPrefix(bit *res, const str *arg1, const str *arg2);
27mal_export str STRSuffix(bit *res, const str *arg1, const str *arg2);
28mal_export str STRLower(str *res, const str *arg1);
29mal_export str STRUpper(str *res, const str *arg1);
30mal_export str STRstrSearch(int *res, const str *arg1, const str *arg2);
31mal_export str STRReverseStrSearch(int *res, const str *arg1, const str *arg2);
32mal_export str STRsplitpart(str *res, str *haystack, str *needle, int *field);
33mal_export str STRStrip(str *res, const str *arg1);
34mal_export str STRLtrim(str *res, const str *arg1);
35mal_export str STRRtrim(str *res, const str *arg1);
36mal_export str STRStrip2(str *res, const str *arg1, const str *arg2);
37mal_export str STRLtrim2(str *res, const str *arg1, const str *arg2);
38mal_export str STRRtrim2(str *res, const str *arg1, const str *arg2);
39mal_export str STRLpad(str *res, const str *arg1, const int *len);
40mal_export str STRRpad(str *res, const str *arg1, const int *len);
41mal_export str STRLpad2(str *res, const str *arg1, const int *len, const str *arg2);
42mal_export str STRRpad2(str *res, const str *arg1, const int *len, const str *arg2);
43mal_export str STRSubstitute(str *res, const str *arg1, const str *arg2, const str *arg3, const bit *g);
44
45mal_export str STRsubstringTail(str *ret, const str *s, const int *start);
46mal_export str STRsubstring(str *ret, const str *s, const int *start, const int *l);
47mal_export str STRlikewrap2(bit *ret, const str *s, const str *pat);
48mal_export str STRlikewrap(bit *ret, const str *s, const str *pat, const str *esc);
49mal_export str STRascii(int *ret, const str *s);
50mal_export str STRprefix(str *ret, const str *s, const int *l);
51mal_export str STRsuffix(str *ret, const str *s, const int *l);
52mal_export str STRlocate(int *ret, const str *s1, const str *s2);
53mal_export str STRlocate2(int *ret, const str *s1, const str *s2, const int *start);
54mal_export str STRinsert(str *ret, const str *s, const int *start, const int *l, const str *s2);
55mal_export str STRreplace(str *ret, const str *s1, const str *s2, const str *s3);
56mal_export str STRrepeat(str *ret, const str *s, const int *c);
57mal_export str STRspace(str *ret, const int *l);
58
59#endif /* __string_H__ */
60