home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume16 / xcmdpanl / patch1 < prev    next >
Encoding:
Text File  |  1992-03-05  |  8.2 KB  |  295 lines

  1. Path: uunet!cs.utexas.edu!swrinde!mips!msi!dcmartin
  2. From: erlkonig@gnu.ai.mit.edu (Christopher North-Keys)
  3. Newsgroups: comp.sources.x
  4. Subject: v16i111: xcmdpanel: version 1.1 to 1.2, Patch1, Part01/01
  5. Message-ID: <1992Mar6.134228.1813@msi.com>
  6. Date: 6 Mar 92 13:42:28 GMT
  7. References: <csx-16i111-xcmdpanel-1.1@uunet.UU.NET>
  8. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  9. Organization: Molecular Simulations, Inc.
  10. Lines: 281
  11. Approved: dcmartin@msi.com
  12. Originator: dcmartin@fascet
  13.  
  14. Submitted-by: erlkonig@gnu.ai.mit.edu (Christopher North-Keys)
  15. Posting-number: Volume 16, Issue 111
  16. Archive-name: xcmdpanel-1.1/patch1
  17. Patch-To: xcmdpanel-1.1: Volume 16, Issue 98
  18.  
  19.  
  20. diff -b -w -c xcmdpanel-1.1/Makefile.dist xcmdpanel-1.2/Makefile.dist
  21. *** xcmdpanel-1.1/Makefile.dist    Thu Oct 31 07:08:59 1991
  22. --- xcmdpanel-1.2/Makefile.dist    Fri Mar  6 06:28:48 1992
  23. ***************
  24. *** 117,125 ****
  25.   # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  26.   
  27.             PATHSEP = /
  28. !         USRLIBDIR = $(DESTDIR)/usr/lib
  29. !            BINDIR = $(DESTDIR)/usr/bin/X11
  30. !           INCROOT = $(DESTDIR)/usr/include
  31.        BUILDINCROOT = $(TOP)
  32.         BUILDINCDIR = $(BUILDINCROOT)/X11
  33.         BUILDINCTOP = ..
  34. --- 117,125 ----
  35.   # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  36.   
  37.             PATHSEP = /
  38. !         USRLIBDIR = $(DESTDIR)/usr/local/lib
  39. !            BINDIR = $(DESTDIR)/usr/local/X11
  40. !           INCROOT = $(DESTDIR)/usr/local/include
  41.        BUILDINCROOT = $(TOP)
  42.         BUILDINCDIR = $(BUILDINCROOT)/X11
  43.         BUILDINCTOP = ..
  44. ***************
  45. *** 135,141 ****
  46.              AWMDIR = $(LIBDIR)/awm
  47.              TWMDIR = $(LIBDIR)/twm
  48.              GWMDIR = $(LIBDIR)/gwm
  49. !           MANPATH = $(DESTDIR)/usr/man
  50.       MANSOURCEPATH = $(MANPATH)/man
  51.              MANDIR = $(MANSOURCEPATH)n
  52.           LIBMANDIR = $(MANSOURCEPATH)3
  53. --- 135,141 ----
  54.              AWMDIR = $(LIBDIR)/awm
  55.              TWMDIR = $(LIBDIR)/twm
  56.              GWMDIR = $(LIBDIR)/gwm
  57. !           MANPATH = $(DESTDIR)/usr/local/man
  58.       MANSOURCEPATH = $(MANPATH)/man
  59.              MANDIR = $(MANSOURCEPATH)n
  60.           LIBMANDIR = $(MANSOURCEPATH)3
  61. ***************
  62. *** 211,216 ****
  63. --- 211,220 ----
  64.             LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
  65.           LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
  66.             LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
  67. +         XWLIBSRC = $(CONTRIBSRC)/toolkits/Xw
  68. +         DEPXWLIB = $(USRLIBDIR)/libXw.a
  69. +         XWLIB =  -lXw
  70.   
  71.             DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  72.   
  73. diff -b -w -c xcmdpanel-1.1/README xcmdpanel-1.2/README
  74. *** xcmdpanel-1.1/README    Tue Mar  3 02:20:50 1992
  75. --- xcmdpanel-1.2/README    Fri Mar  6 06:44:39 1992
  76. ***************
  77. *** 1,6 ****
  78.   PROGRAM
  79. !     xcmdpanel
  80.   
  81.   DESCRIPTION
  82.       The xcmdpanel  program  allows  the  user  to  run  a  user-
  83.       configured command panel on a workstation display running X.
  84. --- 1,11 ----
  85.   PROGRAM
  86. !     xcmdpanel (version 1.2)
  87.    
  88. + CHANGES from 1.1
  89. +     Configuration files are now sought as described in the documentation.
  90. +     A memory underallocation bug has (hopefully) been fixed.
  91.   DESCRIPTION
  92.       The xcmdpanel  program  allows  the  user  to  run  a  user-
  93.       configured command panel on a workstation display running X.
  94. ***************
  95. *** 20,31 ****
  96.   
  97.       or perhaps
  98.   
  99. !         make -f Makefile.dist Makefile
  100.   
  101.   CONFIGURATION
  102. !     Defaults to the file .xcmdpanel in the current directory, or more
  103. !     specifically, to the file ./.<programname> , where <programname>
  104. !     is the name by which xcmdpanel is invoked.
  105.   
  106.       See the manual page or .txt file for detail.
  107.   
  108. --- 25,45 ----
  109.   
  110.       or perhaps
  111.   
  112. !         make -f Makefile.dist Makefile ; make
  113.   
  114. +     Output from make here at MIT while compiling xcmdpanel.
  115. +     | 
  116. +     | % xmkmf
  117. +     | mv Makefile Makefile.bak
  118. +     | imake -DUseInstalled -I/usr/local/lib/X11/config
  119. +     |   
  120. +     | % make
  121. +     | cc -O   -I/usr/local/include        -sun4 -c  xcmdpanel.c
  122. +     | rm -f xcmdpanel
  123. +     | cc -o xcmdpanel xcmdpanel.o -O  -lXaw -lXmu -lXt -lXext -lX11
  124. +     
  125.   CONFIGURATION
  126. !     Defaults to the file .xcmdpanel in the current directory.
  127.   
  128.       See the manual page or .txt file for detail.
  129.   
  130. diff -b -w -c xcmdpanel-1.1/patchlevel.h xcmdpanel-1.2/patchlevel.h
  131. *** xcmdpanel-1.1/patchlevel.h    Thu Oct 31 07:08:59 1991
  132. --- xcmdpanel-1.2/patchlevel.h    Fri Mar  6 01:36:02 1992
  133. ***************
  134. *** 10,16 ****
  135.    */
  136.   
  137.   int VersionMajor = 1
  138. ! int VersionMinor = 1
  139.   
  140.   /* Add nothing after the following endif line */
  141.   #endif _patchlevel_h
  142. --- 10,16 ----
  143.    */
  144.   
  145.   int VersionMajor = 1
  146. ! int VersionMinor = 2
  147.   
  148.   /* Add nothing after the following endif line */
  149.   #endif _patchlevel_h
  150. diff -b -w -c xcmdpanel-1.1/xcmdpanel.c xcmdpanel-1.2/xcmdpanel.c
  151. *** xcmdpanel-1.1/xcmdpanel.c    Tue Mar  3 02:16:16 1992
  152. --- xcmdpanel-1.2/xcmdpanel.c    Fri Mar  6 06:32:56 1992
  153. ***************
  154. *** 112,128 ****
  155.   {
  156.       Cardinal i;
  157.       Widget toplevel, box;
  158.       Arg c_args[2];
  159. -     String filename;
  160. -     char *buffer;          /* for file read */
  161.       long length;  /* length of read file */
  162. !     Datum *items;
  163. !     XtAppContext app_con;
  164.       
  165. -     filename = (char *)calloc(strlen(argv[0]) + 4, sizeof(char *));
  166. -     (void)strcpy(filename, "./.");
  167. -     (void)strcat(filename, argv[0]);
  168. -     
  169.       toplevel = XtAppInitialize(&app_con, "XCmdPanel",
  170.                                  options, XtNumber(options),
  171.                                  &argc, argv,
  172. --- 112,124 ----
  173.   {
  174.       Cardinal i;
  175.       Widget toplevel, box;
  176. +     XtAppContext app_con;
  177.       Arg c_args[2];
  178.       long length;              /* length of read file */
  179. !     String filename = (String)0;
  180. !     char *buffer = (char*)0;            /* for file read */
  181. !     Datum *items = (Datum*)0;
  182.       
  183.       toplevel = XtAppInitialize(&app_con, "XCmdPanel",
  184.                                  options, XtNumber(options),
  185.                                  &argc, argv,
  186. ***************
  187. *** 130,146 ****
  188.                                  NULL,
  189.                                  ZERO);
  190.   
  191. !     if (argc == 2) filename = argv[1];
  192. !     if(filename)
  193.       {
  194. !         if(FAIL == (length = SwallowFile(&buffer, filename)))
  195.           {
  196. !             fprintf(stderr, "Error involving file %s, aborting.\n", argv[i]);
  197. !             Syntax(argv[0]);
  198.           }
  199.       }
  200.       
  201.       XtGetApplicationResources(toplevel,
  202.                                 (XtPointer) &flags,
  203.                                 resources, XtNumber(resources),
  204. --- 126,162 ----
  205.                                  NULL,
  206.                                  ZERO);
  207.   
  208. !     if (argc == 2)
  209. !         filename = argv[1];        /* use commandline configfile if given */
  210. !     else
  211.       {
  212. !         String filedefault = ".xcmdpanel";
  213. !         FILE *tmp = (FILE*)0;
  214. !         if(tmp = fopen(filename = filedefault, "r"))    /* else check in cwd */
  215. !             fclose(tmp);
  216. !         else
  217.           {
  218. !             char *home = (char*)0;
  219. !             if(home = (char*)getenv("HOME"))
  220. !             {
  221. !                 int filename_len = strlen(home) + strlen(filedefault) + 2;
  222. !                 if(filename = (char *)calloc(1, filename_len * sizeof(char)))
  223. !                 {
  224. !                     strcpy(filename, home);
  225. !                     strcat(filename, "/");
  226. !                     strcat(filename, filedefault);        /* fallback to ~ */
  227.                   }
  228. +                 else perror("main - calloc");
  229.               }
  230. +         }
  231. +     }
  232.   
  233. +     if(! filename || (FAIL == (length = SwallowFile(&buffer, filename))))
  234. +     {
  235. +             fprintf(stderr, "Error seeking config file; aborting.\n");
  236. +             Syntax(argv[0]);
  237. +     }
  238. +     
  239.       XtGetApplicationResources(toplevel,
  240.                                 (XtPointer) &flags,
  241.                                 resources, XtNumber(resources),
  242. ***************
  243. *** 187,193 ****
  244.   void
  245.   Execute(widget, clientData, callData)
  246.   Widget widget;
  247. ! String *clientData;
  248.   XtPointer callData;
  249.   {
  250.       if(strlen(clientData)) system(clientData);
  251. --- 203,209 ----
  252.   void
  253.   Execute(widget, clientData, callData)
  254.   Widget widget;
  255. ! String clientData;
  256.   XtPointer callData;
  257.   {
  258.       if(strlen(clientData)) system(clientData);
  259. ***************
  260. *** 204,210 ****
  261.       short state;
  262.   #define S_Tag    (0)
  263.   #define S_Text   (1)
  264. -     extern char *strchr(), *strcpy();
  265.       
  266.        lim = (char *)(&(buffer[length]));
  267.       ind = (char *)(&(buffer[0]));
  268. --- 220,225 ----
  269. ***************
  270. *** 255,261 ****
  271.       char *new;
  272.       char *n_i, *s_i, *lim;
  273.   
  274. !     if(NULL == (new = (char *)calloc(strlen(string), sizeof(char))))
  275.           Fatal("ExtractEscapedString", "calloc");
  276.   
  277.       lim = &string[strlen(string)];
  278. --- 270,276 ----
  279.       char *new;
  280.       char *n_i, *s_i, *lim;
  281.   
  282. !     if(NULL == (new = (char *)calloc(strlen(string)+1, sizeof(char))))
  283.           Fatal("ExtractEscapedString", "calloc");
  284.   
  285.       lim = &string[strlen(string)];
  286. -- 
  287. --
  288. Molecular Simulations, Inc.            mail: dcmartin@msi.com
  289. 796 N. Pastoria Avenue                uucp: uunet!dcmartin
  290. Sunnyvale, California 94086            at&t: 408/522-9236
  291.