client.c

Go to the documentation of this file.
00001 /*
00002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00003 %                                                                             %
00004 %                                                                             %
00005 %                                                                             %
00006 %                  CCCC  L      IIIII  EEEEE  N   N  TTTTT                    %
00007 %                 C      L        I    E      NN  N    T                      %
00008 %                 C      L        I    EEE    N N N    T                      %
00009 %                 C      L        I    E      N  NN    T                      %
00010 %                  CCCC  LLLLL  IIIII  EEEEE  N   N    T                      %
00011 %                                                                             %
00012 %                                                                             %
00013 %                         MagickCore Client Methods                           %
00014 %                                                                             %
00015 %                             Software Design                                 %
00016 %                               John Cristy                                   %
00017 %                               March 2003                                    %
00018 %                                                                             %
00019 %                                                                             %
00020 %  Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization      %
00021 %  dedicated to making software imaging solutions freely available.           %
00022 %                                                                             %
00023 %  You may not use this file except in compliance with the License.  You may  %
00024 %  obtain a copy of the License at                                            %
00025 %                                                                             %
00026 %    http://www.imagemagick.org/script/license.php                            %
00027 %                                                                             %
00028 %  Unless required by applicable law or agreed to in writing, software        %
00029 %  distributed under the License is distributed on an "AS IS" BASIS,          %
00030 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
00031 %  See the License for the specific language governing permissions and        %
00032 %  limitations under the License.                                             %
00033 %                                                                             %
00034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00035 %
00036 %
00037 */
00038 
00039 /*
00040   Include declarations.
00041 */
00042 #include "magick/studio.h"
00043 #include "magick/client.h"
00044 #include "magick/string_.h"
00045 
00046 /*
00047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00048 %                                                                             %
00049 %                                                                             %
00050 %                                                                             %
00051 %   G e t C l i e n t N a m e                                                 %
00052 %                                                                             %
00053 %                                                                             %
00054 %                                                                             %
00055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00056 %
00057 %  GetClientName returns the current client name.
00058 %
00059 %  The format of the GetClientName method is:
00060 %
00061 %      const char *GetClientName(void)
00062 %
00063 */
00064 MagickExport const char *GetClientName(void)
00065 {
00066   return(SetClientName((const char *) NULL));
00067 }
00068 
00069 /*
00070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00071 %                                                                             %
00072 %                                                                             %
00073 %                                                                             %
00074 %   G e t C l i e n t P a t h                                                 %
00075 %                                                                             %
00076 %                                                                             %
00077 %                                                                             %
00078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00079 %
00080 %  GetClientPath returns the current client name.
00081 %
00082 %  The format of the GetClientPath method is:
00083 %
00084 %      const char *GetClientPath(void)
00085 %
00086 */
00087 MagickExport const char *GetClientPath(void)
00088 {
00089   return(SetClientPath((const char *) NULL));
00090 }
00091 
00092 /*
00093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00094 %                                                                             %
00095 %                                                                             %
00096 %                                                                             %
00097 %   S e t C l i e n t N a m e                                                 %
00098 %                                                                             %
00099 %                                                                             %
00100 %                                                                             %
00101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00102 %
00103 %  SetClientName sets the client name and returns it.
00104 %
00105 %  The format of the SetClientName method is:
00106 %
00107 %      const char *SetClientName(const char *name)
00108 %
00109 %  A description of each parameter follows:
00110 %
00111 %    o name: Specifies the new client name.
00112 %
00113 */
00114 MagickExport const char *SetClientName(const char *name)
00115 {
00116   static char
00117     client_name[MaxTextExtent] = "Magick";
00118 
00119   if ((name != (char *) NULL) && (*name != '\0'))
00120     (void) CopyMagickString(client_name,name,MaxTextExtent);
00121   return(client_name);
00122 }
00123 
00124 /*
00125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00126 %                                                                             %
00127 %                                                                             %
00128 %                                                                             %
00129 %   S e t C l i e n t P a t h                                                 %
00130 %                                                                             %
00131 %                                                                             %
00132 %                                                                             %
00133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00134 %
00135 %  SetClientPath() sets the client path if the name is specified.  Otherwise
00136 %  the current client path is returned. A zero-length string is returned if
00137 %  the client path has never been set.
00138 %
00139 %  The format of the SetClientPath method is:
00140 %
00141 %      const char *SetClientPath(const char *path)
00142 %
00143 %  A description of each parameter follows:
00144 %
00145 %    o path: Specifies the new client path.
00146 %
00147 */
00148 MagickExport const char *SetClientPath(const char *path)
00149 {
00150   static char
00151     client_path[MaxTextExtent] = "";
00152 
00153   if ((path != (char *) NULL) && (*path != '\0'))
00154     (void) CopyMagickString(client_path,path,MaxTextExtent);
00155   return(client_path);
00156 }

Generated on 19 Nov 2009 for MagickCore by  doxygen 1.6.1