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

  1. Newsgroups: comp.sources.x
  2. From: ferguson@cs.rochester.edu (George Ferguson)
  3. Subject: v20i048:  xarchie - An X browser interface to Archie, v2.0.6, Part20/24
  4. Message-ID: <1993Jun15.223521.1743@sparky.imd.sterling.com>
  5. X-Md4-Signature: 40bd1b7b5e1110381ce07f51ce784b8e
  6. Sender: chris@sparky.imd.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Tue, 15 Jun 1993 22:35:21 GMT
  9. Approved: chris@sparky.imd.sterling.com
  10.  
  11. Submitted-by: ferguson@cs.rochester.edu (George Ferguson)
  12. Posting-number: Volume 20, Issue 48
  13. Archive-name: xarchie/part20
  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/part20
  19.  
  20. #!/bin/sh
  21. # this is Part.20 (part 20 of xarchie-2.0.6)
  22. # do not concatenate these parts, unpack them in order with /bin/sh
  23. # file xarchie-2.0.6/FWF/Dir/Directory.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" != 20; 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/FWF/Dir/Directory.h'
  39. else
  40. echo 'x - continuing file xarchie-2.0.6/FWF/Dir/Directory.h'
  41. sed 's/^X//' << 'SHAR_EOF' >> 'xarchie-2.0.6/FWF/Dir/Directory.h' &&
  42. X * prior permission.  Brian Totty and University of Illinois make no
  43. X * representations about the suitability of this software for any
  44. X * purpose.  It is provided "as is" without express or implied warranty.
  45. X *
  46. X * Brian Totty and University of Illinois disclaim all warranties with
  47. X * regard to this software, including all implied warranties of
  48. X * merchantability and fitness, in no event shall Brian Totty or
  49. X * University of Illinois be liable for any special, indirect or
  50. X * consequential damages or any damages whatsoever resulting from loss of
  51. X * use, data or profits, whether in an action of contract, negligence or
  52. X * other tortious action, arising out of or in connection with the use or
  53. X * performance of this software.
  54. X *
  55. X * Author:
  56. X *     Brian Totty
  57. X *     Department of Computer Science
  58. X *     University Of Illinois at Urbana-Champaign
  59. X *    1304 West Springfield Avenue
  60. X *     Urbana, IL 61801
  61. X * 
  62. X *     totty@cs.uiuc.edu
  63. X *     
  64. X */ 
  65. X
  66. #ifndef _DIRECTORY_H_
  67. #define _DIRECTORY_H_
  68. X
  69. #include <stdio.h>
  70. #include <sys/param.h>
  71. #include <sys/types.h>
  72. #include <sys/stat.h>
  73. X
  74. #if defined(SYSV) || defined(SVR4)
  75. # ifndef __sgi
  76. #  ifndef getwd
  77. #   define getwd(path) getcwd(path, MAXPATHLEN)
  78. #  endif
  79. # endif
  80. #endif
  81. X
  82. #ifndef NO_DIRENT
  83. #include <dirent.h>
  84. #else
  85. #include <sys/dir.h>
  86. #define dirent direct
  87. #endif
  88. X
  89. #ifndef _SYS_NAME_MAX
  90. #ifndef MAXNAMLEN
  91. ERROR, ONE OF THESE MUST BE DEFINED
  92. #else
  93. #define    MAX_NAME_LENGTH    MAXNAMLEN
  94. #endif
  95. #else
  96. #define    MAX_NAME_LENGTH    _SYS_NAME_MAX
  97. #endif
  98. X
  99. #ifndef TRUE
  100. #define TRUE                1
  101. #endif
  102. X
  103. #ifndef FALSE
  104. #define    FALSE                0
  105. #endif
  106. X
  107. #define    PERM_READ            4
  108. #define    PERM_WRITE            2    
  109. #define    PERM_EXECUTE            1
  110. X
  111. #define    F_TYPE_DIR            1
  112. #define    F_TYPE_FILE            2
  113. #define    F_TYPE_CHAR_SPECIAL        3
  114. #define    F_TYPE_BLOCK_SPECIAL        4
  115. #define    F_TYPE_SYM_LINK            5
  116. #define    F_TYPE_SOCKET            6
  117. #define    F_TYPE_FIFO            7
  118. X
  119. /*--------------------------------------------------------------------------*
  120. X
  121. X            D A T A    T Y P E    A C C E S S    M A C R O S
  122. X
  123. X *--------------------------------------------------------------------------*/
  124. X
  125. X    /* Directory: Directory Iterator */
  126. X
  127. #define    DirectoryDir(dp)        ((dp)->filep)
  128. #define    DirectoryPath(dp)        ((dp)->path)
  129. X
  130. X    /* FileInfo: Information About A File Or Link */
  131. X
  132. #define    FileInfoProt(fi)        ((fi)->protections)
  133. #define FileInfoOrigMode(fi)        ((fi)->orig_mode)
  134. #define    FileInfoUserID(fi)        ((fi)->user_id)
  135. #define    FileInfoGroupID(fi)        ((fi)->group_id)
  136. #define    FileInfoFileSize(fi)        ((fi)->size)
  137. #define    FileInfoLastAccess(fi)        ((fi)->last_access)
  138. #define    FileInfoLastModify(fi)        ((fi)->last_modify)
  139. #define    FileInfoLastStatusChange(fi)    ((fi)->last_status_change)
  140. X
  141. #define    FIProt(fi)            FileInfoProt(fi)
  142. #define FIOrigMode(fi)            FileInfoOrigMode(fi)
  143. #define    FIUserID(fi)            FileInfoUserID(fi)
  144. #define    FIGroupID(fi)            FileInfoGroupID(fi)
  145. #define    FIFileSize(fi)            FileInfoFileSize(fi)
  146. #define    FILastAccess(fi)        FileInfoLastAccess(fi)
  147. #define    FILastModify(fi)        FileInfoLastModify(fi)
  148. #define    FILastStatusChange(fi)        FileInfoLastStatusChange(fi)
  149. X
  150. X    /* FType: File Type Macros */
  151. X
  152. #define    FTypeIsDir(ft)            ((ft) == F_TYPE_DIR)
  153. #define    FTypeIsFile(ft)            ((ft) == F_TYPE_FILE)
  154. #define    FTypeIsCharSpecial(ft)        ((ft) == F_TYPE_CHAR_SPECIAL)
  155. #define    FTypeIsBlockSpecial(ft)        ((ft) == F_TYPE_BLOCK_SPECIAL)
  156. #define    FTypeIsSymLink(ft)        ((ft) == F_TYPE_SYM_LINK)
  157. #define    FTypeIsSocket(ft)        ((ft) == F_TYPE_SOCKET)
  158. #define    FTypeIsFifo(ft)            ((ft) == F_TYPE_FIFO)
  159. X
  160. X    /* DirEntry: Information About A Item In A Directory */
  161. X
  162. #define    DirEntryFileName(fi)        ((fi)->filename)
  163. #define    DirEntryType(fi)        ((fi)->file_type)
  164. #define    DirEntrySelfInfo(fi)        (&((fi)->self_info))
  165. #define    DirEntryActualInfo(fi)        (&((fi)->actual_info))
  166. X
  167. #define    DirEntryIsBrokenLink(fi)    ((fi)->broken_link)
  168. #define    DirEntryIsDirectoryLink(fi)    ((fi)->directory_link)
  169. #define    DirEntryIsDir(fi)        (FTypeIsDir(DirEntryType(fi)))
  170. #define    DirEntryIsFile(fi)        (FTypeIsFile(DirEntryType(fi)))
  171. #define    DirEntryIsCharSpecial(fi)    (FTypeIsCharSpecial(DirEntryType(fi)))
  172. #define    DirEntryIsBlockSpecial(fi)    (FTypeIsBlockSpecial(DirEntryType(fi)))
  173. #define    DirEntryIsSymLink(fi)        (FTypeIsSymLink(DirEntryType(fi)))
  174. #define    DirEntryIsSocket(fi)        (FTypeIsSocket(DirEntryType(fi)))
  175. #define    DirEntryIsFifo(fi)        (FTypeIsFifo(DirEntryType(fi)))
  176. #define    DirEntryLeadsToDir(fi)        (DirEntryIsDir(fi) ||        \
  177. X                     DirEntryIsDirectoryLink(fi))
  178. X
  179. #define    DirEntryProt(d)            FIProt(DirEntrySelfInfo(d))
  180. #define DirEntryOrigMode(d)        FIOrigMode(DirEntrySelfInfo(d))
  181. #define    DirEntryUserID(d)        FIUserID(DirEntrySelfInfo(d))
  182. #define    DirEntryGroupID(d)        FIGroupID(DirEntrySelfInfo(d))
  183. #define    DirEntryFileSize(d)        FIFileSize(DirEntrySelfInfo(d))
  184. #define    DirEntryLastAccess(d)        FILastAccess(DirEntrySelfInfo(d))
  185. #define    DirEntryLastModify(d)        FILastModify(DirEntrySelfInfo(d))
  186. #define    DirEntryLastStatusChange(d)    FILastStatusChange(DirEntrySelfInfo(d))
  187. X
  188. /*--------------------------------------------------------------------------*
  189. X
  190. X             D A T A    T Y P E    D E F I N I T I O N S
  191. X
  192. X *--------------------------------------------------------------------------*/
  193. X
  194. X    /* Directory: Directory Iterator */
  195. X
  196. typedef struct
  197. {
  198. X    DIR *filep;
  199. X    char path[MAXPATHLEN + 2];
  200. } DIRECTORY;
  201. X
  202. typedef DIRECTORY Directory;
  203. X
  204. X    /* FileInfo: Information About A File Or Link */
  205. X
  206. typedef struct
  207. {
  208. X    short protections;
  209. X    short orig_mode;
  210. X    short user_id;
  211. X    short group_id;
  212. X    long size;
  213. X    time_t last_access;
  214. X    time_t last_modify;
  215. X    time_t last_status_change;
  216. } FILE_INFO;
  217. X
  218. typedef    FILE_INFO FileInfo;
  219. X
  220. X    /* DirEntry: Information About A Item In A Directory */
  221. X
  222. typedef struct
  223. {
  224. X    char filename[MAX_NAME_LENGTH + 1];
  225. X    short file_type;
  226. X    short broken_link;
  227. X    short directory_link;
  228. X    FileInfo self_info;
  229. X    FileInfo actual_info;
  230. } DIR_ENTRY;
  231. X
  232. typedef DIR_ENTRY DirEntry;
  233. X
  234. /*--------------------------------------------------------------------------*
  235. X
  236. X        L O W    L E V E L    D I R E C T O R Y    I N T E R F A C E
  237. X
  238. X *--------------------------------------------------------------------------*/
  239. X
  240. #if (!NeedFunctionPrototypes)
  241. X
  242. int    DirectoryOpen();
  243. void    DirectoryRestart();
  244. void    DirectoryClose();
  245. long    DirectoryTellPosition();
  246. void    DirectorySetPosition();
  247. int    DirectoryReadNextEntry();
  248. char *    DirectoryPathExpand();
  249. void    DirEntryDump();
  250. X
  251. #else
  252. X
  253. int    DirectoryOpen(char *dir_name, Directory *dp);
  254. void    DirectoryRestart(Directory *dp);
  255. void    DirectoryClose(Directory *dp);
  256. long    DirectoryTellPosition(Directory *dp);
  257. void    DirectorySetPosition(Directory *dp, long int pos);
  258. int    DirectoryReadNextEntry(Directory *dp, DirEntry *de);
  259. char *    DirectoryPathExpand(char *old_path, char *new_path);
  260. void    DirEntryDump(FILE *fp, DirEntry *de);
  261. X
  262. #endif
  263. X
  264. #endif
  265. X
  266. X
  267. SHAR_EOF
  268. echo 'File xarchie-2.0.6/FWF/Dir/Directory.h is complete' &&
  269. chmod 0644 xarchie-2.0.6/FWF/Dir/Directory.h ||
  270. echo 'restore of xarchie-2.0.6/FWF/Dir/Directory.h failed'
  271. Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/Directory.h'`"
  272. test 7501 -eq "$Wc_c" ||
  273.     echo 'xarchie-2.0.6/FWF/Dir/Directory.h: original size 7501, current size' "$Wc_c"
  274. rm -f _shar_wnt_.tmp
  275. fi
  276. # ============= xarchie-2.0.6/FWF/Dir/DirectoryT.c ==============
  277. if test -f 'xarchie-2.0.6/FWF/Dir/DirectoryT.c' -a X"$1" != X"-c"; then
  278.     echo 'x - skipping xarchie-2.0.6/FWF/Dir/DirectoryT.c (File already exists)'
  279.     rm -f _shar_wnt_.tmp
  280. else
  281. > _shar_wnt_.tmp
  282. echo 'x - extracting xarchie-2.0.6/FWF/Dir/DirectoryT.c (Text)'
  283. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/DirectoryT.c' &&
  284. /*
  285. X * Copyright 1990,1991,1992 Brian Totty
  286. X * 
  287. X * Permission to use, copy, modify, distribute, and sell this software
  288. X * and its documentation for any purpose is hereby granted without fee,
  289. X * provided that the above copyright notice appears in all copies and that
  290. X * both that copyright notice and this permission notice appear in
  291. X * supporting documentation, and that the name of Brian Totty or
  292. X * University of Illinois not be used in advertising or publicity
  293. X * pertaining to distribution of the software without specific, written
  294. X * prior permission.  Brian Totty and University of Illinois make no
  295. X * representations about the suitability of this software for any
  296. X * purpose.  It is provided "as is" without express or implied warranty.
  297. X *
  298. X * Brian Totty and University of Illinois disclaim all warranties with
  299. X * regard to this software, including all implied warranties of
  300. X * merchantability and fitness, in no event shall Brian Totty or
  301. X * University of Illinois be liable for any special, indirect or
  302. X * consequential damages or any damages whatsoever resulting from loss of
  303. X * use, data or profits, whether in an action of contract, negligence or
  304. X * other tortious action, arising out of or in connection with the use or
  305. X * performance of this software.
  306. X *
  307. X * Author:
  308. X *     Brian Totty
  309. X *     Department of Computer Science
  310. X *     University Of Illinois at Urbana-Champaign
  311. X *    1304 West Springfield Avenue
  312. X *     Urbana, IL 61801
  313. X * 
  314. X *     totty@cs.uiuc.edu
  315. X *     
  316. X */ 
  317. #include <stdio.h>
  318. #include <Directory.h>
  319. X
  320. int main(argc,argv)
  321. int argc;
  322. char **argv;
  323. {
  324. X    Directory directory;
  325. X    DirEntry entry;
  326. X    int status;
  327. X
  328. X    if (DirectoryOpen(argv[1],&directory) == FALSE)
  329. X    {
  330. X        fprintf(stderr,"Can't open directory '%s'\n",argv[1]);
  331. X        exit(-1);
  332. X    }
  333. X    printf("*** Listing Of Directory '%s' ***\n",
  334. X           DirectoryPath(&directory));
  335. X    while (DirectoryReadNextEntry(&directory,&entry))
  336. X    {
  337. X        printf("<Type %5d,  File '%20s',  Mode %3d,  Size %d>\n",
  338. X               DirEntryType(&entry),
  339. X               DirEntryFileName(&entry),
  340. X               DirEntryProt(&entry),
  341. X               DirEntryFileSize(&entry));
  342. X    }
  343. X    printf("\nChange the directory please...sleeping 5 seconds...\n\n");
  344. X    sleep(5);
  345. X    DirectoryRestart(&directory);
  346. X    while (DirectoryReadNextEntry(&directory,&entry))
  347. X    {
  348. X        printf("<Type %5d,  File '%20s',  Mode %3d,  Size %d>\n",
  349. X               DirEntryType(&entry),
  350. X               DirEntryFileName(&entry),
  351. X               DirEntryProt(&entry),
  352. X               DirEntryFileSize(&entry));
  353. X    }
  354. X    return(1);
  355. }
  356. SHAR_EOF
  357. chmod 0644 xarchie-2.0.6/FWF/Dir/DirectoryT.c ||
  358. echo 'restore of xarchie-2.0.6/FWF/Dir/DirectoryT.c failed'
  359. Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/DirectoryT.c'`"
  360. test 2440 -eq "$Wc_c" ||
  361.     echo 'xarchie-2.0.6/FWF/Dir/DirectoryT.c: original size 2440, current size' "$Wc_c"
  362. rm -f _shar_wnt_.tmp
  363. fi
  364. # ============= xarchie-2.0.6/FWF/Dir/Imakefile ==============
  365. if test -f 'xarchie-2.0.6/FWF/Dir/Imakefile' -a X"$1" != X"-c"; then
  366.     echo 'x - skipping xarchie-2.0.6/FWF/Dir/Imakefile (File already exists)'
  367.     rm -f _shar_wnt_.tmp
  368. else
  369. > _shar_wnt_.tmp
  370. echo 'x - extracting xarchie-2.0.6/FWF/Dir/Imakefile (Text)'
  371. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/Imakefile' &&
  372. #
  373. # Imakefile for Dir
  374. #
  375. # Note that this Imakefile is just sufficient to build the Dir routines
  376. # for use with xarchie. The original FWF distribution contains a more
  377. # elaborate Imakefile for a variety of purposes. See the file ../README.
  378. #
  379. # George Ferguson, ferguson@cs.rochester.edu, 26 Nov 1992.
  380. #
  381. X
  382. SRCS = Directory.c DirMgr.c RegExp.c
  383. OBJS = Directory.o DirMgr.o RegExp.o
  384. X
  385. INCLUDES = -I.
  386. X
  387. AllTarget(first)
  388. NormalLibraryTarget(Dir,$(OBJS))
  389. X
  390. first:
  391. X    @rm -f dirent.h
  392. X    @(if [ ! -f /usr/include/dirent.h ];            \
  393. X        then echo "Patching because no dirent.h";        \
  394. X             echo "#ifndef _BRIDIRENT_H_" > dirent.h;    \
  395. X             echo "#define _BRIDIRENT_H_" >> dirent.h;    \
  396. X             echo "#define dirent direct" >> dirent.h;    \
  397. X             echo "#include <sys/dir.h>" >> dirent.h;    \
  398. X             echo "#endif" >> dirent.h;            \
  399. X        else echo "";                    \
  400. X        fi; exit 0)
  401. X    @rm -f regexp.h
  402. X    @(if [ ! -f /usr/include/regexp.h ];            \
  403. X        then echo "Patching because no regexp.h";        \
  404. X             echo "#ifndef _BRIREGEXP_H_" > regexp.h;    \
  405. X             echo "#define _BRIREGEXP_H_" >> regexp.h;    \
  406. X             echo "#define NO_REGEXP 1" >> regexp.h;    \
  407. X             echo "#endif" >> regexp.h;            \
  408. X        else echo "";                    \
  409. X        fi; exit 0)
  410. X
  411. DependTarget()
  412. SHAR_EOF
  413. chmod 0644 xarchie-2.0.6/FWF/Dir/Imakefile ||
  414. echo 'restore of xarchie-2.0.6/FWF/Dir/Imakefile failed'
  415. Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/Imakefile'`"
  416. test 1225 -eq "$Wc_c" ||
  417.     echo 'xarchie-2.0.6/FWF/Dir/Imakefile: original size 1225, current size' "$Wc_c"
  418. rm -f _shar_wnt_.tmp
  419. fi
  420. # ============= xarchie-2.0.6/FWF/Dir/Makefile ==============
  421. if test -f 'xarchie-2.0.6/FWF/Dir/Makefile' -a X"$1" != X"-c"; then
  422.     echo 'x - skipping xarchie-2.0.6/FWF/Dir/Makefile (File already exists)'
  423.     rm -f _shar_wnt_.tmp
  424. else
  425. > _shar_wnt_.tmp
  426. echo 'x - extracting xarchie-2.0.6/FWF/Dir/Makefile (Text)'
  427. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/Makefile' &&
  428. # Makefile generated by imake - do not edit!
  429. # $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
  430. #
  431. # The cpp used on this machine replaces all newlines and multiple tabs and
  432. # spaces in a macro expansion with a single space.  Imake tries to compensate
  433. # for this, but is not always successful.
  434. #
  435. X
  436. # -------------------------------------------------------------------------
  437. # Makefile generated from "Imake.tmpl" and </tmp/IIf.a12656>
  438. # $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
  439. #
  440. # Platform-specific parameters may be set in the appropriate <vendor>.cf
  441. # configuration files.  Site-specific parameters should be set in the file
  442. # site.def.  Full rebuilds are recommended if any parameters are changed.
  443. #
  444. # If your C preprocessor does not define any unique symbols, you will need
  445. # to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  446. # "make World" the first time).
  447. #
  448. X
  449. # -------------------------------------------------------------------------
  450. # site-specific configuration parameters that need to come before
  451. # the platform-specific parameters - edit site.def to change
  452. X
  453. # site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  454. X
  455. # -------------------------------------------------------------------------
  456. # platform-specific configuration parameters - edit sun.cf to change
  457. X
  458. # platform:  $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
  459. X
  460. # operating system:  SunOS 4.1.1
  461. X
  462. # $XConsortium: sunLib.rules,v 1.7 91/12/20 11:19:47 rws Exp $
  463. X
  464. # -------------------------------------------------------------------------
  465. # site-specific configuration parameters that go after
  466. # the platform-specific parameters - edit site.def to change
  467. X
  468. # site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  469. X
  470. X            SHELL = /bin/sh
  471. X
  472. X              TOP = ../../.
  473. X      CURRENT_DIR = ./FWF/Dir
  474. X
  475. X               AR = ar clq
  476. X  BOOTSTRAPCFLAGS =
  477. X               CC = cc
  478. X               AS = as
  479. X
  480. X         COMPRESS = compress
  481. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  482. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  483. X          INSTALL = install
  484. X               LD = ld
  485. X             LINT = lint
  486. X      LINTLIBFLAG = -C
  487. X         LINTOPTS = -axz
  488. X               LN = ln -s
  489. X             MAKE = make
  490. X               MV = mv
  491. X               CP = cp
  492. X
  493. X           RANLIB = ranlib
  494. X  RANLIBINSTFLAGS =
  495. X
  496. X               RM = rm -f
  497. X            TROFF = psroff
  498. X         MSMACROS = -ms
  499. X              TBL = tbl
  500. X              EQN = eqn
  501. X     STD_INCLUDES =
  502. X  STD_CPP_DEFINES =
  503. X      STD_DEFINES =
  504. X EXTRA_LOAD_FLAGS =
  505. X  EXTRA_LIBRARIES =
  506. X             TAGS = ctags
  507. X
  508. X    SHAREDCODEDEF = -DSHAREDCODE
  509. X         SHLIBDEF = -DSUNSHLIB
  510. X
  511. X    PROTO_DEFINES =
  512. X
  513. X     INSTPGMFLAGS =
  514. X
  515. X     INSTBINFLAGS = -m 0755
  516. X     INSTUIDFLAGS = -m 4755
  517. X     INSTLIBFLAGS = -m 0644
  518. X     INSTINCFLAGS = -m 0444
  519. X     INSTMANFLAGS = -m 0444
  520. X     INSTDATFLAGS = -m 0444
  521. X    INSTKMEMFLAGS = -g kmem -m 2755
  522. X
  523. X      PROJECTROOT = /usr/staff
  524. X
  525. X     TOP_INCLUDES = -I$(INCROOT)
  526. X
  527. X      CDEBUGFLAGS = -O
  528. X        CCOPTIONS = -pipe
  529. X
  530. X      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
  531. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
  532. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  533. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  534. X
  535. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  536. X
  537. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
  538. X
  539. X   LDCOMBINEFLAGS = -X -r
  540. X      DEPENDFLAGS =
  541. X
  542. X        MACROFILE = sun.cf
  543. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  544. X
  545. X    IMAKE_DEFINES =
  546. X
  547. X         IRULESRC = $(CONFIGDIR)
  548. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  549. X
  550. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  551. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  552. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  553. X
  554. # -------------------------------------------------------------------------
  555. # X Window System Build Parameters
  556. # $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
  557. X
  558. # -------------------------------------------------------------------------
  559. # X Window System make variables; this need to be coordinated with rules
  560. X
  561. X          PATHSEP = /
  562. X        USRLIBDIR = /usr/staff/lib
  563. X           BINDIR = /usr/staff/bin
  564. X          INCROOT = /usr/staff/include
  565. X     BUILDINCROOT = $(TOP)
  566. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  567. X      BUILDINCTOP = ..
  568. X           INCDIR = $(INCROOT)/X11
  569. X           ADMDIR = /usr/adm
  570. X           LIBDIR = $(USRLIBDIR)/X11
  571. X        CONFIGDIR = $(LIBDIR)/config
  572. X       LINTLIBDIR = $(USRLIBDIR)/lint
  573. X
  574. X          FONTDIR = $(LIBDIR)/fonts
  575. X         XINITDIR = $(LIBDIR)/xinit
  576. X           XDMDIR = $(LIBDIR)/xdm
  577. X           TWMDIR = $(LIBDIR)/twm
  578. X          MANPATH = /usr/staff/man
  579. X    MANSOURCEPATH = $(MANPATH)/man
  580. X        MANSUFFIX = 1
  581. X     LIBMANSUFFIX = 3
  582. X           MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
  583. X        LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
  584. X           NLSDIR = $(LIBDIR)/nls
  585. X        PEXAPIDIR = $(LIBDIR)/PEX
  586. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  587. X       FONTCFLAGS = -t
  588. X
  589. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  590. X
  591. X            IMAKE = imake
  592. X           DEPEND = makedepend
  593. X              RGB = rgb
  594. X
  595. X            FONTC = bdftopcf
  596. X
  597. X        MKFONTDIR = mkfontdir
  598. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
  599. X
  600. X        CONFIGSRC = $(TOP)/config
  601. X       DOCUTILSRC = $(TOP)/doc/util
  602. X        CLIENTSRC = $(TOP)/clients
  603. X          DEMOSRC = $(TOP)/demos
  604. X           LIBSRC = $(TOP)/lib
  605. X          FONTSRC = $(TOP)/fonts
  606. X       INCLUDESRC = $(TOP)/X11
  607. X        SERVERSRC = $(TOP)/server
  608. X          UTILSRC = $(TOP)/util
  609. X        SCRIPTSRC = $(UTILSRC)/scripts
  610. X       EXAMPLESRC = $(TOP)/examples
  611. X       CONTRIBSRC = $(TOP)/../contrib
  612. X           DOCSRC = $(TOP)/doc
  613. X           RGBSRC = $(TOP)/rgb
  614. X        DEPENDSRC = $(UTILSRC)/makedepend
  615. X         IMAKESRC = $(CONFIGSRC)
  616. X         XAUTHSRC = $(LIBSRC)/Xau
  617. X          XLIBSRC = $(LIBSRC)/X
  618. X           XMUSRC = $(LIBSRC)/Xmu
  619. X       TOOLKITSRC = $(LIBSRC)/Xt
  620. X       AWIDGETSRC = $(LIBSRC)/Xaw
  621. X       OLDXLIBSRC = $(LIBSRC)/oldX
  622. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  623. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  624. X      BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
  625. X      BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
  626. X     MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
  627. X         FSLIBSRC = $(FONTSRC)/lib/fs
  628. X    FONTSERVERSRC = $(FONTSRC)/server
  629. X     EXTENSIONSRC = $(TOP)/extensions
  630. X         XILIBSRC = $(EXTENSIONSRC)/lib/xinput
  631. X      PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
  632. X
  633. # $XConsortium: sunLib.tmpl,v 1.14.1.1 92/03/17 14:58:46 rws Exp $
  634. X
  635. SHLIBLDFLAGS = -assert pure-text
  636. PICFLAGS = -pic
  637. X
  638. X  DEPEXTENSIONLIB =
  639. X     EXTENSIONLIB = -lXext
  640. X
  641. X          DEPXLIB = $(DEPEXTENSIONLIB)
  642. X             XLIB = $(EXTENSIONLIB) -lX11
  643. X
  644. X        DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
  645. X       XMULIBONLY = -lXmu
  646. X           XMULIB = -lXmu
  647. X
  648. X       DEPOLDXLIB =
  649. X          OLDXLIB = -loldX
  650. X
  651. X      DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
  652. X         XTOOLLIB = -lXt
  653. X
  654. X        DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
  655. X           XAWLIB = -lXaw
  656. X
  657. X        DEPXILIB =
  658. X           XILIB = -lXi
  659. X
  660. X        SOXLIBREV = 4.10
  661. X          SOXTREV = 4.10
  662. X         SOXAWREV = 5.0
  663. X        SOOLDXREV = 4.10
  664. X         SOXMUREV = 4.10
  665. X        SOXEXTREV = 4.10
  666. X      SOXINPUTREV = 4.10
  667. X
  668. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  669. X         XAUTHLIB =  -lXau
  670. X      DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
  671. X         XDMCPLIB =  -lXdmcp
  672. X
  673. X        DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
  674. X           PHIGSLIB =  -lphigs
  675. X
  676. X       DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
  677. X          XBSDLIB =  -lXbsd
  678. X
  679. X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
  680. X         LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
  681. X          LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
  682. X        LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
  683. X          LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
  684. X           LINTXI = $(LINTLIBDIR)/llib-lXi.ln
  685. X        LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
  686. X
  687. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  688. X
  689. X         DEPLIBS1 = $(DEPLIBS)
  690. X         DEPLIBS2 = $(DEPLIBS)
  691. X         DEPLIBS3 = $(DEPLIBS)
  692. X
  693. # -------------------------------------------------------------------------
  694. # Imake rules for building libraries, programs, scripts, and data files
  695. # rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
  696. X
  697. # -------------------------------------------------------------------------
  698. # start of Imakefile
  699. X
  700. #
  701. # Imakefile for Dir
  702. #
  703. # Note that this Imakefile is just sufficient to build the Dir routines
  704. # for use with xarchie. The original FWF distribution contains a more
  705. # elaborate Imakefile for a variety of purposes. See the file ../README.
  706. #
  707. # George Ferguson, ferguson@cs.rochester.edu, 26 Nov 1992.
  708. #
  709. X
  710. SRCS = Directory.c DirMgr.c RegExp.c
  711. OBJS = Directory.o DirMgr.o RegExp.o
  712. X
  713. INCLUDES = -I.
  714. X
  715. all:: first
  716. X
  717. all:: libDir.a
  718. X
  719. libDir.a: $(OBJS)
  720. X    $(RM) $@
  721. X    $(AR) $@ $(OBJS)
  722. X    $(RANLIB) $@
  723. X
  724. first:
  725. X    @rm -f dirent.h
  726. X    @(if [ ! -f /usr/include/dirent.h ];            \
  727. X        then echo "Patching because no dirent.h";        \
  728. X             echo "#ifndef _BRIDIRENT_H_" > dirent.h;    \
  729. X             echo "#define _BRIDIRENT_H_" >> dirent.h;    \
  730. X             echo "#define dirent direct" >> dirent.h;    \
  731. X             echo "#include <sys/dir.h>" >> dirent.h;    \
  732. X             echo "#endif" >> dirent.h;            \
  733. X        else echo "";                    \
  734. X        fi; exit 0)
  735. X    @rm -f regexp.h
  736. X    @(if [ ! -f /usr/include/regexp.h ];            \
  737. X        then echo "Patching because no regexp.h";        \
  738. X             echo "#ifndef _BRIREGEXP_H_" > regexp.h;    \
  739. X             echo "#define _BRIREGEXP_H_" >> regexp.h;    \
  740. X             echo "#define NO_REGEXP 1" >> regexp.h;    \
  741. X             echo "#endif" >> regexp.h;            \
  742. X        else echo "";                    \
  743. X        fi; exit 0)
  744. X
  745. depend::
  746. X    $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  747. X
  748. # -------------------------------------------------------------------------
  749. # common rules for all Makefiles - do not edit
  750. X
  751. emptyrule::
  752. X
  753. clean::
  754. X    $(RM_CMD) "#"*
  755. X
  756. Makefile::
  757. X    -@if [ -f Makefile ]; then set -x; \
  758. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  759. X    else exit 0; fi
  760. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  761. X
  762. tags::
  763. X    $(TAGS) -w *.[ch]
  764. X    $(TAGS) -xw *.[ch] > TAGS
  765. X
  766. saber:
  767. X    # load $(ALLDEFINES) $(SRCS)
  768. X
  769. osaber:
  770. X    # load $(ALLDEFINES) $(OBJS)
  771. X
  772. # -------------------------------------------------------------------------
  773. # empty rules for directories that do not have SUBDIRS - do not edit
  774. X
  775. install::
  776. X    @echo "install in $(CURRENT_DIR) done"
  777. X
  778. install.man::
  779. X    @echo "install.man in $(CURRENT_DIR) done"
  780. X
  781. Makefiles::
  782. X
  783. includes::
  784. X
  785. # -------------------------------------------------------------------------
  786. # dependencies generated by makedepend
  787. X
  788. SHAR_EOF
  789. chmod 0644 xarchie-2.0.6/FWF/Dir/Makefile ||
  790. echo 'restore of xarchie-2.0.6/FWF/Dir/Makefile failed'
  791. Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/Makefile'`"
  792. test 10638 -eq "$Wc_c" ||
  793.     echo 'xarchie-2.0.6/FWF/Dir/Makefile: original size 10638, current size' "$Wc_c"
  794. rm -f _shar_wnt_.tmp
  795. fi
  796. # ============= xarchie-2.0.6/FWF/Dir/Makefile.dst ==============
  797. if test -f 'xarchie-2.0.6/FWF/Dir/Makefile.dst' -a X"$1" != X"-c"; then
  798.     echo 'x - skipping xarchie-2.0.6/FWF/Dir/Makefile.dst (File already exists)'
  799.     rm -f _shar_wnt_.tmp
  800. else
  801. > _shar_wnt_.tmp
  802. echo 'x - extracting xarchie-2.0.6/FWF/Dir/Makefile.dst (Text)'
  803. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/Makefile.dst' &&
  804. # This Makefile is for use with FileSelector if you don't have imake/xmkmf.
  805. X
  806. RM = rm -f
  807. AR = ar clq
  808. RANLIB = ranlib
  809. X
  810. # These should be set in the master Makefile
  811. XXINCS = -I/usr/local/include
  812. CDEBUGFLAGS = -g
  813. X
  814. OBJS = Directory.o DirMgr.o RegExp.o
  815. INCLUDES = -I.
  816. CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(XINCS)
  817. X
  818. libDir.a: first $(OBJS)
  819. X    $(RM) $@
  820. X    $(AR) $@ $(OBJS)
  821. X    $(RANLIB) $(@)
  822. X
  823. first:
  824. X    @rm -f dirent.h
  825. X    @(if [ ! -f /usr/include/dirent.h ];            \
  826. X        then echo "Patching because no dirent.h";        \
  827. X             echo "#ifndef _BRIDIRENT_H_" > dirent.h;    \
  828. X             echo "#define _BRIDIRENT_H_" >> dirent.h;    \
  829. X             echo "#define dirent direct" >> dirent.h;    \
  830. X             echo "#include <sys/dir.h>" >> dirent.h;    \
  831. X             echo "#endif" >> dirent.h;            \
  832. X        else echo "";                    \
  833. X        fi; exit 0)
  834. X    @rm -f regexp.h
  835. X    @(if [ ! -f /usr/include/regexp.h ];            \
  836. X        then echo "Patching because no regexp.h";        \
  837. X             echo "#ifndef _BRIREGEXP_H_" > regexp.h;    \
  838. X             echo "#define _BRIREGEXP_H_" >> regexp.h;    \
  839. X             echo "#define NO_REGEXP 1" >> regexp.h;    \
  840. X             echo "#endif" >> regexp.h;            \
  841. X        else echo "";                    \
  842. X        fi; exit 0)
  843. X
  844. clean:
  845. X    $(RM) libDir.a $(OBJS)
  846. SHAR_EOF
  847. chmod 0644 xarchie-2.0.6/FWF/Dir/Makefile.dst ||
  848. echo 'restore of xarchie-2.0.6/FWF/Dir/Makefile.dst failed'
  849. Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/Makefile.dst'`"
  850. test 1172 -eq "$Wc_c" ||
  851.     echo 'xarchie-2.0.6/FWF/Dir/Makefile.dst: original size 1172, current size' "$Wc_c"
  852. rm -f _shar_wnt_.tmp
  853. fi
  854. # ============= xarchie-2.0.6/FWF/Dir/OldMakefile ==============
  855. if test -f 'xarchie-2.0.6/FWF/Dir/OldMakefile' -a X"$1" != X"-c"; then
  856.     echo 'x - skipping xarchie-2.0.6/FWF/Dir/OldMakefile (File already exists)'
  857.     rm -f _shar_wnt_.tmp
  858. else
  859. > _shar_wnt_.tmp
  860. echo 'x - extracting xarchie-2.0.6/FWF/Dir/OldMakefile (Text)'
  861. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/OldMakefile' &&
  862. FWFINCDIR       =    $(BASEPATH)/include
  863. FWFLIBDIR       =    $(BASEPATH)/lib
  864. FWFBINDIR       =    $(BASEPATH)/bin
  865. X
  866. CP        =    cp
  867. CC        =    cc
  868. CFLAGS        =    -g -I.
  869. MV        =    mv
  870. RM        =    rm
  871. X
  872. DIRH        =    Directory.h
  873. DIRSRC        =    Directory.c
  874. DIROBJ        =    Directory.o
  875. DIRTESTSRC    =    DirectoryTest.c
  876. DIRTESTOBJ    =    DirectoryTest.o
  877. DIRTEST        =    $(FWFBINDIR)/DirectoryTest
  878. REGH        =    RegExp.h
  879. REGSRC        =    RegExp.c
  880. REGOBJ        =    RegExp.o
  881. REGTESTSRC    =    RegExpTest.c
  882. REGTESTOBJ    =    RegExpTest.o
  883. REGTEST        =    $(FWFBINDIR)/RegExpTest
  884. DIRMGRH        =    DirectoryMgr.h
  885. DIRMGRSRC    =    DirectoryMgr.c
  886. DIRMGROBJ    =    DirectoryMgr.o
  887. DIRMGRTESTSRC    =    DirectoryMgrTest.c
  888. DIRMGRTESTOBJ    =    DirectoryMgrTest.o
  889. DIRMGRTEST    =    $(FWFBINDIR)/DirectoryMgrTest
  890. X
  891. HEADERS         =       $(FWFINCDIR)/$(DIRH) $(FWFINCDIR)/$(REGH) \
  892. X                        $(FWFINCDIR)/$(DIRMGRH)
  893. X
  894. OBJS        =    $(DIROBJ) $(REGOBJ) $(DIRMGROBJ)
  895. OUTLIB        =    $(FWFLIBDIR)/libDir.a
  896. X
  897. all::        first $(DIRTEST) $(REGTEST) $(DIRMGRTEST) $(OUTLIB)
  898. X
  899. first:
  900. X        @rm -f dirent.h
  901. X        @rm -f $(FWFINCDIR)/dirent.h
  902. X        -@if [ ! -f /usr/include/dirent.h ];            \
  903. X            then echo "Patching because no dirent.h";        \
  904. X                 echo "#ifndef _BRIDIRENT_H_" > dirent.h;    \
  905. X                 echo "#define _BRIDIRENT_H_" >> dirent.h;    \
  906. X                 echo "#define dirent direct" >> dirent.h;    \
  907. X                 echo "#include <sys/dir.h>" >> dirent.h;    \
  908. X                 echo "#endif" >> dirent.h;            \
  909. X                 cp dirent.h $(FWFINCDIR)/dirent.h        \
  910. X            else echo "";                    \
  911. X            fi
  912. X        @rm -f regexp.h
  913. X        @rm -f $(FWFINCDIR)/regexp.h
  914. X        -@if [ ! -f /usr/include/regexp.h ];            \
  915. X            then echo "Patching because no regexp.h";        \
  916. X                 echo "#ifndef _BRIREGEXP_H_" > regexp.h;    \
  917. X                 echo "#define _BRIREGEXP_H_" >> regexp.h;    \
  918. X                 echo "#define NO_REGEXP 1" >> regexp.h;    \
  919. X                 echo "#endif" >> regexp.h;            \
  920. X                 cp regexp.h $(FWFINCDIR)/regexp.h        \
  921. X            else echo "";                    \
  922. X            fi
  923. X
  924. $(DIRTEST):    $(DIRTESTOBJ) $(DIROBJ) $(REGOBJ) $(FWFINCDIR)/$(DIRH)
  925. X    $(CC) $(CFLAGS) $(DIRTESTOBJ) $(DIROBJ) $(REGOBJ) $(LIBS) -o $(DIRTEST)
  926. X
  927. $(DIRTESTOBJ):    $(DIRTESTSRC) $(FWFINCDIR)/$(DIRH)
  928. X    $(CC) $(CFLAGS) -c $(DIRTESTSRC)
  929. X
  930. $(DIROBJ):    $(DIRSRC) $(FWFINCDIR)/$(DIRH)
  931. X    $(CC) $(CFLAGS) -c $(DIRSRC)
  932. X
  933. $(FWFINCDIR)/$(DIRH): $(DIRH)
  934. X    $(CP) $(DIRH) $(FWFINCDIR)
  935. X
  936. X
  937. X
  938. X
  939. $(REGTEST):    $(REGTESTOBJ) $(REGOBJ) $(FWFINCDIR)/$(REGH)
  940. X    $(CC) $(CFLAGS) $(REGTESTOBJ) $(REGOBJ) -o $(REGTEST)
  941. X
  942. $(REGTESTOBJ):    $(REGTESTSRC) $(FWFINCDIR)/$(REGH)
  943. X    $(CC) $(CFLAGS) -c $(REGTESTSRC)
  944. X
  945. $(REGOBJ):    $(REGSRC) $(FWFINCDIR)/$(REGH)
  946. X    $(CC) $(CFLAGS) -c $(REGSRC)
  947. X
  948. $(FWFINCDIR)/$(REGH): $(REGH)
  949. X    $(CP) $(REGH) $(FWFINCDIR)
  950. X
  951. X
  952. X
  953. X
  954. $(DIRMGRTEST):    $(DIRMGRTESTOBJ) $(DIROBJ) $(REGOBJ) $(DIRMGROBJ)
  955. X    $(CC) $(CFLAGS) $(DIRMGRTESTOBJ) $(DIRMGROBJ) $(DIROBJ) $(REGOBJ) $(LIBS) -o $(DIRMGRTEST)
  956. X
  957. $(DIRMGRTESTOBJ):    $(DIRMGRTESTSRC) $(HEADERS)
  958. X    $(CC) $(CFLAGS) -c $(DIRMGRTESTSRC)
  959. X
  960. $(DIRMGROBJ):    $(DIRMGRSRC) $(HEADERS)
  961. X    $(CC) $(CFLAGS) -c $(DIRMGRSRC)
  962. X
  963. $(FWFINCDIR)/$(DIRMGRH): $(DIRMGRH)
  964. X    $(CP) $(DIRMGRH) $(FWFINCDIR)
  965. X
  966. X
  967. X
  968. X
  969. $(OUTLIB): $(OBJS)
  970. X    ar rv $(OUTLIB) $(OBJS)
  971. X    ranlib $(OUTLIB)
  972. X
  973. clean:
  974. X    rm -f *.o core *~ *# regexp.h dirent.h
  975. SHAR_EOF
  976. chmod 0644 xarchie-2.0.6/FWF/Dir/OldMakefile ||
  977. echo 'restore of xarchie-2.0.6/FWF/Dir/OldMakefile failed'
  978. Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/OldMakefile'`"
  979. test 3021 -eq "$Wc_c" ||
  980.     echo 'xarchie-2.0.6/FWF/Dir/OldMakefile: original size 3021, current size' "$Wc_c"
  981. rm -f _shar_wnt_.tmp
  982. fi
  983. # ============= xarchie-2.0.6/FWF/Dir/RegExp.c ==============
  984. if test -f 'xarchie-2.0.6/FWF/Dir/RegExp.c' -a X"$1" != X"-c"; then
  985.     echo 'x - skipping xarchie-2.0.6/FWF/Dir/RegExp.c (File already exists)'
  986.     rm -f _shar_wnt_.tmp
  987. else
  988. > _shar_wnt_.tmp
  989. echo 'x - extracting xarchie-2.0.6/FWF/Dir/RegExp.c (Text)'
  990. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/RegExp.c' &&
  991. /****************************************************************************
  992. X
  993. X    RegExp.c
  994. X
  995. X    This file contains the C code for the regular expression
  996. X    matching code.
  997. X
  998. X    The routines supported act as a more friendly, user level
  999. X    interface to the regexp regular expression matching system.
  1000. X
  1001. X ****************************************************************************/
  1002. /*
  1003. X * Copyright 1990,1991,1992 Brian Totty
  1004. X * 
  1005. X * Permission to use, copy, modify, distribute, and sell this software
  1006. X * and its documentation for any purpose is hereby granted without fee,
  1007. X * provided that the above copyright notice appears in all copies and that
  1008. X * both that copyright notice and this permission notice appear in
  1009. X * supporting documentation, and that the name of Brian Totty or
  1010. X * University of Illinois not be used in advertising or publicity
  1011. X * pertaining to distribution of the software without specific, written
  1012. X * prior permission.  Brian Totty and University of Illinois make no
  1013. X * representations about the suitability of this software for any
  1014. X * purpose.  It is provided "as is" without express or implied warranty.
  1015. X *
  1016. X * Brian Totty and University of Illinois disclaim all warranties with
  1017. X * regard to this software, including all implied warranties of
  1018. X * merchantability and fitness, in no event shall Brian Totty or
  1019. X * University of Illinois be liable for any special, indirect or
  1020. X * consequential damages or any damages whatsoever resulting from loss of
  1021. X * use, data or profits, whether in an action of contract, negligence or
  1022. X * other tortious action, arising out of or in connection with the use or
  1023. X * performance of this software.
  1024. X *
  1025. X * Author:
  1026. X *     Brian Totty
  1027. X *     Department of Computer Science
  1028. X *     University Of Illinois at Urbana-Champaign
  1029. X *    1304 West Springfield Avenue
  1030. X *     Urbana, IL 61801
  1031. X * 
  1032. X *     totty@cs.uiuc.edu
  1033. X *     
  1034. X */ 
  1035. X
  1036. #include <RegExp.h>
  1037. #include <regexp.h>
  1038. X
  1039. void RegExpCompile(regexp,fsm_ptr,fsm_length)
  1040. char *regexp,*fsm_ptr;
  1041. int fsm_length;
  1042. {
  1043. #ifndef NO_REGEXP
  1044. X    compile(regexp,fsm_ptr,&(fsm_ptr[fsm_length]),'\0');
  1045. #endif
  1046. } /* End RegExpCompile */
  1047. X
  1048. X
  1049. int RegExpMatch(string,fsm_ptr)
  1050. char *string,*fsm_ptr;
  1051. {
  1052. #ifndef NO_REGEXP
  1053. X    if (advance(string,fsm_ptr) != 0)
  1054. X        return(TRUE);
  1055. X        else
  1056. X        return(FALSE);
  1057. #else
  1058. X    return(TRUE);
  1059. #endif
  1060. } /* End RegExpMatch */
  1061. X
  1062. X
  1063. void _RegExpError(val)
  1064. int val;
  1065. {
  1066. X    fprintf(stderr,"Regular Expression Error %d\n",val);
  1067. X    exit(-1);
  1068. } /* End _RegExpError */
  1069. X
  1070. X
  1071. void RegExpPatternToRegExp(pattern,reg_exp)
  1072. char *pattern,*reg_exp;
  1073. {
  1074. X    int in_bracket;
  1075. X
  1076. X    in_bracket = 0;
  1077. X    while (*pattern != '\0')
  1078. X    {
  1079. X        if (in_bracket)
  1080. X        {
  1081. X            if (*pattern == ']') in_bracket = 0;
  1082. X            *reg_exp++ = *pattern++;
  1083. X        }
  1084. X            else
  1085. X        {
  1086. X            switch (*pattern)
  1087. X            {
  1088. X                case '[':
  1089. X                in_bracket = 1;
  1090. X                *reg_exp++ = '[';
  1091. X                break;
  1092. X                case '?':
  1093. X                *reg_exp++ = '.';
  1094. X                break;
  1095. X                case '*':
  1096. X                *reg_exp++ = '.';
  1097. X                *reg_exp++ = '*';
  1098. X                break;
  1099. X                case '.':
  1100. X                *reg_exp++ = '\\';
  1101. X                *reg_exp++ = '.';
  1102. X                break;
  1103. X                default:
  1104. X                *reg_exp++ = *pattern;
  1105. X                break;
  1106. X            }
  1107. X            ++ pattern;
  1108. X        }
  1109. X    }
  1110. X    *reg_exp++ = '$';
  1111. X    *reg_exp++ = '\0';
  1112. } /* End RegExpPatternToRegExp */
  1113. SHAR_EOF
  1114. chmod 0644 xarchie-2.0.6/FWF/Dir/RegExp.c ||
  1115. echo 'restore of xarchie-2.0.6/FWF/Dir/RegExp.c failed'
  1116. Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/RegExp.c'`"
  1117. test 3088 -eq "$Wc_c" ||
  1118.     echo 'xarchie-2.0.6/FWF/Dir/RegExp.c: original size 3088, current size' "$Wc_c"
  1119. rm -f _shar_wnt_.tmp
  1120. fi
  1121. # ============= xarchie-2.0.6/FWF/Dir/RegExp.h ==============
  1122. if test -f 'xarchie-2.0.6/FWF/Dir/RegExp.h' -a X"$1" != X"-c"; then
  1123.     echo 'x - skipping xarchie-2.0.6/FWF/Dir/RegExp.h (File already exists)'
  1124.     rm -f _shar_wnt_.tmp
  1125. else
  1126. > _shar_wnt_.tmp
  1127. echo 'x - extracting xarchie-2.0.6/FWF/Dir/RegExp.h (Text)'
  1128. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/RegExp.h' &&
  1129. /****************************************************************************
  1130. X
  1131. X    RegExp.h
  1132. X
  1133. X    This file contains the C definitions and declarations for
  1134. X    the regular expression matching code.
  1135. X
  1136. X    The routines supported act as a more friendly, user level
  1137. X    interface to the regexp regular expression matching system.
  1138. X
  1139. X ****************************************************************************/
  1140. /*
  1141. X * Copyright 1990,1991,1992 Brian Totty
  1142. X * 
  1143. X * Permission to use, copy, modify, distribute, and sell this software
  1144. X * and its documentation for any purpose is hereby granted without fee,
  1145. X * provided that the above copyright notice appears in all copies and that
  1146. X * both that copyright notice and this permission notice appear in
  1147. X * supporting documentation, and that the name of Brian Totty or
  1148. X * University of Illinois not be used in advertising or publicity
  1149. X * pertaining to distribution of the software without specific, written
  1150. X * prior permission.  Brian Totty and University of Illinois make no
  1151. X * representations about the suitability of this software for any
  1152. X * purpose.  It is provided "as is" without express or implied warranty.
  1153. X *
  1154. X * Brian Totty and University of Illinois disclaim all warranties with
  1155. X * regard to this software, including all implied warranties of
  1156. X * merchantability and fitness, in no event shall Brian Totty or
  1157. X * University of Illinois be liable for any special, indirect or
  1158. X * consequential damages or any damages whatsoever resulting from loss of
  1159. X * use, data or profits, whether in an action of contract, negligence or
  1160. X * other tortious action, arising out of or in connection with the use or
  1161. X * performance of this software.
  1162. X *
  1163. X * Author:
  1164. X *     Brian Totty
  1165. X *     Department of Computer Science
  1166. X *     University Of Illinois at Urbana-Champaign
  1167. X *    1304 West Springfield Avenue
  1168. X *     Urbana, IL 61801
  1169. X * 
  1170. X *     totty@cs.uiuc.edu
  1171. X *     
  1172. X */ 
  1173. X
  1174. #ifndef _RegExp_h_
  1175. #define _RegExp_h_
  1176. X
  1177. #include <stdio.h>
  1178. X
  1179. #if (!NeedFunctionPrototypes)
  1180. X
  1181. void    RegExpCompile();
  1182. int    RegExpMatch();
  1183. void    _RegExpError();
  1184. void    RegExpPatternToRegExp();
  1185. X
  1186. #else
  1187. X
  1188. void    RegExpCompile(char *regexp, char *fsm_ptr, int fsm_length);
  1189. int    RegExpMatch(char *string, char *fsm_ptr);
  1190. void    _RegExpError(int val);
  1191. void    RegExpPatternToRegExp(char *pattern, char *reg_exp);
  1192. X
  1193. #endif
  1194. X
  1195. #ifndef TRUE
  1196. #define TRUE                1
  1197. #endif
  1198. X
  1199. #ifndef FALSE
  1200. #define    FALSE                0
  1201. #endif
  1202. X
  1203. #define    INIT        register char *sp = instring;
  1204. #define    GETC()        (*sp++)
  1205. #define    PEEKC()        (*sp)
  1206. #define    UNGETC(c)    -- sp
  1207. #define    RETURN(ptr)    return;
  1208. #define    ERROR(val)    _RegExpError(val)
  1209. X
  1210. #endif
  1211. SHAR_EOF
  1212. chmod 0644 xarchie-2.0.6/FWF/Dir/RegExp.h ||
  1213. echo 'restore of xarchie-2.0.6/FWF/Dir/RegExp.h failed'
  1214. Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/RegExp.h'`"
  1215. test 2520 -eq "$Wc_c" ||
  1216.     echo 'xarchie-2.0.6/FWF/Dir/RegExp.h: original size 2520, current size' "$Wc_c"
  1217. rm -f _shar_wnt_.tmp
  1218. fi
  1219. # ============= xarchie-2.0.6/FWF/Dir/RegExpT.c ==============
  1220. if test -f 'xarchie-2.0.6/FWF/Dir/RegExpT.c' -a X"$1" != X"-c"; then
  1221.     echo 'x - skipping xarchie-2.0.6/FWF/Dir/RegExpT.c (File already exists)'
  1222.     rm -f _shar_wnt_.tmp
  1223. else
  1224. > _shar_wnt_.tmp
  1225. echo 'x - extracting xarchie-2.0.6/FWF/Dir/RegExpT.c (Text)'
  1226. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/RegExpT.c' &&
  1227. /*
  1228. X * Copyright 1990,1991,1992 Brian Totty
  1229. X * 
  1230. X * Permission to use, copy, modify, distribute, and sell this software
  1231. X * and its documentation for any purpose is hereby granted without fee,
  1232. X * provided that the above copyright notice appears in all copies and that
  1233. X * both that copyright notice and this permission notice appear in
  1234. X * supporting documentation, and that the name of Brian Totty or
  1235. X * University of Illinois not be used in advertising or publicity
  1236. X * pertaining to distribution of the software without specific, written
  1237. X * prior permission.  Brian Totty and University of Illinois make no
  1238. X * representations about the suitability of this software for any
  1239. X * purpose.  It is provided "as is" without express or implied warranty.
  1240. X *
  1241. X * Brian Totty and University of Illinois disclaim all warranties with
  1242. X * regard to this software, including all implied warranties of
  1243. X * merchantability and fitness, in no event shall Brian Totty or
  1244. X * University of Illinois be liable for any special, indirect or
  1245. X * consequential damages or any damages whatsoever resulting from loss of
  1246. X * use, data or profits, whether in an action of contract, negligence or
  1247. X * other tortious action, arising out of or in connection with the use or
  1248. X * performance of this software.
  1249. X *
  1250. X * Author:
  1251. X *     Brian Totty
  1252. X *     Department of Computer Science
  1253. X *     University Of Illinois at Urbana-Champaign
  1254. X *    1304 West Springfield Avenue
  1255. X *     Urbana, IL 61801
  1256. X * 
  1257. X *     totty@cs.uiuc.edu
  1258. X *     
  1259. X */ 
  1260. #include <stdio.h>
  1261. #include <RegExp.h>
  1262. X
  1263. int main(argc,argv)
  1264. int argc;
  1265. char **argv;
  1266. {
  1267. X    char fsm[1024],regexp[1024];
  1268. X    char *string,*ret_str,*re_comp();
  1269. X    int status;
  1270. X
  1271. X    if (argc != 3)
  1272. X    {
  1273. X        fprintf(stderr,"%s regexp string\n",argv[0]);
  1274. X        exit(1);
  1275. X    }
  1276. X    RegExpPatternToRegExp(argv[1],regexp);
  1277. X    string = argv[2];
  1278. X    RegExpCompile(regexp,fsm,1024);
  1279. X    status = RegExpMatch(string,fsm);
  1280. X    printf("Matching '%s' with pattern '%s' (regexp '%s') returns %d\n",
  1281. X           string,argv[1],regexp,status);
  1282. X    return(1);
  1283. }
  1284. SHAR_EOF
  1285. chmod 0644 xarchie-2.0.6/FWF/Dir/RegExpT.c ||
  1286. echo 'restore of xarchie-2.0.6/FWF/Dir/RegExpT.c failed'
  1287. Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/RegExpT.c'`"
  1288. test 1961 -eq "$Wc_c" ||
  1289.     echo 'xarchie-2.0.6/FWF/Dir/RegExpT.c: original size 1961, current size' "$Wc_c"
  1290. rm -f _shar_wnt_.tmp
  1291. fi
  1292. # ============= xarchie-2.0.6/FWF/FileChooser/FChooser.c ==============
  1293. if test ! -d 'xarchie-2.0.6/FWF/FileChooser'; then
  1294.     echo 'x - creating directory xarchie-2.0.6/FWF/FileChooser'
  1295.     mkdir 'xarchie-2.0.6/FWF/FileChooser'
  1296. fi
  1297. if test -f 'xarchie-2.0.6/FWF/FileChooser/FChooser.c' -a X"$1" != X"-c"; then
  1298.     echo 'x - skipping xarchie-2.0.6/FWF/FileChooser/FChooser.c (File already exists)'
  1299.     rm -f _shar_wnt_.tmp
  1300. else
  1301. > _shar_wnt_.tmp
  1302. echo 'x - extracting xarchie-2.0.6/FWF/FileChooser/FChooser.c (Text)'
  1303. sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/FileChooser/FChooser.c' &&
  1304. /*
  1305. X * FChooser.c : A widget for choosing a file
  1306. X *
  1307. X * George Ferguson, ferguson@cs.rochester.edu, 21 Jan 1993.
  1308. X * Last update: 12 May 1993.
  1309. X *
  1310. X * This code is derived from the FileSelector widget by Brian Totty,
  1311. X * hence the following copyright applies:
  1312. X *
  1313. X * Copyright 1990,1991,1992 Brian Totty
  1314. X * 
  1315. X * Permission to use, copy, modify, distribute, and sell this software
  1316. X * and its documentation for any purpose is hereby granted without fee,
  1317. X * provided that the above copyright notice appears in all copies and that
  1318. X * both that copyright notice and this permission notice appear in
  1319. X * supporting documentation, and that the name of Brian Totty or
  1320. X * University of Illinois not be used in advertising or publicity
  1321. X * pertaining to distribution of the software without specific, written
  1322. X * prior permission.  Brian Totty and University of Illinois make no
  1323. X * representations about the suitability of this software for any
  1324. X * purpose.  It is provided "as is" without express or implied warranty.
  1325. X *
  1326. X * Brian Totty and University of Illinois disclaim all warranties with
  1327. X * regard to this software, including all implied warranties of
  1328. X * merchantability and fitness, in no event shall Brian Totty or
  1329. X * University of Illinois be liable for any special, indirect or
  1330. X * consequential damages or any damages whatsoever resulting from loss of
  1331. X * use, data or profits, whether in an action of contract, negligence or
  1332. X * other tortious action, arising out of or in connection with the use or
  1333. X * performance of this software.
  1334. X *
  1335. X * Author:
  1336. X *     Brian Totty
  1337. X *     Department of Computer Science
  1338. X *     University Of Illinois at Urbana-Champaign
  1339. X *    1304 West Springfield Avenue
  1340. X *     Urbana, IL 61801
  1341. X * 
  1342. X *     totty@cs.uiuc.edu
  1343. X *     
  1344. X */ 
  1345. X
  1346. #include <X11/Xlib.h>
  1347. #include <X11/Xos.h>
  1348. #include <X11/IntrinsicP.h>
  1349. #include <X11/Intrinsic.h>
  1350. #include <X11/StringDefs.h>
  1351. #include <X11/cursorfont.h>
  1352. #include <X11/CompositeP.h>
  1353. #include <X11/Composite.h>
  1354. #include <X11/Xaw/MenuButton.h>
  1355. #include <X11/Xaw/SimpleMenu.h>
  1356. #include <X11/Xaw/SmeBSB.h>
  1357. #include <X11/Xaw/Viewport.h>
  1358. #include <X11/Xaw/List.h>
  1359. X
  1360. #include <DirMgr.h>
  1361. #include <FChooserP.h>
  1362. #include <FChooser.h>
  1363. X
  1364. #if defined(SYSV) || defined(SVR4)
  1365. # ifndef __sgi
  1366. #  ifndef getwd
  1367. #   define getwd(path) getcwd(path, MAXPATHLEN)
  1368. #  endif
  1369. # endif
  1370. #endif
  1371. X
  1372. /*---------------------------------------------------------------------------*
  1373. X
  1374. X                   I N T E R N A L    R O U T I N E S
  1375. X
  1376. X *---------------------------------------------------------------------------*/
  1377. X
  1378. #if (!NeedFunctionPrototypes)
  1379. X
  1380. static void        Initialize();
  1381. static void        Realize();
  1382. static void        Destroy();
  1383. static void        Resize();
  1384. static Boolean        SetValues();
  1385. static XtGeometryResult    GeometryManager();
  1386. static void        ChildrenCreate();
  1387. static void        ChildrenRealize();
  1388. static void        ChildrenUpdate();
  1389. static void        DirectoryCallback();
  1390. static void        FileCallback();
  1391. static void        SelectFileByIndex();
  1392. static Boolean        SelectFileByName();
  1393. static void        UnselectAll();
  1394. static void        Notify();
  1395. static void        GotoDeepestLegalDirectory();
  1396. static void        UpdateLists();
  1397. static void        Chdir();
  1398. X
  1399. #else
  1400. X
  1401. static void        Initialize(Widget request, Widget new);
  1402. static void        Realize(Widget w, XtValueMask *valueMask,
  1403. X                XSetWindowAttributes *attrs);
  1404. static void        Destroy(XfwfFileChooserWidget fcw);
  1405. static void        Resize(Widget w);
  1406. static Boolean        SetValues(Widget current, Widget request, Widget new);
  1407. static XtGeometryResult    GeometryManager(Widget w,
  1408. X                XtWidgetGeometry *request,
  1409. X                XtWidgetGeometry *reply);
  1410. static void        ChildrenCreate(XfwfFileChooserWidget fcw);
  1411. static void        ChildrenRealize(XfwfFileChooserWidget fcw);
  1412. static void        ChildrenUpdate(XfwfFileChooserWidget fcw);
  1413. static void        DirectoryCallback(Widget w, XtPointer client_data,
  1414. X                XtPointer call_data);
  1415. static void        FileCallback(Widget w, XtPointer client_data,
  1416. X                XtPointer call_data);
  1417. static void        SelectFileByIndex(XfwfFileChooserWidget fcw, int index);
  1418. static Boolean        SelectFileByName(XfwfFileChooserWidget fcw, char *name);
  1419. static void        UnselectAll(XfwfFileChooserWidget fcw);
  1420. static void        Notify(XfwfFileChooserWidget fcw);
  1421. static void        GotoDeepestLegalDirectory(XfwfFileChooserWidget fcw);
  1422. static void        UpdateLists(XfwfFileChooserWidget fcw);
  1423. static void        Chdir(XfwfFileChooserWidget fcw);
  1424. X
  1425. #endif
  1426. X
  1427. /*---------------------------------------------------------------------------*
  1428. X
  1429. X              R E S O U R C E    I N I T I A L I Z A T I O N
  1430. X
  1431. X *---------------------------------------------------------------------------*/
  1432. X
  1433. #define FCFieldOffset(FIELD)    XtOffset(XfwfFileChooserWidget,fileChooser.FIELD)
  1434. #define CoreFieldOffset(FIELD)    XtOffset(Widget,core.FIELD)
  1435. X
  1436. static XtResource resources[] = {
  1437. X    { XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
  1438. X     CoreFieldOffset(width), XtRString, "500" },
  1439. X    { XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
  1440. X     CoreFieldOffset(height), XtRString, "250" },
  1441. X    { XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
  1442. X     CoreFieldOffset(background_pixel), XtRString, "white" },
  1443. X    { XtNcurrentDirectory, XtCPathname, XtRString, sizeof(String),
  1444. X     FCFieldOffset(current_dir), XtRString, NULL },
  1445. X    { XtNcurrentFile, XtCFilename, XtRString, sizeof(String),
  1446. X     FCFieldOffset(current_file), XtRString, NULL },
  1447. X    { XtNcallback, XtCCallback, XtRCallback,
  1448. X     sizeof(XtCallbackList), FCFieldOffset(callbacks), XtRCallback, NULL},
  1449. X    {XtNsortMode, XtCValue, XtRInt, sizeof(int),
  1450. X     FCFieldOffset(sort_mode), XtRString, "2"},
  1451. X    {XtNpattern, XtCFile, XtRString, sizeof(String),
  1452. X     FCFieldOffset(pattern), XtRString, NULL},
  1453. };
  1454. X
  1455. #undef FCFieldOffset
  1456. #undef CoreFieldOffset
  1457. X
  1458. /*---------------------------------------------------------------------------*
  1459. X
  1460. X                    C L A S S    A L L O C A T I O N
  1461. X
  1462. X *---------------------------------------------------------------------------*/
  1463. X
  1464. XXfwfFileChooserClassRec xfwfFileChooserClassRec = {
  1465. X    {
  1466. X    /* superclass        */    (WidgetClass)&compositeClassRec,
  1467. X    /* class_name        */    "XfwfFileChooser",
  1468. X    /* widget_size        */    sizeof(XfwfFileChooserRec),
  1469. X    /* class_initialize    */    NULL,
  1470. X    /* class_part_initialize*/    NULL,
  1471. X    /* class_inited        */    FALSE,
  1472. X    /* initialize        */    (XtInitProc)Initialize,
  1473. X    /* initialize_hook    */    NULL,
  1474. X    /* realize        */    (XtRealizeProc)Realize,
  1475. X    /* actions        */    NULL,
  1476. X    /* num_actions        */    0,
  1477. X    /* resources        */    resources,
  1478. X    /* resource_count    */    XtNumber(resources),
  1479. X    /* xrm_class        */    NULLQUARK,
  1480. X    /* compress_motion    */    TRUE,
  1481. X    /* compress_exposure    */    TRUE,
  1482. X    /* compress_enterleave    */    TRUE,
  1483. X    /* visible_interest    */    FALSE,
  1484. X    /* destroy        */    (XtWidgetProc)Destroy,
  1485. X    /* resize        */    (XtWidgetProc)Resize,
  1486. X    /* expose        */    XtInheritExpose,
  1487. X    /* set_values        */    (XtSetValuesFunc)SetValues,
  1488. X    /* set_values_hook    */    NULL,
  1489. X    /* set_values_almost    */    XtInheritSetValuesAlmost,
  1490. X    /* get_values_hook    */    NULL,
  1491. X    /* accept_focus        */    NULL,
  1492. X    /* version        */    XtVersion,
  1493. X    /* callback_private    */    NULL,
  1494. X    /* tm_table        */    NULL,
  1495. X    /* query_geometry       */    XtInheritQueryGeometry,
  1496. X    /* display_accelerator  */    XtInheritDisplayAccelerator,
  1497. X    /* extension            */    NULL
  1498. X    }, /* Core Part */
  1499. X    {
  1500. X    /* geometry_manager     */    GeometryManager,
  1501. X    /* change_managed       */    XtInheritChangeManaged,
  1502. X    /* insert_child         */    XtInheritInsertChild,
  1503. X    /* delete_child         */    XtInheritDeleteChild,
  1504. X    /* extension            */    NULL
  1505. X    }, /* Composite Part */        
  1506. X    {
  1507. X    /* no extra class data  */    0
  1508. X    }  /* FileSelector Part */
  1509. };
  1510. X
  1511. WidgetClass xfwfFileChooserWidgetClass =
  1512. X    (WidgetClass)&xfwfFileChooserClassRec;
  1513. X
  1514. /*---------------------------------------------------------------------------*
  1515. X
  1516. X                    E X P O R T E D    M E T H O D S
  1517. X
  1518. X *---------------------------------------------------------------------------*/
  1519. X
  1520. X
  1521. /*---------------------------------------------------------------------------*
  1522. X
  1523. X    Initialize()
  1524. X
  1525. X    This procedure is called by the X toolkit to initialize
  1526. X    the FileChooser widget instance.  The hook to this routine is in the
  1527. X    initialize part of the core part of the class.
  1528. X
  1529. X *---------------------------------------------------------------------------*/
  1530. X
  1531. /* ARGSUSED */
  1532. static void
  1533. Initialize(request,new)
  1534. Widget request,new;
  1535. {
  1536. X    XfwfFileChooserWidget fcw = (XfwfFileChooserWidget)new;
  1537. X    char *str,*initial_file,path[MAXPATHLEN + 2];
  1538. X    static char *star = "*";
  1539. X
  1540. X    FCBusyCursor(fcw) = XCreateFontCursor(XtDisplay(fcw),XC_watch);
  1541. X    FCDirMenu(fcw) = NULL;
  1542. X    FCDirMenuButton(fcw) = NULL;
  1543. X    FCFileList(fcw) = NULL;
  1544. X    FCDirMgr(fcw) = NULL;
  1545. X    FCFileNames(fcw) = NULL;
  1546. X    FCNumFileNames(fcw) = 0;
  1547. X    FCDirNames(fcw) = NULL;
  1548. X    FCNumDirNames(fcw) = 0;
  1549. X
  1550. X    str = (char *)XtCalloc((MAXPATHLEN + 2),sizeof(char));
  1551. X    if (FCCurrentDirectory(fcw) != NULL) {    /* User Specified Path */
  1552. X    strcpy(str,FCCurrentDirectory(fcw));
  1553. X    } else {
  1554. X    getwd(path);
  1555. X    strcpy(str,path);
  1556. X    }
  1557. X    FCCurrentDirectory(fcw) = str;
  1558. X
  1559. X    str = (char *)XtCalloc((MAXPATHLEN + 2),sizeof(char));
  1560. X    initial_file = FCCurrentFile(fcw);
  1561. X    FCCurrentFile(fcw) = str;
  1562. X
  1563. X    if (FCCorePart(request)->width <= 0)
  1564. X    FCCorePart(new)->width = 500;
  1565. X    if (FCCorePart(request)->height <= 0)
  1566. X    FCCorePart(new)->height = 200;
  1567. X
  1568. X    if (FCPattern(fcw) == NULL)
  1569. X    FCPattern(fcw) = star;
  1570. X    FCPattern(fcw) = XtNewString(FCPattern(fcw));
  1571. X
  1572. X    ChildrenCreate(fcw);
  1573. X    GotoDeepestLegalDirectory(fcw);
  1574. X    if (initial_file)
  1575. X    SelectFileByName(fcw,initial_file);
  1576. } /* End Initialize */
  1577. X
  1578. /*---------------------------------------------------------------------------*
  1579. X
  1580. X    Realize()
  1581. X
  1582. X    This function is called to realize a FileChooser widget.
  1583. X
  1584. X *---------------------------------------------------------------------------*/
  1585. X
  1586. static void Realize(w,valueMask,attrs)
  1587. Widget w;
  1588. XXtValueMask *valueMask;
  1589. XXSetWindowAttributes *attrs;
  1590. {
  1591. X    XfwfFileChooserWidget fcw = (XfwfFileChooserWidget)w;
  1592. X
  1593. X    XtCreateWindow(w,InputOutput,(Visual *)CopyFromParent,*valueMask,attrs);
  1594. X    ChildrenRealize(fcw);
  1595. X    ChildrenUpdate(fcw);
  1596. X    Resize(w);
  1597. X    Notify(fcw);
  1598. } /* End Realize */
  1599. X
  1600. /*---------------------------------------------------------------------------*
  1601. X
  1602. X    Destroy()
  1603. X
  1604. X    This function is called to destroy a FileChooser widget.
  1605. X
  1606. X *---------------------------------------------------------------------------*/
  1607. X
  1608. static void
  1609. Destroy(fcw)
  1610. SHAR_EOF
  1611. true || echo 'restore of xarchie-2.0.6/FWF/FileChooser/FChooser.c failed'
  1612. fi
  1613. echo 'End of xarchie-2.0.6 part 20'
  1614. echo 'File xarchie-2.0.6/FWF/FileChooser/FChooser.c is continued in part 21'
  1615. echo 21 > _shar_seq_.tmp
  1616. exit 0
  1617.  
  1618. exit 0 # Just in case...
  1619. -- 
  1620.   // chris@IMD.Sterling.COM       | Send comp.sources.x submissions to:
  1621. \X/  Amiga - The only way to fly! |    sources-x@imd.sterling.com
  1622.  "It's intuitively obvious to the |
  1623.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1624.