1 /* |
1 /* |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
3 * |
3 * |
4 * Copyright 2016 Olaf Wintermann. All rights reserved. |
4 * Copyright 2017 Mike Becker, Olaf Wintermann All rights reserved. |
5 * |
5 * |
6 * Redistribution and use in source and binary forms, with or without |
6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are met: |
7 * modification, are permitted provided that the following conditions are met: |
8 * |
8 * |
9 * 1. Redistributions of source code must retain the above copyright |
9 * 1. Redistributions of source code must retain the above copyright |
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
26 * POSSIBILITY OF SUCH DAMAGE. |
26 * POSSIBILITY OF SUCH DAMAGE. |
27 */ |
27 */ |
28 |
28 |
|
29 #include "ucx/string.h" |
|
30 |
|
31 #include "ucx/allocator.h" |
|
32 |
29 #include <stdlib.h> |
33 #include <stdlib.h> |
30 #include <string.h> |
34 #include <string.h> |
31 #include <stdarg.h> |
35 #include <stdarg.h> |
32 #include <stdint.h> |
36 #include <stdint.h> |
33 #include <ctype.h> |
37 #include <ctype.h> |
34 |
|
35 #include "string.h" |
|
36 #include "allocator.h" |
|
37 |
38 |
38 sstr_t sstr(char *cstring) { |
39 sstr_t sstr(char *cstring) { |
39 sstr_t string; |
40 sstr_t string; |
40 string.ptr = cstring; |
41 string.ptr = cstring; |
41 string.length = strlen(cstring); |
42 string.length = strlen(cstring); |