blob: 9d0875cb73c58b25091c8f8239c81891e175a4d8 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
Cristy7ce65e72015-12-12 18:03:16 -05002 Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization
cristy3ed852e2009-09-05 21:47:34 +00003 dedicated to making software imaging solutions freely available.
4
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
7
8 http://www.imagemagick.org/script/license.php
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 MagickCore string methods.
17*/
18#ifndef _MAGICKCORE_STRING_H_
19#define _MAGICKCORE_STRING_H_
20
cristy6398ec72013-11-28 02:00:27 +000021#include "MagickCore/exception.h"
22
cristy3ed852e2009-09-05 21:47:34 +000023#if defined(__cplusplus) || defined(c_plusplus)
24extern "C" {
25#endif
26
cristy3ed852e2009-09-05 21:47:34 +000027typedef struct _StringInfo
28{
29 char
dirkcecec522015-04-14 20:17:56 +000030 *path;
cristy3ed852e2009-09-05 21:47:34 +000031
32 unsigned char
33 *datum;
34
35 size_t
cristy5ed838e2010-05-31 00:05:35 +000036 length,
cristy3ed852e2009-09-05 21:47:34 +000037 signature;
38} StringInfo;
39
40extern MagickExport char
41 *AcquireString(const char *),
42 *CloneString(char **,const char *),
43 *ConstantString(const char *),
44 *DestroyString(char *),
45 **DestroyStringList(char **),
46 *EscapeString(const char *,const char),
47 *FileToString(const char *,const size_t,ExceptionInfo *),
cristy99bbf2c2011-09-26 18:27:50 +000048 *GetEnvironmentValue(const char *),
cristy3ed852e2009-09-05 21:47:34 +000049 *StringInfoToHexString(const StringInfo *),
50 *StringInfoToString(const StringInfo *),
51 **StringToArgv(const char *,int *),
52 *StringToken(const char *,char **),
53 **StringToList(const char *);
54
55extern MagickExport const char
56 *GetStringInfoPath(const StringInfo *);
57
cristydbdd0e32011-11-04 23:29:40 +000058extern MagickExport double
dirk05d2ff72015-11-18 23:13:43 +010059 InterpretSiPrefixValue(const char *magick_restrict,char **magick_restrict),
cristy52085732013-11-09 02:32:27 +000060 *StringToArrayOfDoubles(const char *,ssize_t *,ExceptionInfo *);
cristydbdd0e32011-11-04 23:29:40 +000061
cristyde58b412010-02-18 03:53:40 +000062extern MagickExport int
Cristy8ba074d2015-10-19 14:36:08 -040063 CompareStringInfo(const StringInfo *,const StringInfo *);
cristyde58b412010-02-18 03:53:40 +000064
cristy3ed852e2009-09-05 21:47:34 +000065extern MagickExport MagickBooleanType
66 ConcatenateString(char **,const char *),
anthony6f201312012-03-30 04:08:15 +000067 IsStringTrue(const char *),
dirk9a846de2015-07-25 16:51:01 +000068 IsStringFalse(const char *),
cristy3ed852e2009-09-05 21:47:34 +000069 SubstituteString(char **,const char *,const char *);
70
cristy3ed852e2009-09-05 21:47:34 +000071extern MagickExport size_t
cristyd2fe6cb2009-11-19 19:00:50 +000072 ConcatenateMagickString(char *,const char *,const size_t)
cristy73380532012-02-18 20:26:28 +000073 magick_attribute((__nonnull__)),
cristyd2fe6cb2009-11-19 19:00:50 +000074 CopyMagickString(char *,const char *,const size_t)
cristy73380532012-02-18 20:26:28 +000075 magick_attribute((__nonnull__)),
cristy3ed852e2009-09-05 21:47:34 +000076 GetStringInfoLength(const StringInfo *);
77
cristy5ed838e2010-05-31 00:05:35 +000078extern MagickExport ssize_t
cristy40937042014-12-22 01:44:59 +000079 FormatMagickSize(const MagickSizeType,const MagickBooleanType,const char *,
cristyd4618c02015-04-14 23:54:43 +000080 const size_t,char *),
cristy5ed838e2010-05-31 00:05:35 +000081 FormatMagickTime(const time_t,const size_t,char *);
82
cristy3ed852e2009-09-05 21:47:34 +000083extern MagickExport StringInfo
84 *AcquireStringInfo(const size_t),
cristy8723e4b2011-09-01 13:11:19 +000085 *BlobToStringInfo(const void *,const size_t),
cristy3ed852e2009-09-05 21:47:34 +000086 *CloneStringInfo(const StringInfo *),
cristy99bbf2c2011-09-26 18:27:50 +000087 *ConfigureFileToStringInfo(const char *),
cristy3ed852e2009-09-05 21:47:34 +000088 *DestroyStringInfo(StringInfo *),
89 *FileToStringInfo(const char *,const size_t,ExceptionInfo *),
90 *SplitStringInfo(StringInfo *,const size_t),
91 *StringToStringInfo(const char *);
92
93extern MagickExport unsigned char
94 *GetStringInfoDatum(const StringInfo *);
95
96extern MagickExport void
cristyd2fe6cb2009-11-19 19:00:50 +000097 ConcatenateStringInfo(StringInfo *,const StringInfo *)
cristy73380532012-02-18 20:26:28 +000098 magick_attribute((__nonnull__)),
cristy3ed852e2009-09-05 21:47:34 +000099 PrintStringInfo(FILE *file,const char *,const StringInfo *),
100 ResetStringInfo(StringInfo *),
101 SetStringInfo(StringInfo *,const StringInfo *),
102 SetStringInfoDatum(StringInfo *,const unsigned char *),
103 SetStringInfoLength(StringInfo *,const size_t),
104 SetStringInfoPath(StringInfo *,const char *),
105 StripString(char *);
106
107#if defined(__cplusplus) || defined(c_plusplus)
108}
109#endif
110
111#endif