home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8708 / 13 < prev    next >
Encoding:
Internet Message Format  |  1990-07-13  |  25.6 KB

  1. From: matt@srs.UUCP (Matt Goheen)
  2. Newsgroups: comp.sources.misc
  3. Subject: Wasting time on a Sun3 (suntool that plots a graph)
  4. Message-ID: <4161@ncoast.UUCP>
  5. Date: 13 Aug 87 13:55:36 GMT
  6. Sender: allbery@ncoast.UUCP
  7. Lines: 693
  8. Approved: allbery@ncoast.UUCP
  9. X-Archive: comp.sources.misc/8708/13
  10.  
  11. Here is a little program I cooked up.  This version is Sun3 only, if
  12. I get enough responce, I'll adapt it to Sun2s (pretty trivial actually,
  13. but see included README for details).
  14.  
  15.                         Matt Goheen
  16.                         S.R. Systems
  17.                 {seismo,rutgers,ames}!rochester!srs!matt
  18.  
  19. -----cut-----here-----and-----have-----your-----way-----with-----me-----
  20. #!/bin/sh
  21. #
  22. # shar archiver, delete everything above the #!/bin/sh line
  23. # and run through sh (not csh)
  24. #
  25. echo 'shar: extracting "README" (3051 characters)'
  26. # 'README' has a checksum of 15571 on BSD and 1790 on System V.
  27. sed 's/^X//' > README << 'XXX_EOF_XXX'
  28. X
  29. XTAKE NOTE:  brottool as distributed here will only run on a Sun3.  That
  30. X        is only because the f_sqrt() function uses some 68020
  31. X        instructions.  However, it wouldn't be much fun on a Sun2
  32. X        anyway (too slow) so I didn't supply a Sun2 f_sqrt() routine.
  33. X        Also, because the array used for plotting is so large (2 Meg),
  34. X        most Sun2 systems will fall a bit short.  This was developed
  35. X        on Sun OS 3.2, no promises about other versions (no way for
  36. X        2.x, probably works for any 3.x).
  37. X
  38. X
  39. XBrottool is a little program that takes the following equation:
  40. X
  41. X    tmp = y - SIGN(x) * sqrt(fabs(b*x-c));
  42. X    y = a - x;
  43. X    x = tmp;
  44. X
  45. Xand goes nuts with it.  Preferably, it should be started up like:
  46. X
  47. X    brottool -Ws 1100 700
  48. X
  49. Xsince brottool scales its control panel according to the size of the frame,
  50. Xthis allows for greater accuracy when selecting the seed values.  I've
  51. Xfound that the best setup is to set the X offset around the middle, set the
  52. Xhorizontal scrollbar around the middle so that the origin is about in the
  53. Xcenter of the screen, and set the Y offset to around 300 (it defaults to 120).
  54. X
  55. XBrottool clears the screen and restarts anytime one of the seeds changes,
  56. Xthe scale changes or the X or Y offsets change.  It does NOT restart if you
  57. Xscroll (the canvas is a "window" into the larger background, the X and Y
  58. Xoffsets control where in the background the program will plot, you can then
  59. Xscroll your window around viewing the picture).
  60. X
  61. XClicking the "Stop" botton halts the plotting.  This is actually rather
  62. Xuseless (until I add something like screendump - maybe).
  63. X
  64. XBrottool allocates a 2 Meg. array for plotting (monocrome).  If your system
  65. Xhas only 4 meg (or heaven forbid - less), you will want to make sure that
  66. Xnothing else is running (esp. other tools).  They can be on the desktop, they
  67. Xjust shouldn't be in the run state or you will get some pretty massive paging
  68. Xand swapping (i.e. no perfmeter, clocktool, etc.).
  69. X
  70. XThe f_sqrt() routine has restricted use because half of it was developed
  71. Xon company time.  Run "sccs what f_tab_sqrt.o" (once it is unpacked) on
  72. Xthe file to see the Copyright notice.  The rest of the program is purely
  73. Xpublic domain, although I would appreciate it if people sent me any neat
  74. Xchanges they make.
  75. X
  76. XTo make brottool, do the following (assuming you have already unpacked
  77. Xthe shell archive):
  78. X
  79. X    1) Type "make"
  80. X    2) As mentioned above, type "brottool -Ws 1100 700 &"
  81. X    3) Play
  82. X
  83. XPOSSIBLE ENHANCEMENTS:
  84. X
  85. X1) Add Sun2 f_sqrt() routine.
  86. X2) Add floating point support.  The patterns generated are VERY accuracy
  87. X   dependant.  Although floating point looks better, it was too slow for
  88. X   me, so I did the integer implementation.
  89. X3) Add a "screendump" command.
  90. X4) Add a "don't clear" button so that multiple images can be viewed (either
  91. X   overlayed or offset).
  92. X5) Other wizbang stuff, like XORing new points, reverse video (although
  93. X   this can be done with suntools), etc.
  94. X
  95. X
  96. X                    Have fun, and don't
  97. X                    hypnotize yourself,
  98. X
  99. X                    Matt Goheen
  100. X            {seismo,allegra,ames,rutgers}!rochester!srs!matt
  101. X
  102. XXX_EOF_XXX
  103. if test 3051 -ne "`wc -c < README`"
  104. then
  105.     echo 'shar: transmission error on "README"'
  106. fi
  107. chk=`sum README | awk '{print $1}'`
  108. if test 15571 -ne $chk -a 1790 -ne $chk
  109. then
  110.     echo 'shar: checksum error on "README"'
  111. fi
  112. echo 'shar: extracting "Makefile" (268 characters)'
  113. # 'Makefile' has a checksum of 64750 on BSD and 21309 on System V.
  114. sed 's/^X//' > Makefile << 'XXX_EOF_XXX'
  115. X#
  116. X# Makefile for brottool.
  117. X#
  118. X
  119. XPACKAGE = brottool
  120. XGLIBS = -lsuntool -lsunwindow -lpixrect
  121. XCFLAGS = -O
  122. X.PRECIOUS: f_tab_sqrt.o
  123. X
  124. X${PACKAGE}: ${PACKAGE}.o f_tab_sqrt.o
  125. X    cc ${CFLAGS} -o ${PACKAGE} ${PACKAGE}.o f_tab_sqrt.o $(GLIBS)
  126. X
  127. X${PACKAGE}.o: brottool.h brottool.icon
  128. X
  129. XXX_EOF_XXX
  130. if test 268 -ne "`wc -c < Makefile`"
  131. then
  132.     echo 'shar: transmission error on "Makefile"'
  133. fi
  134. chk=`sum Makefile | awk '{print $1}'`
  135. if test 64750 -ne $chk -a 21309 -ne $chk
  136. then
  137.     echo 'shar: checksum error on "Makefile"'
  138. fi
  139. echo 'shar: extracting "brottool.c" (9322 characters)'
  140. # 'brottool.c' has a checksum of 19388 on BSD and 28013 on System V.
  141. sed 's/^X//' > brottool.c << 'XXX_EOF_XXX'
  142. X/*
  143. X**     Overview:    Plot stuff in window...
  144. X*/
  145. X
  146. X#include <stdio.h>
  147. X#include <suntool/sunview.h>
  148. X#include <suntool/canvas.h>
  149. X#include <suntool/panel.h>
  150. X#include "brottool.h"
  151. X
  152. X/*
  153. Xstatic void resize_proc();
  154. Xstatic void repaint_proc();
  155. X*/
  156. Xstatic Notify_value my_notice_destroy();
  157. Xstatic short bits[16] = { 0x8000, 0x4000, 0x2000, 0x1000, 0x800,
  158. X              0x400, 0x200, 0x100, 0x80, 0x40, 0x20,
  159. X              0x10, 0x8, 0x4, 0x2, 0x1 };
  160. X
  161. Xstatic short icon_image[] = {
  162. X#include "brottool.icon"
  163. X};
  164. XDEFINE_ICON_FROM_IMAGE(brot_icon, icon_image);
  165. X
  166. X
  167. Xextern Notify_error notify_dispatch();
  168. Xvoid do_batch();
  169. X
  170. X/* twice as wide as tall */
  171. Xstatic int Xmax = MAX_X_OFF;
  172. Xstatic int Ymax = MAX_Y_OFF;
  173. Xstatic int Stop;        /* Are we stopped? */
  174. Xstatic int my_done;        /* set in my_notice_destroy() */
  175. Xstatic int linebytes;        /* to get Y index into display array */
  176. Xstatic int a, b, c;        /* seed values */
  177. Xstatic int factor;        /* scaling factor */
  178. Xstatic int count;        /* number of STEP points plotted */
  179. Xstatic int xoff, yoff;        /* current X and Y offsets */
  180. Xstatic int sx, sy;        /* current values of X and Y */
  181. Xstatic char *image;        /* pointer to display array (NOT screen) */
  182. Xstatic Pixwin *pw;        /* screen pixwin */
  183. Xstatic Pixrect *Mypr;        /* display array pixrect */
  184. X
  185. X/* pointers to panel items */
  186. Xstatic Panel_item panel_item_A, panel_item_B, panel_item_C;
  187. Xstatic Panel_item panel_item_X, panel_item_Y, panel_stop_toggle;
  188. X
  189. X/* All the notify procs for the panel items call this one procedure.
  190. X** It merely changes the values and restarts the display (unless the
  191. X** item is the "Stop" button, in which case the display isn't restarted).
  192. X*/
  193. X
  194. Xchange_proc(item, value, event)
  195. XPanel_item item;
  196. Xint value;
  197. XEvent *event;
  198. X{
  199. X    if (item == panel_item_A)
  200. X    a = value;
  201. X    else if (item == panel_item_B)
  202. X    b = value;
  203. X    else if (item == panel_item_C)
  204. X    c = value << SHIFT;
  205. X    else if (item == panel_item_X)
  206. X    xoff = value;
  207. X    else if (item == panel_item_Y)
  208. X    yoff = value;
  209. X    else if (item == panel_stop_toggle) {
  210. X    Stop = value;
  211. X    return;
  212. X    } else
  213. X    factor = SHIFT - value;
  214. X    /* could just use bzero() on "image", but Sun OS 3.2 bzero()
  215. X    ** is broken for > 256K (64K * 4 bytes/long)
  216. X    */
  217. X    pr_rop(Mypr, 0, 0, Xmax, Ymax, PIX_CLR | PIX_DONTCLIP, 0, 0, 0);
  218. X    sx = 0; sy = 0; count = 0;        /* start over */
  219. X}
  220. X
  221. Xmain(argc, argv)
  222. Xint argc;
  223. Xchar **argv;
  224. X{
  225. X    int Xsize;            /* panel items scaled to frame size */
  226. X    Frame frame;        /* the tool */
  227. X    Panel panel;        /* the control panel */
  228. X    Canvas canvas;        /* the canvas for drawing */
  229. X    Panel_item panel_iters;    /* for number of STEP iterations */
  230. X    char panel_iter_string[30];    /* ditto */
  231. X
  232. X    frame = window_create(NULL, FRAME,
  233. X              FRAME_LABEL, "BrotTool",
  234. X              FRAME_ARGC_PTR_ARGV, &argc, argv,
  235. X              FRAME_ICON, &brot_icon,
  236. X              FRAME_SUBWINDOWS_ADJUSTABLE, FALSE,
  237. X              WIN_ERROR_MSG, "Can't create frame",
  238. X              0);
  239. X
  240. X    /* get width of the frame to scale panel items by */
  241. X    Xsize = ((Rect *) window_get(frame, WIN_RECT))->r_width;
  242. X
  243. X    panel = window_create(frame, PANEL, 
  244. X              PANEL_LABEL_BOLD, TRUE,
  245. X              0);
  246. X
  247. X    panel_item_A = panel_create_item(panel, PANEL_SLIDER,
  248. X              PANEL_VALUE, DEF_A,
  249. X              PANEL_MIN_VALUE, (-4 << SHIFT),
  250. X              PANEL_MAX_VALUE, (4 << SHIFT),
  251. X              PANEL_NOTIFY_PROC, change_proc,
  252. X              PANEL_LABEL_STRING, "Seed 'A': ",
  253. X              PANEL_NOTIFY_LEVEL, PANEL_DONE,
  254. X              PANEL_SHOW_VALUE, TRUE,
  255. X              PANEL_SLIDER_WIDTH, Xsize-200,
  256. X              PANEL_SHOW_RANGE, FALSE,
  257. X              0);
  258. X    panel_item_B = panel_create_item(panel, PANEL_SLIDER,
  259. X              PANEL_VALUE, DEF_B,
  260. X              PANEL_MIN_VALUE, (-4 << SHIFT),
  261. X              PANEL_MAX_VALUE, (4 << SHIFT),
  262. X              PANEL_NOTIFY_PROC, change_proc,
  263. X              PANEL_LABEL_STRING, "Seed 'B': ",
  264. X              PANEL_NOTIFY_LEVEL, PANEL_DONE,
  265. X              PANEL_SHOW_VALUE, TRUE,
  266. X              PANEL_SLIDER_WIDTH, Xsize-200,
  267. X              PANEL_SHOW_RANGE, FALSE,
  268. X              0);
  269. X    panel_item_C = panel_create_item(panel, PANEL_SLIDER,
  270. X              PANEL_VALUE, DEF_C >> SHIFT,
  271. X              PANEL_MIN_VALUE, (-4 << SHIFT),
  272. X              PANEL_MAX_VALUE, (4 << SHIFT),
  273. X              PANEL_NOTIFY_PROC, change_proc,
  274. X              PANEL_LABEL_STRING, "Seed 'C': ",
  275. X              PANEL_NOTIFY_LEVEL, PANEL_DONE,
  276. X              PANEL_SHOW_VALUE, TRUE,
  277. X              PANEL_SLIDER_WIDTH, Xsize-200,
  278. X              PANEL_SHOW_RANGE, FALSE,
  279. X              0);
  280. X
  281. X    panel_item_X = panel_create_item(panel, PANEL_SLIDER,
  282. X              PANEL_VALUE, DEF_X_OFF,
  283. X              PANEL_MIN_VALUE, 0,
  284. X              PANEL_MAX_VALUE, MAX_X_OFF,
  285. X              PANEL_NOTIFY_PROC, change_proc,
  286. X              PANEL_LABEL_STRING, "X Offset: ",
  287. X              PANEL_NOTIFY_LEVEL, PANEL_DONE,
  288. X              PANEL_SHOW_VALUE, TRUE,
  289. X              PANEL_SLIDER_WIDTH, Xsize-370,
  290. X              PANEL_SHOW_RANGE, FALSE,
  291. X              0);
  292. X
  293. X    /* This is a little strange because there are no PANEL_CHOICE_STRINGS.
  294. X    ** Instead, we use the PANEL_LABEL_STRING to label our button.  This
  295. X    ** is easier than loading a pixfont to get the string to come up bold
  296. X    ** like the rest of the panel items.
  297. X    */
  298. X    panel_stop_toggle = panel_create_item(panel, PANEL_TOGGLE,
  299. X              PANEL_LABEL_STRING, "Stop",
  300. X              PANEL_CHOICE_STRINGS, "", 0,
  301. X              PANEL_NOTIFY_PROC, change_proc,
  302. X              PANEL_TOGGLE_VALUE, 0, FALSE,
  303. X              0);
  304. X    panel_create_item(panel, PANEL_CYCLE,
  305. X              PANEL_NOTIFY_PROC, change_proc,
  306. X              PANEL_LABEL_STRING, " Scale:",
  307. X              PANEL_CHOICE_STRINGS, "1", "2", "4", "8", "16",
  308. X              "32", "64", "128", 0,
  309. X              PANEL_VALUE, DEF_FAC,
  310. X              0);
  311. X
  312. X    panel_item_Y = panel_create_item(panel, PANEL_SLIDER,
  313. X              PANEL_VALUE, DEF_Y_OFF,
  314. X              PANEL_MIN_VALUE, 0,
  315. X              PANEL_MAX_VALUE, MAX_Y_OFF,
  316. X              PANEL_NOTIFY_PROC, change_proc,
  317. X              PANEL_LABEL_STRING, "Y Offset: ",
  318. X              PANEL_NOTIFY_LEVEL, PANEL_DONE,
  319. X              PANEL_SHOW_VALUE, TRUE,
  320. X              PANEL_SLIDER_WIDTH, Xsize-370,
  321. X              PANEL_SHOW_RANGE, FALSE,
  322. X              0);
  323. X
  324. X    panel_create_item(panel, PANEL_MESSAGE,
  325. X              PANEL_LABEL_STRING, "Points:",
  326. X              0);
  327. X    panel_iters = panel_create_item(panel, PANEL_MESSAGE,
  328. X              PANEL_LABEL_STRING, "    0",
  329. X              0);
  330. X    (void) sprintf(panel_iter_string, "x %d", STEP);
  331. X    panel_create_item(panel, PANEL_MESSAGE,
  332. X              PANEL_LABEL_STRING, panel_iter_string,
  333. X              0);
  334. X
  335. X    window_fit_height(panel);    /* squeeze everything together */
  336. X
  337. X    canvas = window_create(frame, CANVAS,
  338. X               /* CANVAS_RESIZE_PROC, resize_proc, */
  339. X               /* CANVAS_REPAINT_PROC, repaint_proc, */
  340. X               CANVAS_RETAINED, FALSE,
  341. X               CANVAS_AUTO_CLEAR, FALSE,
  342. X               CANVAS_WIDTH, Xmax,
  343. X               CANVAS_HEIGHT, Ymax,
  344. X               CANVAS_AUTO_SHRINK, FALSE,
  345. X               WIN_VERTICAL_SCROLLBAR, scrollbar_create(0),
  346. X               WIN_HORIZONTAL_SCROLLBAR, scrollbar_create(0),
  347. X               WIN_ERROR_MSG, "Can't create canvas",
  348. X               0);
  349. X    
  350. X    pw = canvas_pixwin(canvas);
  351. X
  352. X    (void) notify_interpose_destroy_func(frame, my_notice_destroy);
  353. X
  354. X    /* initialize defaults */
  355. X    a = DEF_A; b = DEF_B; c = DEF_C; factor = SHIFT - DEF_FAC;
  356. X    xoff = DEF_X_OFF; yoff = DEF_Y_OFF; Stop = FALSE;
  357. X
  358. X    /* allocate the memory pixrect for the actual display */
  359. X    if ((Mypr = mem_create(Xmax, Ymax, 1)) == NULL) {
  360. X    fprintf(stderr, "%s: not enough memory for display array", argv[0]);
  361. X    exit(1);
  362. X    }
  363. X
  364. X    image = (char *) ((struct mpr_data *) Mypr->pr_data)->md_image;
  365. X    linebytes = ((struct mpr_data *) Mypr->pr_data)->md_linebytes;
  366. X    window_set(frame, WIN_SHOW, TRUE, 0);
  367. X
  368. X    while (TRUE) {
  369. X    (void) notify_dispatch();    /* any windowing to do? */
  370. X    if (my_done)
  371. X        break;
  372. X
  373. X    /* Might be easier to call window_main_loop()? */
  374. X    if (Stop) {        /* don't draw, sleep for 2/10 sec */
  375. X        usleep(200000);
  376. X        continue;
  377. X    }
  378. X    do_batch(&sx, &sy);
  379. X    (void) sprintf(panel_iter_string, "%5d", ++count);
  380. X    panel_set(panel_iters,
  381. X          PANEL_LABEL_STRING, panel_iter_string,
  382. X          0);
  383. X    }
  384. X}
  385. X
  386. X/* NOT NECESSARY...
  387. Xstatic void
  388. Xresize_proc()
  389. X{
  390. X}
  391. X*/
  392. X
  393. X/* Since do_batch() periodically updates the screen anyway,
  394. X** we don't need this at all...
  395. Xstatic void
  396. Xrepaint_proc()
  397. X{
  398. X    pw_write(pw, 0, 0, Xmax, Ymax, PIX_SRC, Mypr, 0, 0);
  399. X}
  400. X*/
  401. X
  402. Xstatic Notify_value
  403. Xmy_notice_destroy(frame, status)
  404. XFrame frame;
  405. XDestroy_status status;
  406. X{
  407. X    if (status != DESTROY_CHECKING) {
  408. X    my_done = 1;
  409. X    (void) notify_stop();
  410. X    }
  411. X    return(notify_next_destroy_func(frame, status));
  412. X}
  413. X
  414. X/* The basic equation is:
  415. X**
  416. X**    tmp = y - SIGN(x) * sqrt(fabs(b*x-c));
  417. X**    y = a - x;
  418. X**    x = tmp;
  419. X*/
  420. X
  421. Xvoid
  422. Xdo_batch()
  423. X{
  424. X    register int tmp, ix, iy, ifactor, i, ibytes;
  425. X    register char *ia, *ib, *ic;
  426. X    register short *ttmp;
  427. X
  428. X    ia = (char *) a; ib = (char *) b; ic = (char *) c;
  429. X    ix = sx; iy = sy;
  430. X    ibytes = linebytes;
  431. X    ifactor = factor;
  432. X
  433. X    for (i=STEP; i--; ) {
  434. X    tmp = iy; tmp >>= ifactor; tmp += yoff;        /* y */
  435. X    if (tmp < Ymax && tmp >= 0) {
  436. X        tmp *= ibytes;
  437. X        ttmp = (short *) (image + tmp);
  438. X        tmp = ix; tmp >>= ifactor; tmp += xoff;    /* x */
  439. X        if (tmp < Xmax && tmp >= 0)
  440. X        *(ttmp + (tmp >> 4)) |= bits[tmp & 0x0f];
  441. X    }
  442. X    tmp = (int) ib;
  443. X    tmp *= ix;
  444. X    tmp -= (int) ic;
  445. X    if (tmp < 0)
  446. X        tmp = -tmp;
  447. X    tmp = f_sqrt(tmp);
  448. X    if (ix < 0)
  449. X        tmp = -tmp;
  450. X    tmp = iy - tmp;
  451. X    iy = (int) ia - ix;
  452. X    ix = tmp;
  453. X    }
  454. X
  455. X    /* Maybe this would be faster if we kept track of the canvases
  456. X    ** current viewport and only did a pw_write of that area.  For
  457. X    ** now, this appears to be fast enough.
  458. X    */
  459. X    pw_write(pw, 0, 0, Xmax, Ymax, PIX_SRC, Mypr, 0, 0);
  460. X
  461. X    sx = ix;    /* save the x value for the next call */
  462. X    sy = iy;    /* save the y value for the next call */
  463. X}
  464. XXX_EOF_XXX
  465. if test 9322 -ne "`wc -c < brottool.c`"
  466. then
  467.     echo 'shar: transmission error on "brottool.c"'
  468. fi
  469. chk=`sum brottool.c | awk '{print $1}'`
  470. if test 19388 -ne $chk -a 28013 -ne $chk
  471. then
  472.     echo 'shar: checksum error on "brottool.c"'
  473. fi
  474. echo 'shar: extracting "brottool.h" (863 characters)'
  475. # 'brottool.h' has a checksum of 24498 on BSD and 65017 on System V.
  476. sed 's/^X//' > brottool.h << 'XXX_EOF_XXX'
  477. X/* Number of points to plot before updating the screen */
  478. X#define STEP        5000
  479. X
  480. X/* Default seed values */
  481. X#define DEF_A        (-22938)
  482. X#define DEF_B        (-1638)
  483. X#define DEF_C        221459251
  484. X
  485. X/* Index of default screen magnification factor (1, 2, 4, 8, 16, 32, 64, 128) */
  486. X#define DEF_FAC        6
  487. X
  488. X/* Size of display area:
  489. X** X=(DEF_SIZE << (WIN_SHIFT+1)),
  490. X** Y=(DEF_SIZE << (WIN_SHIFT-1))
  491. X*/
  492. X#define DEF_SIZE    512
  493. X#define WIN_SHIFT    3
  494. X
  495. X/* Default X and Y offsets into display area (NOT the same as scrolling) */
  496. X#define DEF_X_OFF    100
  497. X#define DEF_Y_OFF    120
  498. X
  499. X/* For scrollbars, display size */
  500. X#define MAX_X_OFF    (DEF_SIZE << (WIN_SHIFT+1))
  501. X#define MAX_Y_OFF    (DEF_SIZE << (WIN_SHIFT-1))
  502. X
  503. X/* Number of bits in fixed point calculations, probably shouldn't mess
  504. X** with this one.  14 seems to overflow, 12 gives poor (or poorer) results.
  505. X** This seems to be the best.
  506. X*/
  507. X#define SHIFT        13
  508. X
  509. XXX_EOF_XXX
  510. if test 863 -ne "`wc -c < brottool.h`"
  511. then
  512.     echo 'shar: transmission error on "brottool.h"'
  513. fi
  514. chk=`sum brottool.h | awk '{print $1}'`
  515. if test 24498 -ne $chk -a 65017 -ne $chk
  516. then
  517.     echo 'shar: checksum error on "brottool.h"'
  518. fi
  519. echo 'shar: extracting "brottool.icon" (1933 characters)'
  520. # 'brottool.icon' has a checksum of 43697 on BSD and 49786 on System V.
  521. sed 's/^X//' > brottool.icon << 'XXX_EOF_XXX'
  522. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  523. X */
  524. X    0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x00C0,0x0300,0x0001,
  525. X    0x8000,0x00C0,0x0300,0x0001,0x800F,0xE060,0x0607,0xF001,
  526. X    0x803F,0xF860,0x061F,0xFC01,0x80F0,0x1E30,0x0C78,0x0F01,
  527. X    0x8140,0x051C,0x38A0,0x0281,0x8380,0x0387,0xE1C0,0x01C1,
  528. X    0x8500,0x0140,0x0280,0x00A1,0x8600,0x00C0,0x0300,0x0061,
  529. X    0x8C00,0x0060,0x0600,0x0031,0x8C00,0x0060,0x0600,0x0031,
  530. X    0x9800,0x0030,0x0C00,0x0019,0x9800,0x0030,0x0C00,0x0019,
  531. X    0x9800,0x0030,0x0C00,0x0019,0x9800,0x0030,0x0C00,0x0019,
  532. X    0x9800,0x0030,0x0C00,0x0019,0x9800,0x0030,0x0C00,0x0019,
  533. X    0x9800,0x0030,0x0C00,0x0019,0x8C00,0x0070,0x0E00,0x0031,
  534. X    0x8C00,0x0070,0x0E00,0x0031,0x8600,0x00D0,0x0B00,0x0061,
  535. X    0x8500,0x016F,0xF680,0x00A1,0x8380,0x039F,0xF9C0,0x01C1,
  536. X    0x8140,0x0500,0x00A0,0x0281,0x82F0,0x1E00,0x0078,0x0F41,
  537. X    0x87FF,0xF800,0x001F,0xFFE1,0x8C0F,0xE018,0x1807,0xF031,
  538. X    0x9800,0x0024,0x2400,0x0019,0x9800,0x0024,0x2400,0x0019,
  539. X    0x9800,0x0022,0x4400,0x0019,0x9800,0x001F,0xF800,0x0019,
  540. X    0x9800,0x001F,0xF800,0x0019,0x9800,0x0022,0x4400,0x0019,
  541. X    0x9800,0x0024,0x2400,0x0019,0x9800,0x0024,0x2400,0x0019,
  542. X    0x8C0F,0xE018,0x1807,0xF031,0x87FF,0xF800,0x001F,0xFFE1,
  543. X    0x82F0,0x1E00,0x0078,0x0F41,0x8140,0x0500,0x00A0,0x0281,
  544. X    0x8380,0x039F,0xF9C0,0x01C1,0x8500,0x016F,0xF680,0x00A1,
  545. X    0x8600,0x00D0,0x0B00,0x0061,0x8C00,0x0070,0x0E00,0x0031,
  546. X    0x8C00,0x0070,0x0E00,0x0031,0x9800,0x0030,0x0C00,0x0019,
  547. X    0x9800,0x0030,0x0C00,0x0019,0x9800,0x0030,0x0C00,0x0019,
  548. X    0x9800,0x0030,0x0C00,0x0019,0x9800,0x0030,0x0C00,0x0019,
  549. X    0x9800,0x0030,0x0C00,0x0019,0x9800,0x0030,0x0C00,0x0019,
  550. X    0x8C00,0x0060,0x0600,0x0031,0x8C00,0x0060,0x0600,0x0031,
  551. X    0x8600,0x00C0,0x0300,0x0061,0x8500,0x0140,0x0280,0x00A1,
  552. X    0x8380,0x0387,0xE1C0,0x01C1,0x8140,0x051C,0x38A0,0x0281,
  553. X    0x80F0,0x1E30,0x0C78,0x0F01,0x803F,0xF860,0x061F,0xFC01,
  554. X    0x800F,0xE060,0x0607,0xF001,0x8000,0x00C0,0x0300,0x0001,
  555. X    0x8000,0x00C0,0x0300,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF
  556. XXX_EOF_XXX
  557. if test 1933 -ne "`wc -c < brottool.icon`"
  558. then
  559.     echo 'shar: transmission error on "brottool.icon"'
  560. fi
  561. chk=`sum brottool.icon | awk '{print $1}'`
  562. if test 43697 -ne $chk -a 49786 -ne $chk
  563. then
  564.     echo 'shar: checksum error on "brottool.icon"'
  565. fi
  566. echo 'shar: extracting "encoded" (6239 characters)'
  567. # 'encoded' has a checksum of 18293 on BSD and 3096 on System V.
  568. sed 's/^X//' > encoded << 'XXX_EOF_XXX'
  569. Xbegin 755 f_tab_sq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5D5T
  586. XM19%%KT7,1>I&!T8D1D%&7D9[1IA&M4;21N]'#$<I1T9'8D=_1YQ'N$?51_%(
  587. XM#D@J2$9(8TA_2)M(MTC42/!)#$DH241)8$E\29=)LTG/2>M*!DHB2CY*64IU
  588. XM2I!*K$K'2N)*_DL92S1+4$MK2X9+H4N\2]=+\DP-3"A,0TQ>3'A,DTRN3,E,
  589. XMXTS^31A-,TU-36A-@DV=3;=-T4WL3@9.($XZ3E5.;TZ)3J-.O4[73O%/"T\E
  590. XM3S]/6$]R3XQ/ID^_3]E/\U`,4"90/U!94')0C%"E4+]0V%#Q40M1)%$]4591
  591. XM;U&)4:)1NU'44>U2!E(?4CA245)I4H)2FU*T4LU2Y5+^4Q=3+U-(4V!3>5.2
  592. XM4ZI3PE/;4_-4#%0D5#Q4551M5(54G52V5,Y4YE3^5195+E5&55Y5=E6.5:95
  593. XMOE765>Y6!58=5C56359D5GQ6E%:K5L-6VU;R5PI7(5<Y5U!7:%=_5Y=7KE?%
  594. XM5]U7]%@+6")8.EA16&A8?UB66*U8Q%C<6/-9"EDA63A93EEE67Q9DUFJ6<%9
  595. XMV%GN6@5:'%HS6DE:8%IW6HU:I%JZ6M%:Z%K^6Q5;*UM"6UA;;EN%6YM;L5O(
  596. XM6]Y;]%P+7"%<-UQ-7&-<>ER07*9<O%S27.A<_ET472I=0%U676Q=@EV87:Y=
  597. XMQ%W97>]>!5X;7C!>1EY<7G)>AUZ=7K->R%[>7O-?"5\>7S1?25]?7W1?BE^?
  598. XM7[5?RE_?7_5@"F`?8#5@2F!?8'5@BF"?8+1@R6#>8/1A"6$>83-A2&%=87)A
  599. XMAV&<8;%AQF';8?!B!6(:8BYB0V)88FUB@F*78JMBP&+58NIB_F,38RAC/&-1
  600. XM8V5C>F./8Z-CN&/,8^%C]60*9!YD,V1'9%MD<&2$9)EDK63!9-9DZF3^91-E
  601. XM)V4[94]E8V5X98QEH&6T9<AEW&7P9@5F&68M9D%F569I9GUFD6:E9KEFS&;@
  602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69?=&%B7W-Q<G0N<R`Q
  664. XM+C$@0V]P>7)I9VAT("A#*2`X+S$Q+S@W(%-P965C:"!296-O9VYI=&EO;B!3
  665. XM>7-T96US"D`H(RE4:&ES(&-O9&4@;6%Y($Y/5"!B92!S;VQD(&%N9"]O<B!U
  666. XM<V5D(&9O<B!P<F]F:70N("!#;W!I97,@9F]R"D`H(REN;VXM<')O9FET('5S
  667. XM92!M87D@8F4@;6%D92P@87,@;&]N9R!A<R!T:&ES(&-O<'ER:6=H="!N;W1I
  668. XM8V4*0"@C*6ES(&YO="!R96UO=F5D(&]R(&%L=&5R960N`````!X```9`````
  669. XM/```!D`````$!P`!7````%0````.!0`&#@`````````67W-Q<G1?=&%B`%]F
  670. X&7W-Q<G0`
  671. X`
  672. Xend
  673. XXX_EOF_XXX
  674. if test 6239 -ne "`wc -c < encoded`"
  675. then
  676.     echo 'shar: transmission error on "encoded"'
  677. fi
  678. chk=`sum encoded | awk '{print $1}'`
  679. if test 18293 -ne $chk -a 3096 -ne $chk
  680. then
  681.     echo 'shar: checksum error on "encoded"'
  682. else
  683.     echo 'shar: decoding "encoded" to "f_tab_sqrt.o"'
  684.     uudecode encoded
  685. fi
  686. echo 'shar: extracting "Copyright.c" (269 characters)'
  687. # 'Copyright.c' has a checksum of 19970 on BSD and 22893 on System V.
  688. sed 's/^X//' > Copyright.c << 'XXX_EOF_XXX'
  689. Xstatic char Sccsid[] = "\
  690. X@(#)f_tab_sqrt.s 1.1 Copyright (C) 8/11/87 Speech Recognition Systems\n\
  691. X@(#)This code may NOT be sold and/or used for profit.  Copies for\n\
  692. X@(#)non-profit use may be made, as long as this copyright notice\n\
  693. X@(#)is not removed or altered.";
  694. XXX_EOF_XXX
  695. if test 269 -ne "`wc -c < Copyright.c`"
  696. then
  697.     echo 'shar: transmission error on "Copyright.c"'
  698. fi
  699. chk=`sum Copyright.c | awk '{print $1}'`
  700. if test 19970 -ne $chk -a 22893 -ne $chk
  701. then
  702.     echo 'shar: checksum error on "Copyright.c"'
  703. fi
  704.