home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3646 < prev    next >
Encoding:
Text File  |  1991-07-17  |  40.1 KB  |  1,122 lines

  1. Newsgroups: alt.sources
  2. From: jtsillas@sprite.ma30.bull.com (James Tsillas)
  3. Subject: mxgdb Part 8/9
  4. Date: 16 Jul 91 13:14:52
  5. Message-ID: <JTSILLAS.91Jul16131452@sprite.ma30.bull.com>
  6.  
  7.  
  8.  
  9. ---- Cut Here and feed the following to sh ----
  10. #!/bin/sh
  11. # this is mxgdb.08 (part 8 of a multipart archive)
  12. # do not concatenate these parts, unpack them in order with /bin/sh
  13. # file mxgdb/patchlevel.h continued
  14. #
  15. if test ! -r _shar_seq_.tmp; then
  16.     echo 'Please unpack part 1 first!'
  17.     exit 1
  18. fi
  19. (read Scheck
  20.  if test "$Scheck" != 8; then
  21.     echo Please unpack part "$Scheck" next!
  22.     exit 1
  23.  else
  24.     exit 0
  25.  fi
  26. ) < _shar_seq_.tmp || exit 1
  27. if test ! -f _shar_wnt_.tmp; then
  28.     echo 'x - still skipping mxgdb/patchlevel.h'
  29. else
  30. echo 'x - continuing file mxgdb/patchlevel.h'
  31. sed 's/^X//' << 'SHAR_EOF' >> 'mxgdb/patchlevel.h' &&
  32. X
  33. #define PATCHLEVEL 2
  34. SHAR_EOF
  35. echo 'File mxgdb/patchlevel.h is complete' &&
  36. chmod 0664 mxgdb/patchlevel.h ||
  37. echo 'restore of mxgdb/patchlevel.h failed'
  38. Wc_c="`wc -c < 'mxgdb/patchlevel.h'`"
  39. test 91 -eq "$Wc_c" ||
  40.     echo 'mxgdb/patchlevel.h: original size 91, current size' "$Wc_c"
  41. rm -f _shar_wnt_.tmp
  42. fi
  43. # ============= mxgdb/global.h ==============
  44. if test -f 'mxgdb/global.h' -a X"$1" != X"-c"; then
  45.     echo 'x - skipping mxgdb/global.h (File already exists)'
  46.     rm -f _shar_wnt_.tmp
  47. else
  48. > _shar_wnt_.tmp
  49. echo 'x - extracting mxgdb/global.h (Text)'
  50. sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/global.h' &&
  51. /* $Id: global.h,v 1.9 1991/07/16 14:51:57 jtsillas Exp $ */
  52. X
  53. /*****************************************************************************
  54. X *
  55. X *  xdbx - X Window System interface to the dbx debugger
  56. X *
  57. X *  Copyright 1989 The University of Texas at Austin
  58. X *  Copyright 1990 Microelectronics and Computer Technology Corporation
  59. X *
  60. X *  Permission to use, copy, modify, and distribute this software and its
  61. X *  documentation for any purpose and without fee is hereby granted,
  62. X *  provided that the above copyright notice appear in all copies and that
  63. X *  both that copyright notice and this permission notice appear in
  64. X *  supporting documentation, and that the name of The University of Texas
  65. X *  and Microelectronics and Computer Technology Corporation (MCC) not be 
  66. X *  used in advertising or publicity pertaining to distribution of
  67. X *  the software without specific, written prior permission.  The
  68. X *  University of Texas and MCC makes no representations about the 
  69. X *  suitability of this software for any purpose.  It is provided "as is" 
  70. X *  without express or implied warranty.
  71. X *
  72. X *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
  73. X *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  74. X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
  75. X *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  76. X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
  77. X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  78. X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  79. X *
  80. X *  Author:      Po Cheung
  81. X *  Created:       March 10, 1989
  82. X *
  83. X *****************************************************************************
  84. X * 
  85. X *  xxgdb - X Window System interface to the gdb debugger
  86. X *  
  87. X *     Copyright 1990 Thomson Consumer Electronics, Inc.
  88. X *  
  89. X *  Permission to use, copy, modify, and distribute this software and its
  90. X *  documentation for any purpose and without fee is hereby granted,
  91. X *  provided that the above copyright notice appear in all copies and that
  92. X *  both that copyright notice and this permission notice appear in
  93. X *  supporting documentation, and that the name of Thomson Consumer
  94. X *  Electronics (TCE) not be used in advertising or publicity pertaining
  95. X *  to distribution of the software without specific, written prior
  96. X *  permission.  TCE makes no representations about the suitability of
  97. X *  this software for any purpose.  It is provided "as is" without express
  98. X *  or implied warranty.
  99. X *
  100. X *  TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  101. X *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
  102. X *  SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
  103. X *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  104. X *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  105. X *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  106. X *  SOFTWARE.
  107. X *
  108. X *  Adaptation to GDB:  Pierre Willard
  109. X *  XXGDB Created:       December, 1990
  110. X *
  111. X *****************************************************************************
  112. X *  Modifications for use under System V
  113. X *
  114. X *      Copyright 1990 Bull Worldwide Information Systems, Inc.
  115. X *
  116. X *  Permission to use, copy, modify, and distribute this software and its
  117. X *  documentation for any purpose and without fee is hereby granted,
  118. X *  provided that the above copyright notice appear in all copies and that
  119. X *  both that copyright notice and this permission notice appear in
  120. X *  supporting documentation, and that the name of Bull Worldwide
  121. X *  Information Systems not be used in advertising or publicity pertaining
  122. X *  to distribution of the software without specific, written prior
  123. X *  permission.  Bull makes no representations about the suitability of
  124. X *  this software for any purpose.  It is provided "as is" without express
  125. X *  or implied warranty.
  126. X *
  127. X *  BULL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  128. X *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
  129. X *  SHALL BULL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
  130. X *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  131. X *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  132. X *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  133. X *  SOFTWARE.
  134. X *
  135. X *  Adaptation to SYSV: James Tsillas
  136. X *  XXGDB Created:      March, 1991
  137. X *
  138. X *****************************************************************************/
  139. X
  140. /*  global.h:
  141. X *
  142. X *    Contain extern declarations of variables and functions.
  143. X */
  144. X
  145. #ifdef __GNUC__
  146. #   define alloca __builtin_alloca
  147. #endif
  148. X
  149. #ifndef MAXPATHLEN
  150. #define MAXPATHLEN 1024
  151. #endif
  152. X
  153. X
  154. X
  155. #ifdef SYSV 
  156. #    define MAX(a,b)    ((a)>(b)?(a):(b))
  157. #    define MIN(a,b)    ((a)>(b)?(b):(a))
  158. #ifdef SCO
  159. #    include <unistd.h>
  160. #endif
  161. #endif
  162. X
  163. #include "defs.h"
  164. X
  165. /* calldbx.c */
  166. X
  167. extern void        calldbx();        /* fork child, exec dbx */
  168. X
  169. /* command.c */
  170. X
  171. extern void             Break();
  172. extern void             DoIt();
  173. extern void             Print();
  174. extern void             Display_();
  175. extern void             Undisplay();
  176. extern void             Clear();
  177. extern void             Quit();
  178. extern void             Help();
  179. extern void             PopupSearch();
  180. extern void        CreateCommandPanel();
  181. extern void        send_command();
  182. extern char        *get_command();
  183. extern void        insert_command();
  184. extern void        delete_command();
  185. X
  186. /* dbx.c */
  187. extern void        debug_init();        /* initial source display */
  188. extern void         read_dbx();        /* get data from dbx */
  189. extern void         write_dbx();        /* send data to dbx */
  190. extern void        query_dbx();        /* ask dbx for info */
  191. X
  192. /* dialog.c */
  193. X
  194. extern void        CreateDialogWindow();
  195. extern void         AppendDialogText();    /* append text to buffer */
  196. X
  197. /* filemenu.c */
  198. X
  199. extern void        File();            /* file button callback */
  200. extern void             OKCallBack();
  201. extern void             CancelCallBack();
  202. X
  203. /* handler.c */
  204. X
  205. extern void        TextSetTopPosition();    /* sets topDisplayPosition */
  206. extern void         AdjustText();        /* adjust display position */
  207. extern void         exec_handler();        /* run, cont, next, step */
  208. extern void         done_handler();        /* run, cont, next, step */
  209. extern void         stop_at_handler();    /* stop at line */
  210. extern void         stop_in_handler();    /* stop in function */
  211. extern void         updown_handler();    /* move up/down the stack */
  212. extern void         clear_handler();    /* clear stop signs */
  213. extern void         func_handler();        /* display function */
  214. extern void         file_handler();        /* display file */
  215. extern void         debug_handler();    /* debug program */
  216. extern void         cd_handler();        /* change directory */
  217. extern void         pwd_handler();        /* print working directory */
  218. extern void         use_handler();        /* update use directory list */
  219. extern void         search_handler();    /* display searched string */
  220. extern void         list_handler();        /* list source code */
  221. extern void         display_handler();    /* show display variables */
  222. extern void             help_handler();
  223. X
  224. extern Widget        helplabels[];
  225. extern Widget        helpbuttons[];
  226. X
  227. /* parser.c */
  228. X
  229. extern void        parser_init();        /* initialization */
  230. extern void        parse();        /* parse dbx output */
  231. extern void        filter();        /* modify dbx output */
  232. X
  233. /* signals.c */
  234. extern void        trap_signals();        /* signal handling for xdbx */
  235. X
  236. /* signs.c */
  237. X
  238. extern void        signs_init();        /* initilalize routine */
  239. extern void         DisplayStop();        /* show stop sign */
  240. extern void         UpdateStops();        /* update position of stops */
  241. extern void         ClearStops();        /* mark all stops invalid */
  242. extern void         RemoveStop();        /* undisplay stop sign */
  243. extern void         UpdateArrow();        /* update position of arrow */
  244. extern void         UpdateUpdown();        /* update position of updown */
  245. extern void         UpdateBomb();        /* update position of bomb */
  246. X
  247. /* source.c */
  248. X
  249. extern void        SelectStart();        /* modified select-start */
  250. extern void        SelectEnd();        /* modified select-end */
  251. extern void        SelectWord();        /* my select word */
  252. extern void        PrintSelection();    /* select variable and print */
  253. extern void        Update();        /* update line label */
  254. extern void        source_init();        /* init routine */
  255. extern void         CreateSourceWindow();
  256. extern int         LoadFile();        /* display source file */
  257. extern int         LoadCurrentFile();    /* display source file */
  258. extern char        *GetPathname();        /* get full path name of file */
  259. extern void        MakeDirList();        /* maintain list of dirs */
  260. X
  261. /* utils.c */
  262. X
  263. extern XmTextPosition    TextGetLastPos();    /* get last pos of text */
  264. extern int         TextPositionToLine();    /* convert line # to text pos */
  265. extern int        LineToStop_no();    /* convert line # to stop # */
  266. extern void         bell();            /* sound bell */
  267. extern char         *concat();        /* substring search */
  268. X
  269. /* windows.c */
  270. X
  271. extern void         CreateSubWindows();    /* all subwindows of xdbx */
  272. extern void         UpdateFileLabel();    /* update current file name */
  273. extern void         UpdateLineLabel();    /* update current line num */
  274. extern void         UpdateMessageWindow();    /* update xdbx message */
  275. extern void             CreateSearchPopup();
  276. X
  277. /* extern variables */
  278. X
  279. extern Display    *display;
  280. extern XtAppContext     app_context;
  281. extern Widget    toplevel, fileWindow, 
  282. X            sourceForm, sourceScroll, sourceWindow, messageWindow,  
  283. X        commandWindow, dialogWindow, searchWindow, separator,
  284. X        displayWindow, fileSel, displayFD, scrollV, scrollH,
  285. X        searchText, pageRbutton, pageLbutton, breakbutton,
  286. X                stepbutton, nextbutton, printbutton, downbutton, upbutton,
  287. X                stackbutton, contbutton, finishbutton, runbutton,
  288. X                dispbutton, undispbutton, clearbutton, printsbutton, 
  289. X                argsbutton, localsbutton, helpFD, helpselectscroll,
  290. X                helpupbutton;
  291. X
  292. X
  293. X
  294. extern XdbxResources app_resources;    /* application resources */
  295. extern char    xdbxinit[];        /* initialization filename */
  296. extern char    *dbxprompt;        /* dbx prompt string */
  297. extern char    *xdbxprompt;        /* xdbx prompt string */
  298. extern Boolean    Tstartup;
  299. extern Boolean    debug;
  300. X
  301. extern FileRec       *displayedFile;    /* pointer to current file info */
  302. extern Tokens        Token;        /* token structure */
  303. extern PatternRec       dataPattern[];     /* data display pattern */
  304. X
  305. extern Boolean     Echo;            /* echo dbx output onto window ? */
  306. extern Boolean    Prompt;            /* command or program input ? */
  307. extern Boolean    Parse;            /* flag for parser */
  308. extern Boolean    FalseSignal;        /* real/false signal ? */
  309. extern int    dbxpid;            /* dbx process id */
  310. extern FILE    *dbxfp;            /* file pointer to dbx process */
  311. X
  312. extern char     CurrentFile[];        /* string for dbx output */
  313. extern char     cwd[];            /* current working directory of dbx */
  314. X
  315. extern Arrow    arrow;            /* arrow widget and mapped info */
  316. extern Updown   updown;            /* updown widget and mapped info */
  317. extern Stops    stops[];        /* stop widget and mapped info */
  318. extern Bomb    bomb;            /* bomb widget and mapped info */
  319. extern Cardinal nstops;            /* number of stops */
  320. extern ArrowSign     arrowsign[];
  321. extern UpdownSign     updownsign[];
  322. extern StopSign        stopsign[];
  323. extern BombSign     bombsign[];
  324. X
  325. #ifdef GDB
  326. extern void         display_info_handler();
  327. extern void         break_handler();
  328. extern void         info_dir_handler();
  329. extern void         directory_handler();
  330. extern void         info_line_handler();
  331. extern void         info_break_handler();
  332. #endif
  333. SHAR_EOF
  334. chmod 0664 mxgdb/global.h ||
  335. echo 'restore of mxgdb/global.h failed'
  336. Wc_c="`wc -c < 'mxgdb/global.h'`"
  337. test 11137 -eq "$Wc_c" ||
  338.     echo 'mxgdb/global.h: original size 11137, current size' "$Wc_c"
  339. rm -f _shar_wnt_.tmp
  340. fi
  341. # ============= mxgdb/regex.h ==============
  342. if test -f 'mxgdb/regex.h' -a X"$1" != X"-c"; then
  343.     echo 'x - skipping mxgdb/regex.h (File already exists)'
  344.     rm -f _shar_wnt_.tmp
  345. else
  346. > _shar_wnt_.tmp
  347. echo 'x - extracting mxgdb/regex.h (Text)'
  348. sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/regex.h' &&
  349. /* $Id: regex.h,v 1.1.1.1 1991/05/16 21:42:41 jtsillas Exp $ */
  350. X
  351. /* Definitions for data structures callers pass the regex library.
  352. X   Copyright (C) 1985 Free Software Foundation, Inc.
  353. X
  354. X               NO WARRANTY
  355. X
  356. X  BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
  357. NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT
  358. WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
  359. RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS"
  360. WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  361. BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  362. FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY
  363. AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE
  364. DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
  365. CORRECTION.
  366. X
  367. X IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
  368. STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
  369. WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
  370. LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
  371. OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  372. USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
  373. DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
  374. A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
  375. PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
  376. DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  377. X
  378. X        GENERAL PUBLIC LICENSE TO COPY
  379. X
  380. X  1. You may copy and distribute verbatim copies of this source file
  381. as you receive it, in any medium, provided that you conspicuously and
  382. appropriately publish on each copy a valid copyright notice "Copyright
  383. (C) 1985 Free Software Foundation, Inc."; and include following the
  384. copyright notice a verbatim copy of the above disclaimer of warranty
  385. and of this License.  You may charge a distribution fee for the
  386. physical act of transferring a copy.
  387. X
  388. X  2. You may modify your copy or copies of this source file or
  389. any portion of it, and copy and distribute such modifications under
  390. the terms of Paragraph 1 above, provided that you also do the following:
  391. X
  392. X    a) cause the modified files to carry prominent notices stating
  393. X    that you changed the files and the date of any change; and
  394. X
  395. X    b) cause the whole of any work that you distribute or publish,
  396. X    that in whole or in part contains or is a derivative of this
  397. X    program or any part thereof, to be licensed at no charge to all
  398. X    third parties on terms identical to those contained in this
  399. X    License Agreement (except that you may choose to grant more extensive
  400. X    warranty protection to some or all third parties, at your option).
  401. X
  402. X    c) You may charge a distribution fee for the physical act of
  403. X    transferring a copy, and you may at your option offer warranty
  404. X    protection in exchange for a fee.
  405. X
  406. Mere aggregation of another unrelated program with this program (or its
  407. derivative) on a volume of a storage or distribution medium does not bring
  408. the other program under the scope of these terms.
  409. X
  410. X  3. You may copy and distribute this program (or a portion or derivative
  411. of it, under Paragraph 2) in object code or executable form under the terms
  412. of Paragraphs 1 and 2 above provided that you also do one of the following:
  413. X
  414. X    a) accompany it with the complete corresponding machine-readable
  415. X    source code, which must be distributed under the terms of
  416. X    Paragraphs 1 and 2 above; or,
  417. X
  418. X    b) accompany it with a written offer, valid for at least three
  419. X    years, to give any third party free (except for a nominal
  420. X    shipping charge) a complete machine-readable copy of the
  421. X    corresponding source code, to be distributed under the terms of
  422. X    Paragraphs 1 and 2 above; or,
  423. X
  424. X    c) accompany it with the information you received as to where the
  425. X    corresponding source code may be obtained.  (This alternative is
  426. X    allowed only for noncommercial distribution and only if you
  427. X    received the program in object code or executable form alone.)
  428. X
  429. For an executable file, complete source code means all the source code for
  430. all modules it contains; but, as a special exception, it need not include
  431. source code for modules which are standard libraries that accompany the
  432. operating system on which the executable file runs.
  433. X
  434. X  4. You may not copy, sublicense, distribute or transfer this program
  435. except as expressly provided under this License Agreement.  Any attempt
  436. otherwise to copy, sublicense, distribute or transfer this program is void and
  437. your rights to use the program under this License agreement shall be
  438. automatically terminated.  However, parties who have received computer
  439. software programs from you with this License Agreement will not have
  440. their licenses terminated so long as such parties remain in full compliance.
  441. X
  442. X  5. If you wish to incorporate parts of this program into other free
  443. programs whose distribution conditions are different, write to the Free
  444. Software Foundation at 675 Mass Ave, Cambridge, MA 02139.  We have not yet
  445. worked out a simple rule that can be stated here, but we will often permit
  446. this.  We will be guided by the two goals of preserving the free status of
  447. all derivatives of our free software and of promoting the sharing and reuse of
  448. software.
  449. X
  450. X
  451. In other words, you are welcome to use, share and improve this program.
  452. You are forbidden to forbid anyone else to use, share and improve
  453. what you give them.   Help stamp out software-hoarding!  */
  454. X
  455. X
  456. #ifndef RE_NREGS
  457. #define RE_NREGS 10
  458. #endif
  459. X
  460. /* This data structure is used to represent a compiled pattern. */
  461. X
  462. struct re_pattern_buffer
  463. X  {
  464. X    char *buffer;    /* Space holding the compiled pattern commands. */
  465. X    int allocated;    /* Size of space that  buffer  points to */
  466. X    int used;        /* Length of portion of buffer actually occupied */
  467. X    char *fastmap;    /* Pointer to fastmap, if any, or zero if none. */
  468. X            /* re_search uses the fastmap, if there is one,
  469. X               to skip quickly over totally implausible characters */
  470. X    char *translate;    /* Translate table to apply to all characters 
  471. X                           before comparing.
  472. X               Or zero for no translation.
  473. X               The translation is applied to a pattern when it is compiled
  474. X               and to data when it is matched. */
  475. X    char fastmap_accurate;
  476. X            /* Set to zero when a new pattern is stored,
  477. X               set to one when the fastmap is updated from it. */
  478. X    char can_be_null;   /* Set to one by compiling fastmap
  479. X               if this pattern might match the null string.
  480. X               It does not necessarily match the null string
  481. X               in that case, but if this is zero, it cannot.
  482. X               2 as value means can match null string
  483. X               but at end of range or before a character
  484. X               listed in the fastmap.  */
  485. X  };
  486. X
  487. /* Structure to store "register" contents data in.
  488. X
  489. X   Pass the address of such a structure as an argument to re_match, etc.,
  490. X   if you want this information back.
  491. X
  492. X   start[i] and end[i] record the string matched by \( ... \) grouping i,
  493. X   for i from 1 to RE_NREGS - 1.
  494. X   start[0] and end[0] record the entire string matched. */
  495. X
  496. struct re_registers
  497. X  {
  498. X    int start[RE_NREGS];
  499. X    int end[RE_NREGS];
  500. X  };
  501. X
  502. /* These are the command codes that appear in compiled regular expressions, 
  503. X  one per byte.
  504. X  Some command codes are followed by argument bytes.
  505. X  A command code can specify any interpretation whatever for its arguments.
  506. X  Zero-bytes may appear in the compiled regular expression. */
  507. X
  508. enum regexpcode
  509. X  {
  510. X    unused,
  511. X    exactn,    /* followed by one byte giving n, and then by n literal bytes */
  512. X    begline,   /* fails unless at beginning of line */
  513. X    endline,   /* fails unless at end of line */
  514. X    jump,     /* followed by two bytes giving relative address to jump to */
  515. X    on_failure_jump,     /* followed by two bytes giving relative address of place
  516. X                    to resume at in case of failure. */
  517. X    finalize_jump,     /* Throw away latest failure point and then 
  518. X                jump to address. */
  519. X    maybe_finalize_jump, /* Like jump but finalize if safe to do so.
  520. X                This is used to jump back to the beginning
  521. X                of a repeat.  If the command that follows
  522. X                this jump is clearly incompatible with the
  523. X                one at the beginning of the repeat, such that
  524. X                we can be sure that there is no use backtracking
  525. X                out of repetitions already completed,
  526. X                then we finalize. */
  527. X    dummy_failure_jump,  /* jump, and push a dummy failure point.
  528. X                This failure point will be thrown away
  529. X                if an attempt is made to use it for a failure.
  530. X                A + construct makes this before the first repeat.  */
  531. X    anychar,     /* matches any one character */
  532. X    charset,     /* matches any one char belonging to specified set.
  533. X            First following byte is # bitmap bytes.
  534. X            Then come bytes for a bit-map saying which chars are in.
  535. X            Bits in each byte are ordered low-bit-first.
  536. X            A character is in the set if its bit is 1.
  537. X            A character too large to have a bit in the map
  538. X            is automatically not in the set */
  539. X    charset_not, /* similar but match any character that is NOT one 
  540. X                    of those specified */
  541. X    start_memory, /* starts remembering the text that is matched
  542. X            and stores it in a memory register.
  543. X            followed by one byte containing the register number.
  544. X            Register numbers must be in the range 0 through NREGS. */
  545. X    stop_memory, /* stops remembering the text that is matched
  546. X            and stores it in a memory register.
  547. X            followed by one byte containing the register number.
  548. X            Register numbers must be in the range 0 through NREGS. */
  549. X    duplicate,    /* match a duplicate of something remembered.
  550. X            Followed by one byte containing the index of the memory register. */
  551. X    before_dot,     /* Succeeds if before dot */
  552. X    at_dot,     /* Succeeds if at dot */
  553. X    after_dot,     /* Succeeds if after dot */
  554. X    begbuf,      /* Succeeds if at beginning of buffer */
  555. X    endbuf,      /* Succeeds if at end of buffer */
  556. X    wordchar,    /* Matches any word-constituent character */
  557. X    notwordchar, /* Matches any char that is not a word-constituent */
  558. X    wordbeg,     /* Succeeds if at word beginning */
  559. X    wordend,     /* Succeeds if at word end */
  560. X    wordbound,   /* Succeeds if at a word boundary */
  561. X    notwordbound, /* Succeeds if not at a word boundary */
  562. X    syntaxspec,  /* Matches any character whose syntax is specified.
  563. X            followed by a byte which contains a syntax code, Sword 
  564. X                or such like */
  565. X    notsyntaxspec /* Matches any character whose syntax differs from 
  566. X                     the specified. */
  567. X  };
  568. X
  569. extern char *re_compile_pattern ();
  570. /* Is this really advertised? */
  571. extern void re_compile_fastmap ();
  572. extern int re_search (), re_search_2 ();
  573. extern int re_match (), re_match_2 ();
  574. X
  575. /* 4.2 bsd compatibility (yuck) */
  576. extern char *re_comp ();
  577. extern int re_exec ();
  578. X
  579. #ifdef SYNTAX_TABLE
  580. extern char *re_syntax_table;
  581. #endif
  582. SHAR_EOF
  583. chmod 0664 mxgdb/regex.h ||
  584. echo 'restore of mxgdb/regex.h failed'
  585. Wc_c="`wc -c < 'mxgdb/regex.h'`"
  586. test 10897 -eq "$Wc_c" ||
  587.     echo 'mxgdb/regex.h: original size 10897, current size' "$Wc_c"
  588. rm -f _shar_wnt_.tmp
  589. fi
  590. # ============= mxgdb/signals.c ==============
  591. if test -f 'mxgdb/signals.c' -a X"$1" != X"-c"; then
  592.     echo 'x - skipping mxgdb/signals.c (File already exists)'
  593.     rm -f _shar_wnt_.tmp
  594. else
  595. > _shar_wnt_.tmp
  596. echo 'x - extracting mxgdb/signals.c (Text)'
  597. sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/signals.c' &&
  598. static char rcsid[] = "$Id: signals.c,v 1.1.1.1 1991/05/16 21:42:44 jtsillas Exp $";
  599. X
  600. /*****************************************************************************
  601. X *
  602. X *  xdbx - X Window System interface to the dbx debugger
  603. X *
  604. X *  Copyright 1989 The University of Texas at Austin
  605. X *  Copyright 1990 Microelectronics and Computer Technology Corporation
  606. X *
  607. X *  Permission to use, copy, modify, and distribute this software and its
  608. X *  documentation for any purpose and without fee is hereby granted,
  609. X *  provided that the above copyright notice appear in all copies and that
  610. X *  both that copyright notice and this permission notice appear in
  611. X *  supporting documentation, and that the name of The University of Texas
  612. X *  and Microelectronics and Computer Technology Corporation (MCC) not be 
  613. X *  used in advertising or publicity pertaining to distribution of
  614. X *  the software without specific, written prior permission.  The
  615. X *  University of Texas and MCC makes no representations about the 
  616. X *  suitability of this software for any purpose.  It is provided "as is" 
  617. X *  without express or implied warranty.
  618. X *
  619. X *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
  620. X *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  621. X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
  622. X *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  623. X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
  624. X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  625. X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  626. X *
  627. X *  Author:      Po Cheung
  628. X *  Created:       March 10, 1989
  629. X *
  630. X *****************************************************************************
  631. X
  632. /* signals.c
  633. X *
  634. X *   Signal handling for xdbx and dbx.
  635. X *
  636. X *   kill_hanlder():    For SIGINT, SIGQUIT, SIGILL, SIGBUS, SIGTERM
  637. X *            print error message and exit with signal status.
  638. X *   quit_handler():    SIGCHLD, wait for dbx to die and exit gracefully.
  639. X *   stop_handler():    SIGTSTP, stop dbx process, then stop own process.
  640. X *   cont_handler():    SIGCONT, continue dbx process.
  641. X *   trap_signals():    Install signal handlers.
  642. X */
  643. X
  644. #include <signal.h>
  645. #include <sys/wait.h>
  646. #include "global.h"
  647. X
  648. /*  Kill the dbx child process and then exits. */
  649. /*  ARGSUSED */
  650. static void kill_handler(sig, code, scp, addr)
  651. X    int sig, code;
  652. X    struct sigcontext *scp;
  653. X    char *addr;
  654. {
  655. X    if (FalseSignal) {
  656. X    FalseSignal = FALSE;
  657. X    return;
  658. X    }
  659. X    kill(dbxpid, SIGKILL);
  660. X    switch (sig) {
  661. X      case SIGINT  : fprintf(stderr, "Interrupt\n"); break;
  662. X      case SIGQUIT : fprintf(stderr, "Quit\n"); break;
  663. X      case SIGILL  : fprintf(stderr, "Illegal instruction\n"); break;
  664. X      case SIGBUS  : fprintf(stderr, "Bus error\n"); break;
  665. X      case SIGSEGV : fprintf(stderr, "Segmentation violation\n"); break;
  666. X      case SIGTERM : fprintf(stderr, "Soft kill\n"); break;
  667. X    }
  668. X    exit(sig);
  669. }
  670. X
  671. X
  672. static void quit_handler()
  673. {
  674. X
  675. X  int status;
  676. X  int pid;
  677. X    /*  wait for the child to report its status; if the child has died, 
  678. X     *  exit gracefully.
  679. X     */
  680. X  if(dbxpid)
  681. X    {
  682. X      pid = waitpid(dbxpid, &status , WNOHANG|WUNTRACED);
  683. X      if (dbxpid == pid && (WIFEXITED(status) || WIFSIGNALED(status)) && 
  684. X      !WIFSTOPPED(status)) 
  685. X    {
  686. X      exit(1);
  687. X    }
  688. X    }
  689. }
  690. X
  691. X
  692. static void stop_handler()
  693. {
  694. X    if (dbxpid)
  695. X    kill(dbxpid, SIGSTOP);    /* stop dbx process */
  696. X    kill(0, SIGSTOP);        /* stop own process */
  697. }
  698. X
  699. X
  700. static void cont_handler()
  701. {
  702. X    if (dbxpid) {
  703. X    sleep(1);        /* we need this */
  704. X    kill(dbxpid, SIGCONT);    /* continue dbx after stop */
  705. X    }
  706. }
  707. X
  708. X
  709. /*
  710. X *  Trap signals to xdbx so that the child process can be handled properly.
  711. X */
  712. void trap_signals()
  713. {
  714. X    sigset(SIGINT,  kill_handler);
  715. X    sigset(SIGQUIT, kill_handler);
  716. X    sigset(SIGILL,  kill_handler);
  717. X    sigset(SIGBUS,  kill_handler);
  718. X    sigset(SIGSEGV, kill_handler);
  719. X    sigset(SIGTERM, kill_handler);
  720. X
  721. X    sigset(SIGTSTP, stop_handler);    /* stop signal from keyboard */
  722. X    sigset(SIGCONT, cont_handler);    /* continue after stop */
  723. X    sigset(SIGCHLD, quit_handler);    /* child status has changed */
  724. }
  725. SHAR_EOF
  726. chmod 0664 mxgdb/signals.c ||
  727. echo 'restore of mxgdb/signals.c failed'
  728. Wc_c="`wc -c < 'mxgdb/signals.c'`"
  729. test 4097 -eq "$Wc_c" ||
  730.     echo 'mxgdb/signals.c: original size 4097, current size' "$Wc_c"
  731. rm -f _shar_wnt_.tmp
  732. fi
  733. # ============= mxgdb/signs.c ==============
  734. if test -f 'mxgdb/signs.c' -a X"$1" != X"-c"; then
  735.     echo 'x - skipping mxgdb/signs.c (File already exists)'
  736.     rm -f _shar_wnt_.tmp
  737. else
  738. > _shar_wnt_.tmp
  739. echo 'x - extracting mxgdb/signs.c (Text)'
  740. sed 's/^X//' << 'SHAR_EOF' > 'mxgdb/signs.c' &&
  741. static char rcsid[] = "$Id: signs.c,v 1.2 1991/07/10 01:39:41 jtsillas Exp $";
  742. X
  743. /*****************************************************************************
  744. X *
  745. X *  xdbx - X Window System interface to the dbx debugger
  746. X *
  747. X *  Copyright 1989 The University of Texas at Austin
  748. X *  Copyright 1990 Microelectronics and Computer Technology Corporation
  749. X *
  750. X *  Permission to use, copy, modify, and distribute this software and its
  751. X *  documentation for any purpose and without fee is hereby granted,
  752. X *  provided that the above copyright notice appear in all copies and that
  753. X *  both that copyright notice and this permission notice appear in
  754. X *  supporting documentation, and that the name of The University of Texas
  755. X *  and Microelectronics and Computer Technology Corporation (MCC) not be 
  756. X *  used in advertising or publicity pertaining to distribution of
  757. X *  the software without specific, written prior permission.  The
  758. X *  University of Texas and MCC makes no representations about the 
  759. X *  suitability of this software for any purpose.  It is provided "as is" 
  760. X *  without express or implied warranty.
  761. X *
  762. X *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
  763. X *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  764. X *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
  765. X *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  766. X *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
  767. X *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  768. X *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  769. X *
  770. X *  Author:      Po Cheung
  771. X *  Created:       March 10, 1989
  772. X *
  773. X *****************************************************************************/
  774. X
  775. /*  signs.c
  776. X *
  777. X *  This file contains all the routines for the creation and manipulation of 
  778. X *  symbols used in xdbx.  There are 3 different signs:
  779. X *    arrow  - a solid right arrow to indicate the current execution point.
  780. X *    updown - an outlined right arrow to indicate position in stack trace.
  781. X *    stop   - a stop hand symbol to indicate a breakpoint is set.
  782. X *    bomb  - a bomb symbol to indicate the point of segmentation fault.
  783. X *
  784. X *  To display a sign on a given line in the source window, it is first
  785. X *  created and mapped.  To undisplay it, the sign is unmapped.  It can
  786. X *  be mapped again when the sign is needed.  Note that the sign is never
  787. X *  moved, so that there can be as many signs created (but not mapped) as
  788. X *  the number of lines in the source window.
  789. X *  For arrow and updown, there can be at most one of each mapped at a time.
  790. X *  For stop, there can be more than one mapped at the same time.
  791. X */
  792. X
  793. #include "global.h"
  794. #include "bitmaps.h"
  795. #include <Xm/Xm.h>
  796. #include <Xm/Label.h>
  797. X
  798. #define MAXSTOPS        256             /* max number of stops */
  799. #define MAXSIGNS        256             /* max number of signs */
  800. #define OFFSET            2                 /* offset for displaying signs */
  801. X
  802. ArrowSign     arrowsign[MAXSIGNS];
  803. UpdownSign     updownsign[MAXSIGNS];
  804. StopSign        stopsign[MAXSIGNS];
  805. BombSign     bombsign[MAXSIGNS];
  806. X
  807. Arrow         arrow;
  808. Updown         updown;
  809. Stops        stops[MAXSTOPS];    /* array of stops */
  810. Bomb         bomb;
  811. Cardinal    nstops;            /* number of stops */
  812. X
  813. /* Initialize data structures */
  814. X
  815. void signs_init()
  816. {
  817. X    int i;
  818. X
  819. X    for (i=0; i<MAXSIGNS; i++) {
  820. X    arrowsign[i].w = NULL;
  821. X    arrowsign[i].mapped = FALSE;
  822. X    }
  823. X    for (i=0; i<MAXSIGNS; i++) {
  824. X    stopsign[i].w = NULL;
  825. X    stopsign[i].mapped = FALSE;
  826. X    }
  827. X    arrow.i = 0;
  828. X    arrow.line = 0;
  829. X    strcpy(arrow.file, "");
  830. X    updown.i = 0;
  831. X    updown.line = 0;
  832. X    strcpy(updown.file, "");
  833. X    nstops = 0;
  834. X    bomb.i = 0;
  835. X    bomb.line = 0;
  836. X    strcpy(bomb.file, "");
  837. }
  838. X
  839. X
  840. /*  Create an arrow symbol, updown symbol or stop symbol:
  841. X *    calculate the position of the symbol based on i, the number of lines
  842. X *    from the top line.
  843. X *    create the pixmap of the symbol
  844. X *    display the symbol as a bitmap in a label widget.
  845. X */
  846. static Widget CreateSign(parent, sign, i)
  847. X    Widget    parent;
  848. X    char    *sign;
  849. X    Cardinal     i;
  850. {
  851. X    Arg     args[15];
  852. X    Cardinal     n;
  853. X    Dimension     source_height, height, width; 
  854. X    char    *bits;
  855. X    Pixel       fg, bg;
  856. X    int     horizDistance, vertDistance, height_per_line;
  857. X    int         screen;
  858. X
  859. X    if (displayedFile == NULL) return NULL;
  860. X
  861. X    /* Get height and background pixel values of parent window */
  862. X    XtSetArg(args[0], XmNheight, &source_height);
  863. X    XtSetArg(args[1], XmNbackground, &bg);
  864. X    XtGetValues(parent, args, 2);
  865. X
  866. X    height_per_line = source_height/displayedFile->lines;
  867. X    vertDistance = OFFSET + (i * height_per_line); 
  868. X
  869. X    screen = DefaultScreen(display);
  870. X
  871. X    if (sign && !strcmp(sign, "arrow")) {
  872. X    bits = arrow_bits;
  873. X    width = arrow_width;
  874. X    height = arrow_height;
  875. X    horizDistance = 0;
  876. X    fg = app_resources.arrow_color;
  877. X    }
  878. X    else if (sign && !strcmp(sign, "updown")) {
  879. X    bits = updown_bits;
  880. X    width = updown_width;
  881. X    height = updown_height;
  882. X    horizDistance = 0;
  883. X    fg = app_resources.updown_color;
  884. X    }
  885. X    else if (sign && !strcmp(sign, "stop")) {
  886. X    bits = stop_bits;
  887. X    width = stop_width;
  888. X    height = stop_height;
  889. X    horizDistance = arrow_width;
  890. X    fg = app_resources.stop_color;
  891. X    }
  892. X    else if (sign && !strcmp(sign, "bomb")) {
  893. X    bits = bomb_bits;
  894. X    width = bomb_width;
  895. X    height = bomb_height;
  896. X    horizDistance = 0;
  897. X    fg = app_resources.bomb_color;
  898. X    };
  899. X
  900. X    n = 0;
  901. X    XtSetArg(args[n], XmNborderWidth, 0);                n++;
  902. X    XtSetArg(args[n], XmNwidth, (XtArgVal) width);            n++;
  903. X    XtSetArg(args[n], XmNheight, (XtArgVal) height);            n++;
  904. X    XtSetArg(args[n], XmNlabelType, XmPIXMAP);            n++;
  905. X    XtSetArg(args[n], XmNlabelPixmap, XCreatePixmapFromBitmapData (
  906. X        display, DefaultRootWindow(display), bits, width, height,
  907. X        fg, bg, DefaultDepth(display, screen)));            n++;
  908. X
  909. X    XtSetArg(args[n], XmNx, (XtArgVal) horizDistance+5);
  910. X                                    n++;
  911. X    XtSetArg(args[n], XmNy, (XtArgVal) vertDistance+3);    n++;
  912. X    XtSetArg(args[n], XmNmappedWhenManaged, False);      n++;
  913. X
  914. X    return XtCreateManagedWidget(sign, xmLabelWidgetClass, parent, args, n);
  915. }
  916. X
  917. /*
  918. X *  Given a line number, displays a stop sign if that line is viewable.
  919. X *  If the stop widget for that line does not exist, create one and map it.
  920. X *  If the stop widget exists but not mapped, map it.
  921. X */
  922. void DisplayStop(file, line)
  923. FileRec *file;
  924. int    line;
  925. {
  926. X    Cardinal i;
  927. X
  928. X    if (line >= file->topline && line <= file->bottomline) {
  929. X    i = line - file->topline;
  930. X    if (stopsign[i].w == NULL) {    /* widget does not exist */
  931. X
  932. X        stopsign[i].w = CreateSign(sourceForm, "stop", i);
  933. X        XtMapWidget(stopsign[i].w);
  934. X        stopsign[i].mapped = 1;
  935. X    }
  936. X    else if (!stopsign[i].mapped) { /* widget not mapped */
  937. X        XtMapWidget(stopsign[i].w);
  938. X        stopsign[i].mapped = 1;
  939. X    }
  940. X    }
  941. }
  942. X
  943. /*
  944. X *  Unmap all stop signs and then display only those stops that are viewable.
  945. X */
  946. void UpdateStops(file, reason)
  947. FileRec *file;
  948. int reason;
  949. {
  950. X    Cardinal i;
  951. X    int     line; 
  952. X    Position vert;
  953. X    Dimension source_height;
  954. X    Arg args[1];
  955. X
  956. X
  957. X    if (file == NULL) return;
  958. X    for (i=0; i<file->lines; i++)
  959. X    if (stopsign[i].w && stopsign[i].mapped) {
  960. X        XtUnmapWidget(stopsign[i].w);
  961. X        stopsign[i].mapped = 0;
  962. X    }
  963. X
  964. X    for (i=1; i<=nstops; i++)
  965. X    if (stops[i].file && !strcmp(stops[i].file, file->pathname) &&
  966. X        (line=stops[i].line) && line >= file->topline &&
  967. X        line <= file->bottomline) {
  968. X        DisplayStop(file, line);
  969. X    }
  970. }
  971. X
  972. /*
  973. X * Given a line number, unmap the stop sign associated with that line.
  974. X */
  975. void RemoveStop(line)
  976. int line;
  977. {
  978. X    Cardinal i;
  979. X    char command[30];
  980. X
  981. X    if (displayedFile && line >= displayedFile->topline && 
  982. X             line <= displayedFile->bottomline) {
  983. X    i = line - displayedFile->topline;
  984. X    if (stopsign[i].w && stopsign[i].mapped) {
  985. X        XtUnmapWidget(stopsign[i].w);
  986. X        stopsign[i].mapped = 0;
  987. X
  988. X        sprintf(command, "clear %d\n", line);
  989. X        send_command(command);
  990. X        Echo = False;
  991. X        Parse = False;
  992. X        Prompt = False;
  993. X        while(!Prompt) read_dbx();
  994. X        
  995. X    }
  996. X    }
  997. }
  998. X
  999. void ClearStops()
  1000. {
  1001. X    int i;
  1002. X
  1003. X    for (i=1; i<=nstops; i++) {
  1004. X    stops[i].file = NULL;
  1005. X    stops[i].line = 0;
  1006. X    }
  1007. }
  1008. X
  1009. /*  Unmap the current arrow sign.
  1010. X *  Display a new arrow sign if it is viewable.
  1011. X */
  1012. void UpdateArrow(file)
  1013. FileRec *file;
  1014. {
  1015. X    Cardinal i;
  1016. X    int         line;
  1017. X
  1018. X    if (file == NULL) return;
  1019. X    i = arrow.i;
  1020. X    if (i>=0 && i<file->lines)
  1021. X    if (arrowsign[i].w && arrowsign[i].mapped) {
  1022. X        XtUnmapWidget(arrowsign[i].w);
  1023. X        arrowsign[i].mapped = 0;
  1024. X    }
  1025. X    line = arrow.line;
  1026. X    if (arrow.file && !strcmp(arrow.file, file->pathname) &&
  1027. X        line >= file->topline && line <= file->bottomline) {
  1028. X        i = line - file->topline;
  1029. X    arrow.i = i;
  1030. X    if (arrowsign[i].w == NULL) {
  1031. X        arrowsign[i].w = CreateSign(sourceForm, "arrow", i);
  1032. X        XtMapWidget(arrowsign[i].w);
  1033. X        arrowsign[i].mapped = TRUE;
  1034. X    }
  1035. X    else if (!arrowsign[i].mapped) {
  1036. X        XtMapWidget(arrowsign[i].w);
  1037. X        arrowsign[i].mapped = TRUE;
  1038. X    }
  1039. X    }
  1040. }
  1041. X
  1042. X
  1043. /*  If the new updown is on the same line as the arrow, remove the updown.
  1044. X *  Unmap current updown sign.
  1045. X *  Display the updown if it is viewable.
  1046. X */
  1047. void UpdateUpdown(file)
  1048. FileRec *file;
  1049. {
  1050. X    Cardinal i;
  1051. X    int         line;
  1052. X
  1053. X    if (file == NULL) return;
  1054. X    if (updown.file && !strcmp(updown.file, arrow.file) && 
  1055. X    !strcmp(updown.func, arrow.func) && (updown.line == arrow.line)) {
  1056. X    updown.line = 0;
  1057. X    strcpy(updown.file, "");
  1058. X    }
  1059. X    i = updown.i;
  1060. X    if (i>=0 && i<file->lines)
  1061. X    if (updownsign[i].w && updownsign[i].mapped) {
  1062. X        XtUnmapWidget(updownsign[i].w);
  1063. X        updownsign[i].mapped = 0;
  1064. X    }
  1065. X    line = updown.line;
  1066. X    if (updown.file && !strcmp(updown.file, file->pathname) &&
  1067. X        line >= file->topline && line <= file->bottomline) {
  1068. X        i = line - file->topline;
  1069. X    updown.i = i;
  1070. X    if (updownsign[i].w == NULL) {
  1071. X        updownsign[i].w = CreateSign(sourceForm, "updown", i);
  1072. X        XtMapWidget(updownsign[i].w);
  1073. X        updownsign[i].mapped = TRUE;
  1074. X    }
  1075. X    else if (!updownsign[i].mapped) {
  1076. X        XtMapWidget(updownsign[i].w);
  1077. X        updownsign[i].mapped = TRUE;
  1078. X    }
  1079. X    }
  1080. }
  1081. X
  1082. /*  Unmap the current bomb sign, if any.
  1083. X *  Display a new bomb sign.
  1084. X */
  1085. void UpdateBomb(file)
  1086. FileRec *file;
  1087. {
  1088. X    Cardinal i;
  1089. X    int         line;
  1090. X
  1091. X    if (file == NULL) return;
  1092. X    i = bomb.i;
  1093. X    if (i>=0 && i<file->lines)
  1094. X    if (bombsign[i].w && bombsign[i].mapped) {
  1095. X        XtUnmapWidget(bombsign[i].w);
  1096. X        bombsign[i].mapped = 0;
  1097. X    }
  1098. X    line = bomb.line;
  1099. X    if (bomb.file && !strcmp(bomb.file, file->pathname) &&
  1100. X        line >= file->topline && line <= file->bottomline) {
  1101. X        i = line - file->topline;
  1102. X    bomb.i = i;
  1103. X    if (bombsign[i].w == NULL) {
  1104. X        bombsign[i].w = CreateSign(sourceForm, "bomb", i);
  1105. X        XtMapWidget(bombsign[i].w);
  1106. X        bombsign[i].mapped = TRUE;
  1107. SHAR_EOF
  1108. true || echo 'restore of mxgdb/signs.c failed'
  1109. fi
  1110. echo 'End of  part 8'
  1111. echo 'File mxgdb/signs.c is continued in part 9'
  1112. echo 9 > _shar_seq_.tmp
  1113. exit 0
  1114. --
  1115.  == James Tsillas                    Bull HN Information Systems Inc. ==
  1116.  == (508) 294-2937                   300 Concord Road   826A          ==
  1117.  == jtsillas@bubba.ma30.bull.com     Billerica, MA 01821              ==
  1118.  ==                                                                   ==
  1119.  == The opinions expressed above are solely my own and do not reflect ==
  1120.  == those of my employer.                                             ==
  1121.             -== no solicitations please ==-
  1122.