root / ImageMagick / trunk / magick / client.c

Revision 8839, 7.2 kB (checked in by cristy, 10 months ago)
Line 
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%                         ImageMagick Client Methods                          %
14%                                                                             %
15%                             Software Design                                 %
16%                               John Cristy                                   %
17%                               March 2003                                    %
18%                                                                             %
19%                                                                             %
20%  Copyright 1999-2008 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%    http://www.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 "magick/studio.h"
43#include "magick/client.h"
44#include "magick/string_.h"
45
46/*
47  Static declaractions.
48*/
49static char
50  client_name[MaxTextExtent] = "ImageMagick",
51  client_path[MaxTextExtent] = "";
52
53/*
54%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55%                                                                             %
56%                                                                             %
57%                                                                             %
58%   G e t C l i e n t N a m e                                                 %
59%                                                                             %
60%                                                                             %
61%                                                                             %
62%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63%
64%  GetClientName returns the current client name.
65%
66%  The format of the GetClientName method is:
67%
68%      const char *GetClientName(void)
69%
70*/
71MagickExport const char *GetClientName(void)
72{
73  return(client_name);
74}
75
76/*
77%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78%                                                                             %
79%                                                                             %
80%                                                                             %
81%   G e t C l i e n t P a t h                                                 %
82%                                                                             %
83%                                                                             %
84%                                                                             %
85%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86%
87%  GetClientPath returns the current client name.
88%
89%  The format of the GetClientPath method is:
90%
91%      const char *GetClientPath(void)
92%
93*/
94MagickExport const char *GetClientPath(void)
95{
96  return(client_path);
97}
98
99/*
100%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
101%                                                                             %
102%                                                                             %
103%                                                                             %
104%   S e t C l i e n t N a m e                                                 %
105%                                                                             %
106%                                                                             %
107%                                                                             %
108%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
109%
110%  SetClientName sets the client name and returns it.
111%
112%  The format of the SetClientName method is:
113%
114%      const char *SetClientName(const char *name)
115%
116%  A description of each parameter follows:
117%
118%    o client_name: SetClientName() returns the current client name.
119%
120%    o name: Specifies the new client name.
121%
122*/
123MagickExport const char *SetClientName(const char *name)
124{
125  if ((name != (char *) NULL) && (*name != '\0'))
126    (void) CopyMagickString(client_name,name,MaxTextExtent);
127  return(client_name);
128}
129
130/*
131%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
132%                                                                             %
133%                                                                             %
134%                                                                             %
135%   S e t C l i e n t P a t h                                                 %
136%                                                                             %
137%                                                                             %
138%                                                                             %
139%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140%
141%  SetClientPath() sets the client path if the name is specified.  Otherwise
142%  the current client path is returned. A zero-length string is returned if
143%  the client path has never been set.
144%
145%  The format of the SetClientPath method is:
146%
147%      const char *SetClientPath(const char *path)
148%
149%  A description of each parameter follows:
150%
151%    o client_path: Method SetClientPath returns the current client path.
152%
153%    o path: Specifies the new client path.
154%
155%
156*/
157MagickExport const char *SetClientPath(const char *path)
158{
159  if ((path != (char *) NULL) && (*path != '\0'))
160    (void) CopyMagickString(client_path,path,MaxTextExtent);
161  return(client_path);
162}
Note: See TracBrowser for help on using the browser.