• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2   Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
3   dedicated to making software imaging solutions freely available.
4 
5   You may not use this file except in compliance with the License.  You may
6   obtain a copy of the License at
7 
8     https://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 #include "MagickCore/exception.h"
22 
23 #if defined(__cplusplus) || defined(c_plusplus)
24 extern "C" {
25 #endif
26 
27 typedef struct _StringInfo
28 {
29   char
30     *path;
31 
32   unsigned char
33     *datum;
34 
35   size_t
36     length,
37     signature;
38 
39   char
40     *name;
41 } StringInfo;
42 
43 extern MagickExport char
44   *AcquireString(const char *),
45   *CloneString(char **,const char *),
46   *ConstantString(const char *),
47   *DestroyString(char *),
48   **DestroyStringList(char **),
49   *EscapeString(const char *,const char),
50   *FileToString(const char *,const size_t,ExceptionInfo *),
51   *GetEnvironmentValue(const char *),
52   *SanitizeString(const char *),
53   *StringInfoToHexString(const StringInfo *),
54   *StringInfoToString(const StringInfo *),
55   **StringToArgv(const char *,int *),
56   *StringToken(const char *,char **),
57   **StringToList(const char *),
58   **StringToStrings(const char *,size_t *);
59 
60 extern MagickExport const char
61   *GetStringInfoName(const StringInfo *),
62   *GetStringInfoPath(const StringInfo *);
63 
64 extern MagickExport double
65   InterpretSiPrefixValue(const char *magick_restrict,char **magick_restrict),
66   *StringToArrayOfDoubles(const char *,ssize_t *,ExceptionInfo *);
67 
68 extern MagickExport int
69   CompareStringInfo(const StringInfo *,const StringInfo *);
70 
71 extern MagickExport MagickBooleanType
72   ConcatenateString(char **magick_restrict,const char *magick_restrict),
73   IsStringTrue(const char *) magick_attribute((__pure__)),
74   IsStringFalse(const char *) magick_attribute((__pure__)),
75   SubstituteString(char **,const char *,const char *);
76 
77 extern MagickExport size_t
78   ConcatenateMagickString(char *magick_restrict,const char *magick_restrict,
79     const size_t) magick_attribute((__nonnull__)),
80   CopyMagickString(char *magick_restrict,const char *magick_restrict,
81     const size_t) magick_attribute((__nonnull__)),
82   GetStringInfoLength(const StringInfo *);
83 
84 extern MagickExport ssize_t
85   FormatMagickSize(const MagickSizeType,const MagickBooleanType,const char *,
86     const size_t,char *);
87 
88 extern MagickExport StringInfo
89   *AcquireStringInfo(const size_t),
90   *BlobToStringInfo(const void *,const size_t),
91   *CloneStringInfo(const StringInfo *),
92   *ConfigureFileToStringInfo(const char *),
93   *DestroyStringInfo(StringInfo *),
94   *FileToStringInfo(const char *,const size_t,ExceptionInfo *),
95   *SplitStringInfo(StringInfo *,const size_t),
96   *StringToStringInfo(const char *);
97 
98 extern MagickExport unsigned char
99   *GetStringInfoDatum(const StringInfo *);
100 
101 extern MagickExport void
102   ConcatenateStringInfo(StringInfo *,const StringInfo *)
103     magick_attribute((__nonnull__)),
104   PrintStringInfo(FILE *file,const char *,const StringInfo *),
105   ResetStringInfo(StringInfo *),
106   SetStringInfo(StringInfo *,const StringInfo *),
107   SetStringInfoDatum(StringInfo *,const unsigned char *),
108   SetStringInfoLength(StringInfo *,const size_t),
109   SetStringInfoName(StringInfo *,const char *),
110   SetStringInfoPath(StringInfo *,const char *),
111   StripString(char *);
112 
113 #if defined(__cplusplus) || defined(c_plusplus)
114 }
115 #endif
116 
117 #endif
118