MagickCore 7.1.1
Convert, Edit, Or Compose Bitmap Images
Loading...
Searching...
No Matches
client.c
1/*
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% %
4% %
5% %
6% CCCC L IIIII EEEEE N N TTTTT %
7% C L I E NN N T %
8% C L I EEE N N N T %
9% C L I E N NN T %
10% CCCC LLLLL IIIII EEEEE N N T %
11% %
12% %
13% MagickCore Client Methods %
14% %
15% Software Design %
16% Cristy %
17% March 2003 %
18% %
19% %
20% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization %
21% dedicated to making software imaging solutions freely available. %
22% %
23% You may not use this file except in compliance with the License. You may %
24% obtain a copy of the License at %
25% %
26% https://imagemagick.org/script/license.php %
27% %
28% Unless required by applicable law or agreed to in writing, software %
29% distributed under the License is distributed on an "AS IS" BASIS, %
30% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
31% See the License for the specific language governing permissions and %
32% limitations under the License. %
33% %
34%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35%
36%
37*/
38
39/*
40 Include declarations.
41*/
42#include "MagickCore/studio.h"
43#include "MagickCore/client.h"
44#include "MagickCore/log.h"
45#include "MagickCore/string_.h"
46
47/*
48%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49% %
50% %
51% %
52% G e t C l i e n t N a m e %
53% %
54% %
55% %
56%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57%
58% GetClientName returns the current client name.
59%
60% The format of the GetClientName method is:
61%
62% const char *GetClientName(void)
63%
64*/
65MagickExport const char *GetClientName(void)
66{
67 return(SetClientName((const char *) NULL));
68}
69
70/*
71%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72% %
73% %
74% %
75% G e t C l i e n t P a t h %
76% %
77% %
78% %
79%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
80%
81% GetClientPath returns the current client name.
82%
83% The format of the GetClientPath method is:
84%
85% const char *GetClientPath(void)
86%
87*/
88MagickExport const char *GetClientPath(void)
89{
90 return(SetClientPath((const char *) NULL));
91}
92
93/*
94%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
95% %
96% %
97% %
98% S e t C l i e n t N a m e %
99% %
100% %
101% %
102%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
103%
104% SetClientName sets the client name and returns it.
105%
106% The format of the SetClientName method is:
107%
108% const char *SetClientName(const char *name)
109%
110% A description of each parameter follows:
111%
112% o name: Specifies the new client name.
113%
114*/
115MagickExport const char *SetClientName(const char *name)
116{
117 static char
118 client_name[256] = "";
119
120 if ((name != (char *) NULL) && (*name != '\0'))
121 {
122 (void) CopyMagickString(client_name,name,sizeof(client_name));
123 (void) LogMagickEvent(ConfigureEvent,GetMagickModule(),"%s",client_name);
124 }
125 return(*client_name == '\0' ? "Magick" : client_name);
126}
127
128/*
129%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
130% %
131% %
132% %
133% S e t C l i e n t P a t h %
134% %
135% %
136% %
137%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
138%
139% SetClientPath() sets the client path if the name is specified. Otherwise
140% the current client path is returned. A zero-length string is returned if
141% the client path has never been set.
142%
143% The format of the SetClientPath method is:
144%
145% const char *SetClientPath(const char *path)
146%
147% A description of each parameter follows:
148%
149% o path: Specifies the new client path.
150%
151*/
152MagickExport const char *SetClientPath(const char *path)
153{
154 static char
155 client_path[MagickPathExtent] = "";
156
157 if ((path != (char *) NULL) && (*path != '\0'))
158 {
159 (void) CopyMagickString(client_path,path,MagickPathExtent);
160 (void) LogMagickEvent(ConfigureEvent,GetMagickModule(),"%s",path);
161 }
162 return(client_path);
163}