INGOR
Loading...
Searching...
No Matches
ytStr.h
1/*
2 util/ytStr.{h,c} : String related utility routines.
3 Copyright (C) 2018, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 See LICENSE.txt for details of the licensing agreement.
7*/
8
9#ifndef __YTLIB_STR_H
10#define __YTLIB_STR_H
11
12#include <stdlib.h>
13
14#include "ytStrArray.h"
15#include "ytIntArray.h"
16
17char * ytStr_substr(const char * str, size_t length);
18char * ytStr_substr2(const char * str, const char * end);
19char * ytStr_trim(char * str);
20#ifdef YTLIB_MEMCHECK
21#define ytStr_copy(x) ytStr_copym(x,__FILE__,__LINE__)
22char * ytStr_copym(const char * str, const char * file, int line);
23#else
24char * ytStr_copy(const char * str);
25#endif
26
27size_t ytStr_size(const char * value);
28void ytStr_serialize(const char * value, ytByte ** pptr);
29char * ytStr_deserialize(ytByte ** ptr);
30ytStrArray * ytStr_split(char * str, const char delim, ytStrArray * ar);
31ytIntArray * ytStr_splitPos(char * str, const char delim, ytIntArray * ar);
32int ytStr_debug(int argc, char * argv[]);
33
34#ifdef _WIN64
35#include <string.h>
36#define ytStr_strcasecmp(s1,s2) _stricmp(s1,s2)
37#else
38#include <strings.h>
39#define ytStr_strcasecmp(s1,s2) strcasecmp(s1,s2)
40#endif
41
42#endif /* __YTLIB_STR_H */
Expandable array.
Expandable array.