home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume21 / mrolo / part01 < prev    next >
Encoding:
Text File  |  1993-10-08  |  59.6 KB  |  2,214 lines

  1. Newsgroups: comp.sources.x
  2. From: gregor@kafka.saic.com (gregg hanna)
  3. Subject: v21i008:  mrolo - Motif rolodex, Part01/03
  4. Message-ID: <csx-v21i008=mrolo.201846@sparky.Sterling.COM>
  5. X-Md4-Signature: e5ab836653c06d768fbd3b9640552635
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Sat, 9 Oct 1993 01:19:16 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: gregor@kafka.saic.com (gregg hanna)
  12. Posting-number: Volume 21, Issue 8
  13. Archive-name: mrolo/part01
  14. Environment: X11, OSF/Motif
  15. Supersedes: mrolo: Volume 20, Issue 96-97
  16.  
  17. *Rolo is a set of card file database programs designed to be
  18. simple yet robust, and was born out of frustration with
  19. xrolo's and xrolodex's many menus.  The main program is
  20. mrolo, the Motif based card file program, and there is also
  21. crolo, the curses based equivalent.
  22.  
  23. Some features of mrolo/crolo:
  24.  
  25.   o From the main screen you see a list of all cards and
  26.     may scroll through them viewing/editing cards as desired.
  27.  
  28.   o You may jump to a section of the card file by clicking on
  29.     a lettered tab on the edge of the screen (A-Z) [mrolo] or
  30.     typing the upper-case letter [crolo].
  31.  
  32.   o You can search cards quickly by simply entering text
  33.     in a text field on the main screen.  (You can easily
  34.     do a regular expression search, if you want, just
  35.     start the text with a slash.)
  36.  
  37.   o There are no explicit save/load operations, the current
  38.     display reflects the disk file's contents and changes
  39.     are verified and written at the time of the change.
  40.  
  41. New in release 1.3:
  42.  
  43.   o Regular expression matching.
  44.   o crolo, curses-based for dial-in use
  45.   o Internationalization (see mrolo*indexElements resource).
  46.   o Handles X parameters (like -iconic) correctly.
  47.   o Windows behave better (they all iconify together, etc).
  48.   o AS OF feature, keeps track of when a card was last updated.
  49.   o Optionally constrain the filter to certain fields.
  50.   o Various bug fixes, lots of clean-up, more portability.
  51.  
  52. The programs use a disk format identical to xrolo, so if you
  53. use that it should be an easy switch.  See the manpages for
  54. lots of details.
  55.  
  56. This software was developed on a Sun4 running SunOS 4.1.1.  It
  57. should run on other systems, but it is not tested.  I'm
  58. especially concerned about the portability of the regular
  59. expression code, the curses code, and the time code.
  60.  
  61. If the curses code gives you trouble, just don't build crolo.
  62. If the time code gives you trouble, define the NO_TIME symbol
  63. (i.e. -DNO_TIME) and the "as of:" option will be compiled out.
  64. (Right now, if you put "as of:" at the beginning of the line
  65. in a card then *rolo will put the current date/time on that
  66. line whenever the card is changed.) If the regular expression
  67. code gives you trouble, compile with the flag -DDONT_REGEXP.
  68. Also, contact me (gregor@kafka.saic.com) and I'll try to help
  69. make it work on your system.
  70.  
  71. The package contains four programs:
  72.  
  73.     mrolo - the Motif cardfile program
  74.     crolo - the curses cardfile program
  75.     prolo - a program to print the cardfile
  76.     xr2mr - a script to convert xrolodex files to
  77.                 mrolo/xrolo format
  78.  
  79. To compile the programs do as follows:
  80.  
  81.     xmkmf
  82.     make
  83.  
  84. If you do not have xmkmf or imake, edit and use Makefile.std.
  85. If you have problems with compiling crolo, you might need to
  86. adjust the value of TERMLIBS.  (Some systems don't need
  87. -ltermcap.)
  88.  
  89. To test it, you may want to uudecode and uncompress the file
  90. sample.Z.uu, which is a 100 entry pseudo-random sample
  91. file.  (The option "-f sample" overrides the default
  92. ~/.rolo file.)
  93.  
  94. Once you're happy that the applications work install with:
  95.  
  96.     make install
  97.  
  98. To install the man-pages:
  99.  
  100.     make install.man
  101.  
  102. Please send bug reports, feedback, and suggestions to
  103. gregor@kafka.saic.com
  104.  
  105. Thanks to:
  106.   Bill James and Kral Ferch, my in-house testers.
  107.   David Koblas for AppDefault handling and new backup code.
  108.   William Shubert for the new icon.
  109.   Bruce Bowler for helping make it more VMS friendly.
  110.   John Silva for helping make it more HP friendly.
  111.   Brian Rice for helping make it more Ultrix friendly.
  112.   The anonymous soul who wrote the arrows.c file, which I
  113.      adapted for crolo.
  114.   AT&T and Rich Salz and Jim for the PD getopt(3).
  115.   Everyone who generously offered their suggestions.
  116.  
  117. Copyright 1993 by gregg hanna.  Permission is granted to use,
  118. modify, and distribute this program.  Basically do anything
  119. you want with it, but if you want to use it or any part of it
  120. to make money you must get further permission from me.
  121.  
  122.  
  123. #! /bin/sh
  124. # This is a shell archive.  Remove anything before this line, then unpack
  125. # it by saving it into a file and typing "sh file".  To overwrite existing
  126. # files, type "sh file -c".  You can also feed this as standard input via
  127. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  128. # will see the following message at the end:
  129. #        "End of archive 1 (of 3)."
  130. # Contents:  mrolo13 mrolo13/CHANGES mrolo13/Imakefile mrolo13/MANIFEST
  131. #   mrolo13/MRolo.ad mrolo13/Makefile.std mrolo13/README mrolo13/ad2c
  132. #   mrolo13/arrows.c mrolo13/arrows.h mrolo13/callback.c
  133. #   mrolo13/compat.c mrolo13/compat.h mrolo13/crolo.man
  134. #   mrolo13/getopt.c mrolo13/mrolo.bm mrolo13/mrolo.c
  135. #   mrolo13/myregexp.h mrolo13/patchlevel.h mrolo13/prolo.man
  136. #   mrolo13/rolo.h mrolo13/roloP.h mrolo13/roloc.c mrolo13/rolox.c
  137. #   mrolo13/rolox.h mrolo13/xr2mr mrolo13/xr2mr.man
  138. # Wrapped by gregor@kafka on Fri Sep  3 01:45:25 1993
  139. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  140. if test ! -d 'mrolo13' ; then
  141.     echo shar: Creating directory \"'mrolo13'\"
  142.     mkdir 'mrolo13'
  143. fi
  144. if test -f 'mrolo13/CHANGES' -a "${1}" != "-c" ; then 
  145.   echo shar: Will not clobber existing file \"'mrolo13/CHANGES'\"
  146. else
  147. echo shar: Extracting \"'mrolo13/CHANGES'\" \(1562 characters\)
  148. sed "s/^X//" >'mrolo13/CHANGES' <<'END_OF_FILE'
  149. XVersion 1.2
  150. X
  151. X  Initial public release.
  152. X
  153. X
  154. XVersion 1.3
  155. X
  156. X  Used dialogs instead of Application Shells to do card
  157. X  info and confirmation windows.  Makes behavior more
  158. X  appropriate.
  159. X
  160. X  Fixed bugs in reading input file to enhance xrolo
  161. X  compatibility.
  162. X
  163. X  Modified Imakefile to make it more portable.
  164. X
  165. X  Kludged around old Motif ScrolledList bug that showed
  166. X  just one list entry.
  167. X
  168. X  Fixed memory leak in OKCard.
  169. X
  170. X  Handle XmString tables differently, works under gcc.
  171. X
  172. X  Added mystrdup and mystrcasecmp to make it more
  173. X  portable.
  174. X
  175. X  Added regular expression support.
  176. X
  177. X  Changed MRolo.ad to have better default fonts.  (They
  178. X  were coming up as kanji for some people.)
  179. X
  180. X  Handles X arguments (like -iconic) correctly.
  181. X
  182. X  Added crolo to the distribution.
  183. X
  184. X  Changed index tabs to buttons for more intuitive use.
  185. X
  186. X  Made index tabs configurable to allow non-english
  187. X  alphabets.
  188. X
  189. X  Modified the backup handling to only backup if changes
  190. X  are made (koblas@netcom.com).
  191. X
  192. X  Setup fallback AppDefaults (koblas@netcom.com).
  193. X
  194. X  Added AS OF keyword, keeps track of last change to a card.
  195. X
  196. X  Added filter search limiting as an option.
  197. X
  198. X  Added portability features, consideration for VMS and Ultix (sort of),
  199. X  consideration of non-X users building crolo (NO_X flag).
  200. X
  201. X  Added ifdefs to not do STANDOUT for crolo under SYSV, I had troubles
  202. X  with the HP and Sun using SYSV curses.
  203. X
  204. X  Uses argv[0] as the app name, so if you put app-defaults for
  205. X  different names and symlink the application you can get different
  206. X  looks.  Especially useful for making non-phone rolo files.
  207. END_OF_FILE
  208. if test 1562 -ne `wc -c <'mrolo13/CHANGES'`; then
  209.     echo shar: \"'mrolo13/CHANGES'\" unpacked with wrong size!
  210. fi
  211. # end of 'mrolo13/CHANGES'
  212. fi
  213. if test -f 'mrolo13/Imakefile' -a "${1}" != "-c" ; then 
  214.   echo shar: Will not clobber existing file \"'mrolo13/Imakefile'\"
  215. else
  216. echo shar: Extracting \"'mrolo13/Imakefile'\" \(965 characters\)
  217. sed "s/^X//" >'mrolo13/Imakefile' <<'END_OF_FILE'
  218. XSRCS = callback.c creation.c mrolo.c rolo.c rolox.c compat.c getopt.c
  219. XOBJS = callback.o creation.o mrolo.o rolo.o rolox.o compat.o getopt.o
  220. XLDLIBS = -lXm $(SYSLIBS)
  221. XTERMLIBS = -lcurses -ltermcap
  222. X
  223. XComplexProgramTarget(mrolo)
  224. XInstallAppDefaults(MRolo)
  225. X
  226. Xall:: prolo crolo
  227. X
  228. Xprolo: prolo.c rolo.o compat.o getopt.o
  229. X    $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o prolo prolo.c rolo.o compat.o getopt.o
  230. X
  231. Xcrolo: crolo.c rolo.o roloc.o arrows.o compat.o getopt.o
  232. X    $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o crolo crolo.c rolo.o roloc.o arrows.o compat.o getopt.o $(TERMLIBS)
  233. X
  234. Xclean::
  235. X    $(RM) prolo crolo rolo.samp- xdef MRolo.ad.h
  236. X
  237. XInstallProgram(crolo,$(BINDIR))
  238. XInstallProgram(prolo,$(BINDIR))
  239. XInstallProgram(xr2mr,$(BINDIR))
  240. XInstallManPage(crolo,$(MANDIR))
  241. XInstallManPage(prolo,$(MANDIR))
  242. XInstallManPage(xr2mr,$(MANDIR))
  243. X
  244. Xxdef: MRolo.ad
  245. X    sed -e '1,$$s/^#/!/g' -e '1,$$s/^*/mrolo*/g' MRolo.ad > xdef
  246. X
  247. XMRolo.ad.h: MRolo.ad
  248. X      ./ad2c MRolo.ad > MRolo.ad.h
  249. X
  250. Xmrolo.o: MRolo.ad.h
  251. END_OF_FILE
  252. if test 965 -ne `wc -c <'mrolo13/Imakefile'`; then
  253.     echo shar: \"'mrolo13/Imakefile'\" unpacked with wrong size!
  254. fi
  255. # end of 'mrolo13/Imakefile'
  256. fi
  257. if test -f 'mrolo13/MANIFEST' -a "${1}" != "-c" ; then 
  258.   echo shar: Will not clobber existing file \"'mrolo13/MANIFEST'\"
  259. else
  260. echo shar: Extracting \"'mrolo13/MANIFEST'\" \(1860 characters\)
  261. sed "s/^X//" >'mrolo13/MANIFEST' <<'END_OF_FILE'
  262. X   File Name        Archive #    Description
  263. X-----------------------------------------------------------
  264. X CHANGES                    1        change file
  265. X Imakefile                  1        template for imake
  266. X MANIFEST                   1        this file
  267. X MRolo.ad                   1        application defaults
  268. X Makefile.std               1        non-imake makefile
  269. X README                     1        read this first
  270. X ad2c                       1        converts AD file to .h
  271. X arrows.c                   1        handles arrows under BSD curses
  272. X arrows.h                   1        handles arrows under BSD curses
  273. X callback.c                 1        X callbacks for mrolo
  274. X compat.c                   1        compatibility functions
  275. X compat.h                   1        compatibility function headers
  276. X creation.c                 3        X window creation for mrolo
  277. X crolo.c                    1        curses rolo main program
  278. X crolo.man                  1        curses rolo man page
  279. X getopt.c                   1        portable getopt(3)
  280. X mrolo.bm                   1        bitmap for mrolo
  281. X mrolo.c                    1        Motif rolo main program
  282. X mrolo.man                  2        Motif rolo man page
  283. X myregexp.h                 1        portable regexp
  284. X patchlevel.h               1        patchlevel file
  285. X prolo.c                    2        rolo printer main program
  286. X prolo.man                  1        rolo printer man page
  287. X rolo.c                     2        rolo functions (used by *rolo)
  288. X rolo.h                     1        headers for rolo functions
  289. X sample.Z.uu                2        sample rolo file (compressed/uuencoded)
  290. X roloP.h                    1        private header for rolo.c
  291. X roloc.c                    1        curses rolo functions
  292. X rolox.c                    1        X windows rolo functions
  293. X rolox.h                    1        headers for X windows rolo functions
  294. X xr2mr                      1        converter from xrolodex file to rolo file
  295. X xr2mr.man                  1        manual page for converter
  296. X
  297. END_OF_FILE
  298. if test 1860 -ne `wc -c <'mrolo13/MANIFEST'`; then
  299.     echo shar: \"'mrolo13/MANIFEST'\" unpacked with wrong size!
  300. fi
  301. # end of 'mrolo13/MANIFEST'
  302. fi
  303. if test -f 'mrolo13/MRolo.ad' -a "${1}" != "-c" ; then 
  304.   echo shar: Will not clobber existing file \"'mrolo13/MRolo.ad'\"
  305. else
  306. echo shar: Extracting \"'mrolo13/MRolo.ad'\" \(1789 characters\)
  307. sed "s/^X//" >'mrolo13/MRolo.ad' <<'END_OF_FILE'
  308. X! fonts:  note that addressList ought to have a fixed width font
  309. X*fontList: -*-helvetica-*-r-*-*-14-*-*-*-*-*-*-*
  310. X*addressList*fontList: -misc-fixed-*-r-*-*-14-*-*-*-*-*-*-*
  311. X
  312. X! default size of the comment box on the card info screen
  313. X*commentText.rows: 10
  314. X*commentText.cols: 80
  315. X
  316. X! size of the filter text field
  317. X*filterText.columns:    11
  318. X
  319. X! these control the way buttons look, if you change to
  320. X! XmPACK_TIGHT you probably want to make resizeWidth False
  321. X*XmRowColumn*packing:    XmPACK_COLUMN
  322. X*rowColumn.resizeWidth:    True
  323. X*rowColumn.width:    500
  324. X
  325. X! custom resources, shown here with default values
  326. X*showSecondary:    True
  327. X*sizePrimary:    20
  328. X*selectFilter:    False
  329. X
  330. X! colors you *might* like
  331. X*foreground:    black
  332. X*background:    white
  333. X*XmPushButton*foreground:    black
  334. X*XmPushButton*background:    pink
  335. X*XmText*foreground:    black
  336. X*XmText*background:    alice blue
  337. X*addressList*foreground:    black
  338. X*addressList*background:    honeydew
  339. X
  340. X! labels
  341. X*quitButton.labelString:    Quit
  342. X*addCardButton.labelString:    Add Card
  343. X*clearButton.labelString:    Clear Filter
  344. X*deleteCardButton.labelString:    Delete Card
  345. X*pickerButton.labelString:    Fields
  346. X*okButton.labelString:        OK
  347. X*cancelButton.labelString:    Cancel
  348. X*primaryLabel.labelString:    Phone
  349. X*secondaryLabel.labelString:    Phone #2
  350. X*nameLabel.labelString:        Name
  351. X*messageBox.okLabelString:    Yes
  352. X*messageBox.cancelLabelString:    No
  353. X*messageBox.helpLabelString:    Help
  354. X
  355. X! tranversals
  356. X*quitButton.traversalOn:    True
  357. X*addCardButton.traversalOn:    True
  358. X*clearButton.traversalOn:    True
  359. X
  360. X! indexes on side of screen
  361. Xmrolo*indexElements:        A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  362. X
  363. X! default spacing
  364. X*form.leftOffset:    2
  365. X*form.rightOffset:    2
  366. X*form.topOffset:    2
  367. X*form.bottomOffset:    2
  368. X
  369. X! Toggle buttons, and thus filter settings.
  370. X*tbutton0.set:    True
  371. X*tbutton1.set:    True
  372. X*tbutton2.set:    True
  373. X*tbutton3.set:    True
  374. END_OF_FILE
  375. if test 1789 -ne `wc -c <'mrolo13/MRolo.ad'`; then
  376.     echo shar: \"'mrolo13/MRolo.ad'\" unpacked with wrong size!
  377. fi
  378. # end of 'mrolo13/MRolo.ad'
  379. fi
  380. if test -f 'mrolo13/Makefile.std' -a "${1}" != "-c" ; then 
  381.   echo shar: Will not clobber existing file \"'mrolo13/Makefile.std'\"
  382. else
  383. echo shar: Extracting \"'mrolo13/Makefile.std'\" \(1854 characters\)
  384. sed "s/^X//" >'mrolo13/Makefile.std' <<'END_OF_FILE'
  385. X# Sun OS 4.1.* users:  it should work as is.
  386. X# HP/UX users:  use -DUSE_REGCOMP -DSYSV, LDFLAGS and INCLUDES
  387. X# everyone else:  read through the makefile
  388. X
  389. XRM = /bin/rm
  390. XBINDIR = /usr/bin/X11
  391. XAPPDIR = /usr/lib/X11/app-defaults
  392. XMANDIR = /usr/man/mann
  393. XMANEXT = n
  394. XLDLIBS = -lXm -lXt -lX11
  395. XTERMLIBS = -lcurses -ltermcap
  396. X
  397. X# uncomment one of the following
  398. X#   USE_RE_COMP - if you have re_comp/re_exec
  399. X#   USE_REGCOMP - if you have regcomp/regexec/regfree (POSIX)
  400. X#   DONT_REGEXP - if you have don't have any
  401. X#   nothing - if you have compile/step
  402. X#REGEX = -DUSE_RE_COMP
  403. X#REGEX = -DUSE_REGCOMP
  404. X#REGEX = -DDONT_REGEXP
  405. XREGEX =
  406. X
  407. X# uncomment the following if you don't have X and are just building crolo
  408. X#XMODE = -DNO_X
  409. X
  410. X
  411. X# SYSV controls how curses is handled.  If crolo doesn't
  412. X# compile or works funny, try -DSYSV.
  413. X#SYSV = -DSYSV
  414. X#INCLUDES = -I /usr/include/X11R4 -I /usr/include/Motif1.1
  415. XCFLAGS = -O -D_NO_PROTO $(REGEX) $(XMODE) $(SYSV) $(INCLUDES)
  416. X
  417. X#LDFLAGS = -L /usr/lib/X11R4 -L /usr/lib/Motif1.1
  418. X
  419. XLINK.c = $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
  420. X
  421. Xall: mrolo prolo crolo
  422. X
  423. Xmrolo: callback.o creation.o mrolo.o rolo.o rolox.o compat.o getopt.o
  424. X    $(LINK.c) -o mrolo mrolo.o rolo.o rolox.o creation.o callback.o compat.o getopt.o $(LDLIBS)
  425. X
  426. Xprolo: prolo.c rolo.o compat.o getopt.o
  427. X    $(LINK.c) -o prolo prolo.c rolo.o compat.o getopt.o
  428. X
  429. Xcrolo: crolo.c rolo.o roloc.o compat.o arrows.o getopt.o
  430. X    $(LINK.c) -o crolo crolo.c rolo.o roloc.o compat.o arrows.o getopt.o $(TERMLIBS)
  431. X
  432. XMRolo.ad.h: MRolo.ad
  433. X    ./ad2c MRolo.ad > MRolo.ad.h
  434. X
  435. Xmrolo.o: MRolo.ad.h
  436. X
  437. X
  438. Xinstall: all
  439. X    cp mrolo $(BINDIR)
  440. X    cp prolo $(BINDIR)
  441. X    cp xr2mr $(BINDIR)
  442. X    chmod +x $(BINDIR)/xr2mr
  443. X    cp MRolo.ad $(APPDIR)/MRolo
  444. X
  445. Xinstall.man:
  446. X    cp mrolo.man $(MANDIR)/mrolo.$(MANEXT)
  447. X    cp prolo.man $(MANDIR)/prolo.$(MANEXT)
  448. X    cp xr2mr.man $(MANDIR)/xr2mr.$(MANEXT)
  449. X
  450. Xclean:
  451. X    $(RM) *.o prolo mrolo crolo rolo.samp- xdef *~
  452. END_OF_FILE
  453. if test 1854 -ne `wc -c <'mrolo13/Makefile.std'`; then
  454.     echo shar: \"'mrolo13/Makefile.std'\" unpacked with wrong size!
  455. fi
  456. # end of 'mrolo13/Makefile.std'
  457. fi
  458. if test -f 'mrolo13/README' -a "${1}" != "-c" ; then 
  459.   echo shar: Will not clobber existing file \"'mrolo13/README'\"
  460. else
  461. echo shar: Extracting \"'mrolo13/README'\" \(3912 characters\)
  462. sed "s/^X//" >'mrolo13/README' <<'END_OF_FILE'
  463. X*Rolo is a set of card file database programs designed to be
  464. Xsimple yet robust, and was born out of frustration with
  465. Xxrolo's and xrolodex's many menus.  The main program is
  466. Xmrolo, the Motif based card file program, and there is also
  467. Xcrolo, the curses based equivalent.
  468. X
  469. XSome features of mrolo/crolo:
  470. X
  471. X  o From the main screen you see a list of all cards and
  472. X    may scroll through them viewing/editing cards as desired.
  473. X
  474. X  o You may jump to a section of the card file by clicking on
  475. X    a lettered tab on the edge of the screen (A-Z) [mrolo] or
  476. X    typing the upper-case letter [crolo].
  477. X
  478. X  o You can search cards quickly by simply entering text
  479. X    in a text field on the main screen.  (You can easily
  480. X    do a regular expression search, if you want, just
  481. X    start the text with a slash.)
  482. X
  483. X  o There are no explicit save/load operations, the current
  484. X    display reflects the disk file's contents and changes
  485. X    are verified and written at the time of the change.
  486. X
  487. XNew in this release:
  488. X
  489. X  o Regular expression matching.
  490. X  o crolo, curses-based for dial-in use
  491. X  o Internationalization (see mrolo*indexElements resource).
  492. X  o Handles X parameters (like -iconic) correctly.
  493. X  o Windows behave better (they all iconify together, etc).
  494. X  o AS OF feature, keeps track of when a card was last updated.
  495. X  o Optionally constrain the filter to certain fields.
  496. X  o Various bug fixes, lots of clean-up, more portability.
  497. X
  498. XThe programs use a disk format identical to xrolo, so if you
  499. Xuse that it should be an easy switch.  See the manpages for
  500. Xlots of details.
  501. X
  502. XThis software was developed on a Sun4 running SunOS 4.1.1.  It
  503. Xshould run on other systems, but it is not tested.  I'm
  504. Xespecially concerned about the portability of the regular
  505. Xexpression code, the curses code, and the time code.
  506. X
  507. XIf the curses code gives you trouble, just don't build crolo.
  508. XIf the time code gives you trouble, define the NO_TIME symbol
  509. X(i.e. -DNO_TIME) and the "as of:" option will be compiled out.
  510. X(Right now, if you put "as of:" at the beginning of the line
  511. Xin a card then *rolo will put the current date/time on that
  512. Xline whenever the card is changed.) If the regular expression
  513. Xcode gives you trouble, compile with the flag -DDONT_REGEXP.
  514. XAlso, contact me (gregor@kafka.saic.com) and I'll try to help
  515. Xmake it work on your system.
  516. X
  517. XThe package contains four programs:
  518. X
  519. X    mrolo - the Motif cardfile program
  520. X    crolo - the curses cardfile program
  521. X    prolo - a program to print the cardfile
  522. X    xr2mr - a script to convert xrolodex files to
  523. X                mrolo/xrolo format
  524. X
  525. XTo compile the programs do as follows:
  526. X
  527. X    xmkmf
  528. X    make
  529. X
  530. XIf you do not have xmkmf or imake, edit and use Makefile.std.
  531. XIf you have problems with compiling crolo, you might need to
  532. Xadjust the value of TERMLIBS.  (Some systems don't need
  533. X-ltermcap.)
  534. X
  535. XTo test it, you may want to uudecode and uncompress the file
  536. Xsample.Z.uu, which is a 100 entry pseudo-random sample
  537. Xfile.  (The option "-f sample" overrides the default
  538. X~/.rolo file.)
  539. X
  540. XOnce you're happy that the applications work install with:
  541. X
  542. X    make install
  543. X
  544. XTo install the man-pages:
  545. X
  546. X    make install.man
  547. X
  548. XPlease send bug reports, feedback, and suggestions to
  549. Xgregor@kafka.saic.com
  550. X
  551. XThanks to:
  552. X  Bill James and Kral Ferch, my in-house testers.
  553. X  David Koblas for AppDefault handling and new backup code.
  554. X  William Shubert for the new icon.
  555. X  Bruce Bowler for helping make it more VMS friendly.
  556. X  John Silva for helping make it more HP friendly.
  557. X  Brian Rice for helping make it more Ultrix friendly.
  558. X  The anonymous soul who wrote the arrows.c file, which I
  559. X     adapted for crolo.
  560. X  AT&T and Rich Salz and Jim for the PD getopt(3).
  561. X  Everyone who generously offered their suggestions.
  562. X
  563. XCopyright 1993 by gregg hanna.  Permission is granted to use,
  564. Xmodify, and distribute this program.  Basically do anything
  565. Xyou want with it, but if you want to use it or any part of it
  566. Xto make money you must get further permission from me.
  567. X
  568. END_OF_FILE
  569. if test 3912 -ne `wc -c <'mrolo13/README'`; then
  570.     echo shar: \"'mrolo13/README'\" unpacked with wrong size!
  571. fi
  572. # end of 'mrolo13/README'
  573. fi
  574. if test -f 'mrolo13/ad2c' -a "${1}" != "-c" ; then 
  575.   echo shar: Will not clobber existing file \"'mrolo13/ad2c'\"
  576. else
  577. echo shar: Extracting \"'mrolo13/ad2c'\" \(882 characters\)
  578. sed "s/^X//" >'mrolo13/ad2c' <<'END_OF_FILE'
  579. X#!/bin/sh
  580. X#
  581. X#    ad2c : Convert app-defaults file to C strings decls.
  582. X#
  583. X#    George Ferguson, ferguson@cs.rcohester.edu, 12 Nov 1990.
  584. X#    19 Mar 1991: gf
  585. X#        Made it self-contained.
  586. X#    6 Jan 1992: mycroft@gnu.ai.mit.edu (Charles Hannum)
  587. X#        Removed use of "-n" and ":read" label since Gnu and
  588. X#        IBM sed print pattern space on "n" command. Still works
  589. X#        with Sun sed, of course.
  590. X#    7 Jan 1992: matthew@sunpix.East.Sun.COM (Matthew Stier)
  591. X#        Escape quotes after escaping backslashes.
  592. X#    8 Jul 1992: Version 1.6
  593. X#
  594. X
  595. Xsed '
  596. X# remove comments
  597. X/^!/d
  598. X# remove blanks
  599. X/^$/d
  600. X# escape backslash
  601. Xs/\\/\\\\/g
  602. X# except the line continuation ones
  603. Xs/\\$//g
  604. X# escape quotes
  605. Xs/"/\\"/g
  606. X# add leading quote
  607. Xs/^/"/
  608. X#
  609. X: test
  610. X/\\$/b slash
  611. Xs/$/",/
  612. Xp
  613. Xd
  614. X#
  615. X: slash
  616. Xn
  617. X# just like "read" only does not add leading quote
  618. X/^!/d
  619. X/^$/d
  620. Xs/"/\\"/g
  621. Xs/\\\\/\\/g
  622. Xs/\\n/\\\\n/g
  623. Xs/\\t/\\\\t/g
  624. Xs/\\f/\\\\f/g
  625. Xs/\\b/\\\\b/g
  626. Xb test' "$@"
  627. END_OF_FILE
  628. if test 882 -ne `wc -c <'mrolo13/ad2c'`; then
  629.     echo shar: \"'mrolo13/ad2c'\" unpacked with wrong size!
  630. fi
  631. chmod +x 'mrolo13/ad2c'
  632. # end of 'mrolo13/ad2c'
  633. fi
  634. if test -f 'mrolo13/arrows.c' -a "${1}" != "-c" ; then 
  635.   echo shar: Will not clobber existing file \"'mrolo13/arrows.c'\"
  636. else
  637. echo shar: Extracting \"'mrolo13/arrows.c'\" \(3480 characters\)
  638. sed "s/^X//" >'mrolo13/arrows.c' <<'END_OF_FILE'
  639. X/*
  640. X * this program demonstates one way to handle arrow escape sequences using
  641. X * bsd curses.
  642. X *
  643. X *  to compile:  cc -o demo demo.c -lcurses -ltermcap
  644. X *            
  645. X */
  646. X
  647. X#include <curses.h>
  648. X#include "arrows.h"
  649. X
  650. X#include <stdio.h>
  651. X
  652. Xextern char *getenv();
  653. X
  654. X/* array to hold arrow escape sequences */
  655. Xchar     arrow_table[4][80];
  656. X
  657. X
  658. X/*
  659. X * get arrow terminal capabilities for terminal from termcap file
  660. X * curses uses the global variable ttytype to specify what it
  661. X * thinks your terminal type is
  662. X */
  663. Xget_arrow_info()
  664. X{
  665. X
  666. X    char buffer[1024];
  667. X    char *bp;
  668. X
  669. X    tgetent(buffer,ttytype);
  670. X
  671. X    bp = arrow_table[MY_KEY_RIGHT];
  672. X    tgetstr("kr",&bp);
  673. X
  674. X    bp = arrow_table[MY_KEY_LEFT];
  675. X    tgetstr("kl",&bp);
  676. X
  677. X    bp = arrow_table[MY_KEY_UP];
  678. X    tgetstr("ku",&bp);
  679. X
  680. X    bp = arrow_table[MY_KEY_DOWN];
  681. X    tgetstr("kd",&bp);
  682. X}
  683. X
  684. X
  685. X/*
  686. X * read in the escape sequence and compare it to what we got from
  687. X * termcap entry.
  688. X */
  689. Xdo_escape(c)
  690. X  int c;
  691. X{
  692. X    char buffer[8]; /* buffer to store entire escape sequence */
  693. X    int size;    /* length of the escape sequence */
  694. X    int  i;
  695. X
  696. X    /* we assume that all arrow sequences are the same length */
  697. X    /* so we will just get the size of one of them.           */
  698. X    size=strlen(arrow_table[MY_KEY_RIGHT]);
  699. X
  700. X    /* the first character was an escape */
  701. X    buffer[0]=ESCAPE;
  702. X
  703. X    /* read in the rest of the escape sequence */
  704. X    for(i=1;i<size;i++) {
  705. X
  706. X        buffer[i] = getch();
  707. X
  708. X        /* this hack takes care of vt100s which termcap specifies
  709. X         * as sending <esc>O[ABCD] but which sometimes send
  710. X         *  <esc>[[ABCD]
  711. X         */
  712. X        if(i == 1) 
  713. X            if((buffer[i] == '[') && (arrow_table[MY_KEY_RIGHT][1] == 'O'))
  714. X                buffer[i] = 'O';
  715. X
  716. X    }
  717. X
  718. X    /* add a null terminator to our escape sequence */
  719. X    buffer[size] = '\0';
  720. X
  721. X    /* compare what we read in to what termcap says */
  722. X    /* if we get a match, return the proper result  */
  723. X        if(!strcmp(buffer,arrow_table[MY_KEY_RIGHT]))
  724. X                return(MY_KEY_RIGHT);
  725. X        else if(!strcmp(buffer,arrow_table[MY_KEY_LEFT]))
  726. X                return(MY_KEY_LEFT);
  727. X        else if(!strcmp(buffer,arrow_table[MY_KEY_UP]))
  728. X                return(MY_KEY_UP);
  729. X        else if(!strcmp(buffer,arrow_table[MY_KEY_DOWN]))
  730. X                return(MY_KEY_DOWN);
  731. X        else
  732. X                return(ESCAPE);
  733. X}
  734. X
  735. X#if 0
  736. Xmain()
  737. X{
  738. X    WINDOW *screen;
  739. X    int    x = 5, y = 5,          /* location of our window */
  740. X        len = 30, width = 10;    /* dimensions of our window */
  741. X    char    c;
  742. X
  743. X    /* initialize curses and enter cbreak mode */
  744. X    initscr();
  745. X    noecho();
  746. X    crmode();
  747. X
  748. X
  749. X    /* read in our arrow termcap entries */
  750. X    get_arrow_info();
  751. X
  752. X
  753. X    /* create our window and display it */
  754. X    screen = newwin(width,len,y,x);
  755. X    waddstr(screen,"\n\n\n\n\tHELLO WORLD\n");
  756. X    box(screen,'+','-'); 
  757. X    wrefresh(screen);
  758. X
  759. X    /* read in characters and move window accordingly */
  760. X    while(c != 'x') {
  761. X        c = wgetch(screen);
  762. X        if ( c == ESCAPE ) {
  763. X            c = do_escape();
  764. X        }
  765. X        switch(c) {
  766. X            case MY_KEY_LEFT : if( x != 0 )
  767. X                        mvwin(screen,y,--x);
  768. X                    wrefresh(screen);
  769. X                    break;
  770. X            case MY_KEY_DOWN :    if( y+width < LINES)
  771. X                        mvwin(screen,++y,x);
  772. X                    wrefresh(screen);
  773. X                    break;
  774. X            case MY_KEY_UP :    if( y != 0 )
  775. X                        mvwin(screen,--y,x);
  776. X                    wrefresh(screen);
  777. X                    break;
  778. X            case MY_KEY_RIGHT :if( x+len < COLS)
  779. X                        mvwin(screen,y,++x);
  780. X                    wrefresh(screen);
  781. X                    break;
  782. X            case 'c' :    clear();
  783. X                    refresh();
  784. X                    touchwin(screen);
  785. X                    wrefresh(screen);
  786. X                    break;
  787. X        }
  788. X    }
  789. X
  790. X    /* you should always call endwin before you exit a curses programs */
  791. X    /* so that the terminal is restored to its original state */
  792. X    clear();
  793. X    refresh();
  794. X    endwin();
  795. X    exit(0);
  796. X}
  797. X#endif
  798. END_OF_FILE
  799. if test 3480 -ne `wc -c <'mrolo13/arrows.c'`; then
  800.     echo shar: \"'mrolo13/arrows.c'\" unpacked with wrong size!
  801. fi
  802. # end of 'mrolo13/arrows.c'
  803. fi
  804. if test -f 'mrolo13/arrows.h' -a "${1}" != "-c" ; then 
  805.   echo shar: Will not clobber existing file \"'mrolo13/arrows.h'\"
  806. else
  807. echo shar: Extracting \"'mrolo13/arrows.h'\" \(148 characters\)
  808. sed "s/^X//" >'mrolo13/arrows.h' <<'END_OF_FILE'
  809. X
  810. X#define ESCAPE         27
  811. X#define MY_KEY_RIGHT    0
  812. X#define MY_KEY_LEFT    1
  813. X#define MY_KEY_UP    2
  814. X#define MY_KEY_DOWN    3
  815. X
  816. Xint get_arrow_info();
  817. Xint do_escape();
  818. END_OF_FILE
  819. if test 148 -ne `wc -c <'mrolo13/arrows.h'`; then
  820.     echo shar: \"'mrolo13/arrows.h'\" unpacked with wrong size!
  821. fi
  822. # end of 'mrolo13/arrows.h'
  823. fi
  824. if test -f 'mrolo13/callback.c' -a "${1}" != "-c" ; then 
  825.   echo shar: Will not clobber existing file \"'mrolo13/callback.c'\"
  826. else
  827. echo shar: Extracting \"'mrolo13/callback.c'\" \(6043 characters\)
  828. sed "s/^X//" >'mrolo13/callback.c' <<'END_OF_FILE'
  829. X/* Copyright 1993 by gregg hanna */
  830. X/*
  831. X * Generated by the ICS builderXcessory (BX).
  832. X *
  833. X *
  834. X * Builder Xcessory 1.0.1.
  835. X *
  836. X */
  837. X#include <stdio.h>
  838. X#include <X11/Intrinsic.h>
  839. X#include <X11/Xos.h>
  840. X#include <Xm/Xm.h>
  841. X#include <Xm/Text.h>
  842. X#include <Xm/List.h>
  843. X#include <Xm/ToggleB.h>
  844. X#include <string.h>
  845. X#include "compat.h"
  846. X#include "roloP.h"
  847. X#include "rolo.h"
  848. X
  849. Xint DisplayedCard;
  850. Xint DialogForDelete = 0;
  851. X
  852. X#define IsUp XtIsManaged
  853. X#define UpDialog XtManageChild
  854. X#define DownDialog XtUnmanageChild
  855. X
  856. Xvoid SetDialogDelete()
  857. X{
  858. X  Arg args[1];
  859. X  XmString xmstr;
  860. X  extern Widget confirmDialog;
  861. X
  862. X  DialogForDelete = 1;
  863. X
  864. X  xmstr = XmStringCreateSimple("Delete this card?");
  865. X  XtSetArg(args[0],XmNmessageString,xmstr);
  866. X  XtSetValues(confirmDialog,args,1);
  867. X
  868. X  XmStringFree(xmstr);
  869. X}
  870. X
  871. Xvoid SetDialogUpdate()
  872. X{
  873. X  Arg args[2];
  874. X  XmString xmstr;
  875. X  extern Widget confirmDialog;
  876. X
  877. X  DialogForDelete = 0;
  878. X  
  879. X  xmstr = XmStringCreateSimple("Save changes to this card?");
  880. X  XtSetArg(args[0],XmNmessageString,xmstr);
  881. X  XtSetValues(confirmDialog,args,1);
  882. X
  883. X  XmStringFree(xmstr);
  884. X}
  885. X
  886. Xvoid PickChange(w,client,call)
  887. X     Widget w;
  888. X     caddr_t client, call;
  889. X{
  890. X  Boolean v;
  891. X  int n;
  892. X  XmToggleButtonCallbackStruct *event = (XmToggleButtonCallbackStruct*)call;
  893. X
  894. X  n = (int)client;
  895. X  if ( n >= 0 && n < 4 ) {
  896. X    if ( event->set ) RoloSearch[n] = 1;
  897. X    else RoloSearch[n] = 0;
  898. X  }
  899. X}
  900. X
  901. Xvoid ManageArgAtClick(w,client,call)
  902. X     Widget w;
  903. X     caddr_t client, call;
  904. X{
  905. X  extern Widget picker;
  906. X  XmToggleButtonCallbackStruct *event = (XmToggleButtonCallbackStruct*)call;
  907. X  Widget wi = (Widget)client;
  908. X  XButtonEvent *bevent;
  909. X  Position x, y;
  910. X
  911. X  UpDialog(picker);
  912. X}
  913. X
  914. Xvoid PickDone(w,client,call)
  915. X     Widget w;
  916. X     caddr_t client, call;
  917. X{
  918. X  Widget dialog;
  919. X
  920. X  dialog = (Widget)client;
  921. X  DownDialog(dialog);
  922. X}
  923. X
  924. Xvoid
  925. XActuallyDeleteCard(w, client, call)
  926. XWidget w;
  927. Xcaddr_t client;
  928. Xcaddr_t call;
  929. X{
  930. X  extern Widget cardForm, confirmDialog, ListForRolo;
  931. X  void OKCard();
  932. X  Arg arg[1];
  933. X  int n;
  934. X
  935. X  DeleteRoloCard(DisplayedCard);
  936. X  if ( DialogForDelete ) { /* The dialog was a delete dialog */
  937. X    XmListDeletePos(ListForRolo,DisplayedCard+1);
  938. X    WriteRolo();
  939. X  } else {  /* we were using the delete dialog as an update dialog */
  940. X    XtSetArg(arg[0],XmNtopItemPosition,&n);
  941. X    XtGetValues(ListForRolo,arg,1);
  942. X    DisplayedCard = -1;
  943. X    OKCard((Widget)NULL,(caddr_t)NULL,(caddr_t)NULL); /* will re-add this rec and update */
  944. X    XmListSetPos(ListForRolo,n);
  945. X  }
  946. X
  947. X  DownDialog(cardForm);
  948. X  DownDialog(confirmDialog);
  949. X}
  950. X
  951. X
  952. Xvoid
  953. XAddCard(w, client, call)
  954. XWidget w;
  955. Xcaddr_t client;
  956. Xcaddr_t call;
  957. X{
  958. X  extern Widget nameText, numberText, numberText2, commentText, cardForm, deleteCardButton;
  959. X  Arg args[1];
  960. X
  961. X  XmTextSetString(nameText,"");
  962. X  XmTextSetString(numberText,"");
  963. X  XmTextSetString(numberText2,"");
  964. X  XmTextSetString(commentText,"");
  965. X
  966. X  XtSetArg(args[0],XmNsensitive,False);
  967. X  XtSetValues(deleteCardButton,args,1);
  968. X
  969. X  DisplayedCard = -1;
  970. X  
  971. X  UpDialog(cardForm);
  972. X}
  973. X
  974. Xvoid
  975. XCancelCard(w, client, call)
  976. XWidget w;
  977. Xcaddr_t client;
  978. Xcaddr_t call;
  979. X{
  980. X  extern Widget cardForm, confirmDialog;
  981. X  DownDialog(cardForm);
  982. X  DownDialog(confirmDialog);
  983. X}
  984. X
  985. Xvoid
  986. XDeleteCard(w, client, call)
  987. XWidget w;
  988. Xcaddr_t client;
  989. Xcaddr_t call;
  990. X{
  991. X  extern Widget confirmDialog;
  992. X  SetDialogDelete();
  993. X  if ( IsUp(confirmDialog) ) DownDialog(confirmDialog);
  994. X  UpDialog(confirmDialog);
  995. X}
  996. X
  997. Xvoid
  998. XDontDeleteCard(w, client, call)
  999. XWidget w;
  1000. Xcaddr_t client;
  1001. Xcaddr_t call;
  1002. X{
  1003. X  extern Widget confirmDialog;
  1004. X  DownDialog(confirmDialog);
  1005. X}
  1006. X
  1007. Xvoid
  1008. XOKCard(w, client, call)
  1009. XWidget w;
  1010. Xcaddr_t client;
  1011. Xcaddr_t call;
  1012. X{
  1013. X  extern Widget nameText, numberText, numberText2, commentText, confirmDialog;
  1014. X  extern Widget cardForm, ListForRolo;
  1015. X  char *a, *b, *c, *d;
  1016. X  int same;
  1017. X
  1018. X  a = XmTextGetString(nameText);
  1019. X  b = XmTextGetString(numberText);
  1020. X  c = XmTextGetString(commentText);
  1021. X  d = XmTextGetString(numberText2);
  1022. X
  1023. X  if ( DisplayedCard < 0 ) {
  1024. X    MakeNewRolo(a,b,d,c,1);
  1025. X    WriteRolo();
  1026. X    PutListOnScreen();
  1027. X    DownDialog(cardForm);
  1028. X    XmListSetPos(ListForRolo,GetIndex(a)+1);
  1029. X  } else {
  1030. X    same = ( strcmp(a,GetCardName(DisplayedCard)) == 0 ) &&
  1031. X           ( strcmp(b,GetNumber(DisplayedCard)) == 0 ) &&
  1032. X           ( strcmp(d,GetNumber2(DisplayedCard)) == 0 ) &&
  1033. X           ( strcmp(c,GetText(DisplayedCard)) == 0 );
  1034. X    if ( ! same ) {
  1035. X      SetDialogUpdate();
  1036. X      if ( IsUp(confirmDialog) ) DownDialog(confirmDialog);
  1037. X      UpDialog(confirmDialog);
  1038. X    } else {
  1039. X      DownDialog(cardForm);
  1040. X    }
  1041. X  }
  1042. X  if (a!=NULL) free(a);
  1043. X  if (b!=NULL) free(b);
  1044. X  if (c!=NULL) free(c);
  1045. X  if (d!=NULL) free(d);
  1046. X}
  1047. X
  1048. Xvoid
  1049. XQuitProg(w, client, call)
  1050. XWidget w;
  1051. Xcaddr_t client;
  1052. Xcaddr_t call;
  1053. X{
  1054. X  (void)exit(0);
  1055. X}
  1056. X
  1057. Xvoid
  1058. XSelected(w, client, call)
  1059. XWidget w;
  1060. Xcaddr_t client;
  1061. Xcaddr_t call;
  1062. X{
  1063. X  XmListCallbackStruct *list=(XmListCallbackStruct*)call;
  1064. X  extern Widget nameText, numberText, numberText2, commentText, cardForm, deleteCardButton;
  1065. X  extern Widget filterText;
  1066. X  Arg args[1];
  1067. X  char *s;
  1068. X  int n;
  1069. X
  1070. X  n = list->item_position - 1;
  1071. X  if ( n < 0 ) return;
  1072. X
  1073. X  XmProcessTraversal(filterText,XmTRAVERSE_CURRENT);
  1074. X
  1075. X  s = GetCardName(n);
  1076. X  XmTextSetString(nameText,s);
  1077. X  s = GetNumber(n);
  1078. X  XmTextSetString(numberText,s);
  1079. X  s = GetNumber2(n);
  1080. X  XmTextSetString(numberText2,s);
  1081. X  s = GetText(n);
  1082. X  XmTextSetString(commentText,s);
  1083. X
  1084. X  XtSetArg(args[0],XmNsensitive,True);
  1085. X  XtSetValues(deleteCardButton,args,1);
  1086. X
  1087. X  DisplayedCard = n;
  1088. X  
  1089. X  UpDialog(cardForm);
  1090. X}
  1091. X
  1092. Xvoid
  1093. XSpinRolo(w, client, call)
  1094. XWidget w;
  1095. Xcaddr_t client;
  1096. Xcaddr_t call;
  1097. X{
  1098. X  extern Widget ListForRolo;
  1099. X  int n;
  1100. X
  1101. X  n = GetIndex((char*)client);
  1102. X  XmListSetPos(ListForRolo,n+1);
  1103. X}
  1104. X
  1105. X
  1106. Xvoid ChangeFilter(w, client, call)
  1107. X     Widget w;
  1108. X     caddr_t client;
  1109. X     caddr_t call;
  1110. X{
  1111. X  char *s;
  1112. X  
  1113. X  s = XmTextGetString(w);
  1114. X  RoloFilter(s);
  1115. X  PutListOnScreen();
  1116. X}
  1117. X
  1118. Xvoid ClearFilter(w, client, call)
  1119. X     Widget w;
  1120. X     caddr_t client;
  1121. X     caddr_t call;
  1122. X{
  1123. X  extern Widget filterText;
  1124. X
  1125. X  XmTextSetString(filterText,"");
  1126. X  RoloFilter((char*)NULL);
  1127. X  PutListOnScreen();
  1128. X}
  1129. X
  1130. Xvoid ReturnHit(w, client, call)
  1131. X     Widget w;
  1132. X     caddr_t client;
  1133. X     caddr_t call;
  1134. X{
  1135. X  XmProcessTraversal(w,XmTRAVERSE_NEXT_TAB_GROUP);
  1136. X}
  1137. X
  1138. END_OF_FILE
  1139. if test 6043 -ne `wc -c <'mrolo13/callback.c'`; then
  1140.     echo shar: \"'mrolo13/callback.c'\" unpacked with wrong size!
  1141. fi
  1142. # end of 'mrolo13/callback.c'
  1143. fi
  1144. if test -f 'mrolo13/compat.c' -a "${1}" != "-c" ; then 
  1145.   echo shar: Will not clobber existing file \"'mrolo13/compat.c'\"
  1146. else
  1147. echo shar: Extracting \"'mrolo13/compat.c'\" \(1502 characters\)
  1148. sed "s/^X//" >'mrolo13/compat.c' <<'END_OF_FILE'
  1149. X#ifndef NO_COMPAT
  1150. X
  1151. X#include <ctype.h>
  1152. X
  1153. X/* strcmp, case insensitive */
  1154. Xint mystrcasecmp(a,b)
  1155. X     char *a, *b;
  1156. X{
  1157. X  int rval;
  1158. X  for ( rval = 0; *a != '\0' && *b != '\0' && rval == 0; a++, b++ ) {
  1159. X    rval = *a - *b;
  1160. X    if ( rval != 0 )
  1161. X      if ( isupper(*a) && islower(*b) )
  1162. X        rval = *a - toupper(*b);
  1163. X      else if ( islower(*a) && isupper(*b) )
  1164. X        rval = toupper(*a) - *b;
  1165. X  }
  1166. X  return rval;
  1167. X}
  1168. X
  1169. Xint mystrncasecmp(a,b,n)
  1170. X     char *a, *b;
  1171. X     int n;
  1172. X{
  1173. X  int rval, i;
  1174. X
  1175. X  for ( i = 0, rval = 0; i < n && *a != '\0' && *b != '\0' && rval == 0; a++, b++, i++ ) {
  1176. X    rval = *a - *b;
  1177. X    if ( rval != 0 )
  1178. X      if ( isupper(*a) && islower(*b) )
  1179. X        rval = *a - toupper(*b);
  1180. X      else if ( islower(*a) && isupper(*b) )
  1181. X        rval = toupper(*a) - *b;
  1182. X  }
  1183. X  if ( i < n && *a == '\0' ) rval = -1;
  1184. X  return rval;
  1185. X}
  1186. X
  1187. Xchar *mystrcpy(t,s)
  1188. X    char *t, *s;
  1189. X{
  1190. X  char *a;
  1191. X
  1192. X  a = t;
  1193. X  for ( ; *s != '\0'; s++, t++ ) *t = *s;
  1194. X  *t = '\0';
  1195. X  return a;
  1196. X}
  1197. X
  1198. Xchar *mystrdup(s)
  1199. X  char *s;
  1200. X{
  1201. X  char *t;
  1202. X
  1203. X  if ( s == (char*)0 ) return (char*)0;
  1204. X  t = (char*)malloc(strlen(s)+1);
  1205. X  if ( t == (char*)0 ) return (char*)0;
  1206. X  mystrcpy(t,s);
  1207. X  return t;
  1208. X}
  1209. X
  1210. X#endif
  1211. X
  1212. Xchar *mystrstrcase(t,s)
  1213. X     char *t, *s;
  1214. X{
  1215. X  int n;
  1216. X  char s1, s2;
  1217. X
  1218. X  n = strlen(s);
  1219. X  s1 = s[0];
  1220. X  if ( isupper(s1) ) s2 = tolower(s1);
  1221. X  else if ( islower(s1) ) s2 = toupper(s1);
  1222. X  else s2 = s1;
  1223. X  for (; *t != '\0'; t++ ) {
  1224. X    if ( *t == s1 || *t == s2 )
  1225. X      if ( mystrncasecmp(t,s,n) == 0 ) {
  1226. X        return t;
  1227. X      }
  1228. X  }
  1229. X  return (char*)0;
  1230. X}
  1231. X
  1232. END_OF_FILE
  1233. if test 1502 -ne `wc -c <'mrolo13/compat.c'`; then
  1234.     echo shar: \"'mrolo13/compat.c'\" unpacked with wrong size!
  1235. fi
  1236. # end of 'mrolo13/compat.c'
  1237. fi
  1238. if test -f 'mrolo13/compat.h' -a "${1}" != "-c" ; then 
  1239.   echo shar: Will not clobber existing file \"'mrolo13/compat.h'\"
  1240. else
  1241. echo shar: Extracting \"'mrolo13/compat.h'\" \(250 characters\)
  1242. sed "s/^X//" >'mrolo13/compat.h' <<'END_OF_FILE'
  1243. X
  1244. Xchar *mystrstrcase();
  1245. X
  1246. X#ifndef NO_COMPAT
  1247. X
  1248. Xint mystrcasecmp();
  1249. Xint mystrncasecmp();
  1250. Xchar *mystrcpy();
  1251. Xchar *mystrdup();
  1252. X
  1253. X#else
  1254. X
  1255. X#define mystrcasecmp strcasecmp
  1256. X#define mystrncasecmp strncasecmp
  1257. X#define mystrcpy strcpy
  1258. X#define mystrdup strdup
  1259. X
  1260. X#endif
  1261. END_OF_FILE
  1262. if test 250 -ne `wc -c <'mrolo13/compat.h'`; then
  1263.     echo shar: \"'mrolo13/compat.h'\" unpacked with wrong size!
  1264. fi
  1265. # end of 'mrolo13/compat.h'
  1266. fi
  1267. if test -f 'mrolo13/crolo.man' -a "${1}" != "-c" ; then 
  1268.   echo shar: Will not clobber existing file \"'mrolo13/crolo.man'\"
  1269. else
  1270. echo shar: Extracting \"'mrolo13/crolo.man'\" \(3372 characters\)
  1271. sed "s/^X//" >'mrolo13/crolo.man' <<'END_OF_FILE'
  1272. X'\" t
  1273. X.TH crolo L "21 July 1993"
  1274. X.SH NAME
  1275. Xcrolo \- curses-based card file manager
  1276. X.SH SYNOPSIS
  1277. X.B crolo
  1278. X[
  1279. X.B -v
  1280. X] [
  1281. X.B -f filename
  1282. X]
  1283. X.SH DESCRIPTION
  1284. X.LP
  1285. X.I CRolo
  1286. Xis a program for maintaining a simple cardfile,
  1287. Xspecifically oriented for saving address-book
  1288. Xinformation.
  1289. X.LP
  1290. XThe default database file read is
  1291. X.IR $HOME/.rolo ,
  1292. Xalthough this can be overridden with the
  1293. X.B ROLODEX
  1294. Xenvironment variable or the
  1295. X.B -f
  1296. Xcommand-line argument.
  1297. XIf the file does not exist, it is created empty.
  1298. XThe database is stored in a format similar to that of the
  1299. X.I xrolo
  1300. Xprogram:  Blocks of text separated by lines containing just
  1301. Xa ctrl-L.
  1302. X.LP
  1303. XWhen invoked
  1304. X.I CRolo
  1305. Xwill present the user with a screen summarizing the database.
  1306. XThe user may scroll through the summary with the cursor keys,
  1307. Xup and down move the selection bar up and down, while left
  1308. Xand right move up or down a screenful.
  1309. XIf the cursor keys don't work correctly, or you are
  1310. Xused to the vi editor, the following controls work as well:
  1311. X.TS
  1312. Xtab(:), center;
  1313. Xc l.
  1314. X^F, ^D:move down a screen
  1315. X^B, ^U:move up a screen
  1316. Xj, +:move down a line
  1317. Xk, -:move up a line
  1318. X.TE
  1319. X.LP
  1320. XSelecting an individual entry (by hitting return)
  1321. Xwill display the full information in your default
  1322. Xeditor.  You may edit or just view this information.
  1323. X.LP
  1324. XHitting any capital letter will scroll your listing to
  1325. Xthose entries which start with that letter.
  1326. XCommands are entered by pressing the lower-case
  1327. Xletter which corresponds to the first letter of
  1328. Xthe command you want to execute.  The commands are:
  1329. X.IP "Add Card"
  1330. XStarts your editor with a blank card.  Fill in text
  1331. Xas desired then save the file, it will be added to your
  1332. Xcard file database.
  1333. X.IP "Delete Card"
  1334. XWill delete the currently selected card from your card
  1335. Xfile database, after confirming the deletion.
  1336. X.IP "Redraw"
  1337. XThis will redraw the whole screen.  Control-L does this
  1338. Xalso.
  1339. X.IP "Quit"
  1340. XExit the program.
  1341. X.IP "Clear Filter"
  1342. XEmpties the contents of the filter string, thus showing
  1343. Xall of the cards in the database.
  1344. X.IP "Filter"
  1345. XEnter a filter string and only cards which contain the
  1346. Xgiven string will be shown on the display.  If the first
  1347. Xletter of the string is a backslash the rest of the
  1348. Xfilter text will be interpreted as a regular expression,
  1349. Xotherwise it is matched as case-insensitive text.
  1350. X.LP
  1351. XThere are companion programs included in this package but
  1352. Xdocumented seperately.  They are:
  1353. X.IP "\fImrolo\fR"
  1354. XMotif-based card file database manager
  1355. X.IP "\fIprolo\fR"
  1356. Xprints card file databases in postscript
  1357. X.IP "\fIxr2mr\fR"
  1358. Xconverts xrolodex files to crolo format
  1359. X.SH OPTIONS
  1360. X.TP
  1361. X.B \-v
  1362. XDisplay the version number and show error messages.
  1363. X.TP
  1364. X.B \-f filename
  1365. XRun using the specified file as the default database.
  1366. X.SH FILES
  1367. X.TP 20
  1368. X.B ~/.rolo
  1369. XDefault database.
  1370. X.SH ENVIRONMENT
  1371. X.TP 20
  1372. XROLODEX
  1373. XDefault database, overrides ~/.rolo, but not the -f option.
  1374. X.SH "SEE ALSO"
  1375. X.PD
  1376. X.BR xr2mr (1),
  1377. X.BR mrolo (1),
  1378. X.BR prolo (1)
  1379. X.br
  1380. X.ne 5
  1381. X.SH BUGS
  1382. X.LP
  1383. XNone known.  Report bugs to gregor@kafka.saic.com
  1384. X.SH AUTHOR
  1385. X.nf
  1386. X.LP
  1387. Xgregg hanna (gregor@kafka.saic.com)
  1388. XScience Applications International Corporation
  1389. X10260 Campus Point Drive, MS C3
  1390. XSan Diego, California  92121
  1391. X.fi
  1392. X.LP
  1393. XCopyright 1993 by gregg hanna.  Permission is granted
  1394. Xto use, modify, and distribute this program.  Basically
  1395. Xdo anything you want with it, but if you want to use
  1396. Xit or any part of it to make money you must get further
  1397. Xpermission from me.
  1398. X
  1399. X
  1400. END_OF_FILE
  1401. if test 3372 -ne `wc -c <'mrolo13/crolo.man'`; then
  1402.     echo shar: \"'mrolo13/crolo.man'\" unpacked with wrong size!
  1403. fi
  1404. # end of 'mrolo13/crolo.man'
  1405. fi
  1406. if test -f 'mrolo13/getopt.c' -a "${1}" != "-c" ; then 
  1407.   echo shar: Will not clobber existing file \"'mrolo13/getopt.c'\"
  1408. else
  1409. echo shar: Extracting \"'mrolo13/getopt.c'\" \(1409 characters\)
  1410. sed "s/^X//" >'mrolo13/getopt.c' <<'END_OF_FILE'
  1411. X/*
  1412. X**  GETOPT PROGRAM AND LIBRARY ROUTINE
  1413. X**
  1414. X**  I wrote main() and AT&T wrote getopt() and we both put our efforts into
  1415. X**  the public domain via mod.sources.
  1416. X**    Rich $alz
  1417. X**    Mirror Systems
  1418. X**    (mirror!rs, rs@mirror.TMC.COM)
  1419. X**    August 10, 1986
  1420. X** 
  1421. X**  This is the public-domain AT&T getopt(3) code.  Hacked by Rich and by Jim.
  1422. X*/
  1423. X
  1424. X#include <stdio.h>
  1425. X#ifdef NO_X
  1426. X#include <strings.h>
  1427. X#else
  1428. X#include <X11/Xos.h>
  1429. X#endif
  1430. X
  1431. X#define ERR(_s, _c) { if (opterr) fprintf (stderr, "%s%s%c\n", argv[0], _s, _c);}
  1432. X
  1433. Xint    opterr = 1;
  1434. Xint    optind = 1;
  1435. Xint    optopt;
  1436. Xchar    *optarg;
  1437. X
  1438. Xint
  1439. Xgetopt(argc, argv, opts)
  1440. Xint    argc;
  1441. Xchar    **argv, *opts;
  1442. X{
  1443. X    static int sp = 1;
  1444. X    register int c;
  1445. X    register char *cp;
  1446. X
  1447. X    if(sp == 1)
  1448. X        if(optind >= argc ||
  1449. X           argv[optind][0] != '-' || argv[optind][1] == '\0')
  1450. X            return(EOF);
  1451. X        else if(strcmp(argv[optind], "--") == NULL) {
  1452. X            optind++;
  1453. X            return(EOF);
  1454. X        }
  1455. X    optopt = c = argv[optind][sp];
  1456. X    if(c == ':' || (cp=index(opts, c)) == NULL) {
  1457. X        ERR(": illegal option -- ", c);
  1458. X        if(argv[optind][++sp] == '\0') {
  1459. X            optind++;
  1460. X            sp = 1;
  1461. X        }
  1462. X        return('?');
  1463. X    }
  1464. X    if(*++cp == ':') {
  1465. X        if(argv[optind][sp+1] != '\0')
  1466. X            optarg = &argv[optind++][sp+1];
  1467. X        else if(++optind >= argc) {
  1468. X            ERR(": option requires an argument -- ", c);
  1469. X            sp = 1;
  1470. X            return('?');
  1471. X        } else
  1472. X            optarg = argv[optind++];
  1473. X        sp = 1;
  1474. X    } else {
  1475. X        if(argv[optind][++sp] == '\0') {
  1476. X            sp = 1;
  1477. X            optind++;
  1478. X        }
  1479. X        optarg = NULL;
  1480. X    }
  1481. X    return(c);
  1482. X}
  1483. END_OF_FILE
  1484. if test 1409 -ne `wc -c <'mrolo13/getopt.c'`; then
  1485.     echo shar: \"'mrolo13/getopt.c'\" unpacked with wrong size!
  1486. fi
  1487. # end of 'mrolo13/getopt.c'
  1488. fi
  1489. if test -f 'mrolo13/mrolo.bm' -a "${1}" != "-c" ; then 
  1490.   echo shar: Will not clobber existing file \"'mrolo13/mrolo.bm'\"
  1491. else
  1492. echo shar: Extracting \"'mrolo13/mrolo.bm'\" \(1659 characters\)
  1493. sed "s/^X//" >'mrolo13/mrolo.bm' <<'END_OF_FILE'
  1494. X#define mrolo_width 50
  1495. X#define mrolo_height 44
  1496. Xstatic char mrolo_bits[] = {
  1497. X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1498. X 0x00,0x00,0x00,0xf0,0x1f,0x00,0x00,0x00,0x00,0x00,0x08,0x20,0x00,0x00,0x00,
  1499. X 0x00,0x00,0x88,0x22,0x00,0x00,0x00,0x00,0x00,0x48,0x25,0x00,0xe0,0xff,0xff,
  1500. X 0xff,0x0f,0x20,0x00,0x10,0x00,0x00,0x00,0x00,0x20,0x00,0x10,0x00,0x00,0x00,
  1501. X 0x00,0x20,0x00,0x10,0x00,0x3e,0x80,0x03,0x20,0x00,0x10,0x00,0x66,0x00,0x03,
  1502. X 0x20,0x00,0x10,0x00,0x66,0x00,0x03,0x20,0x00,0x10,0x00,0x66,0x00,0x03,0x20,
  1503. X 0x00,0x90,0x3f,0x66,0x3e,0xf3,0x21,0x00,0x90,0x6d,0x3e,0x63,0x1b,0x23,0x00,
  1504. X 0x90,0x6d,0x66,0x63,0x1b,0x23,0x00,0x90,0x6d,0x66,0x63,0x1b,0x23,0x00,0x90,
  1505. X 0x6d,0x66,0x63,0x1b,0x23,0x00,0x90,0x6d,0x66,0x36,0xb3,0x21,0x00,0x90,0x6d,
  1506. X 0xc6,0x9c,0xe7,0x20,0x00,0x10,0x00,0x00,0x00,0x00,0x20,0x00,0x1c,0x00,0x00,
  1507. X 0x00,0x00,0xe0,0x00,0x1c,0x10,0x00,0x00,0x20,0xe0,0x00,0x1c,0x28,0x00,0x00,
  1508. X 0x50,0xe0,0x00,0x1c,0x10,0x00,0x00,0x20,0xe0,0x00,0xfc,0xff,0xff,0xff,0xff,
  1509. X 0xff,0x00,0xbc,0xff,0xff,0xff,0xff,0xf7,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
  1510. X 0x00,0x1c,0x10,0x00,0x00,0x20,0xe0,0x00,0x1c,0x28,0x00,0x00,0x50,0xe0,0x00,
  1511. X 0x1c,0x10,0x00,0x00,0x20,0xe0,0x00,0x1c,0x00,0x00,0x00,0x00,0xe0,0x00,0x10,
  1512. X 0x00,0x00,0x00,0x00,0x20,0x00,0x10,0x00,0x00,0x00,0x00,0x20,0x00,0x30,0x00,
  1513. X 0x00,0x00,0x00,0x20,0x00,0xd0,0xff,0xff,0xff,0x07,0x20,0x00,0x30,0x00,0x00,
  1514. X 0x00,0x08,0x20,0x00,0xd0,0xff,0xff,0xff,0xf7,0x3f,0x00,0x20,0x00,0x00,0x00,
  1515. X 0x08,0x20,0x00,0xc0,0xff,0xff,0xff,0xf7,0x3f,0x00,0x00,0x00,0x00,0x00,0x08,
  1516. X 0x20,0x00,0x00,0x00,0x00,0x00,0xf0,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  1517. X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
  1518. END_OF_FILE
  1519. if test 1659 -ne `wc -c <'mrolo13/mrolo.bm'`; then
  1520.     echo shar: \"'mrolo13/mrolo.bm'\" unpacked with wrong size!
  1521. fi
  1522. # end of 'mrolo13/mrolo.bm'
  1523. fi
  1524. if test -f 'mrolo13/mrolo.c' -a "${1}" != "-c" ; then 
  1525.   echo shar: Will not clobber existing file \"'mrolo13/mrolo.c'\"
  1526. else
  1527. echo shar: Extracting \"'mrolo13/mrolo.c'\" \(3438 characters\)
  1528. sed "s/^X//" >'mrolo13/mrolo.c' <<'END_OF_FILE'
  1529. X/* Copyright 1993 by gregg hanna */
  1530. X/*
  1531. X * Generated by the ICS builderXcessory (BX).
  1532. X *
  1533. X *
  1534. X * Builder Xcessory 1.0.1.
  1535. X *
  1536. X */
  1537. X/*
  1538. X * REQUIRED MOTIF INCLUDE FILES
  1539. X */
  1540. X#include <Xm/Xm.h>
  1541. X#include <X11/Shell.h>
  1542. X#include <Xm/DialogS.h>
  1543. X#include <X11/StringDefs.h>
  1544. X#include <stdio.h>
  1545. X
  1546. X/* GLOBAL WIDGET VARIABLES */
  1547. XWidget Shell000;
  1548. XWidget Form;
  1549. XWidget Createform();
  1550. XWidget cardForm;
  1551. XWidget confirmDialog;
  1552. XWidget CreateMessageDialog();
  1553. XWidget CreateFormDialog();
  1554. XWidget CreatePicker();
  1555. X
  1556. Xvoid dumpcore(){char *s; s = 0; *s = 'x'; }
  1557. X
  1558. X#include "roloP.h"
  1559. X#include "rolo.h"
  1560. X#include "mrolo.bm"
  1561. X#include "compat.h"
  1562. X
  1563. Xtypedef struct {
  1564. X  String  indexElements;
  1565. X  Boolean showSecondary;
  1566. X  int     sizePrimary;
  1567. X  Boolean selectFilter;
  1568. X} mroloAppResources, *mroloAppResourcesP;
  1569. X
  1570. X#define MOffset(x) XtOffset(mroloAppResourcesP, x)
  1571. X
  1572. Xstatic XtResource resources[] = {
  1573. X  {"indexElements", "IndexElements", XtRString, sizeof(String),
  1574. X     MOffset(indexElements), XtRString, "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"},
  1575. X  {"showSecondary", "ShowSecondary", XtRBoolean, sizeof(Boolean),
  1576. X     MOffset(showSecondary), XtRImmediate, (XtPointer) True},
  1577. X  {"sizePrimary", "SizePrimary", XtRInt, sizeof(int),
  1578. X     MOffset(sizePrimary), XtRImmediate, (XtPointer) 20},
  1579. X  {"selectFilter", "SelectFilter", XtRBoolean, sizeof(Boolean),
  1580. X     MOffset(selectFilter), XtRImmediate, (XtPointer) False},
  1581. X};
  1582. X
  1583. Xstatic char *appDefaults[] = {
  1584. X#include "MRolo.ad.h"
  1585. X      NULL
  1586. X};
  1587. X
  1588. XBoolean showSecondary;
  1589. Xint sizePrimary;
  1590. XString indexElements;
  1591. X
  1592. Xvoid SetResources(w)
  1593. X   Widget  w;
  1594. X{
  1595. X  mroloAppResources appResources;
  1596. X  XtGetApplicationResources(w, (XtPointer) &appResources,
  1597. X                resources, XtNumber(resources), NULL, 0);
  1598. X  showSecondary = appResources.showSecondary;
  1599. X  sizePrimary = appResources.sizePrimary;
  1600. X  indexElements = mystrdup(appResources.indexElements);
  1601. X  if ( ! selectFilter )
  1602. X    selectFilter = (int)appResources.selectFilter;
  1603. X}
  1604. X
  1605. Xvoid SetIcon(w)
  1606. X    Widget w;
  1607. X{
  1608. X  Pixmap p;
  1609. X  Arg arg[1];
  1610. X
  1611. X  p = XCreateBitmapFromData(XtDisplay(w),XtWindow(w),mrolo_bits,mrolo_width,mrolo_height);
  1612. X  XtSetArg(arg[0],XmNiconPixmap,p);
  1613. X  XtSetValues(w,arg,1);
  1614. X}
  1615. X
  1616. X#define APP_NAME argv[0]
  1617. X
  1618. X/* Tweeks the size of a widget to make old ScrolledLists work right */
  1619. Xvoid DoResize()
  1620. X{
  1621. X  Dimension width, height, bwidth;
  1622. X
  1623. X  XtVaGetValues(Shell000,XmNwidth,&width,XmNheight,&height,XmNborderWidth,&bwidth,NULL);
  1624. X  XtResizeWidget(Shell000,width,height-1,bwidth);
  1625. X  XtResizeWidget(Shell000,width,height,bwidth);
  1626. X}
  1627. X
  1628. X/* MAIN PROGRAM */
  1629. Xmain(argc, argv)
  1630. Xint argc;
  1631. Xchar **argv;
  1632. X{
  1633. X    Arg     args[256];
  1634. X    int     argcnt;
  1635. X    XtAppContext context;
  1636. X    extern Widget filterText;
  1637. X    extern Widget picker;
  1638. X
  1639. X    XmRegisterConverters();
  1640. X    argcnt = 0;
  1641. X    XtSetArg(args[argcnt], XmNtitle, "Rolodex"); argcnt++;
  1642. X    Shell000 = XtAppInitialize(&context,APP_NAME,NULL,0,(Cardinal*)&argc,argv,
  1643. X                   appDefaults,args,argcnt);
  1644. X    SetResources(Shell000);
  1645. X
  1646. X    InitRolo(argc,argv,1);
  1647. X    SetupRolo();
  1648. X
  1649. X    Form = Createform(Shell000);
  1650. X    XtManageChild(Form);
  1651. X
  1652. X    cardForm = CreateFormDialog(Shell000);
  1653. X    confirmDialog = CreateMessageDialog(Shell000);
  1654. X
  1655. X    if ( selectFilter )
  1656. X      picker = CreatePicker(Shell000);
  1657. X
  1658. X    XtRealizeWidget(Shell000);
  1659. X
  1660. X    SetIcon(Shell000);
  1661. X    PutListOnScreen();
  1662. X
  1663. X#ifdef WANT_CORE
  1664. X    XSetErrorHandler(dumpcore);
  1665. X#endif
  1666. X
  1667. X    XmProcessTraversal(filterText,XmTRAVERSE_CURRENT);
  1668. X
  1669. X    DoResize();  /* kludge for old ScrolledList */
  1670. X
  1671. X    XtAppMainLoop(context);
  1672. X
  1673. X    return 0;
  1674. X
  1675. X}
  1676. END_OF_FILE
  1677. if test 3438 -ne `wc -c <'mrolo13/mrolo.c'`; then
  1678.     echo shar: \"'mrolo13/mrolo.c'\" unpacked with wrong size!
  1679. fi
  1680. # end of 'mrolo13/mrolo.c'
  1681. fi
  1682. if test -f 'mrolo13/myregexp.h' -a "${1}" != "-c" ; then 
  1683.   echo shar: Will not clobber existing file \"'mrolo13/myregexp.h'\"
  1684. else
  1685. echo shar: Extracting \"'mrolo13/myregexp.h'\" \(848 characters\)
  1686. sed "s/^X//" >'mrolo13/myregexp.h' <<'END_OF_FILE'
  1687. X/* setup regular expression handling */
  1688. X
  1689. X#ifdef USE_RE_COMP
  1690. X
  1691. Xchar *re_comp();
  1692. Xint re_exec();
  1693. X#define re_free()
  1694. X
  1695. X#else
  1696. X#ifdef _POSIX_SOURCE
  1697. X
  1698. X#include <regex.h>
  1699. Xstatic regex_t local_re;
  1700. X#define re_comp(s)  (regcomp(&local_re,(s),REG_NOSUB|REG_ICASE),(char*)NULL)
  1701. X#define re_exec(s)  (regexec(&local_re,(s),(size_t)0,NULL,0)==NULL)
  1702. X#define re_free()  (regfree(&local_re))
  1703. X
  1704. X#else
  1705. X#ifdef NO_REGEX
  1706. X
  1707. X#ifndef DONT_REGEX
  1708. X#define DONT_REGEX
  1709. X#endif
  1710. X
  1711. X#else
  1712. X
  1713. X#define INIT   register char *sp = instring;
  1714. X#define GETC() (*sp++)
  1715. X#define PEEKC()     (*sp)
  1716. X#define UNGETC(c)   (--sp)
  1717. X#define RETURN(c)   return;
  1718. X#define ERROR(c)    if(verbose)fprintf(stderr,"regexp compile error %d\n",(c));
  1719. X#define re_comp(s)  (char*)(compile((s),expbuf,&expbuf[EXPSIZE],'\0'),NULL)
  1720. X#define re_exec(s)  step((s),expbuf)
  1721. X#define re_free()
  1722. X#include <regexp.h>
  1723. X
  1724. X#endif
  1725. X#endif
  1726. X#endif
  1727. END_OF_FILE
  1728. if test 848 -ne `wc -c <'mrolo13/myregexp.h'`; then
  1729.     echo shar: \"'mrolo13/myregexp.h'\" unpacked with wrong size!
  1730. fi
  1731. # end of 'mrolo13/myregexp.h'
  1732. fi
  1733. if test -f 'mrolo13/patchlevel.h' -a "${1}" != "-c" ; then 
  1734.   echo shar: Will not clobber existing file \"'mrolo13/patchlevel.h'\"
  1735. else
  1736. echo shar: Extracting \"'mrolo13/patchlevel.h'\" \(21 characters\)
  1737. sed "s/^X//" >'mrolo13/patchlevel.h' <<'END_OF_FILE'
  1738. X#define PATCHLEVEL 0
  1739. END_OF_FILE
  1740. if test 21 -ne `wc -c <'mrolo13/patchlevel.h'`; then
  1741.     echo shar: \"'mrolo13/patchlevel.h'\" unpacked with wrong size!
  1742. fi
  1743. # end of 'mrolo13/patchlevel.h'
  1744. fi
  1745. if test -f 'mrolo13/prolo.man' -a "${1}" != "-c" ; then 
  1746.   echo shar: Will not clobber existing file \"'mrolo13/prolo.man'\"
  1747. else
  1748. echo shar: Extracting \"'mrolo13/prolo.man'\" \(3680 characters\)
  1749. sed "s/^X//" >'mrolo13/prolo.man' <<'END_OF_FILE'
  1750. X.TH prolo L "13 May 1993"
  1751. X.SH NAME
  1752. Xprolo \- card file database printer
  1753. X.SH SYNOPSIS
  1754. X.B prolo
  1755. X[
  1756. X.B \-cbeh
  1757. X] [
  1758. X.B \-F filtertext
  1759. X] [
  1760. X.B \-f rolofile
  1761. X] [
  1762. X.B \-s fontsize
  1763. X]
  1764. X.SH DESCRIPTION
  1765. X.LP
  1766. X.I PRolo
  1767. Xis a program for printing a simple cardfile,
  1768. Xgenerating PostScript output.
  1769. X.LP
  1770. XThe default database file read is
  1771. X.IR $HOME/.rolo ,
  1772. Xalthough this can be overridden with the
  1773. X.B ROLODEX
  1774. Xenvironment variable or the
  1775. X.B -f
  1776. Xcommand-line argument.
  1777. XIf the file does not exist, it is created empty.
  1778. XThe database is assumed to be in the format of
  1779. Xthe
  1780. X.I mrolo
  1781. Xor
  1782. X.I xrolo
  1783. Xprograms.
  1784. X.LP
  1785. XThe output will be a PostScript program.  Most of the options
  1786. Xset from the command line can also be set by editing this
  1787. Xprogram before printing.  The basic, unchangeable format
  1788. Xfor the individual records is:
  1789. X.nf
  1790. XFirst Line  Second Line  Third Line
  1791. X            Fourth Line
  1792. X            Fifth Line
  1793. X              .
  1794. X              .
  1795. X              .
  1796. X.fi
  1797. X.LP
  1798. XWhen used with
  1799. X.I mrolo
  1800. XThe first line is usually a name, the second the primary
  1801. Xphone number, the third the secondary phone number,
  1802. Xand others are descriptive text (address, other
  1803. Xnumbers, etc.).  The PostScript program will organize these
  1804. Xentries in columns and the columns into pages, if needed.
  1805. X.LP
  1806. XNote that lines are sized and spaced based on the largest
  1807. Xentries, so you might want to edit your cardfile to have
  1808. Xfairly consistent field lengths.  For example, if you use
  1809. Xthe secondary number to store a very long string or
  1810. Xhave one name which is particularly long then 
  1811. X.B all
  1812. Xof the
  1813. Xprinted entries will be very wide.
  1814. X.SH OPTIONS
  1815. X.TP
  1816. X.B \-c
  1817. XInclude card info, by default only name, primary and secondary
  1818. Xnumbers are printed.
  1819. X.TP
  1820. X.B \-b
  1821. XDraw a box around each entry.
  1822. X.TP
  1823. X.B \-e
  1824. XMake all entries the same size.  Each entry will take up
  1825. Xas much space as the largest entry, using more space
  1826. Xbut looking neat and tidy.  This only makes sense with
  1827. Xthe -c option.
  1828. X.TP
  1829. X.B \-F filertext
  1830. XOnly emit entries which contain
  1831. X.I filtertext
  1832. Xsomewhere in the entry.  This option cannot be changed
  1833. Xin the PostScript program, it must be specified on
  1834. Xthe command line.  If the filter text begins with a back-slash,
  1835. Xthe filter is interpreted as a regular expression.  Note that
  1836. Xthe shell treats back-slash as a special character, so you
  1837. Xmust quote it properly.
  1838. X.TP
  1839. X.B \-f filename
  1840. XRun using the specified file as the default database.
  1841. XThis option cannot be changed in the PostScript program,
  1842. Xit must be specified on the command line.
  1843. X.TP
  1844. X.B \-s fontsize
  1845. XThe font size used to print the entries.  The default is 5
  1846. X(small for pocket lists).
  1847. X
  1848. X.SH POSTSCRIPT OPTIONS
  1849. X.LP
  1850. XMost of the command-line options (the exceptions are noted above)
  1851. Xcan be changed and played with in the output file.  Each option
  1852. Xhas a corresponding variable set at the beginning of the PostScript,
  1853. Xthe following table describes the mappings:
  1854. X.TP
  1855. X.B -c
  1856. Xcardinfo
  1857. X.TP
  1858. X.B -b
  1859. Xboxmode
  1860. X.TP
  1861. X.B -e
  1862. Xequalbox
  1863. X.TP
  1864. X.B -s
  1865. Xfontsize
  1866. X
  1867. X.SH FILES
  1868. X.TP 20
  1869. X.B ~/.rolo
  1870. XDefault database.
  1871. X.SH ENVIRONMENT
  1872. X.TP 20
  1873. XROLODEX
  1874. XDefault database, overrides ~/.rolo, but not the -f option.
  1875. X.SH "SEE ALSO"
  1876. X.PD
  1877. X.BR xrolo (1),
  1878. X.BR mrolo (1)
  1879. X.br
  1880. X.ne 5
  1881. X.SH BUGS
  1882. X.LP
  1883. XThis program makes assumptions about the size of the
  1884. Xoutput paper.  It was developed for 8.5x11 paper, your milage
  1885. Xmay vary.
  1886. X.LP
  1887. XReport bugs to gregor@kafka.saic.com
  1888. X.SH AUTHOR
  1889. X.nf
  1890. X.LP
  1891. Xgregg hanna (gregor@kafka.saic.com)
  1892. XScience Applications International Corporation
  1893. X10260 Campus Point Drive, MS C3
  1894. XSan Diego, California  92121
  1895. X.fi
  1896. X.LP
  1897. XCopyright 1993 by gregg hanna.  Permission is granted
  1898. Xto use, modify, and distribute this program.  Basically
  1899. Xdo anything you want with it, but if you want to use
  1900. Xit or any part of it to make money you must get further
  1901. Xpermission from me.
  1902. X
  1903. X
  1904. END_OF_FILE
  1905. if test 3680 -ne `wc -c <'mrolo13/prolo.man'`; then
  1906.     echo shar: \"'mrolo13/prolo.man'\" unpacked with wrong size!
  1907. fi
  1908. # end of 'mrolo13/prolo.man'
  1909. fi
  1910. if test -f 'mrolo13/rolo.h' -a "${1}" != "-c" ; then 
  1911.   echo shar: Will not clobber existing file \"'mrolo13/rolo.h'\"
  1912. else
  1913. echo shar: Extracting \"'mrolo13/rolo.h'\" \(320 characters\)
  1914. sed "s/^X//" >'mrolo13/rolo.h' <<'END_OF_FILE'
  1915. X#ifndef _ROLO_H
  1916. X#define _ROLO_H
  1917. X
  1918. X#define VERSION_MAJOR 1
  1919. X#define VERSION_MINOR 3
  1920. X
  1921. Xint NumRoloOn();
  1922. Xvoid MakeNewRolo();
  1923. Xvoid InitRolo();
  1924. Xvoid SetupRolo();
  1925. Xvoid PutListOnScreen();
  1926. Xvoid DeleteRoloCard();
  1927. Xvoid WriteRolo();
  1928. Xchar *GetCardName();
  1929. Xchar *GetNumber();
  1930. Xchar *GetNumber2();
  1931. Xchar *GetText();
  1932. Xint GetIndex();
  1933. X
  1934. X#endif
  1935. END_OF_FILE
  1936. if test 320 -ne `wc -c <'mrolo13/rolo.h'`; then
  1937.     echo shar: \"'mrolo13/rolo.h'\" unpacked with wrong size!
  1938. fi
  1939. # end of 'mrolo13/rolo.h'
  1940. fi
  1941. if test -f 'mrolo13/roloP.h' -a "${1}" != "-c" ; then 
  1942.   echo shar: Will not clobber existing file \"'mrolo13/roloP.h'\"
  1943. else
  1944. echo shar: Extracting \"'mrolo13/roloP.h'\" \(297 characters\)
  1945. sed "s/^X//" >'mrolo13/roloP.h' <<'END_OF_FILE'
  1946. X#ifndef _ROLOP_H
  1947. X#define _ROLOP_H
  1948. X
  1949. Xtypedef struct _RoloRec {
  1950. X  char *name;
  1951. X  char *number;
  1952. X  char *number2;
  1953. X  char *text;
  1954. X  int on;
  1955. X  struct _RoloRec *next;
  1956. X} RoloRec;
  1957. X
  1958. X#define STRSIZE 100000
  1959. X
  1960. Xextern RoloRec *RoloList;
  1961. Xextern int RoloSearch[4];
  1962. Xextern int selectFilter;
  1963. X
  1964. XRoloRec *GetN();
  1965. X
  1966. X#endif
  1967. X
  1968. END_OF_FILE
  1969. if test 297 -ne `wc -c <'mrolo13/roloP.h'`; then
  1970.     echo shar: \"'mrolo13/roloP.h'\" unpacked with wrong size!
  1971. fi
  1972. # end of 'mrolo13/roloP.h'
  1973. fi
  1974. if test -f 'mrolo13/roloc.c' -a "${1}" != "-c" ; then 
  1975.   echo shar: Will not clobber existing file \"'mrolo13/roloc.c'\"
  1976. else
  1977. echo shar: Extracting \"'mrolo13/roloc.c'\" \(1219 characters\)
  1978. sed "s/^X//" >'mrolo13/roloc.c' <<'END_OF_FILE'
  1979. X/* Copyright 1993 by gregg hanna */
  1980. X#include <curses.h>
  1981. X#include "patchlevel.h"
  1982. X#include "rolo.h"
  1983. X#include "roloP.h"
  1984. X
  1985. Xextern WINDOW *listWin;
  1986. Xextern int top_of_screen, linec, linew, active_line;
  1987. X
  1988. Xstatic void formatstr(r,s,n)
  1989. X     RoloRec *r;
  1990. X     char *s;
  1991. X     int n;
  1992. X{
  1993. X  int i;
  1994. X  sprintf(s,"%-30s %s, %s",r->name,r->number,r->number2);
  1995. X  if ( strlen(s) < n )
  1996. X    for ( i = strlen(s); i < n; i++ )
  1997. X      s[i] = ' ';
  1998. X  s[n] = '\0';
  1999. X}
  2000. X
  2001. Xvoid PutLineOnScreen(ln)
  2002. X     int ln;
  2003. X{
  2004. X  RoloRec *rr;
  2005. X  char *buf, *s;
  2006. X  int n;
  2007. X
  2008. X  if ( top_of_screen < 0 ) top_of_screen = 0;
  2009. X  buf = (char*)malloc(500+linew);
  2010. X  wmove(listWin,ln-top_of_screen,0);
  2011. X  for ( n = 0, rr = RoloList; rr != NULL; rr = rr->next ) {
  2012. X    if ( rr->on ) {
  2013. X      if ( n == ln ) {
  2014. X#ifdef SYSV
  2015. X    formatstr(rr,buf,linew-1);
  2016. X    waddch(listWin,((n==active_line)?'>':' '));
  2017. X        waddstr(listWin,buf);
  2018. X#else
  2019. X    formatstr(rr,buf,linew);
  2020. X    if ( n != active_line ) waddstr(listWin,buf);
  2021. X    else for ( s = buf; *s != '\0'; s++ ) waddch(listWin,*s|_STANDOUT);
  2022. X#endif
  2023. X    break;
  2024. X      }
  2025. X      n++;
  2026. X    }
  2027. X  }
  2028. X  if ( rr == NULL ) wclrtoeol(listWin);
  2029. X  free(buf);
  2030. X}
  2031. X
  2032. Xvoid PutListOnScreen()
  2033. X{
  2034. X  int i;
  2035. X  for ( i = top_of_screen; i < top_of_screen + linec; i++ )
  2036. X    PutLineOnScreen(i);
  2037. X}
  2038. END_OF_FILE
  2039. if test 1219 -ne `wc -c <'mrolo13/roloc.c'`; then
  2040.     echo shar: \"'mrolo13/roloc.c'\" unpacked with wrong size!
  2041. fi
  2042. # end of 'mrolo13/roloc.c'
  2043. fi
  2044. if test -f 'mrolo13/rolox.c' -a "${1}" != "-c" ; then 
  2045.   echo shar: Will not clobber existing file \"'mrolo13/rolox.c'\"
  2046. else
  2047. echo shar: Extracting \"'mrolo13/rolox.c'\" \(1176 characters\)
  2048. sed "s/^X//" >'mrolo13/rolox.c' <<'END_OF_FILE'
  2049. X/* Copyright 1993 by gregg hanna */
  2050. X#include <stdio.h>
  2051. X#include <stdlib.h>
  2052. X#include <ctype.h>
  2053. X#include <X11/Xos.h>
  2054. X#include <Xm/Xm.h>
  2055. X#include <Xm/List.h>
  2056. X
  2057. X#include "patchlevel.h"
  2058. X#include "rolo.h"
  2059. X#include "roloP.h"
  2060. X
  2061. Xextern Boolean showSecondary;
  2062. Xextern int sizePrimary;
  2063. X
  2064. Xvoid PutListOnScreen()
  2065. X{
  2066. X  RoloRec *rr;
  2067. X  char buf[500];
  2068. X  int n, i;
  2069. X  extern Widget ListForRolo;
  2070. X  XmString *xmtable;
  2071. X
  2072. X  n = 0;
  2073. X  for ( rr = RoloList; rr != NULL; rr = rr->next )
  2074. X    if ( rr->on ) n++;
  2075. X
  2076. X  xmtable = (XmString*)calloc(n,sizeof(XmString));
  2077. X  for ( rr = RoloList, i = 0; rr != NULL; rr = rr->next )
  2078. X    if ( rr->on ) {
  2079. X      sprintf(buf,"%-30s",rr->name);
  2080. X      buf[30] = ' ';
  2081. X      if ( showSecondary ) {
  2082. X        sprintf(&buf[31],"%-*s",sizePrimary,rr->number);
  2083. X        buf[31+sizePrimary] = ' ';
  2084. X        mystrcpy(&buf[31+sizePrimary+1],rr->number2);
  2085. X      } else {
  2086. X        mystrcpy(&buf[31],rr->number);
  2087. X      }
  2088. X      xmtable[i] = XmStringCreateSimple(buf);
  2089. X      i++;
  2090. X    }
  2091. X  XtUnmapWidget(ListForRolo);
  2092. X  XmListDeleteAllItems(ListForRolo);
  2093. X  XmListAddItems(ListForRolo,xmtable,n,0);
  2094. X  XtMapWidget(ListForRolo);
  2095. X  for ( i = 0; i < n; i++ ) XmStringFree(xmtable[i]);
  2096. X  free(xmtable);
  2097. X}
  2098. X
  2099. END_OF_FILE
  2100. if test 1176 -ne `wc -c <'mrolo13/rolox.c'`; then
  2101.     echo shar: \"'mrolo13/rolox.c'\" unpacked with wrong size!
  2102. fi
  2103. # end of 'mrolo13/rolox.c'
  2104. fi
  2105. if test -f 'mrolo13/rolox.h' -a "${1}" != "-c" ; then 
  2106.   echo shar: Will not clobber existing file \"'mrolo13/rolox.h'\"
  2107. else
  2108. echo shar: Extracting \"'mrolo13/rolox.h'\" \(67 characters\)
  2109. sed "s/^X//" >'mrolo13/rolox.h' <<'END_OF_FILE'
  2110. X#ifndef _ROLOX_H
  2111. X#define _ROLOX_H
  2112. X
  2113. Xvoid PutListOnScreen();
  2114. X
  2115. X#endif
  2116. END_OF_FILE
  2117. if test 67 -ne `wc -c <'mrolo13/rolox.h'`; then
  2118.     echo shar: \"'mrolo13/rolox.h'\" unpacked with wrong size!
  2119. fi
  2120. # end of 'mrolo13/rolox.h'
  2121. fi
  2122. if test -f 'mrolo13/xr2mr' -a "${1}" != "-c" ; then 
  2123.   echo shar: Will not clobber existing file \"'mrolo13/xr2mr'\"
  2124. else
  2125. echo shar: Extracting \"'mrolo13/xr2mr'\" \(60 characters\)
  2126. sed "s/^X//" >'mrolo13/xr2mr' <<'END_OF_FILE'
  2127. X#!/bin/sh
  2128. Xsed '1,$s/^####$/\014/g' $1 | tail +2
  2129. Xecho "\014"
  2130. END_OF_FILE
  2131. if test 60 -ne `wc -c <'mrolo13/xr2mr'`; then
  2132.     echo shar: \"'mrolo13/xr2mr'\" unpacked with wrong size!
  2133. fi
  2134. chmod +x 'mrolo13/xr2mr'
  2135. # end of 'mrolo13/xr2mr'
  2136. fi
  2137. if test -f 'mrolo13/xr2mr.man' -a "${1}" != "-c" ; then 
  2138.   echo shar: Will not clobber existing file \"'mrolo13/xr2mr.man'\"
  2139. else
  2140. echo shar: Extracting \"'mrolo13/xr2mr.man'\" \(775 characters\)
  2141. sed "s/^X//" >'mrolo13/xr2mr.man' <<'END_OF_FILE'
  2142. X.TH xr2mr L "19 May 1993"
  2143. X.SH NAME
  2144. Xxr2mr \- Convert xrolodex file to mrolo format
  2145. X.SH SYNOPSIS
  2146. X.B xr2mr
  2147. X[
  2148. X.B filename
  2149. X]
  2150. X.SH DESCRIPTION
  2151. X.LP
  2152. X.I xr2mr
  2153. Xis a UNIX shell script which will read a xrolodex
  2154. Xfile and emit on standard output an equivalent
  2155. X.I mrolo
  2156. Xfile.  If no file is given on the command line
  2157. Xthen standard input is used.
  2158. X.LP
  2159. XThe format for
  2160. X.I mrolo
  2161. Xis detailed in it's own manpage, but the format
  2162. Xis compatible with xrolo.
  2163. X.SH EXAMPLE
  2164. X.LP
  2165. Xxr2mr .rolodex > .rolo
  2166. X.SH "SEE ALSO"
  2167. X.PD
  2168. X.BR mrolo (1),
  2169. X.BR prolo (1),
  2170. X.BR xrolo (1)
  2171. X.br
  2172. X.ne 5
  2173. X.SH BUGS
  2174. X.LP
  2175. XNone known.  Report bugs to gregor@kafka.saic.com
  2176. X.SH AUTHOR
  2177. X.nf
  2178. X.LP
  2179. Xgregg hanna (gregor@kafka.saic.com)
  2180. XScience Applications International Corporation
  2181. X10260 Campus Point Drive, MS C3
  2182. XSan Diego, California  92121
  2183. X.fi
  2184. END_OF_FILE
  2185. if test 775 -ne `wc -c <'mrolo13/xr2mr.man'`; then
  2186.     echo shar: \"'mrolo13/xr2mr.man'\" unpacked with wrong size!
  2187. fi
  2188. # end of 'mrolo13/xr2mr.man'
  2189. fi
  2190. echo shar: End of archive 1 \(of 3\).
  2191. cp /dev/null ark1isdone
  2192. MISSING=""
  2193. for I in 1 2 3 ; do
  2194.     if test ! -f ark${I}isdone ; then
  2195.     MISSING="${MISSING} ${I}"
  2196.     fi
  2197. done
  2198. if test "${MISSING}" = "" ; then
  2199.     echo You have unpacked all 3 archives.
  2200.     rm -f ark[1-9]isdone
  2201. else
  2202.     echo You still need to unpack the following archives:
  2203.     echo "        " ${MISSING}
  2204. fi
  2205. ##  End of shell archive.
  2206. exit 0
  2207.  
  2208. exit 0 # Just in case...
  2209. -- 
  2210.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  2211. \X/  Amiga - The only way to fly! |    sources-x@sterling.com
  2212.  "It's intuitively obvious to the |
  2213.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  2214.