home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume19 / xmail / part08 < prev    next >
Encoding:
Text File  |  1993-04-27  |  58.2 KB  |  1,715 lines

  1. Newsgroups: comp.sources.x
  2. From: markham@cadence.com (Jeff Markham)
  3. Subject: v19i033:  xmail - X Window System interface to the mail program, Part08/10
  4. Message-ID: <1993Mar10.203020.11267@sparky.imd.sterling.com>
  5. X-Md4-Signature: 4097e66901269bb1a30e2f477b5fd442
  6. Date: Wed, 10 Mar 1993 20:30:20 GMT
  7. Approved: chris@sparky.imd.sterling.com
  8.  
  9. Submitted-by: markham@cadence.com (Jeff Markham)
  10. Posting-number: Volume 19, Issue 33
  11. Archive-name: xmail/part08
  12. Environment: X11
  13. Supersedes: xmail: Volume 15, Issue 18-26
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then feed it
  17. # into a shell via "sh file" or similar.  To overwrite existing files,
  18. # type "sh file -c".
  19. # Contents:  Makefile Makefile_R5 XMail.ad global.h handler.c
  20. # Wrapped by chris@sparky on Wed Mar 10 14:17:51 1993
  21. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  22. echo If this archive is complete, you will see the following message:
  23. echo '          "shar: End of archive 8 (of 10)."'
  24. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'Makefile'\"
  26. else
  27.   echo shar: Extracting \"'Makefile'\" \(11265 characters\)
  28.   sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  29. X# Makefile generated by imake - do not edit!
  30. X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
  31. X#
  32. X# The cpp used on this machine replaces all newlines and multiple tabs and
  33. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  34. X# for this, but is not always successful.
  35. X#
  36. X
  37. X###########################################################################
  38. X# Makefile generated from "Imake.tmpl" and <Imakefile>
  39. X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
  40. X#
  41. X# Platform-specific parameters may be set in the appropriate .cf
  42. X# configuration files.  Site-wide parameters may be set in the file
  43. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  44. X#
  45. X# If your C preprocessor doesn't define any unique symbols, you'll need
  46. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  47. X# "make Makefile", "make Makefiles", or "make World").
  48. X#
  49. X# If you absolutely can't get imake to work, you'll need to set the
  50. X# variables at the top of each Makefile as well as the dependencies at the
  51. X# bottom (makedepend will do this automatically).
  52. X#
  53. X
  54. X###########################################################################
  55. X# platform-specific configuration parameters - edit sun.cf to change
  56. X
  57. X# platform:  $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
  58. X# operating system:  SunOS 4.1.1
  59. X
  60. X###########################################################################
  61. X# site-specific configuration parameters - edit site.def to change
  62. X
  63. X# site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
  64. X
  65. X            SHELL = /bin/sh
  66. X
  67. X              TOP = .
  68. X      CURRENT_DIR = .
  69. X
  70. X               AR = ar cq
  71. X  BOOTSTRAPCFLAGS =
  72. X               CC = cc
  73. X
  74. X         COMPRESS = compress
  75. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  76. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  77. X          INSTALL = install
  78. X               LD = ld
  79. X             LINT = lint
  80. X      LINTLIBFLAG = -C
  81. X         LINTOPTS = -axz
  82. X               LN = ln -s
  83. X             MAKE = make
  84. X               MV = mv
  85. X               CP = cp
  86. X           RANLIB = ranlib
  87. X  RANLIBINSTFLAGS =
  88. X               RM = rm -f
  89. X     STD_INCLUDES =
  90. X  STD_CPP_DEFINES =
  91. X      STD_DEFINES =
  92. X EXTRA_LOAD_FLAGS =
  93. X  EXTRA_LIBRARIES =
  94. X             TAGS = ctags
  95. X
  96. X    SHAREDCODEDEF = -DSHAREDCODE
  97. X         SHLIBDEF = -DSUNSHLIB
  98. X
  99. X    PROTO_DEFINES =
  100. X
  101. X     INSTPGMFLAGS =
  102. X
  103. X     INSTBINFLAGS = -m 0755
  104. X     INSTUIDFLAGS = -m 4755
  105. X     INSTLIBFLAGS = -m 0664
  106. X     INSTINCFLAGS = -m 0444
  107. X     INSTMANFLAGS = -m 0444
  108. X     INSTDATFLAGS = -m 0444
  109. X    INSTKMEMFLAGS = -m 4755
  110. X
  111. X          DESTDIR =
  112. X
  113. X     TOP_INCLUDES = -I$(INCROOT)
  114. X
  115. X      CDEBUGFLAGS = -O
  116. X        CCOPTIONS = -pipe
  117. X      COMPATFLAGS =
  118. X
  119. X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
  120. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
  121. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  122. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  123. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  124. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
  125. X   LDCOMBINEFLAGS = -X -r
  126. X
  127. X        MACROFILE = sun.cf
  128. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  129. X
  130. X    IMAKE_DEFINES =
  131. X
  132. X         IRULESRC = $(CONFIGDIR)
  133. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  134. X
  135. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  136. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  137. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  138. X
  139. X###########################################################################
  140. X# X Window System Build Parameters
  141. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  142. X
  143. X###########################################################################
  144. X# X Window System make variables; this need to be coordinated with rules
  145. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  146. X
  147. X          PATHSEP = /
  148. X        USRLIBDIR = $(DESTDIR)/usr/lib
  149. X           BINDIR = $(DESTDIR)/usr/bin/X11
  150. X          INCROOT = $(DESTDIR)/usr/include
  151. X     BUILDINCROOT = $(TOP)
  152. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  153. X      BUILDINCTOP = ..
  154. X           INCDIR = $(INCROOT)/X11
  155. X           ADMDIR = $(DESTDIR)/usr/adm
  156. X           LIBDIR = $(USRLIBDIR)/X11
  157. X        CONFIGDIR = $(LIBDIR)/config
  158. X       LINTLIBDIR = $(USRLIBDIR)/lint
  159. X
  160. X          FONTDIR = $(LIBDIR)/fonts
  161. X         XINITDIR = $(LIBDIR)/xinit
  162. X           XDMDIR = $(LIBDIR)/xdm
  163. X           AWMDIR = $(LIBDIR)/awm
  164. X           TWMDIR = $(LIBDIR)/twm
  165. X           GWMDIR = $(LIBDIR)/gwm
  166. X          MANPATH = $(DESTDIR)/usr/man
  167. X    MANSOURCEPATH = $(MANPATH)/man
  168. X           MANDIR = $(MANSOURCEPATH)1
  169. X        LIBMANDIR = $(MANSOURCEPATH)3
  170. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  171. X
  172. X        SOXLIBREV = 4.2
  173. X          SOXTREV = 4.0
  174. X         SOXAWREV = 4.0
  175. X        SOOLDXREV = 4.0
  176. X         SOXMUREV = 4.0
  177. X        SOXEXTREV = 4.0
  178. X
  179. X       FONTCFLAGS = -t
  180. X
  181. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  182. X
  183. X            IMAKE = imake
  184. X           DEPEND = makedepend
  185. X              RGB = rgb
  186. X            FONTC = bdftosnf
  187. X        MKFONTDIR = mkfontdir
  188. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
  189. X
  190. X        CONFIGSRC = $(TOP)/config
  191. X        CLIENTSRC = $(TOP)/clients
  192. X          DEMOSRC = $(TOP)/demos
  193. X           LIBSRC = $(TOP)/lib
  194. X          FONTSRC = $(TOP)/fonts
  195. X       INCLUDESRC = $(TOP)/X11
  196. X        SERVERSRC = $(TOP)/server
  197. X          UTILSRC = $(TOP)/util
  198. X        SCRIPTSRC = $(UTILSRC)/scripts
  199. X       EXAMPLESRC = $(TOP)/examples
  200. X       CONTRIBSRC = $(TOP)/../contrib
  201. X           DOCSRC = $(TOP)/doc
  202. X           RGBSRC = $(TOP)/rgb
  203. X        DEPENDSRC = $(UTILSRC)/makedepend
  204. X         IMAKESRC = $(CONFIGSRC)
  205. X         XAUTHSRC = $(LIBSRC)/Xau
  206. X          XLIBSRC = $(LIBSRC)/X
  207. X           XMUSRC = $(LIBSRC)/Xmu
  208. X       TOOLKITSRC = $(LIBSRC)/Xt
  209. X       AWIDGETSRC = $(LIBSRC)/Xaw
  210. X       OLDXLIBSRC = $(LIBSRC)/oldX
  211. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  212. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  213. X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  214. X     EXTENSIONSRC = $(TOP)/extensions
  215. X
  216. X  DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
  217. X     EXTENSIONLIB =  -lXext
  218. X
  219. X          DEPXLIB = $(DEPEXTENSIONLIB)
  220. X             XLIB = $(EXTENSIONLIB) -lX11
  221. X
  222. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  223. X         XAUTHLIB =  -lXau
  224. X
  225. X        DEPXMULIB =
  226. X           XMULIB = -lXmu
  227. X
  228. X       DEPOLDXLIB =
  229. X          OLDXLIB = -loldX
  230. X
  231. X      DEPXTOOLLIB =
  232. X         XTOOLLIB = -lXt
  233. X
  234. X        DEPXAWLIB =
  235. X           XAWLIB = -lXaw
  236. X
  237. X      DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
  238. X         XDMCPLIB =  -lXdmcp
  239. X
  240. X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
  241. X         LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
  242. X          LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
  243. X        LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
  244. X          LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
  245. X
  246. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  247. X
  248. X         DEPLIBS1 = $(DEPLIBS)
  249. X         DEPLIBS2 = $(DEPLIBS)
  250. X         DEPLIBS3 = $(DEPLIBS)
  251. X
  252. X###########################################################################
  253. X# Imake rules for building libraries, programs, scripts, and data files
  254. X# rules:  $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
  255. X
  256. X###########################################################################
  257. X# start of Imakefile
  258. X
  259. X#
  260. X# @(#)Imakefile - for xmail version 1 patchlevel 5
  261. X#
  262. X# Uncomment USE_DIRENT if readdir() uses <dirent.h> instead of <sys/dir.h>
  263. X#
  264. X     USE_DIRENT = -DUSE_DIRENT
  265. X#
  266. X# Uncomment X_FACE and COMPFACE if you have the compface library installed
  267. X# and you want xmail to automatically display the X-Face: header, if found
  268. X# in a message.
  269. X#
  270. X#         X_FACE = -DX_FACE
  271. X#       COMPFACE = -lcompface
  272. X#
  273. X# Uncomment XPM if you have the Xpm version 3 library and want color icons
  274. X#
  275. X#            XPM = -DXPM
  276. X#         LIBXPM = -lXpm
  277. X#
  278. X# Uncomment LPT if you require att environment support for pseudo ports.
  279. X#
  280. X#            LPT = -lpt
  281. X#
  282. X# Uncomment REGEXP if your system supplies the regexp.h include file.
  283. X# Otherwise, xmail will use the regex procedures re_comp and re_exec.
  284. X#
  285. X#   REGEXP = -DUSE_REGEXP
  286. X#
  287. X# Define MAILBOX_DIRECTORY if your mail spool is located in other than the
  288. X# default /usr/spool/mail.  (If not specified, the default will be used.)
  289. X#
  290. X#    MAILBOX_DIR = -DMAILBOX_DIRECTORY=\"/usr/spool/mail\"
  291. X#
  292. X# Define DEFAULT_VISUAL if your copy of vi lies in some place other than
  293. X# /usr/ucb.  (If not specified, /usr/ucb/vi will be the default editor.)
  294. X#
  295. X#     DEF_VISUAL = -DDEFAULT_VISUAL=\"/usr/ucb/vi\"
  296. X#
  297. X# Define DEFAULT_MAILER if your mail program is not the standard
  298. X# /usr/ucb/Mail.  CAUTION - Operation is NOT guaranteed with other mailers.
  299. X#
  300. X#     DEF_MAILER = -DDEFAULT_MAILER=\"/usr/ucb/Mail\"
  301. X#
  302. X# Define SIGACTION if your system utilizes the sigaction() call rather
  303. X# than the sigvec() call (true on most SYSV and POSIX compilant systems)
  304. X# You may also need to add the following BSD define (true on SGI systems)
  305. X#
  306. X#         SIGDEF = -D_BSD_SIGNALS
  307. X#
  308. X#         SIGACT = -DSIGACTION
  309. X#
  310. X
  311. X  XMAIL_DEFINES = $(MAILBOX_DIR) $(DEF_VISUAL) $(DEF_MAILER) $(SIGACT) $(SIGDEF)
  312. X        DEFINES = $(USE_DIRENT) $(X_FACE) $(XPM) $(REGEXP) $(XMAIL_DEFINES)
  313. X
  314. X        DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  315. XLOCAL_LIBRARIES = $(LIBXPM) $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) $(COMPFACE) $(LPT)
  316. X
  317. X           SRCS = Mailwatch.c HelpText.c actions.c callMail.c callbacks.c \
  318. X          confirm.c directory.c environs.c handler.c mail.c parser.c \
  319. X          utils.c windows.c xmail.c
  320. X
  321. X           OBJS = Mailwatch.o HelpText.o actions.o callMail.o callbacks.o \
  322. X          confirm.o directory.o environs.o handler.o mail.o parser.o \
  323. X          utils.o windows.o xmail.o
  324. X
  325. X PROGRAM = xmail
  326. X
  327. Xall:: xmail
  328. X
  329. Xxmail: $(OBJS) $(DEPLIBS)
  330. X    $(RM) $@
  331. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  332. X
  333. Xsaber_xmail:
  334. X    #load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  335. X
  336. Xosaber_xmail:
  337. X    #load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  338. X
  339. Xinstall:: xmail
  340. X    $(INSTALL) -c $(INSTPGMFLAGS)   xmail $(BINDIR)
  341. X
  342. Xinstall.man:: xmail.man
  343. X    $(INSTALL) -c $(INSTMANFLAGS) xmail.man $(MANDIR)/xmail.1
  344. X
  345. Xdepend::
  346. X    $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  347. X
  348. Xlint:
  349. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  350. Xlint1:
  351. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  352. X
  353. Xclean::
  354. X    $(RM) $(PROGRAM)
  355. X
  356. Xinstall:: XMail.ad
  357. X    $(INSTALL) -c $(INSTAPPFLAGS) XMail.ad $(XAPPLOADDIR)/XMail
  358. X
  359. X###########################################################################
  360. X# common rules for all Makefiles - do not edit
  361. X
  362. Xemptyrule::
  363. X
  364. Xclean::
  365. X    $(RM_CMD) \#*
  366. X
  367. XMakefile::
  368. X    -@if [ -f Makefile ]; then \
  369. X    echo "    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  370. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  371. X    else exit 0; fi
  372. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  373. X
  374. Xtags::
  375. X    $(TAGS) -w *.[ch]
  376. X    $(TAGS) -xw *.[ch] > TAGS
  377. X
  378. Xsaber:
  379. X    #load $(ALLDEFINES) $(SRCS)
  380. X
  381. Xosaber:
  382. X    #load $(ALLDEFINES) $(OBJS)
  383. X
  384. X###########################################################################
  385. X# empty rules for directories that do not have SUBDIRS - do not edit
  386. X
  387. Xinstall::
  388. X    @echo "install in $(CURRENT_DIR) done"
  389. X
  390. Xinstall.man::
  391. X    @echo "install.man in $(CURRENT_DIR) done"
  392. X
  393. XMakefiles::
  394. X
  395. Xincludes::
  396. X
  397. X###########################################################################
  398. X# dependencies generated by makedepend
  399. X
  400. END_OF_FILE
  401.   if test 11265 -ne `wc -c <'Makefile'`; then
  402.     echo shar: \"'Makefile'\" unpacked with wrong size!
  403.   fi
  404.   # end of 'Makefile'
  405. fi
  406. if test -f 'Makefile_R5' -a "${1}" != "-c" ; then 
  407.   echo shar: Will not clobber existing file \"'Makefile_R5'\"
  408. else
  409.   echo shar: Extracting \"'Makefile_R5'\" \(11594 characters\)
  410.   sed "s/^X//" >'Makefile_R5' <<'END_OF_FILE'
  411. X# Makefile generated by imake - do not edit!
  412. X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
  413. X#
  414. X# The cpp used on this machine replaces all newlines and multiple tabs and
  415. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  416. X# for this, but is not always successful.
  417. X#
  418. X
  419. X###########################################################################
  420. X# Makefile generated from "Imake.tmpl" and <Imakefile>
  421. X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
  422. X#
  423. X# Platform-specific parameters may be set in the appropriate .cf
  424. X# configuration files.  Site-wide parameters may be set in the file
  425. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  426. X#
  427. X# If your C preprocessor doesn't define any unique symbols, you'll need
  428. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  429. X# "make Makefile", "make Makefiles", or "make World").
  430. X#
  431. X# If you absolutely can't get imake to work, you'll need to set the
  432. X# variables at the top of each Makefile as well as the dependencies at the
  433. X# bottom (makedepend will do this automatically).
  434. X#
  435. X
  436. X###########################################################################
  437. X# platform-specific configuration parameters - edit sun.cf to change
  438. X
  439. X# platform:  $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
  440. X# operating system:  SunOS 4.0.3
  441. X
  442. X###########################################################################
  443. X# site-specific configuration parameters - edit site.def to change
  444. X
  445. X# site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
  446. X
  447. X            SHELL = /bin/sh
  448. X
  449. X              TOP = .
  450. X      CURRENT_DIR = .
  451. X
  452. X               AR = ar cq
  453. X  BOOTSTRAPCFLAGS =
  454. X               CC = cc
  455. X
  456. X         COMPRESS = compress
  457. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  458. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  459. X          INSTALL = install
  460. X               LD = ld
  461. X             LINT = lint
  462. X      LINTLIBFLAG = -C
  463. X         LINTOPTS = -axz
  464. X               LN = ln -s
  465. X             MAKE = make
  466. X               MV = mv
  467. X               CP = cp
  468. X           RANLIB = ranlib
  469. X  RANLIBINSTFLAGS =
  470. X               RM = rm -f
  471. X     STD_INCLUDES =
  472. X  STD_CPP_DEFINES =
  473. X      STD_DEFINES =
  474. X EXTRA_LOAD_FLAGS =
  475. X  EXTRA_LIBRARIES =
  476. X             TAGS = ctags
  477. X
  478. X    SHAREDCODEDEF = -DSHAREDCODE
  479. X         SHLIBDEF = -DSUNSHLIB
  480. X
  481. X    PROTO_DEFINES =
  482. X
  483. X     INSTPGMFLAGS = -s -m 0755
  484. X
  485. X     INSTBINFLAGS = -m 0755
  486. X     INSTUIDFLAGS = -m 4755
  487. X     INSTLIBFLAGS = -m 0664
  488. X     INSTINCFLAGS = -m 0444
  489. X     INSTMANFLAGS = -m 0444
  490. X     INSTDATFLAGS = -m 0444
  491. X    INSTKMEMFLAGS = -m 4755
  492. X
  493. X          DESTDIR =
  494. X
  495. X     TOP_INCLUDES = -I$(INCROOT)
  496. X
  497. X      CDEBUGFLAGS = -O
  498. X        CCOPTIONS =
  499. X      COMPATFLAGS =
  500. X
  501. X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
  502. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
  503. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  504. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  505. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  506. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
  507. X   LDCOMBINEFLAGS = -X -r
  508. X
  509. X        MACROFILE = sun.cf
  510. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  511. X
  512. X    IMAKE_DEFINES =
  513. X
  514. X         IRULESRC = $(CONFIGDIR)
  515. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  516. X
  517. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  518. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  519. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  520. X
  521. X###########################################################################
  522. X# X Window System Build Parameters
  523. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  524. X
  525. X###########################################################################
  526. X# X Window System make variables; this need to be coordinated with rules
  527. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  528. X
  529. X          PATHSEP = /
  530. X        USRLIBDIR = $(DESTDIR)/usr/lib
  531. X           BINDIR = $(DESTDIR)/usr/bin/X11
  532. X          INCROOT = $(DESTDIR)/usr/include
  533. X     BUILDINCROOT = $(TOP)
  534. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  535. X      BUILDINCTOP = ..
  536. X           INCDIR = $(INCROOT)/X11
  537. X           ADMDIR = $(DESTDIR)/usr/adm
  538. X           LIBDIR = $(USRLIBDIR)/X11
  539. X        CONFIGDIR = $(LIBDIR)/config
  540. X       LINTLIBDIR = $(USRLIBDIR)/lint
  541. X
  542. X          FONTDIR = $(LIBDIR)/fonts
  543. X         XINITDIR = $(LIBDIR)/xinit
  544. X           XDMDIR = $(LIBDIR)/xdm
  545. X           AWMDIR = $(LIBDIR)/awm
  546. X           TWMDIR = $(LIBDIR)/twm
  547. X           GWMDIR = $(LIBDIR)/gwm
  548. X          MANPATH = $(DESTDIR)/usr/man
  549. X    MANSOURCEPATH = $(MANPATH)/man
  550. X           MANDIR = $(MANSOURCEPATH)n
  551. X        LIBMANDIR = $(MANSOURCEPATH)3
  552. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  553. X
  554. X        SOXLIBREV = 4.2
  555. X          SOXTREV = 4.0
  556. X         SOXAWREV = 4.0
  557. X        SOOLDXREV = 4.0
  558. X         SOXMUREV = 4.0
  559. X        SOXEXTREV = 4.0
  560. X
  561. X       FONTCFLAGS = -t
  562. X
  563. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  564. X
  565. X            IMAKE = imake
  566. X           DEPEND = makedepend
  567. X              RGB = rgb
  568. X            FONTC = bdftosnf
  569. X        MKFONTDIR = mkfontdir
  570. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
  571. X
  572. X        CONFIGSRC = $(TOP)/config
  573. X        CLIENTSRC = $(TOP)/clients
  574. X          DEMOSRC = $(TOP)/demos
  575. X           LIBSRC = $(TOP)/lib
  576. X          FONTSRC = $(TOP)/fonts
  577. X       INCLUDESRC = $(TOP)/X11
  578. X        SERVERSRC = $(TOP)/server
  579. X          UTILSRC = $(TOP)/util
  580. X        SCRIPTSRC = $(UTILSRC)/scripts
  581. X       EXAMPLESRC = $(TOP)/examples
  582. X       CONTRIBSRC = $(TOP)/../contrib
  583. X           DOCSRC = $(TOP)/doc
  584. X           RGBSRC = $(TOP)/rgb
  585. X        DEPENDSRC = $(UTILSRC)/makedepend
  586. X         IMAKESRC = $(CONFIGSRC)
  587. X         XAUTHSRC = $(LIBSRC)/Xau
  588. X          XLIBSRC = $(LIBSRC)/X
  589. X           XMUSRC = $(LIBSRC)/Xmu
  590. X       TOOLKITSRC = $(LIBSRC)/Xt
  591. X       AWIDGETSRC = $(LIBSRC)/Xaw
  592. X       OLDXLIBSRC = $(LIBSRC)/oldX
  593. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  594. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  595. X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  596. X     EXTENSIONSRC = $(TOP)/extensions
  597. X
  598. X  DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
  599. X     EXTENSIONLIB =  -lXext
  600. X
  601. X          DEPXLIB = $(DEPEXTENSIONLIB)
  602. X             XLIB = $(EXTENSIONLIB) -lX11
  603. X
  604. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  605. X         XAUTHLIB =  -lXau
  606. X
  607. X        DEPXMULIB =
  608. X           XMULIB = -lXmu
  609. X
  610. X       DEPOLDXLIB =
  611. X          OLDXLIB = -loldX
  612. X
  613. X      DEPXTOOLLIB =
  614. X         XTOOLLIB = -lXt
  615. X
  616. X        DEPXAWLIB =
  617. X           XAWLIB = -lXaw
  618. X
  619. X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
  620. X         LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
  621. X          LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
  622. X        LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
  623. X          LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
  624. X
  625. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  626. X
  627. X         DEPLIBS1 = $(DEPLIBS)
  628. X         DEPLIBS2 = $(DEPLIBS)
  629. X         DEPLIBS3 = $(DEPLIBS)
  630. X
  631. X      USRINCDIR = $(DESTDIR)/usr/include
  632. X        TESTSRC = $(TOP)/tests
  633. X    MTOOLKITSRC = $(LIBSRC)/Xt
  634. X     MWIDGETSRC = $(LIBSRC)/Xm
  635. X   MRESOURCESRC = $(LIBSRC)/Mrm
  636. X         UILSRC = $(CLIENTSRC)/uil
  637. X            UIL = $(UILSRC)/uil
  638. X      XMTOOLLIB = $(MTOOLKITSRC)/libXt.a
  639. X          XMLIB = $(MWIDGETSRC)/libXm.a
  640. X   MRESOURCELIB = $(MRESOURCESRC)/libMrm.a
  641. X         UILLIB = $(UILSRC)/libUil.a
  642. X  LINTMRESOURCE = $(MRESOURCESRC)/libMrm.a
  643. XLINTXMWIDGETLIB = $(MWIDGETSRC)/llib-l/Xm.ln
  644. X     LINTXMTOOL = $(MTOOLKITSRC)/llib-lXt.ln
  645. X     LINTUILLIB = $(UILSRC)/llib-lUil.ln
  646. X        SYSLIBS = -lXt -lX11
  647. X    MWM_DEFINES = -DSHAPE -DOPAQUE -DSTRINGS_ALIGNED -D_NO_PROTO -DNO_REGEX
  648. X
  649. X###########################################################################
  650. X# Imake rules for building libraries, programs, scripts, and data files
  651. X# rules:  $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
  652. X
  653. X###########################################################################
  654. X# start of Imakefile
  655. X
  656. X#
  657. X# @(#)Imakefile - for xmail version 1 patchlevel 5
  658. X#
  659. X# Uncomment USE_DIRENT if readdir() uses <dirent.h> instead of <sys/dir.h>
  660. X#
  661. X     USE_DIRENT = -DUSE_DIRENT
  662. X#
  663. X# Uncomment X_FACE and COMPFACE if you have the compface library installed
  664. X# and you want xmail to automatically display the X-Face: header, if found
  665. X# in a message.
  666. X#
  667. X         X_FACE = -DX_FACE
  668. X       COMPFACE = -lcompface
  669. X#
  670. X# Uncomment XPM if you have the Xpm version 3 library and want color icons
  671. X#
  672. X            XPM = -DXPM
  673. X         LIBXPM = -lXpm
  674. X#
  675. X# Uncomment LPT if you require att environment support for pseudo ports.
  676. X#
  677. X#            LPT = -lpt
  678. X#
  679. X# Uncomment REGEXP if your system supplies the regexp.h include file.
  680. X# Otherwise, xmail will use the regex procedures re_comp and re_exec.
  681. X#
  682. X#   REGEXP = -DUSE_REGEXP
  683. X#
  684. X# Define MAILBOX_DIRECTORY if your mail spool is located in other than the
  685. X# default /usr/spool/mail.  (If not specified, the default will be used.)
  686. X#
  687. X#    MAILBOX_DIR = -DMAILBOX_DIRECTORY=\"/usr/spool/mail\"
  688. X#
  689. X# Define DEFAULT_VISUAL if your copy of vi lies in some place other than
  690. X# /usr/ucb.  (If not specified, /usr/ucb/vi will be the default editor.)
  691. X#
  692. X#     DEF_VISUAL = -DDEFAULT_VISUAL=\"/usr/ucb/vi\"
  693. X#
  694. X# Define DEFAULT_MAILER if your mail program is not the standard
  695. X# /usr/ucb/Mail.  CAUTION - Operation is NOT guaranteed with other mailers.
  696. X#
  697. X#     DEF_MAILER = -DDEFAULT_MAILER=\"/usr/ucb/Mail\"
  698. X#
  699. X# Define SIGACTION if your system utilizes the sigaction() call rather
  700. X# than the sigvec() call (true on most SYSV and POSIX compilant systems)
  701. X# You may also need to add the following BSD define (true on SGI systems)
  702. X#
  703. X#         SIGDEF = -D_BSD_SIGNALS
  704. X#
  705. X#         SIGACT = -DSIGACTION
  706. X#
  707. X
  708. X  XMAIL_DEFINES = $(MAILBOX_DIR) $(DEF_VISUAL) $(DEF_MAILER) $(SIGACT) $(SIGDEF)
  709. X        DEFINES = $(USE_DIRENT) $(X_FACE) $(XPM) $(REGEXP) $(XMAIL_DEFINES)
  710. X
  711. X        DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  712. XLOCAL_LIBRARIES = $(LIBXPM) $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) $(COMPFACE) $(LPT)
  713. X
  714. X           SRCS = Mailwatch.c HelpText.c actions.c callMail.c callbacks.c \
  715. X          confirm.c directory.c environs.c handler.c mail.c parser.c \
  716. X          utils.c windows.c xmail.c
  717. X
  718. X           OBJS = Mailwatch.o HelpText.o actions.o callMail.o callbacks.o \
  719. X          confirm.o directory.o environs.o handler.o mail.o parser.o \
  720. X          utils.o windows.o xmail.o
  721. X
  722. X PROGRAM = xmail
  723. X
  724. Xall:: xmail
  725. X
  726. Xxmail: $(OBJS) $(DEPLIBS)
  727. X    $(RM) $@
  728. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  729. X
  730. Xinstall:: xmail
  731. X    $(INSTALL) -c $(INSTPGMFLAGS)   xmail $(BINDIR)
  732. X
  733. Xinstall.man:: xmail.man
  734. X    $(INSTALL) -c $(INSTMANFLAGS) xmail.man $(MANDIR)/xmail.n
  735. X
  736. Xdepend::
  737. X    $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  738. X
  739. Xlint:
  740. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  741. Xlint1:
  742. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  743. X
  744. Xclean::
  745. X    $(RM) $(PROGRAM)
  746. X
  747. Xinstall:: XMail.ad
  748. X    $(INSTALL) -c $(INSTAPPFLAGS) XMail.ad $(XAPPLOADDIR)/XMail
  749. X
  750. X###########################################################################
  751. X# common rules for all Makefiles - do not edit
  752. X
  753. Xemptyrule::
  754. X
  755. Xclean::
  756. X    $(RM_CMD) \#*
  757. X
  758. XMakefile::
  759. X    -@if [ -f Makefile ]; then \
  760. X    echo "    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  761. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  762. X    else exit 0; fi
  763. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  764. X
  765. Xtags::
  766. X    $(TAGS) -w *.[ch]
  767. X    $(TAGS) -xw *.[ch] > TAGS
  768. X
  769. X###########################################################################
  770. X# empty rules for directories that do not have SUBDIRS - do not edit
  771. X
  772. Xinstall::
  773. X    @echo "install in $(CURRENT_DIR) done"
  774. X
  775. Xinstall.man::
  776. X    @echo "install.man in $(CURRENT_DIR) done"
  777. X
  778. XMakefiles::
  779. X
  780. Xincludes::
  781. X
  782. X###########################################################################
  783. X# dependencies generated by makedepend
  784. X
  785. END_OF_FILE
  786.   if test 11594 -ne `wc -c <'Makefile_R5'`; then
  787.     echo shar: \"'Makefile_R5'\" unpacked with wrong size!
  788.   fi
  789.   # end of 'Makefile_R5'
  790. fi
  791. if test -f 'XMail.ad' -a "${1}" != "-c" ; then 
  792.   echo shar: Will not clobber existing file \"'XMail.ad'\"
  793. else
  794.   echo shar: Extracting \"'XMail.ad'\" \(10253 characters\)
  795.   sed "s/^X//" >'XMail.ad' <<'END_OF_FILE'
  796. X! XMail resource default definitions for xmail version 1.5
  797. X!
  798. X! DO NOT use the wildcard (*) entry on the geometry specification, or it
  799. X! will force all popups to initially anchor with those same coordinates.
  800. X!
  801. X! The color suggestions in this resource file are commented out by default, in
  802. X! deference to sites who's monochrome displays do not find them complimentary.
  803. X! The colors were original chosen for compatability, their complimentary
  804. X! nature in relation to the actions of buttons they are assigned to, and also
  805. X! to provide adequate support if the application is run on a monochrome display
  806. X! with these color definitions uncommented.  They do work, at least on a Sun.
  807. X! You may uncomment, and/or alter these choices to suit your own preferences.
  808. X!
  809. X! The color choices utilized in this application defaults file are:
  810. X!
  811. X! ff0000 - red        ffff00 - yellow        0000ff - blue
  812. X! 00ff00 - green    00ffff - cyan        00cd00 - green3
  813. X! ffffff - white    000000 - black        afeeee - paleturquoise
  814. X! 2e8b57 - seagreen    a52a2a - brown        eedd82 - lightgoldenrod
  815. X! d2b48c - tan        daa520 - goldenrod    7fff00 - chartreuse
  816. X! f0e68c - khaki    ffe4e1 - mistyrose    fffacd - lemonchiffon
  817. X!
  818. X! *expert:                True
  819. X! .geometry:                +65+3
  820. X! *iconGeometry:            +835+0
  821. X! *shapeStyle:                oval
  822. X!
  823. X! *Abort.background:            white
  824. X! *Abort.foreground:            red
  825. X*Abort.translations:            #override <Btn2Down>:    ShowHelp()
  826. X! *Autograph.background:            cyan
  827. X*Autograph.translations:        #override <Btn2Down>:    ShowHelp()
  828. X! *autograph.background:            paleturquoise
  829. X*autograph.translations:        #override <Btn2Down>:    ShowHelp()
  830. X! *aliasList*Background:            tan
  831. X! *aliasList.table.entry.background:    cyan
  832. X! *alwaysignore*foreground:        seagreen
  833. X! *noalwaysignore*foreground:        red
  834. X! *autoprint*foreground:            seagreen
  835. X! *noautoprint*foreground:        red
  836. X! *background:                yellow
  837. X! *borderColor:                brown
  838. X! *Bcc.background:            cyan
  839. X! *Bcc*AsciiSink*Background:        cyan
  840. X*Bcc*scrollHorizontal:            whenNeeded
  841. X*Bcc*Thickness:                5
  842. X*Bcc*MinimumThumb:            3
  843. X! *Cancel.background:            mistyrose
  844. X! *Cancel.foreground:            black
  845. X*Cancel.translations:            #override <Btn2Down>:    ShowHelp()
  846. X! *Cc.background:                cyan
  847. X! *Cc*AsciiSink*Background:        cyan
  848. X*Cc*scrollHorizontal:            whenNeeded
  849. X*Cc*Thickness:                5
  850. X*Cc*MinimumThumb:            3
  851. X! *Copy.foreground:            blue
  852. X! *commandPanel.background:        goldenrod
  853. X! *copy.background:            cyan
  854. X! *Deliver.background:            green
  855. X! *Deliver.foreground:            brown
  856. X! *Deliver.borderColor:            brown
  857. X*Deliver.translations:            #override <Btn2Down>:    ShowHelp()
  858. X! *delete.foreground:            red
  859. X! *delete.background:            white
  860. X! *Drop.foreground:            red
  861. X! *editheaders*foreground:        seagreen
  862. X! *noeditheaders*foreground:        red
  863. X! *editorCommand:  xterm -name XMail -title "Message Edit" -display %s -e vi %s
  864. X! *exit.foreground:            blue
  865. X! *expert*foreground:            seagreen
  866. X! *noexpert*foreground:            red
  867. X! *Folder.background:            cyan
  868. X! *Font:                    *-courier-bold-r-normal--14-*
  869. X! *fileWindow*background:            chartreuse
  870. X*fileWindow*scrollHorizontal:        whenNeeded
  871. X*fileWindow*Thickness:            5
  872. X*fileWindow*MinimumThumb:        3
  873. X! *foreground:                brown
  874. X! *forward.foreground:            green3
  875. X! *full.foreground:            red
  876. X*grip*foreground:            brown
  877. X! *hold*foreground:            seagreen
  878. X! *nohold*foreground:            red
  879. X! *icon*background:            lightgoldenrod
  880. X! *icon*foreground:            brown
  881. X! *inc.background:            cyan
  882. X! *indexWindow*background:        lemonchiffon
  883. X*indexWindow*scrollHorizontal:        whenNeeded
  884. X*indexWindow*Thickness:            10
  885. X*indexWindow*MinimumThumb:        5
  886. X! *list.background:            tan
  887. X! *menu.background:            tan
  888. X! *menubutton.foreground:            brown
  889. X! *menubutton.background:            cyan
  890. X! *Newmail.foreground:            blue
  891. X! *previous.foreground:            blue
  892. X! *quit.foreground:            red
  893. X! *quit.background:            white
  894. X! *read.foreground:            green3
  895. X! *ReEdit.background:            khaki
  896. X! *ReEdit.foreground:            brown
  897. X*ReEdit.translations:            #override <Btn2Down>:    ShowHelp()
  898. X! *replyall.background:            green
  899. X! *save.background:            cyan
  900. X! *Save.foreground:            blue
  901. X! *set_menu.background:            tan
  902. X*statusWindow.background:        brown
  903. X*statusWindow.foreground:        yellow
  904. X! *Subject.background:            cyan
  905. X! *Subject*AsciiSink*Background:        cyan
  906. X*Subject*scrollHorizontal:        whenNeeded
  907. X*Subject*Thickness:            5
  908. X*Subject*MinimumThumb:            3
  909. X! *textWindow*background:            lemonchiffon
  910. X*textWindow.text*Wrap:            word
  911. X! *textWindow.face.background:        white
  912. X*textWindow*Thickness:            10
  913. X*textWindow*MinimumThumb:        5
  914. X*titleBar*Background:            brown
  915. X*titleBar*Foreground:            yellow
  916. X*titleBar.logo.background:        white
  917. X*titleBar.logo.foreground:        blue
  918. X! *To.Background:                cyan
  919. X! *To*AsciiSink*Background:        cyan
  920. X*To*scrollHorizontal:            whenNeeded
  921. X*To*Thickness:                5
  922. X*To*MinimumThumb:            3
  923. X! *undelete.foreground:            green3
  924. X! *write.foreground:            green3
  925. X! *Write.foreground:            red
  926. X!
  927. X*Bcc.translations:    #override \n\
  928. X       <Key>Delete:    delete-previous-character() \n\
  929. X       <Key>BackSpace:    delete-previous-character() \n\
  930. X  Meta <Key>A:        DoDone(Cancel) \n\
  931. X  Meta <Key>C:        DoDone(cancel) \n\
  932. X  Meta <Key>D:        DoDone(Deliver) \n\
  933. X  Ctrl <Key>H:        delete-previous-character() \n\
  934. X  Meta <Key>R:        DoDone(ReEdit) \n\
  935. X  Meta <Key>S:        DoDone(Autograph) \n\
  936. X  Ctrl <Key>U:        beginning-of-line() kill-to-end-of-line() \n\
  937. X  Ctrl <Key>W:        delete-previous-word() \n\
  938. X  Meta <Key>X:        DoDone(autograph) \n\
  939. X       <Btn3Down>:    SetAliases() \n\
  940. X       <Key>Return:    NextField()
  941. X!
  942. X*Cc.translations:    #override \n\
  943. X       <Key>Delete:    delete-previous-character() \n\
  944. X       <Key>BackSpace:    delete-previous-character() \n\
  945. X  Meta <Key>A:        DoDone(Cancel) \n\
  946. X  Meta <Key>C:        DoDone(cancel) \n\
  947. X  Meta <Key>D:        DoDone(Deliver) \n\
  948. X  Ctrl <Key>H:        delete-previous-character() \n\
  949. X  Meta <Key>R:        DoDone(ReEdit) \n\
  950. X  Meta <Key>S:        DoDone(Autograph) \n\
  951. X  Ctrl <Key>U:        beginning-of-line() kill-to-end-of-line() \n\
  952. X  Ctrl <Key>W:        delete-previous-word() \n\
  953. X  Meta <Key>X:        DoDone(autograph) \n\
  954. X       <Btn3Down>:    SetAliases() \n\
  955. X       <Key>Return:    NextField()
  956. X!
  957. X*indexWindow.translations: \
  958. X  Ctrl <Key>L:        redraw-display() \n\
  959. X  Ctrl <Key>V:        next-page() \n\
  960. X  Ctrl <Key>Z:        scroll-one-line-up() \n\
  961. X  Meta <Key>Q:        DoNothing() \n\
  962. X  Meta <Key>V:        previous-page() \n\
  963. X  Meta <Key>Z:        scroll-one-line-down() \n\
  964. X  Meta <Key><:        beginning-of-file() \n\
  965. X  Meta <Key>>:        end-of-file() \n\
  966. X  None <Key>Return:    scroll-one-line-up() \n\
  967. X  None <Key>space:    next-page() \n\
  968. X  Shift <Key>G:        end-of-file() \n\
  969. X  None <Key>a:        DoReply(a) \n\
  970. X  None <Key>b:        previous-page() \n\
  971. X  None <Key>c:        DoSave(c) \n\
  972. X  None <Key>d:        DoSelected(d) \n\
  973. X  None <Key>f:        DoSelected(P) \n\
  974. X  None <Key>i:        DoCmd(inc) \n\
  975. X  None <Key>j:        scroll-one-line-up() \n\
  976. X  None <Key>k:        scroll-one-line-down() \n\
  977. X  None <Key>m:        DoReply(s) \n\
  978. X  None <Key>n:        DoSelected(n) \n\
  979. X  None <Key>p:        DoSelected(-) \n\
  980. X  None <Key>q:        Quit(q) \n\
  981. X  None <Key>r:        DoSelected(p) \n\
  982. X  None <Key>s:        DoSave(s) \n\
  983. X  None <Key>u:        DoSelected(u) \n\
  984. X  None <Key>w:        DoSave(w) \n\
  985. X  None <Key>x:        Quit(x) \n\
  986. X  None <Key>-:        scroll-one-line-down() \n\
  987. X  None <Key>\':        beginning-of-file() \n\
  988. X       <Btn1Down>:    select-start() SetSelect() \n\
  989. X       <Btn1Motion>:    extend-adjust() \n\
  990. X       <Btn1Up>:    extend-end(PRIMARY, CUT_BUFFER0) \n\
  991. X       <Btn2Down>:    ShowHelp() \n\
  992. X       <Btn3Down>:    select-start() SetSelect() \n\
  993. X       <Btn3Up>:    DoSelected(p) \n\
  994. X  Ctrl <Key>R:        search(backward) \n\
  995. X  Ctrl <Key>S:        search(forward)
  996. X!
  997. X*Subject.translations:    #override \n\
  998. X       <Key>Delete:    delete-previous-character() \n\
  999. X       <Key>BackSpace:    delete-previous-character() \n\
  1000. X  Meta <Key>A:        DoDone(Cancel) \n\
  1001. X  Meta <Key>C:        DoDone(cancel) \n\
  1002. X  Meta <Key>D:        DoDone(Deliver) \n\
  1003. X  Ctrl <Key>H:        delete-previous-character() \n\
  1004. X  Meta <Key>R:        DoDone(ReEdit) \n\
  1005. X  Meta <Key>S:        DoDone(Autograph) \n\
  1006. X  Ctrl <Key>U:        beginning-of-line() kill-to-end-of-line() \n\
  1007. X  Ctrl <Key>W:        delete-previous-word() \n\
  1008. X  Meta <Key>X:        DoDone(autograph) \n\
  1009. X       <Btn3Motion>:    DoNothing() \n\
  1010. X       <Btn3Up>:    DoNothing() \n\
  1011. X       <Key>Return:    NextField()
  1012. X!
  1013. X*textWindow.text.translations: #override \
  1014. X  Ctrl <Key>J:        MenuPopdown(help) \n\
  1015. X  Ctrl <Key>L:        redraw-display() \n\
  1016. X  Ctrl <Key>V:        next-page() \n\
  1017. X  Ctrl <Key>Z:        scroll-one-line-up() \n\
  1018. X  Meta <Key>Q:        DoNothing() \n\
  1019. X  Meta <Key>V:        previous-page() \n\
  1020. X  Meta <Key>Z:        scroll-one-line-down() \n\
  1021. X  Meta <Key><:        beginning-of-file() \n\
  1022. X  Meta <Key>>:        end-of-file() \n\
  1023. X  Shift <Key>A:        DoReply(A) \n\
  1024. X  Shift <Key>C:        DoSave(C) \n\
  1025. X  Shift <Key>F:        DoReply(S) \n\
  1026. X  Shift <Key>G:        end-of-file() \n\
  1027. X  Shift <Key>M:        DoReply(r) \n\
  1028. X  Shift <Key>N:        DoCmd(file %) \n\
  1029. X  Shift <Key>P:        PrintMsg() \n\
  1030. X  Shift <Key>R:        DoReply(R) \n\
  1031. X  Shift <Key>S:        DoSave(S) \n\
  1032. X  None <Key>Linefeed:    MenuPopdown(help) \n\
  1033. X  None <Key>Return:    scroll-one-line-up() \n\
  1034. X  None <Key>-:        scroll-one-line-down() \n\
  1035. X  None <Key>\':        beginning-of-file() \n\
  1036. X  None <Key>space:    next-page() \n\
  1037. X  None <Key>a:        DoReply(a) \n\
  1038. X  None <Key>b:        previous-page() \n\
  1039. X  None <Key>c:        DoSave(c) \n\
  1040. X  None <Key>d:        DoSelected(d) \n\
  1041. X  None <Key>f:        DoSelected(P) \n\
  1042. X  None <Key>i:        DoCmd(inc) \n\
  1043. X  None <Key>j:        scroll-one-line-up() \n\
  1044. X  None <Key>k:        scroll-one-line-down() \n\
  1045. X  None <Key>m:        DoReply(s) \n\
  1046. X  None <Key>n:        DoSelected(n) \n\
  1047. X  None <Key>p:        DoSelected(-) \n\
  1048. X  None <Key>q:        Quit(q) \n\
  1049. X  None <Key>r:        DoSelected(p) \n\
  1050. X  None <Key>s:        DoSave(s) \n\
  1051. X  None <Key>u:        DoSelected(u) \n\
  1052. X  None <Key>w:        DoSave(w) \n\
  1053. X  None <Key>x:        Quit(x) \n\
  1054. X       <Key>?:        ShowHelp() \n\
  1055. X       <Btn1Down>:    select-start() \n\
  1056. X       <Btn1Motion>:    extend-adjust() \n\
  1057. X       <Btn1Up>:    extend-end(PRIMARY, CUT_BUFFER0) \n\
  1058. X       <Btn2Down>:    ShowHelp() \n\
  1059. X       <Btn3Down>:    extend-start() \n\
  1060. X       <Btn3Motion>:    extend-adjust() \n\
  1061. X       <Btn3Up>:    extend-end(PRIMARY, CUT_BUFFER0) \n\
  1062. X  Ctrl <Key>R:        search(backward) \n\
  1063. X  Ctrl <Key>S:        search(forward)
  1064. X!
  1065. X*To.translations:    #override \n\
  1066. X       <Key>Delete:    delete-previous-character() \n\
  1067. X       <Key>BackSpace:    delete-previous-character() \n\
  1068. X  Meta <Key>A:        DoDone(Cancel) \n\
  1069. X  Meta <Key>C:        DoDone(cancel) \n\
  1070. X  Meta <Key>D:        DoDone(Deliver) \n\
  1071. X  Ctrl <Key>H:        delete-previous-character() \n\
  1072. X  Meta <Key>R:        DoDone(ReEdit) \n\
  1073. X  Meta <Key>S:        DoDone(Autograph) \n\
  1074. X  Ctrl <Key>U:        beginning-of-line() kill-to-end-of-line() \n\
  1075. X  Ctrl <Key>W:        delete-previous-word() \n\
  1076. X  Meta <Key>X:        DoDone(autograph) \n\
  1077. X       <Btn3Down>:    SetAliases() \n\
  1078. X       <Key>Return:    NextField()
  1079. X!
  1080. END_OF_FILE
  1081.   if test 10253 -ne `wc -c <'XMail.ad'`; then
  1082.     echo shar: \"'XMail.ad'\" unpacked with wrong size!
  1083.   fi
  1084.   # end of 'XMail.ad'
  1085. fi
  1086. if test -f 'global.h' -a "${1}" != "-c" ; then 
  1087.   echo shar: Will not clobber existing file \"'global.h'\"
  1088. else
  1089.   echo shar: Extracting \"'global.h'\" \(10049 characters\)
  1090.   sed "s/^X//" >'global.h' <<'END_OF_FILE'
  1091. X/*
  1092. X * xmail - X window system interface to the mail program
  1093. X *
  1094. X * Copyright 1990,1991,1992 by National Semiconductor Corporation
  1095. X *
  1096. X * Permission to use, copy, modify, and distribute this software and its
  1097. X * documentation for any purpose is hereby granted without fee, provided that
  1098. X * the above copyright notice appear in all copies and that both that
  1099. X * copyright notice and this permission notice appear in supporting
  1100. X * documentation, and that the name of National Semiconductor Corporation not
  1101. X * be used in advertising or publicity pertaining to distribution of the
  1102. X * software without specific, written prior permission.
  1103. X *
  1104. X * NATIONAL SEMICONDUCTOR CORPORATION MAKES NO REPRESENTATIONS ABOUT THE
  1105. X * SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE.  IT IS PROVIDED "AS IS"
  1106. X * WITHOUT EXPRESS OR IMPLIED WARRANTY.  NATIONAL SEMICONDUCTOR CORPORATION
  1107. X * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  1108. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
  1109. X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
  1110. X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1111. X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  1112. X * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1113. X * PERFORMANCE OF THIS SOFTWARE.
  1114. X *
  1115. X * Author:  Michael C. Wagnitz - National Semiconductor Corporation
  1116. X *
  1117. X */
  1118. X
  1119. X
  1120. X#include "defs.h"
  1121. X
  1122. X/* HelpText.c */
  1123. X
  1124. Xextern String        Autograph_Info[];
  1125. Xextern String        Copy_Info[];
  1126. Xextern String        Default_Status_Info;
  1127. Xextern String        Delete_Info[];
  1128. Xextern String        Deliver_Info[];
  1129. Xextern String        Folder_Info[];
  1130. Xextern String        Hold_Info[];
  1131. Xextern String        NewMail_Info[];
  1132. Xextern String        Print_Info[];
  1133. Xextern String        Quit_Info[];
  1134. Xextern String        Read_Info[];
  1135. Xextern String        Reply_Info[];
  1136. Xextern String        Save_Info[];
  1137. Xextern String        Send_Info[];
  1138. Xextern String        SendMail_Info[];
  1139. X
  1140. Xextern String        Abort_Help;
  1141. Xextern String        Bcc_Help;
  1142. Xextern String        Cancel_Help;
  1143. Xextern String        Cc_Help;
  1144. Xextern String        Copy_Help;
  1145. Xextern String        Delete_Help;
  1146. Xextern String        Deliver_Help;
  1147. Xextern String        File_Help;
  1148. Xextern String        Folder_Help;
  1149. Xextern String        Hold_Help;
  1150. Xextern String        Index_Help;
  1151. Xextern String        NewMail_Help;
  1152. Xextern String        Print_Help;
  1153. Xextern String        Quit_Help;
  1154. Xextern String        Read_Help;
  1155. Xextern String        ReEdit_Help;
  1156. Xextern String        Reply_Help;
  1157. Xextern String        Save_Help;
  1158. Xextern String        Send_Help;
  1159. Xextern String        Sign_Help;
  1160. Xextern String        sign_Help;
  1161. Xextern String        Status_Help;
  1162. Xextern String        Subject_Help;
  1163. Xextern String        Text_Help;
  1164. Xextern String        Text2_Help;
  1165. Xextern String        Title_Help;
  1166. Xextern String        To_Help;
  1167. X
  1168. X/* actions.c */
  1169. X
  1170. Xextern void        initfoldir();        /* initialize foldir value */
  1171. Xextern int        str_compare();        /* for qsort of folder names */
  1172. Xextern XtActionProc    CheckInsert();        /* for the file window */
  1173. Xextern void        EraseIt();        /* delete requested buf data */
  1174. Xextern XtActionProc    DeleteChar();        /* for deletes (file window) */
  1175. Xextern XtActionProc    DeleteLine();        /* in the file window */
  1176. Xextern XtActionProc    DeleteWord();        /* also in the file window */
  1177. Xextern XtActionProc    DoCmd();        /* effect specified command */
  1178. Xextern XtActionProc    DoDone();        /* complete message delivery */
  1179. Xextern XtActionProc    DoNothing();        /* dummy action routine */
  1180. Xextern XtActionProc    DoReply();        /* invoke reply callback */
  1181. Xextern XtActionProc    DoSave();        /* invoke the save callback */
  1182. Xextern XtActionProc    DoSelected();        /* DoCmd w/ selected message */
  1183. Xextern XtActionProc    Folder();        /* execute folder command */
  1184. Xextern XtActionProc    Iconify();        /* iconification request */
  1185. Xextern XtActionProc    MyNotify();        /* invokes callbacks w/ param */
  1186. Xextern XtActionProc    NextField();        /* warps pointer to data fld */
  1187. Xextern XtActionProc    PrintMsg();        /* send mail to the printer */
  1188. Xextern XtActionProc    Quit();            /* termination procedure */
  1189. Xextern XtActionProc    SetAliases();        /* menu list of alias names */
  1190. Xextern void        SetNewness();        /* hilite folders w/ new data */
  1191. Xextern XtActionProc    SetFolders();        /* create a list of folders */
  1192. Xextern XtActionProc    SetMenu();        /* Position set_menu popup */
  1193. Xextern XtActionProc    SetPopup();        /* Position relative to owner */
  1194. Xextern XtActionProc    SetSelect();        /* reposition select mark */
  1195. Xextern XtActionProc    ShowHelp();        /* Position help & popup text */
  1196. X
  1197. X/* callbacks.c */
  1198. X
  1199. Xextern XtCallbackProc    Autograph();        /* adds Signature to message */
  1200. Xextern int        endDelivery();        /* catch delivery completion */
  1201. Xextern int        DoCopy();        /* folder copy mail delivery */
  1202. Xextern XtCallbackProc    Done();            /* completes mail delivery */
  1203. Xextern XtCallbackProc    DoIt();            /* callback do specified cmd */
  1204. Xextern XtCallbackProc    DoPrint();        /* callback printer execution */
  1205. Xextern XtCallbackProc    DoQuit();        /* callback termination func */
  1206. Xextern XtCallbackProc    DoSet();        /* callback to toggle options */
  1207. Xextern XtCallbackProc    DoWith();        /* do cmd with arguments */
  1208. Xextern XtCallbackProc    DropIt();        /* destroy Folder popup list */
  1209. Xextern XtCallbackProc    GetAliasName();        /* retrieve alias name */
  1210. Xextern XtCallbackProc    GetFolderName();    /* retrieve folder name */
  1211. Xextern XtCallbackProc    ReEdit();        /* re-edit the mail message */
  1212. Xextern XtCallbackProc    Reply();        /* use msg author and subject */
  1213. Xextern XtCallbackProc    Save();            /* callback save routine */
  1214. Xextern XtCallbackProc    SetNewmail();        /* highlight when new mail */
  1215. Xextern XtCallbackProc    UnsetNewmail();        /* remove newmail highlight */
  1216. X
  1217. X/* callMail.c */
  1218. X
  1219. Xextern void        callMail();        /* fork child, exec mail */
  1220. X
  1221. X/* confirm.c */
  1222. X
  1223. Xextern Bool        Confirm();        /* Confirm destructive acts */
  1224. X
  1225. X/* directory.c */
  1226. X
  1227. Xextern XtActionProc    SetDirectory();        /* create folder files list */
  1228. X
  1229. X/* environs.c */
  1230. X
  1231. Xextern char        *GetMailEnv();        /* get value from mail env */
  1232. Xextern char        *GetMailrc();        /* get mailrc item value */
  1233. Xextern char        *alias();        /* get mailrc alias value */
  1234. X
  1235. X/* handler.c */
  1236. X
  1237. Xextern int         In_System_Folder();    /* boolean test of folder */
  1238. Xextern XtEventHandler    icon_handler();        /* handle iconify changes */
  1239. Xextern int         index_handler();    /* highlight the msg number */
  1240. Xextern void         info_handler();        /* change content of status */
  1241. Xextern int         file_handler();        /* handle change of folder */
  1242. X
  1243. X/* mail.c */
  1244. X
  1245. Xextern XtEventHandler    warp_handler();        /* warp cursor AFTER mapping */
  1246. Xextern char        *extract_of();        /* get header info from buf */
  1247. Xextern int         endEdits();        /* catch exit of edit child */
  1248. Xextern void         editMail();        /* create/compose a message */
  1249. Xextern XtInputCallbackProc readMail();        /* get data from mail pipe */
  1250. Xextern void        makeHeading();        /* message header windows */
  1251. Xextern void        makeButton();        /* message completion buttons */
  1252. Xextern void         sendMail();        /* used by Send/Reply cmds */
  1253. Xextern void         writeMail();        /* send data to mail pipe */
  1254. X
  1255. X/* parser.c */
  1256. X
  1257. Xextern void        parser_init();        /* compile patterns */
  1258. Xextern int        match();        /* eval command or output */
  1259. Xextern void        parse();        /* parse mail output */
  1260. Xextern char        *QueryMail();        /* ask mail for info */
  1261. X
  1262. X/* utils.c */
  1263. X
  1264. Xextern void         Bell();            /* disp. error and sound bell */
  1265. Xextern int        figureWidth();        /* get figure width for font */
  1266. Xextern void         markIndex();        /* add/replace index marker */
  1267. Xextern int         SelectionNumber();    /* get number of selected msg */
  1268. Xextern void        SetCursor();        /* change between wait & norm */
  1269. Xextern void         SetXY();        /* set widget x/y coordinates */
  1270. Xextern XawTextPosition    TextGetLastPos();    /* get last pos of text */
  1271. Xextern void        UpdateTitleBar();    /* file name and msg count */
  1272. Xextern void         writeText();        /* write text to buffer */
  1273. Xextern void         writeTo();        /* send text data to window */
  1274. X
  1275. X/* windows.c */
  1276. X
  1277. Xextern void        AddHelpText();        /* Add help popup to window */
  1278. Xextern void        AddMenuWindow();    /* Add menu popup to window */
  1279. Xextern void        AddButton();        /* Add command to window */
  1280. Xextern void        CreateButtons();    /* make the command buttons */
  1281. Xextern void        CreateCommandPanel();    /* form for command buttons */
  1282. Xextern void        CreateFileWindow();    /* a text input window */
  1283. Xextern void        CreateFolderButton();    /* a special command button */
  1284. Xextern void        CreateHelpWindow();    /* the help window base */
  1285. Xextern void        CreateIndexWindow();    /* a text input window */
  1286. Xextern void        CreateStatusWindow();    /* a text output window */
  1287. Xextern void         CreateSubWindows();    /* all subwindows of xmail */
  1288. Xextern void        CreateTextWindow();    /* another text window */
  1289. Xextern void        CreateTitleBar();    /* a text output window */
  1290. Xextern Widget        CreateInputWindow();    /* To, Subject, Cc, and Bcc */
  1291. Xextern void        ParseIconGeometry();    /* Parse icon geometry */
  1292. X
  1293. X/* xmail.c */
  1294. X
  1295. Xextern void        initialize();        /* main initialization code */
  1296. Xextern int        mailoptions();        /* sets up call to mail pgm */
  1297. X
  1298. X/* extern functions */
  1299. X
  1300. Xextern char    *strchr(), *strrchr();
  1301. X
  1302. X/* extern variables */
  1303. X
  1304. Xextern Atom    wmDeleteWindow;        /* for WM_DELETE_WINDOW property */
  1305. Xextern Boolean    In_Bogus_Mail_File;    /* in bogus folder when we're iconic */
  1306. Xextern Boolean    Waiting;        /* TRUE when we set the busy cursor */
  1307. Xextern Pixmap    hatch;            /* cross_weave, to indicate new mail */
  1308. Xextern Widget    toplevel;         /* top level shell widget    */
  1309. Xextern Window    WaitCursorWindow;
  1310. X
  1311. Xextern AliasRecPtr    *aliases;    /* array of mail alias strings    */
  1312. Xextern helpText        *HelpList;
  1313. Xextern XmailResources    XMail;        /* XMail application resources */
  1314. X
  1315. Xextern int    mail_fd;        /* descriptor to mail process i/o */
  1316. X
  1317. Xextern int    mailargc;        /* counter passed to mail child    */
  1318. Xextern int    RootWidth, RootHeight;
  1319. Xextern int    mailpid;        /* mail process id */
  1320. Xextern int    Highlighted;        /* state of 'Newmail' highlighting */
  1321. Xextern int    mailInputId;        /* Identity of the XtAddInput call */
  1322. X
  1323. Xextern char    HOME[BUFSIZ];        /* home directory of user       */
  1324. Xextern char    Command[BUFSIZ];    /* xmail command string        */
  1325. Xextern char     InReply[BUFSIZ];    /* reply reference string    */
  1326. Xextern char     tmpName[BUFSIZ];    /* message temporary filename    */
  1327. Xextern char    otherBuf[BUFSIZ];    /* bucket for non-addressee names */
  1328. Xextern char    foldir[BUFSIZ];        /* name of the folder directory */
  1329. Xextern char     lastFolder[BUFSIZ];    /* previous folder's title-bar    */
  1330. Xextern char    *mailargv[8];        /* array passed to mail child    */
  1331. X
  1332. X/* global.h */
  1333. END_OF_FILE
  1334.   if test 10049 -ne `wc -c <'global.h'`; then
  1335.     echo shar: \"'global.h'\" unpacked with wrong size!
  1336.   fi
  1337.   # end of 'global.h'
  1338. fi
  1339. if test -f 'handler.c' -a "${1}" != "-c" ; then 
  1340.   echo shar: Will not clobber existing file \"'handler.c'\"
  1341. else
  1342.   echo shar: Extracting \"'handler.c'\" \(11289 characters\)
  1343.   sed "s/^X//" >'handler.c' <<'END_OF_FILE'
  1344. X/*
  1345. X * xmail - X window system interface to the mail program
  1346. X *
  1347. X * Copyright 1990,1991,1992 by National Semiconductor Corporation
  1348. X *
  1349. X * Permission to use, copy, modify, and distribute this software and its
  1350. X * documentation for any purpose is hereby granted without fee, provided that
  1351. X * the above copyright notice appear in all copies and that both that
  1352. X * copyright notice and this permission notice appear in supporting
  1353. X * documentation, and that the name of National Semiconductor Corporation not
  1354. X * be used in advertising or publicity pertaining to distribution of the
  1355. X * software without specific, written prior permission.
  1356. X *
  1357. X * NATIONAL SEMICONDUCTOR CORPORATION MAKES NO REPRESENTATIONS ABOUT THE
  1358. X * SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE.  IT IS PROVIDED "AS IS"
  1359. X * WITHOUT EXPRESS OR IMPLIED WARRANTY.  NATIONAL SEMICONDUCTOR CORPORATION
  1360. X * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  1361. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
  1362. X * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
  1363. X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1364. X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  1365. X * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1366. X * PERFORMANCE OF THIS SOFTWARE.
  1367. X *
  1368. X * The following software modules were created and are Copyrighted by National
  1369. X * Semiconductor Corporation:
  1370. X *
  1371. X * 1. In_System_Folder:
  1372. X * 2. icon_handler:
  1373. X * 3. index_handler:
  1374. X * 4. info_handler: and
  1375. X * 5. file_handler.
  1376. X *
  1377. X * Author:  Michael C. Wagnitz - National Semiconductor Corporation
  1378. X *
  1379. X */
  1380. X
  1381. X
  1382. X#include <ctype.h>
  1383. X#include "global.h"
  1384. X#include "MailwatchP.h"
  1385. X#include <X11/Xaw/LabelP.h>
  1386. X
  1387. XBoolean    In_Bogus_Mail_File = False;    /* TRUE when we go iconic */
  1388. X
  1389. X/*
  1390. X** Examine the current value of the titleBar title and return TRUE/FALSE
  1391. X** to the question "Does it match the system mail folder name?"  The folder
  1392. X** name in the title bar label should be surrounded by a pair of quote marks.
  1393. X*/
  1394. Xint
  1395. XIn_System_Folder()
  1396. X{
  1397. X int        len, result;
  1398. X char        *fq, *lq, *buf;
  1399. X Arg        args[1];
  1400. X MailwatchWidget mb = (MailwatchWidget) XtNameToWidget(toplevel, "icon.mailbox");
  1401. X Widget        tb = XtNameToWidget(toplevel, "topBox.titleBar.title");
  1402. X
  1403. X
  1404. X XtSetArg(args[0], XtNlabel, &buf);
  1405. X XtGetValues(tb, args, 1);
  1406. X
  1407. X if ((lq = strrchr(buf, '"')) == NULL) result = FALSE;
  1408. X else {                    /* if a current folder name exists */
  1409. X    if ((fq = strchr(buf, '"')) == NULL) result = FALSE;
  1410. X    else {
  1411. X       ++fq;
  1412. X       len = lq - fq;
  1413. X       result = (strncmp(mb->mailbox.filename, fq, len) == 0) ? TRUE : FALSE ;
  1414. X      }
  1415. X   }
  1416. X return(result);
  1417. X} /* In_System_Folder */
  1418. X
  1419. X
  1420. X/*
  1421. X** Process map and unmap events for the icon widget to manage our iconify and
  1422. X** deiconify actions and switch to/from a bogus mail folder.  This allows users
  1423. X** to access mail from another process without colliding with an open folder.
  1424. X** Once the bogus mail folder is accessed, we unlink it, to avoid having to
  1425. X** explicitly remove it later.
  1426. X*/
  1427. X/* ARGSUSED */
  1428. XXtEventHandler
  1429. Xicon_handler(w, client_data, event)
  1430. XWidget    w;
  1431. Xcaddr_t    client_data;
  1432. XXEvent    *event;
  1433. X{
  1434. X static Boolean    Was_System_Folder = False;    /* TRUE if we had been in */
  1435. X FILE    *fp;
  1436. X char    *cp, cmd[BUFSIZ];
  1437. X
  1438. X
  1439. X if (mailpid) {
  1440. X    switch (event->type) {
  1441. X           case MapNotify :
  1442. X                if (! In_Bogus_Mail_File) {
  1443. X                   Was_System_Folder = In_System_Folder();
  1444. X                   (void) sprintf(cmd, "%s+", tmpName);
  1445. X                   if (fp = fopen(cmd, "w")) {    /* create a bogus mail file */
  1446. X                      (void) fprintf(fp, "\n");
  1447. X                      (void) fclose(fp);
  1448. X                      (void) sprintf(cmd, "file %s+", tmpName);
  1449. X                      cp = QueryMail(cmd);    /* focus our attention there */
  1450. X                      *cp = '\0';
  1451. X              (void) UpdateTitleBar("No current folder");
  1452. X                  writeTo(XtNameToWidget(toplevel, "*indexWindow"), " ", REPLACE);
  1453. X                  writeText(" ");
  1454. X                      (void) sprintf(cmd, "%s+", tmpName);
  1455. X                      (void) unlink(cmd);    /* toss it now that we're in */
  1456. X                      In_Bogus_Mail_File = True;
  1457. X                     }
  1458. X                  }
  1459. X                break;
  1460. X           case UnmapNotify :
  1461. X                if (In_Bogus_Mail_File) {
  1462. X                   if (strcmp(Command, "Start") != 0) {    /* if not starting up */
  1463. X                      if (Was_System_Folder) {        /* go to system file */
  1464. X                         (void) strcpy(Command, "file %\n");
  1465. X                        } else {            /* go to prev. file */
  1466. X                         (void) strcpy(Command, "file #\n");
  1467. X                        }
  1468. X                     } else {
  1469. X                      if (XMail.MFileName) {    /* start in specified folder */
  1470. X                         (void) sprintf(Command, "file %s\n", XMail.MFileName);
  1471. X                        } else {        /* or else use system folder */
  1472. X                         (void) strcpy(Command, "file %\n");
  1473. X                        }
  1474. X                     }
  1475. X                   SetCursor(WATCH);
  1476. X                   writeMail(Command);        /* let parser do the updating */
  1477. X                   In_Bogus_Mail_File = False;
  1478. X                   Was_System_Folder = False;
  1479. X                  } else if (In_System_Folder())
  1480. X                            UnsetNewmail(NULL, NULL, NULL);
  1481. X                break;
  1482. X           default:
  1483. X                break;
  1484. X          } /* end - switch on event type */
  1485. X   } /* end - if mail is active */
  1486. X} /* icon_handler */
  1487. X
  1488. X
  1489. X/*
  1490. X** @(#)index_handler() - find value of specified or next appropriate message
  1491. X*/
  1492. Xint
  1493. Xindex_handler(msg_num, undeleting)
  1494. Xint    msg_num;
  1495. Xint    undeleting;
  1496. X{
  1497. X int            j, k;
  1498. X XawTextPosition    pos;
  1499. X String            c, s, IBuf;
  1500. X Widget            iw;
  1501. X Arg            args[1];
  1502. X
  1503. X
  1504. X Bell("");                    /* reset bell worthyness flag */
  1505. X Bell(Default_Status_Info);
  1506. X
  1507. X k = msg_num;                    /* Try to use specified msg. */
  1508. X if (k == 0) {                    /* But, if not specified... */
  1509. X    c = QueryMail("=");
  1510. X    if (*c)
  1511. X       (void) sscanf(c, "%d", &k);        /* get msg num from mail. */
  1512. X   }
  1513. X
  1514. X iw = XtNameToWidget(toplevel, "topBox.indexWindow");
  1515. X IBuf = NULL;
  1516. X XtSetArg(args[0], XtNstring, &IBuf);
  1517. X XtGetValues(iw, args, 1);
  1518. X
  1519. X if (k <= 50) {                    /* do short index from front */
  1520. X    s = IBuf;
  1521. X    for (j = k - 1; j > 0 && (c = strchr(s, '\n')) != NULL; j--) s = c + 1;
  1522. X   } else {                    /* if index is fairly large */
  1523. X    for (s = &IBuf[strlen(IBuf) - 2]; s > IBuf && *s != '\n'; s--);
  1524. X    for (c = s + 1; *c && !isdigit(*c); c++);    /* get number of last entry */
  1525. X    j = 0;
  1526. X    if (*c)
  1527. X       (void) sscanf(c, "%d", &j);        /* look backwards from there */
  1528. X    for (; j > k; j--) {
  1529. X        if (s > IBuf) s--;
  1530. X        for (; s > IBuf && *s != '\n'; s--);
  1531. X       }
  1532. X    if (*s == '\n') s++;
  1533. X   } 
  1534. X
  1535. X j = k;
  1536. X for (;;) {                    /* allow for deleted msgs */
  1537. X     for (c = s; *c && !isdigit(*c); c++);
  1538. X     if (! *c || k == 0 ||
  1539. X    (sscanf(c, "%d", &j) && j <= k))    /* total may be less than us */
  1540. X        break;
  1541. X
  1542. X     if (s - 2 >= IBuf)
  1543. X        for (s -= 2; s > IBuf && *s != '\n'; s--);
  1544. X     if (*s == '\n') s++;
  1545. X    }
  1546. X
  1547. X if (! undeleting && *(s + 1) == 'D') {        /* If this is a deleted msg */
  1548. X    j = 0;                    /* then num is inappropriate */
  1549. X    for (;*s && *(s + 1) == 'D';) {        /* try looking above deletes */
  1550. X        if (! (c = strchr(s,'\n'))) break;    /* don't go past end of buf */
  1551. X        s = c + 1;
  1552. X       }
  1553. X    for (;s > IBuf && *(s + 1) == 'D';) {
  1554. X        for (s -= 2; s > IBuf && *s != '\n'; s--);
  1555. X        if (*s == '\n') s++;
  1556. X       }
  1557. X    if (*(s + 1) != 'D') {            /* If we found a readable msg */
  1558. X       for (c = s; *c && !isdigit(*c); c++);
  1559. X       if (*c)
  1560. X          (void) sscanf(c, "%d", &j);
  1561. X      }
  1562. X   }
  1563. X
  1564. X if (j) {                    /* if we have a valid msg num */
  1565. X    pos = s - IBuf;                /* resolve our position */
  1566. X    XawTextSetInsertionPoint(iw, pos);        /* point at selected line */
  1567. X    markIndex("> ");                /* flag it as current */
  1568. X   }
  1569. X
  1570. X return(j);                    /* return msg actually found */
  1571. X} /* index_handler */
  1572. X
  1573. X
  1574. X/*
  1575. X** @(#)info_handler - use enter/leave_notify events to alter status window info
  1576. X*/
  1577. X/*ARGSUSED*/
  1578. Xvoid
  1579. Xinfo_handler(w, client_data, event)
  1580. XWidget    w;                /* unused */
  1581. Xcaddr_t    client_data;
  1582. XXEvent    *event;
  1583. X{
  1584. X if      (event->type == LeaveNotify && ! Waiting) Bell(Default_Status_Info);
  1585. X else if (event->type == EnterNotify) {
  1586. X         if (! Waiting) Bell(client_data);
  1587. X         Waiting = FALSE;
  1588. X        }
  1589. X} /* end - info_handler */
  1590. X
  1591. X
  1592. X/*
  1593. X** @(#)file_handler() - Handle output of Start and file commands.
  1594. X**                      If *Show_Last: resource is TRUE show last
  1595. X**                      message in list, if none are marked as new.
  1596. X*/
  1597. Xfile_handler()
  1598. X{
  1599. X int            New_Unread, msg_num = 0;
  1600. X char            *c, *p, *headers = NULL;
  1601. X char            msgnum_str[10];
  1602. X XawTextPosition    pos;
  1603. X Widget            iw = XtNameToWidget(toplevel, "topBox.indexWindow");
  1604. X
  1605. X
  1606. X c = QueryMail("file");                /* Forces msg to first New/U */
  1607. X if (! mailpid) return (msg_num);
  1608. X
  1609. X if (! In_Bogus_Mail_File)
  1610. X    (void) UpdateTitleBar(c);
  1611. X
  1612. X c = QueryMail("=");                /* Get current mail msg num. */
  1613. X while (! isdigit(*c)) {
  1614. X    if (! mailpid) return (msg_num);
  1615. X    c = QueryMail("=");
  1616. X   }
  1617. X (void) sprintf(msgnum_str, c);
  1618. X
  1619. X *c = '\0';
  1620. X if (! mailpid) return (msg_num);
  1621. X headers = QueryMail("h");
  1622. X if (strncmp(headers, "No applicable messages", 22) == 0) {
  1623. X    Bell(headers);
  1624. X    writeTo(iw, " ", REPLACE);
  1625. X    writeText(" ");
  1626. X   } else {
  1627. X    /*
  1628. X    ** find mail's idea of this folder's current message number
  1629. X    */
  1630. X    if (*headers == '>') c = headers;
  1631. X    else                /* start search from the end of buf */
  1632. X       if (c = strrchr(headers, '\n')) c++;
  1633. X       else c = headers;
  1634. X
  1635. X    while (c > headers) {
  1636. X          if (*c == '>' && *(c - 1) == '\n')
  1637. X             break;
  1638. X
  1639. X          for (c -= 2; c > headers && *c != '\n'; c--);
  1640. X          if (*c == '\n') c++;
  1641. X         }
  1642. X    /*
  1643. X    ** If the current message is marked new or unread, ensure as many of the new
  1644. X    ** message headers as possible are displayed in the index window (especially
  1645. X    ** the current one), else if the Show_Last resource is not false, select the
  1646. X    ** last message in the header.
  1647. X    */
  1648. X    p = c;                    /* save position of current */
  1649. X    New_Unread = (*(c+1) == 'N' || *(c+1) == 'U');
  1650. X    if (! New_Unread && XMail.Show_Last) {    /* find the last message */
  1651. X       if (*p == '>') *p = ' ';            /* erase the original marker */
  1652. X       if (c == headers) {            /* if we would've started @1 */
  1653. X          if (p = strrchr(headers, '\n')) p++;
  1654. X          else p = headers;            /* go to last line of buffer */
  1655. X         }
  1656. X       for (c = p; *c && !isdigit(*c); c++);
  1657. X       if (*c)
  1658. X          (void) sscanf(c, "%d", &msg_num);
  1659. X       (void) sprintf(msgnum_str, "%d", msg_num);
  1660. X      }
  1661. X    /*
  1662. X    ** mark the current message's index line
  1663. X    */
  1664. X    *p = '>'; *(p+1) = ' ';
  1665. X    /*
  1666. X    ** Install these headers in the index window
  1667. X    */
  1668. X    writeTo(iw, headers, REPLACE);
  1669. X    /*
  1670. X    ** Ensure if there are new or unread messages that as many as possible are
  1671. X    ** displayed in the index window to reduce the amount of scrolling required
  1672. X    ** when reading(/deleting) them.
  1673. X    */
  1674. X    pos = p - headers;
  1675. X    if (New_Unread)
  1676. X       XawTextSetInsertionPoint(iw, strlen(headers));
  1677. X    XawTextSetInsertionPoint(iw, pos);
  1678. X    /*
  1679. X    ** Return the current message number.
  1680. X    */
  1681. X    msg_num = atoi(msgnum_str);
  1682. X   }
  1683. X *headers = '\0';
  1684. X return(msg_num);
  1685. X} /* file_handler */
  1686. END_OF_FILE
  1687.   if test 11289 -ne `wc -c <'handler.c'`; then
  1688.     echo shar: \"'handler.c'\" unpacked with wrong size!
  1689.   fi
  1690.   # end of 'handler.c'
  1691. fi
  1692. echo shar: End of archive 8 \(of 10\).
  1693. cp /dev/null ark8isdone
  1694. MISSING=""
  1695. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  1696.     if test ! -f ark${I}isdone ; then
  1697.     MISSING="${MISSING} ${I}"
  1698.     fi
  1699. done
  1700. if test "${MISSING}" = "" ; then
  1701.     echo You have unpacked all 10 archives.
  1702.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1703. else
  1704.     echo You still must unpack the following archives:
  1705.     echo "        " ${MISSING}
  1706. fi
  1707. exit 0
  1708. exit 0 # Just in case...
  1709. -- 
  1710.   // chris@IMD.Sterling.COM            | Send comp.sources.x submissions to:
  1711. \X/  Amiga - The only way to fly!      |
  1712.  "It's intuitively obvious to the most |    sources-x@imd.sterling.com
  1713.   casual observer..."                  |
  1714.