home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / x / volume16 / contool-3.2 / part05 < prev    next >
Encoding:
Text File  |  1992-03-05  |  56.1 KB  |  1,748 lines

  1. Newsgroups: comp.sources.x
  2. Path: uunet!think.com!mips!msi!news
  3. From: chuck@trantor.harris-atd.com (Chuck Musciano)
  4. Subject: v16i090: Contool 3.2, Part05/05
  5. Message-ID: <1992Mar5.190356.2671@msi.com>
  6. Originator: news@sun4
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. References: <csx-16i086-contool-3.2@uunet.UU.NET>
  10. Date: Thu, 5 Mar 1992 19:03:56 GMT
  11. Approved: dcmartin@msi.com
  12.  
  13. Submitted-by: chuck@trantor.harris-atd.com (Chuck Musciano)
  14. Posting-number: Volume 16, Issue 90
  15. Archive-name: contool-3.2/part05
  16.  
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  21. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  22. # If this archive is complete, you will see the following message at the end:
  23. #        "End of archive 5 (of 5)."
  24. # Contents:  INTRO Imakefile about.c busy.c contool.h error.c expand.c
  25. #   filename_completion.c getopt.c icons/default_bad.icon
  26. #   icons/default_flash.icon icons/default_good.icon icons/mask.icon
  27. #   images/empty.icon images/range.icon images/single.icon load_icon.c
  28. #   logging.c manifest.h patchlevel.h pinned_menu_notify.c regexp.c
  29. #   sample.filter
  30. # Wrapped by dcmartin@fascet on Sat Feb 22 10:11:10 1992
  31. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  32. if test -f 'INTRO' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'INTRO'\"
  34. else
  35. echo shar: Extracting \"'INTRO'\" \(1369 characters\)
  36. sed "s/^X//" >'INTRO' <<'END_OF_FILE'
  37. X     This release brings contool from version 3.1a to 3.2.  This new
  38. Xrelease has the following enhancements:
  39. X
  40. X     *    -i option allows messages to be read from other sources
  41. X         including named pipes and the standard input
  42. X     
  43. X     *    -f option causes contool to fork automatically after
  44. X         acquiring the console
  45. X     
  46. X     *    alternative icons are correctly masked
  47. X     
  48. X     *    messages can be moved to an archive window, letting you keep
  49. X         only current messages in the contool window
  50. X
  51. XAs always, complete sources are available from trantor.harris-atd.com
  52. Xin the /pub/suntools/contool directory.
  53. X
  54. X     Fun with sounds: if your machine can play sounds, you can use the
  55. X"Execute command with message" feature to produce all sorts of audible
  56. Xsignals when messages arrive.  Ellery Chan here at Harris found a nifty
  57. Xuse of sound: he plays the sound /usr/demo/SOUND/sounds/splat.au as the
  58. Xdefault action when a message arrives, and has the window open.  When a
  59. Xmessage arrives, he gets a satisfying "splat!" sound and contool appears
  60. Xon his screen.  If you are running on a SPARCstation (or otherwise have
  61. Xa copy of splat.au for your machine) give it a try.
  62. X
  63. XChuck Musciano                ARPA  : chuck@trantor.harris-atd.com
  64. XHarris Corporation             Usenet: ...!uunet!x102a!trantor!chuck
  65. XPO Box 37, MS 3A/1912            AT&T  : (407) 727-6131
  66. XMelbourne, FL 32902            FAX   : (407) 729-3363
  67. END_OF_FILE
  68. if test 1369 -ne `wc -c <'INTRO'`; then
  69.     echo shar: \"'INTRO'\" unpacked with wrong size!
  70. fi
  71. # end of 'INTRO'
  72. fi
  73. if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  74.   echo shar: Will not clobber existing file \"'Imakefile'\"
  75. else
  76. echo shar: Extracting \"'Imakefile'\" \(914 characters\)
  77. sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
  78. XOPENWINHOME    = /usr/openwin
  79. X
  80. XHELPDIR        = /usr/local/lib/help
  81. X
  82. XMAILER        = /usr/ucb/mail
  83. X
  84. XLOCAL_LIBRARIES = -lxview -lolgx $(XLIB)
  85. X
  86. XLDOPTIONS    = -L$(OPENWINHOME)/lib
  87. X
  88. XCPPFLAGS    = -I$(OPENWINHOME)/include
  89. X
  90. XCFLAGS        = -O -DMAILER=\"$(MAILER)\"
  91. X
  92. XEXTRA_INCLUDES    = -I$(OPENWINHOME)/include
  93. X
  94. XSRCS        = about.c archive.c busy.c contool.c contool_ui.c error.c expand.c filename_completion.c \
  95. X          filters.c getopt.c load.c load_icon.c logging.c misc.c parse.y \
  96. X          pinned_menu_notify.c place_dialog.c props.c regexp.c send_mail.c store.c
  97. X
  98. XOBJS        = about.o archive.o busy.o contool.o contool_ui.o error.o expand.o filename_completion.o \
  99. X          filters.o getopt.o load.o load_icon.o logging.o misc.o parse.o \
  100. X          pinned_menu_notify.o place_dialog.o props.o regexp.o send_mail.o store.o
  101. X
  102. XComplexProgramTarget(contool)
  103. X
  104. Xinstall: install.man install.help
  105. X
  106. Xinstall.help:
  107. X    $(INSTALL) -c $(INSTMANFLAGS) contool.info $(HELPDIR)/contool.info
  108. END_OF_FILE
  109. if test 914 -ne `wc -c <'Imakefile'`; then
  110.     echo shar: \"'Imakefile'\" unpacked with wrong size!
  111. fi
  112. # end of 'Imakefile'
  113. fi
  114. if test -f 'about.c' -a "${1}" != "-c" ; then 
  115.   echo shar: Will not clobber existing file \"'about.c'\"
  116. else
  117. echo shar: Extracting \"'about.c'\" \(2001 characters\)
  118. sed "s/^X//" >'about.c' <<'END_OF_FILE'
  119. X/************************************************************************/
  120. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  121. X/*                                    */
  122. X/*    Full ownership of this software, and all rights pertaining to     */
  123. X/*    the for-profit distribution of this software, are retained by     */
  124. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  125. X/*    use this software without fee.  This software is provided "as     */
  126. X/*    is" without express or implied warranty.  You may redistribute     */
  127. X/*    this software, provided that this copyright notice is retained,    */
  128. X/*    and that the software is not distributed for profit.  If you     */
  129. X/*    wish to use this software in a profit-making venture, you must     */
  130. X/*    first license this code and its underlying technology from     */
  131. X/*    Harris Corporation.                         */
  132. X/*                                    */
  133. X/*    Bottom line: you can have this software, you can use it, you     */
  134. X/*    can give it away.  You just can't sell any or all parts of it     */
  135. X/*    without prior permission from Harris Corporation.         */
  136. X/************************************************************************/
  137. X
  138. X/************************************************************************/
  139. X/*                                    */
  140. X/*    about.c        display a little information window        */
  141. X/*                                    */
  142. X/************************************************************************/
  143. X
  144. X#include    <stdio.h>
  145. X#include    <sys/param.h>
  146. X#include    <sys/types.h>
  147. X#include    <xview/xview.h>
  148. X#include    <xview/panel.h>
  149. X#include    "contool_ui.h"
  150. X
  151. X#include    "manifest.h"
  152. X
  153. XPUBLIC    contool_base_objects    *contool_base;
  154. X
  155. XPRIVATE    contool_about_objects    *dialog = NULL;
  156. X
  157. X/************************************************************************/
  158. XEXPORT    Menu_item    popup_about_contool(item, op)
  159. X
  160. XMenu_item    item;
  161. XMenu_generate    op;
  162. X
  163. X{
  164. X    if (op == MENU_NOTIFY) {
  165. X       if (dialog == NULL) {
  166. X          dialog = contool_about_objects_initialize(NULL, contool_base->base);
  167. X          place_dialog(contool_base->base, dialog->about);
  168. X          }
  169. X       xv_set(dialog->about, XV_SHOW, TRUE, NULL);
  170. X       }
  171. X    return item;
  172. X}
  173. END_OF_FILE
  174. if test 2001 -ne `wc -c <'about.c'`; then
  175.     echo shar: \"'about.c'\" unpacked with wrong size!
  176. fi
  177. # end of 'about.c'
  178. fi
  179. if test -f 'busy.c' -a "${1}" != "-c" ; then 
  180.   echo shar: Will not clobber existing file \"'busy.c'\"
  181. else
  182. echo shar: Extracting \"'busy.c'\" \(2165 characters\)
  183. sed "s/^X//" >'busy.c' <<'END_OF_FILE'
  184. X/************************************************************************/
  185. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  186. X/*                                    */
  187. X/*    Full ownership of this software, and all rights pertaining to     */
  188. X/*    the for-profit distribution of this software, are retained by     */
  189. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  190. X/*    use this software without fee.  This software is provided "as     */
  191. X/*    is" without express or implied warranty.  You may redistribute     */
  192. X/*    this software, provided that this copyright notice is retained,    */
  193. X/*    and that the software is not distributed for profit.  If you     */
  194. X/*    wish to use this software in a profit-making venture, you must     */
  195. X/*    first license this code and its underlying technology from     */
  196. X/*    Harris Corporation.                         */
  197. X/*                                    */
  198. X/*    Bottom line: you can have this software, you can use it, you     */
  199. X/*    can give it away.  You just can't sell any or all parts of it     */
  200. X/*    without prior permission from Harris Corporation.         */
  201. X/************************************************************************/
  202. X
  203. X/************************************************************************/
  204. X/*                                    */
  205. X/*    busy.c    turn frame busy attribute on and off            */
  206. X/*                                    */
  207. X/************************************************************************/
  208. X
  209. X#include    <stdio.h>
  210. X#include    <xview/xview.h>
  211. X#include    <xview/panel.h>
  212. X
  213. X#include    "manifest.h"
  214. X
  215. X/************************************************************************/
  216. XPRIVATE    set_busy(base, busy, skip)
  217. X
  218. XFrame    base;
  219. Xint    busy;
  220. XFrame    skip;
  221. X
  222. X{    Frame    subframe;
  223. X    int    i;
  224. X
  225. X    for (i = 1; subframe = (Frame) xv_get(base, FRAME_NTH_SUBFRAME, i); i++)
  226. X       if (subframe != skip)
  227. X          if (xv_get(subframe, XV_SHOW))
  228. X             xv_set(subframe, FRAME_BUSY, busy, NULL);
  229. X    xv_set(base, FRAME_BUSY, busy, NULL);
  230. X}
  231. X
  232. X/************************************************************************/
  233. XEXPORT    lets_get_busy(base, busy, skip)
  234. X
  235. XFrame    base;
  236. Xint    busy;
  237. XFrame    skip;
  238. X
  239. X{    static    int    depth = 0;
  240. X
  241. X    if (busy) {
  242. X       if (depth == 0)
  243. X          set_busy(base, TRUE, skip);
  244. X       depth++;
  245. X       }
  246. X    else if (depth > 0)
  247. X       if (--depth == 0)
  248. X          set_busy(base, FALSE, NULL);
  249. X}
  250. END_OF_FILE
  251. if test 2165 -ne `wc -c <'busy.c'`; then
  252.     echo shar: \"'busy.c'\" unpacked with wrong size!
  253. fi
  254. # end of 'busy.c'
  255. fi
  256. if test -f 'contool.h' -a "${1}" != "-c" ; then 
  257.   echo shar: Will not clobber existing file \"'contool.h'\"
  258. else
  259. echo shar: Extracting \"'contool.h'\" \(2457 characters\)
  260. sed "s/^X//" >'contool.h' <<'END_OF_FILE'
  261. X/************************************************************************/
  262. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  263. X/*                                    */
  264. X/*    Full ownership of this software, and all rights pertaining to     */
  265. X/*    the for-profit distribution of this software, are retained by     */
  266. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  267. X/*    use this software without fee.  This software is provided "as     */
  268. X/*    is" without express or implied warranty.  You may redistribute     */
  269. X/*    this software, provided that this copyright notice is retained,    */
  270. X/*    and that the software is not distributed for profit.  If you     */
  271. X/*    wish to use this software in a profit-making venture, you must     */
  272. X/*    first license this code and its underlying technology from     */
  273. X/*    Harris Corporation.                         */
  274. X/*                                    */
  275. X/*    Bottom line: you can have this software, you can use it, you     */
  276. X/*    can give it away.  You just can't sell any or all parts of it     */
  277. X/*    without prior permission from Harris Corporation.         */
  278. X/************************************************************************/
  279. X
  280. X/************************************************************************/
  281. X/*                                    */
  282. X/*    contool.h    internal contool data structures        */
  283. X/*                                    */
  284. X/************************************************************************/
  285. X
  286. X#define        is_null(x)        ((x)? x : "")
  287. X
  288. X#define        BEEP_BIT        0x01
  289. X#define        COMMAND_BIT        0x02
  290. X#define        FLASH_BIT        0x04
  291. X#define        LOG_BIT            0x08
  292. X#define        OPEN_BIT        0x10
  293. X#define        STAMP_BIT        0x20
  294. X
  295. X#define        ARCHIVE_MANUALLY    0
  296. X#define        ARCHIVE_ON_CLOSE    1
  297. X
  298. Xtypedef    struct    filter    Filter;
  299. Xtypedef    struct    props    Props;
  300. X
  301. Xstruct    filter    {char    *start;
  302. X         char    *start_re;
  303. X         int    start_circf;
  304. X         char    *stop;
  305. X         char    *stop_re;
  306. X         int    stop_circf;
  307. X         char    *comment;
  308. X         int    save;
  309. X         int    beep;
  310. X         int    flash;
  311. X         int    log;
  312. X         int    open;
  313. X         int    stamp;
  314. X         int    timeout;
  315. X         char    *command;
  316. X         Filter    *next;
  317. X        };
  318. X
  319. Xstruct    props    {int    beep;
  320. X         int    flash;
  321. X         int    log;
  322. X         int    open;
  323. X         int    stamp;
  324. X         char    *command;
  325. X         char    *good_icon;
  326. X         char    *bad_icon;
  327. X         char    *flash_icon;
  328. X         char    *print_filter;
  329. X         char    *log_file;
  330. X         int    log_after;
  331. X         int    archive_style;
  332. X         int    stamp_resolution;
  333. X         int    max_size;
  334. X         int    delete_amount;
  335. X        };
  336. X
  337. XPUBLIC    char    *compile_exp();
  338. XPUBLIC    char    *expand_tilde();
  339. X
  340. XPUBLIC    Props    defaults;
  341. XPUBLIC    Props    *parsed_defaults;
  342. XPUBLIC    Filter    *parsed_filters;
  343. XPUBLIC    Filter    *filters;
  344. XPUBLIC    int    parse_errors_occured;
  345. XPUBLIC    char    *filter_file;
  346. XPUBLIC    int    filter_version;
  347. END_OF_FILE
  348. if test 2457 -ne `wc -c <'contool.h'`; then
  349.     echo shar: \"'contool.h'\" unpacked with wrong size!
  350. fi
  351. # end of 'contool.h'
  352. fi
  353. if test -f 'error.c' -a "${1}" != "-c" ; then 
  354.   echo shar: Will not clobber existing file \"'error.c'\"
  355. else
  356. echo shar: Extracting \"'error.c'\" \(2036 characters\)
  357. sed "s/^X//" >'error.c' <<'END_OF_FILE'
  358. X/************************************************************************/
  359. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  360. X/*                                    */
  361. X/*    Full ownership of this software, and all rights pertaining to     */
  362. X/*    the for-profit distribution of this software, are retained by     */
  363. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  364. X/*    use this software without fee.  This software is provided "as     */
  365. X/*    is" without express or implied warranty.  You may redistribute     */
  366. X/*    this software, provided that this copyright notice is retained,    */
  367. X/*    and that the software is not distributed for profit.  If you     */
  368. X/*    wish to use this software in a profit-making venture, you must     */
  369. X/*    first license this code and its underlying technology from     */
  370. X/*    Harris Corporation.                         */
  371. X/*                                    */
  372. X/*    Bottom line: you can have this software, you can use it, you     */
  373. X/*    can give it away.  You just can't sell any or all parts of it     */
  374. X/*    without prior permission from Harris Corporation.         */
  375. X/************************************************************************/
  376. X
  377. X/************************************************************************/
  378. X/*                                    */
  379. X/*    error.c        handle error messages                */
  380. X/*                                    */
  381. X/************************************************************************/
  382. X
  383. X#include    <stdio.h>
  384. X#include    <xview/xview.h>
  385. X#include    <xview/notice.h>
  386. X
  387. X#include    "manifest.h"
  388. X#include    "contool_ui.h"
  389. X
  390. XPUBLIC    contool_base_objects    *contool_base;
  391. X
  392. X/************************************************************************/
  393. XEXPORT    void    error(a, b, c, d, e, f)
  394. X
  395. Xchar    *a, *b, *c, *d, *e, *f;
  396. X
  397. X{    char    buf[1024];
  398. X
  399. X    sprintf(buf, a, b, c, d, e, f);
  400. X    notice_prompt(contool_base->base, NULL,
  401. X                 NOTICE_MESSAGE_STRINGS, buf, 0,
  402. X                 NOTICE_BUTTON_YES, "OK",
  403. X              0);
  404. X}
  405. X
  406. X/************************************************************************/
  407. XEXPORT    void    abend(a, b, c, d, e, f)
  408. X
  409. Xchar    *a, *b, *c, *d, *e, *f;
  410. X
  411. X{    char    buf[1024];
  412. X
  413. X    fprintf(stderr, a, b, c, d, e, f);
  414. X    fprintf(stderr, "\n");
  415. X    exit(1);
  416. X}
  417. END_OF_FILE
  418. if test 2036 -ne `wc -c <'error.c'`; then
  419.     echo shar: \"'error.c'\" unpacked with wrong size!
  420. fi
  421. # end of 'error.c'
  422. fi
  423. if test -f 'expand.c' -a "${1}" != "-c" ; then 
  424.   echo shar: Will not clobber existing file \"'expand.c'\"
  425. else
  426. echo shar: Extracting \"'expand.c'\" \(3112 characters\)
  427. sed "s/^X//" >'expand.c' <<'END_OF_FILE'
  428. X/************************************************************************/
  429. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  430. X/*                                    */
  431. X/*    Full ownership of this software, and all rights pertaining to     */
  432. X/*    the for-profit distribution of this software, are retained by     */
  433. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  434. X/*    use this software without fee.  This software is provided "as     */
  435. X/*    is" without express or implied warranty.  You may redistribute     */
  436. X/*    this software, provided that this copyright notice is retained,    */
  437. X/*    and that the software is not distributed for profit.  If you     */
  438. X/*    wish to use this software in a profit-making venture, you must     */
  439. X/*    first license this code and its underlying technology from     */
  440. X/*    Harris Corporation.                         */
  441. X/*                                    */
  442. X/*    Bottom line: you can have this software, you can use it, you     */
  443. X/*    can give it away.  You just can't sell any or all parts of it     */
  444. X/*    without prior permission from Harris Corporation.         */
  445. X/************************************************************************/
  446. X
  447. X#include    <sys/types.h>
  448. X#include    <sys/dir.h>
  449. X#include    <pwd.h>
  450. X
  451. X#include    "manifest.h"
  452. X
  453. XPUBLIC    char    *rindex(), *index();
  454. X
  455. X/************************************************************************/
  456. XPRIVATE    char    *root_path(path)
  457. X
  458. Xchar    *path;
  459. X
  460. X{    char    *p;
  461. X
  462. X    if (p = rindex(path, '/'))
  463. X       if (p == path)
  464. X          p[1] = '\0';
  465. X       else
  466. X          *p = '\0';
  467. X    else
  468. X       *path = '\0';
  469. X    return(path);
  470. X}
  471. X
  472. X/************************************************************************/
  473. XPRIVATE    char    *last_node(path)
  474. X
  475. Xchar    *path;
  476. X
  477. X{    char    *p;
  478. X
  479. X    return((p = rindex(path, '/'))? p + 1 : path);
  480. X}
  481. X
  482. X/************************************************************************/
  483. XEXPORT    char    *expand_filename(path)
  484. X
  485. Xchar    *path;
  486. X
  487. X{    static    char    s[1024];
  488. X    char    pattern[1024], candidate[1024], *p,*q;
  489. X    DIR    *dir;
  490. X    struct    direct *dp;
  491. X    struct    passwd    *pw;
  492. X
  493. X    strcpy(s, path);
  494. X    if (*path == '~')
  495. X       if (path[1] == '/' || path[1] == '\0') {
  496. X          strcpy(s, getenv("HOME"));
  497. X          strcat(s, path + 1);
  498. X          }
  499. X       else {
  500. X          if ((p = index(path, '/')) != NULL)
  501. X             *p = '\0';
  502. X          if ((pw = getpwnam(path + 1)) != NULL) {
  503. X             strcpy(s, pw->pw_dir);
  504. X             if (p != NULL) {
  505. X                strcat(s, "/");
  506. X                strcat(s, p + 1);
  507. X                }
  508. X             }
  509. X          else
  510. X             return(NULL);
  511. X          }
  512. X    strcpy(pattern, last_node(s));
  513. X    if (*pattern == '\0')
  514. X       return(s);
  515. X    root_path(s);
  516. X    candidate[0] = '\0';
  517. X    if (*s == '\0')
  518. X       strcpy(s, ".");
  519. X    if ((dir = opendir(s)) == NULL) {
  520. X       strcpy(s, path);
  521. X       return(s);
  522. X       }
  523. X    while ((dp = readdir(dir)) != NULL)
  524. X       if (strncmp(dp->d_name, pattern, strlen(pattern)) == 0)
  525. X          if (*candidate == '\0')
  526. X             strcpy(candidate, dp->d_name);
  527. X          else {
  528. X             for (p = candidate, q = dp->d_name; *p == *q; p++, q++)
  529. X                ;
  530. X             *p = '\0';
  531. X             }
  532. X    closedir(dir);
  533. X    if (*candidate == '\0')
  534. X       return(NULL);
  535. X    else {
  536. X       if (strcmp(s, ".") == 0)
  537. X          *s = '\0';
  538. X       else if (s[strlen(s) - 1] != '/')
  539. X          strcat(s, "/");
  540. X       strcat(s, candidate);
  541. X       }
  542. X    return(s);
  543. X}
  544. END_OF_FILE
  545. if test 3112 -ne `wc -c <'expand.c'`; then
  546.     echo shar: \"'expand.c'\" unpacked with wrong size!
  547. fi
  548. # end of 'expand.c'
  549. fi
  550. if test -f 'filename_completion.c' -a "${1}" != "-c" ; then 
  551.   echo shar: Will not clobber existing file \"'filename_completion.c'\"
  552. else
  553. echo shar: Extracting \"'filename_completion.c'\" \(2146 characters\)
  554. sed "s/^X//" >'filename_completion.c' <<'END_OF_FILE'
  555. X/************************************************************************/
  556. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  557. X/*                                    */
  558. X/*    Full ownership of this software, and all rights pertaining to     */
  559. X/*    the for-profit distribution of this software, are retained by     */
  560. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  561. X/*    use this software without fee.  This software is provided "as     */
  562. X/*    is" without express or implied warranty.  You may redistribute     */
  563. X/*    this software, provided that this copyright notice is retained,    */
  564. X/*    and that the software is not distributed for profit.  If you     */
  565. X/*    wish to use this software in a profit-making venture, you must     */
  566. X/*    first license this code and its underlying technology from     */
  567. X/*    Harris Corporation.                         */
  568. X/*                                    */
  569. X/*    Bottom line: you can have this software, you can use it, you     */
  570. X/*    can give it away.  You just can't sell any or all parts of it     */
  571. X/*    without prior permission from Harris Corporation.         */
  572. X/************************************************************************/
  573. X
  574. X/************************************************************************/
  575. X/*                                    */
  576. X/*    filename_completion.c    completion handler for text items    */
  577. X/*                                    */
  578. X/************************************************************************/
  579. X
  580. X#include    <stdio.h>
  581. X#include    <sys/param.h>
  582. X#include    <sys/types.h>
  583. X#include    <xview/xview.h>
  584. X#include    <xview/panel.h>
  585. X
  586. X#include    "manifest.h"
  587. X
  588. X/************************************************************************/
  589. XEXPORT    Panel_setting    filename_completion(item, event)
  590. X
  591. XPanel_item    item;
  592. XEvent        *event;
  593. X
  594. X{    char    *p, *expand_filename();
  595. X
  596. X    switch (event_action(event)) {
  597. X       case '\n' :
  598. X       case '\r' : 
  599. X       case ' '  : if ((p = expand_filename((char *) xv_get(item, PANEL_VALUE))) == NULL)
  600. X                 window_bell(xv_get(item, XV_OWNER));
  601. X                  else
  602. X                     xv_set(item, PANEL_VALUE, p, 0);
  603. X                  event_set_id(event, '\n');
  604. X                  return(PANEL_NONE);
  605. X       case '\t' : return(event_shift_is_down(event)? PANEL_PREVIOUS : PANEL_NEXT);
  606. X       default   : return(panel_text_notify(item, event));
  607. X       }
  608. X}
  609. END_OF_FILE
  610. if test 2146 -ne `wc -c <'filename_completion.c'`; then
  611.     echo shar: \"'filename_completion.c'\" unpacked with wrong size!
  612. fi
  613. # end of 'filename_completion.c'
  614. fi
  615. if test -f 'getopt.c' -a "${1}" != "-c" ; then 
  616.   echo shar: Will not clobber existing file \"'getopt.c'\"
  617. else
  618. echo shar: Extracting \"'getopt.c'\" \(1926 characters\)
  619. sed "s/^X//" >'getopt.c' <<'END_OF_FILE'
  620. X/************************************************************************/
  621. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  622. X/*                                    */
  623. X/*    Full ownership of this software, and all rights pertaining to     */
  624. X/*    the for-profit distribution of this software, are retained by     */
  625. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  626. X/*    use this software without fee.  This software is provided "as     */
  627. X/*    is" without express or implied warranty.  You may redistribute     */
  628. X/*    this software, provided that this copyright notice is retained,    */
  629. X/*    and that the software is not distributed for profit.  If you     */
  630. X/*    wish to use this software in a profit-making venture, you must     */
  631. X/*    first license this code and its underlying technology from     */
  632. X/*    Harris Corporation.                         */
  633. X/*                                    */
  634. X/*    Bottom line: you can have this software, you can use it, you     */
  635. X/*    can give it away.  You just can't sell any or all parts of it     */
  636. X/*    without prior permission from Harris Corporation.         */
  637. X/************************************************************************/
  638. X
  639. X#include    <stdio.h>
  640. X
  641. X#include    "manifest.h"
  642. X
  643. X/************************************************************************/
  644. XPRIVATE    delarg(argc, argv)
  645. X
  646. Xint    *argc;
  647. Xchar    **argv;
  648. X
  649. X{    char    *p;
  650. X
  651. X    while (*argv = *(argv+1))
  652. X       argv++;
  653. X    (*argc)--;
  654. X}
  655. X
  656. X/************************************************************************/
  657. XEXPORT    char    getopt(argc, argv, opts, parm)
  658. X
  659. Xint    *argc;
  660. Xchar    **argv;
  661. Xchar    *opts;
  662. Xchar    **parm;
  663. X
  664. X{    char    c, *p, *strcpy(), *index();
  665. X    int    killed;
  666. X
  667. X    *parm = NULL;
  668. X    while (*argv && ((**argv != '-') || (*(*argv+1) == '\0')))
  669. X       argv++;
  670. X    if (*argv == NULL)
  671. X       return(EOF);
  672. X    c = *(*argv+1);
  673. X    *++(*argv) = '-';
  674. X    if (killed = (*(*argv+1) == '\0'))
  675. X       delarg(argc, argv);
  676. X    if ((p = index(opts, c)) == NULL)
  677. X       c = '\0';
  678. X    else if (*(p+1) == ':') {
  679. X       *parm = killed ? *argv : *argv+1;
  680. X       delarg(argc, argv);
  681. X       }
  682. X    return(c);
  683. X}
  684. END_OF_FILE
  685. if test 1926 -ne `wc -c <'getopt.c'`; then
  686.     echo shar: \"'getopt.c'\" unpacked with wrong size!
  687. fi
  688. # end of 'getopt.c'
  689. fi
  690. if test -f 'icons/default_bad.icon' -a "${1}" != "-c" ; then 
  691.   echo shar: Will not clobber existing file \"'icons/default_bad.icon'\"
  692. else
  693. echo shar: Extracting \"'icons/default_bad.icon'\" \(1997 characters\)
  694. sed "s/^X//" >'icons/default_bad.icon' <<'END_OF_FILE'
  695. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  696. X */
  697. X    0x0000,0x0000,0x0000,0x0000,
  698. X    0x0000,0x0000,0x0000,0x0000,
  699. X    0x0000,0x0000,0x0000,0x0000,
  700. X    0x0000,0x0000,0x0000,0x0000,
  701. X    0x0000,0x0000,0x0000,0x0000,
  702. X    0x0000,0x0000,0x0000,0x0000,
  703. X    0x0000,0x0000,0x0000,0x0000,
  704. X    0x0000,0xFFFF,0xFFFE,0x0000,
  705. X    0x0001,0xFFFF,0xFFFF,0x0000,
  706. X    0x0001,0x8000,0x0003,0x0000,
  707. X    0x0001,0xBFFF,0xFFFB,0x0000,
  708. X    0x0001,0xBFFF,0xFFFB,0x0000,
  709. X    0x0001,0xBFFF,0xFFFB,0x0000,
  710. X    0x0001,0xBFFF,0xFFFB,0x0000,
  711. X    0x0001,0xBFFF,0xFFFB,0x0000,
  712. X    0x0001,0xBFFF,0xFFFB,0x0000,
  713. X    0x0001,0xBFFF,0xFFFB,0x0000,
  714. X    0x0001,0xBFFF,0xFFFB,0x0000,
  715. X    0x0001,0xBFFF,0xFFFB,0x0000,
  716. X    0x0001,0xBFFF,0xFFFB,0x0000,
  717. X    0x0001,0xBFFF,0xFFFB,0x0000,
  718. X    0x0001,0xBFFF,0xFFFB,0x0000,
  719. X    0x0001,0xBFFF,0xFFFB,0x0000,
  720. X    0x0001,0xBFFF,0xFFFB,0x0000,
  721. X    0x0001,0xBFFF,0xFFFB,0x0000,
  722. X    0x0001,0xBFFF,0xFFFB,0x0000,
  723. X    0x0001,0xBFFF,0xFFFB,0x0000,
  724. X    0x0001,0xBFFF,0xFFFB,0x0000,
  725. X    0x0001,0xBFFF,0xFFFB,0x0000,
  726. X    0x0001,0x8000,0x0003,0x0000,
  727. X    0x0001,0xFFFF,0xFFFF,0x0000,
  728. X    0x0000,0xFFFF,0xFFFE,0x0000,
  729. X    0x0000,0x0000,0x0000,0x0000,
  730. X    0x0000,0x0000,0x0000,0x0000,
  731. X    0x000F,0xFFFF,0xFFFF,0xE000,
  732. X    0x0018,0x0000,0x0000,0x3000,
  733. X    0x0031,0x5555,0x5555,0x1800,
  734. X    0x0062,0xAAAA,0xAAAA,0x8C00,
  735. X    0x00C5,0x5555,0x5555,0x4600,
  736. X    0x00C0,0x0000,0x0000,0x0600,
  737. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  738. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  739. X    0x0000,0x0000,0x0000,0x0000,
  740. X    0x0000,0x0000,0x0000,0x0000,
  741. X    0x0000,0x0000,0x0000,0x0000,
  742. X    0x0000,0x0000,0x0000,0x0000,
  743. X    0x0000,0x0000,0x0000,0x0000,
  744. X    0x0000,0x0000,0x0000,0x0000,
  745. X    0x0000,0x0000,0x0000,0x0000,
  746. X    0x0000,0x0000,0x0004,0x0000,
  747. X    0x0000,0x0000,0x0004,0x0000,
  748. X    0x0000,0x0000,0x0004,0x0000,
  749. X    0x000E,0x30B0,0xE184,0x7000,
  750. X    0x0010,0x48C9,0x0244,0x8800,
  751. X    0x0020,0x8489,0x0424,0x8800,
  752. X    0x0020,0x8488,0xC424,0xF800,
  753. X    0x0020,0x8488,0x2424,0x8000,
  754. X    0x0010,0x4888,0x2244,0x8800,
  755. X    0x000E,0x3089,0xC184,0x7000,
  756. X    0x0000,0x0000,0x0000,0x0000,
  757. X    0x0000,0x0000,0x0000,0x0000,
  758. X    0x0000,0x0000,0x0000,0x0000,
  759. X    0x0000,0x0000,0x0000,0x0000,
  760. X    0x0000,0x0000,0x0000,0x0000
  761. END_OF_FILE
  762. if test 1997 -ne `wc -c <'icons/default_bad.icon'`; then
  763.     echo shar: \"'icons/default_bad.icon'\" unpacked with wrong size!
  764. fi
  765. # end of 'icons/default_bad.icon'
  766. fi
  767. if test -f 'icons/default_flash.icon' -a "${1}" != "-c" ; then 
  768.   echo shar: Will not clobber existing file \"'icons/default_flash.icon'\"
  769. else
  770. echo shar: Extracting \"'icons/default_flash.icon'\" \(1997 characters\)
  771. sed "s/^X//" >'icons/default_flash.icon' <<'END_OF_FILE'
  772. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  773. X */
  774. X    0x0000,0x0000,0x0000,0x0000,
  775. X    0x0000,0x0000,0x0000,0x0000,
  776. X    0x0000,0x0000,0x0000,0x0000,
  777. X    0x0000,0x0000,0x0000,0x0000,
  778. X    0x0000,0x0000,0x0000,0x0000,
  779. X    0x0000,0x0000,0x0000,0x0000,
  780. X    0x0000,0x0000,0x0000,0x0000,
  781. X    0x0000,0xFFFF,0xFFFE,0x0000,
  782. X    0x0001,0xFFFF,0xFFFF,0x0000,
  783. X    0x0001,0x8000,0x0003,0x0000,
  784. X    0x0001,0xBFFF,0xFFFB,0x0000,
  785. X    0x0001,0xA000,0x000B,0x0000,
  786. X    0x0001,0xA000,0x000B,0x0000,
  787. X    0x0001,0xA000,0x000B,0x0000,
  788. X    0x0001,0xA000,0x000B,0x0000,
  789. X    0x0001,0xA000,0x000B,0x0000,
  790. X    0x0001,0xA000,0x000B,0x0000,
  791. X    0x0001,0xA000,0x000B,0x0000,
  792. X    0x0001,0xA000,0x000B,0x0000,
  793. X    0x0001,0xA000,0x000B,0x0000,
  794. X    0x0001,0xA000,0x000B,0x0000,
  795. X    0x0001,0xA000,0x000B,0x0000,
  796. X    0x0001,0xA000,0x000B,0x0000,
  797. X    0x0001,0xA000,0x000B,0x0000,
  798. X    0x0001,0xA000,0x000B,0x0000,
  799. X    0x0001,0xA000,0x000B,0x0000,
  800. X    0x0001,0xA000,0x000B,0x0000,
  801. X    0x0001,0xA000,0x000B,0x0000,
  802. X    0x0001,0xBFFF,0xFFFB,0x0000,
  803. X    0x0001,0x8000,0x0003,0x0000,
  804. X    0x0001,0xFFFF,0xFFFF,0x0000,
  805. X    0x0000,0xFFFF,0xFFFE,0x0000,
  806. X    0x0000,0x0000,0x0000,0x0000,
  807. X    0x0000,0x0000,0x0000,0x0000,
  808. X    0x000F,0xFFFF,0xFFFF,0xE000,
  809. X    0x0018,0x0000,0x0000,0x3000,
  810. X    0x0031,0x5555,0x5555,0x1800,
  811. X    0x0062,0xAAAA,0xAAAA,0x8C00,
  812. X    0x00C5,0x5555,0x5555,0x4600,
  813. X    0x00C0,0x0000,0x0000,0x0600,
  814. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  815. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  816. X    0x0000,0x0000,0x0000,0x0000,
  817. X    0x0000,0x0000,0x0000,0x0000,
  818. X    0x0000,0x0000,0x0000,0x0000,
  819. X    0x0000,0x0000,0x0000,0x0000,
  820. X    0x0000,0x0000,0x0000,0x0000,
  821. X    0x0000,0x0000,0x0000,0x0000,
  822. X    0x0000,0x0000,0x0000,0x0000,
  823. X    0x0000,0x0000,0x0004,0x0000,
  824. X    0x0000,0x0000,0x0004,0x0000,
  825. X    0x0000,0x0000,0x0004,0x0000,
  826. X    0x000E,0x30B0,0xE184,0x7000,
  827. X    0x0010,0x48C9,0x0244,0x8800,
  828. X    0x0020,0x8489,0x0424,0x8800,
  829. X    0x0020,0x8488,0xC424,0xF800,
  830. X    0x0020,0x8488,0x2424,0x8000,
  831. X    0x0010,0x4888,0x2244,0x8800,
  832. X    0x000E,0x3089,0xC184,0x7000,
  833. X    0x0000,0x0000,0x0000,0x0000,
  834. X    0x0000,0x0000,0x0000,0x0000,
  835. X    0x0000,0x0000,0x0000,0x0000,
  836. X    0x0000,0x0000,0x0000,0x0000,
  837. X    0x0000,0x0000,0x0000,0x0000
  838. END_OF_FILE
  839. if test 1997 -ne `wc -c <'icons/default_flash.icon'`; then
  840.     echo shar: \"'icons/default_flash.icon'\" unpacked with wrong size!
  841. fi
  842. # end of 'icons/default_flash.icon'
  843. fi
  844. if test -f 'icons/default_good.icon' -a "${1}" != "-c" ; then 
  845.   echo shar: Will not clobber existing file \"'icons/default_good.icon'\"
  846. else
  847. echo shar: Extracting \"'icons/default_good.icon'\" \(1997 characters\)
  848. sed "s/^X//" >'icons/default_good.icon' <<'END_OF_FILE'
  849. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  850. X */
  851. X    0x0000,0x0000,0x0000,0x0000,
  852. X    0x0000,0x0000,0x0000,0x0000,
  853. X    0x0000,0x0000,0x0000,0x0000,
  854. X    0x0000,0x0000,0x0000,0x0000,
  855. X    0x0000,0x0000,0x0000,0x0000,
  856. X    0x0000,0x0000,0x0000,0x0000,
  857. X    0x0000,0x0000,0x0000,0x0000,
  858. X    0x0000,0xFFFF,0xFFFE,0x0000,
  859. X    0x0001,0xFFFF,0xFFFF,0x0000,
  860. X    0x0001,0x8000,0x0003,0x0000,
  861. X    0x0001,0xBFFF,0xFFFB,0x0000,
  862. X    0x0001,0xB555,0x555B,0x0000,
  863. X    0x0001,0xAAAA,0xAAAB,0x0000,
  864. X    0x0001,0xB555,0x555B,0x0000,
  865. X    0x0001,0xAAAA,0xA02B,0x0000,
  866. X    0x0001,0xB555,0x505B,0x0000,
  867. X    0x0001,0xAAAA,0xA02B,0x0000,
  868. X    0x0001,0xB555,0x505B,0x0000,
  869. X    0x0001,0xAAAA,0xA02B,0x0000,
  870. X    0x0001,0xB555,0x555B,0x0000,
  871. X    0x0001,0xAAAA,0xAAAB,0x0000,
  872. X    0x0001,0xB555,0x555B,0x0000,
  873. X    0x0001,0xAAAA,0xAAAB,0x0000,
  874. X    0x0001,0xB555,0x555B,0x0000,
  875. X    0x0001,0xAAAA,0xAAAB,0x0000,
  876. X    0x0001,0xB555,0x555B,0x0000,
  877. X    0x0001,0xAAAA,0xAAAB,0x0000,
  878. X    0x0001,0xB555,0x555B,0x0000,
  879. X    0x0001,0xBFFF,0xFFFB,0x0000,
  880. X    0x0001,0x8000,0x0003,0x0000,
  881. X    0x0001,0xFFFF,0xFFFF,0x0000,
  882. X    0x0000,0xFFFF,0xFFFE,0x0000,
  883. X    0x0000,0x0000,0x0000,0x0000,
  884. X    0x0000,0x0000,0x0000,0x0000,
  885. X    0x000F,0xFFFF,0xFFFF,0xE000,
  886. X    0x0018,0x0000,0x0000,0x3000,
  887. X    0x0031,0x5555,0x5555,0x1800,
  888. X    0x0062,0xAAAA,0xAAAA,0x8C00,
  889. X    0x00C5,0x5555,0x5555,0x4600,
  890. X    0x00C0,0x0000,0x0000,0x0600,
  891. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  892. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  893. X    0x0000,0x0000,0x0000,0x0000,
  894. X    0x0000,0x0000,0x0000,0x0000,
  895. X    0x0000,0x0000,0x0000,0x0000,
  896. X    0x0000,0x0000,0x0000,0x0000,
  897. X    0x0000,0x0000,0x0000,0x0000,
  898. X    0x0000,0x0000,0x0000,0x0000,
  899. X    0x0000,0x0000,0x0000,0x0000,
  900. X    0x0000,0x0000,0x0004,0x0000,
  901. X    0x0000,0x0000,0x0004,0x0000,
  902. X    0x0000,0x0000,0x0004,0x0000,
  903. X    0x000E,0x30B0,0xE184,0x7000,
  904. X    0x0010,0x48C9,0x0244,0x8800,
  905. X    0x0020,0x8489,0x0424,0x8800,
  906. X    0x0020,0x8488,0xC424,0xF800,
  907. X    0x0020,0x8488,0x2424,0x8000,
  908. X    0x0010,0x4888,0x2244,0x8800,
  909. X    0x000E,0x3089,0xC184,0x7000,
  910. X    0x0000,0x0000,0x0000,0x0000,
  911. X    0x0000,0x0000,0x0000,0x0000,
  912. X    0x0000,0x0000,0x0000,0x0000,
  913. X    0x0000,0x0000,0x0000,0x0000,
  914. X    0x0000,0x0000,0x0000,0x0000
  915. END_OF_FILE
  916. if test 1997 -ne `wc -c <'icons/default_good.icon'`; then
  917.     echo shar: \"'icons/default_good.icon'\" unpacked with wrong size!
  918. fi
  919. # end of 'icons/default_good.icon'
  920. fi
  921. if test -f 'icons/mask.icon' -a "${1}" != "-c" ; then 
  922.   echo shar: Will not clobber existing file \"'icons/mask.icon'\"
  923. else
  924. echo shar: Extracting \"'icons/mask.icon'\" \(1997 characters\)
  925. sed "s/^X//" >'icons/mask.icon' <<'END_OF_FILE'
  926. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  927. X */
  928. X    0x0000,0x0000,0x0000,0x0000,
  929. X    0x0000,0x0000,0x0000,0x0000,
  930. X    0x0000,0x0000,0x0000,0x0000,
  931. X    0x0000,0x0000,0x0000,0x0000,
  932. X    0x0000,0x0000,0x0000,0x0000,
  933. X    0x0000,0x0000,0x0000,0x0000,
  934. X    0x0000,0x0000,0x0000,0x0000,
  935. X    0x0000,0xFFFF,0xFFFE,0x0000,
  936. X    0x0001,0xFFFF,0xFFFF,0x0000,
  937. X    0x0001,0xFFFF,0xFFFF,0x0000,
  938. X    0x0001,0xFFFF,0xFFFF,0x0000,
  939. X    0x0001,0xFFFF,0xFFFF,0x0000,
  940. X    0x0001,0xFFFF,0xFFFF,0x0000,
  941. X    0x0001,0xFFFF,0xFFFF,0x0000,
  942. X    0x0001,0xFFFF,0xFFFF,0x0000,
  943. X    0x0001,0xFFFF,0xFFFF,0x0000,
  944. X    0x0001,0xFFFF,0xFFFF,0x0000,
  945. X    0x0001,0xFFFF,0xFFFF,0x0000,
  946. X    0x0001,0xFFFF,0xFFFF,0x0000,
  947. X    0x0001,0xFFFF,0xFFFF,0x0000,
  948. X    0x0001,0xFFFF,0xFFFF,0x0000,
  949. X    0x0001,0xFFFF,0xFFFF,0x0000,
  950. X    0x0001,0xFFFF,0xFFFF,0x0000,
  951. X    0x0001,0xFFFF,0xFFFF,0x0000,
  952. X    0x0001,0xFFFF,0xFFFF,0x0000,
  953. X    0x0001,0xFFFF,0xFFFF,0x0000,
  954. X    0x0001,0xFFFF,0xFFFF,0x0000,
  955. X    0x0001,0xFFFF,0xFFFF,0x0000,
  956. X    0x0001,0xFFFF,0xFFFF,0x0000,
  957. X    0x0001,0xFFFF,0xFFFF,0x0000,
  958. X    0x0001,0xFFFF,0xFFFF,0x0000,
  959. X    0x0000,0xFFFF,0xFFFE,0x0000,
  960. X    0x0000,0x0000,0x0000,0x0000,
  961. X    0x0000,0x0000,0x0000,0x0000,
  962. X    0x000F,0xFFFF,0xFFFF,0xE000,
  963. X    0x001F,0xFFFF,0xFFFF,0xF000,
  964. X    0x003F,0xFFFF,0xFFFF,0xF800,
  965. X    0x007F,0xFFFF,0xFFFF,0xFC00,
  966. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  967. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  968. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  969. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  970. X    0x0000,0x0000,0x0000,0x0000,
  971. X    0x0000,0x0000,0x0000,0x0000,
  972. X    0x0000,0x0000,0x0000,0x0000,
  973. X    0x0000,0x0000,0x0000,0x0000,
  974. X    0x0000,0x0000,0x0000,0x0000,
  975. X    0x0000,0x0000,0x0000,0x0000,
  976. X    0x0000,0x0000,0x0000,0x0000,
  977. X    0x0000,0x0000,0x0004,0x0000,
  978. X    0x0000,0x0000,0x0004,0x0000,
  979. X    0x0000,0x0000,0x0004,0x0000,
  980. X    0x000E,0x30B0,0xE184,0x7000,
  981. X    0x0010,0x48C9,0x0244,0x8800,
  982. X    0x0020,0x8489,0x0424,0x8800,
  983. X    0x0020,0x8488,0xC424,0xF800,
  984. X    0x0020,0x8488,0x2424,0x8000,
  985. X    0x0010,0x4888,0x2244,0x8800,
  986. X    0x000E,0x3089,0xC184,0x7000,
  987. X    0x0000,0x0000,0x0000,0x0000,
  988. X    0x0000,0x0000,0x0000,0x0000,
  989. X    0x0000,0x0000,0x0000,0x0000,
  990. X    0x0000,0x0000,0x0000,0x0000,
  991. X    0x0000,0x0000,0x0000,0x0000
  992. END_OF_FILE
  993. if test 1997 -ne `wc -c <'icons/mask.icon'`; then
  994.     echo shar: \"'icons/mask.icon'\" unpacked with wrong size!
  995. fi
  996. # end of 'icons/mask.icon'
  997. fi
  998. if test -f 'images/empty.icon' -a "${1}" != "-c" ; then 
  999.   echo shar: Will not clobber existing file \"'images/empty.icon'\"
  1000. else
  1001. echo shar: Extracting \"'images/empty.icon'\" \(193 characters\)
  1002. sed "s/^X//" >'images/empty.icon' <<'END_OF_FILE'
  1003. X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
  1004. X */
  1005. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1006. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  1007. END_OF_FILE
  1008. if test 193 -ne `wc -c <'images/empty.icon'`; then
  1009.     echo shar: \"'images/empty.icon'\" unpacked with wrong size!
  1010. fi
  1011. # end of 'images/empty.icon'
  1012. fi
  1013. if test -f 'images/range.icon' -a "${1}" != "-c" ; then 
  1014.   echo shar: Will not clobber existing file \"'images/range.icon'\"
  1015. else
  1016. echo shar: Extracting \"'images/range.icon'\" \(193 characters\)
  1017. sed "s/^X//" >'images/range.icon' <<'END_OF_FILE'
  1018. X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
  1019. X */
  1020. X    0x9440,0xBF68,0x0000,0x8000,0xF6DE,0x0000,0x8A22,0xDFBB,
  1021. X    0x0000,0xA100,0xBBB6,0x0000,0x8824,0xEDB7,0x0000,0x0000
  1022. END_OF_FILE
  1023. if test 193 -ne `wc -c <'images/range.icon'`; then
  1024.     echo shar: \"'images/range.icon'\" unpacked with wrong size!
  1025. fi
  1026. # end of 'images/range.icon'
  1027. fi
  1028. if test -f 'images/single.icon' -a "${1}" != "-c" ; then 
  1029.   echo shar: Will not clobber existing file \"'images/single.icon'\"
  1030. else
  1031. echo shar: Extracting \"'images/single.icon'\" \(193 characters\)
  1032. sed "s/^X//" >'images/single.icon' <<'END_OF_FILE'
  1033. X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
  1034. X */
  1035. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x8A22,0xDFBB,
  1036. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  1037. END_OF_FILE
  1038. if test 193 -ne `wc -c <'images/single.icon'`; then
  1039.     echo shar: \"'images/single.icon'\" unpacked with wrong size!
  1040. fi
  1041. # end of 'images/single.icon'
  1042. fi
  1043. if test -f 'load_icon.c' -a "${1}" != "-c" ; then 
  1044.   echo shar: Will not clobber existing file \"'load_icon.c'\"
  1045. else
  1046. echo shar: Extracting \"'load_icon.c'\" \(2201 characters\)
  1047. sed "s/^X//" >'load_icon.c' <<'END_OF_FILE'
  1048. X/************************************************************************/
  1049. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  1050. X/*                                    */
  1051. X/*    Full ownership of this software, and all rights pertaining to     */
  1052. X/*    the for-profit distribution of this software, are retained by     */
  1053. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  1054. X/*    use this software without fee.  This software is provided "as     */
  1055. X/*    is" without express or implied warranty.  You may redistribute     */
  1056. X/*    this software, provided that this copyright notice is retained,    */
  1057. X/*    and that the software is not distributed for profit.  If you     */
  1058. X/*    wish to use this software in a profit-making venture, you must     */
  1059. X/*    first license this code and its underlying technology from     */
  1060. X/*    Harris Corporation.                         */
  1061. X/*                                    */
  1062. X/*    Bottom line: you can have this software, you can use it, you     */
  1063. X/*    can give it away.  You just can't sell any or all parts of it     */
  1064. X/*    without prior permission from Harris Corporation.         */
  1065. X/************************************************************************/
  1066. X
  1067. X#include    <stdio.h>
  1068. X#include    <sys/file.h>
  1069. X
  1070. X#include    <xview/xview.h>
  1071. X#include    <xview/icon_load.h>
  1072. X
  1073. X#include    "manifest.h"
  1074. X
  1075. X#if !defined(ICON_PATH)
  1076. X#define        ICON_PATH        ".:./icons:/usr/local/images:/usr/include/images"
  1077. X#endif
  1078. X
  1079. XPUBLIC    char    *getenv(), *index();
  1080. X
  1081. X/************************************************************************/
  1082. XEXPORT    Server_image    load_icon(path, message)
  1083. X
  1084. Xchar    *path;
  1085. Xchar    *message;
  1086. X
  1087. X{    char    *icon_path, new_path[1024], *p, *q;
  1088. X
  1089. X    if (*path == '/')
  1090. X       return(icon_load_svrim(path, message));
  1091. X    else {
  1092. X       if ((p = getenv("ICON_PATH")) != NULL)
  1093. X          icon_path = strsave(p);
  1094. X       else
  1095. X          icon_path = strsave(ICON_PATH);
  1096. X       for (p = icon_path; *p; ) {
  1097. X          if (q = index(p, ':'))
  1098. X             *q = '\0';
  1099. X          strcpy(new_path, p);
  1100. X          strcat(new_path, "/");
  1101. X          strcat(new_path, path);
  1102. X          if (access(new_path, R_OK) == 0) {
  1103. X             free(icon_path);
  1104. X             return(icon_load_svrim(new_path, message));
  1105. X             }
  1106. X          else if (q != NULL)
  1107. X             p = q + 1;
  1108. X          else
  1109. X             break;
  1110. X          }
  1111. X       free(icon_path);
  1112. X       return(icon_load_svrim(path, message));
  1113. X       }
  1114. X}
  1115. END_OF_FILE
  1116. if test 2201 -ne `wc -c <'load_icon.c'`; then
  1117.     echo shar: \"'load_icon.c'\" unpacked with wrong size!
  1118. fi
  1119. # end of 'load_icon.c'
  1120. fi
  1121. if test -f 'logging.c' -a "${1}" != "-c" ; then 
  1122.   echo shar: Will not clobber existing file \"'logging.c'\"
  1123. else
  1124. echo shar: Extracting \"'logging.c'\" \(4060 characters\)
  1125. sed "s/^X//" >'logging.c' <<'END_OF_FILE'
  1126. X/************************************************************************/
  1127. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  1128. X/*                                    */
  1129. X/*    Full ownership of this software, and all rights pertaining to     */
  1130. X/*    the for-profit distribution of this software, are retained by     */
  1131. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  1132. X/*    use this software without fee.  This software is provided "as     */
  1133. X/*    is" without express or implied warranty.  You may redistribute     */
  1134. X/*    this software, provided that this copyright notice is retained,    */
  1135. X/*    and that the software is not distributed for profit.  If you     */
  1136. X/*    wish to use this software in a profit-making venture, you must     */
  1137. X/*    first license this code and its underlying technology from     */
  1138. X/*    Harris Corporation.                         */
  1139. X/*                                    */
  1140. X/*    Bottom line: you can have this software, you can use it, you     */
  1141. X/*    can give it away.  You just can't sell any or all parts of it     */
  1142. X/*    without prior permission from Harris Corporation.         */
  1143. X/************************************************************************/
  1144. X
  1145. X/************************************************************************/
  1146. X/*                                    */
  1147. X/*    logging.c    message log management                */
  1148. X/*                                    */
  1149. X/************************************************************************/
  1150. X
  1151. X#include    <stdio.h>
  1152. X#include    <sys/param.h>
  1153. X#include    <sys/types.h>
  1154. X#include    <xview/xview.h>
  1155. X#include    <xview/panel.h>
  1156. X#include    <xview/xv_xrect.h>
  1157. X
  1158. X#include    "manifest.h"
  1159. X#include    "contool.h"
  1160. X#include    "contool_ui.h"
  1161. X
  1162. XPUBLIC    Menu_item    start_logging();
  1163. XPUBLIC    Menu_item    stop_logging();
  1164. X
  1165. XPUBLIC    contool_base_objects    *contool_base;
  1166. X
  1167. XPRIVATE    int    logging = FALSE;
  1168. XPRIVATE    FILE    *logfile = NULL;
  1169. XPRIVATE    char    *log_path = NULL;
  1170. X
  1171. X/************************************************************************/
  1172. XEXPORT    void    disable_logging()
  1173. X
  1174. X{
  1175. X    if (logging) {
  1176. X       fclose(logfile);
  1177. X       cond_free(log_path);
  1178. X       log_path = NULL;
  1179. X       logging = FALSE;
  1180. X       }
  1181. X    xv_set(contool_base->base, FRAME_RIGHT_FOOTER, "", NULL);
  1182. X}
  1183. X
  1184. X/************************************************************************/
  1185. XEXPORT    void    enable_logging()
  1186. X
  1187. X{    char    buf[1024];
  1188. X
  1189. X    if (logging) {
  1190. X       if (log_path && strcmp(log_path, defaults.log_file) == 0)
  1191. X          return;
  1192. X       disable_logging();
  1193. X       }
  1194. X    if (is_empty(defaults.log_file))
  1195. X       error("You must specify a log file in the Properties dialog");
  1196. X    else if ((logfile = fopen(defaults.log_file, "a")) == NULL)
  1197. X       error("Cannot open log file %s : %s", defaults.log_file, sys_errlist[errno]);
  1198. X    else {
  1199. X       logging = TRUE;
  1200. X       log_path = strsave(defaults.log_file);
  1201. X       sprintf(buf, "Logging to %s...", defaults.log_file);
  1202. X       xv_set(contool_base->base, FRAME_RIGHT_FOOTER, buf, NULL);
  1203. X       }
  1204. X}
  1205. X
  1206. X/************************************************************************/
  1207. XEXPORT    Menu_item    start_logging(item, op)
  1208. X
  1209. XMenu_item    item;
  1210. XMenu_generate    op;
  1211. X
  1212. X{    contool_base_objects    *ip = (contool_base_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1213. X
  1214. X    if (op == MENU_DISPLAY)
  1215. X       xv_set(item, MENU_INACTIVE, logging, NULL);
  1216. X    else if (op == MENU_NOTIFY)
  1217. X       enable_logging();
  1218. X    return item;
  1219. X}
  1220. X
  1221. X/************************************************************************/
  1222. XEXPORT    Menu_item    stop_logging(item, op)
  1223. X
  1224. XMenu_item    item;
  1225. XMenu_generate    op;
  1226. X
  1227. X{    contool_base_objects    *ip = (contool_base_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1228. X    
  1229. X    if (op == MENU_DISPLAY)
  1230. X       xv_set(item, MENU_INACTIVE, !logging, NULL);
  1231. X    else if (op == MENU_NOTIFY)
  1232. X       disable_logging();
  1233. X    return item;
  1234. X}
  1235. X
  1236. X/************************************************************************/
  1237. XEXPORT    update_logging()
  1238. X
  1239. X{
  1240. X    if (logging) {
  1241. X       disable_logging();
  1242. X       enable_logging();
  1243. X       }
  1244. X}
  1245. X
  1246. X/************************************************************************/
  1247. XEXPORT    write_log(s)
  1248. X
  1249. Xchar    *s;
  1250. X
  1251. X{    int    t;
  1252. X    static    char    hostname[100] = "";
  1253. X
  1254. X    if (logging) {
  1255. X       if (*hostname == NULL) 
  1256. X          if (gethostname(hostname, 99) != 0)
  1257. X             strcpy(hostname, "(unknown)");
  1258. X       t = time(0);
  1259. X       fseek(logfile, 0L, 2);
  1260. X       fprintf(logfile, "%s\t%.16s\t%s", hostname, ctime(&t) + 4, s);
  1261. X       fflush(logfile);
  1262. X       }
  1263. X}
  1264. END_OF_FILE
  1265. if test 4060 -ne `wc -c <'logging.c'`; then
  1266.     echo shar: \"'logging.c'\" unpacked with wrong size!
  1267. fi
  1268. # end of 'logging.c'
  1269. fi
  1270. if test -f 'manifest.h' -a "${1}" != "-c" ; then 
  1271.   echo shar: Will not clobber existing file \"'manifest.h'\"
  1272. else
  1273. echo shar: Extracting \"'manifest.h'\" \(1749 characters\)
  1274. sed "s/^X//" >'manifest.h' <<'END_OF_FILE'
  1275. X/************************************************************************/
  1276. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  1277. X/*                                    */
  1278. X/*    Full ownership of this software, and all rights pertaining to     */
  1279. X/*    the for-profit distribution of this software, are retained by     */
  1280. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  1281. X/*    use this software without fee.  This software is provided "as     */
  1282. X/*    is" without express or implied warranty.  You may redistribute     */
  1283. X/*    this software, provided that this copyright notice is retained,    */
  1284. X/*    and that the software is not distributed for profit.  If you     */
  1285. X/*    wish to use this software in a profit-making venture, you must     */
  1286. X/*    first license this code and its underlying technology from     */
  1287. X/*    Harris Corporation.                         */
  1288. X/*                                    */
  1289. X/*    Bottom line: you can have this software, you can use it, you     */
  1290. X/*    can give it away.  You just can't sell any or all parts of it     */
  1291. X/*    without prior permission from Harris Corporation.         */
  1292. X/************************************************************************/
  1293. X
  1294. X/************************************************************************/
  1295. X/*                                    */
  1296. X/*    manifest.h    simple manifest constants            */
  1297. X/*                                    */
  1298. X/************************************************************************/
  1299. X
  1300. X#define        TRUE            1
  1301. X#define        FALSE            0
  1302. X
  1303. X#define        PRIVATE            static
  1304. X#define        PUBLIC            extern
  1305. X#define        EXPORT
  1306. X
  1307. X#ifndef    NULL
  1308. X#define        NULL            0
  1309. X#endif
  1310. X
  1311. X#if !defined(ICON_PATH)
  1312. X#define        ICON_PATH        ".:./icons:/usr/local/images:/usr/include/images"
  1313. X#endif
  1314. X
  1315. X#define        strsave(x)        (((x) == NULL)? NULL : (char *) strcpy((char *) malloc(strlen(x) + 1), x))
  1316. X#define        cond_free(x)        ((x)? free(x) : 0)
  1317. X
  1318. XPUBLIC    int    errno;
  1319. XPUBLIC    char    *sys_errlist[];
  1320. END_OF_FILE
  1321. if test 1749 -ne `wc -c <'manifest.h'`; then
  1322.     echo shar: \"'manifest.h'\" unpacked with wrong size!
  1323. fi
  1324. # end of 'manifest.h'
  1325. fi
  1326. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  1327.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  1328. else
  1329. echo shar: Extracting \"'patchlevel.h'\" \(2060 characters\)
  1330. sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  1331. X/************************************************************************/
  1332. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  1333. X/*                                    */
  1334. X/*    Full ownership of this software, and all rights pertaining to     */
  1335. X/*    the for-profit distribution of this software, are retained by     */
  1336. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  1337. X/*    use this software without fee.  This software is provided "as     */
  1338. X/*    is" without express or implied warranty.  You may redistribute     */
  1339. X/*    this software, provided that this copyright notice is retained,    */
  1340. X/*    and that the software is not distributed for profit.  If you     */
  1341. X/*    wish to use this software in a profit-making venture, you must     */
  1342. X/*    first license this code and its underlying technology from     */
  1343. X/*    Harris Corporation.                         */
  1344. X/*                                    */
  1345. X/*    Bottom line: you can have this software, you can use it, you     */
  1346. X/*    can give it away.  You just can't sell any or all parts of it     */
  1347. X/*    without prior permission from Harris Corporation.         */
  1348. X/************************************************************************/
  1349. X
  1350. X/************************************************************************/
  1351. X/*                                    */
  1352. X/*    Patch        Comments                    */
  1353. X/*      0        Initial release for XView            */
  1354. X/*               comp.sources.x: Volume 10, Issues 34-39    */
  1355. X/*                                    */
  1356. X/*      1        Bug fixes; see README for details        */
  1357. X/*               comp.sources.x: Volume 10, Issue 40        */
  1358. X/*                                    */
  1359. X/*      2        Bug fixes; see README for details        */
  1360. X/*               comp.sources.x: Volume 10, Issue 78        */
  1361. X/*                                    */
  1362. X/*      3        Bug fixes; see README for details        */
  1363. X/*               comp.sources.x: Volume 11, Issue 4        */
  1364. X/*                                    */
  1365. X/*      4        Release of version 3.1; see README for details    */
  1366. X/*               comp.sources.x: Volume 13, Issues 54 & 55    */
  1367. X/*                                    */
  1368. X/*      5        Bug fixes; see README for details        */
  1369. X/*               comp.sources.x: Volume 14, Issue 4        */
  1370. X/*                                    */
  1371. X/*      6        Release of version 3.2; see README for details    */
  1372. X/*               comp.sources.x: Volume ?, Issue ?        */
  1373. X/*                                    */
  1374. X/************************************************************************/
  1375. END_OF_FILE
  1376. if test 2060 -ne `wc -c <'patchlevel.h'`; then
  1377.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  1378. fi
  1379. # end of 'patchlevel.h'
  1380. fi
  1381. if test -f 'pinned_menu_notify.c' -a "${1}" != "-c" ; then 
  1382.   echo shar: Will not clobber existing file \"'pinned_menu_notify.c'\"
  1383. else
  1384. echo shar: Extracting \"'pinned_menu_notify.c'\" \(2118 characters\)
  1385. sed "s/^X//" >'pinned_menu_notify.c' <<'END_OF_FILE'
  1386. X/************************************************************************/
  1387. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  1388. X/*                                    */
  1389. X/*    Full ownership of this software, and all rights pertaining to     */
  1390. X/*    the for-profit distribution of this software, are retained by     */
  1391. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  1392. X/*    use this software without fee.  This software is provided "as     */
  1393. X/*    is" without express or implied warranty.  You may redistribute     */
  1394. X/*    this software, provided that this copyright notice is retained,    */
  1395. X/*    and that the software is not distributed for profit.  If you     */
  1396. X/*    wish to use this software in a profit-making venture, you must     */
  1397. X/*    first license this code and its underlying technology from     */
  1398. X/*    Harris Corporation.                         */
  1399. X/*                                    */
  1400. X/*    Bottom line: you can have this software, you can use it, you     */
  1401. X/*    can give it away.  You just can't sell any or all parts of it     */
  1402. X/*    without prior permission from Harris Corporation.         */
  1403. X/************************************************************************/
  1404. X
  1405. X/************************************************************************/
  1406. X/*                                    */
  1407. X/*    pinned_menu_notify.c    GUIDE callback for pinned menus        */
  1408. X/*                                    */
  1409. X/************************************************************************/
  1410. X
  1411. X#include    <stdio.h>
  1412. X#include    <sys/param.h>
  1413. X#include    <sys/types.h>
  1414. X#include    <xview/xview.h>
  1415. X
  1416. X#include    "manifest.h"
  1417. X
  1418. X/************************************************************************/
  1419. XEXPORT    void    pinned_menu_notify(menu, item)
  1420. X
  1421. XMenu        menu;
  1422. XMenu_item    item;
  1423. X
  1424. X{    Xv_opaque    pin_window     = (Xv_opaque) xv_get(menu, MENU_PIN_WINDOW);
  1425. X    void        (*menu_notify)() = (void (*)()) xv_get(menu, MENU_GEN_PROC);
  1426. X    void        (*item_notify)() = (void (*)()) xv_get(item, MENU_GEN_PROC);
  1427. X    
  1428. X    if (pin_window && xv_get(pin_window, XV_SHOW)) {
  1429. X       if (menu_notify)
  1430. X          (*menu_notify)(menu, MENU_NOTIFY);
  1431. X       if (item_notify)
  1432. X          (*item_notify)(item, MENU_NOTIFY);
  1433. X       if (item_notify)
  1434. X          (*item_notify)(item, MENU_NOTIFY_DONE);
  1435. X       if (menu_notify)
  1436. X          (*menu_notify)(menu, MENU_NOTIFY_DONE);
  1437. X    }
  1438. X}
  1439. END_OF_FILE
  1440. if test 2118 -ne `wc -c <'pinned_menu_notify.c'`; then
  1441.     echo shar: \"'pinned_menu_notify.c'\" unpacked with wrong size!
  1442. fi
  1443. # end of 'pinned_menu_notify.c'
  1444. fi
  1445. if test -f 'regexp.c' -a "${1}" != "-c" ; then 
  1446.   echo shar: Will not clobber existing file \"'regexp.c'\"
  1447. else
  1448. echo shar: Extracting \"'regexp.c'\" \(3963 characters\)
  1449. sed "s/^X//" >'regexp.c' <<'END_OF_FILE'
  1450. X/************************************************************************/
  1451. X/*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  1452. X/*                                    */
  1453. X/*    Full ownership of this software, and all rights pertaining to     */
  1454. X/*    the for-profit distribution of this software, are retained by     */
  1455. X/*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  1456. X/*    use this software without fee.  This software is provided "as     */
  1457. X/*    is" without express or implied warranty.  You may redistribute     */
  1458. X/*    this software, provided that this copyright notice is retained,    */
  1459. X/*    and that the software is not distributed for profit.  If you     */
  1460. X/*    wish to use this software in a profit-making venture, you must     */
  1461. X/*    first license this code and its underlying technology from     */
  1462. X/*    Harris Corporation.                         */
  1463. X/*                                    */
  1464. X/*    Bottom line: you can have this software, you can use it, you     */
  1465. X/*    can give it away.  You just can't sell any or all parts of it     */
  1466. X/*    without prior permission from Harris Corporation.         */
  1467. X/************************************************************************/
  1468. X
  1469. X#include    <stdio.h>
  1470. X
  1471. X#include    "manifest.h"
  1472. X#include    "contool.h"
  1473. X
  1474. XPRIVATE    regexp_error();
  1475. X
  1476. X#define        INIT            register char *expbuf = ep, *sp = instring;
  1477. X#define        GETC()            (*sp++)
  1478. X#define        PEEKC()            (*sp)
  1479. X#define        UNGETC(c)        (--sp)
  1480. X#define        RETURN(p)        {bcopy(expbuf, sp = (char *) malloc(p - expbuf), p - expbuf); return(sp);}
  1481. X#define        ERROR(val)        {regexp_error(val, instring); return(NULL);}
  1482. X
  1483. X#include    <regexp.h>
  1484. X
  1485. XPRIVATE    char    error_message[512];
  1486. X
  1487. X/************************************************************************/
  1488. XEXPORT    int    match_exp(exp, circ, str)
  1489. X
  1490. Xchar    *exp;
  1491. Xint    circ;
  1492. Xchar    *str;
  1493. X
  1494. X{    char    *p;
  1495. X    int    result;
  1496. X
  1497. X    p = str + strlen(str) - 1;
  1498. X    if (p >= str && *p == '\n')
  1499. X       *p = '\0';
  1500. X    circf = circ;
  1501. X    result = step(str, exp);
  1502. X    if (p >= str && *p == '\0')
  1503. X       *p = '\n';
  1504. X    return(result);
  1505. X}
  1506. X
  1507. X/************************************************************************/
  1508. XPRIVATE    regexp_error(val, string)
  1509. X
  1510. Xint    val;
  1511. Xchar    *string;
  1512. X
  1513. X{    char    *msg;
  1514. X
  1515. X    switch (val) {
  1516. X       case 11 : msg = "range endpoint too large";
  1517. X       case 16 : msg = "bad number";
  1518. X       case 25 : msg = "\"\\digit\" out of range";
  1519. X       case 36 : msg = "illegal or missing delimiter";
  1520. X       case 41 : msg = "no remembered search string";
  1521. X       case 42 : msg = "\\(\\) imbalance";
  1522. X       case 43 : msg = "too many \\(";
  1523. X       case 44 : msg = "more than 2 numbers given in \\{\\}";
  1524. X       case 45 : msg = "} expected after \\";
  1525. X       case 46 : msg = "first number exceeds second in \\{\\}";
  1526. X       case 49 : msg = "[] imbalance";
  1527. X       case 50 : msg = "regular expression overflow";
  1528. X       default : msg = "regular expression error";
  1529. X       }
  1530. X    sprintf(error_message, "%s in %s", msg, string);
  1531. X}
  1532. X
  1533. X/************************************************************************/
  1534. XPRIVATE    char    *fix_control_chars(s)
  1535. X
  1536. Xchar    *s;
  1537. X
  1538. X{    static    char    buf[2048];
  1539. X    char    *p;
  1540. X
  1541. X    for (p = buf; *s; s++, p++)
  1542. X       if (*s == '\\' && *(s + 1) >= '0' && *(s + 1) <= '7') {
  1543. X          for (*p = 0, s++; *s && *s >= '0' && *s <= '7'; s++)
  1544. X             *p = (*p << 3) + *s - '0';
  1545. X          s--;
  1546. X          }
  1547. X       else
  1548. X          *p = *s;
  1549. X    *p = '\0';
  1550. X    return(buf);
  1551. X}
  1552. X
  1553. X/************************************************************************/
  1554. XEXPORT    char    *compile_exp(filter, start, stop)
  1555. X
  1556. XFilter    *filter;
  1557. Xchar    *start;
  1558. Xchar    *stop;
  1559. X
  1560. X{    char    rbuf[1024], *sre, *ere;
  1561. X    int    sc, ec;
  1562. X
  1563. X    sre = ere = NULL;
  1564. X    if (start) {
  1565. X       if ((sre = compile(fix_control_chars(start), rbuf, rbuf+1024, '\0')) == NULL)
  1566. X          return(error_message);
  1567. X       sc = circf;
  1568. X       }
  1569. X    if (stop) {
  1570. X       if ((ere = compile(fix_control_chars(stop), rbuf, rbuf+1024, '\0')) == NULL) {
  1571. X          cond_free(sre);
  1572. X          return(error_message);
  1573. X          }
  1574. X       ec = circf;
  1575. X       }
  1576. X    if (filter) {
  1577. X       filter->start = start;
  1578. X       filter->stop = stop;
  1579. X       filter->start_re = sre;
  1580. X       filter->stop_re = ere;
  1581. X       filter->start_circf = sc;
  1582. X       filter->stop_circf = ec;
  1583. X       }
  1584. X    else {
  1585. X       cond_free(sre);
  1586. X       if (ere)
  1587. X          cond_free(ere);
  1588. X       }
  1589. X    return(NULL);
  1590. X}
  1591. END_OF_FILE
  1592. if test 3963 -ne `wc -c <'regexp.c'`; then
  1593.     echo shar: \"'regexp.c'\" unpacked with wrong size!
  1594. fi
  1595. # end of 'regexp.c'
  1596. fi
  1597. if test -f 'sample.filter' -a "${1}" != "-c" ; then 
  1598.   echo shar: Will not clobber existing file \"'sample.filter'\"
  1599. else
  1600. echo shar: Extracting \"'sample.filter'\" \(2556 characters\)
  1601. sed "s/^X//" >'sample.filter' <<'END_OF_FILE'
  1602. Xversion 320
  1603. Xdefaults {
  1604. X   beep                 3
  1605. X   command              ""
  1606. X   flash                yes
  1607. X   log                  yes
  1608. X   open                 no
  1609. X   stamp                yes
  1610. X   archive              0
  1611. X   good_icon            ""
  1612. X   check_icon           ""
  1613. X   flash_icon           ""
  1614. X   print                "lpr"
  1615. X   log_file             ""
  1616. X   log_before_filtering no
  1617. X   timestamp            10
  1618. X   display              32768
  1619. X   delete               1024
  1620. X}
  1621. Xfilters {
  1622. X   {
  1623. X      match   "su: chuck"
  1624. X      comment "Track myself becoming super user"
  1625. X      ignore  no
  1626. X      beep    0
  1627. X      command ""
  1628. X      flash   no
  1629. X      log     yes
  1630. X      open    no
  1631. X      stamp   yes
  1632. X   }
  1633. X   {
  1634. X      match   "su:"
  1635. X      comment "Get excited about anyone else becoming superuser"
  1636. X      ignore  no
  1637. X      beep    4
  1638. X      command ""
  1639. X      flash   no
  1640. X      log     yes
  1641. X      open    yes
  1642. X      stamp   yes
  1643. X   }
  1644. X   {
  1645. X      match   "Window data lock"
  1646. X      to      "The offending process"
  1647. X      timeout 30
  1648. X      comment "Ignore spurious window system messages"
  1649. X      ignore  yes
  1650. X   }
  1651. X   {
  1652. X      match   "win ioctl number"
  1653. X      comment "Ignore spurious window system messages"
  1654. X      ignore  no
  1655. X      beep    0
  1656. X      command ""
  1657. X      flash   no
  1658. X      log     yes
  1659. X      open    no
  1660. X      stamp   yes
  1661. X   }
  1662. X   {
  1663. X      match   "A tty window"
  1664. X      to      "Its child"
  1665. X      timeout 30
  1666. X      comment "Ignore spurious window system messages"
  1667. X      ignore  no
  1668. X      beep    0
  1669. X      command ""
  1670. X      flash   no
  1671. X      log     yes
  1672. X      open    no
  1673. X      stamp   yes
  1674. X   }
  1675. X   {
  1676. X      match   "Too large a window number"
  1677. X      comment "Ignore spurious window system messages"
  1678. X      ignore  yes
  1679. X   }
  1680. X   {
  1681. X      match   "NFS server"
  1682. X      comment "Track NFS server message"
  1683. X      ignore  no
  1684. X      beep    0
  1685. X      command ""
  1686. X      flash   no
  1687. X      log     yes
  1688. X      open    no
  1689. X      stamp   yes
  1690. X   }
  1691. X   {
  1692. X      match   "yp:"
  1693. X      comment "Track YP server problems"
  1694. X      ignore  no
  1695. X      beep    0
  1696. X      command ""
  1697. X      flash   no
  1698. X      log     yes
  1699. X      open    no
  1700. X      stamp   yes
  1701. X   }
  1702. X   {
  1703. X      match   "/usr/local/frame"
  1704. X      comment "Ignore various noisy Frame messages"
  1705. X      ignore  yes
  1706. X   }
  1707. X   {
  1708. X      match   "starting maker"
  1709. X      to      "maker: Finished"
  1710. X      timeout 120
  1711. X      comment "Ignore various noisy Frame messages"
  1712. X      ignore  yes
  1713. X   }
  1714. X   {
  1715. X      match   "maker:"
  1716. X      comment "Ignore various noisy Frame messages"
  1717. X      ignore  yes
  1718. X   }
  1719. X   {
  1720. X      match   "fmprintdriver.ps: Using"
  1721. X      comment "Ignore various noisy Frame messages"
  1722. X      ignore  yes
  1723. X   }
  1724. X}
  1725. END_OF_FILE
  1726. if test 2556 -ne `wc -c <'sample.filter'`; then
  1727.     echo shar: \"'sample.filter'\" unpacked with wrong size!
  1728. fi
  1729. # end of 'sample.filter'
  1730. fi
  1731. echo shar: End of archive 5 \(of 5\).
  1732. cp /dev/null ark5isdone
  1733. MISSING=""
  1734. for I in 1 2 3 4 5 ; do
  1735.     if test ! -f ark${I}isdone ; then
  1736.     MISSING="${MISSING} ${I}"
  1737.     fi
  1738. done
  1739. if test "${MISSING}" = "" ; then
  1740.     echo You have unpacked all 5 archives.
  1741.     rm -f ark[1-9]isdone
  1742. else
  1743.     echo You still need to unpack the following archives:
  1744.     echo "        " ${MISSING}
  1745. fi
  1746. ##  End of shell archive.
  1747. exit 0
  1748.