char *argv[])
{
int vargc, i, j, n, result;
- char c, *s, **vargv, vbuf[30];
+ char *s, **vargv, vbuf[30];
vgpane_t *vgp, **vgpp;
point p, q, *ps;
poly *tpp;
}
vgp = *vgpp;
- c = argv[1][0];
size_t length = strlen(argv[1]);
- if ((c == 'c') && (strncmp(argv[1], "coords", length) == 0)) {
+ if (strncmp(argv[1], "coords", length) == 0) {
if ((argc < 3)) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" ", argv[1], " id ?x1 y1 x2 y2...?\"",
return (insert_poly(interp, vgp, polyid, vargv, vargc));
- } else if ((c == 'd') && (strncmp(argv[1], "debug", length) == 0)) {
+ } else if (strncmp(argv[1], "debug", length) == 0) {
/* debug only */
printf("debug output goes here\n");
return TCL_OK;
- } else if ((c == 'd') && (strncmp(argv[1], "delete", length) == 0)) {
+ } else if (strncmp(argv[1], "delete", length) == 0) {
/* delete a vgpane and all memory associated with it */
if (vgp->vc)
Pobsclose(vgp->vc);
free(tclhandleFree(vgpaneTable, argv[0]));
return TCL_OK;
- } else if ((c == 'f') && (strncmp(argv[1], "find", length) == 0)) {
+ } else if (strncmp(argv[1], "find", length) == 0) {
/* find the polygon that the point is inside and return it
id, or null */
if ((argc < 3)) {
}
return TCL_OK;
- } else if ((c == 'i') && (strncmp(argv[1], "insert", length) == 0)) {
+ } else if (strncmp(argv[1], "insert", length) == 0) {
/* add poly to end poly list, and it coordinates to the end of
the point list */
if ((argc < 3)) {
Tcl_AppendResult(interp, vbuf, (char *) NULL);
return TCL_OK;
- } else if ((c == 'l') && (strncmp(argv[1], "list", length) == 0)) {
+ } else if (strncmp(argv[1], "list", length) == 0) {
/* return list of polygon ids */
for (i = 0; i < vgp->Npoly; i++) {
snprintf(vbuf, sizeof(vbuf), "%d", vgp->poly[i].id);
}
return TCL_OK;
- } else if ((c == 'p') && (strncmp(argv[1], "path", length) == 0)) {
+ } else if (strncmp(argv[1], "path", length) == 0) {
/* return a list of points corresponding to the shortest path
that does not cross the remaining "visible" polygons. */
if ((argc < 3)) {
return TCL_OK;
- } else if ((c == 'b') && (strncmp(argv[1], "bind", length) == 0)) {
+ } else if (strncmp(argv[1], "bind", length) == 0) {
if ((argc < 2) || (argc > 4)) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
argv[0], " bind triangle ?command?\"",
Tcl_AppendResult(interp, s, (char *) NULL);
return TCL_OK;
- } else if ((c == 'b') && (strncmp(argv[1], "bpath", length) == 0)) {
+ } else if (strncmp(argv[1], "bpath", length) == 0) {
/* return a list of points corresponding to the shortest path
that does not cross the remaining "visible" polygons. */
if ((argc < 3)) {
}
return TCL_OK;
- } else if ((c == 'b') && (strncmp(argv[1], "bbox", length) == 0)) {
+ } else if (strncmp(argv[1], "bbox", length) == 0) {
if ((argc < 3)) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" ", argv[1], " id\"", (char *) NULL);
(char *) NULL);
return TCL_ERROR;
- } else if ((c == 'c') && (strncmp(argv[1], "center", length) == 0)) {
+ } else if (strncmp(argv[1], "center", length) == 0) {
if ((argc < 3)) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" ", argv[1], " id\"", (char *) NULL);
(char *) NULL);
return TCL_ERROR;
- } else if ((c == 't')
- && (strncmp(argv[1], "triangulate", length) == 0)) {
+ } else if (strncmp(argv[1], "triangulate", length) == 0) {
if ((argc < 2)) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" id ", (char *) NULL);
Tcl_AppendResult(interp, " no such polygon: ", argv[2],
(char *) NULL);
return TCL_ERROR;
- } else if ((c == 'r') && (strncmp(argv[1], "rotate", length) == 0)) {
+ } else if (strncmp(argv[1], "rotate", length) == 0) {
if ((argc < 4)) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" ", argv[1], " id alpha\"", (char *) NULL);
(char *) NULL);
return TCL_ERROR;
- } else if ((c == 's') && (strncmp(argv[1], "scale", length) == 0)) {
+ } else if (strncmp(argv[1], "scale", length) == 0) {
if ((argc < 4)) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" ", argv[1], " id gain\"", (char *) NULL);
(char *) NULL);
return TCL_ERROR;
- } else if ((c == 'r') && (strncmp(argv[1], "remove", length) == 0)) {
+ } else if (strncmp(argv[1], "remove", length) == 0) {
if ((argc < 3)) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" ", argv[1], " id\"", (char *) NULL);