blob: 589c3bedea799dcdb70eb9c161a3dc7cd119e54e [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
cristyfe676ee2013-11-18 13:03:38 +00002 Copyright 1999-2014 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
21#if defined(__cplusplus) || defined(c_plusplus)
22extern "C" {
23#endif
24
cristy4c08aed2011-07-01 19:47:50 +000025#include "MagickCore/exception.h"
cristy3ed852e2009-09-05 21:47:34 +000026
27typedef struct _StringInfo
28{
29 char
30 path[MaxTextExtent];
31
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
anthonyb1d483a2012-04-14 12:53:56 +000059 InterpretSiPrefixValue(const char *restrict,char **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
63 CompareStringInfo(const StringInfo *,const StringInfo *),
64 LocaleCompare(const char *,const char *),
65 LocaleNCompare(const char *,const char *,const size_t);
66
cristy3ed852e2009-09-05 21:47:34 +000067extern MagickExport MagickBooleanType
68 ConcatenateString(char **,const char *),
anthony6f201312012-03-30 04:08:15 +000069 IsStringTrue(const char *),
70 IsStringNotFalse(const char *),
cristy3ed852e2009-09-05 21:47:34 +000071 SubstituteString(char **,const char *,const char *);
72
cristy3ed852e2009-09-05 21:47:34 +000073extern MagickExport size_t
cristyd2fe6cb2009-11-19 19:00:50 +000074 ConcatenateMagickString(char *,const char *,const size_t)
cristy73380532012-02-18 20:26:28 +000075 magick_attribute((__nonnull__)),
cristyd2fe6cb2009-11-19 19:00:50 +000076 CopyMagickString(char *,const char *,const size_t)
cristy73380532012-02-18 20:26:28 +000077 magick_attribute((__nonnull__)),
cristy3ed852e2009-09-05 21:47:34 +000078 GetStringInfoLength(const StringInfo *);
79
cristy5ed838e2010-05-31 00:05:35 +000080extern MagickExport ssize_t
cristy99bbf2c2011-09-26 18:27:50 +000081 FormatMagickSize(const MagickSizeType,const MagickBooleanType,char *),
cristy5ed838e2010-05-31 00:05:35 +000082 FormatMagickTime(const time_t,const size_t,char *);
83
cristy3ed852e2009-09-05 21:47:34 +000084extern MagickExport StringInfo
85 *AcquireStringInfo(const size_t),
cristy8723e4b2011-09-01 13:11:19 +000086 *BlobToStringInfo(const void *,const size_t),
cristy3ed852e2009-09-05 21:47:34 +000087 *CloneStringInfo(const StringInfo *),
cristy99bbf2c2011-09-26 18:27:50 +000088 *ConfigureFileToStringInfo(const char *),
cristy3ed852e2009-09-05 21:47:34 +000089 *DestroyStringInfo(StringInfo *),
90 *FileToStringInfo(const char *,const size_t,ExceptionInfo *),
91 *SplitStringInfo(StringInfo *,const size_t),
92 *StringToStringInfo(const char *);
93
94extern MagickExport unsigned char
95 *GetStringInfoDatum(const StringInfo *);
96
97extern MagickExport void
cristyd2fe6cb2009-11-19 19:00:50 +000098 ConcatenateStringInfo(StringInfo *,const StringInfo *)
cristy73380532012-02-18 20:26:28 +000099 magick_attribute((__nonnull__)),
cristy3ed852e2009-09-05 21:47:34 +0000100 LocaleLower(char *),
101 LocaleUpper(char *),
102 PrintStringInfo(FILE *file,const char *,const StringInfo *),
103 ResetStringInfo(StringInfo *),
104 SetStringInfo(StringInfo *,const StringInfo *),
105 SetStringInfoDatum(StringInfo *,const unsigned char *),
106 SetStringInfoLength(StringInfo *,const size_t),
107 SetStringInfoPath(StringInfo *,const char *),
108 StripString(char *);
109
110#if defined(__cplusplus) || defined(c_plusplus)
111}
112#endif
113
114#endif