summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdAH.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-02-08 21:41:27 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-02-08 21:41:27 (GMT)
commitc02df4db03405fcafcc2112fb34211157748e459 (patch)
treefeaabb969de44d4d6c82c59dab708581780f8666 /generic/tclCmdAH.c
parent828b7e282d4e1591be7f44c77c513ed0bf170b06 (diff)
downloadtcl-c02df4db03405fcafcc2112fb34211157748e459.zip
tcl-c02df4db03405fcafcc2112fb34211157748e459.tar.gz
tcl-c02df4db03405fcafcc2112fb34211157748e459.tar.bz2
TIP#258 IMPLEMENTATION
* doc/Encoding.3: New subcommand [encoding dirs]. * doc/encoding.n: New routine Tcl_GetEncodingNameFromEnvironment. * generic/tcl.decls: Made public: * generic/tclBasic.c: TclGetEncodingFromObj * generic/tclCmdAH.c: -> Tcl_GetEncodingFromObj * generic/tclEncoding.c:TclGetEncodingSearchPath * generic/tclInt.decls: -> Tcl_GetEncodingSearchPath * generic/tclInt.h: TclSetEncodingSearchPath * generic/tclTest.c: -> Tcl_SetEncodingSearchPath * library/init.tcl: Removed commands: * tests/cmdAH.test: [tcl::unsupported::EncodingDirs] * tests/encoding.test: [testencoding path] (Tcltest) * unix/tclUnixInit.c: [Patch 1413934]. * win/tclWinInit.c: * generic/tclDecls.h: make genstubs * generic/tclIntDecls.h: * generic/tclStubInit.c:
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r--generic/tclCmdAH.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 78ce150..ce50da4 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdAH.c,v 1.71 2005/12/08 20:20:34 hobbs Exp $
+ * RCS: @(#) $Id: tclCmdAH.c,v 1.72 2006/02/08 21:41:27 dgp Exp $
*/
#include "tclInt.h"
@@ -24,6 +24,9 @@
static int CheckAccess(Tcl_Interp *interp, Tcl_Obj *pathPtr,
int mode);
+static int EncodingDirsObjCmd(ClientData dummy,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]);
static int GetStatBuf(Tcl_Interp *interp, Tcl_Obj *pathPtr,
Tcl_FSStatProc *statProc, Tcl_StatBuf *statPtr);
static char * GetTypeFromMode(int mode);
@@ -427,11 +430,11 @@ Tcl_EncodingObjCmd(dummy, interp, objc, objv)
int index;
static CONST char *optionStrings[] = {
- "convertfrom", "convertto", "names", "system",
+ "convertfrom", "convertto", "dirs", "names", "system",
NULL
};
enum options {
- ENC_CONVERTFROM, ENC_CONVERTTO, ENC_NAMES, ENC_SYSTEM
+ ENC_CONVERTFROM, ENC_CONVERTTO, ENC_DIRS, ENC_NAMES, ENC_SYSTEM
};
if (objc < 2) {
@@ -456,7 +459,7 @@ Tcl_EncodingObjCmd(dummy, interp, objc, objv)
encoding = Tcl_GetEncoding(interp, NULL);
data = objv[2];
} else if (objc == 4) {
- if (TclGetEncodingFromObj(interp, objv[2], &encoding) != TCL_OK) {
+ if (Tcl_GetEncodingFromObj(interp, objv[2], &encoding) != TCL_OK) {
return TCL_ERROR;
}
data = objv[3];
@@ -497,6 +500,8 @@ Tcl_EncodingObjCmd(dummy, interp, objc, objv)
Tcl_FreeEncoding(encoding);
break;
}
+ case ENC_DIRS:
+ return EncodingDirsObjCmd(dummy, interp, objc-1, objv+1);
case ENC_NAMES:
if (objc > 2) {
Tcl_WrongNumArgs(interp, 2, objv, NULL);
@@ -523,7 +528,7 @@ Tcl_EncodingObjCmd(dummy, interp, objc, objv)
/*
*----------------------------------------------------------------------
*
- * TclEncodingDirsObjCmd --
+ * EncodingDirsObjCmd --
*
* This command manipulates the encoding search path.
*
@@ -537,7 +542,7 @@ Tcl_EncodingObjCmd(dummy, interp, objc, objv)
*/
int
-TclEncodingDirsObjCmd(dummy, interp, objc, objv)
+EncodingDirsObjCmd(dummy, interp, objc, objv)
ClientData dummy; /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
@@ -548,10 +553,10 @@ TclEncodingDirsObjCmd(dummy, interp, objc, objv)
return TCL_ERROR;
}
if (objc == 1) {
- Tcl_SetObjResult(interp, TclGetEncodingSearchPath());
+ Tcl_SetObjResult(interp, Tcl_GetEncodingSearchPath());
return TCL_OK;
}
- if (TclSetEncodingSearchPath(objv[1]) == TCL_ERROR) {
+ if (Tcl_SetEncodingSearchPath(objv[1]) == TCL_ERROR) {
Tcl_AppendResult(interp, "expected directory list but got \"",
Tcl_GetString(objv[1]), "\"", NULL);
return TCL_ERROR;