home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume20 / xarchie / part05 < prev    next >
Encoding:
Text File  |  1993-06-14  |  50.4 KB  |  1,862 lines

  1. Newsgroups: comp.sources.x
  2. From: ferguson@cs.rochester.edu (George Ferguson)
  3. Subject: v20i033:  xarchie - An X browser interface to Archie, v2.0.6, Part05/24
  4. Message-ID: <1993Jun15.223210.29837@sparky.imd.sterling.com>
  5. X-Md4-Signature: 03efa96246e74383a54d6b5f22c443e7
  6. Sender: chris@sparky.imd.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Tue, 15 Jun 1993 22:32:10 GMT
  9. Approved: chris@sparky.imd.sterling.com
  10.  
  11. Submitted-by: ferguson@cs.rochester.edu (George Ferguson)
  12. Posting-number: Volume 20, Issue 33
  13. Archive-name: xarchie/part05
  14. Environment: X11
  15. Supersedes: xarchie: Volume 14, Issue 82-90
  16.  
  17. Submitted-by: ferguson@cs.rochester.edu
  18. Archive-name: xarchie-2.0.6/part05
  19.  
  20. #!/bin/sh
  21. # this is Part.05 (part 5 of xarchie-2.0.6)
  22. # do not concatenate these parts, unpack them in order with /bin/sh
  23. # file xarchie-2.0.6/Xarchie.ad.h continued
  24. #
  25. if test ! -r _shar_seq_.tmp; then
  26.     echo 'Please unpack part 1 first!'
  27.     exit 1
  28. fi
  29. (read Scheck
  30.  if test "$Scheck" != 5; then
  31.     echo Please unpack part "$Scheck" next!
  32.     exit 1
  33.  else
  34.     exit 0
  35.  fi
  36. ) < _shar_seq_.tmp || exit 1
  37. if test ! -f _shar_wnt_.tmp; then
  38.     echo 'x - still skipping xarchie-2.0.6/Xarchie.ad.h'
  39. else
  40. echo 'x - continuing file xarchie-2.0.6/Xarchie.ad.h'
  41. sed 's/^X//' << 'SHAR_EOF' >> 'xarchie-2.0.6/Xarchie.ad.h' &&
  42. "Xarchie.gray*Dialog*background:            gray90",
  43. "Xarchie.gray*Dialog*Command.background:        gray50",
  44. "Xarchie.gray*statusText*background:        gray55",
  45. "Xarchie.gray*viewSaveLabelText*background:    gray55",
  46. "Xarchie.gray*browserForm.background:        gray90",
  47. "Xarchie.gray*browserForm*Command.background:    gray90",
  48. "Xarchie.gray*browserForm*Paned*background:    gray90",
  49. "Xarchie.gray*List*background:            gray90",
  50. "Xarchie.gray*XfwfMultiList*highlightBackground:    gray20",
  51. "Xarchie.gray*XfwfMultiList*highlightForeground:    white",
  52. "Xarchie.gray*stringForm*Text*background:    gray80",
  53. "Xarchie.gray*stringForm*searchText*background:    gray80",
  54. "Xarchie.gray*helpForm*List.background:        gray90",
  55. "Xarchie.gray*helpForm*Text*background:        gray90",
  56. "Xarchie.gray*ftpTraceText*background:        gray55",
  57. SHAR_EOF
  58. echo 'File xarchie-2.0.6/Xarchie.ad.h is complete' &&
  59. chmod 0644 xarchie-2.0.6/Xarchie.ad.h ||
  60. echo 'restore of xarchie-2.0.6/Xarchie.ad.h failed'
  61. Wc_c="`wc -c < 'xarchie-2.0.6/Xarchie.ad.h'`"
  62. test 32017 -eq "$Wc_c" ||
  63.     echo 'xarchie-2.0.6/Xarchie.ad.h: original size 32017, current size' "$Wc_c"
  64. rm -f _shar_wnt_.tmp
  65. fi
  66. # ============= xarchie-2.0.6/about.c ==============
  67. if test -f 'xarchie-2.0.6/about.c' -a X"$1" != X"-c"; then
  68.     echo 'x - skipping xarchie-2.0.6/about.c (File already exists)'
  69.     rm -f _shar_wnt_.tmp
  70. else
  71. > _shar_wnt_.tmp
  72. echo 'x - extracting xarchie-2.0.6/about.c (Text)'
  73. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/about.c' &&
  74. /*
  75. X * about.c : The "About xarchie" panel, with goofy display
  76. X *
  77. X * George Ferguson, ferguson@cs.rochester.edu, 23 Apr 1993.
  78. X *
  79. X * If either HAVE_RANDOM or HAVE_RAND are defined (config.h), the display
  80. X * is animated randomly, otherwise it just sits there.
  81. X * 13 May 1993: Fixed array bound error in popupAboutPanel().
  82. X *        Changed the way the version info is printed.
  83. X *        Changed style of animation (spare time killer).
  84. X */
  85. #include <stdio.h>
  86. #include <X11/Intrinsic.h>
  87. #include <X11/Shell.h>
  88. #include <X11/StringDefs.h>
  89. #include <X11/Xaw/Form.h>
  90. #include <X11/Xaw/Label.h>
  91. #include <X11/Xaw/Command.h>
  92. #include "xarchie.h"
  93. #include "patchlevel.h"
  94. #include "about.xbm"
  95. #include "config.h"
  96. X
  97. #define TIMER_LENGTH 250    /* msec */
  98. X
  99. /*
  100. X * Functions defined here
  101. X */
  102. void initAboutActions();
  103. void popupAboutPanel();
  104. void setAboutShellState();
  105. X
  106. static void initAboutWidgets();
  107. static void aboutAction(),aboutDoneAction();
  108. static void drawFrame(),timeoutProc();
  109. X
  110. /*
  111. X * Data defined here:
  112. X */
  113. static Widget aboutShell;
  114. static Widget picture;
  115. static Window window;
  116. static XtIntervalId timer;
  117. static Boolean isPoppedUp;
  118. X
  119. static XtActionsRec actionTable[] = {
  120. X    { "about",        aboutAction },
  121. X    { "about-done",    aboutDoneAction },
  122. };
  123. X
  124. #define PTS_PER_LINE    3        /* maximum pts per line */
  125. #define LINES_PER_WAVE    6        /* total lines per wave */
  126. #define NUM_WAVES    4        /* number of different waves */
  127. #define NUM_FRAMES    4        /* number of anim frames per wave */
  128. X
  129. static XPoint points[NUM_WAVES][LINES_PER_WAVE][PTS_PER_LINE] = {
  130. X    { { {24,33}, { 4,0}, {0, 4} },
  131. X      { {22,30}, { 9,0}, {0, 8} },
  132. X      { {20,27}, {14,0}, {0,12} },
  133. X      { {18,24}, {19,0}, {0,16} },
  134. X      { {16,21}, {24,0}, {0,20} },
  135. X      { {14,18}, {29,0}, {0,24} } },
  136. X    { { {16,18}, { 1,0} },
  137. X      { {15,21}, { 3,0} },
  138. X      { {14,24}, { 5,0} },
  139. X      { {13,28}, { 7,0} },
  140. X      { {12,31}, { 9,0} },
  141. X      { {11,34}, {11,0} } },
  142. X    { { {42,22}, { 1, 1} },
  143. X      { {38,23}, { 3, 3} },
  144. X      { {34,24}, { 5, 5} },
  145. X      { {30,25}, { 7, 7} },
  146. X      { {26,26}, { 9, 9} },
  147. X      { {22,27}, {11,11} } },
  148. X    { { {43,46}, {0, 1} },
  149. X      { {40,45}, {0, 3} },
  150. X      { {37,44}, {0, 5} },
  151. X      { {34,43}, {0, 7} },
  152. X      { {31,42}, {0, 9} },
  153. X      { {28,41}, {0,11} } }
  154. };
  155. static int num[NUM_WAVES] = { 3, 2, 2, 2 };
  156. X
  157. static GC clearGC,setGC;
  158. static int wave,frame;
  159. X
  160. /*    -    -    -    -    -    -    -    -    */
  161. X
  162. void
  163. initAboutActions()
  164. {
  165. X    XtAppAddActions(appContext,actionTable,XtNumber(actionTable));
  166. X    wave = 0;
  167. X    frame = -1;        /* so we start with frame 0 of wave 0 */
  168. }
  169. X
  170. /*ARGSUSED*/
  171. static void
  172. aboutAction(w,event,params,num_params)
  173. Widget w;
  174. XXEvent *event;
  175. String *params;
  176. Cardinal *num_params;
  177. {
  178. X    popupAboutPanel();
  179. }
  180. X
  181. /*ARGSUSED*/
  182. static void
  183. aboutDoneAction(w,event,params,num_params)
  184. Widget w;
  185. XXEvent *event;
  186. String *params;
  187. Cardinal *num_params;
  188. {
  189. X    XtRemoveTimeOut(timer);
  190. X    isPoppedUp = False;
  191. X    XtPopdown(aboutShell);
  192. }
  193. X
  194. /*    -    -    -    -    -    -    -    -    */
  195. X
  196. void
  197. popupAboutPanel()
  198. {
  199. X    XGCValues values;
  200. X    Arg args[2];
  201. X    Pixel fg,bg;
  202. X
  203. X    if (isPoppedUp) {
  204. X    XRaiseWindow(display,XtWindow(aboutShell));
  205. X    return;
  206. X    }
  207. X    if (aboutShell == NULL) {
  208. X    initAboutWidgets();
  209. X    window = XtWindow(picture);
  210. X    XtSetArg(args[0],XtNforeground,&fg);
  211. X    XtSetArg(args[1],XtNbackground,&bg);
  212. X    XtGetValues(picture,args,2);
  213. X    values.function = GXcopy;
  214. X    values.foreground = fg;
  215. X    setGC = XCreateGC(display,root,GCFunction|GCForeground,&values);
  216. X    values.foreground = bg;
  217. X    clearGC = XCreateGC(display,root,GCFunction|GCForeground,&values);
  218. X    }
  219. X    isPoppedUp = True;
  220. X    XtPopup(aboutShell,XtGrabNone);
  221. #if defined(HAVE_RANDOM) || defined(HAVE_RAND)
  222. X    timer = XtAppAddTimeOut(appContext,(unsigned long)TIMER_LENGTH,
  223. X                timeoutProc,NULL);
  224. #endif
  225. }
  226. X
  227. static void
  228. initAboutWidgets()
  229. {
  230. X    Pixmap bitmap;
  231. X    Widget form;
  232. X    Arg args[1];
  233. X    char buf[64];
  234. X
  235. X    bitmap = XCreateBitmapFromData(display,root,(char *)about_bits,
  236. X                   about_width,about_height);
  237. X    aboutShell = XtCreatePopupShell("aboutShell",topLevelShellWidgetClass,
  238. X                    toplevel,NULL,0);
  239. X    form = XtCreateManagedWidget("aboutForm",formWidgetClass,
  240. X                 aboutShell,NULL,0);
  241. #ifdef BETA
  242. X    sprintf(buf,"Xarchie %.1fb%d",VERSION,PATCHLEVEL);
  243. #else
  244. X    sprintf(buf,"Xarchie %.1f.%d",VERSION,PATCHLEVEL);
  245. #endif
  246. X    XtSetArg(args[0],XtNlabel,buf);
  247. X    (void)XtCreateManagedWidget("aboutLabel0",labelWidgetClass,form,args,1);
  248. X    (void)XtCreateManagedWidget("aboutLabel1",labelWidgetClass,form,NULL,0);
  249. X    (void)XtCreateManagedWidget("aboutLabel2",labelWidgetClass,form,NULL,0);
  250. X    XtSetArg(args[0],XtNbitmap,bitmap);
  251. X    picture = XtCreateManagedWidget("aboutLabel3",labelWidgetClass,
  252. X                    form,args,1);
  253. X    (void)XtCreateManagedWidget("aboutLabel4",labelWidgetClass,form,NULL,0);
  254. X    (void)XtCreateManagedWidget("aboutLabel5",labelWidgetClass,form,NULL,0);
  255. X    (void)XtCreateManagedWidget("aboutDoneButton",commandWidgetClass,
  256. X                form,NULL,0);
  257. X    XtRealizeWidget(aboutShell);
  258. X    (void)XSetWMProtocols(XtDisplay(aboutShell),XtWindow(aboutShell),
  259. X              &WM_DELETE_WINDOW,1);
  260. }
  261. X
  262. /* This will never get called unless HAVE_RANDOM or HAVE_RAND is defined. */
  263. /*ARGSUSED*/
  264. static void
  265. timeoutProc(client_data,id)
  266. XXtPointer client_data;
  267. XXtIntervalId *id;
  268. {
  269. X    /* Clear old lines (after first call) */
  270. X    if (frame >= 0)
  271. X    drawFrame(clearGC);
  272. X    /* Compute next frame and/or wave */
  273. X    if (frame < NUM_FRAMES-1) {
  274. X    frame += 1;
  275. X    } else {
  276. #ifdef HAVE_RANDOM
  277. X    wave = random() % NUM_WAVES;
  278. #else
  279. #ifdef HAVE_RAND
  280. X    wave = rand() % NUM_WAVES;
  281. #endif
  282. #endif
  283. X    frame = 0;
  284. X    }
  285. X    /* Draw new lines */
  286. X    drawFrame(setGC);
  287. X    /* Reset timer */
  288. X    timer = XtAppAddTimeOut(appContext,(unsigned long)TIMER_LENGTH,
  289. X                timeoutProc,NULL);
  290. }
  291. X
  292. /*
  293. X * Draw or clear the current frame of the current wave by drawing some of
  294. X * the lines.
  295. X */
  296. static
  297. void drawFrame(gc)
  298. GC gc;
  299. {
  300. X    int i,first,last;
  301. X
  302. X    switch (frame) {
  303. X      case 0:
  304. X    first = 0; last = 1; break;
  305. X      case 1:
  306. X    first = 0; last = 3; break;
  307. X      case 2:
  308. X    first = 2; last = 5; break;
  309. X      case 3:
  310. X    first = 4; last = 5; break;
  311. X    }
  312. X    for (i=first; i <= last; i++) {
  313. X    XDrawLines(display,window,gc,
  314. X           points[wave][i],num[wave],CoordModePrevious);
  315. X    }
  316. }
  317. X
  318. void
  319. setAboutShellState(state)
  320. int state;
  321. {
  322. X    if (!isPoppedUp)
  323. X    return;
  324. X    switch (state) {
  325. X    case NormalState:
  326. X        XtMapWidget(aboutShell);
  327. X        timer = XtAppAddTimeOut(appContext,(unsigned long)TIMER_LENGTH,
  328. X                    timeoutProc,NULL);
  329. X        break;
  330. X    case IconicState:
  331. X        XtRemoveTimeOut(timer);
  332. X        XtUnmapWidget(aboutShell);
  333. X        break;
  334. X    }
  335. }
  336. SHAR_EOF
  337. chmod 0644 xarchie-2.0.6/about.c ||
  338. echo 'restore of xarchie-2.0.6/about.c failed'
  339. Wc_c="`wc -c < 'xarchie-2.0.6/about.c'`"
  340. test 6460 -eq "$Wc_c" ||
  341.     echo 'xarchie-2.0.6/about.c: original size 6460, current size' "$Wc_c"
  342. rm -f _shar_wnt_.tmp
  343. fi
  344. # ============= xarchie-2.0.6/about.h ==============
  345. if test -f 'xarchie-2.0.6/about.h' -a X"$1" != X"-c"; then
  346.     echo 'x - skipping xarchie-2.0.6/about.h (File already exists)'
  347.     rm -f _shar_wnt_.tmp
  348. else
  349. > _shar_wnt_.tmp
  350. echo 'x - extracting xarchie-2.0.6/about.h (Text)'
  351. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/about.h' &&
  352. /*
  353. X * about.c : The "About xarchie" panel
  354. X *
  355. X * George Ferguson, ferguson@cs.rochester.edu, 23 Apr 1993.
  356. X */
  357. X
  358. extern void initAboutActions();
  359. extern void popupAboutPanel();
  360. extern void setAboutShellState();
  361. X
  362. SHAR_EOF
  363. chmod 0644 xarchie-2.0.6/about.h ||
  364. echo 'restore of xarchie-2.0.6/about.h failed'
  365. Wc_c="`wc -c < 'xarchie-2.0.6/about.h'`"
  366. test 208 -eq "$Wc_c" ||
  367.     echo 'xarchie-2.0.6/about.h: original size 208, current size' "$Wc_c"
  368. rm -f _shar_wnt_.tmp
  369. fi
  370. # ============= xarchie-2.0.6/about.xbm ==============
  371. if test -f 'xarchie-2.0.6/about.xbm' -a X"$1" != X"-c"; then
  372.     echo 'x - skipping xarchie-2.0.6/about.xbm (File already exists)'
  373.     rm -f _shar_wnt_.tmp
  374. else
  375. > _shar_wnt_.tmp
  376. echo 'x - extracting xarchie-2.0.6/about.xbm (Text)'
  377. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/about.xbm' &&
  378. #define about_width 64
  379. #define about_height 64
  380. static char about_bits[] = {
  381. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00,
  382. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
  383. X   0x00, 0x90, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x28, 0x00,
  384. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00,
  385. X   0x00, 0x50, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x27, 0x00,
  386. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
  387. X   0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  388. X   0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0xc0, 0xff, 0x00,
  389. X   0x00, 0x08, 0x40, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0xf8, 0x7f, 0x00,
  390. X   0x00, 0x40, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xa1, 0x00,
  391. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00,
  392. X   0x00, 0x40, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x9e, 0x00,
  393. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
  394. X   0x00, 0xc0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  395. X   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
  396. X   0x00, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01,
  397. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  398. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  399. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  400. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  401. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  402. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  403. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  404. X   0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
  405. X   0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xff, 0x7f, 0x01,
  406. X   0x00, 0x00, 0x00, 0x00, 0xa0, 0x55, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00,
  407. X   0xa0, 0xaa, 0x6a, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xfd, 0x5f, 0x01,
  408. X   0x00, 0x00, 0x00, 0x00, 0xa0, 0x06, 0x68, 0x01, 0x00, 0xc0, 0xff, 0x00,
  409. X   0xa0, 0xfd, 0x5f, 0x01, 0x00, 0x40, 0x80, 0x00, 0xa0, 0x26, 0x69, 0x01,
  410. X   0x00, 0x40, 0x9e, 0x00, 0xa0, 0x25, 0x59, 0x01, 0x00, 0x40, 0xa1, 0x00,
  411. X   0xa0, 0xfe, 0x6f, 0x01, 0x00, 0x40, 0xa1, 0x00, 0xa0, 0x05, 0x58, 0x01,
  412. X   0x00, 0x40, 0xa1, 0x00, 0xa0, 0xfe, 0x6f, 0x01, 0x00, 0x40, 0x9e, 0x00,
  413. X   0xa0, 0x55, 0x55, 0x01, 0x00, 0x40, 0x80, 0x00, 0xa0, 0xaa, 0x6a, 0x01,
  414. X   0x00, 0xc0, 0xff, 0x00, 0xa0, 0xff, 0x7f, 0x01, 0x00, 0x00, 0x00, 0x00,
  415. X   0x20, 0x00, 0x00, 0x01, 0x00, 0xc0, 0xff, 0x00, 0xe0, 0xff, 0xff, 0x01,
  416. X   0x00, 0x20, 0x00, 0x01, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0x01,
  417. X   0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02,
  418. X   0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
  419. X   0xf0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  420. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  421. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  422. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  423. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  424. SHAR_EOF
  425. chmod 0644 xarchie-2.0.6/about.xbm ||
  426. echo 'restore of xarchie-2.0.6/about.xbm failed'
  427. Wc_c="`wc -c < 'xarchie-2.0.6/about.xbm'`"
  428. test 3278 -eq "$Wc_c" ||
  429.     echo 'xarchie-2.0.6/about.xbm: original size 3278, current size' "$Wc_c"
  430. rm -f _shar_wnt_.tmp
  431. fi
  432. # ============= xarchie-2.0.6/actions.c ==============
  433. if test -f 'xarchie-2.0.6/actions.c' -a X"$1" != X"-c"; then
  434.     echo 'x - skipping xarchie-2.0.6/actions.c (File already exists)'
  435.     rm -f _shar_wnt_.tmp
  436. else
  437. > _shar_wnt_.tmp
  438. echo 'x - extracting xarchie-2.0.6/actions.c (Text)'
  439. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/actions.c' &&
  440. /*
  441. X * actions.c : Widget action procedures
  442. X *
  443. X * Other modules also define actions, and call XtAppAddActions() when
  444. X * they are initialized.
  445. X *
  446. X * George Ferguson, ferguson@cs.rochester.edu, 2 Nov 1991.
  447. X * Version 2.0: 23 Apr 1993.
  448. X */
  449. X
  450. #include <stdio.h>
  451. #include <X11/Intrinsic.h>
  452. #include "xarchie.h"
  453. #include "browser.h"
  454. #include "types.h"
  455. #include "appres.h"
  456. #include "actions.h"
  457. #include "file-panel.h"
  458. #include "ftp-actions.h"
  459. #include "about.h"
  460. #ifdef HELP
  461. # include "help.h"
  462. #endif
  463. #include "query.h"
  464. #include "regex.h"
  465. #include "xutil.h"
  466. #include "stringdefs.h"
  467. #include "alert.h"
  468. #include "confirm.h"
  469. #include "debug.h"
  470. extern void abortDirsend();        /* dirsend.c */
  471. extern void ftpAbortTransfer();        /* ftp-actions.c */
  472. X
  473. /*
  474. X * Functions defined here
  475. X */
  476. void initActions();
  477. X
  478. static void quitAction();
  479. static void queryAction(),abortAction(),queryOrAbortAction();
  480. static void queryHostAction(),queryLocationAction();
  481. static void shiftDownAction(),shiftUpAction(),shiftTopAction();
  482. static void openAllAction(),openFilesAction(),openDirectoriesAction();
  483. static void getAction();
  484. X
  485. /*
  486. X * Data defined here:
  487. X */
  488. static XtActionsRec actionTable[] = {
  489. X    { "quit",            quitAction },
  490. X    { "query",            queryAction },
  491. X    { "abort",            abortAction },
  492. X    { "query-or-abort",        queryOrAbortAction },
  493. X    { "query-host",        queryHostAction },
  494. X    { "query-location",        queryLocationAction },
  495. X    { "browser-down",        shiftDownAction },
  496. X    { "browser-up",        shiftUpAction },
  497. X    { "browser-top",        shiftTopAction },
  498. X    { "browser-open-files",    openFilesAction },
  499. X    { "browser-open-directories",    openDirectoriesAction },
  500. X    { "browser-open-all",    openAllAction },
  501. X    { "ftp-get",        getAction },
  502. };
  503. X
  504. /*    -    -    -    -    -    -    -    -    */
  505. X
  506. void
  507. initActions()
  508. {
  509. X    XtAppAddActions(appContext,actionTable,XtNumber(actionTable));
  510. X    initFtpActions();
  511. X    initFilePanelActions();
  512. X    initAboutActions();
  513. #ifdef HELP
  514. X    initHelpActions();
  515. #endif
  516. }
  517. X
  518. /*    -    -    -    -    -    -    -    -    */
  519. X
  520. #define ACTION_PROC(NAME)    void NAME(w,event,params,num_params) \
  521. X                    Widget w; \
  522. X                    XEvent *event; \
  523. X                    String *params; \
  524. X                    Cardinal *num_params;
  525. X
  526. /*ARGSUSED*/
  527. static
  528. ACTION_PROC(quitAction)
  529. {
  530. X    bye(0);
  531. }
  532. X
  533. /*ARGSUSED*/
  534. static
  535. ACTION_PROC(queryAction)
  536. {
  537. X    char *s;
  538. X    int len;
  539. X    Boolean gif;
  540. X
  541. X    if (getBrowserState() != BROWSER_READY) {
  542. X    /* Don't do anything using popups since we could be in dirsend()
  543. X       by now. */
  544. X    XBell(display,0);
  545. X    return;
  546. X    }
  547. X    if ((s=getWidgetString(searchText)) == NULL || *s == '\0') {
  548. X    alert0("No search term specified.");
  549. X    return;
  550. X    }
  551. #ifndef DONT_CATCH_GIFS
  552. X    len = strlen(s);
  553. X    gif = False;
  554. X    switch (appResources.searchType) {
  555. X    case GfExact:
  556. X        gif = ((len > 4 &&
  557. X            (!strcmp(s+len-4,".gif") || !strcmp(s+len-4,".GIF"))) ||
  558. X           (len > 6 &&
  559. X            (!strcmp(s+len-6,".gif.Z") || !strcmp(s+len-6,".GIF.Z"))));
  560. X        break;
  561. X    case GfSubstr:
  562. X    case GfExactSubstr:
  563. X    case GfSubcase:
  564. X    case GfExactSubcase:
  565. X        gif = (strstr(s,"gif") || strstr(s,"GIF"));
  566. X        break;
  567. X    case GfRegexp:
  568. X    case GfExactRegexp:
  569. X        gif = (re_comp(s) == NULL &&
  570. X           (re_exec("@PrObAbLyNoTaFiLe@.gif") ||
  571. X            re_exec("@PrObAbLyNoTaFiLe@.gif.Z")));
  572. X        break;
  573. X    }
  574. X    if (gif) {
  575. X    if (!confirm0("Your search term will match GIFs. Do it anyway?"))
  576. X        return;
  577. X    else if (appResources.niceLevel <= 0 &&
  578. X         !confirm0("Really do it without increasing niceness?"))
  579. X        return;
  580. X    }
  581. #endif /* DONT_CATCH_GIFS */
  582. X    /* We're about to do the query, so disable querying */
  583. X    setBrowserState(BROWSER_DIRSEND);
  584. X    queryItemAndParse(s);
  585. X    /* Re-enable querying */
  586. X    setBrowserState(BROWSER_READY);
  587. }
  588. X
  589. /*ARGSUSED*/
  590. static
  591. ACTION_PROC(abortAction)
  592. {
  593. X    DEBUG0("abortAction...\n");
  594. X    XtSetSensitive(abortButton,False);
  595. X    switch (getBrowserState()) {
  596. X    case BROWSER_DIRSEND:
  597. X        abortDirsend();
  598. X        break;
  599. X    case BROWSER_FTP:
  600. X        ftpAbortTransfer();
  601. X        break;
  602. X    }
  603. X    DEBUG0("abortAction: done\n");
  604. }
  605. X
  606. /*ARGSUSED*/
  607. static
  608. ACTION_PROC(queryOrAbortAction)
  609. {
  610. X    DEBUG0("queryOrAbortAction...\n");
  611. X    if (getBrowserState() == BROWSER_READY)
  612. X    XtCallActionProc(toplevel,"query",NULL,NULL,0);
  613. X    else
  614. X    XtCallActionProc(toplevel,"abort",NULL,NULL,0);
  615. X    DEBUG0("queryOrAbortAction: done\n");
  616. }
  617. X
  618. /*ARGSUSED*/
  619. static
  620. ACTION_PROC(queryHostAction)
  621. {
  622. X    char *host;
  623. X
  624. X    if (getBrowserState() != BROWSER_READY) {
  625. X    XBell(display,0);
  626. X    return;
  627. X    }
  628. X    if ((host=getWidgetString(hostText)) == NULL || *host == '\0') {
  629. X    alert0("No host specified.");
  630. X    return;
  631. X    }
  632. X    /* We're about to do the query, so disable querying */
  633. X    setBrowserState(BROWSER_DIRSEND);
  634. X    queryHostAndParse(host);
  635. X    /* Re-enable querying */
  636. X    setBrowserState(BROWSER_READY);
  637. }
  638. X
  639. /*ARGSUSED*/
  640. static
  641. ACTION_PROC(queryLocationAction)
  642. {
  643. X    char *host,*loc;
  644. X
  645. X    if (getBrowserState() != BROWSER_READY) {
  646. X    XBell(display,0);
  647. X    return;
  648. X    }
  649. X    if ((host=getWidgetString(hostText)) == NULL || *host == '\0') {
  650. X    alert0("No host specified.");
  651. X    return;
  652. X    }
  653. X    if ((loc=getWidgetString(locationText)) == NULL || *loc == '\0') {
  654. X    alert0("No host specified.");
  655. X    return;
  656. X    }
  657. X    /* We're about to do the query, so disable querying */
  658. X    setBrowserState(BROWSER_DIRSEND);
  659. X    queryLocationAndParse(host,loc);
  660. X    /* Re-enable querying */
  661. X    setBrowserState(BROWSER_READY);
  662. }
  663. X
  664. /*    -    -    -    -    -    -    -    -    */
  665. X
  666. /*ARGSUSED*/
  667. static
  668. ACTION_PROC(shiftDownAction)
  669. {
  670. X    shiftBrowserDown();
  671. }
  672. X
  673. /*ARGSUSED*/
  674. static
  675. ACTION_PROC(shiftUpAction)
  676. {
  677. X    shiftBrowserUp();
  678. }
  679. X
  680. /*ARGSUSED*/
  681. static
  682. ACTION_PROC(shiftTopAction)
  683. {
  684. X    shiftBrowserTop();
  685. }
  686. X
  687. /*ARGSUSED*/
  688. static
  689. ACTION_PROC(openAllAction)
  690. {
  691. X    if (getBrowserState() != BROWSER_READY) {
  692. X    XBell(display,0);
  693. X    return;
  694. X    }
  695. X    if (openBrowserAll() == 1)
  696. X    shiftBrowserDown();
  697. }
  698. X
  699. /*ARGSUSED*/
  700. static
  701. ACTION_PROC(openDirectoriesAction)
  702. {
  703. X    if (getBrowserState() != BROWSER_READY) {
  704. X    XBell(display,0);
  705. X    return;
  706. X    }
  707. X    if (openBrowserDirectories() == 1)
  708. X    shiftBrowserDown();
  709. }
  710. X
  711. /*ARGSUSED*/
  712. static
  713. ACTION_PROC(openFilesAction)
  714. {
  715. X    if (getBrowserState() != BROWSER_READY) {
  716. X    XBell(display,0);
  717. X    return;
  718. X    }
  719. X    openBrowserFiles();
  720. }
  721. X
  722. /*    -    -    -    -    -    -    -    -    */
  723. X
  724. /*ARGSUSED*/
  725. static
  726. ACTION_PROC(getAction)
  727. {
  728. X    if (getBrowserState() != BROWSER_READY) {
  729. X    XBell(display,0);
  730. X    return;
  731. X    }
  732. X    DEBUG0("getAction...\n");
  733. X    ftpGetSelectedItems();
  734. X    DEBUG0("getAction: done\n");
  735. }
  736. SHAR_EOF
  737. chmod 0644 xarchie-2.0.6/actions.c ||
  738. echo 'restore of xarchie-2.0.6/actions.c failed'
  739. Wc_c="`wc -c < 'xarchie-2.0.6/actions.c'`"
  740. test 6248 -eq "$Wc_c" ||
  741.     echo 'xarchie-2.0.6/actions.c: original size 6248, current size' "$Wc_c"
  742. rm -f _shar_wnt_.tmp
  743. fi
  744. # ============= xarchie-2.0.6/actions.h ==============
  745. if test -f 'xarchie-2.0.6/actions.h' -a X"$1" != X"-c"; then
  746.     echo 'x - skipping xarchie-2.0.6/actions.h (File already exists)'
  747.     rm -f _shar_wnt_.tmp
  748. else
  749. > _shar_wnt_.tmp
  750. echo 'x - extracting xarchie-2.0.6/actions.h (Text)'
  751. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/actions.h' &&
  752. /*
  753. X * actions.h : Definition of global action procedures
  754. X *
  755. X * George Ferguson, ferguson@cs.rochester.edu, 20 Oct 1991.
  756. X * Version 2.0: 23 Apr 1993.
  757. X */
  758. X
  759. #ifndef _ACTIONS_H
  760. #define _ACTIONS_H
  761. X
  762. extern void initActions();
  763. X
  764. #endif /* _ACTIONS_H */
  765. SHAR_EOF
  766. chmod 0644 xarchie-2.0.6/actions.h ||
  767. echo 'restore of xarchie-2.0.6/actions.h failed'
  768. Wc_c="`wc -c < 'xarchie-2.0.6/actions.h'`"
  769. test 245 -eq "$Wc_c" ||
  770.     echo 'xarchie-2.0.6/actions.h: original size 245, current size' "$Wc_c"
  771. rm -f _shar_wnt_.tmp
  772. fi
  773. # ============= xarchie-2.0.6/alert.c ==============
  774. if test -f 'xarchie-2.0.6/alert.c' -a X"$1" != X"-c"; then
  775.     echo 'x - skipping xarchie-2.0.6/alert.c (File already exists)'
  776.     rm -f _shar_wnt_.tmp
  777. else
  778. > _shar_wnt_.tmp
  779. echo 'x - extracting xarchie-2.0.6/alert.c (Text)'
  780. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/alert.c' &&
  781. /*
  782. X * alert.c : Alert popup
  783. X *
  784. X * George Ferguson, ferguson@cs.rochester.edu, 23 Apr 1993.
  785. X */
  786. X
  787. #include <X11/Intrinsic.h>
  788. #include "popups.h"
  789. X
  790. /*
  791. X * Functions defined here:
  792. X */
  793. void alert0(),alert1(),alert2();
  794. static void alertCallback();
  795. X
  796. /*
  797. X * Data defined here:
  798. X */
  799. static Widget alertShell;
  800. X
  801. /*    -    -    -    -    -    -    -    -    */
  802. X
  803. void
  804. alert0(str)
  805. char *str;
  806. {
  807. X    if (alertShell == NULL)
  808. X    alertShell = createPopup("alert",1,alertCallback);
  809. X    setPopupLabel(alertShell,"alert",str);
  810. X    popupMainLoop(alertShell);
  811. }
  812. void
  813. alert1(fmt,arg)
  814. char *fmt,*arg;
  815. {
  816. X    char buf[256];
  817. X
  818. X    sprintf(buf,fmt,arg);
  819. X    alert0(buf);
  820. }
  821. X
  822. void
  823. alert2(fmt,arg1,arg2)
  824. char *fmt,*arg1,*arg2;
  825. {
  826. X    char buf[256];
  827. X
  828. X    sprintf(buf,fmt,arg1,arg2);
  829. X    alert0(buf);
  830. }
  831. X
  832. /*ARGSUSED*/
  833. static void
  834. alertCallback(w,client_data,call_data)
  835. Widget w;
  836. XXtPointer client_data;        /* button number */
  837. XXtPointer call_data;
  838. {
  839. X    popupDone();
  840. }
  841. SHAR_EOF
  842. chmod 0644 xarchie-2.0.6/alert.c ||
  843. echo 'restore of xarchie-2.0.6/alert.c failed'
  844. Wc_c="`wc -c < 'xarchie-2.0.6/alert.c'`"
  845. test 897 -eq "$Wc_c" ||
  846.     echo 'xarchie-2.0.6/alert.c: original size 897, current size' "$Wc_c"
  847. rm -f _shar_wnt_.tmp
  848. fi
  849. # ============= xarchie-2.0.6/alert.h ==============
  850. if test -f 'xarchie-2.0.6/alert.h' -a X"$1" != X"-c"; then
  851.     echo 'x - skipping xarchie-2.0.6/alert.h (File already exists)'
  852.     rm -f _shar_wnt_.tmp
  853. else
  854. > _shar_wnt_.tmp
  855. echo 'x - extracting xarchie-2.0.6/alert.h (Text)'
  856. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/alert.h' &&
  857. /*
  858. X * alert.h : External defs for alert functions
  859. X *
  860. X * George Ferguson, ferguson@cs.rochester.edu, 23 Apr 1993.
  861. X */
  862. X
  863. #ifndef _ALERT_H
  864. #define _ALERT_H
  865. X
  866. extern void alert0(),alert1(),alert2();
  867. X
  868. #endif
  869. SHAR_EOF
  870. chmod 0644 xarchie-2.0.6/alert.h ||
  871. echo 'restore of xarchie-2.0.6/alert.h failed'
  872. Wc_c="`wc -c < 'xarchie-2.0.6/alert.h'`"
  873. test 201 -eq "$Wc_c" ||
  874.     echo 'xarchie-2.0.6/alert.h: original size 201, current size' "$Wc_c"
  875. rm -f _shar_wnt_.tmp
  876. fi
  877. # ============= xarchie-2.0.6/appres.h ==============
  878. if test -f 'xarchie-2.0.6/appres.h' -a X"$1" != X"-c"; then
  879.     echo 'x - skipping xarchie-2.0.6/appres.h (File already exists)'
  880.     rm -f _shar_wnt_.tmp
  881. else
  882. > _shar_wnt_.tmp
  883. echo 'x - extracting xarchie-2.0.6/appres.h (Text)'
  884. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/appres.h' &&
  885. /*
  886. X * appres.h : External defs for files needing the application
  887. X *    resources.
  888. X *
  889. X * George Ferguson, ferguson@cs.rochester.edu, 12 Nov 1991.
  890. X * Version 2.0: 23 Apr 1993.
  891. X */
  892. X
  893. #ifndef APP_RESOURCES_H
  894. #define APP_RESOURCES_H
  895. X
  896. #include "types.h"        /* for SearchType and SortType */
  897. X
  898. typedef struct _AppResources {
  899. X    SearchType    searchType;
  900. X    SortType    sortType;
  901. X    String    archieHost;
  902. X    int        numHosts;
  903. X    int        maxHits;
  904. X    int        offset;
  905. X    int        timeout;
  906. X    int        retries;
  907. X    int        niceLevel;
  908. X    String    ftpLocalDir;
  909. X    String    ftpType;
  910. X    Boolean    ftpPrompt;
  911. X    Boolean    ftpTrace;
  912. X    Boolean    ftpStrip;
  913. X    String    ftpMailAddress;
  914. X    int        debugLevel;
  915. X    Boolean    fileWriteOnePerLine;
  916. X    XFontStruct    *xarchieFont;
  917. X    XFontStruct    *xarchieBoldFont;
  918. X    String    hostWeights;
  919. X    Boolean    autoScroll;
  920. X    Boolean    pasteBuffer;
  921. X    String    visualType;
  922. X    Pixmap    defaultIcon;
  923. X    Pixmap    busyIcon;
  924. } AppResources;
  925. X
  926. extern AppResources appResources;
  927. X
  928. #endif /* APP_RESOURCES_H */
  929. SHAR_EOF
  930. chmod 0644 xarchie-2.0.6/appres.h ||
  931. echo 'restore of xarchie-2.0.6/appres.h failed'
  932. Wc_c="`wc -c < 'xarchie-2.0.6/appres.h'`"
  933. test 972 -eq "$Wc_c" ||
  934.     echo 'xarchie-2.0.6/appres.h: original size 972, current size' "$Wc_c"
  935. rm -f _shar_wnt_.tmp
  936. fi
  937. # ============= xarchie-2.0.6/archie.h ==============
  938. if test -f 'xarchie-2.0.6/archie.h' -a X"$1" != X"-c"; then
  939.     echo 'x - skipping xarchie-2.0.6/archie.h (File already exists)'
  940.     rm -f _shar_wnt_.tmp
  941. else
  942. > _shar_wnt_.tmp
  943. echo 'x - extracting xarchie-2.0.6/archie.h (Text)'
  944. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/archie.h' &&
  945. /*
  946. X * archie.h : Definitions for the programmatic Prospero interface to Archie
  947. X *
  948. X *     Written by Brendan Kehoe (brendan@cs.widener.edu), 
  949. X *                George Ferguson (ferguson@cs.rochester.edu), and
  950. X *                Clifford Neuman (bcn@isi.edu).
  951. X */
  952. X
  953. /*
  954. X * Archie server (one of):   archie.sura.net
  955. X *                 archie.mcgill.ca
  956. X *                           archie.funet.fi
  957. X *                           archie.au
  958. X */
  959. #define ARCHIE_HOST "ARCHIE.SURA.NET"
  960. X
  961. /*
  962. X * Default value for max hits.  Note that this is normally different
  963. X * for different client implementations.  Doing so makes it easier to
  964. X * collect statistics on the use of the various clients.
  965. X */
  966. #ifdef VMS
  967. # define    MAX_HITS    98    /* VMS Client */
  968. #else
  969. # ifdef XARCHIE
  970. #  define    MAX_HITS    99    /* X Client */
  971. # else
  972. #  define    MAX_HITS    95    /* Normal client */
  973. # endif
  974. #endif
  975. X
  976. /*
  977. X * CLIENT_VERSION may be used to identify the version of the client if 
  978. X * distributed separately from the Prospero distribution.  The version
  979. X * command should then identify both the client version and the Prospero
  980. X * version identifiers.   
  981. X */
  982. #ifdef XARCHIE
  983. # define CLIENT_VERSION    "1.3-X"
  984. #else
  985. # define CLIENT_VERSION "1.2"
  986. #endif
  987. X
  988. /* Procedures from user/aquery.c */
  989. X
  990. /* archie_query(host,string,max_hits,offset,query_type,cmp_proc,flags) */
  991. extern VLINK archie_query(); 
  992. X
  993. /* defcmplink(p,q) and invdatecmplink(p,q)                             */
  994. extern int defcmplink();    /* Compare by host then by filename    */
  995. extern int invdatecmplink();    /* Compare links inverted by date      */
  996. X
  997. /* Definitions for the comparison procedures                           */
  998. #define AQ_DEFCMP    defcmplink
  999. #define AQ_INVDATECMP    invdatecmplink
  1000. X
  1001. /* Flags                                                               */
  1002. #define AQ_NOSORT    0x01    /* Don't sort                          */
  1003. #define AQ_NOTRANS    0x02    /* Don't translate Archie responses    */
  1004. SHAR_EOF
  1005. chmod 0644 xarchie-2.0.6/archie.h ||
  1006. echo 'restore of xarchie-2.0.6/archie.h failed'
  1007. Wc_c="`wc -c < 'xarchie-2.0.6/archie.h'`"
  1008. test 1882 -eq "$Wc_c" ||
  1009.     echo 'xarchie-2.0.6/archie.h: original size 1882, current size' "$Wc_c"
  1010. rm -f _shar_wnt_.tmp
  1011. fi
  1012. # ============= xarchie-2.0.6/atalloc.c ==============
  1013. if test -f 'xarchie-2.0.6/atalloc.c' -a X"$1" != X"-c"; then
  1014.     echo 'x - skipping xarchie-2.0.6/atalloc.c (File already exists)'
  1015.     rm -f _shar_wnt_.tmp
  1016. else
  1017. > _shar_wnt_.tmp
  1018. echo 'x - extracting xarchie-2.0.6/atalloc.c (Text)'
  1019. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/atalloc.c' &&
  1020. /*
  1021. X * Copyright (c) 1989, 1990 by the University of Washington
  1022. X *
  1023. X * For copying and distribution information, please see the file
  1024. X * <copyright.h>.
  1025. X *
  1026. X * v1.1.2 - gf  11/02/91 - renamed ZERO() to BZERO() for X
  1027. X */
  1028. X
  1029. #include <copyright.h>
  1030. #include <stdio.h>
  1031. X
  1032. #include <pfs.h>
  1033. #include "config.h"    /* gf */
  1034. #include "stringdefs.h"    /* for correct definition of bzero, used by BZERO */
  1035. X
  1036. static PATTRIB    lfree = NULL;
  1037. int        pattrib_count = 0;
  1038. int        pattrib_max = 0;
  1039. X
  1040. /*
  1041. X * atalloc - allocate and initialize vlink structure
  1042. X *
  1043. X *    ATALLOC returns a pointer to an initialized structure of type
  1044. X *    PATTRIB.  If it is unable to allocate such a structure, it
  1045. X *    returns NULL.
  1046. X */
  1047. PATTRIB
  1048. atalloc()
  1049. X    {
  1050. X    PATTRIB    at;
  1051. X    if(lfree) {
  1052. X        at = lfree;
  1053. X        lfree = lfree->next;
  1054. X    }
  1055. X    else {
  1056. X        at = (PATTRIB) malloc(sizeof(PATTRIB_ST));
  1057. X        if (!at) return(NULL);
  1058. X        pattrib_max++;
  1059. X    }
  1060. X
  1061. X    pattrib_count++;
  1062. X
  1063. X    BZERO(at);
  1064. X    /* Initialize and fill in default values; all items are
  1065. X       0 [or NULL] save precedence */
  1066. X    at->precedence = ATR_PREC_OBJECT;
  1067. X
  1068. X    return(at);
  1069. X    }
  1070. X
  1071. /*
  1072. X * atfree - free a PATTRIB structure
  1073. X *
  1074. X *    ATFREE takes a pointer to a PATTRRIB structure and adds it to
  1075. X *    the free list for later reuse.
  1076. X */
  1077. void
  1078. atfree(at)
  1079. X    PATTRIB    at;
  1080. X    {
  1081. X    if(at->aname) stfree(at->aname);
  1082. X
  1083. X    if((strcmp(at->avtype,"ASCII") == 0) && at->value.ascii) 
  1084. X        stfree(at->value.ascii);
  1085. X    if((strcmp(at->avtype,"LINK") == 0) && at->value.link) 
  1086. X        vlfree(at->value.link);
  1087. X    
  1088. X    if(at->avtype) stfree(at->avtype);
  1089. X
  1090. X    at->next = lfree;
  1091. X    at->previous = NULL;
  1092. X    lfree = at;
  1093. X    pattrib_count--;
  1094. X    }
  1095. X
  1096. /*
  1097. X * atlfree - free a PATTRIB structure
  1098. X *
  1099. X *    ATLFREE takes a pointer to a PATTRIB structure frees it and any linked
  1100. X *    PATTRIB structures.  It is used to free an entrie list of PATTRIB
  1101. X *    structures.
  1102. X */
  1103. void
  1104. atlfree(at)
  1105. X    PATTRIB    at;
  1106. X    {
  1107. X    PATTRIB    nxt;
  1108. X
  1109. X    while(at != NULL) {
  1110. X        nxt = at->next;
  1111. X        atfree(at);
  1112. X        at = nxt;
  1113. X    }
  1114. X    }
  1115. X
  1116. SHAR_EOF
  1117. chmod 0644 xarchie-2.0.6/atalloc.c ||
  1118. echo 'restore of xarchie-2.0.6/atalloc.c failed'
  1119. Wc_c="`wc -c < 'xarchie-2.0.6/atalloc.c'`"
  1120. test 1929 -eq "$Wc_c" ||
  1121.     echo 'xarchie-2.0.6/atalloc.c: original size 1929, current size' "$Wc_c"
  1122. rm -f _shar_wnt_.tmp
  1123. fi
  1124. # ============= xarchie-2.0.6/browser.c ==============
  1125. if test -f 'xarchie-2.0.6/browser.c' -a X"$1" != X"-c"; then
  1126.     echo 'x - skipping xarchie-2.0.6/browser.c (File already exists)'
  1127.     rm -f _shar_wnt_.tmp
  1128. else
  1129. > _shar_wnt_.tmp
  1130. echo 'x - extracting xarchie-2.0.6/browser.c (Text)'
  1131. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/browser.c' &&
  1132. /*
  1133. X * browser.c : Device-independent browser routines
  1134. X *
  1135. X * George Ferguson, ferguson@cs.rochester.edu, 23 Apr 1993.
  1136. X * 28 Apr 1993: Remove some bogus status0("Ready") calls.
  1137. X */
  1138. X
  1139. #include <stdio.h>
  1140. #include "stringdefs.h"
  1141. #include "pfs.h"
  1142. #include "db.h"
  1143. #include "xtypes.h"
  1144. #include "appres.h"
  1145. #include "query.h"
  1146. #include "actions.h"
  1147. #include "browser.h"
  1148. #include "selection.h"
  1149. #include "display.h"
  1150. #include "ftp-actions.h"
  1151. #include "alert.h"
  1152. #include "status.h"
  1153. #include "debug.h"
  1154. extern DbEntry *db;
  1155. X
  1156. /*
  1157. X * Functions defined here:
  1158. X */
  1159. void resetBrowser();
  1160. int paneDepth();
  1161. void selectBrowserItem(),unselectBrowserItem();
  1162. void displayEntries();
  1163. void resortBrowser();
  1164. int openBrowserAll(),openBrowserDirectories(),openBrowserFiles();
  1165. void shiftBrowserDown(), shiftBrowserUp(), shiftBrowserTop();
  1166. void setBrowserState();
  1167. int getBrowserState();
  1168. X
  1169. static void clearInfoForDepth(),displayInfoForDepth();
  1170. static void updateButtons(),resetParentEntries();
  1171. static void openBrowserDirectory();
  1172. X
  1173. /*
  1174. X * Data defined here:
  1175. X */
  1176. /*
  1177. X * These are the parents of the heads of the lists being displayed in
  1178. X * the browser panes.
  1179. X */
  1180. static DbEntry *parentEntries[MAX_DEPTH];
  1181. X
  1182. /*
  1183. X * This is the index of the leftmost pane's contents in the previous arrays.
  1184. X */
  1185. static int currentRootDepth;
  1186. X
  1187. static int browserState;
  1188. X
  1189. /*    -    -    -    -    -    -    -    -    */
  1190. X
  1191. void
  1192. resetBrowser()
  1193. {
  1194. X    clearBrowser();
  1195. X    currentRootDepth = 0;
  1196. X    resetSelections(0);
  1197. X    resetParentEntries(0);
  1198. X    setUpSensitive(0);
  1199. X    setDownSensitive(0);
  1200. }
  1201. X
  1202. int
  1203. paneDepth(pane)
  1204. int pane;
  1205. {
  1206. X    return(currentRootDepth+pane);
  1207. }
  1208. X
  1209. #ifdef DEBUG
  1210. /*ARGSUSED*/
  1211. static void
  1212. doPrint(dbp,list_index)
  1213. DbEntry dbp;
  1214. int list_index;
  1215. {
  1216. X    printf("%d ",list_index);
  1217. }
  1218. #endif
  1219. X
  1220. void
  1221. selectBrowserItem(pane,item)
  1222. int pane,item;
  1223. {
  1224. X    DbEntry *dbp;
  1225. X    int depth;
  1226. X    
  1227. X    /* Adjust for shifted browser */
  1228. X    depth = paneDepth(pane);
  1229. #ifdef DEBUG
  1230. X    fprintf(stderr,"selecting item %d, pane=%d, depth=%d\n",item,pane,depth);
  1231. X    fprintf(stderr,"  before: selections[] = ");
  1232. X    if (hasSelection(depth))
  1233. X    forEachSelectedItemAtDepth(depth,doPrint);
  1234. X    else
  1235. X    fprintf(stderr,"None");
  1236. X    fprintf(stderr,"\n");
  1237. #endif
  1238. X    if (isSelected(depth,item)) {
  1239. X    DEBUG1("item %d already selected\n",item);
  1240. X    return;
  1241. X    }
  1242. X    dbp = findEntryFromIndex(parentEntries[depth],item);
  1243. X    DEBUG2("selected item is \"%s\"(%lx)\n",dbp->name,dbp);
  1244. X    DEBUG1("clearing parents depth >= %d\n",depth+1);
  1245. X    resetParentEntries(depth+1);
  1246. X    DEBUG1("resetting selections for depth >= %d\n",depth+1);
  1247. X    resetSelections(depth+1);
  1248. X    DEBUG3("adding selection at depth %d = \"%s\"(%lx)\n",depth,dbp->name,dbp);
  1249. X    addSelection(depth,dbp,item);
  1250. X    DEBUG3("setting parentEntries[%d] = \"%s\"(%lx)\n",depth+1,dbp->name,dbp);
  1251. X    parentEntries[depth+1] = dbp;
  1252. X    DEBUG3("displaying entry \"%s\"(%lx) in pane %d\n",dbp->name,dbp,pane);
  1253. X    /* Highlight the selected item */
  1254. X    redrawSelectionsForPane(pane);
  1255. X    /* Show selected info */
  1256. X    displayInfoForDepth(depth);
  1257. X    /* If we're not at the rightmost pane, then show the choices. */
  1258. X    if (pane < NUM_BROWSER_PANES-1) {
  1259. X    displayEntries(dbp,pane+1);
  1260. X    }
  1261. #ifdef DEBUG
  1262. X    fprintf(stderr,"  after: selections[] = ");
  1263. X    if (hasSelection(depth))
  1264. X    forEachSelectedItemAtDepth(depth,doPrint);
  1265. X    else
  1266. X    fprintf(stderr,"None");
  1267. X    fprintf(stderr,"\n");
  1268. X    fprintf(stderr,"done selecting item\n");
  1269. #endif
  1270. }
  1271. X
  1272. void
  1273. unselectBrowserItem(pane,item)
  1274. int pane,item;
  1275. {
  1276. X     int depth,i;
  1277. X    
  1278. X    /* Adjust for shifted browser */
  1279. X    depth = paneDepth(pane);
  1280. #ifdef DEBUG
  1281. X    fprintf(stderr,"unselecting item %d, pane=%d, depth=%d\n",item,pane,depth);
  1282. X    fprintf(stderr,"  before: selections[] = ");
  1283. X    if (hasSelection(depth))
  1284. X    forEachSelectedItemAtDepth(depth,doPrint);
  1285. X    else
  1286. X    fprintf(stderr,"None");
  1287. X    fprintf(stderr,"\n");
  1288. #endif
  1289. X    unhighlightBrowserItem(pane,item);
  1290. X    /* Clear all panes below this one */
  1291. X    for (i=NUM_BROWSER_PANES-1; i > pane; i--)
  1292. X    clearBrowserPane(i);
  1293. X    /* Clear all info including this one since de-selected */
  1294. X    clearInfoForDepth(depth);
  1295. X    DEBUG2("removing selection at depth %d = item %d\n",depth,item);
  1296. X    removeSelection(depth,NULL,item);
  1297. X    DEBUG1("clearing parents depth >= %d\n",depth+1);
  1298. X    resetParentEntries(depth+1);
  1299. #ifdef DEBUG
  1300. X    printf("  after: selections[] = ");
  1301. X    if (hasSelection(depth))
  1302. X    forEachSelectedItemAtDepth(depth,doPrint);
  1303. X    else
  1304. X    printf("None");
  1305. X    printf("\n");
  1306. X    fprintf(stderr,"done deselecting item\n");
  1307. #endif
  1308. }
  1309. X
  1310. static void
  1311. clearInfoForDepth(depth)
  1312. int depth;
  1313. {
  1314. X    switch (depth) {
  1315. X    case 0:    setHostText("");
  1316. X        /* fall through */
  1317. X    case 1:    setLocationText("");
  1318. X        /* fall through */
  1319. X    case 2:    setFileText("");
  1320. X        setSizeText("");
  1321. X        setModesText("");
  1322. X        setDateText("");
  1323. X        break;
  1324. X    }
  1325. X    DEBUG1("cleared info for depth %d\n",depth);
  1326. }
  1327. X
  1328. static void
  1329. displayInfoForDepth(depth)
  1330. int depth;
  1331. {
  1332. X    SelectedItem *item;
  1333. X    char buf[MAX_VPATH];
  1334. X    int i;
  1335. X
  1336. X    DEBUG1("  display info for depth %d:\n",depth);
  1337. X    if ((item=getSelection(0)) != NULL) {
  1338. X    setHostText(item->entry->name);
  1339. X    DEBUG1("    host: \"%s\"\n",item->entry->name);
  1340. X    }
  1341. X    /* Special case if location was selected */
  1342. X    if (depth == 1) {
  1343. X    if ((item=getSelection(1)) != NULL) {
  1344. X        setLocationText(item->entry->name);
  1345. X        DEBUG1("    loc: \"%s\"\n",item->entry->name);
  1346. X    }
  1347. X    } else {    /* Otherwise normal case, get location and file */
  1348. X    strcpy(buf,"");
  1349. X    for (i=1; i < depth; i++)
  1350. X        if ((item=getSelection(i)) != NULL) {
  1351. X        (void)strcat(buf,item->entry->name);
  1352. X        if (i < depth-1 &&
  1353. X            buf[strlen(buf)-1] != '/')
  1354. X            strcat(buf,"/");
  1355. X        }
  1356. X    setLocationText(buf);
  1357. X    DEBUG1("    loc: \"%s\"\n",buf);
  1358. X    if ((item=getSelection(depth)) != NULL) {
  1359. X        setFileText(item->entry->name);
  1360. #ifdef MSDOS
  1361. X        sprintf(buf,"%lu",item->entry->size);
  1362. #else
  1363. X        sprintf(buf,"%d",item->entry->size);
  1364. #endif
  1365. X        setSizeText(buf);
  1366. X        setModesText(item->entry->modes);
  1367. X        setDateText(item->entry->date);
  1368. X        DEBUG1("    file: \"%s\"\n",item->entry->name);
  1369. X    }
  1370. X    }
  1371. }
  1372. X
  1373. void
  1374. displayEntries(parent,pane)
  1375. DbEntry *parent;
  1376. int pane;
  1377. {
  1378. X    DbEntry *dbp;
  1379. X    SelectedItem *sel;
  1380. X    int i,depth;
  1381. X
  1382. X    depth = paneDepth(pane);
  1383. X    if (parent == NULL) {
  1384. X    fprintf(stderr,"DB error: attempt to display entries from NULL list");
  1385. X    return;
  1386. X    }
  1387. X    DEBUG3("displaying parent \"%s\" in pane %d (depth %d)\n",
  1388. X       (parent?parent->name:"<NIL>"),pane,depth);
  1389. X    /* Clear this and all subordinate panes */
  1390. X    for (i=pane; i < NUM_BROWSER_PANES; i++) {
  1391. X    DEBUG1("  clearing pane %d\n",i);
  1392. X    clearBrowserPane(i);
  1393. X    }
  1394. X    /* Set the strings to be displayed in this pane */
  1395. X    for (i=0, dbp=parent->entries; dbp != NULL; dbp=dbp->next) {
  1396. X    DEBUG2("  item %d: \"%s\"\n",i,dbp->name);
  1397. X    setBrowserItem(pane,i++,dbp->name);
  1398. X    }
  1399. X    /* If there's anything to display, display it */
  1400. X    if (i > 0)
  1401. X    redrawBrowserPane(pane);
  1402. X    /* If there's only one thing then select it */
  1403. X    if (i == 1) {
  1404. X    DEBUG0("  solo -> select\n");
  1405. X    addSelection(depth,parent->entries,0);
  1406. X    }
  1407. X    /* If there's something selected (either because we just selected the
  1408. X       only thing or because we're scrolling left), then redo the
  1409. X       highlighting and display the correct info. If we're not at the
  1410. X       rightmost pane, then recusively draw the next pane. */
  1411. X    if ((sel=getSelection(depth)) != NULL) {
  1412. X    redrawSelectionsForPane(pane);
  1413. X    displayInfoForDepth(depth);
  1414. X    if (pane < NUM_BROWSER_PANES - 1)
  1415. X        displayEntries(sel->entry,pane+1);
  1416. X    } else {
  1417. X    /* Otherwise there's nothing selected here */
  1418. X    clearInfoForDepth(depth);
  1419. X    }
  1420. X    /* Save which list is being displayed in the pane */
  1421. X    parentEntries[paneDepth(pane)] = parent;
  1422. X    /* Get the shift buttons right */
  1423. X    updateButtons();
  1424. }
  1425. X
  1426. static void
  1427. updateButtons()
  1428. {
  1429. X    SelectedItem *sel;
  1430. X
  1431. X    setUpSensitive(currentRootDepth > 0);
  1432. X    if ((sel=getSelection(currentRootDepth+NUM_BROWSER_PANES-1)) != NULL &&
  1433. X    sel->entry->entries != NULL)
  1434. X    setDownSensitive(1);
  1435. X    else
  1436. X    setDownSensitive(0);
  1437. }
  1438. X
  1439. static void
  1440. resetParentEntries(first)
  1441. int first;
  1442. {
  1443. X    int i;
  1444. X
  1445. X    for (i=first; i < MAX_DEPTH; i++)
  1446. X    parentEntries[i] = NULL;
  1447. }
  1448. X
  1449. /*    -    -    -    -    -    -    -    -    */
  1450. /* Resort the browser based on the appResources */
  1451. X
  1452. void
  1453. resortBrowser()
  1454. {
  1455. X    /* Reset browser to leftmost position */
  1456. X    DEBUG0("resortBrowser: resetting browser\n");
  1457. X    resetBrowser();
  1458. X    DEBUG0("resortBrowser: sorting entries\n");
  1459. X    switch(appResources.sortType) {
  1460. X    case GfName:
  1461. X        sortEntriesRecursively(db,cmpEntryNames);
  1462. X        break;
  1463. X    case GfDate:
  1464. X        sortEntriesRecursively(db,cmpEntryDates);
  1465. X        break;
  1466. X    case GfWeight:
  1467. X        sortEntriesRecursively(db,cmpEntryWeights);
  1468. X        break;
  1469. X    }
  1470. X    /* Display results in browser */
  1471. X    DEBUG0("resortBrowser: displaying entries\n");
  1472. X    displayEntries(db,0);
  1473. X    DEBUG0("resortBrowser: done\n");
  1474. }
  1475. X
  1476. /*    -    -    -    -    -    -    -    -    */
  1477. /* Routines to open (ie. expand) the browser */
  1478. X
  1479. static int numOpened;
  1480. X
  1481. /*
  1482. X * Open any selected items in the browser. Return the number of items
  1483. X * that were successfully opened.
  1484. X */
  1485. int
  1486. openBrowserAll()
  1487. {
  1488. X    DEBUG1("openBrowserAll: depth = %d\n",currentRootDepth);
  1489. X    if (!hasSelection(NUM_BROWSER_PANES-1)) {
  1490. X    alert0("You must select something to open.");
  1491. X    return(0);
  1492. X    }
  1493. X    numOpened = 0;
  1494. X    /* Do the directories */
  1495. X    forEachSelectedItem(openBrowserDirectory);
  1496. X    /* Do the files */
  1497. X    ftpOpenSelectedItems();
  1498. X    DEBUG1("done openBrowserAll, returning %d\n",numOpened);
  1499. X    return(numOpened);
  1500. }
  1501. X
  1502. int
  1503. openBrowserDirectories()
  1504. {
  1505. X    DEBUG1("openBrowserDirectories: depth = %d\n",currentRootDepth);
  1506. X    if (!hasSelection(2)) {
  1507. X    alert0("You must select a directory to open.");
  1508. X    return(0);
  1509. X    }
  1510. X    numOpened = 0;
  1511. X    forEachSelectedItem(openBrowserDirectory);
  1512. X    status0("Ready");
  1513. X    DEBUG1("done openBrowserDirectories, returning %d\n",numOpened);
  1514. X    return(numOpened);
  1515. }
  1516. X
  1517. int
  1518. openBrowserFiles()
  1519. {
  1520. X    DEBUG1("openBrowserFiles: depth = %d\n",currentRootDepth);
  1521. X    if (!hasSelection(2)) {
  1522. X    alert0("You must select a file to open.");
  1523. X    return(0);
  1524. X    }
  1525. X    numOpened = 0;
  1526. X    ftpOpenSelectedItems();
  1527. X    DEBUG1("done openBrowserFiles, returning %d\n",numOpened);
  1528. X    return(numOpened);
  1529. }
  1530. X
  1531. /*
  1532. X * Open a selected item. Ignore any selections that aren't directories.
  1533. X */
  1534. /*ARGSUSED*/
  1535. static void
  1536. openBrowserDirectory(dbp,list_index)
  1537. DbEntry *dbp;
  1538. int list_index;
  1539. {
  1540. X    VLINK vl,links;
  1541. X
  1542. X    DEBUG1("openBrowserDirectory: \"%s\"\n",dbp->name);
  1543. X    if (dbp->type != DB_DIRECTORY)
  1544. X    return;
  1545. X    if (dbp->entries == NULL) {
  1546. X    /* It's not been expanded already... */
  1547. X    if ((vl=dbp->vlink) == NULL) {
  1548. X        alert0("ERROR: NULL vlink to openBrowserDirectory!");
  1549. X        return;
  1550. X    }
  1551. X    /* Disable querying */
  1552. X    setBrowserState(BROWSER_DIRSEND);
  1553. X    DEBUG1("getting entries for \"%s\"\n",dbp->name);
  1554. X    links = stringQuery(vl->host,vl->filename);
  1555. X    DEBUG0("calling handleProsperoErrors\n");
  1556. X    (void)handleProsperoErrors();
  1557. X    if (links != NULL)
  1558. X        numOpened += 1;
  1559. #ifdef DEBUG
  1560. X    fprintf(stderr,"unprocessed results of stringQuery:\n");
  1561. X    for (vl=links; vl != NULL; vl=vl->next)
  1562. X        fprintf(stderr,"  \"%s\"\n",vl->filename);
  1563. X    fprintf(stderr,"calling parseStringQueryResults\n");
  1564. #endif
  1565. X    /* Process the results into the database */
  1566. X    switch(appResources.sortType) {
  1567. X        case GfName:
  1568. X        (void)parseStringQueryResults(dbp,links,cmpEntryNames);
  1569. X        break;
  1570. X        case GfDate:
  1571. X        (void)parseStringQueryResults(dbp,links,cmpEntryDates);
  1572. X        break;
  1573. X        case GfWeight:
  1574. X        (void)parseStringQueryResults(dbp,links,cmpEntryWeights);
  1575. X        break;
  1576. X    }
  1577. X    /* Re-enable querying */
  1578. X    setBrowserState(BROWSER_READY);
  1579. X    }
  1580. X    DEBUG0("done openBrowserDirectory\n");
  1581. }
  1582. X
  1583. /*    -    -    -    -    -    -    -    -    */
  1584. /* Routines for shifting the browser up, down, top. */
  1585. X
  1586. void
  1587. shiftBrowserDown()
  1588. {
  1589. X    DEBUG1("doing shiftDown, depth = %d\n",currentRootDepth);
  1590. X    if (currentRootDepth >= MAX_DEPTH-1) {
  1591. X    alert1("Browser only goes %d levels deep!",(char *)MAX_DEPTH);
  1592. X    return;
  1593. X    }
  1594. X    if (parentEntries[currentRootDepth+1] == NULL) {
  1595. X    alert0("Nothing to display below!");
  1596. X    return;
  1597. X    }
  1598. X    currentRootDepth += 1;
  1599. X    DEBUG1("currentRootDepth is now %d\n",currentRootDepth);
  1600. X    displayEntries(parentEntries[currentRootDepth],0);
  1601. X    DEBUG0("done shiftDown\n");
  1602. }
  1603. X
  1604. void
  1605. shiftBrowserUp()
  1606. {
  1607. X    DEBUG1("doing shiftUp, depth = %d\n",currentRootDepth);
  1608. X    if (currentRootDepth == 0) {
  1609. X    beep();
  1610. X    return;
  1611. X    }
  1612. X    currentRootDepth -= 1;
  1613. X    DEBUG1("currentRootDepth is now %d\n",currentRootDepth);
  1614. X    displayEntries(parentEntries[currentRootDepth],0);
  1615. X    DEBUG0("done shiftUp\n");
  1616. }
  1617. X
  1618. void
  1619. shiftBrowserTop()
  1620. {
  1621. X    DEBUG1("doing shiftTop, depth = %d\n",currentRootDepth);
  1622. X    currentRootDepth = 0;
  1623. X    DEBUG1("currentRootDepth is now %d\n",currentRootDepth);
  1624. X    displayEntries(db,0);
  1625. X    DEBUG0("done shiftTop\n");
  1626. }
  1627. X
  1628. /*    -    -    -    -    -    -    -    -    */
  1629. /* Routines for getting/setting the state of the browser */
  1630. /*
  1631. X * Non-zero state => busy
  1632. X */
  1633. X
  1634. void
  1635. setBrowserState(state)
  1636. int state;
  1637. {
  1638. X    setQuerySensitive(state == BROWSER_READY);
  1639. X    setAbortSensitive(state != BROWSER_READY);
  1640. X    browserState = state;
  1641. }
  1642. X
  1643. int
  1644. getBrowserState()
  1645. {
  1646. X    return(browserState);
  1647. }
  1648. X
  1649. SHAR_EOF
  1650. chmod 0644 xarchie-2.0.6/browser.c ||
  1651. echo 'restore of xarchie-2.0.6/browser.c failed'
  1652. Wc_c="`wc -c < 'xarchie-2.0.6/browser.c'`"
  1653. test 12889 -eq "$Wc_c" ||
  1654.     echo 'xarchie-2.0.6/browser.c: original size 12889, current size' "$Wc_c"
  1655. rm -f _shar_wnt_.tmp
  1656. fi
  1657. # ============= xarchie-2.0.6/browser.h ==============
  1658. if test -f 'xarchie-2.0.6/browser.h' -a X"$1" != X"-c"; then
  1659.     echo 'x - skipping xarchie-2.0.6/browser.h (File already exists)'
  1660.     rm -f _shar_wnt_.tmp
  1661. else
  1662. > _shar_wnt_.tmp
  1663. echo 'x - extracting xarchie-2.0.6/browser.h (Text)'
  1664. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/browser.h' &&
  1665. /*
  1666. X * browser.h : Device-independent browser defs
  1667. X *
  1668. X * George Ferguson, ferguson@cs.rochester.edu, 23 Apr 1993.
  1669. X */
  1670. X
  1671. #ifndef _BROWSER_H
  1672. #define _BROWSER_H
  1673. X
  1674. #define NUM_BROWSER_PANES    3
  1675. #define MAX_DEPTH        20
  1676. X
  1677. extern void initBrowser();
  1678. extern void resetBrowser();
  1679. extern int paneDepth();
  1680. extern void selectBrowserItem(),unselectBrowserItem();
  1681. extern void displayEntries();
  1682. extern void resortBrowser();
  1683. extern int openBrowserAll(),openBrowserDirectories(),openBrowserFiles();
  1684. extern void shiftBrowserDown(),shiftBrowserUp(),shiftBrowserTop();
  1685. X
  1686. #define BROWSER_READY    0
  1687. #define BROWSER_DIRSEND    1
  1688. #define BROWSER_FTP    2
  1689. X
  1690. extern void setBrowserState();
  1691. extern int getBrowserState();
  1692. X
  1693. #endif /* _BROWSER_H */
  1694. SHAR_EOF
  1695. chmod 0644 xarchie-2.0.6/browser.h ||
  1696. echo 'restore of xarchie-2.0.6/browser.h failed'
  1697. Wc_c="`wc -c < 'xarchie-2.0.6/browser.h'`"
  1698. test 701 -eq "$Wc_c" ||
  1699.     echo 'xarchie-2.0.6/browser.h: original size 701, current size' "$Wc_c"
  1700. rm -f _shar_wnt_.tmp
  1701. fi
  1702. # ============= xarchie-2.0.6/busy.xbm ==============
  1703. if test -f 'xarchie-2.0.6/busy.xbm' -a X"$1" != X"-c"; then
  1704.     echo 'x - skipping xarchie-2.0.6/busy.xbm (File already exists)'
  1705.     rm -f _shar_wnt_.tmp
  1706. else
  1707. > _shar_wnt_.tmp
  1708. echo 'x - extracting xarchie-2.0.6/busy.xbm (Text)'
  1709. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/busy.xbm' &&
  1710. #define busy_width 32
  1711. #define busy_height 32
  1712. static unsigned char busy_bits[] = {
  1713. X   0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0x29, 0x19, 0xab, 0x8e,
  1714. X   0xa9, 0xaa, 0xa8, 0x82, 0x91, 0x9b, 0xb8, 0x86, 0xa9, 0xaa, 0xa8, 0x82,
  1715. X   0xa9, 0x2a, 0xab, 0x8e, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
  1716. X   0x01, 0x04, 0x20, 0x80, 0x03, 0x0c, 0x60, 0x80, 0x01, 0x04, 0x20, 0x80,
  1717. X   0x03, 0x0c, 0x60, 0x80, 0x01, 0x04, 0x20, 0x80, 0x03, 0x0c, 0x60, 0x80,
  1718. X   0x01, 0x04, 0x20, 0x80, 0x03, 0x0c, 0x60, 0x80, 0x01, 0x04, 0x20, 0x80,
  1719. X   0x03, 0x0c, 0x60, 0x80, 0x01, 0x04, 0x20, 0x80, 0x03, 0x0c, 0x60, 0x80,
  1720. X   0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0x1d, 0x00, 0x00, 0x80,
  1721. X   0x01, 0x00, 0x00, 0x80, 0x3d, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80,
  1722. X   0x1d, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x1d, 0x70, 0x80, 0x87,
  1723. X   0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff};
  1724. SHAR_EOF
  1725. chmod 0644 xarchie-2.0.6/busy.xbm ||
  1726. echo 'restore of xarchie-2.0.6/busy.xbm failed'
  1727. Wc_c="`wc -c < 'xarchie-2.0.6/busy.xbm'`"
  1728. test 884 -eq "$Wc_c" ||
  1729.     echo 'xarchie-2.0.6/busy.xbm: original size 884, current size' "$Wc_c"
  1730. rm -f _shar_wnt_.tmp
  1731. fi
  1732. # ============= xarchie-2.0.6/config.h ==============
  1733. if test -f 'xarchie-2.0.6/config.h' -a X"$1" != X"-c"; then
  1734.     echo 'x - skipping xarchie-2.0.6/config.h (File already exists)'
  1735.     rm -f _shar_wnt_.tmp
  1736. else
  1737. > _shar_wnt_.tmp
  1738. echo 'x - extracting xarchie-2.0.6/config.h (Text)'
  1739. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/config.h' &&
  1740. /* config.h.  Generated automatically by configure.  */
  1741. X
  1742. #ifndef _CONFIG_H
  1743. #define _CONFIG_H
  1744. X
  1745. /* Define if you have the ANSI C header files.  */
  1746. #undef STDC_HEADERS
  1747. X
  1748. /* Define if you have <string.h>, otherwise assumes <strings.h> */
  1749. #define HAVE_STRING_H 1
  1750. X
  1751. /* Define if you have memory.h, and string.h doesn't declare the
  1752. X   mem* functions.  */
  1753. #define HAVE_MEMORY_H 1
  1754. X
  1755. /* Adjust of your sys/param.h doesn't define MAXPATHLEN */
  1756. #define HAVE_SYS_PARAM_H 1
  1757. #ifndef HAVE_SYS_PARAM_H
  1758. # define MAXPATHLEN 1024
  1759. #endif
  1760. X
  1761. /* Define if your sys/time.h declares struct tm.  */
  1762. #undef TM_IN_SYS_TIME
  1763. X
  1764. /* Define if your sys/types.h declares FD_SET.  */
  1765. #define FD_SET_IN_SYS_TYPES_H 1
  1766. /* Define if your sys/select.h declares FD_SET.  */
  1767. #undef FD_SET_IN_SYS_SELECT_H
  1768. /* Define if your sys/inet.h declares FD_SET.  */
  1769. #undef FD_SET_IN_SYS_INET_H
  1770. X
  1771. /* Define if you have re_comp() and re_exec() */
  1772. #define HAVE_RE_COMP 1
  1773. /* Some systems use regcmp() and regex() instead (like AIX) */
  1774. #undef HAVE_REGCMP
  1775. X
  1776. /* Define if you have strcasecmp() */
  1777. #define HAVE_STRCASECMP 1
  1778. X
  1779. /* Define if you have random() */
  1780. #define HAVE_RANDOM 1
  1781. /* Some systems use rand() instead (like HPUX) */
  1782. #define HAVE_RAND 1
  1783. X
  1784. /* Define if you have the ANSI function strerror() */
  1785. #define HAVE_STRERROR 1
  1786. X
  1787. /* Define if you have errno (who doesn't)? */
  1788. #define HAVE_ERRNO 1
  1789. X
  1790. /* Define if you have sys_errlist (not needed if you have strerror) */
  1791. #define HAVE_SYS_ERRLIST 1
  1792. X
  1793. /* Define if you have getlogin() (who doesn't?) */
  1794. #define HAVE_GETLOGIN 1
  1795. X
  1796. /* Define if you have getpwuid() defined in <pwd.h> */
  1797. #define HAVE_GETPWUID 1
  1798. X
  1799. /* Define if you have strspn() */
  1800. #define HAVE_STRSPN 1
  1801. X
  1802. /* Define this if you need -lresolv in your link line (used by imake) */
  1803. #undef NEED_LRESOLV
  1804. X
  1805. #endif /*!_CONFIG_H*/
  1806. SHAR_EOF
  1807. chmod 0644 xarchie-2.0.6/config.h ||
  1808. echo 'restore of xarchie-2.0.6/config.h failed'
  1809. Wc_c="`wc -c < 'xarchie-2.0.6/config.h'`"
  1810. test 1757 -eq "$Wc_c" ||
  1811.     echo 'xarchie-2.0.6/config.h: original size 1757, current size' "$Wc_c"
  1812. rm -f _shar_wnt_.tmp
  1813. fi
  1814. # ============= xarchie-2.0.6/config.h.in ==============
  1815. if test -f 'xarchie-2.0.6/config.h.in' -a X"$1" != X"-c"; then
  1816.     echo 'x - skipping xarchie-2.0.6/config.h.in (File already exists)'
  1817.     rm -f _shar_wnt_.tmp
  1818. else
  1819. > _shar_wnt_.tmp
  1820. echo 'x - extracting xarchie-2.0.6/config.h.in (Text)'
  1821. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/config.h.in' &&
  1822. X
  1823. #ifndef _CONFIG_H
  1824. #define _CONFIG_H
  1825. X
  1826. /* Define if you have the ANSI C header files.  */
  1827. #undef STDC_HEADERS
  1828. X
  1829. /* Define if you have <string.h>, otherwise assumes <strings.h> */
  1830. #undef HAVE_STRING_H
  1831. X
  1832. /* Define if you have memory.h, and string.h doesn't declare the
  1833. X   mem* functions.  */
  1834. #undef HAVE_MEMORY_H
  1835. X
  1836. /* Adjust of your sys/param.h doesn't define MAXPATHLEN */
  1837. #undef HAVE_SYS_PARAM_H
  1838. #ifndef HAVE_SYS_PARAM_H
  1839. # define MAXPATHLEN 1024
  1840. #endif
  1841. X
  1842. /* Define if your sys/time.h declares struct tm.  */
  1843. #undef TM_IN_SYS_TIME
  1844. X
  1845. /* Define if your sys/types.h declares FD_SET.  */
  1846. #undef FD_SET_IN_SYS_TYPES_H
  1847. SHAR_EOF
  1848. true || echo 'restore of xarchie-2.0.6/config.h.in failed'
  1849. fi
  1850. echo 'End of xarchie-2.0.6 part 5'
  1851. echo 'File xarchie-2.0.6/config.h.in is continued in part 6'
  1852. echo 6 > _shar_seq_.tmp
  1853. exit 0
  1854.  
  1855. exit 0 # Just in case...
  1856. -- 
  1857.   // chris@IMD.Sterling.COM       | Send comp.sources.x submissions to:
  1858. \X/  Amiga - The only way to fly! |    sources-x@imd.sterling.com
  1859.  "It's intuitively obvious to the |
  1860.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1861.