home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!cs.utexas.edu!swrinde!mips!msi!dcmartin
- From: erlkonig@gnu.ai.mit.edu (Christopher North-Keys)
- Newsgroups: comp.sources.x
- Subject: v16i111: xcmdpanel: version 1.1 to 1.2, Patch1, Part01/01
- Message-ID: <1992Mar6.134228.1813@msi.com>
- Date: 6 Mar 92 13:42:28 GMT
- References: <csx-16i111-xcmdpanel-1.1@uunet.UU.NET>
- Sender: dcmartin@msi.com (David C. Martin - Moderator)
- Organization: Molecular Simulations, Inc.
- Lines: 281
- Approved: dcmartin@msi.com
- Originator: dcmartin@fascet
-
- Submitted-by: erlkonig@gnu.ai.mit.edu (Christopher North-Keys)
- Posting-number: Volume 16, Issue 111
- Archive-name: xcmdpanel-1.1/patch1
- Patch-To: xcmdpanel-1.1: Volume 16, Issue 98
-
-
- diff -b -w -c xcmdpanel-1.1/Makefile.dist xcmdpanel-1.2/Makefile.dist
- *** xcmdpanel-1.1/Makefile.dist Thu Oct 31 07:08:59 1991
- --- xcmdpanel-1.2/Makefile.dist Fri Mar 6 06:28:48 1992
- ***************
- *** 117,125 ****
- # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
-
- PATHSEP = /
- ! USRLIBDIR = $(DESTDIR)/usr/lib
- ! BINDIR = $(DESTDIR)/usr/bin/X11
- ! INCROOT = $(DESTDIR)/usr/include
- BUILDINCROOT = $(TOP)
- BUILDINCDIR = $(BUILDINCROOT)/X11
- BUILDINCTOP = ..
- --- 117,125 ----
- # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
-
- PATHSEP = /
- ! USRLIBDIR = $(DESTDIR)/usr/local/lib
- ! BINDIR = $(DESTDIR)/usr/local/X11
- ! INCROOT = $(DESTDIR)/usr/local/include
- BUILDINCROOT = $(TOP)
- BUILDINCDIR = $(BUILDINCROOT)/X11
- BUILDINCTOP = ..
- ***************
- *** 135,141 ****
- AWMDIR = $(LIBDIR)/awm
- TWMDIR = $(LIBDIR)/twm
- GWMDIR = $(LIBDIR)/gwm
- ! MANPATH = $(DESTDIR)/usr/man
- MANSOURCEPATH = $(MANPATH)/man
- MANDIR = $(MANSOURCEPATH)n
- LIBMANDIR = $(MANSOURCEPATH)3
- --- 135,141 ----
- AWMDIR = $(LIBDIR)/awm
- TWMDIR = $(LIBDIR)/twm
- GWMDIR = $(LIBDIR)/gwm
- ! MANPATH = $(DESTDIR)/usr/local/man
- MANSOURCEPATH = $(MANPATH)/man
- MANDIR = $(MANSOURCEPATH)n
- LIBMANDIR = $(MANSOURCEPATH)3
- ***************
- *** 211,216 ****
- --- 211,220 ----
- LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
- LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
- LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
- +
- + XWLIBSRC = $(CONTRIBSRC)/toolkits/Xw
- + DEPXWLIB = $(USRLIBDIR)/libXw.a
- + XWLIB = -lXw
-
- DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
-
- diff -b -w -c xcmdpanel-1.1/README xcmdpanel-1.2/README
- *** xcmdpanel-1.1/README Tue Mar 3 02:20:50 1992
- --- xcmdpanel-1.2/README Fri Mar 6 06:44:39 1992
- ***************
- *** 1,6 ****
- PROGRAM
- ! xcmdpanel
-
- DESCRIPTION
- The xcmdpanel program allows the user to run a user-
- configured command panel on a workstation display running X.
- --- 1,11 ----
- PROGRAM
- ! xcmdpanel (version 1.2)
-
- + CHANGES from 1.1
- +
- + Configuration files are now sought as described in the documentation.
- + A memory underallocation bug has (hopefully) been fixed.
- +
- DESCRIPTION
- The xcmdpanel program allows the user to run a user-
- configured command panel on a workstation display running X.
- ***************
- *** 20,31 ****
-
- or perhaps
-
- ! make -f Makefile.dist Makefile
-
- CONFIGURATION
- ! Defaults to the file .xcmdpanel in the current directory, or more
- ! specifically, to the file ./.<programname> , where <programname>
- ! is the name by which xcmdpanel is invoked.
-
- See the manual page or .txt file for detail.
-
- --- 25,45 ----
-
- or perhaps
-
- ! make -f Makefile.dist Makefile ; make
-
- + Output from make here at MIT while compiling xcmdpanel.
- + |
- + | % xmkmf
- + | mv Makefile Makefile.bak
- + | imake -DUseInstalled -I/usr/local/lib/X11/config
- + |
- + | % make
- + | cc -O -I/usr/local/include -sun4 -c xcmdpanel.c
- + | rm -f xcmdpanel
- + | cc -o xcmdpanel xcmdpanel.o -O -lXaw -lXmu -lXt -lXext -lX11
- +
- CONFIGURATION
- ! Defaults to the file .xcmdpanel in the current directory.
-
- See the manual page or .txt file for detail.
-
- diff -b -w -c xcmdpanel-1.1/patchlevel.h xcmdpanel-1.2/patchlevel.h
- *** xcmdpanel-1.1/patchlevel.h Thu Oct 31 07:08:59 1991
- --- xcmdpanel-1.2/patchlevel.h Fri Mar 6 01:36:02 1992
- ***************
- *** 10,16 ****
- */
-
- int VersionMajor = 1
- ! int VersionMinor = 1
-
- /* Add nothing after the following endif line */
- #endif _patchlevel_h
- --- 10,16 ----
- */
-
- int VersionMajor = 1
- ! int VersionMinor = 2
-
- /* Add nothing after the following endif line */
- #endif _patchlevel_h
- diff -b -w -c xcmdpanel-1.1/xcmdpanel.c xcmdpanel-1.2/xcmdpanel.c
- *** xcmdpanel-1.1/xcmdpanel.c Tue Mar 3 02:16:16 1992
- --- xcmdpanel-1.2/xcmdpanel.c Fri Mar 6 06:32:56 1992
- ***************
- *** 112,128 ****
- {
- Cardinal i;
- Widget toplevel, box;
- Arg c_args[2];
- - String filename;
- - char *buffer; /* for file read */
- long length; /* length of read file */
- ! Datum *items;
- ! XtAppContext app_con;
-
- - filename = (char *)calloc(strlen(argv[0]) + 4, sizeof(char *));
- - (void)strcpy(filename, "./.");
- - (void)strcat(filename, argv[0]);
- -
- toplevel = XtAppInitialize(&app_con, "XCmdPanel",
- options, XtNumber(options),
- &argc, argv,
- --- 112,124 ----
- {
- Cardinal i;
- Widget toplevel, box;
- + XtAppContext app_con;
- Arg c_args[2];
- long length; /* length of read file */
- ! String filename = (String)0;
- ! char *buffer = (char*)0; /* for file read */
- ! Datum *items = (Datum*)0;
-
- toplevel = XtAppInitialize(&app_con, "XCmdPanel",
- options, XtNumber(options),
- &argc, argv,
- ***************
- *** 130,146 ****
- NULL,
- ZERO);
-
- ! if (argc == 2) filename = argv[1];
- !
- ! if(filename)
- {
- ! if(FAIL == (length = SwallowFile(&buffer, filename)))
- {
- ! fprintf(stderr, "Error involving file %s, aborting.\n", argv[i]);
- ! Syntax(argv[0]);
- }
- }
-
- XtGetApplicationResources(toplevel,
- (XtPointer) &flags,
- resources, XtNumber(resources),
- --- 126,162 ----
- NULL,
- ZERO);
-
- ! if (argc == 2)
- ! filename = argv[1]; /* use commandline configfile if given */
- ! else
- {
- ! String filedefault = ".xcmdpanel";
- ! FILE *tmp = (FILE*)0;
- ! if(tmp = fopen(filename = filedefault, "r")) /* else check in cwd */
- ! fclose(tmp);
- ! else
- {
- ! char *home = (char*)0;
- ! if(home = (char*)getenv("HOME"))
- ! {
- ! int filename_len = strlen(home) + strlen(filedefault) + 2;
- ! if(filename = (char *)calloc(1, filename_len * sizeof(char)))
- ! {
- ! strcpy(filename, home);
- ! strcat(filename, "/");
- ! strcat(filename, filedefault); /* fallback to ~ */
- }
- + else perror("main - calloc");
- }
- + }
- + }
-
- + if(! filename || (FAIL == (length = SwallowFile(&buffer, filename))))
- + {
- + fprintf(stderr, "Error seeking config file; aborting.\n");
- + Syntax(argv[0]);
- + }
- +
- XtGetApplicationResources(toplevel,
- (XtPointer) &flags,
- resources, XtNumber(resources),
- ***************
- *** 187,193 ****
- void
- Execute(widget, clientData, callData)
- Widget widget;
- ! String *clientData;
- XtPointer callData;
- {
- if(strlen(clientData)) system(clientData);
- --- 203,209 ----
- void
- Execute(widget, clientData, callData)
- Widget widget;
- ! String clientData;
- XtPointer callData;
- {
- if(strlen(clientData)) system(clientData);
- ***************
- *** 204,210 ****
- short state;
- #define S_Tag (0)
- #define S_Text (1)
- - extern char *strchr(), *strcpy();
-
- lim = (char *)(&(buffer[length]));
- ind = (char *)(&(buffer[0]));
- --- 220,225 ----
- ***************
- *** 255,261 ****
- char *new;
- char *n_i, *s_i, *lim;
-
- ! if(NULL == (new = (char *)calloc(strlen(string), sizeof(char))))
- Fatal("ExtractEscapedString", "calloc");
-
- lim = &string[strlen(string)];
- --- 270,276 ----
- char *new;
- char *n_i, *s_i, *lim;
-
- ! if(NULL == (new = (char *)calloc(strlen(string)+1, sizeof(char))))
- Fatal("ExtractEscapedString", "calloc");
-
- lim = &string[strlen(string)];
- --
- --
- Molecular Simulations, Inc. mail: dcmartin@msi.com
- 796 N. Pastoria Avenue uucp: uunet!dcmartin
- Sunnyvale, California 94086 at&t: 408/522-9236
-