MCPcopy Create free account
hub / github.com/SimHacker/micropolis / Tk_GetJoinStyle

Function Tk_GetJoinStyle

micropolis-activity/src/tk/tkget.c:171–200  ·  view source on GitHub ↗
(interp, string, joinPtr)

Source from the content-addressed store, hash-verified

169 * None.
170 *
171 *--------------------------------------------------------------
172 */
173
174int
175Tk_GetJoinStyle(interp, string, joinPtr)
176 Tcl_Interp *interp; /* Use this for error reporting. */
177 char *string; /* String describing a justification style. */
178 int *joinPtr; /* Where to store join style corresponding
179 * to string. */
180{
181 int c, length;
182
183 c = string[0];
184 length = strlen(string);
185
186 if ((c == 'b') && (strncmp(string, "bevel", length) == 0)) {
187 *joinPtr = JoinBevel;
188 return TCL_OK;
189 }
190 if ((c == 'm') && (strncmp(string, "miter", length) == 0)) {
191 *joinPtr = JoinMiter;
192 return TCL_OK;
193 }
194 if ((c == 'r') && (strncmp(string, "round", length) == 0)) {
195 *joinPtr = JoinRound;
196 return TCL_OK;
197 }
198
199 Tcl_AppendResult(interp, "bad join style \"", string,
200 "\": must be bevel, miter, or round",
201 (char *) NULL);
202 return TCL_ERROR;
203}

Callers 1

DoConfigFunction · 0.85

Calls 1

Tcl_AppendResultFunction · 0.85

Tested by

no test coverage detected