add: break;
context: NsTclSetCmd(ClientData arg, Tcl_Interp *interp, int argc, char **argv){    Ns_Set       *set, *set2Ptr;    int           locked, i;    char         *cmd;    int           flags;    Ns_Set      **setvectorPtrPtr;    char         *split;    Tcl_DString   ds;    Tcl_HashTable *tablePtr;    Tcl_HashEntry *hPtr;    Tcl_HashSearch search;    NsInterp	  *itPtr = arg;    if (argc < 2) {        Tcl_AppendResult(interp, "wrong # of args: should be \"",            argv[0], " command ?args?\"", NULL);        return TCL_ERROR;    }    cmd = argv[1];    if (STREQ(cmd, "create")) {	cmd = "new";    }    if (STREQ(cmd, "cleanup")) {	NsFreeSets(itPtr);    } else if (STREQ(cmd, "list")) {	if (argc == 2) {	    tablePtr = &itPtr->sets.table;    	    locked = 0;	} else if (STREQ(argv[2], "-shared")) {	    tablePtr = &itPtr->servPtr->sets.table;	    locked = 1;	    Ns_MutexLock(&itPtr->servPtr->sets.lock);	} else {    	    return BadArgs(interp, argv, "?-shared?");	}	if (tablePtr != NULL) {	    hPtr = Tcl_FirstHashEntry(tablePtr, &search);	    while (hPtr != NULL) {		Tcl_AppendElement(interp, Tcl_GetHashKey(tablePtr, hPtr));		hPtr = Tcl_NextHashEntry(&search);	    }	}	if (locked) {	    Ns_MutexUnlock(&itPtr->servPtr->sets.lock);	}    } else if (STREQ(cmd, "new")  ||	STREQ(cmd, "copy") ||	STREQ(cmd, "split")) {	/*	 * The set will be dynamic and possibly shared.	 */	        flags = NS_TCL_SET_DYNAMIC;        i = 2;        if (argv[2] != NULL &&	    (STREQ(argv[2], "-shared") || STREQ(argv[2], "-persist"))) {            flags |= NS_TCL_SET_SHARED;            ++i;        }	        switch (*cmd) {        case 'n':	    /*	     * ns_set new	     */	                if (argv[i] != NULL && argv[i + 1] != NULL) {                return BadArgs(interp, argv, "?-shared? ?name?");            }            EnterSet(itPtr, interp, Ns_SetCreate(argv[i]), flags);            break;        case 'c':	    /*	     * ns_set copy	     */	                if (argv[i] == NULL || argv[i + 1] != NULL) {                return BadArgs(interp, argv, "?-shared? setId");            }	    if (LookupSet(itPtr, interp, argv[i], 0, &set) != TCL_OK) {                return TCL_ERROR;            }            EnterSet(itPtr, interp, Ns_SetCopy(set), flags);            break;        case 's':	    /*	     * ns_set split	     */	                if (argv[i] == NULL ||		(argv[i + 1] != NULL && argv[i + 2] != NULL)) {                return BadArgs(interp, argv, "?-shared? setId ?splitChar?");            }	    if (LookupSet(itPtr, interp, argv[i++], 0, &set) != TCL_OK) {                return TCL_ERROR;            }            split = argv[i];            if (split == NULL) {                split = ".";            }            Tcl_DStringInit(&ds);            setvectorPtrPtr = Ns_SetSplit(set, *split);            for (i = 0; setvectorPtrPtr[i] != NULL; i++) {                EnterSet(itPtr, interp, setvectorPtrPtr[i], flags);                Tcl_DStringAppendElement(&ds, interp->result);            }            ns_free(setvectorPtrPtr);            Tcl_DStringResult(interp, &ds);            break;        }    } else {        /*         * All futher commands require a valid set.         */	        if (argc < 3) {            return BadArgs(interp, argv, "setId ?args?");        }	if (LookupSet(itPtr, interp, argv[2], 0, &set) != TCL_OK) {            return TCL_ERROR;        }        if (STREQ(cmd, "size")  ||	    STREQ(cmd, "name")  ||	    STREQ(cmd, "array") ||	    STREQ(cmd, "print") ||	    STREQ(cmd, "free")) {	                if (argc != 3) {                return BadArgs(interp, argv, "setId");            }            switch (*cmd) {	    case 'a':		Tcl_DStringInit(&ds);		for (i = 0; i < Ns_SetSize(set); ++i) {		    Tcl_DStringAppendElement(&ds, Ns_SetKey(set, i));		    Tcl_DStringAppendElement(&ds, Ns_SetValue(set, i));		}		Tcl_DStringResult(interp, &ds);            case 's':		/*		 * ns_set size		 */		                sprintf(interp->result, "%d", Ns_SetSize(set));                break;		            case 'n':		/*		 * ns_set name		 */		                Tcl_SetResult(interp, set->name, TCL_STATIC);                break;		            case 'p':		/*		 * ns_set print		 */		                Ns_SetPrint(set);                break;		            case 'f':		/*		 * ns_set free		 */		                Ns_TclFreeSet(interp, argv[2]);                break;            }        } else if (STREQ(cmd, "find")    ||		   STREQ(cmd, "ifind")   ||		   STREQ(cmd, "get")     ||		   STREQ(cmd, "iget")    ||		   STREQ(cmd, "delkey")  ||		   STREQ(cmd, "idelkey") ||		   STREQ(cmd, "unique")  ||		   STREQ(cmd, "iunique")) {	                if (argc != 4) {                return BadArgs(interp, argv, "setId key");            }            switch (*cmd) {            case 'f':		/*		 * ns_set find		 */		                sprintf(interp->result, "%d", Ns_SetFind(set, argv[3]));                break;		            case 'g':		/*		 * ns_set get		 */		                Tcl_SetResult(interp, Ns_SetGet(set, argv[3]), TCL_STATIC);                break;		            case 'd':		/*		 * ns_set delete		 */		                Ns_SetDeleteKey(set, argv[3]);                break;		            case 'u':		/*		 * ns_set unique		 */		                sprintf(interp->result, "%d", Ns_SetUnique(set, argv[3]));                break;		            case 'i':                switch (cmd[1]) {                case 'f':		    /*		     * ns_set ifind		     */		                        sprintf(interp->result, "%d",			    Ns_SetIFind(set, argv[3]));                    break;		                    case 'g':		    /*		     * ns_set iget		     */		                        Tcl_SetResult(interp, Ns_SetIGet(set, argv[3]),				  TCL_STATIC);                    break;		                    case 'd':		    /*		     * ns_set idelete		     */		                        Ns_SetIDeleteKey(set, argv[3]);                    break;		                    case 'u':		    /*		     * ns_set iunique		     */		                        sprintf(interp->result, "%d",			    Ns_SetIUnique(set, argv[3]));                    break;                }            }        } else if (STREQ(cmd, "value")  ||		   STREQ(cmd, "isnull") ||		   STREQ(cmd, "key")    ||		   STREQ(cmd, "delete") ||		   STREQ(cmd, "truncate")) {	    /*	     * These are all commands that work on an index; that is	     * the do something to the Nth item of a set.	     */	                if (argc != 4) {                return BadArgs(interp, argv, "setId index");            }            if (Tcl_GetInt(interp, argv[3], &i) != TCL_OK) {                return TCL_ERROR;            }	    if (i < 0) {                sprintf(interp->result, "Specified negative index (%d)", i);                return TCL_ERROR;            }            if (i >= Ns_SetSize(set)) {                sprintf(interp->result,			"Can't access index %d; set only has %d field%s",			i, Ns_SetSize(set),			Ns_SetSize(set) != 1 ? "s" : "");                return TCL_ERROR;            }            switch (*cmd) {            case 'v':		/*		 * ns_set value		 */		                Tcl_SetResult(interp, Ns_SetValue(set, i), TCL_STATIC);                break;		            case 'i':		/*		 * ns_set isnull		 */		                Tcl_SetResult(interp, Ns_SetValue(set, i) ? "0" : "1",			      TCL_STATIC);                break;		            case 'k':		/*		 * ns_set key		 */		                Tcl_SetResult(interp, Ns_SetKey(set, i), TCL_STATIC);                break;		            case 'd':		/*		 * ns_set delete		 */		                Ns_SetDelete(set, i);                break;		            case 't':		/*		 * ns_set truncate		 */		                Ns_SetTrunc(set, i);                break;            }        } else if (STREQ(cmd, "put")    ||		   STREQ(cmd, "update") ||		   STREQ(cmd, "cput")   ||		   STREQ(cmd, "icput")) {	                if (argc != 5) {                return BadArgs(interp, argv, "setId key value");            }	    switch (*cmd) {	    case 'u':		/*		 * ns_set update		 */		                Ns_SetDeleteKey(set, argv[3]);                i = Ns_SetPut(set, argv[3], argv[4]);		break;			    case 'i':		/*		 * ns_set icput		 */		                i = Ns_SetIFind(set, argv[3]);		if (i < 0) {		    i = Ns_SetPut(set, argv[3], argv[4]);		}		break;			    case 'c':		/*		 * ns_set cput		 */		                i = Ns_SetFind(set, argv[3]);		if (i < 0) {		    i = Ns_SetPut(set, argv[3], argv[4]);		}		break;			    case 'p':		/*		 * ns_set put		 */		i = Ns_SetPut(set, argv[3], argv[4]);		break;            }            sprintf(interp->result, "%d", i);        } else if (STREQ(cmd, "merge") ||		   STREQ(cmd, "move")) {	                if (argc != 4) {                return BadArgs(interp, argv, "setTo, setFrom");            }            if (LookupSet(itPtr, interp, argv[3], 0, &set2Ptr) != TCL_OK) {                return TCL_ERROR;            }	    switch (cmd[1]) {	    case 'e':		/*		 * ns_set merge		 */		                Ns_SetMerge(set, set2Ptr);		break;			    case 'o':		/*		 * ns_set move		 */		                Ns_SetMove(set, set2Ptr);		break;            }            Tcl_SetResult(interp, argv[2], TCL_VOLATILE);        } else {            Tcl_AppendResult(interp, "unknown command \"", argv[1],                "\":  should be one of "                "copy, "                "create, "                "delete, "                "delkey, "                "free, "                "get, "                "iget, "                "idelkey, "                "iunique, "                "key, "                "list, "                "merge, "                "move, "                "name, "                "new, "                "print, "                "purge, "                "put, "                "size, "                "split, "                "truncate, "                "unique or update", NULL);            return TCL_ERROR;        }    }    return TCL_OK;}