home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume27 / trsfg218 / part03 < prev    next >
Encoding:
Text File  |  1993-10-05  |  62.8 KB  |  2,197 lines

  1. Newsgroups: comp.sources.unix
  2. From: envbvs@epb12.lbl.gov (Brian V. Smith)
  3. Subject: v27i057: transfig-2.1.8 - a set of tools for creating TeX documents with graphics, Part03/07
  4. References: <1.749903574.10622@gw.home.vix.com>
  5. Sender: unix-sources-moderator@gw.home.vix.com
  6. Approved: vixie@gw.home.vix.com
  7.  
  8. Submitted-By: envbvs@epb12.lbl.gov (Brian V. Smith)
  9. Posting-Number: Volume 27, Issue 57
  10. Archive-Name: transfig-2.1.8/part03
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 3 (of 7)."
  19. # Contents:  Makefile doc/fig2dev.1 fig2dev/bound.c fig2dev/read1_3.c
  20. #   transfig/Makefile
  21. # Wrapped by envbvs@epb12.lbl.gov.lbl.gov on Fri Oct  1 14:55:47 1993
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'Makefile'\"
  25. else
  26. echo shar: Extracting \"'Makefile'\" \(12794 characters\)
  27. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  28. X# Makefile generated by imake - do not edit!
  29. X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
  30. X#
  31. X# The cpp used on this machine replaces all newlines and multiple tabs and
  32. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  33. X# for this, but is not always successful.
  34. X#
  35. X
  36. X# -------------------------------------------------------------------------
  37. X# Makefile generated from "Imake.tmpl" and </tmp/IIf.a21047>
  38. X# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
  39. X#
  40. X# Platform-specific parameters may be set in the appropriate <vendor>.cf
  41. X# configuration files.  Site-specific parameters should be set in the file
  42. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  43. X#
  44. X# If your C preprocessor does not define any unique symbols, you will need
  45. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  46. X# "make World" the first time).
  47. X#
  48. X
  49. X# -------------------------------------------------------------------------
  50. X# site-specific configuration parameters that need to come before
  51. X# the platform-specific parameters - edit site.def to change
  52. X
  53. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  54. X
  55. X# -------------------------------------------------------------------------
  56. X# platform-specific configuration parameters - edit sun.cf to change
  57. X
  58. X# platform:  $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
  59. X
  60. X# operating system:  SunOS 4.1.2
  61. X
  62. X# $XConsortium: sunLib.rules,v 1.7 91/12/20 11:19:47 rws Exp $
  63. X
  64. X# -------------------------------------------------------------------------
  65. X# site-specific configuration parameters that go after
  66. X# the platform-specific parameters - edit site.def to change
  67. X
  68. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  69. X
  70. X            SHELL = /bin/sh
  71. X
  72. X              TOP = .
  73. X      CURRENT_DIR = .
  74. X
  75. X               AR = ar clq
  76. X  BOOTSTRAPCFLAGS =
  77. X               CC = cc
  78. X               AS = as
  79. X
  80. X         COMPRESS = compress
  81. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  82. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  83. X          INSTALL = install
  84. X               LD = ld
  85. X             LINT = lint
  86. X      LINTLIBFLAG = -C
  87. X         LINTOPTS = -axz
  88. X               LN = ln -s
  89. X             MAKE = make
  90. X               MV = mv
  91. X               CP = cp
  92. X
  93. X           RANLIB = ranlib
  94. X  RANLIBINSTFLAGS =
  95. X
  96. X               RM = rm -f
  97. X            TROFF = psroff
  98. X         MSMACROS = -ms
  99. X              TBL = tbl
  100. X              EQN = eqn
  101. X     STD_INCLUDES =
  102. X  STD_CPP_DEFINES =
  103. X      STD_DEFINES =
  104. X EXTRA_LOAD_FLAGS =
  105. X  EXTRA_LIBRARIES =
  106. X             TAGS = ctags
  107. X
  108. X    SHAREDCODEDEF = -DSHAREDCODE
  109. X         SHLIBDEF = -DSUNSHLIB
  110. X
  111. X    PROTO_DEFINES =
  112. X
  113. X     INSTPGMFLAGS =
  114. X
  115. X     INSTBINFLAGS = -m 0755
  116. X     INSTUIDFLAGS = -m 4755
  117. X     INSTLIBFLAGS = -m 0644
  118. X     INSTINCFLAGS = -m 0444
  119. X     INSTMANFLAGS = -m 0444
  120. X     INSTDATFLAGS = -m 0444
  121. X    INSTKMEMFLAGS = -g kmem -m 2755
  122. X
  123. X      CDEBUGFLAGS = -O
  124. X        CCOPTIONS =
  125. X
  126. X      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
  127. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
  128. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  129. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  130. X
  131. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  132. X
  133. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS)
  134. X
  135. X   LDCOMBINEFLAGS = -X -r
  136. X      DEPENDFLAGS =
  137. X
  138. X        MACROFILE = sun.cf
  139. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  140. X
  141. X    IMAKE_DEFINES =
  142. X
  143. X         IRULESRC = $(CONFIGDIR)
  144. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  145. X
  146. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  147. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  148. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  149. X
  150. X# -------------------------------------------------------------------------
  151. X# X Window System Build Parameters
  152. X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
  153. X
  154. X# -------------------------------------------------------------------------
  155. X# X Window System make variables; this need to be coordinated with rules
  156. X
  157. X          PATHSEP = /
  158. X        USRLIBDIR = /usr/lib
  159. X           BINDIR = /usr/bin/X11
  160. X          INCROOT = /usr/include
  161. X     BUILDINCROOT = $(TOP)
  162. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  163. X      BUILDINCTOP = ..
  164. X           INCDIR = $(INCROOT)/X11
  165. X           ADMDIR = /usr/adm
  166. X           LIBDIR = $(USRLIBDIR)/X11
  167. X        CONFIGDIR = $(LIBDIR)/config
  168. X       LINTLIBDIR = $(USRLIBDIR)/lint
  169. X
  170. X          FONTDIR = $(LIBDIR)/fonts
  171. X         XINITDIR = $(LIBDIR)/xinit
  172. X           XDMDIR = $(LIBDIR)/xdm
  173. X           TWMDIR = $(LIBDIR)/twm
  174. X          MANPATH = /usr/man
  175. X    MANSOURCEPATH = $(MANPATH)/man
  176. X        MANSUFFIX = l
  177. X     LIBMANSUFFIX = 3
  178. X           MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
  179. X        LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
  180. X           NLSDIR = $(LIBDIR)/nls
  181. X        PEXAPIDIR = $(LIBDIR)/PEX
  182. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  183. X       FONTCFLAGS = -t
  184. X
  185. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  186. X
  187. X            IMAKE = imake
  188. X           DEPEND = makedepend
  189. X              RGB = rgb
  190. X
  191. X            FONTC = bdftopcf
  192. X
  193. X        MKFONTDIR = mkfontdir
  194. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
  195. X
  196. X        CONFIGSRC = $(TOP)/config
  197. X       DOCUTILSRC = $(TOP)/doc/util
  198. X        CLIENTSRC = $(TOP)/clients
  199. X          DEMOSRC = $(TOP)/demos
  200. X           LIBSRC = $(TOP)/lib
  201. X          FONTSRC = $(TOP)/fonts
  202. X       INCLUDESRC = $(TOP)/X11
  203. X        SERVERSRC = $(TOP)/server
  204. X          UTILSRC = $(TOP)/util
  205. X        SCRIPTSRC = $(UTILSRC)/scripts
  206. X       EXAMPLESRC = $(TOP)/examples
  207. X       CONTRIBSRC = $(TOP)/../contrib
  208. X           DOCSRC = $(TOP)/doc
  209. X           RGBSRC = $(TOP)/rgb
  210. X        DEPENDSRC = $(UTILSRC)/makedepend
  211. X         IMAKESRC = $(CONFIGSRC)
  212. X         XAUTHSRC = $(LIBSRC)/Xau
  213. X          XLIBSRC = $(LIBSRC)/X
  214. X           XMUSRC = $(LIBSRC)/Xmu
  215. X       TOOLKITSRC = $(LIBSRC)/Xt
  216. X       AWIDGETSRC = $(LIBSRC)/Xaw
  217. X       OLDXLIBSRC = $(LIBSRC)/oldX
  218. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  219. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  220. X      BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
  221. X      BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
  222. X     MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
  223. X         FSLIBSRC = $(FONTSRC)/lib/fs
  224. X    FONTSERVERSRC = $(FONTSRC)/server
  225. X     EXTENSIONSRC = $(TOP)/extensions
  226. X         XILIBSRC = $(EXTENSIONSRC)/lib/xinput
  227. X      PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
  228. X
  229. X# $XConsortium: sunLib.tmpl,v 1.14.1.1 92/03/17 14:58:46 rws Exp $
  230. X
  231. XSHLIBLDFLAGS = -assert pure-text
  232. XPICFLAGS = -pic
  233. X
  234. X  DEPEXTENSIONLIB =
  235. X     EXTENSIONLIB = -lXext
  236. X
  237. X          DEPXLIB = $(DEPEXTENSIONLIB)
  238. X             XLIB = $(EXTENSIONLIB) -lX11
  239. X
  240. X        DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
  241. X       XMULIBONLY = -lXmu
  242. X           XMULIB = -lXmu
  243. X
  244. X       DEPOLDXLIB =
  245. X          OLDXLIB = -loldX
  246. X
  247. X      DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
  248. X         XTOOLLIB = -lXt
  249. X
  250. X        DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
  251. X           XAWLIB = -lXaw
  252. X
  253. X        DEPXILIB =
  254. X           XILIB = -lXi
  255. X
  256. X        SOXLIBREV = 4.10
  257. X          SOXTREV = 4.10
  258. X         SOXAWREV = 5.0
  259. X        SOOLDXREV = 4.10
  260. X         SOXMUREV = 4.10
  261. X        SOXEXTREV = 4.10
  262. X      SOXINPUTREV = 4.10
  263. X
  264. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  265. X         XAUTHLIB =  -lXau
  266. X      DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
  267. X         XDMCPLIB =  -lXdmcp
  268. X
  269. X        DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
  270. X           PHIGSLIB =  -lphigs
  271. X
  272. X       DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
  273. X          XBSDLIB =  -lXbsd
  274. X
  275. X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
  276. X         LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
  277. X          LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
  278. X        LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
  279. X          LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
  280. X           LINTXI = $(LINTLIBDIR)/llib-lXi.ln
  281. X        LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
  282. X
  283. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  284. X
  285. X         DEPLIBS1 = $(DEPLIBS)
  286. X         DEPLIBS2 = $(DEPLIBS)
  287. X         DEPLIBS3 = $(DEPLIBS)
  288. X
  289. X# -------------------------------------------------------------------------
  290. X# Imake rules for building libraries, programs, scripts, and data files
  291. X# rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
  292. X
  293. X# -------------------------------------------------------------------------
  294. X# start of Imakefile
  295. X
  296. X#
  297. X# Top level Makefile for TransFig
  298. X#
  299. X# to make fig2dev:         type "make"
  300. X#
  301. X
  302. XDEPLIBS =
  303. XSUBDIRS = transfig fig2dev
  304. X
  305. Xall::
  306. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  307. X    for i in $(SUBDIRS) ;\
  308. X    do \
  309. X    (cd $$i ; echo "making" all "in $(CURRENT_DIR)/$$i..."; \
  310. X    $(MAKE) $(MFLAGS) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' all); \
  311. X    done
  312. X
  313. Xdepend::
  314. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  315. X    for i in $(SUBDIRS) ;\
  316. X    do \
  317. X    (cd $$i ; echo "depending" "in $(CURRENT_DIR)/$$i..."; \
  318. X    $(MAKE) $(MFLAGS)  depend); \
  319. X    done
  320. X
  321. Xmanual:
  322. X
  323. Xtransfig.man: ../doc/transfig.1
  324. X    ln -s ../doc/transfig.1 transfig.man
  325. X    cd doc/manual; make; latex manual; latex manual
  326. X
  327. Xclean::
  328. X    cd doc/manual; make clean
  329. X
  330. X# -------------------------------------------------------------------------
  331. X# common rules for all Makefiles - do not edit
  332. X
  333. Xemptyrule::
  334. X
  335. Xclean::
  336. X    $(RM_CMD) "#"*
  337. X
  338. XMakefile::
  339. X    -@if [ -f Makefile ]; then set -x; \
  340. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  341. X    else exit 0; fi
  342. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  343. X
  344. Xtags::
  345. X    $(TAGS) -w *.[ch]
  346. X    $(TAGS) -xw *.[ch] > TAGS
  347. X
  348. Xsaber:
  349. X    # load $(ALLDEFINES) $(SRCS)
  350. X
  351. Xosaber:
  352. X    # load $(ALLDEFINES) $(OBJS)
  353. X
  354. X# -------------------------------------------------------------------------
  355. X# rules for building in SUBDIRS - do not edit
  356. X
  357. Xinstall::
  358. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  359. X    for i in $(SUBDIRS) ;\
  360. X    do \
  361. X    (cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \
  362. X    $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \
  363. X    done
  364. X
  365. Xinstall.man::
  366. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  367. X    for i in $(SUBDIRS) ;\
  368. X    do \
  369. X    (cd $$i ; echo "installing man pages" "in $(CURRENT_DIR)/$$i..."; \
  370. X    $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install.man); \
  371. X    done
  372. X
  373. Xclean::
  374. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  375. X    for i in $(SUBDIRS) ;\
  376. X    do \
  377. X    (cd $$i ; echo "cleaning" "in $(CURRENT_DIR)/$$i..."; \
  378. X    $(MAKE) $(MFLAGS) RM_CMD='$(RM_CMD)' clean); \
  379. X    done
  380. X
  381. Xtags::
  382. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  383. X    for i in $(SUBDIRS) ;\
  384. X    do \
  385. X    (cd $$i ; echo "tagging" "in $(CURRENT_DIR)/$$i..."; \
  386. X    $(MAKE) $(MFLAGS) TAGS='$(TAGS)' tags); \
  387. X    done
  388. X
  389. XMakefiles::
  390. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  391. X    for i in $(SUBDIRS) ;\
  392. X    do \
  393. X    echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \
  394. X    case "$$i" in \
  395. X    ./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
  396. X    ./?*/?*/?*) newtop=../../../ sub=subsubsub;; \
  397. X    ./?*/?*) newtop=../../ sub=subsub;; \
  398. X    ./?*) newtop=../ sub=sub;; \
  399. X    */?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
  400. X    */?*/?*) newtop=../../../ sub=subsubsub;; \
  401. X    */?*) newtop=../../ sub=subsub;; \
  402. X    *) newtop=../ sub=sub;; \
  403. X    esac; \
  404. X    case "$(TOP)" in \
  405. X    /?*) newtop= upprefix= ;; \
  406. X    *) upprefix=../ ;; \
  407. X    esac; \
  408. X    $(MAKE) $${sub}dirMakefiles UPPREFIX=$$upprefix NEWTOP=$$newtop \
  409. X    MAKEFILE_SUBDIR=$$i NEW_CURRENT_DIR=$(CURRENT_DIR)/$$i;\
  410. X    done
  411. X
  412. XsubdirMakefiles:
  413. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  414. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \
  415. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  416. X    else exit 0; fi
  417. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  418. X    $(MAKE) $(MFLAGS) Makefiles
  419. X
  420. XsubsubdirMakefiles:
  421. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  422. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \
  423. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  424. X    else exit 0; fi
  425. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  426. X    $(MAKE) $(MFLAGS) Makefiles
  427. X
  428. XsubsubsubdirMakefiles:
  429. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  430. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \
  431. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  432. X    else exit 0; fi
  433. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  434. X    $(MAKE) $(MFLAGS) Makefiles
  435. X
  436. XsubsubsubsubdirMakefiles:
  437. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  438. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \
  439. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  440. X    else exit 0; fi
  441. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  442. X    $(MAKE) $(MFLAGS) Makefiles
  443. X
  444. Xincludes::
  445. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  446. X    for i in $(SUBDIRS) ;\
  447. X    do \
  448. X    (cd $$i ; echo including "in $(CURRENT_DIR)/$$i..."; \
  449. X    $(MAKE) $(MFLAGS)  includes); \
  450. X    done
  451. X
  452. X# -------------------------------------------------------------------------
  453. X# dependencies generated by makedepend
  454. X
  455. END_OF_FILE
  456. if test 12794 -ne `wc -c <'Makefile'`; then
  457.     echo shar: \"'Makefile'\" unpacked with wrong size!
  458. fi
  459. # end of 'Makefile'
  460. fi
  461. if test -f 'doc/fig2dev.1' -a "${1}" != "-c" ; then 
  462.   echo shar: Will not clobber existing file \"'doc/fig2dev.1'\"
  463. else
  464. echo shar: Extracting \"'doc/fig2dev.1'\" \(11922 characters\)
  465. sed "s/^X//" >'doc/fig2dev.1' <<'END_OF_FILE'
  466. X.TH FIG2DEV 1 "Release 2.1(.8) (Protocol 2.1) Oct 1, 1993"
  467. X.SH NAME
  468. Xfig2dev \- translates Fig code to various graphics languages
  469. X
  470. X.SH SYNOPSIS
  471. X.B fig2dev
  472. X.B \-L
  473. X.I language
  474. X[
  475. X.B \-m
  476. X.I mag
  477. X] [
  478. X.B \-f 
  479. X.I font
  480. X] [
  481. X.B \-s
  482. X.I fsize
  483. X] [
  484. X.I other options
  485. X] [
  486. X\fIfig-file\fR [ \fIout-file\fR ] ]
  487. X
  488. X.SH DESCRIPTION
  489. X.I Fig2dev
  490. Xtranslates fig code in the named
  491. X.I fig-file
  492. Xinto the specified graphics 
  493. X.I language
  494. Xand puts them in
  495. X.I out-file.
  496. XThe default
  497. X.I fig-file
  498. Xand
  499. X.I out-file
  500. Xare standard input and standard output, respectively
  501. X.LP
  502. XFig (Facility for Interactive Generation of figures) is a screen-oriented
  503. Xtool which allows the user to draw and manipulate objects interactively.
  504. XVarious versions of Fig run under the Suntools/Sunview window environment
  505. Xand under version 11 of the X Windows System.
  506. XFig2dev is compatible with Fig versions 1.3, 1.4, 2.0, and 2.1.
  507. X
  508. X.SH OPTIONS
  509. X.TP
  510. X.B \-L
  511. XSet the output graphics language.
  512. XValid languages are
  513. X\fBbox, epic, eepic, eepicemu, ibmgl, latex, null, pic, pictex,
  514. Xps, pstex, pstex_t, textyl,\fR
  515. Xand
  516. X.B tpic.
  517. X.TP
  518. X.B \-m
  519. XSet the magnification at which the figure is rendered to
  520. X.I mag.
  521. XThe default is 1.0.
  522. X.TP
  523. X.B \-f 
  524. XSet the default font used for text objects to
  525. X.I font.
  526. XThe default is Roman; the format of this option depends on the graphics
  527. X.I language
  528. Xin use.
  529. XIn TeX-based languages, the font is the base of the name given in lfonts.tex,
  530. Xfor instance \"cmr\" for Roman, or \"tt\" for teletype.
  531. XIn PostScript, it is any font name known to the printer or interpreter.
  532. X.TP
  533. X.B \-s
  534. XSet the default font size (in points) for text objects to
  535. X.I fsize.
  536. XThe default is 11*mag, and thus is scaled by the \fB-m\fR option.
  537. XIf there is no scaling, the default font is eleven point Roman."
  538. X.TP
  539. X.B \-V
  540. XPrint the program version number only.
  541. X.TP
  542. X.I other options
  543. XThe other options are specific to the choice of graphics
  544. X.I language,
  545. Xas described below.
  546. X
  547. X.SH EPIC OPTIONS
  548. XEPIC is an enhancement to LaTeX picture drawing environment.
  549. XIt was developed by Sunil Podar of Department of Computer Science
  550. Xin S.U.N.Y at Stony Brook.
  551. X.LP
  552. XEEPIC is an extension to EPIC and LaTeX picture drawing environment
  553. Xwhich uses tpic specials as a graphics mechanism.
  554. XIt was written by Conrad Kwok of Division of
  555. XComputer Science at University of California, Davis.
  556. X.LP
  557. XEEPIC-EMU is an EEPIC emulation package which does not use tpic specials.
  558. X.TP
  559. X.B \-l
  560. XUse "\fB\\thicklines\fR" when width of the line is wider than 
  561. X.I lwidth.
  562. XThe default is 2.
  563. X.TP
  564. X.B \-v
  565. XInclude comments in the output file.
  566. X.TP
  567. X.B \-P
  568. XGenerate a complete LaTeX file. In other words, the output file can be
  569. Xformatted without requiring any changes. The additional text inserted
  570. Xin the beginning and at the end of the file is controlled by the
  571. Xconfiguration parameter "Preamble" and "Postamble".
  572. X.TP
  573. X.B \-S
  574. XSet the scale to which the figure is rendered.
  575. XThis option automatically sets the 
  576. X.I magnification
  577. Xand size to
  578. X.I scale
  579. X/ 12 and 
  580. X.I scale
  581. Xrespectively.
  582. X.TP
  583. X.B \-W
  584. XEnable variable line width
  585. X.TP
  586. X.B \-w
  587. XDisable variable line width. Only "\fB\\thicklines\fR" and/or
  588. X"\fB\\thinlines\fR" commands will be generated in the output file.
  589. X.LP
  590. XWhen variable line width option is enabled, "\fB\\thinlines\fR"
  591. Xcommand is still used when line width is less than
  592. X\fILineThick\fR. One potential problem is that the width of
  593. X"\fB\\thinlines\fR" is 0.4pt
  594. Xbut the resolution of Fig is 1/80 inch (approx. 1pt). If
  595. X\fILineThick\fR is set to 2, normal lines will be drawn in 0.4pt
  596. Xwide lines but the next line width is already 2pt. One possible
  597. Xsolution is to set \fILineThick\fR to 1 and set the width of the
  598. Xthose lines you want to be drawn in "\fB\\thinlines\fR"  to 0.
  599. X
  600. XDue to this problem, Variable line width \fIVarWidth\fR
  601. Xis defaulted to be false.
  602. X
  603. X.SH IBM-GL OPTIONS
  604. XIBM-GL (International Business Machines Graphics Language) is compatible
  605. Xwith HP-GL (Hewlett-Packard Graphics Language).
  606. X.TP
  607. X.B \-a
  608. XSelect ISO A4 (ANSI A) paper size if the default is ANSI A (ISO A4) paper size.
  609. X.TP
  610. X.B \-c
  611. XGenerate instructions for an IBM 6180 Color Plotter
  612. Xwith (without) an IBM Graphics Enhancement Cartridge (IBM-GEC).
  613. X.TP
  614. X.B \-d
  615. XRestrict plotting to a rectangular area of the plotter paper which has
  616. Xa lower left hand corner at
  617. X.I (xll,yll)
  618. Xand a upper right hand corner at
  619. X.I (xur,yur).
  620. XAll four numbers are in inches and follow \fB-d\fR in a comma-sparated list -
  621. X.I xll,yll,xur,yur
  622. X- with no spaces between them.
  623. X.TP
  624. X.B \-f
  625. XLoad text character specifications from the table in the
  626. X.I fonts
  627. Xfile.
  628. XThe table must have 36 entries - one for each font plus a default.
  629. XEach entry consists of 5 numbers
  630. Xwhich specify the
  631. X1.) standard character set (0 - 4, 6 - 9, 30 - 39),
  632. X2.) alternate character set (0 - 4, 6 - 9, 30 - 39),
  633. X3.) character slant angle (degrees),
  634. X4.) character width scale factor and
  635. X5.) character height scale factor.
  636. X.TP
  637. X.B \-l
  638. XLoad area fill line patterns from the table in the
  639. X.I patterns
  640. Xfile.
  641. XThe table must have 21 entries - one for each of the area fill patterns.
  642. XEach entry consists of 5 numbers which specify the
  643. X1.) pattern number (-1 - 6),
  644. X2.) pattern length (inches),
  645. X3.) fill type (1 - 5),
  646. X4.) fill spacing (inches) and
  647. X5.) fill angle (degrees).
  648. X.TP
  649. X.B \-m
  650. XThe magnification may appear as the first element in a comma sepatated list -
  651. X.I mag,x0,y0
  652. X- where the second and third parameters specify an offset in inches.
  653. X.TP
  654. X.B \-p
  655. XLoad plotter pen specifications from the table in the
  656. X.I pens
  657. Xfile.
  658. XThe table must have 9 entries - one for each color plus a default.
  659. XEach entry consists of 2 numbers which specify the
  660. X1.) pen number (1 - 8) and
  661. X2.) pen thickness (millimeters).
  662. X.TP
  663. X.B \-P
  664. XRotate the figure to portrait mode. The default is landscape mode.
  665. X.TP
  666. X.B \-S
  667. XSet the pen speed to
  668. X.I speed
  669. X(centimeters/second).
  670. X.TP
  671. X.B \-v
  672. XPlot the figure upside-down in portrait mode or backwards in landscape mode.
  673. XThis allows you to write on the top surface of overhead transparencies without
  674. Xdisturbing the plotter ink on the bottom surface.
  675. X.LP
  676. XFig2dev may be installed with either ANSI A or ISO A4 default paper size.
  677. XThe \fB-a\fR option selects the alternate paper size.
  678. XFig2dev does not fill closed splines.
  679. XThe IBM-GEC is required to fill other polygons.
  680. XFig2dev may be installed for plotters with or without the IBM-GEC.
  681. XThe \fB-c\fR option selects the alternate instruction set.
  682. X
  683. X.SH LATEX OPTIONS
  684. X.TP
  685. X.B \-l
  686. XSets the threshold between LaTeX thin and thick lines to 
  687. X.I lwidth
  688. Xpixels.
  689. XLaTeX supports only two different line width: \\thinlines and \\thicklines.
  690. XLines of width greater than
  691. X.I lwidth
  692. Xpixels are drawn as \\thicklines.
  693. XAlso affects the size of dots in dotted line style.
  694. XThe default is 1.
  695. X.TP
  696. X.B \-d
  697. XSet a separate magnification for the length of line dashes to
  698. X.I dmag.
  699. X.TP
  700. X.B \-v
  701. XVerbose mode.
  702. X.LP
  703. XLaTeX cannot accurately represent all the graphics objects which can
  704. Xbe described by Fig.
  705. XFor example, the possible slopes which lines may have are limited.
  706. XSome objects, such as spline curves, cannot be drawn at all.
  707. XFig2latex chooses the closest possible line slope, and prints error
  708. Xmessages when objects cannot be drawn accurately
  709. X
  710. X.SH PIC OPTIONS
  711. X.TP
  712. X.B -p
  713. XEnables the use of certain PIC extensions which are known to work with
  714. Xthe groff package; compatibility with DWB PIC is unknown.
  715. XThe extensions enabled by each option are:
  716. X.LP
  717. X.TP
  718. X.B arc
  719. XAllow ARC_BOX i.e. use rounded corners
  720. X.TP
  721. X.B line
  722. XUse the 'line_thickness' value
  723. X.TP
  724. X.B fill
  725. XAllow ellipses to be filled
  726. X.TP
  727. X.B all
  728. XUse all of the above
  729. X.TP
  730. X.B psfont
  731. XDon't convert Postscript fonts generic type (useful for files going to be
  732. XDitroff'ed for and printed on PS printer). DWB-compatible.
  733. X.TP
  734. X.B allps
  735. XUse all of the above (i.e. "all" + "psfont")
  736. X.EP
  737. X.EP
  738. X
  739. X.SH PICTEX OUTPUT
  740. XIn order to include PiCTeX pictures into a document, it is necessary to
  741. Xload the PiCTeX macros.
  742. X.LP
  743. XPiCTeX uses TeX integer register arithmetic to generate curves,
  744. Xand so it is very slow.
  745. XPiCTeX draws curves by \fB\\put\fR-ing the \fIpsymbol\fR repeatedly,
  746. Xand so requires a large amount of TeX's internal memory,
  747. Xand generates large DVI files.
  748. XThe size of TeX's memory limits the number of plot symbols in a picture.
  749. XAs a result, it is best to use PiCTeX to generate small pictures.
  750. X
  751. X.SH POSTSCRIPT OPTIONS
  752. XWith PostScript, Fig can be used to create large posters. The figure
  753. Xwill be created by printing multiple pages which can be glued together.
  754. XDue to memory limitations of most laser printers, the figure should not
  755. Xbe too complicated. Great for text with very big letters.
  756. X.LP
  757. XText can now include various ISO-character codes above 0x7f, which is
  758. Xuseful for language specific characters to be printed directly.
  759. XNot all ISO-characters are implemented.
  760. X.LP
  761. XColor support: Colored objects created by Fig can be printed
  762. Xon a color postscript printer. Currently 8 colors are
  763. Xsupported: black, blue, green, cyan, red, magenta, yellow, white.
  764. XOn a monochrome printer, colored objects will be mapped into different
  765. Xgrayscales.
  766. XFilled objects are printed using the given grayscale. If filled
  767. Xwith grayscale set to 100%, the object will be filled with the same
  768. Xcolor as the enclosing line.
  769. X.TP
  770. X.B -c
  771. Xoption centers the figure on the page.
  772. XThe centering may not be accurate if there are texts in the
  773. X.I fig_file
  774. Xthat extends too far to the right of other objects.
  775. X.TP
  776. X.B -l dummy_arg
  777. XRotate figure to landscape mode.  The dummy argument is ignored,
  778. Xbut must appear on the command line for reasons of compatibility.
  779. X.TP
  780. X.B -P
  781. Xindicates that the figure describes a full page which will not
  782. Xnecessarily be inserted into a document, but can be sent directly
  783. Xto a PS printer.
  784. XThis ensures that a showpage command is inserted at the end of
  785. Xthe figure, and inhibits translation of the figure coordinate system.
  786. X.LP
  787. X
  788. X.SH PSTEX OPTIONS
  789. X.TP
  790. XThe
  791. X.B pstex
  792. Xlanguage is a variant of
  793. X.B ps
  794. Xwhich suppresses formatted (special) text.
  795. XThe
  796. X.B pstex_t
  797. Xlanguage has the complementary behavior: it generates only LaTeX commands
  798. Xnecessary to position special text, and to overlay the
  799. XPostScript file generated using
  800. X.B pstex.
  801. XThese two drivers can be used to generate a figure which combines the
  802. Xflexibility of PostScript graphics with LaTeX text formatting of
  803. Xspecial text.
  804. X.TP
  805. XThe
  806. X.B pstex_t
  807. Xoption 
  808. X.B -p file
  809. Xspecifies the name of the PostScript file to be overlaid.
  810. XIf not set or its value is null then no PS file will be inserted.
  811. X.LP
  812. X
  813. X.SH TEXTYL OPTIONS
  814. XThere are no TeXtyl-specific options.
  815. X
  816. X.SH TPIC OPTIONS
  817. XThere are no tpic-specific options.
  818. X
  819. X.SH "SEE ALSO"
  820. X[x]fig(1),
  821. Xpic(1)
  822. Xpic2fig(1),
  823. Xtransfig(1)
  824. X.SH COPYRIGHT
  825. XCopyright (c) 1985 Supoj Sutantavibul
  826. X.br
  827. XCopyright (c) 1991 Micah Beck
  828. X.LP
  829. XPermission to use, copy, modify, distribute, and sell this software and its
  830. Xdocumentation for any purpose is hereby granted without fee, provided that
  831. Xthe above copyright notice appear in all copies and that both that
  832. Xcopyright notice and this permission notice appear in supporting
  833. Xdocumentation. The authors make no representations about the suitability 
  834. Xof this software for any purpose.  It is provided "as is" without express 
  835. Xor implied warranty.
  836. X.LP
  837. XTHE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  838. XINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  839. XEVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  840. XCONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  841. XDATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  842. XTORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  843. XPERFORMANCE OF THIS SOFTWARE.
  844. X.SH AUTHORS
  845. XMicah Beck
  846. X.br
  847. XCornell University
  848. X.br
  849. XSept 28 1990
  850. X.sp
  851. Xand Frank Schmuck (then of Cornell University)
  852. X.br
  853. Xand Conrad Kwok (then of U.C. Davis).
  854. X.sp
  855. Xdrivers contributed by
  856. X.br
  857. XJose Alberto Fernandez R. (U. of Maryland)
  858. X.br
  859. Xand Gary Beihl (MCC)
  860. X.sp
  861. XColor support, ISO-character encoding and poster support by
  862. X.br
  863. XHerbert Bauer (heb@regent.e-technik.tu-muenchen.de)
  864. X.sp
  865. XModified from f2p (fig to PIC), by the author of Fig
  866. X.br
  867. XSupoj Sutanthavibul (supoj@sally.utexas.edu)
  868. X.br
  869. XUniversity of Texas at Austin. 
  870. X
  871. END_OF_FILE
  872. if test 11922 -ne `wc -c <'doc/fig2dev.1'`; then
  873.     echo shar: \"'doc/fig2dev.1'\" unpacked with wrong size!
  874. fi
  875. # end of 'doc/fig2dev.1'
  876. fi
  877. if test -f 'fig2dev/bound.c' -a "${1}" != "-c" ; then 
  878.   echo shar: Will not clobber existing file \"'fig2dev/bound.c'\"
  879. else
  880. echo shar: Extracting \"'fig2dev/bound.c'\" \(12109 characters\)
  881. sed "s/^X//" >'fig2dev/bound.c' <<'END_OF_FILE'
  882. X/*
  883. X * TransFig: Facility for Translating Fig code
  884. X * Copyright (c) 1985 Supoj Sutantavibul
  885. X * Copyright (c) 1991 Micah Beck
  886. X *
  887. X * Permission to use, copy, modify, distribute, and sell this software and its
  888. X * documentation for any purpose is hereby granted without fee, provided that
  889. X * the above copyright notice appear in all copies and that both that
  890. X * copyright notice and this permission notice appear in supporting
  891. X * documentation. The authors make no representations about the suitability 
  892. X * of this software for any purpose.  It is provided "as is" without express 
  893. X * or implied warranty.
  894. X *
  895. X * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  896. X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  897. X * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  898. X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  899. X * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  900. X * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  901. X * PERFORMANCE OF THIS SOFTWARE.
  902. X *
  903. X */
  904. X
  905. X#include <stdio.h>
  906. X#include <math.h>
  907. X#include "pi.h"
  908. X#include "object.h"
  909. X
  910. X#define        Ninety_deg        M_PI_2
  911. X#define        One_eighty_deg        M_PI
  912. X#define        Two_seventy_deg        (M_PI + M_PI_2)
  913. X#define        Three_sixty_deg        (M_PI + M_PI)
  914. X#define        round(x)        ((int) ((x) + ((x >= 0)? 0.5: -0.5)))
  915. X#define        half(z1 ,z2)        ((z1+z2)/2.0)
  916. X#define        max(a, b)        (((a) > (b)) ? (a) : (b))
  917. X#define        min(a, b)        (((a) < (b)) ? (a) : (b))
  918. X
  919. Xarc_bound(arc, xmin, ymin, xmax, ymax)
  920. XF_arc    *arc;
  921. Xint    *xmin, *ymin, *xmax, *ymax;
  922. X{
  923. X    double    alpha, beta;
  924. X    double    dx, dy, radius;
  925. X    int    bx, by, sx, sy;
  926. X
  927. X    dx = arc->point[0].x - arc->center.x;
  928. X    dy = arc->center.y - arc->point[0].y;
  929. X    alpha = atan2(dy, dx);
  930. X    if (alpha < 0.0) alpha += Three_sixty_deg;
  931. X    /* compute_angle returns value between 0 to 2PI */
  932. X    
  933. X    radius = hypot(dx, dy);
  934. X
  935. X    dx = arc->point[2].x - arc->center.x;
  936. X    dy = arc->center.y - arc->point[2].y;
  937. X    beta = atan2(dy, dx);
  938. X    if (beta < 0.0) beta += Three_sixty_deg;
  939. X
  940. X    bx = max(arc->point[0].x, arc->point[1].x);
  941. X    bx = max(arc->point[2].x, bx);
  942. X    by = max(arc->point[0].y, arc->point[1].y);
  943. X    by = max(arc->point[2].y, by);
  944. X    sx = min(arc->point[0].x, arc->point[1].x);
  945. X    sx = min(arc->point[2].x, sx);
  946. X    sy = min(arc->point[0].y, arc->point[1].y);
  947. X    sy = min(arc->point[2].y, sy);
  948. X
  949. X    if (arc->direction == 1) { /* counter clockwise */
  950. X        if (alpha > beta) {
  951. X        if (alpha <= 0 || 0 <= beta)
  952. X            bx = (int)(arc->center.x + radius + 1.0);
  953. X        if (alpha <= Ninety_deg || Ninety_deg <= beta)
  954. X            sy = (int)(arc->center.y - radius - 1.0);
  955. X        if (alpha <= One_eighty_deg || One_eighty_deg <= beta)
  956. X            sx = (int)(arc->center.x - radius - 1.0);
  957. X        if (alpha <= Two_seventy_deg || Two_seventy_deg <= beta)
  958. X            by = (int)(arc->center.y + radius + 1.0);
  959. X        }
  960. X        else {
  961. X        if (0 <= beta && alpha <= 0)
  962. X            bx = (int)(arc->center.x + radius + 1.0);
  963. X        if (Ninety_deg <= beta && alpha <= Ninety_deg)
  964. X            sy = (int)(arc->center.y - radius - 1.0);
  965. X        if (One_eighty_deg <= beta && alpha <= One_eighty_deg)
  966. X            sx = (int)(arc->center.x - radius - 1.0);
  967. X        if (Two_seventy_deg <= beta && alpha <= Two_seventy_deg)
  968. X            by = (int)(arc->center.y + radius + 1.0);
  969. X        }
  970. X        }
  971. X    else {    /* clockwise    */
  972. X        if (alpha > beta) {
  973. X        if (beta <= 0 && 0 <= alpha)
  974. X            bx = (int)(arc->center.x + radius + 1.0);
  975. X        if (beta <= Ninety_deg && Ninety_deg <= alpha)
  976. X            sy = (int)(arc->center.y - radius - 1.0);
  977. X        if (beta <= One_eighty_deg && One_eighty_deg <= alpha)
  978. X            sx = (int)(arc->center.x - radius - 1.0);
  979. X        if (beta <= Two_seventy_deg && Two_seventy_deg <= alpha)
  980. X            by = (int)(arc->center.y + radius + 1.0);
  981. X        }
  982. X        else {
  983. X        if (0 <= alpha || beta <= 0)
  984. X            bx = (int)(arc->center.x + radius + 1.0);
  985. X        if (Ninety_deg <= alpha || beta <= Ninety_deg)
  986. X            sy = (int)(arc->center.y - radius - 1.0);
  987. X        if (One_eighty_deg <= alpha || beta <= One_eighty_deg)
  988. X            sx = (int)(arc->center.x - radius - 1.0);
  989. X        if (Two_seventy_deg <= alpha || beta <= Two_seventy_deg)
  990. X            by = (int)(arc->center.y + radius + 1.0);
  991. X        }
  992. X        }
  993. X    *xmax = bx; *ymax = by;
  994. X    *xmin = sx; *ymin = sy;
  995. X    }
  996. X
  997. Xcompound_bound(compound, xmin, ymin, xmax, ymax, include)
  998. XF_compound    *compound;
  999. Xint        *xmin, *ymin, *xmax, *ymax;
  1000. Xint        include;
  1001. X{
  1002. X    F_arc        *a;
  1003. X    F_ellipse    *e;
  1004. X    F_compound    *c;
  1005. X    F_spline    *s;
  1006. X    F_line        *l;
  1007. X    F_text        *t;
  1008. X    int        bx, by, sx, sy, first = 1;
  1009. X    int        llx, lly, urx, ury;
  1010. X
  1011. X   while(compound != NULL)
  1012. X   {
  1013. X    for (a = compound->arcs; a != NULL; a = a->next) {
  1014. X        arc_bound(a, &sx, &sy, &bx, &by);
  1015. X        if (first) {
  1016. X        first = 0;
  1017. X        llx = sx; lly = sy;
  1018. X        urx = bx; ury = by;
  1019. X        }
  1020. X        else {
  1021. X        llx = min(llx, sx); lly = min(lly, sy);
  1022. X        urx = max(urx, bx); ury = max(ury, by);
  1023. X        }
  1024. X        }
  1025. X
  1026. X    for (c = compound->compounds; c != NULL; c = c->next) {
  1027. X        compound_bound(c, &sx, &sy, &bx, &by);
  1028. X        if (first) {
  1029. X        first = 0;
  1030. X        llx = sx; lly = sy;
  1031. X        urx = bx; ury = by;
  1032. X        }
  1033. X        else {
  1034. X        llx = min(llx, sx); lly = min(lly, sy);
  1035. X        urx = max(urx, bx); ury = max(ury, by);
  1036. X        }
  1037. X        }
  1038. X
  1039. X    for (e = compound->ellipses; e != NULL; e = e->next) {
  1040. X        ellipse_bound(e, &sx, &sy, &bx, &by);
  1041. X        if (first) {
  1042. X        first = 0;
  1043. X        llx = sx; lly = sy;
  1044. X        urx = bx; ury = by;
  1045. X        }
  1046. X        else {
  1047. X        llx = min(llx, sx); lly = min(lly, sy);
  1048. X        urx = max(urx, bx); ury = max(ury, by);
  1049. X        }
  1050. X        }
  1051. X
  1052. X    for (l = compound->lines; l != NULL; l = l->next) {
  1053. X        line_bound(l, &sx, &sy, &bx, &by);
  1054. X        if (first) {
  1055. X        first = 0;
  1056. X        llx = sx; lly = sy;
  1057. X        urx = bx; ury = by;
  1058. X        }
  1059. X        else {
  1060. X        llx = min(llx, sx); lly = min(lly, sy);
  1061. X        urx = max(urx, bx); ury = max(ury, by);
  1062. X        }
  1063. X        }
  1064. X
  1065. X    for (s = compound->splines; s != NULL; s = s->next) {
  1066. X        spline_bound(s, &sx, &sy, &bx, &by);
  1067. X        if (first) {
  1068. X        first = 0;
  1069. X        llx = sx; lly = sy;
  1070. X        urx = bx; ury = by;
  1071. X        }
  1072. X        else {
  1073. X        llx = min(llx, sx); lly = min(lly, sy);
  1074. X        urx = max(urx, bx); ury = max(ury, by);
  1075. X        }
  1076. X        }
  1077. X
  1078. X    for (t = compound->texts; t != NULL; t = t->next) {
  1079. X        text_bound(t, &sx, &sy, &bx, &by, include);
  1080. X        if (first) {
  1081. X        first = 0;
  1082. X        llx = sx; lly = sy;
  1083. X        urx = bx; ury = by;
  1084. X        }
  1085. X        else {
  1086. X        llx = min(llx, sx); lly = min(lly, sy);
  1087. X        urx = max(urx, bx); ury = max(ury, by);
  1088. X        }
  1089. X        }
  1090. X        compound = compound->next;
  1091. X     }
  1092. X
  1093. X    *xmin = llx; *ymin = lly;
  1094. X    *xmax = urx; *ymax = ury;
  1095. X    }
  1096. X
  1097. Xellipse_bound(e, xmin, ymin, xmax, ymax)
  1098. XF_ellipse    *e;
  1099. Xint        *xmin, *ymin, *xmax, *ymax;
  1100. X{
  1101. X    *xmin = e->center.x - e->radiuses.x;
  1102. X    *ymin = e->center.y - e->radiuses.y;
  1103. X    *xmax = e->center.x + e->radiuses.x;
  1104. X    *ymax = e->center.y + e->radiuses.y;
  1105. X    }
  1106. X
  1107. Xline_bound(l, xmin, ymin, xmax, ymax)
  1108. XF_line    *l;
  1109. Xint    *xmin, *ymin, *xmax, *ymax;
  1110. X{
  1111. X    points_bound(l->points, xmin, ymin, xmax, ymax);
  1112. X    }
  1113. X
  1114. Xspline_bound(s, xmin, ymin, xmax, ymax)
  1115. XF_spline    *s;
  1116. Xint        *xmin, *ymin, *xmax, *ymax;
  1117. X{
  1118. X    if (int_spline(s)) {
  1119. X        int_spline_bound(s, xmin, ymin, xmax, ymax);
  1120. X        }
  1121. X    else {
  1122. X        normal_spline_bound(s, xmin, ymin, xmax, ymax);
  1123. X        }
  1124. X    }
  1125. X
  1126. Xint_spline_bound(s, xmin, ymin, xmax, ymax)
  1127. XF_spline    *s;
  1128. Xint        *xmin, *ymin, *xmax, *ymax;
  1129. X{
  1130. X    F_point        *p1, *p2;
  1131. X    F_control    *cp1, *cp2;
  1132. X    double        x0, y0, x1, y1, x2, y2, x3, y3, sx1, sy1, sx2, sy2;
  1133. X    double        tx, ty, tx1, ty1, tx2, ty2;
  1134. X    double        sx, sy, bx, by;
  1135. X
  1136. X    p1 = s->points;
  1137. X    sx = bx = p1->x;
  1138. X    sy = by = p1->y;
  1139. X    cp1 = s->controls;
  1140. X    for (p2 = p1->next, cp2 = cp1->next; p2 != NULL;
  1141. X        p1 = p2, cp1 = cp2, p2 = p2->next, cp2 = cp2->next) {
  1142. X        x0 = p1->x; y0 = p1->y;
  1143. X        x1 = cp1->rx; y1 = cp1->ry;
  1144. X        x2 = cp2->lx; y2 = cp2->ly;
  1145. X        x3 = p2->x; y3 = p2->y;
  1146. X        tx = half(x1, x2); ty = half(y1, y2);
  1147. X        sx1 = half(x0, x1); sy1 = half(y0, y1);
  1148. X        sx2 = half(sx1, tx); sy2 = half(sy1, ty);
  1149. X        tx2 = half(x2, x3); ty2 = half(y2, y3);
  1150. X        tx1 = half(tx2, tx); ty1 = half(ty2, ty);
  1151. X
  1152. X        sx = min(x0, sx); sy = min(y0, sy);
  1153. X        sx = min(sx1, sx); sy = min(sy1, sy);
  1154. X        sx = min(sx2, sx); sy = min(sy2, sy);
  1155. X        sx = min(tx1, sx); sy = min(ty1, sy);
  1156. X        sx = min(tx2, sx); sy = min(ty2, sy);
  1157. X        sx = min(x3, sx); sy = min(y3, sy);
  1158. X
  1159. X        bx = max(x0, bx); by = max(y0, by);
  1160. X        bx = max(sx1, bx); by = max(sy1, by);
  1161. X        bx = max(sx2, bx); by = max(sy2, by);
  1162. X        bx = max(tx1, bx); by = max(ty1, by);
  1163. X        bx = max(tx2, bx); by = max(ty2, by);
  1164. X        bx = max(x3, bx); by = max(y3, by);
  1165. X        }
  1166. X    *xmin = round(sx);
  1167. X    *ymin = round(sy);
  1168. X    *xmax = round(bx);
  1169. X    *ymax = round(by);
  1170. X    }
  1171. X
  1172. Xnormal_spline_bound(s, xmin, ymin, xmax, ymax)
  1173. XF_spline    *s;
  1174. Xint        *xmin, *ymin, *xmax, *ymax;
  1175. X{
  1176. X    F_point    *p;
  1177. X    double    cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
  1178. X    double    x1, y1, x2, y2, sx, sy, bx, by;
  1179. X    double    px, py, qx, qy;
  1180. X
  1181. X    p = s->points;
  1182. X    x1 = p->x;  y1 = p->y;
  1183. X    p = p->next;
  1184. X    x2 = p->x;  y2 = p->y;
  1185. X    cx1 = (x1 + x2) / 2.0;   cy1 = (y1 + y2) / 2.0;
  1186. X    cx2 = (cx1 + x2) / 2.0;  cy2 = (cy1 + y2) / 2.0;
  1187. X    if (closed_spline(s)) {
  1188. X        x1 = (cx1 + x1) / 2.0;
  1189. X        y1 = (cy1 + y1) / 2.0;
  1190. X        }
  1191. X    sx = min(x1, cx2); sy = min(y1, cy2);
  1192. X    bx = max(x1, cx2); by = max(y1, cy2);
  1193. X
  1194. X    for (p = p->next; p != NULL; p = p->next) {
  1195. X        x1 = x2;  y1 = y2;
  1196. X        x2 = p->x;  y2 = p->y;
  1197. X        cx4 = (x1 + x2) / 2.0; cy4 = (y1 + y2) / 2.0;
  1198. X        cx3 = (x1 + cx4) / 2.0; cy3 = (y1 + cy4) / 2.0;
  1199. X        cx2 = (cx4 + x2) / 2.0;  cy2 = (cy4 + y2) / 2.0;
  1200. X
  1201. X        px = min(cx2, cx3); py = min(cy2, cy3);
  1202. X        qx = max(cx2, cx3); qy = max(cy2, cy3);
  1203. X
  1204. X        sx = min(sx, px); sy = min(sy, py);
  1205. X        bx = max(bx, qx); by = max(by, qy);
  1206. X        }
  1207. X    if (closed_spline(s)) {
  1208. X        *xmin = round(sx); *ymin = round(sy);
  1209. X        *xmax = round(bx); *ymax = round(by);
  1210. X        }
  1211. X    else {
  1212. X        *xmin = round(min(sx, x2)); *ymin = round(min(sy, y2));
  1213. X        *xmax = round(max(bx, x2)); *ymax = round(max(by, y2));
  1214. X        }
  1215. X    }
  1216. X
  1217. Xdouble rot_x(x,y,angle) 
  1218. Xdouble x,y,angle;
  1219. X{
  1220. X    return(x*cos(-angle)-y*sin(-angle));
  1221. X}
  1222. X
  1223. Xdouble rot_y(x,y,angle)
  1224. Xdouble x,y,angle;
  1225. X{
  1226. X return(x*sin(-angle)+y*cos(-angle));
  1227. X}
  1228. X
  1229. X
  1230. Xtext_bound(t, xmin, ymin, xmax, ymax, include)
  1231. XF_text    *t;
  1232. Xint    *xmin, *ymin, *xmax, *ymax;
  1233. Xint    include;
  1234. X{
  1235. X    double dx1, dx2, dx3, dx4, dy1, dy2, dy3, dy4;
  1236. X
  1237. X    if (t->type == T_CENTER_JUSTIFIED) {
  1238. X        dx1 = (t->length/2);     dy1 = 0.0;
  1239. X        dx2 = -(t->length/2);    dy2 = 0.0;
  1240. X        dx3 = (t->length/2);     dy3 = -t->height;
  1241. X        dx4 = -(t->length/2);    dy4 = -t->height;
  1242. X    } else if (t->type == T_RIGHT_JUSTIFIED) {
  1243. X        dx1 = 0.0;               dy1 = 0.0;
  1244. X        dx2 = -t->length;        dy2 = 0.0;
  1245. X        dx3 = 0.0;               dy3 = -t->height;
  1246. X        dx4 = -t->length;        dy4 = -t->height;
  1247. X    } else {
  1248. X        dx1 = (include ? t->length : 0); dy1 = 0.0;
  1249. X        dx2 = 0.0;                       dy2 = 0.0;
  1250. X        dx3 = (include ? t->length : 0); dy3 = -t->height;
  1251. X        dx4 = 0.0;                       dy4 = -t->height;
  1252. X    }
  1253. X    *xmax= t->base_x +
  1254. X           max( max( rot_x(dx1,dy1,t->angle), rot_x(dx2,dy2,t->angle) ), 
  1255. X            max( rot_x(dx3,dy3,t->angle), rot_x(dx4,dy4,t->angle) ) );
  1256. X    *ymax= t->base_y + 
  1257. X           max( max( rot_y(dx1,dy1,t->angle), rot_y(dx2,dy2,t->angle) ), 
  1258. X            max( rot_y(dx3,dy3,t->angle), rot_y(dx4,dy4,t->angle) ) );
  1259. X
  1260. X    *xmin= t->base_x + 
  1261. X           min( min( rot_x(dx1,dy1,t->angle), rot_x(dx2,dy2,t->angle) ), 
  1262. X            min( rot_x(dx3,dy3,t->angle), rot_x(dx4,dy4,t->angle) ) );
  1263. X    *ymin= t->base_y + 
  1264. X           min( min( rot_y(dx1,dy1,t->angle), rot_y(dx2,dy2,t->angle) ), 
  1265. X            min( rot_y(dx3,dy3,t->angle), rot_y(dx4,dy4,t->angle) ) );
  1266. X    }
  1267. X
  1268. Xpoints_bound(points, xmin, ymin, xmax, ymax)
  1269. XF_point    *points;
  1270. Xint    *xmin, *ymin, *xmax, *ymax;
  1271. X{
  1272. X    int    bx, by, sx, sy;
  1273. X    F_point    *p;
  1274. X
  1275. X    bx = sx = points->x; by = sy = points->y;
  1276. X    for (p = points->next; p != NULL; p = p->next) {
  1277. X        sx = min(sx, p->x); sy = min(sy, p->y);
  1278. X        bx = max(bx, p->x); by = max(by, p->y);
  1279. X        }
  1280. X    *xmin = sx; *ymin = sy;
  1281. X    *xmax = bx; *ymax = by;
  1282. X    }
  1283. X
  1284. Xcontrol_points_bound(cps, xmin, ymin, xmax, ymax)
  1285. XF_control    *cps;
  1286. Xint        *xmin, *ymin, *xmax, *ymax;
  1287. X{
  1288. X    F_control    *c;
  1289. X    double        bx, by, sx, sy;
  1290. X
  1291. X    bx = sx = cps->lx;
  1292. X    by = sy = cps->ly;
  1293. X    sx = min(sx, cps->rx); sy = min(sy, cps->ry);
  1294. X    bx = max(bx, cps->rx); by = max(by, cps->ry);
  1295. X    for (c = cps->next; c != NULL; c = c->next) {
  1296. X        sx = min(sx, c->lx); sy = min(sy, c->ly);
  1297. X        bx = max(bx, c->lx); by = max(by, c->ly);
  1298. X        sx = min(sx, c->rx); sy = min(sy, c->ry);
  1299. X        bx = max(bx, c->rx); by = max(by, c->ry);
  1300. X        }
  1301. X    *xmin = round(sx); *ymin = round(sy);
  1302. X    *xmax = round(bx); *ymax = round(by);
  1303. X    }
  1304. END_OF_FILE
  1305. if test 12109 -ne `wc -c <'fig2dev/bound.c'`; then
  1306.     echo shar: \"'fig2dev/bound.c'\" unpacked with wrong size!
  1307. fi
  1308. # end of 'fig2dev/bound.c'
  1309. fi
  1310. if test -f 'fig2dev/read1_3.c' -a "${1}" != "-c" ; then 
  1311.   echo shar: Will not clobber existing file \"'fig2dev/read1_3.c'\"
  1312. else
  1313. echo shar: Extracting \"'fig2dev/read1_3.c'\" \(10940 characters\)
  1314. sed "s/^X//" >'fig2dev/read1_3.c' <<'END_OF_FILE'
  1315. X/*
  1316. X * TransFig: Facility for Translating Fig code
  1317. X * Copyright (c) 1985 Supoj Sutantavibul
  1318. X * Copyright (c) 1991 Micah Beck
  1319. X *
  1320. X * Permission to use, copy, modify, distribute, and sell this software and its
  1321. X * documentation for any purpose is hereby granted without fee, provided that
  1322. X * the above copyright notice appear in all copies and that both that
  1323. X * copyright notice and this permission notice appear in supporting
  1324. X * documentation. The authors make no representations about the suitability 
  1325. X * of this software for any purpose.  It is provided "as is" without express 
  1326. X * or implied warranty.
  1327. X *
  1328. X * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  1329. X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  1330. X * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  1331. X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  1332. X * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  1333. X * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1334. X * PERFORMANCE OF THIS SOFTWARE.
  1335. X *
  1336. X */
  1337. X
  1338. X/*******************************************************************/
  1339. X/***************       Read version 1.3 format       ***************/
  1340. X/*******************************************************************/
  1341. X#include <stdio.h>
  1342. X#include <sys/types.h>
  1343. X#include <sys/stat.h>
  1344. X#include <errno.h>
  1345. X#include "alloc.h"
  1346. X#include "object.h"
  1347. X
  1348. X/*******    Fig 1.3 subtype of objects    *******/
  1349. X#define            DRAW_ELLIPSE_BY_RAD     1
  1350. X#define            DRAW_ELLIPSE_BY_DIA     2
  1351. X#define            DRAW_CIRCLE_BY_RAD     3
  1352. X#define            DRAW_CIRCLE_BY_DIA     4
  1353. X#define            DRAW_CIRCULAR_ARC    5
  1354. X#define            DRAW_POLYLINE        6
  1355. X#define            DRAW_BOX        7
  1356. X#define            DRAW_POLYGON        8
  1357. X#define            DRAW_TEXT        9
  1358. X#define            DRAW_SPLINE        10
  1359. X#define            DRAW_CLOSEDSPLINE    11
  1360. X#define            DRAW_COMPOUND        13
  1361. X
  1362. Xextern F_arrow        *forward_arrow(), *backward_arrow();
  1363. Xextern int        figure_modified;
  1364. Xextern int        errno;
  1365. Xextern char        *sys_errlist[];
  1366. Xextern int        sys_nerr, errno;
  1367. X
  1368. Xstatic F_ellipse    *read_ellipseobject();
  1369. Xstatic F_line        *read_lineobject();
  1370. Xstatic F_text        *read_textobject();
  1371. Xstatic F_spline        *read_splineobject();
  1372. Xstatic F_arc        *read_arcobject();
  1373. Xstatic F_compound    *read_compoundobject();
  1374. X
  1375. Xextern int        line_no;
  1376. Xextern int        num_object;
  1377. X
  1378. Xint
  1379. Xread_1_3_objects(fp, obj)
  1380. XFILE        *fp;
  1381. XF_compound    *obj;
  1382. X{
  1383. X    F_ellipse    *e, *le = NULL;
  1384. X    F_line        *l, *ll = NULL;
  1385. X    F_text        *t, *lt = NULL;
  1386. X    F_spline    *s, *ls = NULL;
  1387. X    F_arc        *a, *la = NULL;
  1388. X    F_compound    *c, *lc = NULL;
  1389. X    int         n;
  1390. X    int         object, pixperinch, canvaswid, canvasht, coord_sys;
  1391. X
  1392. X    n = fscanf(fp,"%d%d%d%d\n", &pixperinch, &coord_sys, &canvaswid, &canvasht);
  1393. X    if (n != 4) {
  1394. X        put_msg("Incorrect format in the first line in input file");
  1395. X        return(-1);
  1396. X        }
  1397. X    obj->nwcorner.x = pixperinch;
  1398. X    obj->nwcorner.y = coord_sys;
  1399. X    while (fscanf(fp, "%d", &object) == 1) {
  1400. X        switch (object) {
  1401. X        case O_POLYLINE :
  1402. X            if ((l = read_lineobject(fp)) == NULL) return(-1);
  1403. X            if (ll)
  1404. X            ll = (ll->next = l);
  1405. X            else
  1406. X            ll = obj->lines = l;
  1407. X            num_object++;
  1408. X            break;
  1409. X        case O_SPLINE :
  1410. X            if ((s = read_splineobject(fp)) == NULL) return(-1);
  1411. X            if (ls)
  1412. X            ls = (ls->next = s);
  1413. X            else
  1414. X            ls = obj->splines = s;
  1415. X            num_object++;
  1416. X            break;
  1417. X        case O_ELLIPSE :
  1418. X            if ((e = read_ellipseobject(fp)) == NULL) return(-1);
  1419. X            if (le)
  1420. X            le = (le->next = e);
  1421. X            else
  1422. X            le = obj->ellipses = e;
  1423. X            num_object++;
  1424. X            break;
  1425. X        case O_ARC :
  1426. X            if ((a = read_arcobject(fp)) == NULL) return(-1);
  1427. X            if (la)
  1428. X            la = (la->next = a);
  1429. X            else
  1430. X            la = obj->arcs = a;
  1431. X            num_object++;
  1432. X            break;
  1433. X        case O_TEXT :
  1434. X            if ((t = read_textobject(fp)) == NULL) return(-1);
  1435. X            if (lt)
  1436. X            lt = (lt->next = t);
  1437. X            else
  1438. X            lt = obj->texts = t;
  1439. X            num_object++;
  1440. X            break;
  1441. X        case O_COMPOUND :
  1442. X            if ((c = read_compoundobject(fp)) == NULL) return(-1);
  1443. X            if (lc)
  1444. X            lc = (lc->next = c);
  1445. X            else
  1446. X            lc = obj->compounds = c;
  1447. X            num_object++;
  1448. X            break;
  1449. X        default:
  1450. X            put_msg("Incorrect object code %d", object);
  1451. X            return(-1);
  1452. X        } /*  switch */
  1453. X        } /*  while */
  1454. X    if (feof(fp))
  1455. X        return(0);
  1456. X    else
  1457. X        return(errno);
  1458. X    }
  1459. X
  1460. Xstatic F_arc *
  1461. Xread_arcobject(fp)
  1462. XFILE    *fp;
  1463. X{
  1464. X    F_arc    *a;
  1465. X    int    f, b, h, w, n;
  1466. X
  1467. X    Arc_malloc(a);
  1468. X    a->type = T_3_POINTS_ARC;
  1469. X          a->color = BLACK_COLOR;
  1470. X    a->depth = 0;
  1471. X    a->pen = 0;
  1472. X    a->for_arrow = NULL;
  1473. X    a->back_arrow = NULL;
  1474. X    a->next = NULL;
  1475. X    n = fscanf(fp, " %d %d %d %lf %d %d %d %d %d %lf %lf %d %d %d %d %d %d\n",
  1476. X        &a->type, &a->style, &a->thickness, 
  1477. X        &a->style_val, &a->direction, &f, &b,
  1478. X        &h, &w, &a->center.x, &a->center.y, 
  1479. X        &a->point[0].x, &a->point[0].y, 
  1480. X        &a->point[1].x, &a->point[1].y, 
  1481. X        &a->point[2].x, &a->point[2].y);
  1482. X    if (n != 17) {
  1483. X        put_msg("incomplete arc data");
  1484. X        free((char*)a);
  1485. X        return(NULL);
  1486. X        }
  1487. X    if (f) {
  1488. X        a->for_arrow = forward_arrow();
  1489. X        a->for_arrow->wid = w;
  1490. X        a->for_arrow->ht = h;
  1491. X        }
  1492. X    if (b) {
  1493. X        a->back_arrow = backward_arrow();
  1494. X        a->back_arrow->wid = w;
  1495. X        a->back_arrow->ht = h;
  1496. X        }
  1497. X    return(a);
  1498. X    }
  1499. X
  1500. Xstatic F_compound *
  1501. Xread_compoundobject(fp)
  1502. XFILE    *fp;
  1503. X{
  1504. X    F_arc        *a, *la = NULL;
  1505. X    F_ellipse    *e, *le = NULL;
  1506. X    F_line        *l, *ll = NULL;
  1507. X    F_spline    *s, *ls = NULL;
  1508. X    F_text        *t, *lt = NULL;
  1509. X    F_compound    *com, *c, *lc = NULL;
  1510. X    int         n, object;
  1511. X
  1512. X    Compound_malloc(com);
  1513. X    com->arcs = NULL;
  1514. X    com->ellipses = NULL;
  1515. X    com->lines = NULL;
  1516. X    com->splines = NULL;
  1517. X    com->texts = NULL;
  1518. X    com->compounds = NULL;
  1519. X    com->next = NULL;
  1520. X    n = fscanf(fp, " %d %d %d %d\n", &com->nwcorner.x, &com->nwcorner.y,
  1521. X        &com->secorner.x, &com->secorner.y);
  1522. X    if (n != 4) {
  1523. X        put_msg("Incorrect compound object format");
  1524. X        return(NULL);
  1525. X        }
  1526. X    while (fscanf(fp, "%d", &object) == 1) {
  1527. X        switch (object) {
  1528. X        case O_POLYLINE :
  1529. X            if ((l = read_lineobject(fp)) == NULL) { 
  1530. X            free_line(&l);
  1531. X            return(NULL);
  1532. X            }
  1533. X            if (ll)
  1534. X            ll = (ll->next = l);
  1535. X            else
  1536. X            ll = com->lines = l;
  1537. X            break;
  1538. X        case O_SPLINE :
  1539. X            if ((s = read_splineobject(fp)) == NULL) { 
  1540. X            free_spline(&s);
  1541. X            return(NULL);
  1542. X            }
  1543. X            if (ls)
  1544. X            ls = (ls->next = s);
  1545. X            else
  1546. X            ls = com->splines = s;
  1547. X            break;
  1548. X        case O_ELLIPSE :
  1549. X            if ((e = read_ellipseobject(fp)) == NULL) { 
  1550. X            free_ellipse(&e);
  1551. X            return(NULL);
  1552. X            }
  1553. X            if (le)
  1554. X            le = (le->next = e);
  1555. X            else
  1556. X            le = com->ellipses = e;
  1557. X            break;
  1558. X        case O_ARC :
  1559. X            if ((a = read_arcobject(fp)) == NULL) { 
  1560. X            free_arc(&a);
  1561. X            return(NULL);
  1562. X            }
  1563. X            if (la)
  1564. X            la = (la->next = a);
  1565. X            else
  1566. X            la = com->arcs = a;
  1567. X            break;
  1568. X        case O_TEXT :
  1569. X            if ((t = read_textobject(fp)) == NULL) { 
  1570. X            free_text(&t);
  1571. X            return(NULL);
  1572. X            }
  1573. X            if (lt)
  1574. X            lt = (lt->next = t);
  1575. X            else
  1576. X            lt = com->texts = t;
  1577. X            break;
  1578. X        case O_COMPOUND :
  1579. X            if ((c = read_compoundobject(fp)) == NULL) { 
  1580. X            free_compound(&c);
  1581. X            return(NULL);
  1582. X            }
  1583. X            if (lc)
  1584. X            lc = (lc->next = c);
  1585. X            else
  1586. X            lc = com->compounds = c;
  1587. X            break;
  1588. X        case O_END_COMPOUND :
  1589. X            return(com);
  1590. X        } /*  switch */
  1591. X        }
  1592. X    if (feof(fp))
  1593. X        return(com);
  1594. X    else {
  1595. X        put_msg("Format error: %s", sys_errlist[errno]);
  1596. X        return(NULL);
  1597. X        }
  1598. X    }
  1599. X
  1600. Xstatic F_ellipse *
  1601. Xread_ellipseobject(fp)
  1602. XFILE    *fp;
  1603. X{
  1604. X    F_ellipse    *e;
  1605. X    int        n, t;
  1606. X
  1607. X    Ellipse_malloc(e);
  1608. X          e->color = BLACK_COLOR;
  1609. X    e->angle = 0.0;
  1610. X    e->depth = 0;
  1611. X    e->pen = 0;
  1612. X    e->area_fill = 0;
  1613. X    e->next = NULL;
  1614. X    n = fscanf(fp," %d %d %d %lf %d %d %d %d %d %d %d %d %d\n", 
  1615. X        &t, &e->style,
  1616. X        &e->thickness, &e->style_val, &e->direction, 
  1617. X        &e->center.x, &e->center.y, 
  1618. X        &e->radiuses.x, &e->radiuses.y, 
  1619. X        &e->start.x, &e->start.y, 
  1620. X        &e->end.x, &e->end.y);
  1621. X    if (n != 13) {
  1622. X        put_msg("incomplete ellipse data");
  1623. X        free((char*)e);
  1624. X        return(NULL);
  1625. X        }
  1626. X    if (t == DRAW_ELLIPSE_BY_RAD)
  1627. X        e->type = T_ELLIPSE_BY_RAD;
  1628. X    else if (t == DRAW_ELLIPSE_BY_DIA)
  1629. X        e->type = T_ELLIPSE_BY_DIA;
  1630. X    else if (t == DRAW_CIRCLE_BY_RAD)
  1631. X        e->type = T_CIRCLE_BY_RAD;
  1632. X    else
  1633. X        e->type = T_CIRCLE_BY_DIA;
  1634. X    return(e);
  1635. X    }
  1636. X
  1637. Xstatic F_line *
  1638. Xread_lineobject(fp)
  1639. XFILE            *fp;
  1640. X{
  1641. X    F_line    *l;
  1642. X    F_point    *p, *q;
  1643. X    int    f, b, h, w, n, t, x, y;
  1644. X
  1645. X    Line_malloc(l);
  1646. X          l->color = BLACK_COLOR;
  1647. X    l->depth = 0;
  1648. X    l->pen = 0;
  1649. X    l->area_fill = 0;
  1650. X    l->for_arrow = NULL;
  1651. X    l->back_arrow = NULL;
  1652. X    l->next = NULL;
  1653. X    l->points = Point_malloc(p);
  1654. X    n = fscanf(fp, " %d %d %d %lf %d %d %d %d %d %d", &t, 
  1655. X        &l->style, &l->thickness, &l->style_val,
  1656. X        &f, &b, &h, &w, &p->x, &p->y);
  1657. X    if (n != 10) {
  1658. X        put_msg("incomplete line data");
  1659. X        free((char*)l);
  1660. X        return(NULL);
  1661. X        }
  1662. X    if (t == DRAW_POLYLINE)
  1663. X        l->type = T_POLYLINE;
  1664. X    else if (t == DRAW_POLYGON)
  1665. X        l->type = T_POLYGON;
  1666. X    else
  1667. X        l->type = T_BOX;
  1668. X    if (f) {
  1669. X        l->for_arrow = forward_arrow();
  1670. X        l->for_arrow->wid = w;
  1671. X        l->for_arrow->ht = h;
  1672. X        }
  1673. X    if (b) {
  1674. X        l->back_arrow = backward_arrow();
  1675. X        l->back_arrow->wid = w;
  1676. X        l->back_arrow->ht = h;
  1677. X        }
  1678. X    for (;;) {
  1679. X        if (fscanf(fp, " %d %d", &x, &y) != 2) {
  1680. X        put_msg("incomplete line object");
  1681. X        free_linestorage(l);
  1682. X        return(NULL);
  1683. X        }
  1684. X        if (x == 9999) break;
  1685. X        Point_malloc(q);
  1686. X        q->x = x;
  1687. X        q->y = y;
  1688. X        q->next = NULL;
  1689. X        p->next = q;
  1690. X        p = q;
  1691. X        }
  1692. X    return(l);
  1693. X    }
  1694. X
  1695. Xstatic F_spline *
  1696. Xread_splineobject(fp)
  1697. XFILE    *fp;
  1698. X{
  1699. X    F_spline    *s;
  1700. X    F_point        *p, *q;
  1701. X    int        f, b, h, w, n, t, x, y;
  1702. X
  1703. X    Spline_malloc(s);
  1704. X          s->color = BLACK_COLOR;
  1705. X    s->depth = 0;
  1706. X    s->pen = 0;
  1707. X    s->area_fill = 0;
  1708. X    s->for_arrow = NULL;
  1709. X    s->back_arrow = NULL;
  1710. X    s->controls = NULL;
  1711. X    s->next = NULL;
  1712. X    s->points = Point_malloc(p);
  1713. X    n = fscanf(fp, " %d %d %d %lf %d %d %d %d %d %d", 
  1714. X            &t, &s->style, &s->thickness, &s->style_val,
  1715. X            &f, &b,
  1716. X            &h, &w, &p->x, &p->y);
  1717. X    if (n != 10) {
  1718. X        put_msg("incomplete spline data");
  1719. X        free((char*)s);
  1720. X        return(NULL);
  1721. X        }
  1722. X    if (t == DRAW_CLOSEDSPLINE)
  1723. X        s->type = T_CLOSED_NORMAL;
  1724. X    else
  1725. X        s->type = T_OPEN_NORMAL;
  1726. X    if (f) {
  1727. X        s->for_arrow = forward_arrow();
  1728. X        s->for_arrow->wid = w;
  1729. X        s->for_arrow->ht = h;
  1730. X        }
  1731. X    if (b) {
  1732. X        s->back_arrow = backward_arrow();
  1733. X        s->back_arrow->wid = w;
  1734. X        s->back_arrow->ht = h;
  1735. X        }
  1736. X    for (;;) {
  1737. X        if (fscanf(fp, " %d %d", &x, &y) != 2) {
  1738. X        put_msg("incomplete spline object");
  1739. X        free_splinestorage(s);
  1740. X        return(NULL);
  1741. X        };
  1742. X        if (x == 9999) break;
  1743. X        Point_malloc(q);
  1744. X        q->x = x;
  1745. X        q->y = y;
  1746. X        q->next = NULL;
  1747. X        p->next = q;
  1748. X        p = q;
  1749. X        }
  1750. X    return(s);
  1751. X    }
  1752. X
  1753. Xstatic F_text *
  1754. Xread_textobject(fp)
  1755. XFILE    *fp;
  1756. X{
  1757. X    F_text    *t;
  1758. X    int    n;
  1759. X    char    buf[128];
  1760. X
  1761. X    Text_malloc(t);
  1762. X    t->type = T_LEFT_JUSTIFIED;
  1763. X    t->flags = 0;
  1764. X          t->color = BLACK_COLOR;
  1765. X    t->depth = 0;
  1766. X    t->pen = 0;
  1767. X    t->angle = 0.0;
  1768. X    t->next = NULL;
  1769. X    n = fscanf(fp," %d %d %d %d %d %d %d %[^\n]", &t->font, 
  1770. X        &t->size, &t->flags, &t->height, &t->length, 
  1771. X        &t->base_x, &t->base_y, buf);
  1772. X    if (n != 8) {
  1773. X        put_msg("incomplete text data");
  1774. X        free((char*)t);
  1775. X        return(NULL);
  1776. X        }
  1777. X    t->cstring = (char *) calloc((unsigned)(strlen(buf)+1), sizeof(char));
  1778. X    if (t->cstring == NULL) {
  1779. X        put_msg(Err_mem);
  1780. X        free((char*) t);
  1781. X        return(NULL);
  1782. X        }
  1783. X    (void)strcpy(t->cstring, buf);
  1784. X    if (t->size == 0) t->size = 18;
  1785. X    return(t);
  1786. X    }
  1787. END_OF_FILE
  1788. if test 10940 -ne `wc -c <'fig2dev/read1_3.c'`; then
  1789.     echo shar: \"'fig2dev/read1_3.c'\" unpacked with wrong size!
  1790. fi
  1791. # end of 'fig2dev/read1_3.c'
  1792. fi
  1793. if test -f 'transfig/Makefile' -a "${1}" != "-c" ; then 
  1794.   echo shar: Will not clobber existing file \"'transfig/Makefile'\"
  1795. else
  1796. echo shar: Extracting \"'transfig/Makefile'\" \(11099 characters\)
  1797. sed "s/^X//" >'transfig/Makefile' <<'END_OF_FILE'
  1798. X# Makefile generated by imake - do not edit!
  1799. X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
  1800. X#
  1801. X# The cpp used on this machine replaces all newlines and multiple tabs and
  1802. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  1803. X# for this, but is not always successful.
  1804. X#
  1805. X
  1806. X# -------------------------------------------------------------------------
  1807. X# Makefile generated from "Imake.tmpl" and </tmp/IIf.a20985>
  1808. X# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
  1809. X#
  1810. X# Platform-specific parameters may be set in the appropriate <vendor>.cf
  1811. X# configuration files.  Site-specific parameters should be set in the file
  1812. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  1813. X#
  1814. X# If your C preprocessor does not define any unique symbols, you will need
  1815. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  1816. X# "make World" the first time).
  1817. X#
  1818. X
  1819. X# -------------------------------------------------------------------------
  1820. X# site-specific configuration parameters that need to come before
  1821. X# the platform-specific parameters - edit site.def to change
  1822. X
  1823. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  1824. X
  1825. X# -------------------------------------------------------------------------
  1826. X# platform-specific configuration parameters - edit sun.cf to change
  1827. X
  1828. X# platform:  $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
  1829. X
  1830. X# operating system:  SunOS 4.1.2
  1831. X
  1832. X# $XConsortium: sunLib.rules,v 1.7 91/12/20 11:19:47 rws Exp $
  1833. X
  1834. X# -------------------------------------------------------------------------
  1835. X# site-specific configuration parameters that go after
  1836. X# the platform-specific parameters - edit site.def to change
  1837. X
  1838. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  1839. X
  1840. X            SHELL = /bin/sh
  1841. X
  1842. X              TOP = ../.
  1843. X      CURRENT_DIR = ./transfig
  1844. X
  1845. X               AR = ar clq
  1846. X  BOOTSTRAPCFLAGS =
  1847. X               CC = cc
  1848. X               AS = as
  1849. X
  1850. X         COMPRESS = compress
  1851. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  1852. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  1853. X          INSTALL = install
  1854. X               LD = ld
  1855. X             LINT = lint
  1856. X      LINTLIBFLAG = -C
  1857. X         LINTOPTS = -axz
  1858. X               LN = ln -s
  1859. X             MAKE = make
  1860. X               MV = mv
  1861. X               CP = cp
  1862. X
  1863. X           RANLIB = ranlib
  1864. X  RANLIBINSTFLAGS =
  1865. X
  1866. X               RM = rm -f
  1867. X            TROFF = psroff
  1868. X         MSMACROS = -ms
  1869. X              TBL = tbl
  1870. X              EQN = eqn
  1871. X     STD_INCLUDES =
  1872. X  STD_CPP_DEFINES =
  1873. X      STD_DEFINES =
  1874. X EXTRA_LOAD_FLAGS =
  1875. X  EXTRA_LIBRARIES =
  1876. X             TAGS = ctags
  1877. X
  1878. X    SHAREDCODEDEF = -DSHAREDCODE
  1879. X         SHLIBDEF = -DSUNSHLIB
  1880. X
  1881. X    PROTO_DEFINES =
  1882. X
  1883. X     INSTPGMFLAGS =
  1884. X
  1885. X     INSTBINFLAGS = -m 0755
  1886. X     INSTUIDFLAGS = -m 4755
  1887. X     INSTLIBFLAGS = -m 0644
  1888. X     INSTINCFLAGS = -m 0444
  1889. X     INSTMANFLAGS = -m 0444
  1890. X     INSTDATFLAGS = -m 0444
  1891. X    INSTKMEMFLAGS = -g kmem -m 2755
  1892. X
  1893. X      CDEBUGFLAGS = -O
  1894. X        CCOPTIONS =
  1895. X
  1896. X      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
  1897. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
  1898. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  1899. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  1900. X
  1901. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  1902. X
  1903. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS)
  1904. X
  1905. X   LDCOMBINEFLAGS = -X -r
  1906. X      DEPENDFLAGS =
  1907. X
  1908. X        MACROFILE = sun.cf
  1909. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  1910. X
  1911. X    IMAKE_DEFINES =
  1912. X
  1913. X         IRULESRC = $(CONFIGDIR)
  1914. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  1915. X
  1916. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  1917. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  1918. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  1919. X
  1920. X# -------------------------------------------------------------------------
  1921. X# X Window System Build Parameters
  1922. X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
  1923. X
  1924. X# -------------------------------------------------------------------------
  1925. X# X Window System make variables; this need to be coordinated with rules
  1926. X
  1927. X          PATHSEP = /
  1928. X        USRLIBDIR = /usr/lib
  1929. X           BINDIR = /usr/bin/X11
  1930. X          INCROOT = /usr/include
  1931. X     BUILDINCROOT = $(TOP)
  1932. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  1933. X      BUILDINCTOP = ..
  1934. X           INCDIR = $(INCROOT)/X11
  1935. X           ADMDIR = /usr/adm
  1936. X           LIBDIR = $(USRLIBDIR)/X11
  1937. X        CONFIGDIR = $(LIBDIR)/config
  1938. X       LINTLIBDIR = $(USRLIBDIR)/lint
  1939. X
  1940. X          FONTDIR = $(LIBDIR)/fonts
  1941. X         XINITDIR = $(LIBDIR)/xinit
  1942. X           XDMDIR = $(LIBDIR)/xdm
  1943. X           TWMDIR = $(LIBDIR)/twm
  1944. X          MANPATH = /usr/man
  1945. X    MANSOURCEPATH = $(MANPATH)/man
  1946. X        MANSUFFIX = l
  1947. X     LIBMANSUFFIX = 3
  1948. X           MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
  1949. X        LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
  1950. X           NLSDIR = $(LIBDIR)/nls
  1951. X        PEXAPIDIR = $(LIBDIR)/PEX
  1952. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  1953. X       FONTCFLAGS = -t
  1954. X
  1955. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  1956. X
  1957. X            IMAKE = imake
  1958. X           DEPEND = makedepend
  1959. X              RGB = rgb
  1960. X
  1961. X            FONTC = bdftopcf
  1962. X
  1963. X        MKFONTDIR = mkfontdir
  1964. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
  1965. X
  1966. X        CONFIGSRC = $(TOP)/config
  1967. X       DOCUTILSRC = $(TOP)/doc/util
  1968. X        CLIENTSRC = $(TOP)/clients
  1969. X          DEMOSRC = $(TOP)/demos
  1970. X           LIBSRC = $(TOP)/lib
  1971. X          FONTSRC = $(TOP)/fonts
  1972. X       INCLUDESRC = $(TOP)/X11
  1973. X        SERVERSRC = $(TOP)/server
  1974. X          UTILSRC = $(TOP)/util
  1975. X        SCRIPTSRC = $(UTILSRC)/scripts
  1976. X       EXAMPLESRC = $(TOP)/examples
  1977. X       CONTRIBSRC = $(TOP)/../contrib
  1978. X           DOCSRC = $(TOP)/doc
  1979. X           RGBSRC = $(TOP)/rgb
  1980. X        DEPENDSRC = $(UTILSRC)/makedepend
  1981. X         IMAKESRC = $(CONFIGSRC)
  1982. X         XAUTHSRC = $(LIBSRC)/Xau
  1983. X          XLIBSRC = $(LIBSRC)/X
  1984. X           XMUSRC = $(LIBSRC)/Xmu
  1985. X       TOOLKITSRC = $(LIBSRC)/Xt
  1986. X       AWIDGETSRC = $(LIBSRC)/Xaw
  1987. X       OLDXLIBSRC = $(LIBSRC)/oldX
  1988. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  1989. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  1990. X      BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
  1991. X      BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
  1992. X     MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
  1993. X         FSLIBSRC = $(FONTSRC)/lib/fs
  1994. X    FONTSERVERSRC = $(FONTSRC)/server
  1995. X     EXTENSIONSRC = $(TOP)/extensions
  1996. X         XILIBSRC = $(EXTENSIONSRC)/lib/xinput
  1997. X      PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
  1998. X
  1999. X# $XConsortium: sunLib.tmpl,v 1.14.1.1 92/03/17 14:58:46 rws Exp $
  2000. X
  2001. XSHLIBLDFLAGS = -assert pure-text
  2002. XPICFLAGS = -pic
  2003. X
  2004. X  DEPEXTENSIONLIB =
  2005. X     EXTENSIONLIB = -lXext
  2006. X
  2007. X          DEPXLIB = $(DEPEXTENSIONLIB)
  2008. X             XLIB = $(EXTENSIONLIB) -lX11
  2009. X
  2010. X        DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
  2011. X       XMULIBONLY = -lXmu
  2012. X           XMULIB = -lXmu
  2013. X
  2014. X       DEPOLDXLIB =
  2015. X          OLDXLIB = -loldX
  2016. X
  2017. X      DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
  2018. X         XTOOLLIB = -lXt
  2019. X
  2020. X        DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
  2021. X           XAWLIB = -lXaw
  2022. X
  2023. X        DEPXILIB =
  2024. X           XILIB = -lXi
  2025. X
  2026. X        SOXLIBREV = 4.10
  2027. X          SOXTREV = 4.10
  2028. X         SOXAWREV = 5.0
  2029. X        SOOLDXREV = 4.10
  2030. X         SOXMUREV = 4.10
  2031. X        SOXEXTREV = 4.10
  2032. X      SOXINPUTREV = 4.10
  2033. X
  2034. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  2035. X         XAUTHLIB =  -lXau
  2036. X      DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
  2037. X         XDMCPLIB =  -lXdmcp
  2038. X
  2039. X        DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
  2040. X           PHIGSLIB =  -lphigs
  2041. X
  2042. X       DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
  2043. X          XBSDLIB =  -lXbsd
  2044. X
  2045. X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
  2046. X         LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
  2047. X          LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
  2048. X        LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
  2049. X          LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
  2050. X           LINTXI = $(LINTLIBDIR)/llib-lXi.ln
  2051. X        LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
  2052. X
  2053. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  2054. X
  2055. X         DEPLIBS1 = $(DEPLIBS)
  2056. X         DEPLIBS2 = $(DEPLIBS)
  2057. X         DEPLIBS3 = $(DEPLIBS)
  2058. X
  2059. X# -------------------------------------------------------------------------
  2060. X# Imake rules for building libraries, programs, scripts, and data files
  2061. X# rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
  2062. X
  2063. X# -------------------------------------------------------------------------
  2064. X# start of Imakefile
  2065. X
  2066. X#    TransFig : Fig code translation Makefile creation program
  2067. X#
  2068. X#    Micah Beck
  2069. X#
  2070. X
  2071. XDEPLIBS =
  2072. XINCLUDES = -I..
  2073. X
  2074. XSRCS = transfig.c txfile.c mkfile.c sys.c
  2075. XOBJS = transfig.o txfile.o mkfile.o sys.o
  2076. X
  2077. X PROGRAM = transfig
  2078. X
  2079. Xall:: transfig
  2080. X
  2081. Xtransfig: $(OBJS) $(DEPLIBS)
  2082. X    $(RM) $@
  2083. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  2084. X
  2085. Xsaber_transfig:: $(SRCS)
  2086. X    # load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  2087. X
  2088. Xosaber_transfig:: $(OBJS)
  2089. X    # load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  2090. X
  2091. Xinstall:: transfig
  2092. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  2093. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  2094. X    $(INSTALL) -c $(INSTPGMFLAGS)  transfig $(DESTDIR)$(BINDIR)
  2095. X
  2096. Xinstall.man:: transfig.man
  2097. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  2098. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  2099. X    $(INSTALL) -c $(INSTMANFLAGS) transfig.man $(DESTDIR)$(MANDIR)/transfig.$(MANSUFFIX)
  2100. X
  2101. Xdepend::
  2102. X    $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  2103. X
  2104. Xlint:
  2105. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  2106. Xlint1:
  2107. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  2108. X
  2109. Xclean::
  2110. X    $(RM) $(PROGRAM)
  2111. X
  2112. Xtransfig.man: ../doc/transfig.1
  2113. X    ln -s ../doc/transfig.1 transfig.man
  2114. X
  2115. Xinstall.man:: fig2ps2tex.man
  2116. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  2117. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  2118. X    $(INSTALL) -c $(INSTMANFLAGS) fig2ps2tex.man $(DESTDIR)$(MANDIR)/fig2ps2tex.$(MANSUFFIX)
  2119. X
  2120. Xinstall.man:: pic2tpic.man
  2121. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  2122. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  2123. X    $(INSTALL) -c $(INSTMANFLAGS) pic2tpic.man $(DESTDIR)$(MANDIR)/pic2tpic.$(MANSUFFIX)
  2124. X
  2125. Xfig2dev.man: ../doc/fig2dev.1
  2126. X    ln -s ../doc/fig2dev.1 fig2dev.man
  2127. X
  2128. Xfig2ps2tex.man: ../doc/fig2ps2tex.1
  2129. X    ln -s ../doc/fig2ps2tex.1 fig2ps2tex.man
  2130. X
  2131. Xpic2tpic.man: ../doc/pic2tpic.1
  2132. X    ln -s ../doc/pic2tpic.1 pic2tpic.man
  2133. X
  2134. X# -------------------------------------------------------------------------
  2135. X# common rules for all Makefiles - do not edit
  2136. X
  2137. Xemptyrule::
  2138. X
  2139. Xclean::
  2140. X    $(RM_CMD) "#"*
  2141. X
  2142. XMakefile::
  2143. X    -@if [ -f Makefile ]; then set -x; \
  2144. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  2145. X    else exit 0; fi
  2146. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  2147. X
  2148. Xtags::
  2149. X    $(TAGS) -w *.[ch]
  2150. X    $(TAGS) -xw *.[ch] > TAGS
  2151. X
  2152. Xsaber:
  2153. X    # load $(ALLDEFINES) $(SRCS)
  2154. X
  2155. Xosaber:
  2156. X    # load $(ALLDEFINES) $(OBJS)
  2157. X
  2158. X# -------------------------------------------------------------------------
  2159. X# empty rules for directories that do not have SUBDIRS - do not edit
  2160. X
  2161. Xinstall::
  2162. X    @echo "install in $(CURRENT_DIR) done"
  2163. X
  2164. Xinstall.man::
  2165. X    @echo "install.man in $(CURRENT_DIR) done"
  2166. X
  2167. XMakefiles::
  2168. X
  2169. Xincludes::
  2170. X
  2171. X# -------------------------------------------------------------------------
  2172. X# dependencies generated by makedepend
  2173. X
  2174. END_OF_FILE
  2175. if test 11099 -ne `wc -c <'transfig/Makefile'`; then
  2176.     echo shar: \"'transfig/Makefile'\" unpacked with wrong size!
  2177. fi
  2178. # end of 'transfig/Makefile'
  2179. fi
  2180. echo shar: End of archive 3 \(of 7\).
  2181. cp /dev/null ark3isdone
  2182. MISSING=""
  2183. for I in 1 2 3 4 5 6 7 ; do
  2184.     if test ! -f ark${I}isdone ; then
  2185.     MISSING="${MISSING} ${I}"
  2186.     fi
  2187. done
  2188. if test "${MISSING}" = "" ; then
  2189.     echo You have unpacked all 7 archives.
  2190.     rm -f ark[1-9]isdone
  2191. else
  2192.     echo You still need to unpack the following archives:
  2193.     echo "        " ${MISSING}
  2194. fi
  2195. ##  End of shell archive.
  2196. exit 0
  2197.