home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume21 / xfsp / part02 < prev    next >
Encoding:
Text File  |  1993-11-23  |  21.6 KB  |  782 lines

  1. Newsgroups: comp.sources.x
  2. From: Steff.Watkins@bristol.ac.uk ("S. Watkins")
  3. Subject: v21i047:  xfsp - X based front-end for the FSP package, Part02/02
  4. Message-ID: <1993Nov23.165249.15766@sparky.sterling.com>
  5. X-Md4-Signature: 7879290a4b49101a4b80d049da0989ef
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Tue, 23 Nov 1993 16:52:49 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: Steff.Watkins@bristol.ac.uk ("S. Watkins")
  12. Posting-number: Volume 21, Issue 47
  13. Archive-name: xfsp/part02
  14. Environment: X11, FSP
  15.  
  16. The following code is an X based front-end for the FSP package. To use
  17. this program, you will also have to have the FSP package installed and in
  18. your search path.
  19.  
  20. ================ CUT HERE ======================================
  21. #!/bin/sh
  22. # to extract, remove the header and type "sh filename"
  23. if `test ! -s ./Imakefile`
  24. then
  25. echo "Writing ./Imakefile"
  26. cat > ./Imakefile << '\Rogue\Monster\'
  27. #ifdef BandAidCompiler
  28. #include BandAidCompiler
  29. #endif
  30.  
  31. ####################
  32. # Imakefile for XFSP
  33. ####################
  34.  
  35. INCLUDES = -I$(TOP) -I$(TOP)/X11
  36. DEPLIBS = $(DEPXTOOLLIB) $(DEPXMULIB) $(DEPXLIB)
  37. LOCAL_LIBRARIES = $(XLIB)
  38.  
  39. SRCS = xfsp.c input.c ops.c output.c
  40. OBJS = xfsp.o input.o ops.o output.o
  41.  
  42. ComplexProgramTarget(xfsp)
  43. \Rogue\Monster\
  44. else
  45.   echo "Will not over-write ./Imakefile"
  46. fi
  47. chmod 755 ./Imakefile
  48. if `test ! -s ./MANIFEST`
  49. then
  50. echo "Writing ./MANIFEST"
  51. cat > ./MANIFEST << '\Rogue\Monster\'
  52. total 106
  53. drwxr-xr-x  2 ccsw          512 Oct 25 11:26 ./
  54. drwxr-xr-x 12 ccsw          512 Oct 18 14:47 ../
  55. -rwxr-xr-x  1 ccsw          331 Oct 25 11:26 Imakefile
  56. -rw-r--r--  1 ccsw            0 Oct 25 11:26 MANIFEST
  57. -rwxr-xr-x  1 ccsw          292 Oct 25 11:26 Makefile.mk
  58. -rw-r--r--  1 ccsw         9073 Oct 25 11:26 README
  59. -rw-r--r--  1 ccsw          187 Oct 25 11:26 config.h
  60. -rw-r--r--  1 ccsw          275 Oct 25 11:26 down.h
  61. -rwxr-xr-x  1 ccsw         7963 Oct 25 11:26 input.c
  62. -rw-r--r--  1 ccsw        14488 Oct 25 11:26 logo.h
  63. -rw-r--r--  1 ccsw          284 Oct 25 11:26 maxdown.h
  64. -rw-r--r--  1 ccsw          278 Oct 25 11:26 maxup.h
  65. -rwxr-xr-x  1 ccsw         3773 Oct 25 11:26 ops.c
  66. -rwxr-xr-x  1 ccsw         7246 Oct 25 11:26 output.c
  67. -rw-r--r--  1 ccsw           44 Oct 25 11:26 patchlevel.h
  68. -rw-r--r--  1 ccsw          269 Oct 25 11:26 up.h
  69. -rwxr-xr-x  1 ccsw         2929 Oct 25 11:26 xfsp.c
  70. -rw-r--r--  1 ccsw          205 Oct 25 11:26 xfsp.h
  71. -rwxr-xr-x  1 ccsw         1343 Oct 25 11:26 xfsp.man
  72. -rw-r--r--  1 ccsw        12089 Oct 25 11:26 xfsp.xbm
  73. \Rogue\Monster\
  74. else
  75.   echo "Will not over-write ./MANIFEST"
  76. fi
  77. chmod 644 ./MANIFEST
  78. if `test ! -s ./Makefile`
  79. then
  80. echo "Writing ./Makefile"
  81. cat > ./Makefile << '\Rogue\Monster\'
  82. ####################
  83. # Makefile for xfile
  84. ####################
  85.  
  86. # your C compiler of choice
  87. CC = cc
  88. CFLAGS = -O
  89. LIBS = -lX11
  90. PRG = xfsp
  91.  
  92. OBJS = xfsp.o input.o ops.o output.o
  93.  
  94. .c.o:    ; $(CC) -c $(CFLAGS) $*.c
  95.  
  96. all: $(PRG)
  97.  
  98. xfsp: $(OBJS)
  99.     $(CC) $(CFLAGS) -o $(PRG) $(OBJS) $(LIBS)
  100.     strip $(PRG)
  101. \Rogue\Monster\
  102. else
  103.   echo "Will not over-write ./Makefile"
  104. fi
  105. chmod 755 ./Makefile
  106. if `test ! -s ./Makefile.mk`
  107. then
  108. echo "Writing ./Makefile.mk"
  109. cat > ./Makefile.mk << '\Rogue\Monster\'
  110. ####################
  111. # Makefile for xfile
  112. ####################
  113.  
  114. # your C compiler of choice
  115. CC = cc
  116. CFLAGS = -O
  117. LIBS = -lX11
  118. PRG = xfsp
  119.  
  120. OBJS = xfsp.o input.o ops.o output.o
  121.  
  122. .c.o:    ; $(CC) -c $(CFLAGS) $*.c
  123.  
  124. all: $(PRG)
  125.  
  126. xfsp: $(OBJS)
  127.     $(CC) $(CFLAGS) -o $(PRG) $(OBJS) $(LIBS)
  128.     strip $(PRG)
  129. \Rogue\Monster\
  130. else
  131.   echo "Will not over-write ./Makefile.mk"
  132. fi
  133. chmod 755 ./Makefile.mk
  134. if `test ! -s ./README`
  135. then
  136. echo "Writing ./README"
  137. cat > ./README << '\Rogue\Monster\'
  138. X-FSP Version 1.00
  139. ==================
  140.  
  141. Release Date :- 11 Oct 93
  142.  
  143.  
  144. INTRODUCTION
  145. ============
  146.  
  147. Hello,
  148.  
  149.   Well, here's my attempt at an FSP front-end. I've only been C/X coding
  150. for a few months, so before you start on about the aestethics of the
  151. program, DON'T!!
  152.  
  153. X-Fsp must be used in conjuction with the FSP package. Before running
  154. X-Fsp, check that you have "fcdcmd", "fgetcmd", "flscmd" and "fput" in
  155. your path. The results, otherwise, could be very disappointing.
  156.  
  157. X-Fsp is an X-Based front-end for the FSP package. The reason I wrote this
  158. little program was that I was getting annoyed having to constantly type in
  159. host names, and port numbers before accessing a FSP host. So, I sat down,
  160. and tried to write a push-and-shoot interface for FSP. Here's the first draft.
  161.  
  162. X-Fsp has been written and tested SOLELY on a SunOs4 box. I can not
  163. and will not guarantee that it will compile or execute on any other system
  164. (at this moment). However, steps will be taken to test and improve the
  165. code so that it will compile properly on other systems (watch this space!).
  166.  
  167. VERSIONS
  168. ========
  169.  
  170. I'm none too sure how other people use their version numbers, but I'll
  171. explain how I intend to use mine. The version is specified as
  172.  
  173.      Version X.YY
  174.  
  175. 'X' will only change if there is a MAJOR change to the operation of X-Fsp
  176. 'YY' will change as the code is changed to incorporate new systems.
  177.  
  178. So, if you have a working Version 1.00, you won't need Version 1.01 OK??
  179.  
  180. COMPILING XFSP
  181. ==============
  182.  
  183. Copy file "makefile.mk" to "Makefile". Have a read through "Makefile", and
  184. make any changes that you feel are necessary. A standard "make" command
  185. afterwards should compile xfsp.
  186.  
  187. I have included an "Imakefile". To use this, you must first type "xmkmf".
  188. This program will generate a makefile which is configured for your system.
  189. Then issue the "make" command. I have noticed that, as this method
  190. includes a load of X11 routines, the final xfsp binary is about 120K bytes
  191. bigger than the one generated by the non-xmkmf'ed Makefile. This may be a
  192. consideration for you if you have limited file space.
  193.  
  194. USING XFSP
  195. ==========
  196.  
  197. To start xfsp, type "xfsp" and hit return.
  198.  
  199. In front of you, there should be a window labelled "X-FSP Version: 1.00".
  200. You should se a large rectangular region in the upper half of the window,
  201. which will contain the text "No entries available" and have four arrow
  202. buttons on the right hand side.
  203.  
  204. In the lower part of the screen, you should see a few string boxes with
  205. buttons next to them ("host", "port", "r-dir", "rfile" and "lfile"), and a
  206. line of buttons along the bottom ("hosts", "fls", "fget", "fput", "fcd",
  207. "about" and "quit").
  208.  
  209. HOST/PORT BUTTON
  210. ================
  211.  
  212. Click on this button. An asterisk ("*") will appear in the text box next
  213. to the right of the button. You can now enter a host name/number or the
  214. port number (depending on which box you're using) via the keyboard.
  215. Keyboard entry is terminated by pressing the "Enter" key.
  216.  
  217. R-DIR BUTTON
  218. ============
  219.  
  220. Click on this button. An asterisk ("*") will appear in the text box next
  221. to the right of the button. You can now enter the name of the remote
  222. directory you want to work with via the keyboard. Keyboard entry is
  223. terminated by pressing the "Enter" key.
  224.  
  225. RFILE/LFILE BUTTON
  226. ==================
  227.  
  228. Click on this button. An asterisk ("*") will appear in the text box next
  229. to the right of the button. You can now enter the name of the remote or
  230. local file you want to work with via the keyboard. Keyboard entry is
  231. terminated by pressing the "Enter" key.
  232.  
  233. FLS BUTTON
  234. ==========
  235.  
  236. Click on this button. XFsp will perform an "flscmd" on the remote
  237. diretory specified in the "r-dir" box. Be sure that you have an entry
  238. filled in for the "host" and "port" boxes.
  239.  
  240. If the "flscmd" is successful, you should get a list of files available
  241. displayed in the upper rectangle of the window. You can scroll through
  242. this list using the four "arrow" button on the right hand side of that
  243. screen. The plain up/down arrows will move you ONE entry through the list
  244. either upwards or downwards. The capped (ones with lines across the ends)
  245. arrows will move you one SCREEN through the list.
  246.  
  247. The list of files displays certain information, such as filename, date of
  248. entry to the current directory and size of the file. Sub-directories are
  249. marked with a "/" at the end, to show that they are sub-directories.
  250.  
  251. If you wish to move to a sub-directory, or select a file from the visible
  252. list, then click on the file name. The relevant entry ("r-dir" or "rfile")
  253. will be completed in the text boxes below. Clicking on ".." will move you
  254. back to the parent directory for the directory you are currently in.
  255. Clicking on "." does NOTHING.
  256.  
  257. HOSTS BUTTON
  258. ============
  259.  
  260. This is MY main reason for writing XFSP. Clicking on this button will
  261. cause a window to open, which obscures the file selection window.
  262.  
  263. This window contains two buttons ("hfile" and "close").
  264.  
  265. HOSTS=>HFILE BUTTON
  266. ===================
  267.  
  268. Click on this button, and an asterisk ("*") will appear in the text box
  269. next to it. You can alter this string to point at any file which contains
  270. a valid fsp host list (see later). Text entry is terminated by pressing
  271. the "Enter" key.
  272.  
  273. HOSTS=>CLOSE BUTTON
  274. ===================
  275.  
  276. Click on this button to close the "hosts" window.
  277.  
  278. If you click on an entry in your "hosts" window, that entry's host and
  279. port parameters will be filled in in the "Host" and "Port" text boxes of
  280. the main window.
  281.  
  282. You may up and down through your hosts list by clicking on the arrow
  283. button on the right hand side of the "hosts" window.
  284.  
  285. ABOUT BUTTON
  286. ============
  287.  
  288. Click on this button to get the "about" window. This is just my chance of
  289. have a pose. The about window contains the version number of the release
  290. you're using (which should also be visible in the title bar!), and
  291. contains my E-Mail address for correspondence.
  292.  
  293. Clicking anywhere in the "about" window will cause it to close.
  294.  
  295. FGET BUTTON
  296. ===========
  297.  
  298. Click on this button to perform an "fgetcmd". XFsp has been set up to
  299. perform an "fget" on the file "r-dir/rfile" (as visible in the appropriate
  300. text boxes). The "fget" performed is backgrounded.
  301.  
  302. FPUT BUTTON
  303. ===========
  304.  
  305. Click on this button to perform an "fput". XFsp has been set up to perform
  306. an "fput" on the file given in the "lfile" text box. The "fput" performed
  307. is backgrounded.
  308.  
  309. THAT'S ABOUT IT FOR BUTTONS!!!!
  310.  
  311. The HOSTS file
  312. ==============
  313.  
  314. The hosts file (as given in the "hfile" text box on the "hosts" window)
  315. has to have a specific format to work. The file must be text, and should
  316. have the following format.
  317.  
  318.    HHHHHHH  PPPP  CCCCCCCCCCC*
  319.  
  320. where:
  321.  
  322.    HHHHHHH is the host name/number
  323.    PPPP    is the port number
  324.    CCCCCCC is an optional comment
  325.  
  326. Each line must be terminated by an asterisk ("*").
  327.  
  328. EXAMPLE
  329. =======
  330.  
  331. fsp.host.one.edu 1234 First FSP site in the list*
  332. fsp.host.two.edu   2345 Second site*
  333. fsp.host.three.edu 21*
  334. 256.256.256.256 256 No comment*
  335.  
  336.  
  337. As you can see, the comment can be space separated, and does not have to
  338. be present.
  339.  
  340. ==================================
  341. + ALL LINES MUST FINISH WITH A * +
  342. ==================================
  343.  
  344. An example "hosts" file is included and is called "fhosts" in this
  345. distribution.
  346.  
  347. FOOTNOTES
  348. =========
  349.  
  350. This is the first version of XFsp. I know it's not brilliant, but I'm
  351. hoping it'll go some way towards making life easier for all you FSP'ers
  352. out there.
  353.  
  354. Current undocumented features (Bugs?) are
  355.  
  356.  :- Sometimes an "fls" will cause a core dump. It's believed that this is
  357.     due to the permissions set on the FSP directory being listed.
  358.  
  359.  :- Sometimes you can click on a blank entry in the file selection window,
  360.     and get an entry which isn't present.
  361.  
  362.  :- Rarely, a click on ".." will cause an invalid "r-dir" entry.
  363.  
  364.  :- XFsp doesn't trap FSP_TRACE or error messages. These appears in the
  365.     parent window for XFsp. Future generations will hopefully trap and
  366.     handle these messages.
  367.  
  368. COPYING AND DISTRIBUTION
  369. ========================
  370.  
  371. This package may be copied and distributed at will. No charge may be made
  372. for this package beyond the recovery of costs incurred in distributing
  373. this file. This package must be distributed in it's entirity.
  374.  
  375. CREDITS AND STUFF
  376. =================
  377.  
  378.  Go easy on me. I haven't been coding for long (and it shows, I know!). At
  379. this point, I have to give the standard disclaimer that I will not accept
  380. ANY responsibility for ANY damage caused through the use or mis-use of
  381. this package. You are using XFsp at your own (hopefully minimal) risk.
  382.  
  383. If you have any comments, hints, tips, ideas, suggestions, code-hacks or
  384. (constructive) criticisms, then E-Mail them to me at
  385.  
  386.     Steff.Watkins@bristol.ac.uk
  387.  
  388.  Credit will be given where credit is due *8)
  389.  
  390. I'd also appreciate being kept up to date on current sites, but that's for
  391. you to decide. Any information volunteered will be confidential and
  392. gratefully accepted.
  393.  
  394. You can also contact me interactivly on IRC. I'm usually around (Mon-Fri
  395. 8am-4pm GMT) on #england. Look for "Pangolin" *8)
  396.  
  397. I'd like to thank Nick Bruton, and Steve B Hill for helping me to develop
  398. XFsp this far.
  399. \Rogue\Monster\
  400. else
  401.   echo "Will not over-write ./README"
  402. fi
  403. chmod 644 ./README
  404. if `test ! -s ./config.h`
  405. then
  406. echo "Writing ./config.h"
  407. cat > ./config.h << '\Rogue\Monster\'
  408. /* The only configurable I could find (so far). Find out whether your
  409. system uses vfork() or fork(). If fork(), then use
  410.  
  411. #undef VFORK
  412.  
  413. else use the default which is
  414.  
  415. */
  416.  
  417. #define VFORK
  418.  
  419.  
  420. \Rogue\Monster\
  421. else
  422.   echo "Will not over-write ./config.h"
  423. fi
  424. chmod 644 ./config.h
  425. if `test ! -s ./down.h`
  426. then
  427. echo "Writing ./down.h"
  428. cat > ./down.h << '\Rogue\Monster\'
  429. #define down_width 16
  430. #define down_height 16
  431. static char down_bits[] = {
  432.    0xff, 0xff, 0x01, 0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
  433.    0x81, 0x81, 0x81, 0x81, 0xfd, 0xbf, 0xf9, 0x9f, 0xf1, 0x8f, 0xe1, 0x87,
  434.    0xc1, 0x83, 0x81, 0x81, 0x01, 0x80, 0xff, 0xff};
  435. \Rogue\Monster\
  436. else
  437.   echo "Will not over-write ./down.h"
  438. fi
  439. chmod 644 ./down.h
  440. if `test ! -s ./input.c`
  441. then
  442. echo "Writing ./input.c"
  443. cat > ./input.c << '\Rogue\Monster\'
  444. #include "xfsp.h"
  445. #include <stdio.h>
  446.  
  447. extern Display *dpy;
  448. extern Window win, hostwin, aboutwin;
  449. extern int screen_num;
  450. extern char hostname[40], portname[6], lfilname[30], rdirname[70];
  451. extern char rfilname[30], currdir[70], hostf[40];
  452. extern char dates[256][20], sizes[10], names[30], home[60];
  453. extern int  dirs[256], dirlen, entries, topent, hoston, tophost, numhosts;
  454. extern XEvent event;
  455.  
  456. char tempname[L_tmpnam];
  457. KeySym keysym;
  458. XComposeStatus compose;
  459. int litbutton, litstr;
  460.  
  461. keyhandler()
  462. {
  463.  int count, i, len, maxlen, buflen = 10;
  464.  char buffer[10], compstr[70];
  465.  
  466.  count = XLookupString(&event, buffer, buflen, &keysym, &compose);
  467.  if (!litstr) XBell(dpy, 100);
  468.  else
  469.  {
  470.  switch (litstr) {
  471.  case 1:
  472.       strcpy(compstr,hostname);
  473.       maxlen = 50;
  474.       break;
  475.  case 2:
  476.       strcpy(compstr,portname);
  477.       maxlen = 9;
  478.       break;
  479.  case 3:
  480.       strcpy(compstr,rdirname);
  481.       maxlen = 70;
  482.       break;
  483.  case 4:
  484.       strcpy(compstr,lfilname);
  485.       maxlen = 30;
  486.       break;
  487.   case 5:
  488.       strcpy(compstr,rfilname);
  489.       maxlen = 30;
  490.       break;
  491.   case 6:
  492.       strcpy(compstr,hostf);
  493.       maxlen = 40;
  494.       break;
  495.   }     
  496.   if ((keysym == XK_Linefeed) || (keysym == XK_KP_Enter)
  497.             || (keysym == XK_Return)) {
  498.      if (litstr <= 3) {
  499.       entries = 0;
  500.       showentries();
  501.       }
  502.      if (litstr == 6) {
  503.       readhosts();
  504.       showhosts();
  505.      }
  506.      litstr = 0;
  507.     }
  508.     else if ((keysym >= XK_exclam) && (keysym <= XK_asciitilde)) {
  509.        if ((strlen(compstr) + strlen(buffer)) >= maxlen)
  510.          XBell(dpy, 100);
  511.        else
  512.          strcat(compstr, buffer);
  513.        }
  514.      else if ((keysym == XK_BackSpace) || (keysym == XK_Delete)) {
  515.         if ((len = strlen(compstr)) > 0) {
  516.            compstr[len - 1] = NULL;
  517.          }
  518.          else XBell(dpy, 100);
  519.        }
  520.    switch (litstr) {
  521.    case 1:
  522.       strcpy(hostname, compstr);
  523.       break;
  524.    case 2:
  525.       strcpy(portname, compstr);
  526.       break;
  527.    case 3:
  528.       strcpy(rdirname, compstr);
  529.       break;
  530.    case 4:
  531.       strcpy(lfilname, compstr);
  532.       break;
  533.    case 5:
  534.       strcpy(rfilname, compstr);
  535.       break;
  536.    case 6:
  537.       strcpy(hostf, compstr);
  538.       break;
  539.     }
  540.     showstrings();
  541.   }
  542. }
  543.  
  544. buttonhandler(bx, by, bw, lit)
  545. int bx, by, lit;
  546. Window bw;
  547. {
  548.  int status;
  549.  char tempstr[60];
  550.  
  551.  if (bw == aboutwin) {
  552.   XUnmapWindow(dpy, aboutwin);
  553.   mainscr();
  554.  }
  555.  if (bw == win) {
  556.  if (!lit) {
  557.   switch(litbutton) {
  558.        case 1:
  559.             button(10, 290, "host", win, 0);
  560.             break;
  561.        case 2:
  562.             button(380, 290, "port", win, 0);
  563.             break;
  564.        case 3:
  565.             button(10, 310, "r-dir", win,0);
  566.             break;
  567.        case 4:
  568.             button(250, 330, "lfile", win, 0);
  569.             break;
  570.        case 5:
  571.             button(10,  370, "hosts", win,0);
  572.             if (!hoston) hosts();
  573.             break;
  574.        case 6:
  575.             button(60,  370, "fls",  win, 0);
  576.             make_env();
  577.             strcpy(tempstr,"flscmd -la > ");
  578.             tmpnam(tempname);
  579.             strcat(tempstr,tempname);
  580.             status = execute(tempstr);
  581.             if (!status) {
  582.              strcpy(currdir, rdirname);
  583.              dirlen = strlen(rdirname);
  584.              flist();
  585.             }
  586.             unlink(tempname);
  587.             break;
  588.        case 7:
  589.             button(110, 370, "fget", win, 0);
  590.             strcpy(tempstr,"fgetcmd ");
  591.             strcat(tempstr,rfilname);
  592.             strcat(tempstr," &");
  593.             status = execute(tempstr);
  594.             break;
  595.        case 8:
  596.             button(160, 370, "fput", win, 0);
  597.             strcpy(tempstr,"fput ");
  598.             strcat(tempstr,lfilname);
  599.             strcat(tempstr," &");
  600.             status = execute(tempstr);
  601.             break;
  602.        case 9:
  603.             button(210, 370, "fcd", win, 0);
  604.             strcpy(tempstr,"fcdcmd ");
  605.             strcat(tempstr,rdirname);
  606.             status = execute(tempstr);
  607.             if (!status) {
  608.              strcpy(currdir,rdirname);
  609.              entries = 0;
  610.              showentries();
  611.             }
  612.             break;
  613.        case 10:
  614.             button(260, 370, "about", win, 0);
  615.             abouts();
  616.             break;
  617.        case 11:
  618.             button(440, 370, "quit", win, 0);
  619.             runend();
  620.             break;
  621.        case 12:
  622.             button(10, 330, "rfile", win, 0);
  623.             break;
  624.    }  /* End switch */
  625.    litbutton = 0;
  626.    if (bx >= 475 && bx <=491) {
  627.     if (by >= 247 & by <= 263) {
  628.      if (topent < entries - 16)  topent++;
  629.     }
  630.     if (by >= 48 && by <= 64) {
  631.      if (topent > 0)  topent = topent - 1;
  632.     }
  633.     if (by >= 30 && by <= 46) {
  634.      if (topent > 16) topent = topent - 16;
  635.      else
  636.      topent = 0;
  637.      }
  638.     if (by >= 265 && by <= 281) {
  639.      if (topent < entries - 32) topent = topent + 16;
  640.       else
  641.       topent = entries - 16;
  642.      }
  643.     if (topent < 0) topent = 0;
  644.     showentries();
  645.     }
  646.   if (topent < 0) topent = 0;
  647.   }
  648.   else
  649.     {
  650.    if ((bx >= 10 && bx <= 460) && (by >= 30 & by <= 280)) selfile(by);
  651.    if ((bx >= 10 && bx <= 50) && (by >= 370 & by <= 385))
  652.       { 
  653.        button(10, 370, "hosts", win, lit);
  654.        litbutton = 5;
  655.        litstr = 0;
  656.       }
  657.    if ((bx >= 60 && bx <= 100) && (by >= 370 && by <= 385)) 
  658.       {
  659.        button(60, 370, "fls", win, lit);
  660.        litbutton = 6;
  661.        litstr = 0;
  662.       }
  663.    if ((bx >= 110 && bx <= 150) && (by >= 370 && by <= 385)) 
  664.       {
  665.        button(110, 370, "fget", win, lit);
  666.        litbutton = 7;
  667.        litstr = 0;
  668.       }
  669.    if ((bx >= 160 && bx <= 200) && (by >= 370 && by <= 385)) 
  670.       {
  671.        button(160, 370, "fput", win, lit);
  672.        litbutton = 8;
  673.        litstr = 0;
  674.       }
  675.    if ((bx >= 210 && bx <= 250) && (by >= 370 && by <= 385)) 
  676.       {
  677.        button(210, 370, "fcd", win, lit);
  678.        litbutton = 9;
  679.        litstr = 0;
  680.       }
  681.    if ((bx >= 260 && bx <= 300) && (by >= 370 && by <= 385)) 
  682.       {
  683.        button(260, 370, "about", win, lit);
  684.        litbutton = 10;
  685.        litstr = 0;
  686.       }
  687.    if ((bx >= 10 && bx <= 50) && (by >= 290 && by <= 305))
  688.       {
  689.        button(10, 290, "host", win, lit);
  690.        litbutton = 1;
  691.        litstr = 1;
  692.       }
  693.    if ((bx >= 380 && bx <= 420) && (by >= 290 && by <= 305))
  694.       {
  695.        button(380, 290, "port", win, lit);
  696.        litbutton = 2;
  697.        litstr = 2;
  698.       }
  699.    if ((bx >= 10 && bx <= 50) && (by >= 310 && by <= 325))
  700.       {
  701.        button(10, 310, "r-dir", win, lit);
  702.        litbutton = 3;
  703.        litstr = 3;
  704.        }
  705.    if ((bx >= 250 && bx <= 290) && (by >= 330 && by <= 345))
  706.       {
  707.        button(250, 330, "lfile", win, lit);
  708.        litstr = 4;
  709.        litbutton = 4;
  710.        }
  711.    if ((bx >= 10 && bx <= 50) && (by >= 330 && by <= 345))
  712.       {
  713.        button(10, 330, "rfile", win, lit);
  714.        litstr = 5;
  715.        litbutton = 12;
  716.        }
  717.    if ((bx >= 440 && bx <= 480) && (by >= 370 && by <= 385))
  718.      {
  719.       button(440, 370, "quit", win, lit);
  720.       litbutton = 11;
  721.       litstr = 0;
  722.      }
  723.   showstrings();
  724.   }
  725.  }
  726.  if (bw == hostwin)
  727.  {
  728.   if ((bx >= 10 && bx <= 50) && (by >= 250 && by <= 265)) {
  729.    button(10, 250, "hfile", hostwin, lit);
  730.    litbutton = 13;
  731.    litstr = 6;
  732.   }
  733.   if ((bx >= 420 && bx <= 460) && (by >= 250 && by <= 265)) {
  734.    XUnmapWindow(dpy, hostwin);
  735.    hoston = 0;
  736.    mainscr();
  737.   }
  738.   if (!lit) {
  739.    if (litbutton == 13) {
  740.     button(10, 250, "hfile", hostwin, 0);
  741.     litbutton = 0;
  742.     }
  743.    if ((bx >= 0 && bx <= 480) && (by >= 20 && by <= 240)) selhost(by);
  744.    if (bx >= 465 && bx <=481) {
  745.     if (by >= 207 && by <= 223) {
  746.      if (tophost < numhosts - 14)  tophost++;
  747.     }
  748.     if (by >= 38 && by <= 54) {
  749.      if (tophost > 0)  tophost = tophost - 1;
  750.     }
  751.     if (by >= 20 && by <= 36) {
  752.      if (tophost > 14) tophost = tophost - 14;
  753.      else
  754.      tophost = 0;
  755.      }
  756.     if (by >= 225 && by <= 241) {
  757.      if (tophost < numhosts - 28) tophost = tophost + 14;
  758.       else
  759.       tophost = numhosts - 14;
  760.      }
  761.     if (tophost < 0) tophost = 0;
  762.     showhosts();
  763.    }
  764.   }
  765.  hoststring();
  766.  }
  767. }
  768. \Rogue\Monster\
  769. else
  770.   echo "Will not over-write ./input.c"
  771. fi
  772. chmod 755 ./input.c
  773. echo "Finished archive 2 of 2"
  774. exit
  775.  
  776. exit 0 # Just in case...
  777. -- 
  778.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  779. \X/  Amiga - The only way to fly! |    sources-x@sterling.com
  780.  "It's intuitively obvious to the |
  781.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  782.