Tcl Source Code

Artifact [f5464b7c4a]
Login

Artifact f5464b7c4ad01d7a64e4f3caebfa31d280c4a2e0:

Attachment "219169-219171.1.diff" to ticket [219169ffff] added by andreas_kupries 2001-04-05 00:17:06.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcl/tcl/ChangeLog,v
retrieving revision 1.401
diff -u -r1.401 ChangeLog
--- ChangeLog	2001/04/04 16:22:11	1.401
+++ ChangeLog	2001/04/04 17:09:23
@@ -1,3 +1,13 @@
+2001-04-04  Andreas Kupries  <[email protected]>
+
+	* unix/mkLinks: Updated to contain the new manpage.
+
+	* doc/Environment.3: New manpage, describes Tcl_PutEnv
+	  [Bug #219171]. 
+
+	* doc/Macintosh.3: New manpage describing the macintosh specific
+	  parts of the public API [Bug #219169].
+
 2001-04-04  Kevin Kenny <[email protected]>
 
 	* doc/ByteArrObj.3:
Index: doc/Environment.3
===================================================================
RCS file: Environment.3
diff -N Environment.3
--- /dev/null	Mon Dec 11 17:26:27 2000
+++ Environment.3	Wed Apr  4 10:09:23 2001
@@ -0,0 +1,36 @@
+'\"
+'\" Copyright (c) 1997-1998 Sun Microsystems, Inc.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\" 
+'\" RCS: @(#) $Id: Encoding.3,v 1.7 1999/10/13 00:32:05 hobbs Exp $
+'\" 
+.so man.macros
+.TH Tcl_PutEnv 3 "7.5" Tcl "Tcl Library Procedures"
+.BS
+.SH NAME
+Tcl_PutEnv \- procedures to manipulate the environment
+.SH SYNOPSIS
+.nf
+\fB#include <tcl.h>\fR
+.sp
+int
+\fBTcl_PutEnv\fR(\fIstring\fR)
+.SH ARGUMENTS
+.AP "CONST char" *string in
+Info about environment variable in the form NAME=value. The string is
+in native format.
+.BE
+
+.SH DESCRIPTION
+.PP
+\fBTcl_PutEnv\fR sets an environment variable. The information is
+passed in a single string of the form NAME=value.  This procedure is
+intended to be a stand-in for the UNIX "putenv" procedure.  All
+tcl-based applications using "putenv" should redefine it to
+\fBTcl_PutEnv\fR so that they will interface properly to the Tcl
+runtime.
+
+.SH KEYWORDS
+environment, variable
Index: doc/Macintosh.3
===================================================================
RCS file: Macintosh.3
diff -N Macintosh.3
--- /dev/null	Mon Dec 11 17:26:27 2000
+++ Macintosh.3	Wed Apr  4 10:09:23 2001
@@ -0,0 +1,111 @@
+'\"
+'\" Copyright (c) 1997-1998 Sun Microsystems, Inc.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\" 
+'\" RCS: @(#) $Id: Encoding.3,v 1.7 1999/10/13 00:32:05 hobbs Exp $
+'\" 
+.so man.macros
+.TH Tcl_MacSetEventProc 3 "8.1" Tcl "Tcl Library Procedures"
+.BS
+.SH NAME
+Tcl_MacSetEventProc, Tcl_MacConvertTextResource, Tcl_MacSetEventProc, Tcl_MacConvertTextResource, Tcl_MacEvalResource, Tcl_MacFindResource, Tcl_GetOSTypeFromObj, Tcl_SetOSTypeObj, Tcl_NewOSTypeObj \- procedures to handle Macintosh resources and other Macintosh specifics
+.SH SYNOPSIS
+.nf
+\fB#include <tcl.h>\fR
+.sp
+int
+\fBTcl_MacEvalResource\fR(\fIinterp, resourceName, resourceNumber, fileName\fR)
+.sp
+char*
+\fBTcl_MacConvertTextResource\fR(\fIresource\fR)
+.sp
+Handle
+\fBTcl_MacFindResource\fR(\fIinterp, resourceType, resourceName, resourceNumber, resFileRef, releaseIt\fR)
+.sp
+Tcl_Obj*
+\fBTcl_NewOSTypeObj\fR(\fInewOSType\fR)
+.sp
+void
+\fBTcl_SetOSTypeObj\fR(\fIobjPtr, newOSType\fR)
+.sp
+int
+\fBTcl_GetOSTypeFromObj\fR(\fIinterp, objPtr, osTypePtr\fR)
+.sp
+void
+\fBTcl_MacSetEventProc\fR(\fIprocPtr\fR)
+.SH ARGUMENTS
+.AP Tcl_Interp *interp in
+Interpreter to use for error reporting, or NULL if no error reporting is
+desired.
+.AP 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
+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
+Registered resource file reference, NULL if searching all open resource files.
+.AP int *releaseIt out
+Should we release this resource when done.
+.AP int newOSType in
+Int used to initialize the new object or set the object's value.
+.AP Tcl_Obj *objPtr in
+Object whose internal representation is to be set or retrieved.
+.AP osTypePtr out
+Place to store the resulting integer.
+.AP Tcl_MacConvertEventPtr procPtr in
+Reference to the new function to handle all incoming Mac events.
+
+.BE
+.SH INTRODUCTION
+.PP
+The described routines are used to implement the Macintosh specific
+\fBresource\fR command and the Mac specific notifier.. They manipulate
+or use Macintosh resources and provide administration for open
+resource file references.
+
+.SH DESCRIPTION
+.PP
+\fBTcl_MacEvalResource\fR extends the \fBsource\fR command to
+Macintosh resources.  It sources Tcl code from a Text resource.
+Currently only sources the resource by name, file IDs may be supported
+at a later date.
+.PP
+\fBTcl_MacConvertTextResource\fR converts a TEXT resource into a Tcl
+suitable string. It mallocs the returned memory, converts '\r' to
+'\n', and appends a NULL. The caller has the responsibility for
+freeing the memory.
+.PP
+\fBTcl_MacFindResource\fR provides a higher level interface for
+loading resources. It is used by \fBresource read\fR.
+.PP
+\fBTcl_NewOSTypeObj\fR is used to create a new resource name type
+object. The object type is "ostype".
+.PP
+\fBTcl_SetOSTypeObj\fR modifies an object to be a resource type and to
+have the specified long value.
+.PP
+\fBTcl_GetOSTypeFromObj\fR attempts to return an int from the Tcl
+object "objPtr". If the object is not already an int, an attempt will
+be made to convert it to one.
+.PP
+\fBTcl_MacSetEventProc\fR sets the event handling procedure for the
+application. This function will be passed all incoming Mac events.
+This function usually controls the console or some other entity like
+Tk.
+
+.SH RESOURCE TYPES
+.PP
+Resource types are 4-byte values used by the macintosh resource
+facility to tag parts of the resource fork in a file so that the OS
+knows how to handle them. As all 4 bytes are restricted to printable
+characters such a type can be interpreted as a 4 character string too.
+
+.SH KEYWORDS
+macintosh, mac, resource, notifier
Index: unix/mkLinks
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/mkLinks,v
retrieving revision 1.20
diff -u -r1.20 mkLinks
--- unix/mkLinks	2001/04/03 14:53:45	1.20
+++ unix/mkLinks	2001/04/04 17:09:27
@@ -372,6 +372,10 @@
     ln Encoding.3 Tcl_GetDefaultEncodingDir.3
     ln Encoding.3 Tcl_SetDefaultEncodingDir.3
 fi
+if test -r Environment.3; then
+    rm -f Tcl_PutEnv.3
+    ln Environment.3 Tcl_PutEnv.3
+fi
 if test -r Eval.3; then
     rm -f Tcl_EvalObjEx.3
     rm -f Tcl_EvalFile.3
@@ -553,6 +557,26 @@
     ln ListObj.3 Tcl_ListObjLength.3
     ln ListObj.3 Tcl_ListObjIndex.3
     ln ListObj.3 Tcl_ListObjReplace.3
+fi
+if test -r Macintosh.3; then
+    rm -f Tcl_MacSetEventProc.3
+    rm -f Tcl_MacConvertTextResource.3
+    rm -f Tcl_MacSetEventProc.3
+    rm -f Tcl_MacConvertTextResource.3
+    rm -f Tcl_MacEvalResource.3
+    rm -f Tcl_MacFindResource.3
+    rm -f Tcl_GetOSTypeFromObj.3
+    rm -f Tcl_SetOSTypeObj.3
+    rm -f Tcl_NewOSTypeObj.3
+    ln Macintosh.3 Tcl_MacSetEventProc.3
+    ln Macintosh.3 Tcl_MacConvertTextResource.3
+    ln Macintosh.3 Tcl_MacSetEventProc.3
+    ln Macintosh.3 Tcl_MacConvertTextResource.3
+    ln Macintosh.3 Tcl_MacEvalResource.3
+    ln Macintosh.3 Tcl_MacFindResource.3
+    ln Macintosh.3 Tcl_GetOSTypeFromObj.3
+    ln Macintosh.3 Tcl_SetOSTypeObj.3
+    ln Macintosh.3 Tcl_NewOSTypeObj.3
 fi
 if test -r Notifier.3; then
     rm -f Tcl_CreateEventSource.3