Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcl/tcl/ChangeLog,v
retrieving revision 1.809
diff -u -3 -r1.809 ChangeLog
--- ChangeLog	2002/01/21 22:50:49	1.809
+++ ChangeLog	2002/01/23 11:10:59
@@ -1,3 +1,11 @@
+2002-01-21  Don Porter <dgp@users.sourceforge.net>
+
+	* doc/Macintosh.3:
+	* generic/tcl.decls (Tcl_MacEvalResource,Tcl_MacFindResource):
+	* mac/tclMacResource.c (Tcl_MacEvalResource,Tcl_MacFindResource):
+	Update interfaces of mac/tclMacResource.c according to TIP 27.
+	* generic/tclPlatDecls.h: make genstubs
+
 2002-01-21  David Gravereaux <davygrvy@pobox.com>
 
 	* generic/tclLoadNone.c: TclpLoadFile() didn't match proto of
Index: doc/Macintosh.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/Macintosh.3,v
retrieving revision 1.3
diff -u -3 -r1.3 Macintosh.3
--- doc/Macintosh.3	2001/05/03 23:57:10	1.3
+++ doc/Macintosh.3	2002/01/23 11:10:44
@@ -39,17 +39,17 @@
 .AP Tcl_Interp *interp in
 Interpreter to use for error reporting, or NULL if no error reporting is
 desired.
-.AP char *resourceName in
+.AP "CONST char" *resourceName in
 Name of TEXT resource to source, NULL if number should be used.
 .AP int resourceNumber in
 Resource id of source.
-.AP char *fileName in
+.AP "CONST char" *fileName in
 Name of file to process. NULL if application resource.
 .AP Handle resource in
 Handle to TEXT resource.
 .AP long resourceType in
 Type of resource to load.
-.AP char *resFileRef in
+.AP "CONST char" *resFileRef in
 Registered resource file reference, NULL if searching all open resource files.
 .AP int *releaseIt out
 Should we release this resource when done.
Index: generic/tcl.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.decls,v
retrieving revision 1.76
diff -u -3 -r1.76 tcl.decls
--- generic/tcl.decls	2002/01/21 16:15:03	1.76
+++ generic/tcl.decls	2002/01/23 11:10:47
@@ -1732,13 +1732,13 @@
     char * Tcl_MacConvertTextResource(Handle resource)
 }
 declare 2 mac {
-    int Tcl_MacEvalResource(Tcl_Interp *interp, char *resourceName, \
-	    int resourceNumber, char *fileName)
+    int Tcl_MacEvalResource(Tcl_Interp *interp, CONST char *resourceName, \
+	    int resourceNumber, CONST char *fileName)
 }
 declare 3 mac {
     Handle Tcl_MacFindResource(Tcl_Interp *interp, long resourceType, \
-	    char *resourceName, int resourceNumber, char *resFileRef, \
-	    int * releaseIt)
+	    CONST char *resourceName, int resourceNumber, \
+	    CONST char *resFileRef, int * releaseIt)
 }
 
 # These routines support the new OSType object type (i.e. the packed 4
Index: generic/tclPlatDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclPlatDecls.h,v
retrieving revision 1.12
diff -u -3 -r1.12 tclPlatDecls.h
--- generic/tclPlatDecls.h	2001/09/09 22:45:13	1.12
+++ generic/tclPlatDecls.h	2002/01/23 11:10:47
@@ -49,12 +49,12 @@
 				Handle resource));
 /* 2 */
 EXTERN int		Tcl_MacEvalResource _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * resourceName, int resourceNumber, 
-				char * fileName));
+				CONST char * resourceName, 
+				int resourceNumber, CONST char * fileName));
 /* 3 */
 EXTERN Handle		Tcl_MacFindResource _ANSI_ARGS_((Tcl_Interp * interp, 
-				long resourceType, char * resourceName, 
-				int resourceNumber, char * resFileRef, 
+				long resourceType, CONST char * resourceName, 
+				int resourceNumber, CONST char * resFileRef, 
 				int * releaseIt));
 /* 4 */
 EXTERN int		Tcl_GetOSTypeFromObj _ANSI_ARGS_((
@@ -84,8 +84,8 @@
 #ifdef MAC_TCL
     void (*tcl_MacSetEventProc) _ANSI_ARGS_((Tcl_MacConvertEventPtr procPtr)); /* 0 */
     char * (*tcl_MacConvertTextResource) _ANSI_ARGS_((Handle resource)); /* 1 */
-    int (*tcl_MacEvalResource) _ANSI_ARGS_((Tcl_Interp * interp, char * resourceName, int resourceNumber, char * fileName)); /* 2 */
-    Handle (*tcl_MacFindResource) _ANSI_ARGS_((Tcl_Interp * interp, long resourceType, char * resourceName, int resourceNumber, char * resFileRef, int * releaseIt)); /* 3 */
+    int (*tcl_MacEvalResource) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * resourceName, int resourceNumber, CONST char * fileName)); /* 2 */
+    Handle (*tcl_MacFindResource) _ANSI_ARGS_((Tcl_Interp * interp, long resourceType, CONST char * resourceName, int resourceNumber, CONST char * resFileRef, int * releaseIt)); /* 3 */
     int (*tcl_GetOSTypeFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, OSType * osTypePtr)); /* 4 */
     void (*tcl_SetOSTypeObj) _ANSI_ARGS_((Tcl_Obj * objPtr, OSType osType)); /* 5 */
     Tcl_Obj * (*tcl_NewOSTypeObj) _ANSI_ARGS_((OSType osType)); /* 6 */
Index: mac/tclMacResource.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacResource.c,v
retrieving revision 1.9
diff -u -3 -r1.9 tclMacResource.c
--- mac/tclMacResource.c	2002/01/18 03:23:02	1.9
+++ mac/tclMacResource.c	2002/01/23 11:10:51
@@ -1235,10 +1235,10 @@
 int
 Tcl_MacEvalResource(
     Tcl_Interp *interp,		/* Interpreter in which to process file. */
-    char *resourceName,		/* Name of TEXT resource to source,
+    CONST char *resourceName,	/* Name of TEXT resource to source,
 				   NULL if number should be used. */
     int resourceNumber,		/* Resource id of source. */
-    char *fileName)		/* Name of file to process.
+    CONST char *fileName)	/* Name of file to process.
 				   NULL if application resource. */
 {
     Handle sourceText;
@@ -1420,10 +1420,10 @@
 Tcl_MacFindResource(
     Tcl_Interp *interp,		/* Interpreter in which to process file. */
     long resourceType,		/* Type of resource to load. */
-    char *resourceName,		/* Name of resource to find,
+    CONST char *resourceName,	/* Name of resource to find,
 				 * NULL if number should be used. */
     int resourceNumber,		/* Resource id of source. */
-    char *resFileRef,		/* Registered resource file reference,
+    CONST char *resFileRef,	/* Registered resource file reference,
 				 * NULL if searching all open resource files. */
     int *releaseIt)	        /* Should we release this resource when done. */
 {
@@ -1462,15 +1462,17 @@
 	    resource = GetResource(resourceType, resourceNumber);
 	}
     } else {
-	c2pstr(resourceName);
+	Tcl_DString ds;
+	char *native = Tcl_UtfToExternalDString(NULL, resourceName, -1, &ds);
+	c2pstr(native);
 	if (limitSearch) {
 	    resource = Get1NamedResource(resourceType,
-		    (StringPtr) resourceName);
+		    (StringPtr) native);
 	} else {
 	    resource = GetNamedResource(resourceType,
 		    (StringPtr) resourceName);
 	}
-	p2cstr((StringPtr) resourceName);
+	Tcl_DStringFree(&ds);
     }
     
     if (*resource == NULL) {
