home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / tcl / 1891 < prev    next >
Encoding:
Text File  |  1992-11-19  |  6.9 KB  |  224 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!ornl!rsg1.er.usgs.gov!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsi!cbnewsh!att-out!cbfsb!mmc
  3. From: mmc@att.com (Michael J. McLennan)
  4. Subject: PATCH for dragdrop-1.0
  5. Message-ID: <1992Nov19.170137.10338@cbfsb.cb.att.com>
  6. Originator: news@cbnewsg.cb.att.com
  7. Sender: news@cbfsb.cb.att.com
  8. Nntp-Posting-Host: gewurtz.cnet.att.com
  9. Reply-To: michael.mclennan@att.com
  10. Organization: AT&T Bell Laboratories
  11. X-Newsreader: TIN [version 1.1 PL6]
  12. Date: Thu, 19 Nov 1992 17:01:37 GMT
  13. Lines: 209
  14.  
  15. I apologize for any grief people may have had trying to compile the
  16. dragdrop-1.0 distribution.  Unfortunately, I overlooked my use of
  17. the TclFindCmd() that George Howlett has proposed as an extension of
  18. the usual TCL core.  (Obviously, it is a useful extension.  Any chance
  19. that it will be adopted by TCL 7.0?)
  20.  
  21. I have updated the distribution to include the source for this function.
  22. You may either obtain a new distribution (which should compile this time!),
  23. or add/replace files in the distribution according to the instructions
  24. below.
  25.  
  26. Again, sorry for the inconvenience.
  27. --Michael
  28.  
  29. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  30.  Michael J. McLennan 2C-226    [   [ [   [  [[   E-mail: alux2!mmc@att.com
  31.  AT&T Bell Laboratories        [[ [[ [[ [[ [      Phone: (215) 770-2842
  32.  1247 S Cedar Crest Blvd    [[ [ [ [ [ [ [  [[[     FAX: (215) 770-3843
  33.  Allentown, PA  18103          [   [ [   [       
  34. vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  35.  
  36.  
  37. PATCHES:
  38.  
  39. 1) Replace the "dragdrop-1.0/Makefile" with...
  40.  
  41. ----------- cut ----------- cut ----------- cut ----------- cut -----------
  42. # Indicate the correct paths for each of the following libraries
  43. #
  44. # XLIB          Your X11 (R4 or R5) library.
  45. # TCLLIB        Tcl Version 6.1 library.
  46. # TKLIB         Tk Version 2.3 library.
  47. # TCLSRC        Tcl Version 6.1 source directory.
  48. # TKSRC         Tk Version 2.3 source directory.
  49. #
  50. XLIB=-L/usr/X11/lib -lX11
  51. TCLLIB=-L/usr/X11/lib -ltcl
  52. TKLIB=-L/usr/X11/lib -ltk
  53. TCLSRC=-I/usr/local/src/X11/local/lib/tk2.3/tcl
  54. TKSRC=-I/usr/local/src/X11/local/lib/tk2.3
  55. #
  56. INCLUDES=-I. -I/usr/X11/include $(TCLSRC) $(TKSRC)
  57. CDEBUGFLAGS=-O
  58. LIBS=$(TKLIB) $(TCLLIB) $(XLIB) -lm
  59. CFLAGS= $(CDEBUGFLAGS) $(INCLUDES) $(DEFINES)
  60.  
  61. SRCS=    main.c tkDragDrop.c tclCmdQuery.c
  62. OBJS=    main.o tkDragDrop.o tclCmdQuery.o
  63.  
  64. CC =   cc 
  65.  
  66. dish:  $(OBJS)
  67.     rm -f dish
  68.     $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o dish
  69.  
  70. $(OBJS):$(HDRS)
  71.  
  72. clean:
  73.     rm -f $(OBJS) dish core
  74.  
  75. lint:
  76.     lint $(INCLUDES) $(SRCS)
  77. ----------- cut ----------- cut ----------- cut ----------- cut -----------
  78.  
  79.  
  80. 2) Add the following file as "dragdrop-1.0/tclCmdQuery.c"
  81.  
  82. ----------- cut ----------- cut ----------- cut ----------- cut -----------
  83. /*
  84.  * ------------------------------------------------------------------------
  85.  *         FILE:  tclCmdQuery.c
  86.  *      PURPOSE:  query info about registered TCL commands
  87.  *
  88.  *  The following set of routines are proposed as useful additions
  89.  *  to the core TCL capability.  They allow the developer to query
  90.  *  information about commands that have been previously registered
  91.  *  via the usual Tcl_CreateCommand().
  92.  *
  93.  * ------------------------------------------------------------------------
  94.  *  AUTHOR:  George A. Howlett
  95.  *           AT&T Bell Laboratories
  96.  *
  97.  *    SCCS:  %W% (%G%)
  98.  * ========================================================================
  99.  *                 Copyright (c) 1992  AT&T Bell Laboratories
  100.  * ========================================================================
  101.  * Permission to use, copy, modify, and distribute this software and its
  102.  * documentation for any purpose and without fee is hereby granted,
  103.  * provided that the above copyright notice appear in all copies and that
  104.  * both that the copyright notice and warranty disclaimer appear in
  105.  * supporting documentation, and that the names of AT&T Bell Laboratories
  106.  * any of their entities not be used in advertising or publicity
  107.  * pertaining to distribution of the software without specific, written
  108.  * prior permission.
  109.  * 
  110.  * AT&T disclaims all warranties with regard to this software, including
  111.  * all implied warranties of merchantability and fitness.  In no event
  112.  * shall AT&T be liable for any special, indirect or consequential
  113.  * damages or any damages whatsoever resulting from loss of use, data or
  114.  * profits, whether in an action of contract, negligence or other
  115.  * tortuous action, arising out of or in connection with the use or
  116.  * performance of this software.
  117.  * ========================================================================
  118.  */
  119. #include <tcl.h>
  120. #include <tclInt.h>
  121.  
  122. /*
  123.  *----------------------------------------------------------------------
  124.  *
  125.  * TclFindCmd --
  126.  *
  127.  *      Given the name of a command, return a pointer to the
  128.  *      structure describing the command.
  129.  *
  130.  * Results:
  131.  *      NULL is returned if the name doesn't correspond to any
  132.  *      command.  Otherwise the return value is a pointer to
  133.  *      the command's structure.
  134.  *
  135.  * Side effects:
  136.  *      None.
  137.  *
  138.  *----------------------------------------------------------------------
  139.  */
  140. Command *
  141. TclFindCmd(iPtr, cmdName)
  142.     Interp *iPtr;               /* Interpreter in which to look. */
  143.     char *cmdName;              /* Name of desired command. */
  144. {
  145.     Tcl_HashEntry *entryPtr;
  146.     Command *cmdPtr;
  147.  
  148.     entryPtr = Tcl_FindHashEntry(&iPtr->commandTable, cmdName);
  149.     if (entryPtr == NULL) {
  150.         return (NULL);
  151.     }
  152.     cmdPtr = (Command *) Tcl_GetHashValue(entryPtr);
  153.     return (cmdPtr);
  154. }
  155.  
  156. /*
  157.  *----------------------------------------------------------------------
  158.  *
  159.  * TclClientData --
  160.  *
  161.  *      Given the command pointer, return the clientData field.
  162.  *
  163.  * Results:
  164.  *      Returns the clientData field of the command structure.
  165.  *
  166.  * Side effects:
  167.  *      None.
  168.  *
  169.  *----------------------------------------------------------------------
  170.  */
  171. ClientData 
  172. TclClientData (cmdPtr)
  173.     Command *cmdPtr;
  174. {
  175.     return (cmdPtr->clientData);
  176. }
  177.  
  178. /*
  179.  *----------------------------------------------------------------------
  180.  *
  181.  * TclDeleteProc --
  182.  *
  183.  *      Given the command pointer, return the delete proc field.
  184.  *
  185.  * Results:
  186.  *      Returns the deleteProc field of the command structure.
  187.  *
  188.  * Side effects:
  189.  *      None.
  190.  *
  191.  *----------------------------------------------------------------------
  192.  */
  193. Tcl_CmdDeleteProc * 
  194. TclDeleteProc (cmdPtr)
  195.     Command *cmdPtr;
  196. {
  197.     return (cmdPtr->deleteProc);
  198. }
  199.  
  200. /*
  201.  *----------------------------------------------------------------------
  202.  *
  203.  * TclCmdProc --
  204.  *
  205.  *      Given the command pointer, return the cmd proc field.
  206.  *
  207.  * Results:
  208.  *      Returns the proc field of the command structure.
  209.  *
  210.  * Side effects:
  211.  *      None.
  212.  *
  213.  *----------------------------------------------------------------------
  214.  */
  215. Tcl_CmdProc * 
  216. TclCmdProc (cmdPtr)
  217.     Command *cmdPtr;
  218. {
  219.     return (cmdPtr->proc);
  220. }
  221. ----------- cut ----------- cut ----------- cut ----------- cut -----------
  222.  
  223. 3) Type "make" as usual (it should compile this time!)
  224.