home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-07-17 | 40.1 KB | 1,170 lines |
- Newsgroups: alt.sources
- From: jtsillas@sprite.ma30.bull.com (James Tsillas)
- Subject: mxgdb Part 2/9
- Date: 16 Jul 91 13:02:24
- Message-ID: <JTSILLAS.91Jul16130224@sprite.ma30.bull.com>
-
-
-
- ---- Cut Here and feed the following to sh ----
- #!/bin/sh
- # this is mxgdb.02 (part 2 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file mxgdb/calldbx.c continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 2; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping mxgdb/calldbx.c'
- else
- echo 'x - continuing file mxgdb/calldbx.c'
- sed 's/^X//' << 'SHAR_EOF' >> 'mxgdb/calldbx.c' &&
- X * call dbx.
- X *
- X * open_master(): Open the master side of pty.
- X * open_slave(): Open the slave side of pty.
- X * calldbx(): Invoke dbx.
- X */
- X
- #include <termio.h>
- #include "global.h"
- X
- #ifdef SYSV
- #ifdef SCO
- # include <sys/fcntl.h>
- #endif
- #endif
- X
- FILE *dbxfp = NULL; /* file pointer to dbx */
- int dbxpid = 0; /* dbx process id */
- #ifdef SYSV
- char dbxfbuf[BUFSIZ];
- #endif
- static int dbxInputId; /* dbx input id */
- static char pty[11] = "/dev/pty??"; /* master side of pseudo-terminal */
- static char tty[11] = "/dev/tty??"; /* slave side of pseudo-terminal */
- extern char *dbxprompt;
- X
- /*
- X * Xdbx talks to dbx through a pseudo terminal which is a pair of master
- X * and slave devices: /dev/pty?? and /dev/tty??, where ?? goes from p0 to
- X * sf (system dependent). The pty is opened for both read and write.
- X */
- static int open_master()
- {
- X int i, master;
- X char c;
- X
- #ifndef SCO
- X for (c='p'; c<'t'; c++) {
- X for (i=0; i<16; i++) {
- #else
- X c = 'p';
- X for (i=0; i<8; i++) {
- #endif
- X pty[8] = c;
- X pty[9] = "0123456789abcdef"[i];
- X if ((master = open(pty, O_RDWR)) >= 0)
- X return (master);
- X }
- #ifndef SCO
- X }
- #endif
- X
- #ifdef GDB
- X fprintf(stderr, "xxgdb: all ptys in use\n");
- #else
- X fprintf(stderr, "xdbx: all ptys in use\n");
- #endif
- X exit(1);
- }
- X
- static int open_slave()
- {
- X int slave;
- X
- X tty[8] = pty[8];
- X tty[9] = pty[9];
- X if ((slave = open(tty, O_RDWR)) >= 0)
- X return (slave);
- X fprintf(stderr, "open: cannot open slave pty %s", tty);
- X exit(1);
- }
- X
- /* ARGSUSED */
- void calldbx(argc, argv)
- int argc;
- char *argv[];
- {
- X struct termio Termio;
- X int master; /* file descriptor of master pty */
- X int slave; /* file descriptor of slave pty */
- X int fd; /* file descriptor of controlling tty */
- X int pid; /* process id */
- X int pgrp; /* process group id */
- X char *debugger; /* name of executable debugger */
- X char errmsg[LINESIZ];
- X
- #ifdef GDB /* for GDB, we use XXGDB_DEBUGGER instead */
- X debugger = (char *) getenv("XXGDB_DEBUGGER"); /* first looks up env var */
- #else
- X debugger = (char *) getenv("DEBUGGER"); /* first looks up env var */
- #endif
- X if (debugger == NULL)
- X debugger = XtNewString(DEBUGGER);
- X
- X /* construct dbx prompt string based on the name of debugger invoked */
- X if (dbxprompt == NULL) {
- X dbxprompt = XtMalloc((4+strlen(debugger)) * sizeof(char));
- X sprintf(dbxprompt, "(%s) ", debugger);
- X }
- X
- X /*
- X * Clear controlling tty. Do this now, so that open_slave and
- X * open_master will cause the selected pty to become the
- X * controlling tty.
- X */
- X if ((fd = open("/dev/tty", O_RDWR)) > 0) {
- #ifndef SYSV
- X ioctl(fd, TIOCNOTTY, 0);
- #endif /* SYSV */
- X close(fd);
- X }
- X
- X master = open_master();
- X
- #ifndef SYSV
- X slave = open_slave();
- #endif
- X
- X dbxpid = fork();
- X if (dbxpid == -1) {
- #ifdef GDB
- X perror("xxgdb error: cannot fork process");
- #else
- X perror("xdbx error: cannot fork process");
- #endif
- X exit(1);
- X }
- X else if (dbxpid) {
- X /*
- X * Parent : close the slave side of pty
- X * close stdin and stdout
- X * set the dbx file descriptor to nonblocking mode
- X * open file pointer with read/write access to dbx
- X * set line buffered mode
- X * register dbx input with X
- X */
- X close(slave);
- X close(0);
- X close(1);
- X fcntl(master, F_SETFL, FNDELAY);
- X dbxfp = (FILE *)fdopen(master, "r+");
- X setvbuf(dbxfp, dbxfbuf, _IONBF, BUFSIZ);
- X dbxInputId = XtAppAddInput(app_context, master, XtInputReadMask,
- X read_dbx, NULL);
- X }
- X else {
- X /*
- X * Child : close master side of pty
- X * redirect stdin, stdout, stderr of dbx to pty
- X * unbuffer output data from dbx
- X * exec dbx with arguments
- X */
- X
- #ifdef SYSV
- X setpgrp();
- X slave = open_slave();
- #endif
- X close(master);
- X
- X /*
- X * Modify local and output mode of slave pty
- X */
- X
- X ioctl(slave, TCGETA, &Termio);
- X Termio.c_lflag &= ~ECHO; /* No echo */
- X Termio.c_oflag &= ~ONLCR; /* Do not map NL to CR-NL on output */
- X ioctl(slave, TCSETA, &Termio);
- X
- X dup2(slave, 0);
- X dup2(slave, 1);
- X dup2(slave, 2);
- X if (slave > 2)
- X close(slave);
- X
- X fcntl(1, F_SETFL, FAPPEND);
- X setbuf(stdout, NULL);
- X
- X /*
- X * Set our process group to that of the terminal,
- X * so we can change the group of the terminal.
- X */
- X
- X
- X
- #ifndef SYSV
- X setpgrp(0, pgrp);
- X /*
- X * Now set the process group of the terminal and of us
- X * to our process id. This clears us from the control
- X * of the other process group.
- X */
- X pid = getpid();
- X ioctl(0, TIOCSPGRP, &pid);
- X setpgrp(0, pid);
- #endif
- X
- X argv[0] = debugger;
- X execvp(debugger, argv);
- #ifdef GDB
- X sprintf(errmsg, "xxgdb error: cannot exec %s", debugger);
- #else
- X sprintf(errmsg, "xdbx error: cannot exec %s", debugger);
- #endif
- X perror(errmsg);
- X exit(1);
- X }
- }
- SHAR_EOF
- echo 'File mxgdb/calldbx.c is complete' &&
- chmod 0664 mxgdb/calldbx.c ||
- echo 'restore of mxgdb/calldbx.c failed'
- Wc_c="`wc -c < 'mxgdb/calldbx.c'`"
- test 8040 -eq "$Wc_c" ||
- echo 'mxgdb/calldbx.c: original size 8040, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/bitmaps.h ==============
- if test -f 'mxgdb/bitmaps.h' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/bitmaps.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/bitmaps.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/bitmaps.h' &&
- /* $Id: bitmaps.h,v 1.2 1991/06/26 18:42:06 jtsillas Exp $ */
- X
- /*****************************************************************************
- X *
- X * xdbx - X Window System interface to the dbx debugger
- X *
- X * Copyright 1989 The University of Texas at Austin
- X * Copyright 1990 Microelectronics and Computer Technology Corporation
- X *
- X * Permission to use, copy, modify, and distribute this software and its
- X * documentation for any purpose and without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of The University of Texas
- X * and Microelectronics and Computer Technology Corporation (MCC) not be
- X * used in advertising or publicity pertaining to distribution of
- X * the software without specific, written prior permission. The
- X * University of Texas and MCC makes no representations about the
- X * suitability of this software for any purpose. It is provided "as is"
- X * without express or implied warranty.
- X *
- X * THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
- X * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- X * FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
- X * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- X * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- X * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- X * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Po Cheung
- X * Created: April 9, 1990
- X *
- X *****************************************************************************/
- X
- /* bitmaps.h
- X *
- X * Contain bitmap data for a 48x48 and a 64x64 xdbx icon, and the
- X * stop sign, execution arrow, up-down arrow, and bomb sign used
- X * in the source window.
- X */
- X
- /* bitmap data for 48x48 xdbx icon */
- X
- #define xdbx48_width 48
- #define xdbx48_height 48
- static char xdbx48_bits[] = {
- X 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0xf0,
- X 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x78, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x3c,
- X 0xf8, 0x7f, 0x00, 0x02, 0x00, 0x3c, 0xf0, 0xff, 0x00, 0x02, 0x00, 0x1e,
- X 0xe0, 0xff, 0x01, 0x04, 0x00, 0x0f, 0xe0, 0xff, 0x01, 0x04, 0x80, 0x07,
- X 0xc0, 0xff, 0xe3, 0xff, 0xc0, 0x03, 0x80, 0xff, 0x1f, 0x01, 0xc7, 0x03,
- X 0x00, 0xff, 0x27, 0x01, 0xf8, 0x01, 0x00, 0xff, 0xcf, 0x60, 0xf0, 0x10,
- X 0x00, 0xfe, 0x1f, 0x90, 0xf8, 0x10, 0x00, 0xfc, 0x3f, 0x90, 0xbc, 0x08,
- X 0x00, 0xfc, 0x7f, 0x60, 0x3c, 0x07, 0x00, 0xfe, 0xff, 0x03, 0x1e, 0x02,
- X 0x00, 0xfe, 0xff, 0x04, 0x0f, 0x02, 0x00, 0xff, 0xff, 0x85, 0x07, 0x04,
- X 0x80, 0xff, 0xff, 0xc3, 0xc3, 0x04, 0x80, 0xdf, 0xff, 0xe7, 0x23, 0x05,
- X 0x84, 0x9f, 0xff, 0xef, 0x25, 0x09, 0xc8, 0x19, 0xff, 0xf7, 0xc4, 0x08,
- X 0xf0, 0x18, 0xfe, 0x7b, 0x03, 0x08, 0xc0, 0x1f, 0xfc, 0x3d, 0x00, 0x08,
- X 0xc0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xc0, 0x1f, 0x78, 0x7f, 0x00, 0x08,
- X 0xf0, 0x98, 0xbd, 0xff, 0x00, 0x08, 0xc8, 0x59, 0xde, 0xff, 0x61, 0x08,
- X 0x84, 0x5f, 0xef, 0xff, 0x91, 0x04, 0x80, 0x9f, 0xc7, 0xff, 0x93, 0x04,
- X 0x80, 0x9f, 0x87, 0xff, 0x67, 0x04, 0x00, 0xdf, 0x03, 0xff, 0x0f, 0x02,
- X 0x00, 0xfe, 0x19, 0xfe, 0x1f, 0x02, 0x00, 0xfe, 0x24, 0xfe, 0x1f, 0x07,
- X 0x00, 0x7c, 0x24, 0xfc, 0xff, 0x08, 0x00, 0x78, 0x18, 0xfa, 0x7f, 0x10,
- X 0x00, 0x3c, 0x00, 0xf2, 0xff, 0x10, 0x00, 0xde, 0x00, 0xfc, 0xff, 0x00,
- X 0x00, 0x8f, 0x0f, 0xe0, 0xff, 0x01, 0x80, 0x87, 0xf0, 0xff, 0xff, 0x03,
- X 0x80, 0x87, 0x00, 0x84, 0xff, 0x07, 0xc0, 0x43, 0x00, 0x84, 0xff, 0x07,
- X 0xe0, 0x21, 0x00, 0x02, 0xff, 0x0f, 0xf0, 0x00, 0x00, 0x02, 0xfe, 0x1f,
- X 0x78, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x78, 0x00, 0x00, 0x00, 0xfc, 0x3f,
- X 0x3c, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x1e, 0x00, 0x00, 0x00, 0xf0, 0xff};
- X
- X
- /* bitmap data for 64x64 xdbx icon */
- X
- #define xdbx64_width 64
- #define xdbx64_height 64
- static char xdbx64_bits[] = {
- X 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x01, 0x00,
- X 0x00, 0x00, 0x00, 0xf8, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x7c,
- X 0xf8, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xf8, 0xff, 0x07, 0x00,
- X 0x00, 0x00, 0x00, 0x1f, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x0f,
- X 0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x80, 0x0f, 0xc0, 0xff, 0x3f, 0x00,
- X 0x00, 0x00, 0xc0, 0x07, 0xc0, 0xff, 0x3f, 0x00, 0x01, 0x00, 0xe0, 0x03,
- X 0x80, 0xff, 0x7f, 0x00, 0x02, 0x00, 0xf0, 0x01, 0x00, 0xff, 0xff, 0x00,
- X 0x04, 0x00, 0xf8, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x04, 0x00, 0xf8, 0x00,
- X 0x00, 0xfe, 0xff, 0x01, 0x04, 0x00, 0x7c, 0x00, 0x00, 0xfc, 0xff, 0xff,
- X 0xff, 0x01, 0x3e, 0x04, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x1e, 0x1f, 0x04,
- X 0x00, 0xf0, 0xff, 0x0f, 0x00, 0xe0, 0x0f, 0x04, 0x00, 0xf0, 0xff, 0x0f,
- X 0x80, 0x81, 0x07, 0x02, 0x00, 0xe0, 0xff, 0x1f, 0x40, 0xc2, 0x07, 0x01,
- X 0x00, 0xc0, 0xff, 0xbf, 0x41, 0xe2, 0x8b, 0x01, 0x00, 0xc0, 0xff, 0x7f,
- X 0x82, 0xf1, 0xd1, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x02, 0xf8, 0x60, 0x00,
- X 0x00, 0xf0, 0xff, 0xff, 0x01, 0x7c, 0x40, 0x00, 0x00, 0xf8, 0xfe, 0xff,
- X 0x01, 0x7c, 0x80, 0x00, 0x00, 0xfc, 0xfc, 0xff, 0x03, 0x3e, 0x80, 0x00,
- X 0x00, 0xfc, 0xfc, 0xff, 0x03, 0x1f, 0x00, 0x01, 0x00, 0xfe, 0xf8, 0xff,
- X 0x87, 0x0f, 0x03, 0x01, 0x00, 0xff, 0xf0, 0xff, 0xcf, 0x87, 0x04, 0x02,
- X 0x08, 0xff, 0xe0, 0xff, 0xcf, 0x87, 0x04, 0x02, 0x10, 0xe7, 0xe0, 0xff,
- X 0xe7, 0x03, 0x03, 0x02, 0xe0, 0xe3, 0xc0, 0xff, 0xf3, 0x01, 0x00, 0x04,
- X 0x80, 0xff, 0x80, 0xff, 0xf9, 0x00, 0x00, 0x04, 0x80, 0xff, 0x00, 0xff,
- X 0xfc, 0x00, 0x00, 0x04, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07,
- X 0x80, 0xff, 0x00, 0x7e, 0xfe, 0x01, 0x00, 0x04, 0x80, 0xff, 0x00, 0x3e,
- X 0xff, 0x1b, 0x00, 0x04, 0xe0, 0xe3, 0x00, 0x9f, 0xff, 0x27, 0x00, 0x04,
- X 0x10, 0xe7, 0xb0, 0xcf, 0xff, 0x2f, 0x30, 0x02, 0x08, 0xff, 0xc8, 0xe7,
- X 0xff, 0x1f, 0x48, 0x02, 0x00, 0xff, 0xe8, 0xe7, 0xff, 0x1f, 0x48, 0x02,
- X 0x00, 0xfe, 0xf0, 0xc3, 0xff, 0x3f, 0x30, 0x01, 0x00, 0xfc, 0xf0, 0xc1,
- X 0xff, 0x3f, 0x00, 0x01, 0x00, 0xfc, 0xf8, 0x80, 0xff, 0x7f, 0x80, 0x00,
- X 0x00, 0xf8, 0x7c, 0x00, 0xff, 0xff, 0x80, 0x00, 0x00, 0xf0, 0x7c, 0x18,
- X 0xfe, 0xff, 0xc1, 0x00, 0x00, 0xe0, 0x3e, 0x24, 0xfe, 0xff, 0x61, 0x00,
- X 0x00, 0xc0, 0x1f, 0x24, 0xfc, 0xff, 0xd3, 0x00, 0x00, 0x80, 0x0f, 0x18,
- X 0xf8, 0xff, 0x8f, 0x01, 0x00, 0xc0, 0x07, 0x00, 0xf4, 0xff, 0x0f, 0x01,
- X 0x00, 0xe0, 0x0f, 0x00, 0xe4, 0xff, 0x1f, 0x02, 0x00, 0xf0, 0x39, 0x00,
- X 0xf8, 0xff, 0x1f, 0x04, 0x00, 0xf0, 0xc9, 0x03, 0xc0, 0xff, 0x3f, 0x04,
- X 0x00, 0xf8, 0x08, 0xfc, 0xff, 0xff, 0x7f, 0x04, 0x00, 0x7c, 0x04, 0x00,
- X 0x01, 0xff, 0x7f, 0x00, 0x00, 0x3e, 0x02, 0x00, 0x01, 0xff, 0xff, 0x00,
- X 0x00, 0x3e, 0x00, 0x00, 0x01, 0xfe, 0xff, 0x01, 0x00, 0x1f, 0x00, 0x80,
- X 0x00, 0xfc, 0xff, 0x03, 0x80, 0x0f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03,
- X 0xc0, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x07, 0xe0, 0x03, 0x00, 0x00,
- X 0x00, 0xf0, 0xff, 0x0f, 0xe0, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f,
- X 0xf0, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0xf8, 0x00, 0x00, 0x00,
- X 0x00, 0xc0, 0xff, 0x3f, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f,
- X 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff};
- X
- X
- /* bitmap data for stop sign */
- X
- #define stop_width 16
- #define stop_height 16
- #define stop_x_hot -1
- #define stop_y_hot -1
- static char stop_bits[] = {
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xa0, 0x03, 0xb8, 0x0e,
- X 0xa8, 0x0a, 0xa8, 0x0a, 0xa8, 0x0a, 0x18, 0x08, 0x10, 0x08, 0x30, 0x0c,
- X 0xe0, 0x07, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00};
- X
- /* bitmap data for arrow sign */
- X
- #define arrow_width 16
- #define arrow_height 16
- #define arrow_x_hot -1
- #define arrow_y_hot -1
- static char arrow_bits[] = {
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x01, 0x80, 0x03,
- X 0xff, 0x07, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x07, 0x80, 0x03, 0x80, 0x01,
- X 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
- X
- X
- /* bitmap data for up-down (outlined arrow) sign */
- X
- #define updown_width 16
- #define updown_height 16
- #define updown_x_hot -1
- #define updown_y_hot -1
- static char updown_bits[] = {
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x01, 0x80, 0x03,
- X 0xff, 0x06, 0x01, 0x0c, 0x01, 0x0c, 0xff, 0x06, 0x80, 0x03, 0x80, 0x01,
- X 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
- X
- X
- /* bitmap data for bomb sign */
- X
- #define bomb_width 16
- #define bomb_height 16
- static char bomb_bits[] = {
- X 0x00, 0x00, 0x69, 0x00, 0x94, 0x00, 0x8a, 0x00, 0xc0, 0x01, 0xc5, 0x01,
- X 0xf0, 0x07, 0xf0, 0x07, 0xf8, 0x0f, 0xf8, 0x0d, 0xf8, 0x0d, 0xf8, 0x0d,
- X 0xf0, 0x06, 0xf0, 0x07, 0xc0, 0x01, 0x00, 0x00};
- SHAR_EOF
- chmod 0664 mxgdb/bitmaps.h ||
- echo 'restore of mxgdb/bitmaps.h failed'
- Wc_c="`wc -c < 'mxgdb/bitmaps.h'`"
- test 8571 -eq "$Wc_c" ||
- echo 'mxgdb/bitmaps.h: original size 8571, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/dbx.c ==============
- if test -f 'mxgdb/dbx.c' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/dbx.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/dbx.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/dbx.c' &&
- static char rcsid[] = "$Id: dbx.c,v 1.1.1.1 1991/05/16 21:41:50 jtsillas Exp $";
- X
- /*****************************************************************************
- X *
- X * xdbx - X Window System interface to the dbx debugger
- X *
- X * Copyright 1989 The University of Texas at Austin
- X * Copyright 1990 Microelectronics and Computer Technology Corporation
- X *
- X * Permission to use, copy, modify, and distribute this software and its
- X * documentation for any purpose and without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of The University of Texas
- X * and Microelectronics and Computer Technology Corporation (MCC) not be
- X * used in advertising or publicity pertaining to distribution of
- X * the software without specific, written prior permission. The
- X * University of Texas and MCC makes no representations about the
- X * suitability of this software for any purpose. It is provided "as is"
- X * without express or implied warranty.
- X *
- X * THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
- X * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- X * FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
- X * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- X * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- X * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- X * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Po Cheung
- X * Created: March 10, 1989
- X *
- X *****************************************************************************
- X *
- X * xxgdb - X Window System interface to the gdb debugger
- X *
- X * Copyright 1990 Thomson Consumer Electronics, Inc.
- X *
- X * Permission to use, copy, modify, and distribute this software and its
- X * documentation for any purpose and without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of Thomson Consumer
- X * Electronics (TCE) not be used in advertising or publicity pertaining
- X * to distribution of the software without specific, written prior
- X * permission. TCE makes no representations about the suitability of
- X * this software for any purpose. It is provided "as is" without express
- X * or implied warranty.
- X *
- X * TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
- X * SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
- X * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- X * SOFTWARE.
- X *
- X * Adaptation to GDB: Pierre Willard
- X * XXGDB Created: December, 1990
- X *
- X *****************************************************************************/
- X
- /*
- X * dbx.c
- X *
- X * Handle dbx command initialization file (.dbxinit) and communication
- X * between dbx and xdbx.
- X *
- X * dbx_init(): Handle .dbxinit
- X * debug_init():
- X * read_dbx(): Read dbx output, parse and filter it before displaying
- X * onto the dialog window.
- X * write_dbx(): Send a command to dbx.
- X * query_dbx(): Send a command to dbx and process it.
- X */
- X
- #include "global.h"
- X
- Boolean Prompt; /* True when dbx prompt arrives */
- char *concat();
- char *dbxprompt;
- char *xdbxprompt;
- X
- /* Given a dbx command initialization file, this routine executes each dbx
- X * command in the file. It sends the command to dbx, and calls read_dbx()
- X * directly to process output returned from dbx.
- X */
- X
- static void dbx_init(xdbxinit)
- char *xdbxinit;
- {
- X FILE *fp;
- X char s[LINESIZ];
- X
- X if (!strcmp(xdbxinit, ""))
- X return;
- X if (fp = fopen(xdbxinit, "r")) {
- X while (fgets(s, LINESIZ, fp)) {
- #ifdef GDB
- X /* if GDB:
- X Check for comment line,
- X DO NOT SEND '\n',
- X Take care of source command.
- X */
- X if ((*s != '#') && strcmp(s,"\n"))
- X {
- X if ((!gdb_source_command(s,TRUE)) &&
- X (!gdb_define_command(s,fp)))
- X {
- X write_dbx(s);
- X insert_command(s);
- X AppendDialogText(s);
- X }
- #else /* GDB */
- X send_command(s);
- X AppendDialogText(s);
- #endif
- X Prompt = False;
- X while (!Prompt)
- X read_dbx();
- #ifdef GDB
- X }
- #endif /* GDB */
- X }
- X close((int)fp);
- X }
- }
- X
- /*
- X * This routine is called after getting the first dbx prompt.
- X * > check the use list to create a list of directories for searching
- X * source files.
- X * > ask dbx for the source file and display it if it exists.
- X * > open the command initialization file and executed the commands;
- X * if Tstartup is true, remove the initialization file.
- X */
- void debug_init()
- {
- X static visited = False;
- X
- X if (!visited) {
- X visited = True;
- X dbx_init(xdbxinit);
- X if (Tstartup)
- X unlink(xdbxinit);
- X strcpy(xdbxinit, "");
- X }
- }
- X
- /*
- X * This is a callback procedure invoked everytime when input is pending
- X * on the file descriptor to dbx.
- X * o reads all the data available on the file descriptor line by line
- X * into local variable 'string' and global variable 'output'.
- X * 'output' records the entire dbx output whereas 'string' records
- X * only the data read in this invocation of read_dbx().
- X * o in Echo mode, the contents in 'string' is edited by filter()
- X * before it gets displayed on the dialog window.
- X * o once the dbx prompt is read, calls parse() to analyse the dbx output
- X * and take appropriate action.
- X */
- /* ARGSUSED */
- void read_dbx(master, source, id)
- XXtPointer master;
- int *source;
- XXtInputId *id;
- {
- X static char *output = NULL; /* buffer for dbx output */
- X static char *next_string = NULL;
- X static char *command;
- X char *string = NULL;
- X char s[LINESIZ];
- X Boolean more;
- X
- X more = True;
- X while (more) {
- X Prompt = False;
- X /* keep reading until no more or until prompt arrives */
- X while (more = fgets(s, LINESIZ, dbxfp) && !Prompt) {
- X if (debug)
- X fprintf(stderr, "=>%s", s);
- X /* receive prompt? */
- X if (!strncmp(s, dbxprompt, strlen(dbxprompt))) {
- X Prompt = True;
- X /* more stuff behind prompt? */
- X if (s[strlen(dbxprompt)])
- X /* remember it */
- X next_string = XtNewString(s+strlen(dbxprompt));
- X /* destroy contents */
- X strcpy(s, "");
- X }
- X string = concat(string, s);
- X strcpy(s, "");
- X }
- X output = concat(output, string);
- X command = get_command();
- X
- X if (Echo) {
- X filter(string, output, command);
- X if (Prompt) AppendDialogText(xdbxprompt);
- X }
- X if (string) {
- X XtFree(string);
- X string = NULL;
- X }
- X if (next_string) {
- X string = concat(string, next_string);
- X XtFree(next_string);
- X next_string = NULL;
- X }
- X if (Prompt) {
- X parse(output, command);
- X delete_command();
- X XtFree(output);
- X output = NULL;
- X }
- X }
- }
- X
- /* Write string s to dbx, and flush the output. */
- X
- void write_dbx(s)
- char *s;
- {
- X if (debug)
- X fprintf(stderr, ">>%s", s); /* (PW) see what is sent to GDB */
- X
- X fputs(s, dbxfp);
- X fflush(dbxfp);
- }
- X
- /* Sends a command to dbx and read the corresponding output, directly
- X * invoking the Xt input procedure, read_dbx().
- X */
- void query_dbx(command)
- char *command;
- {
- X write_dbx(command);
- X insert_command(command);
- X
- X Echo = False;
- X Prompt = False;
- X while (!Prompt)
- X read_dbx();
- X
- X Parse = True; /* Always reset Parse and Echo to True */
- X Echo = True;
- }
- SHAR_EOF
- chmod 0664 mxgdb/dbx.c ||
- echo 'restore of mxgdb/dbx.c failed'
- Wc_c="`wc -c < 'mxgdb/dbx.c'`"
- test 7618 -eq "$Wc_c" ||
- echo 'mxgdb/dbx.c: original size 7618, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/datadpy.h ==============
- if test -f 'mxgdb/datadpy.h' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/datadpy.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/datadpy.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/datadpy.h' &&
- /* $Id: datadpy.h,v 1.1.1.1 1991/05/16 21:41:47 jtsillas Exp $ */
- X
- /*****************************************************************************
- X *
- X * xdbx - X Window System interface to the dbx debugger
- X *
- X * Copyright 1989 The University of Texas at Austin
- X * Copyright 1990 Microelectronics and Computer Technology Corporation
- X *
- X * Permission to use, copy, modify, and distribute this software and its
- X * documentation for any purpose and without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of The University of Texas
- X * and Microelectronics and Computer Technology Corporation (MCC) not be
- X * used in advertising or publicity pertaining to distribution of
- X * the software without specific, written prior permission. The
- X * University of Texas and MCC makes no representations about the
- X * suitability of this software for any purpose. It is provided "as is"
- X * without express or implied warranty.
- X *
- X * THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
- X * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- X * FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
- X * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- X * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- X * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- X * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Po Cheung
- X * Created: March 10, 1989
- X *
- X *****************************************************************************
- X *
- X * xxgdb - X Window System interface to the gdb debugger
- X *
- X * Copyright 1990 Thomson Consumer Electronics, Inc.
- X *
- X * Permission to use, copy, modify, and distribute this software and its
- X * documentation for any purpose and without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of Thomson Consumer
- X * Electronics (TCE) not be used in advertising or publicity pertaining
- X * to distribution of the software without specific, written prior
- X * permission. TCE makes no representations about the suitability of
- X * this software for any purpose. It is provided "as is" without express
- X * or implied warranty.
- X *
- X * TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
- X * SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
- X * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- X * SOFTWARE.
- X *
- X * Adaptation to GDB: Pierre Willard
- X * XXGDB Created: December, 1990
- X *
- X *****************************************************************************/
- X
- /* datadpy.h:
- X *
- X * Regular expression pattern matching for C structures
- X *
- X * The reg_token array indicates the register no. for each token type.
- X * reg_token[0] : level of indentation
- X * reg_token[2] : field name
- X * reg_token[4] : pointer string
- X */
- X
- #define TK_INDENT 0
- #define TK_FIELD 2
- #define TK_POINTER 4
- X
- #define D_POINTER 0
- #define D_FIELD 1
- #define D_STRUCT 2
- X
- /*
- X Note : for GDB the 'set prettyprint on' must be ON.
- X
- X Exaamples "
- X
- X $3 = (struct toto *) 0x40c0
- X
- X $2 = {
- X pt = 0x40b4,
- X u = 5,
- X v = 6
- X }
- */
- X
- PatternRec dataPattern[] = {
- X {"0x[0-9a-f]+",
- X NULL, {-1, -1, -1, -1, -1, -1}
- X },
- X {"\\([ ]*\\)\\(.*[^ ]+\\)[ ]* = \\((.*) \\)?\\(0x[0-9a-f]+\\)[,]?[ ]*\n",
- X NULL, { 1, -1, 2, -1, 4, -1}
- X },
- X {"\\([ ]*\\)\\(.*[^ ]*\\)[ ]* = {\n",
- X NULL, { 1, -1, 2, -1, -1, -1}
- X },
- X NULL
- };
- X
- X
- SHAR_EOF
- chmod 0664 mxgdb/datadpy.h ||
- echo 'restore of mxgdb/datadpy.h failed'
- Wc_c="`wc -c < 'mxgdb/datadpy.h'`"
- test 4052 -eq "$Wc_c" ||
- echo 'mxgdb/datadpy.h: original size 4052, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/dialog.c ==============
- if test -f 'mxgdb/dialog.c' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/dialog.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/dialog.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/dialog.c' &&
- static char rcsid[] = "$Id: dialog.c,v 1.2 1991/05/20 14:04:09 jtsillas Exp $";
- X
- /*****************************************************************************
- X *
- X * xdbx - X Window System interface to the dbx debugger
- X *
- X * Copyright 1989 The University of Texas at Austin
- X * Copyright 1990 Microelectronics and Computer Technology Corporation
- X *
- X * Permission to use, copy, modify, and distribute this software and its
- X * documentation for any purpose and without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of The University of Texas
- X * and Microelectronics and Computer Technology Corporation (MCC) not be
- X * used in advertising or publicity pertaining to distribution of
- X * the software without specific, written prior permission. The
- X * University of Texas and MCC makes no representations about the
- X * suitability of this software for any purpose. It is provided "as is"
- X * without express or implied warranty.
- X *
- X * THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
- X * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- X * FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
- X * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- X * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- X * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- X * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Author: Po Cheung
- X * Created: March 10, 1989
- X *
- X *****************************************************************************
- X *
- X * xxgdb - X Window System interface to the gdb debugger
- X *
- X * Copyright 1990 Thomson Consumer Electronics, Inc.
- X *
- X * Permission to use, copy, modify, and distribute this software and its
- X * documentation for any purpose and without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of Thomson Consumer
- X * Electronics (TCE) not be used in advertising or publicity pertaining
- X * to distribution of the software without specific, written prior
- X * permission. TCE makes no representations about the suitability of
- X * this software for any purpose. It is provided "as is" without express
- X * or implied warranty.
- X *
- X * TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
- X * SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
- X * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- X * SOFTWARE.
- X *
- X * Adaptation to GDB: Pierre Willard
- X * XXGDB Created: December, 1990
- X *
- X *****************************************************************************/
- X
- /* dialog.c
- X *
- X * Create the dialogue window where the user enter dbx commands, and
- X * provide action procs to make a text widget behave like a terminal.
- X *
- X * InsertSpace(): Prevent user from deleting past the prompt (action proc
- X * for DELETE or BACKSPACE).
- X * Dispatch(): Send an input command line to dbx. (action proc for CR).
- X * SigInt(): Send SIGINT to dbx (action proc for Ctrl-C).
- X * SigEof(): Send an EOF signal to dbx (action proc for Ctrl-D).
- X * SigQuit(): Send SIGQUIT to dbx (action proc for Ctrl-\).
- X * CreateDialogWindow(): Create dialog window and install action table.
- X * AppendDialogText(): Append string to dialog window.
- X */
- X
- #include <signal.h>
- #include "global.h"
- #include <Xm/Xm.h>
- #include <Xm/Text.h>
- X
- Widget dialogWindow; /* text window as a dbx terminal */
- Boolean FalseSignal = FALSE; /* set to TRUE before self-generated
- X interrupt/quit signals */
- static XmTextPosition StartPos; /* starting position of input text */
- X
- X
- /* This procedure prevents the user from deleting past the prompt, or
- X * any text appended by AppendDialogText() to the dialog window.
- X * It checks the last position of text, if it matches StartPos, set
- X * by AppendDialogText(), it inserts a space so that delete-previous-
- X * character() can only delete the space character.
- X */
- /* ARGSUSED */
- static void InsertSpace(w, event, params, num_params)
- X Widget w;
- X XEvent *event;
- X String *params;
- X Cardinal *num_params;
- {
- X XmTextPosition lastPos;
- X
- X if (XmTextGetInsertionPosition(w) <= StartPos) {
- X lastPos = TextGetLastPos(w);
- X if (lastPos == StartPos)
- X XmTextInsert(w, lastPos, " ");
- X }
- }
- X
- static void InsertSelection(w, event, params, num_params)
- X Widget w;
- X XEvent *event;
- X String *params;
- X Cardinal *num_params;
- {
- X XmTextSetInsertionPosition(w, XmTextGetLastPosition(w));
- }
- X
- X
- /* Dispatch() is invoked on every <CR>.
- X * It collects text from the dialog window and sends it to dbx.
- X * If the string is a command to dbx (Prompt would be TRUE),
- X * it is stored in the global variable, Command.
- X */
- /* ARGSUSED */
- static void Dispatch(w, event, params, num_params)
- X Widget w;
- X XEvent *event;
- X String *params;
- X Cardinal *num_params;
- {
- X char *DialogText;
- X /*
- X For GDB, '\n' means exec previous command again.
- X default command is space+CR, so that we never send
- X CR to gdb (the repeat is managed here)
- X */
- X static char gdb_command[LINESIZ] = " \n";
- X char s[LINESIZ];
- X
- X DialogText = XmTextGetString(dialogWindow);
- X strcpy(s, DialogText + StartPos);
- X /* (PW)18DEC90 : bug xdbx : without the following line,
- X xdbx sends several times the same lines when Prompt is false */
- X StartPos = TextGetLastPos(dialogWindow);
- X
- X if (Prompt) {
- X if (gdb_source_command(s,FALSE)) /* filter source command (& do not display source command) */
- X {
- X strcpy(gdb_command," \n"); /* do not execute anything if next command is '\n' */
- X return;
- X }
- X /* When we send \n to gdb, it executes the last command,
- X so better tell xxgdb what gdb is doing */
- X if (strcmp(s, "\n"))
- X strcpy(gdb_command,s);
- X else
- X strcpy(s,gdb_command);
- X send_command(s);
- X }
- X else {
- X write_dbx(s);
- X }
- X XtFree(DialogText);
- }
- X
- X
- /* Sends an interrupt signal, SIGINT, to dbx.
- X * Simulates the action of the INTR character (ctrl-C).
- X */
- /* ARGSUSED */
- static void SigInt(w, event, params, num_params)
- X Widget w;
- X XEvent *event;
- X String *params;
- X Cardinal *num_params;
- {
- X FalseSignal = TRUE;
- X killpg(dbxpid, SIGINT);
- }
- X
- X
- /* Sends an EOF signal to dbx. (ctrl-D) */
- /* ARGSUSED */
- static void SigEof(w, event, params, num_params)
- X Widget w;
- X XEvent *event;
- X String *params;
- X Cardinal *num_params;
- {
- X write_dbx("\04");
- }
- X
- X
- /* Sends a QUIT signal, SIGQUIT, to dbx.
- X * Simulates the action of the QUIT character (ctrl-\)
- X */
- /* ARGSUSED */
- static void SigQuit(w, event, params, num_params)
- X Widget w;
- X XEvent *event;
- X String *params;
- X Cardinal *num_params;
- {
- X FalseSignal = TRUE;
- X killpg(dbxpid, SIGQUIT);
- }
- X
- X
- /*
- X * Dialog window has its own set of translations for editing.
- X * Special action procedures for keys Delete/Backspace, Carriage Return,
- X * Ctrl-U, Ctrl-C, Ctrl-D, Ctrl-\, and word selection.
- X */
- void CreateDialogWindow(parent)
- Widget parent;
- {
- X Arg args[MAXARGS];
- X Cardinal n;
- X
- X static XtActionsRec dialog_actions[] = {
- X {"SigInt", (XtActionProc) SigInt},
- X {"SigEof", (XtActionProc) SigEof},
- X {"SigQuit", (XtActionProc) SigQuit},
- X {"InsertSpace", (XtActionProc) InsertSpace},
- X {"InsertSelection", (XtActionProc) InsertSelection},
- X {"Dispatch", (XtActionProc) Dispatch},
- X {NULL, NULL}
- X };
- X
- X XtSetArg(args[0], XmNeditMode, XmMULTI_LINE_EDIT);
- X XtSetArg(args[1], XmNautoShowCursorPosition, True);
- X XtSetArg(args[2], XmNscrollingPolicy, XmAUTOMATIC);
- X XtSetArg(args[3], XmNscrollLeftSide, True);
- X XtSetArg(args[4], XmNwordWrap, True);
- X dialogWindow = XmCreateScrolledText(parent, "dialogWindow",
- X args, 5);
- X XtManageChild(dialogWindow);
- X
- X XtAppAddActions(app_context, dialog_actions, XtNumber(dialog_actions));
- }
- X
- static void TextSetLastPos(w, lastPos)
- Widget w;
- XXmTextPosition lastPos;
- {
- X Arg args[MAXARGS];
- X XtSetArg(args[0], XmNcursorPosition, lastPos);
- X XtSetValues(w, args, 1);
- }
- X
- void AppendDialogText(s)
- X char *s;
- {
- X XmTextPosition i, lastPos;
- X XmTextBlockRec textblock, nullblock;
- X Arg args[MAXARGS];
- X Cardinal n;
- X
- X if (!s || !strcmp(s, "")) return;
- X
- X textblock.length = strlen(s);
- X textblock.ptr = s;
- X
- X lastPos = XmTextGetLastPosition(dialogWindow);
- X
- X XmTextInsert(dialogWindow, lastPos,
- X textblock.ptr);
- X StartPos = TextGetLastPos(dialogWindow);
- X XmTextSetInsertionPosition(dialogWindow,
- X XmTextGetLastPosition(dialogWindow));
- }
- SHAR_EOF
- chmod 0664 mxgdb/dialog.c ||
- echo 'restore of mxgdb/dialog.c failed'
- Wc_c="`wc -c < 'mxgdb/dialog.c'`"
- test 9041 -eq "$Wc_c" ||
- echo 'mxgdb/dialog.c: original size 9041, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= mxgdb/regex.c ==============
- if test -f 'mxgdb/regex.c' -a X"$1" != X"-c"; then
- echo 'x - skipping mxgdb/regex.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting mxgdb/regex.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/regex.c' &&
- static char rcsid[] = "$Id: regex.c,v 1.1.1.1 1991/05/16 21:42:37 jtsillas Exp $";
- X
- /* Extended regular expression matching and search.
- X Copyright (C) 1985 Free Software Foundation, Inc.
- X
- X NO WARRANTY
- X
- X BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
- NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT
- WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
- RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS"
- WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
- AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
- DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
- CORRECTION.
- X
- X IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
- STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
- WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
- LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
- OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
- USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
- DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
- A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
- PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
- X
- X GENERAL PUBLIC LICENSE TO COPY
- X
- X 1. You may copy and distribute verbatim copies of this source file
- as you receive it, in any medium, provided that you conspicuously and
- appropriately publish on each copy a valid copyright notice "Copyright
- (C) 1985 Free Software Foundation, Inc."; and include following the
- copyright notice a verbatim copy of the above disclaimer of warranty
- and of this License. You may charge a distribution fee for the
- physical act of transferring a copy.
- X
- X 2. You may modify your copy or copies of this source file or
- any portion of it, and copy and distribute such modifications under
- SHAR_EOF
- true || echo 'restore of mxgdb/regex.c failed'
- fi
- echo 'End of part 2'
- echo 'File mxgdb/regex.c is continued in part 3'
- echo 3 > _shar_seq_.tmp
- exit 0
- --
- == James Tsillas Bull HN Information Systems Inc. ==
- == (508) 294-2937 300 Concord Road 826A ==
- == jtsillas@bubba.ma30.bull.com Billerica, MA 01821 ==
- == ==
- == The opinions expressed above are solely my own and do not reflect ==
- == those of my employer. ==
- -== no solicitations please ==-
-