home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / tcl / 2109 < prev    next >
Encoding:
Text File  |  1992-12-15  |  8.1 KB  |  423 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!torn!nott!bnrgate!bcars267!news
  3. From: emcoop@bnr.ca (hume smith)
  4. Subject: Re: manual pages for unix
  5. Message-ID: <21495.1992Dec15.100156@bcars148>
  6. Sender: news@bnr.ca (usenet)
  7. Nntp-Posting-Host: bcars148
  8. Organization: Bell-Northern Research, Ottawa, Canada
  9. X-Poster: Emacs-NNTP-0.1
  10. References: <1992Dec9.191545.29278@dragon.acadiau.ca>
  11. Date: Tue, 15 Dec 1992 15:01:56 GMT
  12. Lines: 409
  13.  
  14. In <1992Dec9.191545.29278@dragon.acadiau.ca>, 850347s@dragon.acadiau.ca (Hume Smith) said:
  15. > well a few days ago i posted about the UNIX manual installation
  16. > of the tk and tcl man pages.
  17.  
  18. and i posted csh scripts to install them "correctly".  now that i've figured out
  19. tcl i've got wish scripts.  i'll post them too, if only as sample amateur tcl.
  20. So much more elegantly expressed in tcl!  what a neat language.
  21.  
  22. here's a question though, just so i'm not wasting too much space:
  23. the FAQ makes no mention of any amiga porting.  has anyone tried it,
  24. or accomplished it?  i'd tinker with it, but i'm busy with XLisp
  25. for a the next while, among other things.
  26.  
  27. these scripts install some of the tk man pages into section 1, even though
  28. they don't really really go there, they just have section 1 internally.
  29. maybe they can be grouped into one big wish man page, like sh and csh do?
  30. eventually...
  31.  
  32. ------------------------------8<-------------------
  33. #!/usr/local/bin/wish -f
  34.  
  35. # installs TCL man pages to desired directory
  36.  
  37. # base manual directory
  38. set MANDIR /usr/local/man
  39. # where the original files reside
  40. set FROMDIR [pwd]
  41.  
  42. # FROMDIR and MANDIR must be on the same filesystem.
  43.  
  44. if {!([file writable $MANDIR/man3] &&
  45.       [file isdirectory $MANDIR/man3])} then {
  46.     puts stderr "$MANDIR/man3 is not a writeable directory"
  47.     exit 1
  48. }
  49.  
  50. puts stderr "Linking man pages " nonewline
  51.  
  52. foreach i {
  53.  {AddErrInfo
  54.   Tcl_AddErrorInfo
  55.   Tcl_SetErrorCode
  56.   Tcl_UnixError
  57.   Tcl_CheckStatus}
  58.  {AssembCmd
  59.   Tcl_CreateCmdBuf
  60.   Tcl_AssembleCmd
  61.   Tcl_DeleteCmdBuf}
  62.  {Backslash
  63.   Tcl_Backslash}
  64.  {Concat
  65.   Tcl_Concat}
  66.  {CrtCommand
  67.   Tcl_CreateCommand
  68.   Tcl_DeleteCommand}
  69.  {CrtInterp
  70.   Tcl_CreateInterp
  71.   Tcl_DeleteInterp}
  72.  {CrtPipelin
  73.   Tcl_CreatePipeline}
  74.  {CrtTrace
  75.   Tcl_CreateTrace
  76.   Tcl_DeleteTrace}
  77.  {Eval
  78.   Tcl_Eval
  79.   Tcl_VarEval
  80.   Tcl_EvalFile
  81.   Tcl_GlobalEval}
  82.  {ExprLong
  83.   Tcl_ExprLong
  84.   Tcl_ExprDouble
  85.   Tcl_ExprBool
  86.   Tcl_ExprString}
  87.  {Fork
  88.   Tcl_Fork
  89.   Tcl_WaitPids
  90.   Tcl_DetachPids}
  91.  {GetInt
  92.   Tcl_GetInt
  93.   Tcl_GetDouble
  94.   Tcl_GetBoolean}
  95.  {Hash
  96.   Tcl_InitHashTable
  97.   Tcl_DeleteHashTable
  98.   Tcl_CreateHashEntry
  99.   Tcl_DeleteHashEntry
  100.   Tcl_FindHashEntry
  101.   Tcl_GetHashValue
  102.   Tcl_SetHashValue
  103.   Tcl_GetHashKey
  104.   Tcl_FirstHashEntry
  105.   Tcl_NextHashEntry
  106.   Tcl_HashStats}
  107.  {History
  108.   Tcl_InitHistory
  109.   Tcl_RecordAndEval}
  110.  {Interp
  111.   Tcl_Interp}
  112.  {SetResult
  113.   Tcl_SetResult
  114.   Tcl_AppendResult
  115.   Tcl_AppendElement
  116.   Tcl_ResetResult}
  117.  {SetVar
  118.   Tcl_SetVar
  119.   Tcl_SetVar2
  120.   Tcl_GetVar
  121.   Tcl_GetVar2
  122.   Tcl_UnsetVar
  123.   Tcl_UnsetVar2}
  124.  {SplitList
  125.   Tcl_SplitList
  126.   Tcl_Merge
  127.   Tcl_ScanElement
  128.   Tcl_ConvertElement}
  129.  {StrMatch
  130.   Tcl_StringMatch}
  131.  {Tcl
  132.   Tcl}
  133.  {TildeSubst
  134.   Tcl_TildeSubst}
  135.  {TraceVar
  136.   Tcl_TraceVar
  137.   Tcl_TraceVar2
  138.   Tcl_UntraceVar
  139.   Tcl_UntraceVar2
  140.   Tcl_VarTraceInfo
  141.   Tcl_VarTraceInfo2}
  142.  {library
  143.   libtcl}} {
  144.     set src [lindex $i 0]
  145.     puts stderr "$src... " nonewline
  146.     flush stderr
  147.     foreach j [lrange $i 1 end] {
  148.         exec ln $FROMDIR/$src.man $MANDIR/man3/$j.3
  149.     }
  150. }
  151. puts stderr done.
  152. exit 0
  153. -----------------------------------8<---------------------------------
  154. #!/usr/local/bin/wish -f
  155.  
  156. # installs TK man pages to desired directory
  157.  
  158. # base manual directory
  159. set MANDIR /usr/local/man
  160. # where the original files reside
  161. set FROMDIR [pwd]
  162.  
  163. # FROMDIR and MANDIR must be on the same filesystem.
  164.  
  165. if {!([file isdirectory $MANDIR/man3] &&
  166.       [file isdirectory $MANDIR/man1] &&
  167.       [file writable $MANDIR/man3] &&
  168.       [file writable $MANDIR/man1])} then {
  169.     puts stderr "$MANDIR/man1 and $MANDIR/man3 are not writeable directories"
  170.     exit 1
  171. }
  172.  
  173. puts stderr "Linking man pages " nonewline
  174.  
  175. foreach i {
  176.  {3DBorder 3
  177.    Tk_Get3DBorder
  178.    Tk_Draw3DRectangle
  179.    Tk_Fill3DRectangle
  180.    Tk_Draw3DPolygon
  181.    Tk_Fill3DPolygon
  182.    Tk_SetBackgroundFromBorder
  183.    Tk_NameOf3DBorder
  184.    Tk_Free3DBorder}
  185.  {ConfigWidg 3
  186.    Tk_ConfigureWidget
  187.    Tk_Offset
  188.    Tk_ConfigureInfo}
  189.  {ConfigWind 3
  190.    Tk_ConfigureWindow
  191.    Tk_MoveWindow
  192.    Tk_ResizeWindow
  193.    Tk_MoveResizeWindow
  194.    Tk_SetWindowBorderWidth
  195.    Tk_ChangeWindowAttributes
  196.    Tk_SetWindowBackground
  197.    Tk_SetWindowBackgroundPixmap
  198.    Tk_SetWindowBorder
  199.    Tk_SetWindowBorderPixmap
  200.    Tk_DefineCursor
  201.    Tk_UndefineCursor}
  202.  {CoordToWin 3
  203.    Tk_CoordsToWindow}
  204.  {CrtErrHdlr 3
  205.    Tk_CreateErrorHandler
  206.    Tk_DeleteErrorHandler}
  207.  {CrtGenHdlr 3
  208.    Tk_CreateGenericHandler
  209.    Tk_DeleteGenericHandler}
  210.  {CrtMainWin 3
  211.    Tk_CreateMainWindow
  212.    Tk_CreateWindow
  213.    Tk_CreateWindowFromPath
  214.    Tk_DestroyWindow
  215.    Tk_MakeWindowExist}
  216.  {DoOneEvent 3
  217.    Tk_DoOneEvent
  218.    Tk_MainLoop
  219.    Tk_HandleEvent}
  220.  {DoWhenIdle 3
  221.    Tk_DoWhenIdle
  222.    Tk_CancelIdleCall}
  223.  {EventHndlr 3
  224.    Tk_CreateEventHandler
  225.    Tk_DeleteEventHandler}
  226.  {FileHndlr 3
  227.    Tk_CreateFileHandler
  228.    Tk_DeleteFileHandler}
  229.  {FocusHndlr 3
  230.    Tk_CreateFocusHandler}
  231.  {GeomReq 3
  232.    Tk_GeometryRequest
  233.    Tk_SetInternalBorder}
  234.  {GetAnchor 3
  235.    Tk_GetAnchor
  236.    Tk_NameOfAnchor}
  237.  {GetBitmap 3
  238.    Tk_GetBitmap
  239.    Tk_DefineBitmap
  240.    Tk_NameOfBitmap
  241.    Tk_SizeOfBitmap
  242.    Tk_FreeBitmap
  243.    Tk_GetBitmapFromData}
  244.  {GetCapStyl 3
  245.    Tk_GetCapStyle
  246.    Tk_NameOfCapStyle}
  247.  {GetColor 3
  248.    Tk_GetColor
  249.    Tk_GetColorByValue
  250.    Tk_NameOfColor
  251.    Tk_FreeColor}
  252.  {GetCursor 3
  253.    Tk_GetCursor
  254.    Tk_GetCursorFromData
  255.    Tk_NameOfCursor
  256.    Tk_FreeCursor}
  257.  {GetFontStr 3
  258.    Tk_GetFontStruct
  259.    Tk_NameOfFontStruct
  260.    Tk_FreeFontStruct}
  261.  {GetGC 3
  262.    Tk_GetGC
  263.    Tk_FreeGC}
  264.  {GetJoinStl 3
  265.    Tk_GetJoinStyle
  266.    Tk_NameOfJoinStyle}
  267.  {GetJustify 3
  268.    Tk_GetJustify
  269.    Tk_NameOfJustify}
  270.  {GetOption 3
  271.    Tk_GetOption}
  272.  {GetPixels 3
  273.    Tk_GetPixels
  274.    Tk_GetScreenMM}
  275.  {GetRelief 3
  276.    Tk_GetRelief
  277.    Tk_NameOfRelief}
  278.  {GetRootCrd 3
  279.    Tk_GetRootCoords}
  280.  {GetSelect 3
  281.    Tk_GetSelection}
  282.  {GetUid 3
  283.    Tk_GetUid
  284.    Tk_Uid}
  285.  {InternAtom 3
  286.    Tk_InternAtom
  287.    Tk_GetAtomName}
  288.  {ManageGeom 3
  289.    Tk_ManageGeometry}
  290.  {MapWindow 3
  291.    Tk_MapWindow
  292.    Tk_UnmapWindow}
  293.  {Name 3
  294.    Tk_Name
  295.    Tk_PathName
  296.    Tk_NameToWindow}
  297.  {OwnSelect 3
  298.    Tk_OwnSelection}
  299.  {ParseArgv 3
  300.    Tk_ParseArgv}
  301.  {Preserve 3
  302.    Tk_Preserve
  303.    Tk_Release
  304.    Tk_EventuallyFree}
  305.  {RegInterp 3
  306.    Tk_RegisterInterp}
  307.  {RestrictEv 3
  308.    Tk_RestrictEvents}
  309.  {SelHandler 3
  310.    Tk_CreateSelHandler}
  311.  {SetClass 3
  312.    Tk_SetClass
  313.    Tk_Class}
  314.  {SetGrid 3
  315.    Tk_SetGrid}
  316.  {Sleep 3
  317.    Tk_Sleep}
  318.  {TimerHndlr 3
  319.    Tk_CreateTimerHandler
  320.    Tk_DeleteTimerHandler}
  321.  {WindowId 3
  322.    Tk_WindowId
  323.    Tk_Display
  324.    Tk_DisplayName
  325.    Tk_ScreenNumber
  326.    Tk_Screen
  327.    Tk_X
  328.    Tk_Y
  329.    Tk_Width
  330.    Tk_Height
  331.    Tk_Changes
  332.    Tk_Attributes
  333.    Tk_IsMapped
  334.    Tk_ReqWidth
  335.    Tk_ReqHeight
  336.    Tk_InternalBorderWidth}
  337.  {bind 1
  338.    bind}
  339.  {button 1
  340.    button}
  341.  {checkbuttn 1
  342.    checkbutton.1}
  343.  {destroy 1
  344.    destroy}
  345.  {entry 1
  346.    entry}
  347.  {focus 1
  348.    focus}
  349.  {frame 1
  350.    frame}
  351.  {grab 1
  352.    grab}
  353.  {label 1
  354.    label}
  355.  {lbSingSel 1
  356.    tk_listboxSingleSelect}
  357.  {listbox 1
  358.    listbox}
  359.  {menu 1
  360.    menu}
  361.  {menubuttn 1
  362.    menubutton}
  363.  {message 1
  364.    message}
  365.  {option 1
  366.    option}
  367.  {options 1
  368.    options}
  369.  {pack 1
  370.    pack}
  371.  {place 1
  372.    place}
  373.  {radiobuttn 1
  374.    radiobutton}
  375.  {scale 1
  376.    scale}
  377.  {scrollbar 1
  378.    scrollbar}
  379.  {selection 1
  380.    selection}
  381.  {send 1
  382.    send}
  383.  {text 1
  384.    text}
  385.  {tkerror 1
  386.    tkerror}
  387.  {tkwait 1
  388.    tkwait}
  389.  {toplevel 1
  390.    toplevel}
  391.  {traversal 1
  392.    tk_menus}
  393.  {traversal 1
  394.    tk_bindForTraversal}
  395.  {update 1
  396.    update}
  397.  {variables 1
  398.    variables}
  399.  {winfo 1
  400.    winfo}
  401.  {wish 1
  402.    wish}
  403.  {wm 1
  404.    wm}} {
  405.     set src [lindex $i 0]
  406.     set sec [lindex $i 1]
  407.     puts stderr "$src... " nonewline
  408.     flush stderr
  409.     foreach j [lrange $i 2 end] {
  410.         exec ln $FROMDIR/$src.man $MANDIR/man$sec/$j.$sec
  411.     }
  412. }
  413. puts stderr done.
  414. exit
  415. --
  416. Hume Smith                      Wenn ich des Tages nicht dreimal
  417. hume.smith@acadiau.ca           mein Schaelchen Coffee trinken darf,
  418. emcoop@bnr.ca                   so werd' ich ju zu meiner Qual
  419.                                 wie ein verdorrtes Ziegenbraetchen.  (BWV 211)
  420.  
  421.  
  422.  
  423.