/
api.h
84 lines (73 loc) · 4.13 KB
/
api.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: krakjoe@php.net |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef PHP_USTRING_API_H
#define PHP_USTRING_API_H
#ifdef PHP_WIN32
# define PHP_USTRING_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_USTRING_API __attribute__ ((visibility("default")))
#else
# define PHP_USTRING_API
#endif
extern "C" {
# include "php.h"
# include "php_ini.h"
# include "ext/standard/info.h"
}
/* {{{ */
PHP_USTRING_API void php_ustring_construct(zval *that, const char *value, int32_t len, const char *codepage, int32_t clen TSRMLS_DC);
PHP_USTRING_API int32_t php_ustring_length(zval *that TSRMLS_DC);
PHP_USTRING_API bool php_ustring_startsWith(zval *that, zval *needle TSRMLS_DC);
PHP_USTRING_API bool php_ustring_endsWith(zval *that, zval *needle TSRMLS_DC);
PHP_USTRING_API int32_t php_ustring_indexOf(zval *that, zval *needle, int32_t offset TSRMLS_DC);
PHP_USTRING_API int32_t php_ustring_lastIndexOf(zval *that, zval *needle, int32_t offset TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_toLower(zval *that, zval *lowered TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_toUpper(zval *that, zval *uppered TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_reverse(zval *that, zval *reversed TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_trim(zval *that, zval *trimmed TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_replace(zval *that, zval *search, zval *replace, zval *replaced TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_replaceSlice(zval *that, zval *slice, int32_t offset, int32_t length, zval *replaced TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_charAt(zval *that, int32_t offset, zval *found TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_substring(zval *that, int32_t offset, int32_t length, zval *sub TSRMLS_DC);
PHP_USTRING_API bool php_ustring_contains(zval *that, zval *text TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_chunk(zval *that, int32_t length, zval *chunks TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_repeat(zval *that, int32_t count, zval *repeated TSRMLS_DC);
PHP_USTRING_API int php_ustring_compare(zval *op1, zval *op2 TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_pad(zval *that, int32_t target_len, zval *pad, int mode, zval *padded TSRMLS_DC);
PHP_USTRING_API zval* php_ustring_split(zval *that, zval *delimiter, int32_t limit, zval *pieces TSRMLS_DC);
PHP_USTRING_API zend_string* php_ustring_getCodepage(zval *that TSRMLS_DC);
PHP_USTRING_API void php_ustring_setDefaultCodepage(const char *value, int32_t len TSRMLS_DC);
PHP_USTRING_API zend_string* php_ustring_getDefaultCodepage(TSRMLS_D);
PHP_USTRING_API extern zend_class_entry* ce_UString;
#ifdef ZTS
#define UG(v) TSRMG(ustring_globals_id, zend_ustring_globals *, v)
#else
#define UG(v) (ustring_globals.v)
#endif
ZEND_EXTERN_MODULE_GLOBALS(ustring);
/* }}} */
#endif /* PHP_USTRING_API_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/