cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 | % John Cristy % |
| 17 | % March 2003 % |
| 18 | % % |
| 19 | % % |
cristy | 16af1cb | 2009-12-11 21:38:29 +0000 | [diff] [blame] | 20 | % Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 | /* |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 48 | % % |
| 49 | % % |
| 50 | % % |
| 51 | % G e t C l i e n t N a m e % |
| 52 | % % |
| 53 | % % |
| 54 | % % |
| 55 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 56 | % |
| 57 | % GetClientName returns the current client name. |
| 58 | % |
| 59 | % The format of the GetClientName method is: |
| 60 | % |
| 61 | % const char *GetClientName(void) |
| 62 | % |
| 63 | */ |
| 64 | MagickExport const char *GetClientName(void) |
| 65 | { |
cristy | ad1c716 | 2009-11-03 01:01:07 +0000 | [diff] [blame] | 66 | return(SetClientName((const char *) NULL)); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | /* |
| 70 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 71 | % % |
| 72 | % % |
| 73 | % % |
| 74 | % G e t C l i e n t P a t h % |
| 75 | % % |
| 76 | % % |
| 77 | % % |
| 78 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 79 | % |
| 80 | % GetClientPath returns the current client name. |
| 81 | % |
| 82 | % The format of the GetClientPath method is: |
| 83 | % |
| 84 | % const char *GetClientPath(void) |
| 85 | % |
| 86 | */ |
| 87 | MagickExport const char *GetClientPath(void) |
| 88 | { |
cristy | ad1c716 | 2009-11-03 01:01:07 +0000 | [diff] [blame] | 89 | return(SetClientPath((const char *) NULL)); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | /* |
| 93 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 94 | % % |
| 95 | % % |
| 96 | % % |
| 97 | % S e t C l i e n t N a m e % |
| 98 | % % |
| 99 | % % |
| 100 | % % |
| 101 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 102 | % |
| 103 | % SetClientName sets the client name and returns it. |
| 104 | % |
| 105 | % The format of the SetClientName method is: |
| 106 | % |
| 107 | % const char *SetClientName(const char *name) |
| 108 | % |
| 109 | % A description of each parameter follows: |
| 110 | % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 111 | % o name: Specifies the new client name. |
| 112 | % |
| 113 | */ |
| 114 | MagickExport const char *SetClientName(const char *name) |
| 115 | { |
cristy | ad1c716 | 2009-11-03 01:01:07 +0000 | [diff] [blame] | 116 | static char |
| 117 | client_name[MaxTextExtent] = "Magick"; |
| 118 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 119 | if ((name != (char *) NULL) && (*name != '\0')) |
| 120 | (void) CopyMagickString(client_name,name,MaxTextExtent); |
| 121 | return(client_name); |
| 122 | } |
| 123 | |
| 124 | /* |
| 125 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 126 | % % |
| 127 | % % |
| 128 | % % |
| 129 | % S e t C l i e n t P a t h % |
| 130 | % % |
| 131 | % % |
| 132 | % % |
| 133 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 134 | % |
| 135 | % SetClientPath() sets the client path if the name is specified. Otherwise |
| 136 | % the current client path is returned. A zero-length string is returned if |
| 137 | % the client path has never been set. |
| 138 | % |
| 139 | % The format of the SetClientPath method is: |
| 140 | % |
| 141 | % const char *SetClientPath(const char *path) |
| 142 | % |
| 143 | % A description of each parameter follows: |
| 144 | % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 145 | % o path: Specifies the new client path. |
| 146 | % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 147 | */ |
| 148 | MagickExport const char *SetClientPath(const char *path) |
| 149 | { |
cristy | ad1c716 | 2009-11-03 01:01:07 +0000 | [diff] [blame] | 150 | static char |
| 151 | client_path[MaxTextExtent] = ""; |
| 152 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 153 | if ((path != (char *) NULL) && (*path != '\0')) |
| 154 | (void) CopyMagickString(client_path,path,MaxTextExtent); |
| 155 | return(client_path); |
| 156 | } |