home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume19 / Jetedit / part01 next >
Encoding:
Text File  |  1993-04-28  |  56.1 KB  |  1,685 lines

  1. Newsgroups: comp.sources.x
  2. From: duane@blacks.jpl.nasa.gov (Duane Clark)
  3. Subject: v19i080:  Jetedit - A Motif text editor, Part01/04
  4. Message-ID: <csx-v19i080=Jetedit.094255@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 4bf0f03fa252c0feb4ba97ade0169b5c
  6. Date: Thu, 8 Apr 1993 14:44:18 GMT
  7. Approved: chris@sparky.imd.sterling.com
  8.  
  9. Submitted-by: duane@blacks.jpl.nasa.gov (Duane Clark)
  10. Posting-number: Volume 19, Issue 80
  11. Archive-name: Jetedit/part01
  12. Environment: X11, OSF/Motif
  13.  
  14. Jetedit is a Motif programmer's editor, although it can be used for
  15. general purpose editing.  It has a Mac like interface, along with features
  16. useful to C programming such as:
  17.     -Multiple undos
  18.     -Line number indicator
  19.     -Goto line number
  20.     -Find and Replace
  21.     -Tabbing in and out a block of text
  22.     -Automatic C syntax sensitive indenting, which can be easily configured
  23.     to suit the style you want, or disabled.
  24.     -A clipboard with the ability to cut and paste between editors, even if
  25.     they are running on different hosts.
  26.  
  27. All of the configuration options are set through dialogs. In addition, they
  28. can be set to your desired defaults through resources in your .Xdefaults file.
  29. See the man page. Two fairly complete man pages are supplied; a plain text
  30. version - jetedit.txt and a formatted version - jetedit.man.uu. You will need
  31. to uudecode the second.
  32.  
  33. I have been using this editor exclusively for about three years.  It has been
  34. compiled on an HP9000/300, SUN and Decstation 5000, and under IRIX 4.0.2 and
  35. AIX3.2 (whatever those are), but it should work on any UNIX machine with
  36. X Windows (the file functions use UNIX calls, these would have to be modified
  37. for other machines).
  38.  
  39. This is freeware.  See copyright.h.
  40.  
  41. Authors:
  42.       Duane Clark - duane@blacks.jpl.nasa.gov (Jet Propulsion Labs)
  43.  
  44.       Jim Campbell - jec@milne.boeing.com - contributed regular expression
  45.       text searches.
  46.  
  47.       David W. Sanderson - dws@ssec.wisc.edu - improved the formatting of
  48.       the man page.
  49. #! /bin/sh
  50. # This is a shell archive.  Remove anything before this line, then unpack
  51. # it by saving it into a file and typing "sh file".  To overwrite existing
  52. # files, type "sh file -c".  You can also feed this as standard input via
  53. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  54. # will see the following message at the end:
  55. #        "End of archive 1 (of 4)."
  56. # Contents:  Imakefile Jetedit README copyright.h
  57. #   jetedit.txt makefile patchlevel.h xme.c xme.h
  58. #   xmefile.c
  59. # Wrapped by duane@blacks.jpl.nasa.gov on Sat Apr  3 20:04:06 1993
  60. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  61. if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  62.   echo shar: Will not clobber existing file \"'Imakefile'\"
  63. else
  64. echo shar: Extracting \"'Imakefile'\" \(946 characters\)
  65. sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
  66. X#
  67. X# If your XMLIB is defined in your Imake.tmpl comment out the
  68. X# following line
  69. X#
  70. XXMLIB           =  -lXm
  71. X# for initiall development
  72. X#CC = gcc
  73. X#CDEBUGFLAGS = -g
  74. X#
  75. X#
  76. XINCLUDES      = -I$(TOP)/lib -I$(TOP)
  77. X
  78. X# 
  79. X#    Comment out the following line if you want to set menu
  80. X#    and dialog resources through resource files (see the
  81. X#    included resource file: Jetedit). In this case, be sure
  82. X#    to install the resource file:
  83. X#       /usr/lib/X11/app-defaults/Jetedit.
  84. X#    Otherwise, such things as menu accelerators will be
  85. X#    hardcoded.
  86. X#
  87. X#DEFINES       = -DHARDCODE
  88. X
  89. XHDRS          = xme.h
  90. XLOCAL_LIBRARIES = $(XMLIB) \
  91. X        $(XTOOLLIB) \
  92. X        $(XLIB)
  93. X#If you get an unresolved external, uncomment the following line.
  94. X#SYS_LIBRARIES = -lPW
  95. XOBJS          = xme.o \
  96. X        xmedialg.o \
  97. X        xmefile.o \
  98. X        xmemenu.o \
  99. X        xmemisc.o \
  100. X        xmepref.o \
  101. X        xmespec.o
  102. XSRCS          = xme.c \
  103. X        xmedialg.c \
  104. X        xmefile.c \
  105. X        xmemenu.c \
  106. X        xmemisc.c \
  107. X        xmepref.c \
  108. X        xmespec.c
  109. X
  110. XComplexProgramTarget(jetedit)
  111. END_OF_FILE
  112. if test 946 -ne `wc -c <'Imakefile'`; then
  113.     echo shar: \"'Imakefile'\" unpacked with wrong size!
  114. fi
  115. # end of 'Imakefile'
  116. fi
  117. if test -f 'Jetedit' -a "${1}" != "-c" ; then 
  118.   echo shar: Will not clobber existing file \"'Jetedit'\"
  119. else
  120. echo shar: Extracting \"'Jetedit'\" \(2358 characters\)
  121. sed "s/^X//" >'Jetedit' <<'END_OF_FILE'
  122. X! This is a sample file of resources for jetedit, however
  123. X! Jetedit will work just fine without any resources.
  124. X
  125. X! This file would normally be put in the 
  126. X! /usr/lib/X11/app-defaults directory, or the resources
  127. X! copied into your ~/.Xdefaults file.
  128. X
  129. X!jetedit*font:                courR12
  130. X!jetedit*infoFile:            /update.txt
  131. Xjetedit*background:            DarkTurquoise
  132. Xjetedit*unselectColor:            Grey70
  133. X
  134. X!******************************************
  135. X! The following resources will be used if the HARDCODE
  136. X! flag was NOT used during compiling. This would allow
  137. X! individual users to customize the settings.
  138. X
  139. X! If the HARDCODE flag is used during compile, only a
  140. X! single font can be used for everything including the
  141. X! main window, menus, and dialogs. The font is selected
  142. X! with the font resource (above).
  143. X! If the HARDCODE flag is not used, font controls only
  144. X! the main text window. Everything else uses the
  145. X! fontlist resource, and the individual components can
  146. X! be given different fonts if desired.
  147. X
  148. X!jetedit*fontList:            courR18
  149. X
  150. X! The autoUnmanage resources determine whether the Find
  151. X! and GoTo dialogs will automatically go away when the
  152. X! OK buttons are clicked. If set to False, the dialogs
  153. X! will remain up until the Done or Cancel buttons are
  154. X! clicked.
  155. X
  156. Xjetedit*Find.autoUnmanage:        False
  157. Xjetedit*GoTo.autoUnmanage:        False
  158. X
  159. X!These resources set the Menu accelerators.
  160. X
  161. Xjetedit*Open.acceleratorText:        Ext+O
  162. Xjetedit*Open.accelerator:        Meta<Key>O:
  163. Xjetedit*New.acceleratorText:        Ext+N
  164. Xjetedit*New.accelerator:        Meta<Key>N:
  165. Xjetedit*Save.acceleratorText:        Ext+S
  166. Xjetedit*Save.accelerator:        Meta<Key>S:
  167. Xjetedit*Exit.acceleratorText:        Ext+Q
  168. Xjetedit*Exit.accelerator:        Meta<Key>Q:
  169. X
  170. Xjetedit*Undo.acceleratorText:        Ext+Z
  171. Xjetedit*Undo.accelerator:        Meta<Key>Z:
  172. Xjetedit*Cut.acceleratorText:        Ext+X
  173. Xjetedit*Cut.accelerator:        Meta<Key>X:
  174. Xjetedit*Copy.acceleratorText:        Ext+C
  175. Xjetedit*Copy.accelerator:        Meta<Key>C:
  176. Xjetedit*Paste.acceleratorText:        Ext+V
  177. Xjetedit*Paste.accelerator:        Meta<Key>V:
  178. Xjetedit*Clear.acceleratorText:        Del
  179. X!The text widget already knows to use the Del key.
  180. X
  181. Xjetedit*Find.acceleratorText:        Ext+F
  182. Xjetedit*Find.accelerator:        Meta<Key>F:
  183. Xjetedit*FindA.acceleratorText:        Ext+A
  184. Xjetedit*FindA.accelerator:        Meta<Key>A:
  185. Xjetedit*Replace.acceleratorText:    Ext+R
  186. Xjetedit*Replace.accelerator:        Meta<Key>R:
  187. Xjetedit*GoTo.acceleratorText:        Ext+G
  188. Xjetedit*GoTo.accelerator:        Meta<Key>G:
  189. END_OF_FILE
  190. if test 2358 -ne `wc -c <'Jetedit'`; then
  191.     echo shar: \"'Jetedit'\" unpacked with wrong size!
  192. fi
  193. chmod +x 'Jetedit'
  194. # end of 'Jetedit'
  195. fi
  196. if test -f 'README' -a "${1}" != "-c" ; then 
  197.   echo shar: Will not clobber existing file \"'README'\"
  198. else
  199. echo shar: Extracting \"'README'\" \(2739 characters\)
  200. sed "s/^X//" >'README' <<'END_OF_FILE'
  201. X4/3/93
  202. XThis is version 1.2 of Jetedit. I continue to get a slow trickle of email
  203. Xfrom users of the original, so I thought I would post this one. This will
  204. Xlikely be the final version, as I have little time to spend on it.
  205. X
  206. XDisclaimer: This program gets it's name from my working at the Jet
  207. XPropulsion Labs, but it was written on my own time (so don't worry too
  208. Xmuch about your taxes being wasted).
  209. X
  210. XChanges from 1.0:
  211. X-A bug was fixed that caused a core dump on some systems when the first
  212. X line ended in a ';'.
  213. X-Some minor changes were added to the line number indication to hopefully
  214. X make it indicate correctly in all situations.
  215. X-The Find and Goto dialogs can be set (through resources) to remain up until
  216. X until explicitly commanded to unmap by clicking Done.
  217. X-The ability to perform searches optionally using regular expressions was 
  218. X added. On some machines, this might also make text searches significantly
  219. X faster. Select Help from the Find dialog for a quick reference to regular
  220. X expressions.
  221. X-In the spirit of X, the setting of all menu and dialog resources through a
  222. X resource file is now actually possible (see the makefile - I personally prefer
  223. X to hardcode some of them). A sample resource file is included.
  224. X  
  225. XJetedit is a Motif programmer's editor, although it can be used for
  226. Xgeneral purpose editing.  It has a Mac like interface, along with features
  227. Xuseful to C programming such as:
  228. X    -Multiple undos
  229. X    -Line number indicator
  230. X    -Goto line number
  231. X    -Find and Replace
  232. X    -Tabbing in and out a block of text
  233. X    -Automatic C syntax sensitive indenting, which can be easily configured
  234. X    to suit the style you want, or disabled.
  235. X    -A clipboard with the ability to cut and paste between editors, even if
  236. X    they are running on different hosts.
  237. X
  238. XAll of the configuration options are set through dialogs. In addition, they
  239. Xcan be set to your desired defaults through resources in your .Xdefaults file.
  240. XSee the man page. Two fairly complete man pages are supplied; a plain text
  241. Xversion - jetedit.txt and a formatted version - jetedit.man.uu. You will need
  242. Xto uudecode the second.
  243. X
  244. XI have been using this editor exclusively for about three years.  It has been
  245. Xcompiled on an HP9000/300, SUN and Decstation 5000, and under IRIX 4.0.2 and
  246. XAIX3.2 (whatever those are), but it should work on any UNIX machine with
  247. XX Windows (the file functions use UNIX calls, these would have to be modified
  248. Xfor other machines).
  249. X
  250. XThis is freeware.  See copyright.h.
  251. X
  252. XAuthors:
  253. X      Duane Clark - duane@blacks.jpl.nasa.gov (Jet Propulsion Labs)
  254. X
  255. X      Jim Campbell - jec@milne.boeing.com - contributed regular expression
  256. X      text searches.
  257. X
  258. X      David W. Sanderson - dws@ssec.wisc.edu - improved the formatting of
  259. X      the man page.
  260. END_OF_FILE
  261. if test 2739 -ne `wc -c <'README'`; then
  262.     echo shar: \"'README'\" unpacked with wrong size!
  263. fi
  264. chmod +x 'README'
  265. # end of 'README'
  266. fi
  267. if test -f 'copyright.h' -a "${1}" != "-c" ; then 
  268.   echo shar: Will not clobber existing file \"'copyright.h'\"
  269. else
  270. echo shar: Extracting \"'copyright.h'\" \(1379 characters\)
  271. sed "s/^X//" >'copyright.h' <<'END_OF_FILE'
  272. X/*
  273. X**  Author:    Duane Clark, Jet Propulsion Labs, Pasadena CA
  274. X**                (duane@blacks.jpl.nasa.gov)
  275. X**  Copyright (c) 1993 by Duane Clark
  276. X**  
  277. X** This program originated as "xmeditor", although the resemblance
  278. X** would be hard to see at this point. xmeditor includes the additional
  279. X** copyrights:
  280. X**    (c) Copyright 1989 by Open Software Foundation, Inc.
  281. X**        All Rights Reserved.
  282. X**    (c) Copyright 1989 by Hewlett-Packard Company.
  283. X**
  284. X** Permission to use, copy, modify, and distribute this software
  285. X** and its documentation for any purpose is hereby granted without fee,
  286. X** provided that the above copyright notice appear in all copies and
  287. X** that both that copyright notice and this permission notice appear
  288. X** in supporting documentation.  The author makes no representations
  289. X** about the suitability of this software for any purpose.  It is
  290. X** provided "as is" without express or implied warranty.
  291. X**
  292. X** THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  293. X** INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
  294. X** NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  295. X** CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  296. X** OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  297. X** OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
  298. X** USE OR PERFORMANCE OF THIS SOFTWARE.
  299. X**
  300. X*/
  301. END_OF_FILE
  302. if test 1379 -ne `wc -c <'copyright.h'`; then
  303.     echo shar: \"'copyright.h'\" unpacked with wrong size!
  304. fi
  305. chmod +x 'copyright.h'
  306. # end of 'copyright.h'
  307. fi
  308. if test -f 'jetedit.txt' -a "${1}" != "-c" ; then 
  309.   echo shar: Will not clobber existing file \"'jetedit.txt'\"
  310. else
  311. echo shar: Extracting \"'jetedit.txt'\" \(11162 characters\)
  312. sed "s/^X//" >'jetedit.txt' <<'END_OF_FILE'
  313. X JETEDIT(1X)                                                     JETEDIT(1X)
  314. X
  315. X NAME
  316. X      jetedit - a ``C'' programmer's point and click editor.
  317. X
  318. X SYNTAX
  319. X      jetedit [filename]
  320. X
  321. X DESCRIPTION
  322. X      Jetedit is intended to be a programmer's editor, but is usable for
  323. X      general purpose editing. It has a Mac like interface with the <Extend
  324. X      char> key replacing the Mac <command> key, and duplicates the common
  325. X      Mac editing commands. Other features it has:
  326. X
  327. X      +    Find and Replace
  328. X
  329. X      +    Goto line number
  330. X
  331. X      +    Tabbing in and out a block of text
  332. X
  333. X      +    Undo edits
  334. X
  335. X      +    Automatic C syntax sensitive indenting, which can be easily
  336. X           configured to suit the style you are used to.
  337. X
  338. X OPTIONS
  339. X      Jetedit recognizes all the normal X Windows options such as font and
  340. X      geometry. The only additional option it recognizes is a filename.
  341. X
  342. X HOW IT WORKS
  343. X      The most important feature is that edits can be undone. This is hard
  344. X      coded to remember the previous 20 edits, using a circular buffer.
  345. X      Select Undo from the Edit menu or type <Ext>Z.  Note that some editing
  346. X      functions, such as tabbing a block of text, are remembered as multiple
  347. X      edits, so you may need to undo multiple times to completely undo.
  348. X
  349. X      With the exception of undo, all the editing functions work just like a
  350. X      Mac. This includes the existence of a clipboard. Text cut or copied to
  351. X      the clipboard can not only be pasted between editors running on the
  352. X      same host, but because of X Windows can also be pasted to an editor
  353. X      running on a different host (the XmClipboard is used).
  354. X
  355. X      For non Mac users, a brief explanation:
  356. X
  357. X      +    Holding down the left mouse button and dragging the mouse will
  358. X           select a block of text.  For large blocks of text, click the
  359. X           mouse at the beginning (or end) of the desired block of text,
  360. X           move to the other end of the text, and hold down <Shift> while
  361. X           clicking the mouse.  The ends of the selected block can be
  362. X           altered by <Shift> clicking again or dragging the mouse while
  363. X           holding down the button.
  364. X
  365. X      +    Copy (from the Edit menu) will copy the selected block of text to
  366. X           a ``clipboard'' in memory.  Note that the ``Ext+C'' next to
  367. X           ``Copy'' in the menu means that copying can also be done by
  368. X           holding down the <Ext> key and typing <C>.  On some keyboards,
  369. X           <Ext> may be have some other label such as <Alt>.
  370. X
  371. X      +    Cut will copy the text to the clipboard, and then delete it from
  372. X           your document.
  373. X
  374. X      +    Clear (or the <Del> or <Backspace> key) will delete the text from
  375. X           the document without altering the clipboard.
  376. X
  377. X      +    Paste will insert a copy of the text from the clipboard to the
  378. X           current insertion point.
  379. X
  380. X      +    If a block of text is selected, and then you type a character or
  381. X           paste from the clipboard, the selected block is overwritten.  The
  382. X           contents of the clipboard are not altered.
  383. X           
  384. X      Another method available for copying text is to click the mouse at the
  385. X      point where you want the text to be inserted, to put the insertion
  386. X      point there.  Then go to the the text to be copied and press the
  387. X      center mouse button while dragging the mouse.  As you drag the mouse,
  388. X      the selected text will be underlined.  When the mouse button is
  389. X      released, the selected text will be copied to the previously set
  390. X      insertion point. Holding down <CTRL> while dragging will result in the
  391. X      selected text being deleted after it is copied.
  392. X
  393. X      An entire block of text can be tabbed in or out by selecting the block
  394. X      with the mouse, then typing <Tab> or shift<Tab>.
  395. X
  396. X      Ext<Home> will take you to the beginning of the file. Shift<Home> will
  397. X      take you to the end of the file.
  398. X
  399. X      Selecting Open from the File menu will pop up a File Selection dialog
  400. X      box.  The dialog allows traversal up and down through the directory
  401. X      structure using the mouse. Double clicking (clicking the left mouse
  402. X      button twice rapidly) on a directory name in the Files area will move
  403. X      you down into that directory. Double clicking on ``..'' will move you
  404. X      up one directory. Double clicking on a filename will open that file.
  405. X      Adding something like ``*.c'' in the File Filter window will cause the
  406. X      dialog to only display *.c files, for example.
  407. X
  408. X      A number of features intended for programmers are included, and can be
  409. X      easily varied to suit the format style you are used to. They are
  410. X      controlled by resources that can be set in your .Xdefaults file or
  411. X      with a dialog.  Selecting Preferences from the Edit menu will pop up a
  412. X      dialog to allow you to set the preferences. Then clicking the Help
  413. X      button will pop up another dialog which will tell you exactly what
  414. X      resources to use for the selected preferences.
  415. X
  416. X      Three indenting modes are available.  Smart indenting will indent a
  417. X      new line to the level of the previous line.  Syntax sensitive
  418. X      indenting attempts to make intelligent decisions about indenting and
  419. X      outdenting according to the rules of C syntax, and according to a
  420. X      number of selectable preferences for indenting style. You can also
  421. X      choose no automatic indenting if desired.
  422. X
  423. X X DEFAULTS
  424. X      The following resources can be put in your ~/.Xdefaults or
  425. X      usr/lib/X11/app-defaults/Jetedit file.  Reasonable defaults are
  426. X      supplied if no resources are specified.
  427. X
  428. X      background
  429. X           I find that an overall background of ``Gray90'' is much easier on
  430. X           the eyes than ``White''.
  431. X
  432. X      blinkRate
  433. X           Motif 1.0 text widgets have problems with the blinking cursor.
  434. X           Setting this resource to ``0'' will stop the blinking and the
  435. X           problem.
  436. X
  437. X      find_case.set
  438. X           Setting this to True will set the default for text searches to
  439. X           ignore text case.
  440. X
  441. X      fontList
  442. X           It is best to select a fixed width font. Also, the Motif 1.0 text
  443. X           widget has problems with some fonts when dragging the mouse to
  444. X           select text.  The default is ``Fixed''.  Another good one if you
  445. X           have it is ``lutRS12''.
  446. X
  447. X      infoFile
  448. X           Specifying a filename with a complete path will cause that file
  449. X           to be read into jetedit if no filename is specified on the
  450. X           command line.  This might be useful for informing users globally
  451. X           of updates.
  452. X
  453. X      regular_exp.set
  454. X           Setting this to True will set the default for text searches to
  455. X           use regular expressions.
  456. X
  457. X      start_at_top.set
  458. X           Setting this to True will set the default for text searches to
  459. X           begin at the top of the file.
  460. X
  461. X      unselectColor
  462. X           This determines the color used to indicate the unselected state
  463. X           of the brackets in the preferences dialogs. A good color is
  464. X           ``Gray70''.  It defaults to ``White''.
  465. X
  466. X      The following resources are easiest to determine by selecting
  467. X      Preferences from the Edit menu and using the Help dialog to determine
  468. X      the correct values to use.
  469. X
  470. X      indent
  471. X           Regular, smart, or C syntax sensitive indenting.
  472. X
  473. X      leadingTabs
  474. X           A boolean determining whether to use spaces or tabs for leading
  475. X           tabs. Leading tabs are tabs which are typed before any non-
  476. X           whitespace on a line.
  477. X
  478. X      trailingTabs
  479. X           All other tabs are trailing tabs.
  480. X
  481. X      spaces
  482. X           Determines how many spaces to insert when a tab is typed if
  483. X           either leadingTabs or trailingTabs is False.
  484. X
  485. X      openBrace
  486. X           Determines how to indent opening braces.
  487. X
  488. X      closeBrace
  489. X           Determines how to indent closing braces.
  490. X
  491. X      indentCase
  492. X           A boolean which determines whether to indent case statements from
  493. X           the level of the switch statement.
  494. X
  495. X TRANSLATIONS
  496. X      Jetedit defines the following translations for the main editing
  497. X      window.
  498. X
  499. X           <Key>Return:         NewLine()
  500. X           Shift<Key>Home:      ToBottom()
  501. X           Meta<Key>Home:       ToTop()
  502. X           Shift<Key>Tab:       OutdentText()
  503. X           <Key>Tab:            IndentText()
  504. X           :<Key>braceright:    RightBrace()
  505. X           :<Key>braceleft:     LeftBrace()
  506. X
  507. X ACTION ROUTINES
  508. X      Jetedit defines the following action routines.
  509. X
  510. X      NewLine()
  511. X           When in smart or syntax indenting mode, determines the number of
  512. X           tabs or spaces to insert and inserts them.
  513. X
  514. X      ToBottom()
  515. X           Moves the cursor to the bottom of the file.
  516. X
  517. X      ToTop()
  518. X           Moves the cursor to the top of the file.
  519. X
  520. X      IndentText()
  521. X           If a block of text is selected, indents each line in the block
  522. X           one tab stop. Else inserts one tab stop at current cursor
  523. X           position.
  524. X
  525. X      OutdentText()
  526. X           If a block of text is selected, outdents each line in the block
  527. X           one tab stop. Else deletes one tab stop at current cursor
  528. X           position.
  529. X
  530. X      RightBrace()
  531. X           Inserts a right brace, outdenting if appropriate for the selected
  532. X           editing style.
  533. X
  534. X      LeftBrace()
  535. X           Inserts a left brace, outdenting if appropriate for the selected
  536. X           editing style.
  537. X
  538. X      CutItem()
  539. X           Copies the selected block of text to the clipboard, then deletes
  540. X           it from the text window.
  541. X
  542. X      CopyItem()
  543. X           Copies the selected block of text to the clipboard.
  544. X
  545. X      PasteItem()
  546. X           Overwrites the selected block of text with the contents of the
  547. X           clipboard.
  548. X
  549. X BUGS
  550. X      The Motif 1.0 text widget has a number of minor bugs, most of which
  551. X      have been corrected in Motif 1.1.
  552. X
  553. X      Bugs which have been corrected in Motif 1.1:
  554. X
  555. X      +    The blinking cursor sometimes becomes erratic or disappears. This
  556. X           is best corrected by disabling blinking. See the X DEFAULTS
  557. X           section above.
  558. X
  559. X      +    I did not implement page up and down by clicking in the scroll
  560. X           bar paging area. Motif 1.1 has this support built in.
  561. X
  562. X      +    On some servers, when dragging the mouse to select a block of
  563. X           text, the first caracter you thought you were selecting gets
  564. X           missed. No, you aren't losing eye hand coordination.
  565. X
  566. X      +    Typing a menu accelerator while in one of the menu dialogs can
  567. X           cause fatal crashes.  In over two years use with Motif 1.0, this
  568. X           is the only known fatal error, and is fixed in Motif1.1.
  569. X
  570. X      Bugs which exist in Motif 1.1:
  571. X
  572. X      +    When in wordwrap mode, editing becomes rather sluggish with files
  573. X           of even a few thousand bytes.
  574. X
  575. X COPYRIGHTS
  576. X      (c) Copyright 1993 by Duane Clark.
  577. X
  578. X      See the jetedit source file copyright.h for a full copyright notice.
  579. X
  580. X AUTHORS
  581. X      Duane Clark - duane@blacks.jpl.nasa.gov
  582. X
  583. X      Jim Campbell - jec@milne.boeing.com - contributed regular expression
  584. X      text searches.
  585. X
  586. X      David W. Sanderson - dws@ssec.wisc.edu - did significant work to
  587. X      improve the formatting of the man page.
  588. X
  589. X
  590. END_OF_FILE
  591. if test 11162 -ne `wc -c <'jetedit.txt'`; then
  592.     echo shar: \"'jetedit.txt'\" unpacked with wrong size!
  593. fi
  594. chmod +x 'jetedit.txt'
  595. # end of 'jetedit.txt'
  596. fi
  597. if test -f 'makefile' -a "${1}" != "-c" ; then 
  598.   echo shar: Will not clobber existing file \"'makefile'\"
  599. else
  600. echo shar: Extracting \"'makefile'\" \(934 characters\)
  601. sed "s/^X//" >'makefile' <<'END_OF_FILE'
  602. X#    Makefile for Motif jetedit program on an HP9000.  
  603. X#    Hack away - there's nothing special here. On a Sun or
  604. X#    other BSD Unix machine, minor changes to the flags will
  605. X#    probably be required.
  606. X
  607. X#    Use this line for Motif1.0
  608. X#CFLAGS = -O -DMotif1.0
  609. X#    Use this line for Motif1.1 or later
  610. XCFLAGS = -O -I/usr/include/Motif1.1 -I/usr/include/X11R4
  611. X
  612. X#    Comment out the following line if you want to set menu
  613. X#    and dialog resources through resource files (see the
  614. X#    included resource file: Jetedit). In this case, be sure
  615. X#    to install the resource file:
  616. X#       /usr/lib/X11/app-defaults/Jetedit.
  617. XDEFINES = -DHARDCODE
  618. X
  619. XOBJECTS = xme.o xmedialg.o xmefile.o xmemenu.o xmemisc.o xmepref.o xmespec.o
  620. X
  621. X#LIBS = -Wl,-a,archive -lXm -lXt -lX11 -lPW
  622. XLIBS = -lXm -lXt -lX11 -lPW
  623. X#Note: The XmFileSelectionBox requires the libPW.a
  624. X
  625. Xjetedit: $(OBJECTS) $(TXT_OBJECT)
  626. X    cc $(CFLAGS) -o $@ $< $(OBJECTS) $(LIBS)
  627. X    
  628. X$(OBJECTS): xme.h
  629. X    cc -c $(CFLAGS) $(DEFINES) $<
  630. END_OF_FILE
  631. if test 934 -ne `wc -c <'makefile'`; then
  632.     echo shar: \"'makefile'\" unpacked with wrong size!
  633. fi
  634. # end of 'makefile'
  635. fi
  636. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  637.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  638. else
  639. echo shar: Extracting \"'patchlevel.h'\" \(21 characters\)
  640. sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  641. X#define PATCHLEVEL 0
  642. END_OF_FILE
  643. if test 21 -ne `wc -c <'patchlevel.h'`; then
  644.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  645. fi
  646. # end of 'patchlevel.h'
  647. fi
  648. if test -f 'xme.c' -a "${1}" != "-c" ; then 
  649.   echo shar: Will not clobber existing file \"'xme.c'\"
  650. else
  651. echo shar: Extracting \"'xme.c'\" \(13572 characters\)
  652. sed "s/^X//" >'xme.c' <<'END_OF_FILE'
  653. X/**---------------------------------------------------------------------
  654. X***     
  655. X***    file:           xme.c
  656. X***
  657. X***    project:    jetedit
  658. X***    requires:       xmedialg.c, xmefile.c, xmemenu.c, xmemisc.c,
  659. X***             xmepref.c, xmespec.c,  xme.h
  660. X***
  661. X***
  662. X***-------------------------------------------------------------------*/
  663. X
  664. X#define MAIN
  665. X#include <locale.h>
  666. X#include "xme.h"
  667. X
  668. X/* infoFile is a default file read in with the latest update info */
  669. X#define XmNinfoFile    "infoFile"    /* resource name */
  670. X#define XmCInfoFile    "InfoFile"    /* resource class */
  671. X
  672. X/* indent determines the indenting style: regular, smart, or syntax sensitive */
  673. X#define XmNindent    "indent"
  674. X#define XmCIndent    "Indent"
  675. X#define XmRIndent    "Indent"
  676. X
  677. X/* leadingTabs determines whether to use spaces or tabs for leading tabs */
  678. X#define XmNleadingTabs    "leadingTabs"
  679. X#define XmCLeadingTabs    "LeadingTabs"
  680. X
  681. X/* trailingTabs determines whether to use spaces or tabs for trailing tabs */
  682. X#define XmNtrailingTabs    "trailingTabs"
  683. X#define XmCTrailingTabs    "TrailingTabs"
  684. X
  685. X/* spaces determines the number of spaces to use for tabs, if spaces are selected */
  686. X#define XmNspaces    "spaces"
  687. X#define XmCSpaces    "Spaces"
  688. X
  689. X/* unselectColor determines the unselected color of buttons in the preferences dialog */
  690. X#define XmNunselectColor "unselectColor"
  691. X#define XmCUnselectColor "UnselectColor"
  692. X
  693. X/* openBrace determines where to locate an opening brace */
  694. X#define XmNopenBrace    "openBrace"
  695. X#define XmCOpenBrace    "OpenBrace"
  696. X
  697. X/* closeBrace determines where to locate a closing brace */
  698. X#define XmNcloseBrace    "closeBrace"
  699. X#define XmCCloseBrace    "CloseBrace"
  700. X
  701. X/* indentCase determines whether to indent case statements */
  702. X#define XmNindentCase    "indentCase"
  703. X#define XmCIndentCase    "IndentCase"
  704. X
  705. Xtypedef struct {
  706. X    char    *info;
  707. X    XFontStruct    *font;
  708. X    int        indent;
  709. X    Boolean    leading;
  710. X    Boolean    trailing;
  711. X    int        spaces;
  712. X    Pixel    unselect;
  713. X    int        opening;
  714. X    int        closing;
  715. X    Boolean    incase;
  716. X} AppData, *AppDataPtr;
  717. X
  718. Xstatic XtResource resources[] = {
  719. X    {
  720. X        XmNinfoFile,
  721. X        XmCInfoFile,
  722. X        XmRString,
  723. X        sizeof (char *),
  724. X        XtOffset (AppDataPtr, info),
  725. X        XmRString,
  726. X        ""
  727. X    },
  728. X    {
  729. X        XmNfont,
  730. X        XmCFont,
  731. X        XmRFontStruct,
  732. X        sizeof (XFontStruct *),
  733. X        XtOffset (AppDataPtr, font),
  734. X        XmRString,
  735. X        "Fixed"
  736. X    },
  737. X    {
  738. X        XmNindent,
  739. X        XmCIndent,
  740. X        XmRIndent,
  741. X        sizeof (int),
  742. X        XtOffset (AppDataPtr, indent),
  743. X        XmRString,
  744. X        "syntax"
  745. X    },
  746. X    {
  747. X        XmNleadingTabs,
  748. X        XmCLeadingTabs,
  749. X        XmRBoolean,
  750. X        sizeof (Boolean),
  751. X        XtOffset (AppDataPtr, leading),
  752. X        XmRString,
  753. X        "False"
  754. X    },
  755. X    {
  756. X        XmNtrailingTabs,
  757. X        XmCTrailingTabs,
  758. X        XmRBoolean,
  759. X        sizeof (Boolean),
  760. X        XtOffset (AppDataPtr, trailing),
  761. X        XmRString,
  762. X        "True"
  763. X    },
  764. X    {
  765. X        XmNspaces,
  766. X        XmCSpaces,
  767. X        XmRInt,
  768. X        sizeof (int),
  769. X        XtOffset (AppDataPtr, spaces),
  770. X        XmRString,
  771. X        "4"
  772. X    },
  773. X    {
  774. X        XmNunselectColor,
  775. X        XmCUnselectColor,
  776. X        XmRPixel,
  777. X        sizeof (Pixel),
  778. X        XtOffset (AppDataPtr, unselect),
  779. X        XmRString,
  780. X        "White"
  781. X    },
  782. X    {
  783. X        XmNopenBrace,
  784. X        XmCOpenBrace,
  785. X        XmRInt,
  786. X        sizeof (int),
  787. X        XtOffset (AppDataPtr, opening),
  788. X        XmRString,
  789. X        "2"
  790. X    },
  791. X    {
  792. X        XmNcloseBrace,
  793. X        XmCCloseBrace,
  794. X        XmRInt,
  795. X        sizeof (int),
  796. X        XtOffset (AppDataPtr, closing),
  797. X        XmRString,
  798. X        "0"
  799. X    },
  800. X    {
  801. X        XmNindentCase,
  802. X        XmCIndentCase,
  803. X        XmRBoolean,
  804. X        sizeof (Boolean),
  805. X        XtOffset (AppDataPtr, incase),
  806. X        XmRString,
  807. X        "False"
  808. X    }
  809. X};
  810. X
  811. X/*-------------------------------------------------------------
  812. X**      Action table list for jetedit.
  813. X*/
  814. Xstatic XtActionsRec actionTable[] = {
  815. X        {"NewLine", NewLine},
  816. X        {"ToBottom", ToBottom},
  817. X        {"ToTop", ToTop},
  818. X        {"IndentText", IndentText},
  819. X        {"OutdentText", OutdentText},
  820. X        {"RightBrace", RightBrace},
  821. X        {"LeftBrace", LeftBrace},
  822. X        {"CutItem", CutItem},
  823. X        {"CopyItem", CopyItem},
  824. X        {"PasteItem", PasteItem}
  825. X};
  826. X
  827. X/*-------------------------------------------------------------
  828. X**      main
  829. X*/
  830. Xvoid main (argc,argv)
  831. Xunsigned int    argc;
  832. Xchar            **argv;
  833. X{
  834. X    XFontStruct    *font;
  835. X    Widget    app_shell;    /*  ApplicationShell    */
  836. X    Widget    menu_bar;    /*  RowColumn           */
  837. X    Widget    form;         /*  Form                */
  838. X    Widget    message_form;
  839. X    Arg        al[10];        /*  arg list            */
  840. X    Cardinal    ac;        /*  arg count           */
  841. X    register int i;        /*  counter             */
  842. X    AppData    app_data;
  843. X    struct stat    statbuf;    /* Information on a file. */
  844. X    int        tfd;
  845. X    
  846. X    
  847. X    the_string = NULL;
  848. X    file_saved = True;    /* indicates that the present file is saved */
  849. X    no_undo = True;    /* don't store changes in undo buffer        */
  850. X    oldfile = NULL;    /* string containing file name             */
  851. X    charset = (XmStringCharSet) XmSTRING_DEFAULT_CHARSET;
  852. X        
  853. X    /*      Initialize toolkit and open display.
  854. X    */
  855. X    
  856. X    app_shell = XtInitialize ("main", "Jetedit", NULL, NULL, &argc, argv);
  857. X    
  858. X    theDisp    = XtDisplay(app_shell);
  859. X    theScreen    = DefaultScreen(theDisp);
  860. X    theCmap    = DefaultColormap(theDisp, theScreen);
  861. X    theGC    = DefaultGC(theDisp,theScreen);
  862. X    fcol    = BlackPixel(theDisp,theScreen);
  863. X    bcol    = WhitePixel(theDisp,theScreen);
  864. X    theVisual    = DefaultVisual(theDisp,theScreen);
  865. X    theDepth    = DefaultDepth(theDisp,theScreen);
  866. X    
  867. X    XtAddConverter(XmRString, XmRIndent, CvtStringToIndent, NULL, 0);
  868. X
  869. X    XtGetApplicationResources (app_shell, &app_data, resources,
  870. X        XtNumber (resources), NULL, 0);
  871. X    fontlist        = XmFontListCreate (app_data.font, charset);
  872. X    the_font        = *(app_data.font);
  873. X    indent_style    = app_data.indent;
  874. X    leading_tabs    = app_data.leading;
  875. X    trailing_tabs    = app_data.trailing;
  876. X    tab_spaces        = app_data.spaces;
  877. X    gcol         = app_data.unselect;
  878. X    open_brace        = app_data.opening;
  879. X    close_brace        = app_data.closing;
  880. X    indent_case        = app_data.incase;
  881. X    
  882. X    XtAddActions (actionTable, XtNumber(actionTable));
  883. X    
  884. X    /*      Create MainWindow.
  885. X    */
  886. X    ac = 0;
  887. X    XtSetArg (al[ac], XmNdefaultFontList, fontlist);  ac++;
  888. X    XtSetArg (al[ac], XmNshadowThickness, 0);  ac++;
  889. X    MainW = XmCreateMainWindow (app_shell, "MainW", al, ac);
  890. X    XtManageChild (MainW);
  891. X
  892. X
  893. X    /*      Create MenuBar in MainWindow.
  894. X    */
  895. X    menu_bar = CreateMenuBar (MainW);
  896. X    XtManageChild (menu_bar);
  897. X
  898. X    /*      Create dialogs which are children of the menu bar.
  899. X    */
  900. X    CreateMenuDialogs (menu_bar);
  901. X
  902. X    /*      Create message window in MainWindow.
  903. X    */
  904. X    ac=0;
  905. X    message_form = XmCreateForm(MainW, "message_form", al, ac);
  906. X    XtManageChild(message_form);
  907. X    
  908. X    ac = 0;
  909. X    XtSetArg (al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
  910. X    XtSetArg (al[ac], XmNalignment, XmALIGNMENT_BEGINNING);  ac++;
  911. X#ifdef HARDCODE
  912. X    XtSetArg (al[ac], XmNfontList, fontlist);  ac++;
  913. X#endif
  914. X    XtSetArg (al[ac], XmNlabelString, 
  915. X        XmStringCreateLtoR(" Editing:", charset));  ac++;
  916. X    message = XmCreateLabel (message_form, "message", al, ac);
  917. X    XtManageChild (message);
  918. X
  919. X    lines = 1;
  920. X    ac = 0;
  921. X    XtSetArg (al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
  922. X    XtSetArg (al[ac], XmNalignment, XmALIGNMENT_END);  ac++;
  923. X#ifdef HARDCODE
  924. X    XtSetArg (al[ac], XmNfontList, fontlist);  ac++;
  925. X#endif
  926. X    XtSetArg (al[ac], XmNlabelString, 
  927. X        XmStringCreateLtoR(" Line:    1", charset));  ac++;
  928. X    line = XmCreateLabel (message_form, "message", al, ac);
  929. X    XtManageChild (line);
  930. X
  931. X    XmMainWindowSetAreas (MainW, menu_bar, message_form, NULL, NULL, NULL);
  932. X    
  933. X    /*      Create Text.
  934. X    */
  935. X    CreateText ();
  936. X    XtManageChild (text);
  937. X    OpenUndoBuffer();
  938. X    XmAddTabGroup(text);
  939. X
  940. X    XtSetSensitive(text, False);
  941. X
  942. X    /*      Realize toplevel widgets.
  943. X    */
  944. X    XtRealizeWidget (app_shell);
  945. X    
  946. X    XmFileSelectionDoSearch(open_dialog, NULL);
  947. X    
  948. X    thefile = NULL;    /* string containing file name             */
  949. X    if (argc>1)
  950. X        thefile = argv[1];
  951. X    else thefile = app_data.info;
  952. X    if (strlen(thefile)) {
  953. X        /* Open file, print error if it does not exist. */
  954. X        if ((tfd = open(thefile, O_RDONLY)) == -1)  
  955. X            fprintf(stderr,"Unable to open %s\n", thefile);
  956. X        else {
  957. X            if (stat(thefile, &statbuf) == 0) {
  958. X                file_mode = statbuf.st_mode;
  959. X                if (S_ISREG(file_mode)) {
  960. X                    OpenFile(tfd);
  961. X                    /* close up the file */
  962. X                    if (close(tfd) != NULL) 
  963. X                        strcat (message_string, 
  964. X                        "  \7Warning: unable to close file.");
  965. X                }
  966. X            }
  967. X        }
  968. X    }
  969. X    
  970. X    /*      Process events.
  971. X    */
  972. X    XtMainLoop ();
  973. X}
  974. X
  975. X
  976. X/*-------------------------------------------------------------
  977. X**      CvtStringToIndent
  978. X*/
  979. Xvoid CvtStringToIndent(args, nargs, fromVal, toVal)
  980. XXrmValuePtr    args, fromVal, toVal;
  981. Xint        *nargs;
  982. X{
  983. X    char *inString;
  984. X    static int  outVal;
  985. X    
  986. X    inString = (char *)fromVal->addr;
  987. X    toVal->size = sizeof(indent_style);
  988. X    
  989. X    outVal = SYNTAX;
  990. X    if (!strncmp(inString, "regular", 7))
  991. X        outVal = NONE;
  992. X    else if (!strncmp(inString, "smart", 5))
  993. X        outVal = SMART;
  994. X    else if (!strncmp(inString, "syntax", 6))
  995. X        outVal = SYNTAX;
  996. X    else
  997. X        XtStringConversionWarning(inString, "Indent");
  998. X    
  999. X    toVal->addr = (caddr_t) &outVal;
  1000. X}
  1001. X
  1002. X
  1003. X/*-------------------------------------------------------------
  1004. X**      ToBottom - an action routine to move the cursor to the
  1005. X**        bottom of the file. 
  1006. X*/
  1007. Xvoid ToBottom()
  1008. X{
  1009. X    char *file_string;
  1010. X    XmTextPosition cursorPos;
  1011. X    Arg al[1];
  1012. X    
  1013. X    /* get the text string */
  1014. X    file_string = (char *)XmTextGetString(text);
  1015. X    cursorPos = strlen(file_string);
  1016. X    /* Motif1.1 does not work changing the cursor to the position
  1017. X    following the last character in the file, even though this is
  1018. X    a valid cursor position. Motif1.0 worked correctly. */
  1019. X    MoveTo(cursorPos);
  1020. X    XtFree (file_string);
  1021. X}
  1022. X    
  1023. X/*-------------------------------------------------------------
  1024. X**      ToTop
  1025. X*/
  1026. Xvoid ToTop()
  1027. X{
  1028. X    Arg al[1];
  1029. X    
  1030. X    MoveTo((XmTextPosition)0);
  1031. X}
  1032. X    
  1033. X/*-------------------------------------------------------------
  1034. X**      
  1035. X*/
  1036. Xvoid MotionCB (w, client_data, call_data)
  1037. XWidget    w;
  1038. Xcaddr_t    client_data;
  1039. Xcaddr_t    call_data;
  1040. X{
  1041. X    Arg        al[10];
  1042. X    Cardinal    ac;
  1043. X    int        i,j,k,l,newlines;
  1044. X    char     *file_string;
  1045. X    char    line_string[15];
  1046. X    XmTextPosition cursorPos;        /* text cursor position    */
  1047. X    XmTextVerifyCallbackStruct *cb = (XmTextVerifyCallbackStruct *) call_data;
  1048. X    Widget    scroll_bar;
  1049. X    
  1050. X    file_string = (char *)XmTextGetString(text);
  1051. X    cursorPos = cb->newInsert;
  1052. X    
  1053. X    newlines = 1;
  1054. X    for (j=0; j<cursorPos; j++)
  1055. X        if(file_string[j] == '\n')
  1056. X            newlines++;
  1057. X    
  1058. X    if (lines != newlines) {
  1059. X        lines = newlines;
  1060. X        /* update the line number message */
  1061. X        sprintf (line_string, " Line:  %4d", lines);
  1062. X        XtSetArg(al[0], XmNlabelString, 
  1063. X            XmStringCreateLtoR(line_string, charset));
  1064. X        XtSetValues(line, al, 1);
  1065. X    }
  1066. X    XtFree (file_string);
  1067. X}
  1068. X    
  1069. X/*--------------------------------------------------------------
  1070. X**    Translation table for the main text widget.
  1071. X**    Names of keys are found by running xmodmap -pk
  1072. X**    Note that Motif1.1 redefines the Home key to move the cursor
  1073. X**    to the beginning of the line, and the key cannot be redefined.
  1074. X**    Therefore, we are using Meta Home to perform this function.
  1075. X*/
  1076. Xstatic char defaultTranslations[] =
  1077. X    "<Key>Return:    NewLine()    \n\
  1078. X    Shift<Key>Home:    ToBottom()    \n\
  1079. X    Meta<Key>Home:    ToTop()        \n\
  1080. X    Shift<Key>Tab:    OutdentText()    \n\
  1081. X    <Key>Tab:        IndentText()    \n\
  1082. X    :<Key>braceright:    RightBrace()    \n\
  1083. X    :<Key>braceleft:    LeftBrace()";
  1084. X
  1085. X/*--------------------------------------------------------------
  1086. X**      CreateText
  1087. X**              Create text widget.
  1088. X*/
  1089. Xvoid CreateText()
  1090. X{
  1091. X    Arg    al[10];
  1092. X    int    ac;
  1093. X    XtTranslations trans_table;
  1094. X
  1095. X    ac = 0;
  1096. X    XtSetArg (al[ac], XmNrows, 40);  ac++;
  1097. X    XtSetArg (al[ac], XmNcolumns, 80);  ac++;
  1098. X    XtSetArg (al[ac], XmNresizeWidth, False);  ac++;
  1099. X    XtSetArg (al[ac], XmNresizeHeight, False);  ac++;
  1100. X    XtSetArg (al[ac], XmNscrollVertical, True);  ac++;
  1101. X    XtSetArg (al[ac], XmNscrollHorizontal, True);  ac++;
  1102. X    XtSetArg (al[ac], XmNeditMode, XmMULTI_LINE_EDIT);  ac++;
  1103. X    XtSetArg (al[ac], XmNwordWrap, False);  ac++;
  1104. X    XtSetArg (al[ac], XmNfontList, fontlist);  ac++;
  1105. X    
  1106. X    text = XmCreateScrolledText (MainW, "text", al, ac);
  1107. X    XtAddCallback(text, XmNmodifyVerifyCallback, UndoStoreCB, NULL);
  1108. X    XtAddCallback(text, XmNmotionVerifyCallback, MotionCB, NULL);
  1109. X     
  1110. X    /* modify the functions of some of the keyboards keys with
  1111. X        functions from the Action table. */
  1112. X    trans_table = XtParseTranslationTable(defaultTranslations);
  1113. X    XtOverrideTranslations (text, trans_table);
  1114. X    
  1115. X    no_undo = False;
  1116. X}
  1117. X
  1118. X    
  1119. X/*--------------------------------------------------------------
  1120. X**      WordWrap
  1121. X**              Enable or disable word wrap
  1122. X*/
  1123. Xvoid WordWrap(WrapOn)
  1124. XBoolean  WrapOn;
  1125. X{
  1126. X    Arg    al[10];
  1127. X    int    ac;
  1128. X    
  1129. X    ac = 0;
  1130. X    if (WrapOn) {
  1131. X        XtSetArg (al[ac], XmNscrollHorizontal, False);  ac++;
  1132. X        XtSetArg (al[ac], XmNwordWrap, True);  ac++;
  1133. X    }
  1134. X    else {
  1135. X        XtSetArg (al[ac], XmNscrollHorizontal, True);  ac++;
  1136. X        XtSetArg (al[ac], XmNwordWrap, False);  ac++;
  1137. X    }
  1138. X    XtSetValues (text, al, ac);
  1139. X    
  1140. X    no_undo = False;
  1141. X}
  1142. END_OF_FILE
  1143. if test 13572 -ne `wc -c <'xme.c'`; then
  1144.     echo shar: \"'xme.c'\" unpacked with wrong size!
  1145. fi
  1146. chmod +x 'xme.c'
  1147. # end of 'xme.c'
  1148. fi
  1149. if test -f 'xme.h' -a "${1}" != "-c" ; then 
  1150.   echo shar: Will not clobber existing file \"'xme.h'\"
  1151. else
  1152. echo shar: Extracting \"'xme.h'\" \(5700 characters\)
  1153. sed "s/^X//" >'xme.h' <<'END_OF_FILE'
  1154. X/**---------------------------------------------------------------------
  1155. X***    
  1156. X***    file:        xme.h
  1157. X***
  1158. X***    project:    Motif Widgets text editor
  1159. X***
  1160. X/*-------------------------------------------------------------
  1161. X**    Include Files
  1162. X*/
  1163. X
  1164. X#include "copyright.h"
  1165. X#include <stdio.h>
  1166. X#include <string.h>
  1167. X#include <fcntl.h>
  1168. X#include <errno.h>
  1169. X#include <sys/stat.h>
  1170. X#include <sys/unistd.h>
  1171. X#include <X11/Xos.h>
  1172. X#include <X11/Xatom.h>
  1173. X#include <X11/Intrinsic.h>
  1174. X#include <X11/Shell.h>
  1175. X
  1176. X#include <Xm/Xm.h>
  1177. X#include <Xm/BulletinB.h>
  1178. X#include <Xm/CascadeB.h>
  1179. X#include <Xm/CascadeBG.h>
  1180. X#include <Xm/CutPaste.h>
  1181. X#include <Xm/DialogS.h>
  1182. X#include <Xm/DrawingA.h>
  1183. X#include <Xm/FileSB.h>
  1184. X#include <Xm/Form.h>
  1185. X#include <Xm/Label.h>
  1186. X#include <Xm/LabelG.h>
  1187. X#include <Xm/MainW.h>
  1188. X#include <Xm/MessageB.h>
  1189. X#include <Xm/PushB.h>
  1190. X#include <Xm/PushBG.h>
  1191. X#include <Xm/RowColumn.h>
  1192. X#include <Xm/SelectioB.h>
  1193. X#include <Xm/Separator.h>
  1194. X#include <Xm/Text.h>
  1195. X#include <Xm/ToggleB.h>
  1196. X#include <Xm/ToggleBG.h>
  1197. X
  1198. X
  1199. X/*-------------------------------------------------------------
  1200. X**    Global Constants
  1201. X*/
  1202. X
  1203. X#define MAXLENGTH     30    /* Max length of find and replace strings */
  1204. X#define NONE        0
  1205. X#define SMART        1
  1206. X#define SYNTAX        2
  1207. X#define MAX_TAB_SPACES    8
  1208. X
  1209. X#ifndef GID_NO_CHANGE        /* HPUX defines these already */
  1210. X#define GID_NO_CHANGE    -1
  1211. X#define UID_NO_CHANGE    -1
  1212. X#endif
  1213. X
  1214. X#ifdef MAIN
  1215. X#define WHERE
  1216. X#else
  1217. X#define WHERE extern
  1218. X#endif
  1219. X
  1220. XWHERE Widget CreateSpecialWarningDialog();
  1221. XWHERE Widget CreateSpecialFindDialog();
  1222. XWHERE Widget CreateSpecialHelpDialog();
  1223. XWHERE Widget CreatePreferencesDialog();
  1224. XWHERE Widget CreateMenuBar ();
  1225. XWHERE XImage *CreateDefaultImage();
  1226. XWHERE void   CvtStringToIndent();
  1227. XWHERE void   NewLine ();
  1228. XWHERE void   IndentText ();
  1229. XWHERE void   OutdentText ();
  1230. XWHERE void   RightBrace ();
  1231. XWHERE void   LeftBrace ();
  1232. XWHERE void   CreateText ();
  1233. XWHERE void   CloseUndoBuffer();
  1234. XWHERE void   CloseUndoBuffer();
  1235. XWHERE void   UndoStoreCB ();
  1236. XWHERE void   ToBottom();
  1237. XWHERE void   ToTop();
  1238. XWHERE void   CutItem();
  1239. XWHERE void   CopyItem();
  1240. XWHERE void   PasteItem();
  1241. XWHERE void   MoveTo();
  1242. X
  1243. X/** The main windows **/
  1244. XWHERE Widget MainW;            /* MainWindow                      */
  1245. XWHERE Widget text;            /* multi-line text widget        */
  1246. XWHERE Widget message;            /* message bar in main window        */
  1247. XWHERE Widget line;            /* line number message in main window    */
  1248. X/** The menu widgets **/
  1249. XWHERE Widget save_button;
  1250. XWHERE Widget undo_button;
  1251. XWHERE Widget separator;
  1252. XWHERE Widget cut_button;        /* clipboard cut button         */
  1253. XWHERE Widget copy_button;        /* clipboard copy button         */
  1254. XWHERE Widget paste_button;        /* clipboard paste button         */
  1255. XWHERE Widget clear_button;        /* clipboard clear button         */
  1256. XWHERE Widget find_button;        /* go to line button             */
  1257. XWHERE Widget findA_button;        /* find again string button         */
  1258. XWHERE Widget replace_button;
  1259. XWHERE Widget goto_button;        /* find string button             */
  1260. X/** The dialogs **/
  1261. XWHERE Widget open_dialog;        /* file selection dialog         */
  1262. XWHERE Widget open_warning;        /* save changes warning dialog        */
  1263. XWHERE Widget new_dialog;        /* file name prompt dialog         */
  1264. XWHERE Widget new_warning;        /* save changes warning dialog        */
  1265. XWHERE Widget file_exists_dialog;    /* save duplicate file warning dialog    */
  1266. XWHERE Widget save_as_dialog;        /* save as prompt dialog         */
  1267. XWHERE Widget exists_as_dialog;        /* saveas duplicate file warning dialog    */
  1268. XWHERE Widget file_mode_dialog;        /* no write permission dialog        */
  1269. XWHERE Widget refused_dialog;        /* file access denied dialog        */
  1270. XWHERE Widget close_warning;        /* save changes warning dialog        */
  1271. XWHERE Widget exit_warning;        /* save changes warning dialog        */
  1272. XWHERE Widget prefer_dialog;        /* preferences dialog            */
  1273. XWHERE Widget help_dialog;        /* help for preferences dialog        */
  1274. XWHERE Widget help_text;            /* help text for preferences dialog    */
  1275. XWHERE Widget find_dialog;        /* find string dialog             */
  1276. XWHERE Widget find_help_dialog;        /* help for find dialog             */
  1277. XWHERE Widget find_help_text;        /* help text for find dialog        */
  1278. XWHERE Widget replace_pb;        /* the Replace pushbutton        */
  1279. XWHERE Widget replaceAll_pb;        /* the Replace All pushbutton        */
  1280. XWHERE Widget wrap_button;        /* word wrap button            */
  1281. XWHERE Widget goto_dialog;        /* go to line number dialog         */
  1282. X
  1283. X/* variables for the X environment */
  1284. XWHERE XmStringCharSet    charset;
  1285. XWHERE XmFontList    fontlist;
  1286. XWHERE XFontStruct    the_font;
  1287. XWHERE int        theScreen, dispcells;
  1288. XWHERE Colormap        theCmap;
  1289. XWHERE GC        theGC;
  1290. XWHERE Pixel        fcol,bcol,gcol;
  1291. XWHERE Visual        *theVisual;
  1292. XWHERE Display        *theDisp;
  1293. XWHERE unsigned int      theDepth;    /* screen depth             */
  1294. X
  1295. X/* unix variables */
  1296. XWHERE ushort    file_mode;        /* Storage for file mode information.    */
  1297. XWHERE uid_t    file_user;
  1298. XWHERE gid_t    file_group;
  1299. X
  1300. X/* variables used in editing */
  1301. XWHERE Boolean    file_saved;        /* indicates the present file is saved    */
  1302. XWHERE Boolean    no_undo;        /* don't store changes in undo buffer    */
  1303. XWHERE char    *thefile;        /* string containing file name        */
  1304. XWHERE char    *oldfile;        /* string containing file name        */
  1305. XWHERE int    start_pos, end_pos;    /* start, end position of last action    */
  1306. XWHERE char    *the_string;        /* global string for find again routine    */
  1307. XWHERE char    message_string[80];    /* Editing: message              */
  1308. XWHERE int    lines;            /* line number of insert cursor     */
  1309. XWHERE char    Error[128];        /* I don't remember where this is needed*/
  1310. X
  1311. X/* variables for indenting styles */
  1312. XWHERE int    indent_style;        /* regular, smart, or syntax indenting    */
  1313. XWHERE Boolean    leading_tabs;        /* use tabs or spaces for leading tabs    */
  1314. XWHERE Boolean    trailing_tabs;        /* use tabs or spaces for trailing tabs */
  1315. XWHERE int    tab_spaces;        /* number of spaces to use for tabs     */
  1316. XWHERE int    open_brace;        /* where to locate opening brace     */
  1317. XWHERE int    close_brace;        /* where to locate closing brace     */
  1318. XWHERE Boolean    indent_case;        /* indent case statements         */
  1319. END_OF_FILE
  1320. if test 5700 -ne `wc -c <'xme.h'`; then
  1321.     echo shar: \"'xme.h'\" unpacked with wrong size!
  1322. fi
  1323. chmod +x 'xme.h'
  1324. # end of 'xme.h'
  1325. fi
  1326. if test -f 'xmefile.c' -a "${1}" != "-c" ; then 
  1327.   echo shar: Will not clobber existing file \"'xmefile.c'\"
  1328. else
  1329. echo shar: Extracting \"'xmefile.c'\" \(10252 characters\)
  1330. sed "s/^X//" >'xmefile.c' <<'END_OF_FILE'
  1331. X/**---------------------------------------------------------------------
  1332. X***     
  1333. X***    file:        xmefile.c
  1334. X***    main:        xme.c
  1335. X***
  1336. X***    project:    Motif Widgets text editor
  1337. X***
  1338. X***             (c) Copyright 1989 by Open Software Foundation, Inc.
  1339. X***                 All Rights Reserved.
  1340. X***
  1341. X***             (c) Copyright 1989 by Hewlett-Packard Company.
  1342. X***
  1343. X***
  1344. X***-------------------------------------------------------------------*/
  1345. X
  1346. X#include "xme.h"
  1347. X
  1348. X
  1349. X
  1350. X/*-------------------------------------------------------------
  1351. X**      OpenFile
  1352. X**              Open the present file.  Returns true if file 
  1353. X**  exists and open is sucessful.
  1354. X*/
  1355. XBoolean OpenFile(tfd)
  1356. Xint    tfd;        /* Temporary file descriptor */
  1357. X{
  1358. X    struct stat statbuf;    /* Information on a file. */
  1359. X    int        file_length;    /* Length of file.        */
  1360. X    char    *file_string;    /* Contents of file.      */
  1361. X    char    line_string[15];
  1362. X    int        i;
  1363. X    Arg        al[1];
  1364. X    mode_t    mode_mask;
  1365. X    sprintf (message_string, " Opened:  %s", thefile);
  1366. X    
  1367. X    if (stat(thefile, &statbuf) != 0) {
  1368. X        strcat (message_string, 
  1369. X            "  File status problem.");
  1370. X        return(False);
  1371. X    }
  1372. X    file_length = statbuf.st_size;
  1373. X    file_mode = statbuf.st_mode;
  1374. X    file_user = statbuf.st_uid;
  1375. X    file_group = statbuf.st_gid;
  1376. X
  1377. X    /* read the file string */
  1378. X    file_string = XtMalloc((unsigned)(file_length+1));
  1379. X    read(tfd, file_string, file_length);
  1380. X    file_string[file_length] = '\0';
  1381. X
  1382. X    /* add the file string to the text widget */
  1383. X    no_undo = True;
  1384. X    XmTextSetString(text, file_string);
  1385. X    no_undo = False;    
  1386. X    file_saved = True; /* intialize to True */
  1387. X    XtFree (file_string);
  1388. X    
  1389. X    lines = 1;
  1390. X    sprintf (line_string, " Line:  %4d", lines);
  1391. X    XtSetArg(al[0], XmNlabelString, 
  1392. X        XmStringCreateLtoR(line_string, charset));
  1393. X    XtSetValues(line, al, 1);
  1394. X         
  1395. X    /* make appropriate item sensitive */
  1396. X    XtSetSensitive(text, True);
  1397. X    XtSetSensitive(cut_button, True);
  1398. X    XtSetSensitive(copy_button, True);
  1399. X    XtSetSensitive(paste_button, True);
  1400. X    XtSetSensitive(clear_button, True);
  1401. X    XtSetSensitive(find_button, True);
  1402. X    XtSetSensitive(goto_button, True);
  1403. X    InitUndoBuffer();
  1404. X    
  1405. X    /* Check for write permission.    */
  1406. X    if (access (thefile, W_OK))
  1407. X        XtManageChild (file_mode_dialog);
  1408. X    
  1409. X    XtSetArg(al[0], XmNlabelString, 
  1410. X        XmStringCreateLtoR(message_string, charset));
  1411. X    XtSetValues(message, al, 1);
  1412. X    
  1413. X    return(True);
  1414. X}
  1415. X
  1416. X
  1417. X
  1418. X/*-------------------------------------------------------------
  1419. X**    SaveFile
  1420. X**        Save the present file.
  1421. X*/
  1422. XBoolean SaveFile()
  1423. X{
  1424. X    struct stat statbuf;        /* Information on a file. */
  1425. X    char    *file_string = NULL;    /* Contents of file.        */
  1426. X    int     tfd;            /* Temporary file descriptor.    */
  1427. X    char    *tempname;            /* Temporary file name.        */
  1428. X    char    pathname[60];
  1429. X    Arg     al[1];
  1430. X    unsigned int theLength;
  1431. X    
  1432. X    sprintf (message_string, " Saved:  %s", thefile);
  1433. X    
  1434. X    /* Check if file already exists and if we have write permission.  If 
  1435. X        no write permission, attempt to chmod. If this fails, give up. */
  1436. X    if (!access (thefile, F_OK)) {    /* Check if file exists.    */
  1437. X        if (access (thefile, W_OK)) {    /* Check for write permission.    */
  1438. X            chmod (thefile, file_mode | S_IWUSR);
  1439. X            if (access (thefile, W_OK))
  1440. X                XtManageChild (refused_dialog);
  1441. X        }
  1442. X        if (access (thefile, W_OK)) return (False);
  1443. X    }
  1444. X    
  1445. X    /* Create a temporary file name by changing /users/user/file_name
  1446. X       to /users/user/xmeditXXXXXX. The result is in pathname. */
  1447. X    strcpy (pathname, thefile);
  1448. X    if ((tempname = strrchr (pathname, '/')) == NULL)
  1449. X        tempname = pathname;
  1450. X    else tempname = (char *)((long)tempname + 1);
  1451. X    strcpy(tempname, mktemp("xmeditXXXXXX"));
  1452. X    
  1453. X    if ((tfd = open(pathname, O_WRONLY | O_CREAT, file_mode)) == -1) {
  1454. X        strcat (message_string, 
  1455. X            "   \7Warning: unable to open temp file, text not saved.");
  1456. X        XtSetArg(al[0], XmNlabelString, 
  1457. X            XmStringCreateLtoR(message_string, charset));
  1458. X        XtSetValues(message, al, 1);
  1459. X        return(False);;
  1460. X    }
  1461. X    
  1462. X    /* get the text string */
  1463. X    file_string = XmTextGetString(text);
  1464. X    if (file_string[theLength=strlen(file_string)-1] != '\n') {
  1465. X        file_string = XtRealloc (file_string, theLength+2);
  1466. X        file_string[theLength+1] = '\n';
  1467. X        file_string[theLength+2] = '\0';
  1468. X    }
  1469. X
  1470. X    /* write to a temp file */
  1471. X    write(tfd, file_string, strlen(file_string));
  1472. X
  1473. X    /* close the temp file */
  1474. X    if (close(tfd) != NULL) 
  1475. X        strcat (message_string, "   \7Warning: unable to close file.");
  1476. X    chmod (pathname, file_mode);
  1477. X    chown (pathname, file_user, file_group);
  1478. X
  1479. X    XtFree(file_string); /* free the text string */
  1480. X
  1481. X    /* move the pathname to the saved file */
  1482. X    if (rename(pathname, thefile) == 0) {
  1483. X        file_saved = True;
  1484. X    } else {
  1485. X        strcat (message_string, "   \7Warning: unable to save file.");
  1486. X        XtSetArg(al[0], XmNlabelString, 
  1487. X            XmStringCreateLtoR(message_string, charset));
  1488. X        XtSetValues(message, al, 1);
  1489. X        return(False);
  1490. X    }
  1491. X           
  1492. X    XtSetArg(al[0], XmNlabelString, 
  1493. X        XmStringCreateLtoR(message_string, charset));
  1494. X    XtSetValues(message, al, 1);
  1495. X    XtSetSensitive(save_button, False);
  1496. X    
  1497. X    return(True);
  1498. X}
  1499. X
  1500. X
  1501. X
  1502. X/*-------------------------------------------------------------
  1503. X**      CloseFile
  1504. X**              Close the present file.
  1505. X*/
  1506. Xvoid CloseFile()
  1507. X{
  1508. X    no_undo = True;
  1509. X    XmTextSetString(text, "");
  1510. X    no_undo = False;
  1511. X
  1512. X    file_saved = True; /* reinitialize file_saved flag */
  1513. X
  1514. X    /* free the file name */
  1515. X    thefile = NULL;
  1516. X
  1517. X    /* set text to insensitive */
  1518. X    XtSetSensitive(text, False);
  1519. X}
  1520. X
  1521. X
  1522. X
  1523. X/*-------------------------------------------------------------
  1524. X**      CopyItemToClipboard
  1525. X**              Copy the present item to the clipboard.
  1526. X**        USED ONLY in X11R3
  1527. X*/
  1528. Xvoid CopyItemToClipboard(thetime)
  1529. XTime    thetime;
  1530. X{
  1531. X    char    *selected_string;    /* text selection    */
  1532. X    long     item_id = 0;        /* clipboard item id */
  1533. X    int        data_id = 0;        /* clipboard data id */
  1534. X    int        status = 0;        /* clipboard status  */
  1535. X    XmString    clip_label;
  1536. X
  1537. X    selected_string = XmTextGetSelection (text);
  1538. X    if ((selected_string != NULL) && strlen(selected_string)) {
  1539. X        fprintf(stderr, "Copying text");
  1540. X        clip_label = XmStringCreateLtoR ("XM_EDITOR", charset);
  1541. X        /* start copy to clipboard, and continue till
  1542. X           a sucessful start copy is made */
  1543. X        status = 0;
  1544. X        while (status != ClipboardSuccess)
  1545. X            status = XmClipboardStartCopy (XtDisplay(text), XtWindow(text),
  1546. X                                        clip_label, thetime,
  1547. X                                        text, NULL, &item_id);
  1548. X
  1549. X        /* move the data to the clipboard, and
  1550. X           continue till a sucessful copy is made */
  1551. X        status = 0;
  1552. X        while (status != ClipboardSuccess)
  1553. X            status = XmClipboardCopy (XtDisplay(text), XtWindow(text),
  1554. X                                      item_id, "STRING", selected_string,
  1555. X                                      (long)strlen(selected_string)+1, (int)0,
  1556. X                                      &data_id);
  1557. X
  1558. X        /* end the copy to the clipboard and continue till
  1559. X           a sucessful end copy is made */
  1560. X        status = 0;
  1561. X        while (status != ClipboardSuccess)
  1562. X            status = XmClipboardEndCopy (XtDisplay(text), XtWindow(text),
  1563. X                                         item_id);
  1564. X
  1565. X        /* allow pasting when an item is sucessfully copied to the clipboard */
  1566. X        XtSetSensitive(paste_button, True);
  1567. X
  1568. X   }
  1569. X
  1570. X}
  1571. X
  1572. X
  1573. X
  1574. X/*-------------------------------------------------------------
  1575. X**      DeletePrimarySelection
  1576. X**              Deletes the primary selection.
  1577. X**        USED ONLY in X11R3
  1578. X*/
  1579. Xvoid DeletePrimarySelection()
  1580. X{
  1581. X   XClientMessageEvent cm;
  1582. X   
  1583. X   /* send a client message to the text widget
  1584. X      to delete the current selection */
  1585. X   cm.type = ClientMessage;
  1586. X   cm.display = XtDisplay(text);
  1587. X   cm.message_type = XmInternAtom(XtDisplay(text), "KILL_SELECTION", FALSE);
  1588. X   cm.window = XtWindow(text);
  1589. X   cm.format = 32;
  1590. X   cm.data.l[0] = XA_PRIMARY;
  1591. X   XSendEvent(XtDisplay(text), cm.window, TRUE, NoEventMask, &cm);
  1592. X}
  1593. X
  1594. X
  1595. X/*-------------------------------------------------------------
  1596. X**      PasteItemFromClipboard
  1597. X**              paste item from the clipboard to the current cursor location
  1598. X**        USED ONLY in X11R3
  1599. X*/
  1600. Xvoid PasteItemFromClipboard()
  1601. X{
  1602. X    char *selected_string;    /* containts of selection  */
  1603. X    int  status = 0;        /* clipboard status        */
  1604. X    char *buffer;        /* temporary text buffer   */
  1605. X    unsigned long  length;    /* length of buffer        */
  1606. X    unsigned long  outlength = 0;    /* length of bytes copied  */
  1607. X    int  private_id = 0;    /* id of item on clipboard */
  1608. X    XmTextPosition cursorPos;    /* text cursor position    */
  1609. X    Cardinal ac;        /* arg count               */
  1610. X    Arg  al[10];        /* arg list                */
  1611. X
  1612. X    selected_string = XmTextGetSelection (text);
  1613. X    if ((selected_string != NULL) && strlen(selected_string)) 
  1614. X        DeletePrimarySelection();
  1615. X
  1616. X    /* find the length of the paste item, continue till the length is found */
  1617. X    while (status != ClipboardSuccess) {
  1618. X        status = XmClipboardInquireLength(XtDisplay(text), XtWindow(text),
  1619. X                "STRING", &length);
  1620. X        if (status == ClipboardNoData) {
  1621. X            length = 0;
  1622. X            break;
  1623. X        }
  1624. X    }
  1625. X                        
  1626. X    if (length == 0) {
  1627. X        fprintf(stderr, "\7Warning: paste failed, no items to paste.\n"); 
  1628. X        return;
  1629. X    }
  1630. X
  1631. X    /* malloc to necessary space */
  1632. X    buffer = XtMalloc(length);
  1633. X
  1634. X    status = XmClipboardRetrieve (XtDisplay(text), XtWindow(text), "STRING",
  1635. X                                 buffer, length, &outlength, &private_id);
  1636. X                        
  1637. X    /* Dialogs need to be added to indicate errors in pasting */
  1638. X    if (status != ClipboardSuccess) {
  1639. X        fprintf(stderr, "\7Warning: paste failed, status = %d\n", status);        
  1640. X        XtFree (buffer);
  1641. X        return;
  1642. X    }
  1643. X
  1644. X    /* get cursor position for pasting */
  1645. X    XtSetArg(al[0], XmNcursorPosition, &cursorPos);
  1646. X    XtGetValues(text, al, 1);
  1647. X                        
  1648. X    /* add new text */
  1649. X    XmTextReplace(text, cursorPos, cursorPos, buffer);
  1650. X    XtFree (buffer);
  1651. X}
  1652. X
  1653. END_OF_FILE
  1654. if test 10252 -ne `wc -c <'xmefile.c'`; then
  1655.     echo shar: \"'xmefile.c'\" unpacked with wrong size!
  1656. fi
  1657. chmod +x 'xmefile.c'
  1658. # end of 'xmefile.c'
  1659. fi
  1660. echo shar: End of archive 1 \(of 4\).
  1661. cp /dev/null ark1isdone
  1662. MISSING=""
  1663. for I in 1 2 3 4 ; do
  1664.     if test ! -f ark${I}isdone ; then
  1665.     MISSING="${MISSING} ${I}"
  1666.     fi
  1667. done
  1668. if test "${MISSING}" = "" ; then
  1669.     echo You have unpacked all 4 archives.
  1670.     rm -f ark[1-9]isdone
  1671. else
  1672.     echo You still need to unpack the following archives:
  1673.     echo "        " ${MISSING}
  1674. fi
  1675. ##  End of shell archive.
  1676. exit 0
  1677.  
  1678. exit 0 # Just in case...
  1679. -- 
  1680.   // chris@IMD.Sterling.COM            | Send comp.sources.x submissions to:
  1681. \X/  Amiga - The only way to fly!      |
  1682.  "It's intuitively obvious to the most |    sources-x@imd.sterling.com
  1683.   casual observer..."                  |
  1684.