Automatically remove trailing whitespace
This commit is contained in:
parent
62396c5250
commit
1446c97470
86
FEATURES
86
FEATURES
@ -1,93 +1,93 @@
|
||||
NCSA Mosaic Features List
|
||||
*************************
|
||||
|
||||
This list is up to date for version 2.5 of NCSA Mosaic.
|
||||
This list is up to date for version 2.5 of NCSA Mosaic.
|
||||
|
||||
o Support for accessing documents, images, audio, video, animations, and data
|
||||
through World Wide Web, Gopher, WAIS, FTP, NNTP/Usenet news, telnet,
|
||||
tn3270, and local files; and via gateways, Techinfo, TeXinfo, Archie, CSO
|
||||
qi/ph, relational databases, and other sources.
|
||||
o Friendly X/Motif user interface.
|
||||
o Color and monochrome default X resource settings.
|
||||
o Multiple independent document viewing windows.
|
||||
qi/ph, relational databases, and other sources.
|
||||
o Friendly X/Motif user interface.
|
||||
o Color and monochrome default X resource settings.
|
||||
o Multiple independent document viewing windows.
|
||||
o Completely interruptible network input/output, with full status indication
|
||||
during network operations.
|
||||
during network operations.
|
||||
o Support for interactive fill-out forms inside documents, to enable powerful
|
||||
database and search engine front-ends. Fill-out forms can contain text entry
|
||||
areas (single- or multi-line), option buttons, radio buttons, option menus,
|
||||
scrolled lists, and image maps. Fill-out form elements are instantiated as
|
||||
Motif widgets.
|
||||
Motif widgets.
|
||||
o Support for standard World Wide Web authentication scheme, providing
|
||||
security about equivalent to telnet's username/password scheme.
|
||||
security about equivalent to telnet's username/password scheme.
|
||||
o Customizable encryption hooks to allow external PEM or PGP encryption to
|
||||
be used to request and receive encrypted documents.
|
||||
be used to request and receive encrypted documents.
|
||||
o Support for encrypted submission of forms.
|
||||
o Support for first time encryption of all http communication.
|
||||
o Extensive HTTP/1.0 support, including the ability to allow a remote
|
||||
server to
|
||||
server to
|
||||
return URL redirections rather than documents for transparent forwarding of
|
||||
information pointers.
|
||||
information pointers.
|
||||
o Ability to pass any or all URL access methods to a proxy gateway to simulate
|
||||
direct network connection for those behind firewalls.
|
||||
direct network connection for those behind firewalls.
|
||||
o Direct access to WAIS databases, including support for binary files and
|
||||
multiformat responses.
|
||||
multiformat responses.
|
||||
o Built-in support for recognizing and handling GIF, JPEG, TIFF, audio, AIFF,
|
||||
DVI, MPEG, MIME, XWD, RGB, HDF, PostScript files and forking off
|
||||
appropriate viewers.
|
||||
appropriate viewers.
|
||||
o Full customizability of recognized formats, external viewers, and file
|
||||
extensions.
|
||||
extensions.
|
||||
o Ability to fire off arbitrary client-side shell scripts in response to
|
||||
hyperlink
|
||||
activations via format/viewer customization options.
|
||||
hyperlink
|
||||
activations via format/viewer customization options.
|
||||
o Ability to natively view data inside HDF and netCDF scientific data files,
|
||||
with powerful hypermedia interface to explore internal structure of data
|
||||
files.
|
||||
files.
|
||||
o Inlined images in formatted (HTML) text: X bitmaps and GIF images can be
|
||||
included anywhere inside a document, and can act as hyperlink anchors. Image
|
||||
files themselves can be located anywhere on the network. Images can act as
|
||||
maps, so clicking on them sends coordinates of click to remote server.
|
||||
o Automatic dithering of inlined images on monochrome displays.
|
||||
o Support of GIF89 transparent background in inlined images.
|
||||
o Flexible inlined-image caching with customizable image cache size.
|
||||
maps, so clicking on them sends coordinates of click to remote server.
|
||||
o Automatic dithering of inlined images on monochrome displays.
|
||||
o Support of GIF89 transparent background in inlined images.
|
||||
o Flexible inlined-image caching with customizable image cache size.
|
||||
o Delayed image loading mode, to avoid automatic loading of all images in
|
||||
accessed documents for users with slow network connections.
|
||||
o Visited document history list per window.
|
||||
accessed documents for users with slow network connections.
|
||||
o Visited document history list per window.
|
||||
o Global history with previously visited locations visually distinct; global
|
||||
history is persistent across sessions.
|
||||
history is persistent across sessions.
|
||||
o Hotlist/bookmark capability -- keep list of interesting documents,
|
||||
add/remove/rename items, list is persistent across sessions. Now stored
|
||||
in nested HTML.
|
||||
o Personal annotations with GUI annotation entry dialog; annotations can later
|
||||
be edited or deleted, and hyperlinks to existing annotations are inlined
|
||||
into subsequent accesses of an annotated document. (Any document from any
|
||||
server via any access method can be annotated.)
|
||||
server via any access method can be annotated.)
|
||||
o Audio (voice) annotations with GUI for controlling recording process (SGI,
|
||||
SGI, and HP only).
|
||||
SGI, and HP only).
|
||||
o Transparent and automatic uncompression of compressed (.Z) and gzip'd (.z or
|
||||
.gz) files (over FTP, HTTP0, HTTP/1.0, local files, and Gopher).
|
||||
.gz) files (over FTP, HTTP0, HTTP/1.0, local files, and Gopher).
|
||||
o "Load to local disk" mode, for pulling down arbitrary binary files and
|
||||
saving them to local disk without viewing them.
|
||||
o In-document search capability.
|
||||
o Fully 8-bit clean for formatted and plain text.
|
||||
o On-the-fly font and hyperlink style selection.
|
||||
saving them to local disk without viewing them.
|
||||
o In-document search capability.
|
||||
o Fully 8-bit clean for formatted and plain text.
|
||||
o On-the-fly font and hyperlink style selection.
|
||||
o Hardcoded menu entries for popular network starting points, including the
|
||||
NCSA Internet Resources Meta-Index.
|
||||
o Keyword search capability (for WAIS, Gopher, Archie, etc.).
|
||||
o Cut and paste formatted text into other X windows.
|
||||
o Ability to display arbitrarily long documents.
|
||||
NCSA Internet Resources Meta-Index.
|
||||
o Keyword search capability (for WAIS, Gopher, Archie, etc.).
|
||||
o Cut and paste formatted text into other X windows.
|
||||
o Ability to display arbitrarily long documents.
|
||||
o Save/mail/print documents in several formats, including formatted ASCII
|
||||
text and PostScript.
|
||||
o Online hypertext help and FAQ list.
|
||||
text and PostScript.
|
||||
o Online hypertext help and FAQ list.
|
||||
o No config or resource file installation required; self-contained
|
||||
executable.
|
||||
executable.
|
||||
o Extremely customizable via compile-time definitions, X resources, and
|
||||
standard configuration file formats (including mailcap files for
|
||||
format/viewer customization).
|
||||
format/viewer customization).
|
||||
o Can be controlled by signals to allow use as a full-featured help or
|
||||
information presentation subsystems by existing applications.
|
||||
information presentation subsystems by existing applications.
|
||||
o Integrated with NCSA Collage and NCSA DTM to broadcast documents into
|
||||
real-time networked workgroup collaboration sessions.
|
||||
o It's PURIFY'D!!!
|
||||
real-time networked workgroup collaboration sessions.
|
||||
o It's PURIFY'D!!!
|
||||
o Common Client Interface (CCI) support to allow external applications
|
||||
to communicate with Mosaic via TCP/IP.
|
||||
o Kiosk mode
|
||||
|
14
INSTALL
14
INSTALL
@ -177,7 +177,7 @@ xinc = -I/usr/openwin/include -I/usr/dt/include
|
||||
:::
|
||||
SWP
|
||||
---
|
||||
This is where you specify where you have installed your X libraries. Some
|
||||
This is where you specify where you have installed your X libraries. Some
|
||||
systems have everything off of /usr/lib, some are not so lucky. If you
|
||||
are compiling and you get an error of "can't find include file XXX.h" it is
|
||||
more than likely a problem here (or if you don't have a particular lib
|
||||
@ -280,10 +280,10 @@ JPEG support. Comment it out if you aren't going to use it.
|
||||
|
||||
#### KERBEROS SUPPORT
|
||||
####
|
||||
#### If you want Mosaic to support Kerberos authentication, set the
|
||||
#### If you want Mosaic to support Kerberos authentication, set the
|
||||
#### following flags appropriately. You can support Kerberos V4 and/or V5,
|
||||
#### although it's most likely that your realm supports one or the other.
|
||||
#### To enable DES-encryption of HTTP messages via Kerberos key exchange,
|
||||
#### To enable DES-encryption of HTTP messages via Kerberos key exchange,
|
||||
#### define the KRB-ENCRYPT flag.
|
||||
|
||||
##krb4dir = /usr/athena
|
||||
@ -298,7 +298,7 @@ JPEG support. Comment it out if you aren't going to use it.
|
||||
|
||||
#Do not comment out.
|
||||
krbflags = $(krb4flags) $(krb5flags)
|
||||
krblibs = $(krb4libs) $(krb5libs)
|
||||
krblibs = $(krb4libs) $(krb5libs)
|
||||
:::
|
||||
SWP
|
||||
---
|
||||
@ -315,7 +315,7 @@ to leave it alone.
|
||||
#### recommend linking with CNIDR's freeWAIS 0.5 distribution; other
|
||||
#### WAIS distributions may work but we have not tested them with
|
||||
#### Mosaic. freeWAIS 0.5 can currently (Sept.1995) be found at
|
||||
#### ftp://sunsite.unc.edu/pub/wais/servers/freeWAIS
|
||||
#### ftp://sunsite.unc.edu/pub/wais/servers/freeWAIS
|
||||
|
||||
#### If you do not wish to link to the WAIS libraries, then comment
|
||||
#### the following lines out. Mosaic will then communicate with WAIS
|
||||
@ -379,7 +379,7 @@ a slight to Tom...we simply had not thought it through.
|
||||
Another note...the 2.8 distribution tree will be drastically changing. Do not
|
||||
expect patches for 2.7x to work for 2.8x. We will be moving the libraries
|
||||
out of the distribution tree and into a "library" distribution along with
|
||||
pointers to completely external libs (jpeg, png, zlib, etc). Since we have
|
||||
pointers to completely external libs (jpeg, png, zlib, etc). Since we have
|
||||
these libs in binary form, we will probably distribute a "binary_libs" archive
|
||||
of all the libs we build with for each platform (for those who can't get the
|
||||
lib to build or simply don't care to take the time, but still want to play
|
||||
@ -394,7 +394,7 @@ great space wishes to perform this feat for us, we would gladly accept.
|
||||
|
||||
Scott Powers spowers@ncsa.uiuc.edu \ The N.C.S.A. X Mosaic
|
||||
Paul Bleisch pbleisch@ncsa.uiuc.edu \ Development Team
|
||||
Dan Pape dpape@ncsa.uiuc.edu >
|
||||
Dan Pape dpape@ncsa.uiuc.edu >
|
||||
Tommy Reilly tpreilly@ncsa.uiuc.edu / Comments? Suggestions? Problems?
|
||||
Brian Swetland swetland@ncsa.uiuc.edu/ mosaic-x@ncsa.uiuc.edu
|
||||
|
||||
|
@ -14,7 +14,7 @@ Binaries
|
||||
|
||||
NCSA Mosaic is known to compile on the following platforms:
|
||||
|
||||
SGI (IRIX 4.0.x and 5.x)
|
||||
SGI (IRIX 4.0.x and 5.x)
|
||||
IBM (AIX 3.2.4)
|
||||
Sun (SunOS 4.1.3, 5.3, and 5.4 (Solaris))
|
||||
DECstation 5000-200 (Ultrix 4.x)
|
||||
@ -34,7 +34,7 @@ Installation Instructions
|
||||
-------------------------
|
||||
|
||||
Simply examine the toplevel Makefile, change the appropriate
|
||||
customizable options, and type 'make'.
|
||||
customizable options, and type 'make'.
|
||||
|
||||
The final result is a single independent executable, src/Mosaic.
|
||||
|
||||
@ -50,7 +50,7 @@ There is one tricky thing:
|
||||
platform-independent hierarchical scientific data format, and NCSA
|
||||
DTM, a network-based message-passing protocol useful for exchanging
|
||||
scientific data between applications. If you compile one of them
|
||||
in, you should compile both of them in.
|
||||
in, you should compile both of them in.
|
||||
|
||||
If you don't already know what HDF and DTM are and want to compile
|
||||
Mosaic quickly, forget about them for the time being -- you can
|
||||
@ -111,7 +111,7 @@ depends on user feedback and support.
|
||||
=============================================================================
|
||||
Scott Powers spowers@ncsa.uiuc.edu \ The N.C.S.A. X Mosaic
|
||||
Kristin Buxton kbuxton@uiuc.edu \ Development Team
|
||||
Dan Pape dpape@ncsa.uiuc.edu >
|
||||
Dan Pape dpape@ncsa.uiuc.edu >
|
||||
Tommy Reilly tpreilly@uiuc.edu / Comments? Suggestions? Problems?
|
||||
Brian Swetland swetland@uiuc.edu / mosaic-x@ncsa.uiuc.edu
|
||||
=============================================================================
|
||||
|
@ -174,7 +174,7 @@ Mosaic*CatchPriorAndNext: True
|
||||
<dd>Whether or not to use PG_UP and PG_DN.
|
||||
<dt>Mosaic*fullHostname: (NULL)<br>
|
||||
Mosaic*FullHostname: (NULL)
|
||||
<dd>The full hostname of your local machine (for use in conjunction with
|
||||
<dd>The full hostname of your local machine (for use in conjunction with
|
||||
GetHostByNameIsEvil).
|
||||
<dt>Mosaic*reverseInlinedBitmapColors: False<br>
|
||||
Mosaic*ReverseInlinedBitmapColors: False
|
||||
|
@ -24,7 +24,7 @@ Mosaic*pulldownmenu*fontList: -*-helvetica-bold-o-normal-*-14-*-iso8859-1
|
||||
Mosaic*XmList*fontList: -*-helvetica-medium-r-normal-*-14-*-iso8859-1
|
||||
Mosaic*XmText.fontList: -*-lucidatypewriter-medium-r-normal-*-14-*-iso8859-1
|
||||
Mosaic*XmTextField.fontList: -*-lucidatypewriter-medium-r-normal-*-14-*-iso8859-1
|
||||
|
||||
|
||||
Mosaic*optionmenu*marginHeight: 0
|
||||
Mosaic*optionmenu*marginTop: 5
|
||||
Mosaic*optionmenu*marginBottom: 5
|
||||
@ -61,7 +61,7 @@ Mosaic*XmPushButton*highlightThickness: 0
|
||||
Mosaic*XmScrollBar*highlightThickness: 0
|
||||
Mosaic*highlightThickness: 0
|
||||
Mosaic*keyboardFocusPolicy: pointer
|
||||
|
||||
|
||||
Mosaic*TitleFont: -adobe-times-bold-r-normal-*-24-*-*-*-*-*-iso8859-1
|
||||
Mosaic*Font: -adobe-times-medium-r-normal-*-17-*-*-*-*-*-iso8859-1
|
||||
Mosaic*ItalicFont: -adobe-times-medium-i-normal-*-17-*-*-*-*-*-iso8859-1
|
||||
@ -102,7 +102,7 @@ Mosaic*XmList*TopShadowColor: #e7e7e7e7e7e7
|
||||
Mosaic*XmText*TopShadowColor: #e7e7e7e7e7e7
|
||||
Mosaic*XmSelectionBox*TopShadowColor: #e7e7e7e7e7e7
|
||||
Mosaic*XmMessageBox*TopShadowColor: #e7e7e7e7e7e7
|
||||
|
||||
|
||||
Mosaic*TroughColor: #646464646464
|
||||
Mosaic*SelectColor: #ffffffff0000
|
||||
Mosaic*HighlightColor: #bfbfbfbfbfbf
|
||||
|
@ -39,7 +39,7 @@ CGI annotation server.
|
||||
they're placed). Default is true.
|
||||
|
||||
|
||||
<DT> <b><A NAME="catchPriorAndNext">catchPriorAndNext</A></b>: <i>Boolean</i>
|
||||
<DT> <b><A NAME="catchPriorAndNext">catchPriorAndNext</A></b>: <i>Boolean</i>
|
||||
<DD> This resource controls whether use of the keys Prior and Next
|
||||
(Page Up and Page Down on most keyboards) are explicitly caught
|
||||
in the <A NAME=18 HREF="help-on-docview-window.html">Document
|
||||
@ -57,10 +57,10 @@ CGI annotation server.
|
||||
|
||||
<DT> <B>confirmDeleteAnnotation</B>: <I>Boolean</I>
|
||||
<DD> If false, deleting annotations will not be confirmed via a
|
||||
confirmation dialog box. Default is true.
|
||||
confirmation dialog box. Default is true.
|
||||
|
||||
<DT> <b>confirmExit</b>: <i>Boolean</i>
|
||||
<DD> Whether NCSA Mosaic will pop up a dialog box to confirm
|
||||
<DD> Whether NCSA Mosaic will pop up a dialog box to confirm
|
||||
exiting the program
|
||||
when the 'Exit Program' menu option is chosen. Default is true.
|
||||
|
||||
@ -74,9 +74,9 @@ CGI annotation server.
|
||||
<DD> Default height in pixels for a Document View window. Default is 680.
|
||||
|
||||
<DT> <b><A NAME="hotlist-file">defaultHotlistFile</A></b>: <i>string</i>
|
||||
<DD> Name of file to store the
|
||||
<A NAME=6 HREF="help-on-hotlist-view.html">default hotlist</A>
|
||||
(or list of bookmarks).
|
||||
<DD> Name of file to store the
|
||||
<A NAME=6 HREF="help-on-hotlist-view.html">default hotlist</A>
|
||||
(or list of bookmarks).
|
||||
Default is ".mosaic-hotlist-default"; the value
|
||||
of the environment variable $HOME will be prepended to this string.
|
||||
|
||||
@ -86,7 +86,7 @@ CGI annotation server.
|
||||
<DT> <B>delayImageLoads</B>: <I>Boolean</I> </a>
|
||||
<DD> Delayed image loading is for users with slow network connections. If
|
||||
true, Mosaic substitutes a small icon for inlined-images, plus an arrow
|
||||
icon for inlined-images which also act as hyperlinks.
|
||||
icon for inlined-images which also act as hyperlinks.
|
||||
<I>Clicking</I> on an icon tells Mosaic to load that inlined-image, while
|
||||
<I>clicking</I> on the arrow is equivalent to following the associated
|
||||
hyperlink. Selecting <I>Load Images in Current</I> from Mosaic's
|
||||
@ -96,23 +96,23 @@ CGI annotation server.
|
||||
<CODE>Options</CODE> menu. Default is false.
|
||||
|
||||
<DT> <b>displayURLsNotTitles</b>: <i>Boolean</i>
|
||||
<DD> If true, URL's will be displayed everywhere document titles are
|
||||
<DD> If true, URL's will be displayed everywhere document titles are
|
||||
usually displayed. Default is false.
|
||||
|
||||
<DT> <B>DocsDirectory</B>: <I>string</I>
|
||||
<DT> <B>DocsDirectory</B>: <I>string</I>
|
||||
<DD> Can be used to override the location of the help documents. Default is
|
||||
NULL.
|
||||
NULL.
|
||||
|
||||
<DT> <B>documentsMenuSpecfile</B>: <I>string</I>
|
||||
<DT> <B>documentsMenuSpecfile</B>: <I>string</I>
|
||||
<DD> Name of file which holds an optional "Documents Menu Specfile," to allow
|
||||
sites to add their own <CODE>Documents</CODE> menu to Mosaic's menu bar.
|
||||
For more information, see <A HREF="faq-documents-menu.html"> information
|
||||
on creating a configurable <CODE>Documents</CODE> menu.</A> Default is
|
||||
on creating a configurable <CODE>Documents</CODE> menu.</A> Default is
|
||||
"/usr/local/lib/mosaic/documents.menu"
|
||||
|
||||
<DT> <B>editCommand</B>: <I>string</I>
|
||||
<DD> Name of the editor to load when using the <I>File-Edit Source</I> option.
|
||||
This editor is loaded in an xterm, specified by the
|
||||
This editor is loaded in an xterm, specified by the
|
||||
<code>xtermCommand</code> resource. Default is vi.
|
||||
|
||||
<DT> <B>editCommandUseXterm</B>: <I>Boolean</I>
|
||||
@ -137,16 +137,16 @@ CGI annotation server.
|
||||
out it's own full hostname via gethostbyname(), it coredumps,
|
||||
then you should set this resource to true. Default is false.
|
||||
|
||||
<DT> <B>globalExtensionMap</B>: <I>string</I>
|
||||
<DT> <B>globalExtensionMap</B>: <I>string</I>
|
||||
<DD> Can be set to the location of the system-wide <A
|
||||
HREF="extension-map.html">extension map</A> config file of your choice.
|
||||
HREF="extension-map.html">extension map</A> config file of your choice.
|
||||
Default is "/usr/local/lib/mosaic/mime.types"
|
||||
|
||||
<DT> <b>globalHistoryFile</b>: <i>string</i>
|
||||
<DD> Name of file to store the global history of all documents visited
|
||||
from session to session. Default is ".mosaic-global-history"; the value
|
||||
of the environment variable $HOME will be prepended to this string.
|
||||
<DT> <B>globalTypeMap</B>: <I>string</I>
|
||||
<DT> <B>globalTypeMap</B>: <I>string</I>
|
||||
<DD> Can be set to the location of the system-wide <A
|
||||
HREF="mailcap.html">mailcap</A> (type map config) file of your choice.
|
||||
Default is "/usr/local/lib/mosaic/mailcap"
|
||||
@ -158,20 +158,20 @@ CGI annotation server.
|
||||
HREF="ftp://boole.stanford.edu/pub/">boole.stanford.edu/pub/</A>.)
|
||||
|
||||
<DT> <B>hdfMaxImageDimension</B>: <I>integer</I>
|
||||
<DD>
|
||||
<DD>
|
||||
Maximum height and/or width of an <A
|
||||
HREF="http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/hdf-browsing.html">
|
||||
HDF</A> inlined image in pixels. Default is 400.
|
||||
|
||||
<DT> <B>hdfMaxDisplayedDatasets</B>: <I>integer</I>
|
||||
<DD>
|
||||
<DD>
|
||||
Maximum number of displayed datasets while browsing <A
|
||||
HREF="http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/hdf-browsing.html">
|
||||
HDF</A> files. Default is 15. If more than the maximum exist in an HDF
|
||||
file, Mosaic will display the HDF file in "brief mode."
|
||||
|
||||
<DT> <B>hdfMaxDisplayedAttributes</B>: <I>integer</I>
|
||||
<DD>
|
||||
<DD>
|
||||
Maximum number of displayed attributes while browsing <A
|
||||
HREF="http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/hdf-browsing.html">
|
||||
HDF</A> files. Default is 10. If more than the max exist in an HDF file,
|
||||
@ -179,11 +179,11 @@ CGI annotation server.
|
||||
|
||||
<DT> <B>hdfPowerUser</B>: <I>Boolean</I>
|
||||
<DD> If true, most of the supporting text in an HDF file will be removed.
|
||||
Default is false.
|
||||
Default is false.
|
||||
|
||||
<DT> <b>homeDocument</b>: <i>string</i>
|
||||
<DD> Document to access on program startup. Default is
|
||||
"http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/NCSAMosaicHome.html".
|
||||
<DD> Document to access on program startup. Default is
|
||||
"http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/NCSAMosaicHome.html".
|
||||
See also
|
||||
<A NAME=7 HREF="specifying-home.html">information on specifying your
|
||||
home document</A>.
|
||||
@ -214,28 +214,28 @@ CGI annotation server.
|
||||
<DD> Controls the maximum number of cci clients communicating with the browser.
|
||||
Default is no limit.
|
||||
|
||||
<DT> <B>maxWaisResponses</B>: <I>integer</I>
|
||||
<DT> <B>maxWaisResponses</B>: <I>integer</I>
|
||||
<DD> Controls maximum number of matches Mosaic gets from a WAIS server.
|
||||
Default is 200.
|
||||
Default is 200.
|
||||
|
||||
<DT> <b><A NAME="personalAnnotationDirectory">personalAnnotationDirectory</A></b>:
|
||||
<DT> <b><A NAME="personalAnnotationDirectory">personalAnnotationDirectory</A></b>:
|
||||
<i>string</i>
|
||||
<DD> Name of directory in which to store personal annotations (as well
|
||||
as the log file of all personal annotations currently in existence).
|
||||
Default is ".mosaic-personal-annotations"; the value
|
||||
of the environment variable $HOME will be prepended to this string.
|
||||
(If the directory so named does not exist, it will be created;
|
||||
however, intermediate directories, if any are named,
|
||||
however, intermediate directories, if any are named,
|
||||
will not be created.)
|
||||
|
||||
<DT> <B>personalExtensionMap</B>: <I>string</I>
|
||||
<DT> <B>personalExtensionMap</B>: <I>string</I>
|
||||
<DD> Can be set to the location of the personal <A
|
||||
HREF="extension-map.html">extension map</A> config file of
|
||||
your choice -- the value of the environment variable HOME is prepended to
|
||||
this. Default is ".mime.types"
|
||||
|
||||
|
||||
<DT> <B>personalTypeMap</B>: <I>string</I>
|
||||
<DT> <B>personalTypeMap</B>: <I>string</I>
|
||||
<DD> Can be set to the location of the personal <A
|
||||
HREF="mailcap.html">mailcap</A> file of your choice -- the value of the
|
||||
environment variable <CODE>HOME</CODE> is prepended to this. Default is
|
||||
@ -266,17 +266,17 @@ CGI annotation server.
|
||||
|
||||
<DT> <B>reloadPragmaNoCache</B>: <I>Boolean</I>
|
||||
<DD> If true, Mosaic will send additional header info to notify a proxy
|
||||
not to use cache. This only works with caching proxy servers.
|
||||
not to use cache. This only works with caching proxy servers.
|
||||
Default is false.
|
||||
|
||||
<DT> <B>reloadReloadsImages</B>: <I>Boolean</I>
|
||||
<DD> If true, the <I>Reload</I> option will clear out cached image data for
|
||||
<DT> <B>reloadReloadsImages</B>: <I>Boolean</I>
|
||||
<DD> If true, the <I>Reload</I> option will clear out cached image data for
|
||||
the current document before reloading the document, thus causing the
|
||||
images to be reloaded also. This is most useful for HTML authors using
|
||||
Mosaic to view their work. Default is false.
|
||||
|
||||
<A NAME="sendmail">
|
||||
<DT> <B>sendmailCommand</B>: <I>string</I> </A>
|
||||
<DT> <B>sendmailCommand</B>: <I>string</I> </A>
|
||||
<DD> Points to the <CODE>sendmail</CODE> binary. The assumption is made that
|
||||
this program accepts command-line arguments specifying addresses to which
|
||||
messages should be mailed, and accepts other headers and message text from
|
||||
@ -287,11 +287,11 @@ CGI annotation server.
|
||||
<DD> Points to the signature file used when posting articles to newsgroups. This
|
||||
file will be included whenever you post or followup. Default is no signature.
|
||||
|
||||
<DT> <B>simpleInterface</B>: <I>Boolean</I>
|
||||
<DT> <B>simpleInterface</B>: <I>Boolean</I>
|
||||
<DD> Allows Mosaic's menu bar and bottom button configuration to be
|
||||
considerably pared down (default is false).
|
||||
|
||||
<DT> <b><A NAME="tmpDirectory">tmpDirectory</A></b>: <i>string</i>
|
||||
<DT> <b><A NAME="tmpDirectory">tmpDirectory</A></b>: <i>string</i>
|
||||
<DD> Name of directory in which to store temporary files generated by
|
||||
Mosaic. This directory should have plenty of space, ideally
|
||||
at least 10 or 20 megabytes, in case you happen to pull down a
|
||||
@ -300,10 +300,10 @@ CGI annotation server.
|
||||
HREF="command-line-flags.html#tmpdir">-tmpdir</A> or setting
|
||||
the environment variable <code>TMPDIR</code>.
|
||||
|
||||
<DT> <B>trackFullURLs</B>: <I>Boolean</I>
|
||||
<DT> <B>trackFullURLs</B>: <I>Boolean</I>
|
||||
<DD> If set to false, enables prototypical smart display of "where you're
|
||||
going" during mouse tracking, including format divination. Default is
|
||||
true.
|
||||
true.
|
||||
|
||||
<DT> <B>trackPointerMotion</B>: <I>Boolean</I>
|
||||
<DD> If set to false, the mouse pointer will not be tracked so that URLs
|
||||
@ -322,12 +322,12 @@ CGI annotation server.
|
||||
Gopher typing system. When true, Mosaic will use its own mechanism
|
||||
to determine the file types of Gopher documents. Default is true.
|
||||
|
||||
<DT> <B>twirlIncrement</B>: <I>integer</I>
|
||||
<DD> Indicates how many bytes (minimum) are transferred between updates
|
||||
<DT> <B>twirlIncrement</B>: <I>integer</I>
|
||||
<DD> Indicates how many bytes (minimum) are transferred between updates
|
||||
of the twirling transfer icon for normal (FTP, Gopher, HTTP) transfers.
|
||||
Default is 4096.
|
||||
|
||||
<DT> <b>twirlingTransferIcon</b>: <I>Boolean</I>
|
||||
<DT> <b>twirlingTransferIcon</b>: <I>Boolean</I>
|
||||
<DD> Can be set to false to turn off the twirling NCSA logo during document
|
||||
transfers. <I>Clicking</I> the icon will still interrupt a transfer.
|
||||
Default is true.
|
||||
@ -336,22 +336,22 @@ CGI annotation server.
|
||||
<DD> Command to use to uncompress compressed files (files with an
|
||||
extension of '.Z'). Default is "uncompress"
|
||||
|
||||
<DT> <B>useDefaultExtensionMap</B>: <I>Boolean</I>
|
||||
<DT> <B>useDefaultExtensionMap</B>: <I>Boolean</I>
|
||||
<DD> Can be set to false to keep Mosaic from having any default <A
|
||||
HREF="extension-map.html">file-extension-to-MIME-type mappings</A>. <I>
|
||||
We strongly recommend that this resource be left true;</I> simply
|
||||
overridden as necessary. Default is true.
|
||||
|
||||
<DT> <B>useDefaultTypeMap</B>: <I>Boolean</I>
|
||||
<DD> Can be set to false to keep Mosaic from having any default <A
|
||||
<DT> <B>useDefaultTypeMap</B>: <I>Boolean</I>
|
||||
<DD> Can be set to false to keep Mosaic from having any default <A
|
||||
HREF="mailcap.html">MIME-type-to-external-viewer mappings</A>. <I>We
|
||||
strongly recommend that this resource be left true</I>; simply overridden
|
||||
as necessary. Default is true.
|
||||
as necessary. Default is true.
|
||||
|
||||
<DT> <b>useGlobalHistory</b>: <i>Boolean</i>
|
||||
<DD> If true, a global history of everywhere you visit is automatically
|
||||
stored. (This history is used to
|
||||
shade anchors different colors based on whether you've visited the
|
||||
<DD> If true, a global history of everywhere you visit is automatically
|
||||
stored. (This history is used to
|
||||
shade anchors different colors based on whether you've visited the
|
||||
corresponding documents or not, if resource trackVisitedAnchors
|
||||
is set to true) Default is true.
|
||||
|
||||
@ -378,7 +378,7 @@ NAME="widget-resources-note">you should specify them</A> in your
|
||||
<DT> <b>Background</b>: <i>color</i>
|
||||
<DD> Color for main background. Default is grey.
|
||||
<DT> <b>Foreground</b>: <i>color</i>
|
||||
<DD> Color for normal text. Default is black.
|
||||
<DD> Color for normal text. Default is black.
|
||||
<DT> <b>anchorColor</b>: <i>color</i>
|
||||
<DD> Color to shade anchors whose corresponding documents haven't been previously visited. Default is blue3.
|
||||
<DT> <b>visitedAnchorColor</b>: <i>color</i>
|
||||
@ -386,8 +386,8 @@ NAME="widget-resources-note">you should specify them</A> in your
|
||||
<DT> <b>activeAnchorFG</b>: <i>color</i>
|
||||
<DD> Color to shade anchors that are in the process of being activated. Default is red.
|
||||
<DT> <b>activeAnchorBG</b>: <i>color</i>
|
||||
<DD> Color to shade the background of anchors that are in the
|
||||
process of being activated. Default is grey80 (the same
|
||||
<DD> Color to shade the background of anchors that are in the
|
||||
process of being activated. Default is grey80 (the same
|
||||
color as the application's background).
|
||||
<DT> <b>anchorUnderlines</b>: <i>integer</i>
|
||||
<DD> This can be one of {0, 1, 2, 3}, and indicates the number
|
||||
@ -418,7 +418,7 @@ NAME="widget-resources-note">you should specify them</A> in your
|
||||
bitmaps. Default is false.
|
||||
|
||||
<DT> <B>verticalScrollOnRight</B>: <I>Boolean</I>
|
||||
<DD> If false, the Document View window will place its scroll bar on the
|
||||
<DD> If false, the Document View window will place its scroll bar on the
|
||||
left side. Default is true.
|
||||
|
||||
</DL>
|
||||
@ -428,7 +428,7 @@ bitmaps. Default is false.
|
||||
|
||||
Font resources are also resources that belong to the HTML widget, so
|
||||
the <A NAME=8 HREF="#widget-resources-note">above note</A> applies
|
||||
here too. Note that fonts can be changed dynamically from the
|
||||
here too. Note that fonts can be changed dynamically from the
|
||||
<b>Options</b> menu</A>.
|
||||
|
||||
<DL>
|
||||
@ -437,40 +437,40 @@ here too. Note that fonts can be changed dynamically from the
|
||||
to any of the font choices in the Options-Font menu. For example.
|
||||
<LISTING>Mosaic*defaultFontChoice: New Century Large</LISTING>
|
||||
<DT> <b>font</b>: <i>font</i>
|
||||
<DD> Font used in normal formatted text.
|
||||
<DD> Font used in normal formatted text.
|
||||
Default is "-adobe-times-medium-r-normal-*-17-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>italicFont</b>: <i>font</i>
|
||||
<DD> Font used in italic formatted text.
|
||||
<DD> Font used in italic formatted text.
|
||||
Default is "-adobe-times-medium-i-normal-*-17-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>boldFont</b>: <i>font</i>
|
||||
<DD> Font used in bold formatted text.
|
||||
<DD> Font used in bold formatted text.
|
||||
Default is "-adobe-times-bold-r-normal-*-17-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>fixedFont</b>: <i>font</i>
|
||||
<DD> Font used in fixed (typewriter style) formatted text.
|
||||
<DD> Font used in fixed (typewriter style) formatted text.
|
||||
Default is "-adobe-courier-medium-r-normal-*-17-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>header1Font</b>: <i>font</i>
|
||||
<DD> Font used in level 1 headers.
|
||||
<DD> Font used in level 1 headers.
|
||||
Default is "-adobe-times-bold-r-normal-*-24-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>header2Font</b>: <i>font</i>
|
||||
<DD> Font used in level 2 headers.
|
||||
<DD> Font used in level 2 headers.
|
||||
Default is "-adobe-times-bold-r-normal-*-18-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>header3Font</b>: <i>font</i>
|
||||
<DD> Font used in level 3 headers.
|
||||
<DD> Font used in level 3 headers.
|
||||
Default is "-adobe-times-bold-r-normal-*-17-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>header4Font</b>: <i>font</i>
|
||||
<DD> Font used in level 4 headers.
|
||||
<DD> Font used in level 4 headers.
|
||||
Default is "-adobe-times-bold-r-normal-*-14-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>header5Font</b>: <i>font</i>
|
||||
<DD> Font used in level 5 headers.
|
||||
<DD> Font used in level 5 headers.
|
||||
Default is "-adobe-times-bold-r-normal-*-12-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>header6Font</b>: <i>font</i>
|
||||
<DD> Font used in level 6 headers.
|
||||
<DD> Font used in level 6 headers.
|
||||
Default is "-adobe-times-bold-r-normal-*-10-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>addressFont</b>: <i>font</i>
|
||||
<DD> Font used in addresses.
|
||||
<DD> Font used in addresses.
|
||||
Default is "-adobe-times-medium-i-normal-*-17-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>plainFont</b>: <i>font</i>
|
||||
<DD> Font used in plaintext regions or preformatted documents.
|
||||
<DD> Font used in plaintext regions or preformatted documents.
|
||||
Default is "-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-iso8859-1".
|
||||
<DT> <b>listingFont</b>: <i>font</i>
|
||||
<DD> Font used in listing regions. Default is "-adobe-courier-medium-r-normal-*-12-*-*-*-*-*-iso8859-1".
|
||||
@ -566,7 +566,7 @@ The following resources once did something, but not anymore. <P>
|
||||
|
||||
<DT> <b>mailCommand</b>: <i>string</i>
|
||||
<DD> Replaced in version 2.0 with <A HREF="#sendmail">sendmailCommand</A>
|
||||
resource.
|
||||
resource.
|
||||
|
||||
<DT> <b><A NAME="warpPointerForIndex">warpPointerForIndex</A></b>:
|
||||
<i>Boolean</i>
|
||||
@ -587,14 +587,14 @@ version of Mosaic to a 2.x version:</EM>
|
||||
<UL>
|
||||
<LI> The class name has been changed from <i>XMosaic</i> to <i>Mosaic</i>.
|
||||
Existing Mosaic 1.2 X resources and application defaults files should be
|
||||
modified accordingly.
|
||||
modified accordingly.
|
||||
<LI> Information on <A HREF="faq-broken.html#11">the removal of version 1.2
|
||||
multimedia X resources.</A>
|
||||
</UL>
|
||||
|
||||
|
||||
<A HREF="mosaic-docs.html"><IMG SRC="up.xbm"> Back to top level Documentation
|
||||
Index</A>
|
||||
Index</A>
|
||||
<P>
|
||||
|
||||
Last Modified: 9 July 1995 <BR>
|
||||
|
@ -1,7 +1,7 @@
|
||||
# @configure_output@
|
||||
# This file is used by Autoconf to make the real Makefile.
|
||||
# DO NOT EDIT THIS FILE!
|
||||
# If you want to change something do it to the Makefile autoconf
|
||||
# If you want to change something do it to the Makefile autoconf
|
||||
# creates. You should never have to edit this file.
|
||||
|
||||
CC= @CC@
|
||||
|
222
libXmx/Xmx.c
222
libXmx/Xmx.c
@ -171,7 +171,7 @@ void
|
||||
XmxAddEventHandler (Widget w, EventMask event_mask, XtEventHandler proc,
|
||||
int client_data)
|
||||
{
|
||||
XtAddEventHandler
|
||||
XtAddEventHandler
|
||||
(w, event_mask, False, proc, (XtPointer)_XmxMakeClientData (client_data));
|
||||
|
||||
return;
|
||||
@ -195,19 +195,19 @@ XmxRemoveEventHandler (Widget w, EventMask event_mask, XtEventHandler proc,
|
||||
/* Adapted from Dan Heller's post in comp.windows.x.motif;
|
||||
assumes BulletinBoard with one (centered) child. */
|
||||
static void
|
||||
XmxCenteringResize
|
||||
XmxCenteringResize
|
||||
(CompositeWidget w, XConfigureEvent *event, String args[], int *num_args)
|
||||
{
|
||||
WidgetList children;
|
||||
int width = event->width;
|
||||
int height = event->height;
|
||||
Dimension w_width, w_height;
|
||||
|
||||
Dimension w_width, w_height;
|
||||
|
||||
/* get handle to BulletinBoard's children and marginal spacing */
|
||||
XtVaGetValues (w,
|
||||
XmNchildren, &children,
|
||||
NULL);
|
||||
|
||||
|
||||
XtVaGetValues (children[0],
|
||||
XmNheight, &w_height,
|
||||
XmNwidth, &w_width,
|
||||
@ -216,7 +216,7 @@ XmxCenteringResize
|
||||
XmNx, width/2 - w_width/2,
|
||||
XmNy, height/2 - w_height/2,
|
||||
NULL);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@ void XmxManageRemanage (Widget w)
|
||||
XtUnmanageChild (w);
|
||||
XtManageChild (w);
|
||||
#endif
|
||||
|
||||
|
||||
if (XtIsManaged (w))
|
||||
if (XtIsShell(w))
|
||||
XRaiseWindow (XtDisplay (w), XtWindow (w));
|
||||
@ -297,7 +297,7 @@ Widget XmxMakePushButton (Widget parent, String name, XtCallbackProc cb,
|
||||
}
|
||||
Xmx_w = XtCreateManagedWidget ("pushbutton", xmPushButtonWidgetClass,
|
||||
parent, Xmx_wargs, Xmx_n);
|
||||
XtAddCallback (Xmx_w, XmNactivateCallback, cb,
|
||||
XtAddCallback (Xmx_w, XmNactivateCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (cb_data));
|
||||
|
||||
if (xmstr)
|
||||
@ -308,12 +308,12 @@ Widget XmxMakePushButton (Widget parent, String name, XtCallbackProc cb,
|
||||
}
|
||||
|
||||
/* args work */
|
||||
Widget XmxMakeNamedPushButton (Widget parent, String name, String wname,
|
||||
Widget XmxMakeNamedPushButton (Widget parent, String name, String wname,
|
||||
XtCallbackProc cb,
|
||||
int cb_data)
|
||||
{
|
||||
XmString label;
|
||||
|
||||
|
||||
if (name)
|
||||
{
|
||||
label = XmStringCreateLtoR (name, XmSTRING_DEFAULT_CHARSET);
|
||||
@ -321,7 +321,7 @@ Widget XmxMakeNamedPushButton (Widget parent, String name, String wname,
|
||||
}
|
||||
Xmx_w = XtCreateManagedWidget (wname, xmPushButtonWidgetClass,
|
||||
parent, Xmx_wargs, Xmx_n);
|
||||
XtAddCallback (Xmx_w, XmNactivateCallback, cb,
|
||||
XtAddCallback (Xmx_w, XmNactivateCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (cb_data));
|
||||
if (name)
|
||||
XmStringFree (label);
|
||||
@ -336,9 +336,9 @@ Widget XmxMakeBlankButton (Widget parent, XtCallbackProc cb,
|
||||
{
|
||||
Xmx_w = XtCreateManagedWidget ("blankbutton", xmPushButtonWidgetClass,
|
||||
parent, Xmx_wargs, Xmx_n);
|
||||
XtAddCallback (Xmx_w, XmNactivateCallback, cb,
|
||||
XtAddCallback (Xmx_w, XmNactivateCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (cb_data));
|
||||
|
||||
|
||||
Xmx_n = 0;
|
||||
return Xmx_w;
|
||||
}
|
||||
@ -346,7 +346,7 @@ Widget XmxMakeBlankButton (Widget parent, XtCallbackProc cb,
|
||||
/* ------------------------------- COMMAND -------------------------------- */
|
||||
|
||||
/* args work */
|
||||
Widget XmxMakeCommand
|
||||
Widget XmxMakeCommand
|
||||
(Widget parent, String prompt, XtCallbackProc cb, int cb_data)
|
||||
{
|
||||
XmString xmstr = XmxMakeXmstrFromString (prompt);
|
||||
@ -354,8 +354,8 @@ Widget XmxMakeCommand
|
||||
XmxSetArg (XmNpromptString, (XtArgVal)xmstr);
|
||||
Xmx_w = XtCreateManagedWidget ("command", xmCommandWidgetClass, parent,
|
||||
Xmx_wargs, Xmx_n);
|
||||
XtAddCallback
|
||||
(Xmx_w, XmNcommandEnteredCallback, cb,
|
||||
XtAddCallback
|
||||
(Xmx_w, XmNcommandEnteredCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (cb_data));
|
||||
|
||||
XmStringFree (xmstr);
|
||||
@ -376,7 +376,7 @@ Widget XmxMakeScrolledList
|
||||
along with it... */
|
||||
XtAddCallback (Xmx_w, XmNdefaultActionCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (cb_data));
|
||||
|
||||
|
||||
Xmx_n = 0;
|
||||
return Xmx_w;
|
||||
}
|
||||
@ -433,7 +433,7 @@ Widget XmxMakeToggleButton (Widget parent, String name, XtCallbackProc cb,
|
||||
("togglebutton", xmToggleButtonWidgetClass, parent, Xmx_wargs, Xmx_n);
|
||||
/* Used to be XmNarmCallback --- probably not right. */
|
||||
if (cb)
|
||||
XtAddCallback (Xmx_w, XmNvalueChangedCallback, cb,
|
||||
XtAddCallback (Xmx_w, XmNvalueChangedCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (cb_data));
|
||||
|
||||
XmStringFree (label);
|
||||
@ -446,7 +446,7 @@ Widget XmxMakeToggleButton (Widget parent, String name, XtCallbackProc cb,
|
||||
void XmxSetToggleButton (Widget button, int set_state)
|
||||
{
|
||||
assert (set_state == XmxSet || set_state == XmxUnset);
|
||||
XmToggleButtonSetState
|
||||
XmToggleButtonSetState
|
||||
(button, (set_state == XmxSet) ? True : False, False);
|
||||
|
||||
Xmx_n = 0;
|
||||
@ -478,10 +478,10 @@ Widget XmxMakeScale (Widget parent, XtCallbackProc cb, int cb_data,
|
||||
Xmx_w = XtCreateManagedWidget ("scale", xmScaleWidgetClass, parent,
|
||||
Xmx_wargs, Xmx_n);
|
||||
|
||||
XtAddCallback
|
||||
(Xmx_w, XmNvalueChangedCallback, cb,
|
||||
XtAddCallback
|
||||
(Xmx_w, XmNvalueChangedCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (cb_data));
|
||||
XtAddCallback (Xmx_w, XmNdragCallback, cb,
|
||||
XtAddCallback (Xmx_w, XmNdragCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (cb_data));
|
||||
|
||||
Xmx_n = 0;
|
||||
@ -573,7 +573,7 @@ void XmxSetOffsets (Widget w, int top, int bottom, int left, int right)
|
||||
XmxSetArg (XmNleftOffset, (XtArgVal)left);
|
||||
if (right != XmxNoOffset)
|
||||
XmxSetArg (XmNrightOffset, (XtArgVal)right);
|
||||
|
||||
|
||||
XmxSetValues (w);
|
||||
|
||||
Xmx_n = 0;
|
||||
@ -581,7 +581,7 @@ void XmxSetOffsets (Widget w, int top, int bottom, int left, int right)
|
||||
}
|
||||
|
||||
/* args sent to w */
|
||||
void XmxSetConstraints (Widget w,
|
||||
void XmxSetConstraints (Widget w,
|
||||
int top, int bottom, int left, int right,
|
||||
Widget topw, Widget botw, Widget lefw, Widget rigw)
|
||||
{
|
||||
@ -591,7 +591,7 @@ void XmxSetConstraints (Widget w,
|
||||
if (topw)
|
||||
XmxSetArg (XmNtopWidget, (XtArgVal)topw);
|
||||
}
|
||||
|
||||
|
||||
if (bottom != XmATTACH_NONE)
|
||||
{
|
||||
XmxSetArg (XmNbottomAttachment, (XtArgVal)bottom);
|
||||
@ -612,7 +612,7 @@ void XmxSetConstraints (Widget w,
|
||||
if (rigw)
|
||||
XmxSetArg (XmNrightWidget, (XtArgVal)rigw);
|
||||
}
|
||||
|
||||
|
||||
XmxSetValues (w);
|
||||
|
||||
Xmx_n = 0;
|
||||
@ -705,7 +705,7 @@ Widget XmxMakeCenteringBboard (Widget parent, XtAppContext app)
|
||||
{
|
||||
XtActionsRec rec;
|
||||
|
||||
Xmx_w = XtCreateManagedWidget
|
||||
Xmx_w = XtCreateManagedWidget
|
||||
("bboard", xmBulletinBoardWidgetClass, parent, Xmx_wargs, Xmx_n);
|
||||
|
||||
/* Does this have to happen more than once? */
|
||||
@ -714,9 +714,9 @@ Widget XmxMakeCenteringBboard (Widget parent, XtAppContext app)
|
||||
XtAppAddActions (app, &rec, 1);
|
||||
|
||||
/* This does, for sure... */
|
||||
XtOverrideTranslations
|
||||
XtOverrideTranslations
|
||||
(Xmx_w, XtParseTranslationTable ("<Configure>: resize()"));
|
||||
|
||||
|
||||
Xmx_n = 0;
|
||||
return Xmx_w;
|
||||
}
|
||||
@ -830,9 +830,9 @@ Widget XmxMakeQuestionDialog (Widget parent, String question, String title,
|
||||
Xmx_w = XmCreateQuestionDialog (parent, "question", Xmx_wargs, Xmx_n);
|
||||
XtUnmanageChild (XmMessageBoxGetChild (Xmx_w, XmDIALOG_HELP_BUTTON));
|
||||
|
||||
XtAddCallback (Xmx_w, XmNcancelCallback, cb,
|
||||
XtAddCallback (Xmx_w, XmNcancelCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (no_token));
|
||||
XtAddCallback (Xmx_w, XmNokCallback, cb,
|
||||
XtAddCallback (Xmx_w, XmNokCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (yes_token));
|
||||
|
||||
XmStringFree (message);
|
||||
@ -921,21 +921,21 @@ Widget XmxMakeFileSBDialog (Widget parent, String title, String selection_txt,
|
||||
XmxSetArg (XmNdialogTitle, (XtArgVal)dialog_title);
|
||||
/* Can't set width of box with XmNwidth here... why not? */
|
||||
|
||||
/* this will cause the dialog to only resize if needed. That
|
||||
/* this will cause the dialog to only resize if needed. That
|
||||
way it won't be growing and shrinking all the time... very annoying. - DXP */
|
||||
XmxSetArg (XmNresizePolicy, (XtArgVal)XmRESIZE_GROW);
|
||||
|
||||
/* Create the FileSelectionBox with OK and Cancel buttons. */
|
||||
Xmx_w = XmCreateFileSelectionDialog (parent, "fsb", Xmx_wargs, Xmx_n);
|
||||
XtUnmanageChild (XmFileSelectionBoxGetChild (Xmx_w, XmDIALOG_HELP_BUTTON));
|
||||
XtAddCallback (Xmx_w, XmNokCallback, cb,
|
||||
XtAddCallback (Xmx_w, XmNokCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (cb_data));
|
||||
XtAddCallback (Xmx_w, XmNcancelCallback,
|
||||
XtAddCallback (Xmx_w, XmNcancelCallback,
|
||||
(XtCallbackProc)_XmxCancelCallback, 0);
|
||||
|
||||
/* Set selection label to specified selection_txt. */
|
||||
Xmx_n = 0;
|
||||
_selection_label =
|
||||
_selection_label =
|
||||
XmFileSelectionBoxGetChild (Xmx_w, XmDIALOG_SELECTION_LABEL);
|
||||
XmxSetArg (XmNlabelString, (XtArgVal)label);
|
||||
XtSetValues (_selection_label, Xmx_wargs, Xmx_n);
|
||||
@ -977,7 +977,7 @@ XmxCallback(_XmxHelpTextCancelCallback)
|
||||
}
|
||||
|
||||
/* args work */
|
||||
Widget XmxMakeHelpTextDialog
|
||||
Widget XmxMakeHelpTextDialog
|
||||
(Widget parent, String str, String title, Widget *text_w)
|
||||
{
|
||||
Widget _box, _outer_frame, _form;
|
||||
@ -1013,17 +1013,17 @@ Widget XmxMakeHelpTextDialog
|
||||
_sep = XmxMakeHorizontalSeparator (_form);
|
||||
|
||||
/* Make an OK button. */
|
||||
_buttons_form = XmxMakeFormAndOneButton
|
||||
_buttons_form = XmxMakeFormAndOneButton
|
||||
(_form, _XmxHelpTextCancelCallback, "OK", 0);
|
||||
|
||||
/* Constraints for _form. */
|
||||
XmxSetConstraints
|
||||
(XtParent (_scr_text), XmATTACH_FORM, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(XtParent (_scr_text), XmATTACH_FORM, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM, NULL, _sep, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_sep, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, _buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
@ -1082,7 +1082,7 @@ Widget XmxMakeHorizontalSpacer (Widget parent)
|
||||
XmString label = XmStringCreateLtoR (" ", XmSTRING_DEFAULT_CHARSET);
|
||||
|
||||
XmxSetArg (XmNlabelString, (XtArgVal)label);
|
||||
Xmx_w = XtCreateManagedWidget ("label", xmLabelGadgetClass, parent,
|
||||
Xmx_w = XtCreateManagedWidget ("label", xmLabelGadgetClass, parent,
|
||||
Xmx_wargs, Xmx_n);
|
||||
|
||||
XmStringFree (label);
|
||||
@ -1113,7 +1113,7 @@ Widget XmxMakeScrolledText (Widget parent)
|
||||
Xmx_wargs, Xmx_n);
|
||||
XtManageChild (Xmx_w);
|
||||
|
||||
/* Remember this returns the Text Widget, NOT the ScrolledWindow Widget,
|
||||
/* Remember this returns the Text Widget, NOT the ScrolledWindow Widget,
|
||||
which is what needs to be tied into a form. Use XtParent to get the
|
||||
actual ScrolledWindow. */
|
||||
Xmx_n = 0;
|
||||
@ -1165,7 +1165,7 @@ String XmxTextGetString (Widget text)
|
||||
/* args do nothing */
|
||||
void XmxAddCallbackToText (Widget text, XtCallbackProc cb, int cb_data)
|
||||
{
|
||||
XtAddCallback (text, XmNactivateCallback, cb,
|
||||
XtAddCallback (text, XmNactivateCallback, cb,
|
||||
(XtPointer)_XmxMakeClientData (cb_data));
|
||||
return;
|
||||
}
|
||||
@ -1178,7 +1178,7 @@ void XmxAddCallbackToText (Widget text, XtCallbackProc cb, int cb_data)
|
||||
#ifdef __sgi
|
||||
/* args work */
|
||||
Widget
|
||||
XmxMakeDrawingVolume
|
||||
XmxMakeDrawingVolume
|
||||
(Widget parent, int width, int height,
|
||||
GLXconfig *glxConfig,
|
||||
XtCallbackProc redraw_cb, XtCallbackProc resize_cb,
|
||||
@ -1191,11 +1191,11 @@ XmxMakeDrawingVolume
|
||||
Xmx_w = GlxCreateMDraw (parent, "drawingvolume", Xmx_wargs, Xmx_n);
|
||||
XtManageChild (Xmx_w);
|
||||
|
||||
XtAddCallback (Xmx_w, GlxNexposeCallback, redraw_cb,
|
||||
XtAddCallback (Xmx_w, GlxNexposeCallback, redraw_cb,
|
||||
(XtPointer)_XmxMakeClientData (0));
|
||||
XtAddCallback (Xmx_w, GlxNresizeCallback, resize_cb,
|
||||
XtAddCallback (Xmx_w, GlxNresizeCallback, resize_cb,
|
||||
(XtPointer)_XmxMakeClientData (0));
|
||||
XtAddCallback (Xmx_w, GlxNginitCallback, ginit_cb,
|
||||
XtAddCallback (Xmx_w, GlxNginitCallback, ginit_cb,
|
||||
(XtPointer)_XmxMakeClientData (0));
|
||||
|
||||
Xmx_n = 0;
|
||||
@ -1219,7 +1219,7 @@ void XmxInstallColormapsWithOverlay (Widget toplevel, Widget glw)
|
||||
Window overlay, popup, underlay;
|
||||
Arg args[5];
|
||||
register int i=0;
|
||||
|
||||
|
||||
i=0;
|
||||
XtSetArg(args[i], GlxNoverlayWindow, &overlay); i++;
|
||||
XtSetArg(args[i], GlxNpopupWindow, &popup); i++;
|
||||
@ -1244,7 +1244,7 @@ void XmxInstallColormapsWithOverlay (Widget toplevel, Widget glw)
|
||||
windows[i] = XtWindow(glw); i++;
|
||||
windows[i] = XtWindow(toplevel); i++;
|
||||
XSetWMColormapWindows(XtDisplay(toplevel), XtWindow(toplevel), windows, i);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1271,11 +1271,11 @@ XmxMakeDrawingVolume
|
||||
("drawingvolume", glibWidgetClass, parent, Xmx_wargs, Xmx_n);
|
||||
XtManageChild (Xmx_w);
|
||||
|
||||
XtAddCallback (Xmx_w, XglNexposeCallback, redraw_cb,
|
||||
XtAddCallback (Xmx_w, XglNexposeCallback, redraw_cb,
|
||||
(XtPointer)_XmxMakeClientData (0));
|
||||
XtAddCallback (Xmx_w, XglNresizeCallback, resize_cb,
|
||||
XtAddCallback (Xmx_w, XglNresizeCallback, resize_cb,
|
||||
(XtPointer)_XmxMakeClientData (0));
|
||||
XtAddCallback (Xmx_w, XglNgconfigCallback, ginit_cb,
|
||||
XtAddCallback (Xmx_w, XglNgconfigCallback, ginit_cb,
|
||||
(XtPointer)_XmxMakeClientData (0));
|
||||
|
||||
Xmx_n = 0;
|
||||
@ -1363,7 +1363,7 @@ void XmxApplyPixmapToLabelWidget
|
||||
/* ------------------------ DIALOG CONTROL BUTTONS ------------------------ */
|
||||
|
||||
/* args apply to form */
|
||||
Widget XmxMakeFormAndOneButton (Widget parent, XtCallbackProc cb,
|
||||
Widget XmxMakeFormAndOneButton (Widget parent, XtCallbackProc cb,
|
||||
String name1, int cb_data1)
|
||||
{
|
||||
Widget _form, _button1;
|
||||
@ -1374,19 +1374,19 @@ Widget XmxMakeFormAndOneButton (Widget parent, XtCallbackProc cb,
|
||||
|
||||
_button1 = XmxMakePushButton (_form, name1, cb, cb_data1);
|
||||
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button1, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetPositions (_button1, XmxNoPosition, XmxNoPosition, 1, 2);
|
||||
XmxSetOffsets (_button1, XmxNoOffset, XmxNoOffset, 8, 8);
|
||||
|
||||
|
||||
Xmx_n = 0;
|
||||
Xmx_w = _form;
|
||||
return Xmx_w;
|
||||
}
|
||||
|
||||
/* args apply to form */
|
||||
Widget XmxMakeFormAndTwoButtons
|
||||
Widget XmxMakeFormAndTwoButtons
|
||||
(Widget parent, XtCallbackProc cb,
|
||||
String name1, String name2,
|
||||
int cb_data1, int cb_data2)
|
||||
@ -1400,17 +1400,17 @@ Widget XmxMakeFormAndTwoButtons
|
||||
_button1 = XmxMakePushButton (_form, name1, cb, cb_data1);
|
||||
_button2 = XmxMakePushButton (_form, name2, cb, cb_data2);
|
||||
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button1, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button2, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetPositions (_button1, XmxNoPosition, XmxNoPosition, 0, 1);
|
||||
XmxSetPositions (_button2, XmxNoPosition, XmxNoPosition, 1, 2);
|
||||
XmxSetOffsets (_button1, XmxNoOffset, XmxNoOffset, 8, 4);
|
||||
XmxSetOffsets (_button2, XmxNoOffset, XmxNoOffset, 4, 8);
|
||||
|
||||
|
||||
Xmx_n = 0;
|
||||
Xmx_w = _form;
|
||||
return Xmx_w;
|
||||
@ -1431,17 +1431,17 @@ Widget XmxMakeFormAndTwoButtonsSqueezed
|
||||
_button1 = XmxMakePushButton (_form, name1, cb, cb_data1);
|
||||
_button2 = XmxMakePushButton (_form, name2, cb, cb_data2);
|
||||
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button1, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button2, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetPositions (_button1, XmxNoPosition, XmxNoPosition, 1, 2);
|
||||
XmxSetPositions (_button2, XmxNoPosition, XmxNoPosition, 3, 4);
|
||||
XmxSetOffsets (_button1, XmxNoOffset, XmxNoOffset, 8, 4);
|
||||
XmxSetOffsets (_button2, XmxNoOffset, XmxNoOffset, 4, 8);
|
||||
|
||||
|
||||
Xmx_n = 0;
|
||||
Xmx_w = _form;
|
||||
return Xmx_w;
|
||||
@ -1463,13 +1463,13 @@ Widget XmxMakeFormAndThreeButtonsSqueezed
|
||||
_button2 = XmxMakePushButton (_form, name2, cb, cb_data2);
|
||||
_button3 = XmxMakePushButton (_form, name3, cb, cb_data3);
|
||||
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button1, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button2, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button3, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetPositions (_button1, XmxNoPosition, XmxNoPosition, 1, 2);
|
||||
@ -1478,7 +1478,7 @@ Widget XmxMakeFormAndThreeButtonsSqueezed
|
||||
XmxSetOffsets (_button1, XmxNoOffset, XmxNoOffset, 8, 4);
|
||||
XmxSetOffsets (_button2, XmxNoOffset, XmxNoOffset, 4, 4);
|
||||
XmxSetOffsets (_button3, XmxNoOffset, XmxNoOffset, 4, 8);
|
||||
|
||||
|
||||
Xmx_n = 0;
|
||||
Xmx_w = _form;
|
||||
return Xmx_w;
|
||||
@ -1500,13 +1500,13 @@ Widget XmxMakeFormAndThreeButtons
|
||||
_button2 = XmxMakePushButton (_form, name2, cb, cb_data2);
|
||||
_button3 = XmxMakePushButton (_form, name3, cb, cb_data3);
|
||||
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button1, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button2, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button3, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetPositions (_button1, XmxNoPosition, XmxNoPosition, 0, 1);
|
||||
@ -1515,14 +1515,14 @@ Widget XmxMakeFormAndThreeButtons
|
||||
XmxSetOffsets (_button1, XmxNoOffset, XmxNoOffset, 8, 4);
|
||||
XmxSetOffsets (_button2, XmxNoOffset, XmxNoOffset, 4, 4);
|
||||
XmxSetOffsets (_button3, XmxNoOffset, XmxNoOffset, 4, 8);
|
||||
|
||||
|
||||
Xmx_n = 0;
|
||||
Xmx_w = _form;
|
||||
return Xmx_w;
|
||||
}
|
||||
|
||||
/* args apply to form */
|
||||
Widget XmxMakeFormAndFourButtons
|
||||
Widget XmxMakeFormAndFourButtons
|
||||
(Widget parent, XtCallbackProc cb,
|
||||
String name1, String name2, String name3, String name4,
|
||||
int cb_data1, int cb_data2, int cb_data3, int cb_data4)
|
||||
@ -1538,16 +1538,16 @@ Widget XmxMakeFormAndFourButtons
|
||||
_button3 = XmxMakePushButton (_form, name3, cb, cb_data3);
|
||||
_button4 = XmxMakePushButton (_form, name4, cb, cb_data4);
|
||||
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button1, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button2, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button3, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(_button4, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetPositions (_button1, XmxNoPosition, XmxNoPosition, 0, 1);
|
||||
@ -1558,14 +1558,14 @@ Widget XmxMakeFormAndFourButtons
|
||||
XmxSetOffsets (_button2, XmxNoOffset, XmxNoOffset, 4, 4);
|
||||
XmxSetOffsets (_button3, XmxNoOffset, XmxNoOffset, 4, 4);
|
||||
XmxSetOffsets (_button4, XmxNoOffset, XmxNoOffset, 4, 8);
|
||||
|
||||
|
||||
Xmx_n = 0;
|
||||
Xmx_w = _form;
|
||||
return Xmx_w;
|
||||
}
|
||||
|
||||
/* args apply to form */
|
||||
Widget XmxMakeFormAndFiveButtons
|
||||
Widget XmxMakeFormAndFiveButtons
|
||||
(Widget parent, XtCallbackProc cb,
|
||||
String name1, String name2, String name3, String name4, String name5,
|
||||
int cb_data1, int cb_data2, int cb_data3, int cb_data4, int cb_data5)
|
||||
@ -1607,7 +1607,7 @@ Widget XmxMakeFormAndFiveButtons
|
||||
XmxSetOffsets (_button3, XmxNoOffset, XmxNoOffset, 4, 4);
|
||||
XmxSetOffsets (_button4, XmxNoOffset, XmxNoOffset, 4, 4);
|
||||
XmxSetOffsets (_button5, XmxNoOffset, XmxNoOffset, 4, 8);
|
||||
|
||||
|
||||
Xmx_n = 0;
|
||||
Xmx_w = _form;
|
||||
return Xmx_w;
|
||||
@ -1621,7 +1621,7 @@ static void _XmxYesOrNoResponse (Widget w, int *answer, XmAnyCallbackStruct *cbs
|
||||
*answer = 0;
|
||||
}
|
||||
|
||||
int XmxModalYesOrNo (Widget parent, XtAppContext app,
|
||||
int XmxModalYesOrNo (Widget parent, XtAppContext app,
|
||||
char *questionstr, char *yesstr, char *nostr)
|
||||
{
|
||||
Widget dialog;
|
||||
@ -1634,7 +1634,7 @@ int XmxModalYesOrNo (Widget parent, XtAppContext app,
|
||||
yes = XmStringCreateLtoR (yesstr, XmSTRING_DEFAULT_CHARSET);
|
||||
no = XmStringCreateLtoR (nostr, XmSTRING_DEFAULT_CHARSET);
|
||||
title = XmStringCreateLtoR ("Prompt", XmSTRING_DEFAULT_CHARSET);
|
||||
|
||||
|
||||
XmxSetArg (XmNdialogTitle, (XtArgVal)title);
|
||||
XmxSetArg (XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL);
|
||||
XmxSetArg (XmNmessageString, (XtArgVal)question);
|
||||
@ -1644,11 +1644,11 @@ int XmxModalYesOrNo (Widget parent, XtAppContext app,
|
||||
|
||||
dialog = XmCreateQuestionDialog (parent, "question_dialog", Xmx_wargs, Xmx_n);
|
||||
Xmx_n = 0;
|
||||
|
||||
|
||||
XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_HELP_BUTTON));
|
||||
XtAddCallback (dialog, XmNokCallback,
|
||||
XtAddCallback (dialog, XmNokCallback,
|
||||
(XtCallbackProc)_XmxYesOrNoResponse, &answer);
|
||||
XtAddCallback (dialog, XmNcancelCallback,
|
||||
XtAddCallback (dialog, XmNcancelCallback,
|
||||
(XtCallbackProc)_XmxYesOrNoResponse, &answer);
|
||||
|
||||
XtManageChild (dialog);
|
||||
@ -1680,20 +1680,20 @@ int XmxModalYesOrNo (Widget parent, XtAppContext app,
|
||||
#define XMX_NO_ANSWER "-*-no answer, dammit, but Xmx rules, yo yo yo-*-"
|
||||
|
||||
/*SWP -- 7/6/95*/
|
||||
static void _XmxActivate (Widget w, char **answer,
|
||||
static void _XmxActivate (Widget w, char **answer,
|
||||
XmSelectionBoxCallbackStruct *cbs)
|
||||
{
|
||||
*answer = XMX_NO_ANSWER;
|
||||
}
|
||||
|
||||
static void _XmxPromptForStringResponse (Widget w, char **answer,
|
||||
static void _XmxPromptForStringResponse (Widget w, char **answer,
|
||||
XmSelectionBoxCallbackStruct *cbs)
|
||||
{
|
||||
if (!XmStringGetLtoR (cbs->value, XmSTRING_DEFAULT_CHARSET, answer))
|
||||
*answer = XMX_NO_ANSWER;
|
||||
}
|
||||
|
||||
static void _XmxPromptForStringCancel (Widget w, char **answer,
|
||||
static void _XmxPromptForStringCancel (Widget w, char **answer,
|
||||
XmSelectionBoxCallbackStruct *cbs)
|
||||
{
|
||||
*answer = XMX_NO_ANSWER;
|
||||
@ -1701,7 +1701,7 @@ static void _XmxPromptForStringCancel (Widget w, char **answer,
|
||||
|
||||
|
||||
/*SWP -- 7/4/95*/
|
||||
void XmxMakeInfoDialogWait (Widget parent, XtAppContext app,
|
||||
void XmxMakeInfoDialogWait (Widget parent, XtAppContext app,
|
||||
char *infostr, char *titlestr, char *yesstr)
|
||||
{
|
||||
Widget dialog;
|
||||
@ -1711,7 +1711,7 @@ void XmxMakeInfoDialogWait (Widget parent, XtAppContext app,
|
||||
info = XmStringCreateLtoR (infostr, XmSTRING_DEFAULT_CHARSET);
|
||||
yes = XmStringCreateLtoR (yesstr, XmSTRING_DEFAULT_CHARSET);
|
||||
title = XmStringCreateLtoR (titlestr, XmSTRING_DEFAULT_CHARSET);
|
||||
|
||||
|
||||
XmxSetArg (XmNdialogTitle, (XtArgVal)title);
|
||||
XmxSetArg (XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL);
|
||||
XmxSetArg (XmNmessageString, (XtArgVal)info);
|
||||
@ -1724,7 +1724,7 @@ void XmxMakeInfoDialogWait (Widget parent, XtAppContext app,
|
||||
XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_HELP_BUTTON));
|
||||
XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_CANCEL_BUTTON));
|
||||
|
||||
XtAddCallback (dialog, XmNokCallback,
|
||||
XtAddCallback (dialog, XmNokCallback,
|
||||
(XtCallbackProc)_XmxActivate, &answer);
|
||||
|
||||
XtManageChild (dialog);
|
||||
@ -1750,7 +1750,7 @@ void XmxMakeInfoDialogWait (Widget parent, XtAppContext app,
|
||||
|
||||
|
||||
/*SWP -- 4/15/96*/
|
||||
void XmxMakeErrorDialogWait (Widget parent, XtAppContext app,
|
||||
void XmxMakeErrorDialogWait (Widget parent, XtAppContext app,
|
||||
char *infostr, char *titlestr, char *yesstr)
|
||||
{
|
||||
Widget dialog;
|
||||
@ -1760,7 +1760,7 @@ void XmxMakeErrorDialogWait (Widget parent, XtAppContext app,
|
||||
info = XmStringCreateLtoR (infostr, XmSTRING_DEFAULT_CHARSET);
|
||||
yes = XmStringCreateLtoR (yesstr, XmSTRING_DEFAULT_CHARSET);
|
||||
title = XmStringCreateLtoR (titlestr, XmSTRING_DEFAULT_CHARSET);
|
||||
|
||||
|
||||
XmxSetArg (XmNdialogTitle, (XtArgVal)title);
|
||||
XmxSetArg (XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL);
|
||||
XmxSetArg (XmNmessageString, (XtArgVal)info);
|
||||
@ -1773,7 +1773,7 @@ void XmxMakeErrorDialogWait (Widget parent, XtAppContext app,
|
||||
XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_HELP_BUTTON));
|
||||
XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_CANCEL_BUTTON));
|
||||
|
||||
XtAddCallback (dialog, XmNokCallback,
|
||||
XtAddCallback (dialog, XmNokCallback,
|
||||
(XtCallbackProc)_XmxActivate, &answer);
|
||||
|
||||
XtManageChild (dialog);
|
||||
@ -1798,7 +1798,7 @@ void XmxMakeErrorDialogWait (Widget parent, XtAppContext app,
|
||||
}
|
||||
|
||||
|
||||
char *XmxModalPromptForString (Widget parent, XtAppContext app,
|
||||
char *XmxModalPromptForString (Widget parent, XtAppContext app,
|
||||
char *questionstr, char *yesstr, char *nostr)
|
||||
{
|
||||
Widget dialog;
|
||||
@ -1811,7 +1811,7 @@ char *XmxModalPromptForString (Widget parent, XtAppContext app,
|
||||
yes = XmStringCreateLtoR (yesstr, XmSTRING_DEFAULT_CHARSET);
|
||||
no = XmStringCreateLtoR (nostr, XmSTRING_DEFAULT_CHARSET);
|
||||
title = XmStringCreateLtoR ("Prompt", XmSTRING_DEFAULT_CHARSET);
|
||||
|
||||
|
||||
XmxSetArg (XmNdialogTitle, (XtArgVal)title);
|
||||
XmxSetArg (XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL);
|
||||
XmxSetArg (XmNselectionLabelString, (XtArgVal)question);
|
||||
@ -1819,11 +1819,11 @@ char *XmxModalPromptForString (Widget parent, XtAppContext app,
|
||||
XmxSetArg (XmNcancelLabelString, (XtArgVal)no);
|
||||
dialog = XmCreatePromptDialog (parent, "question_dialog", Xmx_wargs, Xmx_n);
|
||||
Xmx_n = 0;
|
||||
|
||||
|
||||
XtUnmanageChild (XmSelectionBoxGetChild (dialog, XmDIALOG_HELP_BUTTON));
|
||||
XtAddCallback (dialog, XmNokCallback,
|
||||
XtAddCallback (dialog, XmNokCallback,
|
||||
(XtCallbackProc)_XmxPromptForStringResponse, &answer);
|
||||
XtAddCallback (dialog, XmNcancelCallback,
|
||||
XtAddCallback (dialog, XmNcancelCallback,
|
||||
(XtCallbackProc)_XmxPromptForStringCancel, &answer);
|
||||
|
||||
XtManageChild (dialog);
|
||||
@ -1860,38 +1860,38 @@ char *XmxModalPromptForString (Widget parent, XtAppContext app,
|
||||
|
||||
static char *_passwd = NULL;
|
||||
|
||||
static void _XmxPromptForPasswordResponse (Widget w, char **answer,
|
||||
static void _XmxPromptForPasswordResponse (Widget w, char **answer,
|
||||
XmSelectionBoxCallbackStruct *cbs)
|
||||
{
|
||||
if (!XmStringGetLtoR (cbs->value, XmSTRING_DEFAULT_CHARSET, answer))
|
||||
*answer = XMX_NO_ANSWER;
|
||||
}
|
||||
|
||||
static void _XmxPromptForPasswordCancel (Widget w, char **answer,
|
||||
static void _XmxPromptForPasswordCancel (Widget w, char **answer,
|
||||
XmSelectionBoxCallbackStruct *cbs)
|
||||
{
|
||||
*answer = XMX_NO_ANSWER;
|
||||
}
|
||||
|
||||
static void _XmxPromptForPasswordVerify (Widget text_w, XtPointer unused,
|
||||
static void _XmxPromptForPasswordVerify (Widget text_w, XtPointer unused,
|
||||
XmTextVerifyCallbackStruct *cbs)
|
||||
{
|
||||
char *new;
|
||||
int len;
|
||||
|
||||
if (cbs->reason != XmCR_MODIFYING_TEXT_VALUE)
|
||||
|
||||
if (cbs->reason != XmCR_MODIFYING_TEXT_VALUE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (cbs->text->ptr == NULL)
|
||||
if (cbs->text->ptr == NULL)
|
||||
{ /* backspace */
|
||||
cbs->doit = True;
|
||||
if (_passwd && *_passwd)
|
||||
{
|
||||
int start;
|
||||
char *tptr;
|
||||
|
||||
|
||||
len = strlen(_passwd);
|
||||
/* Find the start of the delete */
|
||||
if (cbs->startPos < len)
|
||||
@ -1915,7 +1915,7 @@ static void _XmxPromptForPasswordVerify (Widget text_w, XtPointer unused,
|
||||
strcat(_passwd, tptr);
|
||||
}
|
||||
}
|
||||
else if (cbs->text->length >= 1)
|
||||
else if (cbs->text->length >= 1)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1962,7 +1962,7 @@ static void _XmxPromptForPasswordVerify (Widget text_w, XtPointer unused,
|
||||
}
|
||||
}
|
||||
|
||||
char *XmxModalPromptForPassword (Widget parent, XtAppContext app,
|
||||
char *XmxModalPromptForPassword (Widget parent, XtAppContext app,
|
||||
char *questionstr, char *yesstr, char *nostr)
|
||||
{
|
||||
Widget dialog;
|
||||
@ -1977,7 +1977,7 @@ char *XmxModalPromptForPassword (Widget parent, XtAppContext app,
|
||||
yes = XmStringCreateLtoR (yesstr, XmSTRING_DEFAULT_CHARSET);
|
||||
no = XmStringCreateLtoR (nostr, XmSTRING_DEFAULT_CHARSET);
|
||||
title = XmStringCreateLtoR ("Prompt", XmSTRING_DEFAULT_CHARSET);
|
||||
|
||||
|
||||
XmxSetArg (XmNdialogTitle, (XtArgVal)title);
|
||||
XmxSetArg (XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL);
|
||||
XmxSetArg (XmNselectionLabelString, (XtArgVal)question);
|
||||
@ -1985,14 +1985,14 @@ char *XmxModalPromptForPassword (Widget parent, XtAppContext app,
|
||||
XmxSetArg (XmNcancelLabelString, (XtArgVal)no);
|
||||
dialog = XmCreatePromptDialog (parent, "question_dialog", Xmx_wargs, Xmx_n);
|
||||
Xmx_n = 0;
|
||||
|
||||
|
||||
XtUnmanageChild (XmSelectionBoxGetChild (dialog, XmDIALOG_HELP_BUTTON));
|
||||
XtAddCallback
|
||||
(XmSelectionBoxGetChild (dialog, XmDIALOG_TEXT),
|
||||
XmNmodifyVerifyCallback, (XtCallbackProc)_XmxPromptForPasswordVerify, 0);
|
||||
XtAddCallback (dialog, XmNokCallback,
|
||||
XtAddCallback (dialog, XmNokCallback,
|
||||
(XtCallbackProc)_XmxPromptForPasswordResponse, &answer);
|
||||
XtAddCallback (dialog, XmNcancelCallback,
|
||||
XtAddCallback (dialog, XmNcancelCallback,
|
||||
(XtCallbackProc)_XmxPromptForPasswordCancel, &answer);
|
||||
|
||||
XtManageChild (dialog);
|
||||
|
36
libXmx/Xmx.h
36
libXmx/Xmx.h
@ -248,14 +248,14 @@ extern Widget XmxMakeRadioBox (Widget);
|
||||
extern Widget XmxMakeOptionBox (Widget);
|
||||
extern Widget XmxMakeToggleButton (Widget, String, XtCallbackProc, int);
|
||||
extern void XmxSetToggleButton (Widget button, int set_state);
|
||||
extern Widget XmxMakeScale (Widget, XtCallbackProc, int, String,
|
||||
extern Widget XmxMakeScale (Widget, XtCallbackProc, int, String,
|
||||
int, int, int, int);
|
||||
extern void XmxAdjustScale (Widget, int);
|
||||
extern Widget XmxMakeFrame (Widget, int);
|
||||
extern Widget XmxMakeForm (Widget);
|
||||
extern void XmxSetPositions (Widget, int, int, int, int);
|
||||
extern void XmxSetOffsets (Widget, int, int, int, int);
|
||||
extern void XmxSetConstraints (Widget, int, int, int, int, Widget, Widget,
|
||||
extern void XmxSetConstraints (Widget, int, int, int, int, Widget, Widget,
|
||||
Widget, Widget);
|
||||
extern Widget XmxMakeVerticalRowColumn (Widget);
|
||||
extern Widget XmxMakeHorizontalRowColumn (Widget);
|
||||
@ -272,13 +272,13 @@ extern Widget XmxMakeNamedLabel (Widget, String, String);
|
||||
extern Widget XmxMakeBlankLabel (Widget);
|
||||
extern Widget XmxMakeErrorDialog (Widget, String, String);
|
||||
extern Widget XmxMakeInfoDialog (Widget, String, String);
|
||||
extern Widget XmxMakeQuestionDialog (Widget, String, String, XtCallbackProc,
|
||||
extern Widget XmxMakeQuestionDialog (Widget, String, String, XtCallbackProc,
|
||||
int, int);
|
||||
extern XmString XmxMakeXmstrFromFile (String);
|
||||
extern XmString XmxMakeXmstrFromString (String);
|
||||
extern Widget XmxMakeBboardDialog (Widget, String);
|
||||
extern Widget XmxMakeFormDialog (Widget, String);
|
||||
extern Widget XmxMakeFileSBDialog (Widget, String, String, XtCallbackProc,
|
||||
extern Widget XmxMakeFileSBDialog (Widget, String, String, XtCallbackProc,
|
||||
int);
|
||||
extern Widget XmxMakeHelpDialog (Widget, XmString, String);
|
||||
extern Widget XmxMakeHelpTextDialog (Widget, String, String, Widget *);
|
||||
@ -298,7 +298,7 @@ extern void XmxAddCallbackToText (Widget, XtCallbackProc, int);
|
||||
#if 0
|
||||
|
||||
#ifdef __sgi
|
||||
extern Widget XmxMakeDrawingVolume
|
||||
extern Widget XmxMakeDrawingVolume
|
||||
(Widget, int, int, GLXconfig *, XtCallbackProc, XtCallbackProc,
|
||||
XtCallbackProc);
|
||||
extern void XmxInstallColormaps (Widget, Widget);
|
||||
@ -307,7 +307,7 @@ extern void XmxWinset (Widget);
|
||||
#endif
|
||||
|
||||
#ifdef _IBMR2
|
||||
extern Widget XmxMakeDrawingVolume
|
||||
extern Widget XmxMakeDrawingVolume
|
||||
(Widget, int, int, XtCallbackProc, XtCallbackProc,
|
||||
XtCallbackProc);
|
||||
extern void XmxInstallColormaps (Widget, Widget);
|
||||
@ -316,22 +316,22 @@ extern void XmxWinset (Widget);
|
||||
|
||||
#endif /* if 0 */
|
||||
|
||||
extern void XmxApplyBitmapToLabelWidget (Widget, String, unsigned int,
|
||||
extern void XmxApplyBitmapToLabelWidget (Widget, String, unsigned int,
|
||||
unsigned int);
|
||||
extern Pixmap XmxCreatePixmapFromBitmap (Widget, String, unsigned int,
|
||||
unsigned int);
|
||||
extern void XmxApplyPixmapToLabelWidget (Widget, Pixmap);
|
||||
|
||||
extern Widget XmxMakeFormAndOneButton (Widget, XtCallbackProc, String, int);
|
||||
extern Widget XmxMakeFormAndTwoButtons (Widget, XtCallbackProc, String,
|
||||
extern Widget XmxMakeFormAndTwoButtons (Widget, XtCallbackProc, String,
|
||||
String, int, int);
|
||||
extern Widget XmxMakeFormAndTwoButtonsSqueezed (Widget, XtCallbackProc, String,
|
||||
extern Widget XmxMakeFormAndTwoButtonsSqueezed (Widget, XtCallbackProc, String,
|
||||
String, int, int);
|
||||
extern Widget XmxMakeFormAndThreeButtons (Widget, XtCallbackProc, String,
|
||||
extern Widget XmxMakeFormAndThreeButtons (Widget, XtCallbackProc, String,
|
||||
String, String, int, int, int);
|
||||
extern Widget XmxMakeFormAndThreeButtonsSqueezed (Widget, XtCallbackProc, String,
|
||||
extern Widget XmxMakeFormAndThreeButtonsSqueezed (Widget, XtCallbackProc, String,
|
||||
String, String, int, int, int);
|
||||
extern Widget XmxMakeFormAndFourButtons (Widget, XtCallbackProc, String,
|
||||
extern Widget XmxMakeFormAndFourButtons (Widget, XtCallbackProc, String,
|
||||
String, String, String, int, int, int, int);
|
||||
extern Widget XmxMakeFormAndFiveButtons (Widget, XtCallbackProc, String,
|
||||
String, String, String, String,
|
||||
@ -340,11 +340,11 @@ extern Widget XmxMakeFormAndFiveButtons (Widget, XtCallbackProc, String,
|
||||
extern int XmxModalYesOrNo (Widget parent, XtAppContext app,
|
||||
char *questionstr, char *yesstr,
|
||||
char *nostr);
|
||||
extern char *XmxModalPromptForString (Widget parent, XtAppContext app,
|
||||
char *questionstr, char *yesstr,
|
||||
extern char *XmxModalPromptForString (Widget parent, XtAppContext app,
|
||||
char *questionstr, char *yesstr,
|
||||
char *nostr);
|
||||
extern char *XmxModalPromptForPassword (Widget parent, XtAppContext app,
|
||||
char *questionstr, char *yesstr,
|
||||
extern char *XmxModalPromptForPassword (Widget parent, XtAppContext app,
|
||||
char *questionstr, char *yesstr,
|
||||
char *nostr);
|
||||
|
||||
/* Xmx2.c */
|
||||
@ -355,9 +355,9 @@ extern void XmxRSetOptionMenuHistory (XmxMenuRecord *, int);
|
||||
extern void XmxRSetValues (XmxMenuRecord *, int);
|
||||
extern Widget XmxRGetWidget (XmxMenuRecord *, int);
|
||||
|
||||
extern XmxMenuRecord *XmxRMakeOptionMenu (Widget, String, XtCallbackProc,
|
||||
extern XmxMenuRecord *XmxRMakeOptionMenu (Widget, String, XtCallbackProc,
|
||||
XmxOptionMenuStruct *);
|
||||
extern XmxMenuRecord *XmxRMakeToggleMenu (Widget, int, XtCallbackProc,
|
||||
extern XmxMenuRecord *XmxRMakeToggleMenu (Widget, int, XtCallbackProc,
|
||||
XmxToggleMenuStruct *);
|
||||
extern XmxMenuRecord *XmxRMakeMenubar (Widget, XmxMenubarStruct *);
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
||||
/* ----------------------- _XmxMenuAddEntryToRecord ----------------------- */
|
||||
|
||||
/* Create a new MenuEntry and add it to the head of a MenuRecord list. */
|
||||
private void
|
||||
private void
|
||||
_XmxMenuAddEntryToRecord (XmxMenuRecord *rec, Widget w, int token)
|
||||
{
|
||||
XmxMenuEntry *_ent;
|
||||
@ -138,7 +138,7 @@ XmxRSetSensitive (XmxMenuRecord *rec, int token, int state)
|
||||
/* XtSetSensitive propagates down Widget hierarchy. */
|
||||
if (_entry)
|
||||
XtSetSensitive (_entry->w, (state == XmxSensitive) ? True : False);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -153,9 +153,9 @@ XmxRSetToggleState (XmxMenuRecord *rec, int token, int state)
|
||||
assert (state == XmxSet || state == XmxUnset);
|
||||
_entry = _XmxMenuGetEntryFromRecord (rec, XmxExtractToken (token));
|
||||
if (_entry)
|
||||
XmToggleButtonGadgetSetState
|
||||
XmToggleButtonGadgetSetState
|
||||
(_entry->w, (state == XmxSet) ? True : False, False);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -344,8 +344,8 @@ XmxRMakeToggleMenu (Widget parent, int behavior, XtCallbackProc cb,
|
||||
|
||||
/* Possible deficiency: will not be able to grey out a submenu
|
||||
(cascade button). */
|
||||
private void
|
||||
_XmxRCreateMenubar (Widget menu, XmxMenubarStruct *menulist,
|
||||
private void
|
||||
_XmxRCreateMenubar (Widget menu, XmxMenubarStruct *menulist,
|
||||
XmxMenuRecord *rec)
|
||||
{
|
||||
int _i;
|
||||
@ -396,16 +396,16 @@ _XmxRCreateMenubar (Widget menu, XmxMenubarStruct *menulist,
|
||||
|
||||
XtAddCallback
|
||||
(_buttons[_i - _separators], XmNvalueChangedCallback,
|
||||
menulist[_i].func,
|
||||
menulist[_i].func,
|
||||
(XtPointer)_XmxMakeClientData (menulist[_i].data));
|
||||
|
||||
/* Add thie button to the menu record. */
|
||||
_XmxMenuAddEntryToRecord
|
||||
_XmxMenuAddEntryToRecord
|
||||
(rec, _buttons[_i - _separators], menulist[_i].data);
|
||||
}
|
||||
else /* regular button */
|
||||
{
|
||||
XmString xmstr =
|
||||
XmString xmstr =
|
||||
XmStringCreateLtoR
|
||||
(menulist[_i].namestr, XmSTRING_DEFAULT_CHARSET);
|
||||
XmxSetArg (XmNlabelString, (XtArgVal)xmstr);
|
||||
@ -413,13 +413,13 @@ _XmxRCreateMenubar (Widget menu, XmxMenubarStruct *menulist,
|
||||
("pushbutton", xmPushButtonGadgetClass,
|
||||
menu, Xmx_wargs, Xmx_n);
|
||||
XmStringFree (xmstr);
|
||||
XtAddCallback
|
||||
XtAddCallback
|
||||
(_buttons[_i - _separators], XmNactivateCallback,
|
||||
menulist[_i].func,
|
||||
menulist[_i].func,
|
||||
(XtPointer)_XmxMakeClientData (menulist[_i].data));
|
||||
|
||||
/* Add thie button to the menu record. */
|
||||
_XmxMenuAddEntryToRecord
|
||||
_XmxMenuAddEntryToRecord
|
||||
(rec, _buttons[_i - _separators], menulist[_i].data);
|
||||
}
|
||||
}
|
||||
|
@ -49,23 +49,23 @@ dtm_ ::
|
||||
@echo Either set up the ARCH environment or specify a machine type
|
||||
@echo " ex: make sun"
|
||||
|
||||
solaris :
|
||||
solaris :
|
||||
make internal "CC=$(CC)" "CFLAGS = -DSUN -DSOLARIS" \
|
||||
"OBJECTS = $(OBJ) convert.o mdd.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = /bin/true libdtm.a"
|
||||
|
||||
solarisx86 :
|
||||
solarisx86 :
|
||||
make internal "CC=$(CC)" "CFLAGS = -DSUN -DSOLARIS" \
|
||||
"OBJECTS = $(OBJ) convert.o mdd.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = /bin/true libdtm.a"
|
||||
|
||||
alpha :
|
||||
alpha :
|
||||
make internal "CFLAGS = -DOSF1 -target $(TARGET_ARCH:-%=%)" \
|
||||
"OBJECTS = $(OBJ) convert.o mdd.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = ranlib libdtm.a"
|
||||
"RANLIB_CMD = ranlib libdtm.a"
|
||||
|
||||
linux :
|
||||
make internal "CFLAGS = -DLINUX" \
|
||||
@ -74,7 +74,7 @@ linux :
|
||||
"RANLIB_CMD = ranlib libdtm.a"
|
||||
|
||||
sun4 : sun
|
||||
sun :
|
||||
sun :
|
||||
make internal "CFLAGS = -DSUN -target $(TARGET_ARCH:-%=%)" \
|
||||
"OBJECTS = $(OBJ) convert.o mdd.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
@ -84,7 +84,7 @@ sun :
|
||||
"OBJECTS = $(OBJ_SPEC) convert$(ARCH).o mdd$(ARCH).o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = ranlib libdtm$(ARCH).a"
|
||||
next :
|
||||
next :
|
||||
make internal "CFLAGS = -DNEXT " \
|
||||
"OBJECTS = $(OBJ) convert.o mdd.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
@ -105,19 +105,19 @@ indy: $(OBJ) convert.o
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = "
|
||||
|
||||
cray :
|
||||
cray :
|
||||
make internal "CFLAGS = -DCRAY" "CFT = cft77" \
|
||||
"OBJECTS = $(OBJ) craycvt.o crayrtns.o" \
|
||||
"ARCHIVE = bld q" \
|
||||
"RANLIB_CMD = "
|
||||
make libdtmf77.a "CFLAGS = -DCRAY" "CFT = cft77" \
|
||||
"OBJECTS = $(OBJ) craycvt.o crayrtns.o sdsF.o" \
|
||||
"ARCHIVE = bld q"
|
||||
convex :
|
||||
"ARCHIVE = bld q"
|
||||
convex :
|
||||
make internal "CFLAGS = -DCONVEX -fi" \
|
||||
"OBJECTS = $(OBJ) mdd.o convert.o" "ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = ranlib libdtm.a"
|
||||
ibm :
|
||||
ibm :
|
||||
make internal "CFLAGS = -DRS6000" "OBJECTS = $(OBJ) mdd.o convert.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = ranlib libdtm.a"
|
||||
@ -125,11 +125,11 @@ hp :
|
||||
make internal "CFLAGS = -Aa -D_HPUX_SOURCE" "OBJECTS = $(OBJ) mdd.o convert.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = "
|
||||
dec :
|
||||
dec :
|
||||
make internal "CFLAGS = -DDEC" "OBJECTS = $(OBJ) mdd.o deccvt.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = ar ts libdtm.a"
|
||||
vax :
|
||||
vax :
|
||||
make internal "CFLAGS = -DVAX" "OBJECTS = $(OBJ) mdd.o vaxcvt.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = "
|
||||
@ -160,12 +160,12 @@ clean::
|
||||
|
||||
install::
|
||||
-mv $(DIR)/lib/libdtm.a $(DIR)/lib/libdtm.bak
|
||||
cp *.a $(DIR)/lib
|
||||
cp *.a $(DIR)/lib
|
||||
-ranlib $(DIR)/lib/libdtm.a
|
||||
-rm -f $(DIR)/include/dtm.h $(DIR)/include/sds.h
|
||||
-rm -f $(DIR)/include/ris.h $(DIR)/include/db.h
|
||||
-rm -f $(DIR)/include/mdd.h $(DIR)/include/sdl.h
|
||||
-rm -f $(DIR)/include/debug.h $(DIR)/include/arch.h
|
||||
cp dtm.h debug.h sds.h ris.h db.h mdd.h sdl.h arch.h $(DIR)/include
|
||||
cp dtm.h debug.h sds.h ris.h db.h mdd.h sdl.h arch.h $(DIR)/include
|
||||
|
||||
include $(DEPENDS)
|
||||
include $(DEPENDS)
|
||||
|
@ -49,23 +49,23 @@ dtm_ ::
|
||||
@echo Either set up the ARCH environment or specify a machine type
|
||||
@echo " ex: make sun"
|
||||
|
||||
solaris :
|
||||
solaris :
|
||||
make internal "CC=$(CC)" "CFLAGS = -DSUN -DSOLARIS" \
|
||||
"OBJECTS = $(OBJ) convert.o mdd.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = /bin/true libdtm.a"
|
||||
|
||||
solarisx86 :
|
||||
solarisx86 :
|
||||
make internal "CC=$(CC)" "CFLAGS = -DSUN -DSOLARIS" \
|
||||
"OBJECTS = $(OBJ) convert.o mdd.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = /bin/true libdtm.a"
|
||||
|
||||
alpha :
|
||||
alpha :
|
||||
make internal "CFLAGS = -DOSF1 -target $(TARGET_ARCH:-%=%)" \
|
||||
"OBJECTS = $(OBJ) convert.o mdd.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = ranlib libdtm.a"
|
||||
"RANLIB_CMD = ranlib libdtm.a"
|
||||
|
||||
linux :
|
||||
make internal "CFLAGS = -DLINUX" \
|
||||
@ -74,7 +74,7 @@ linux :
|
||||
"RANLIB_CMD = ranlib libdtm.a"
|
||||
|
||||
sun4 : sun
|
||||
sun :
|
||||
sun :
|
||||
make internal "CFLAGS = -DSUN -target $(TARGET_ARCH:-%=%)" \
|
||||
"OBJECTS = $(OBJ) convert.o mdd.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
@ -84,7 +84,7 @@ sun :
|
||||
"OBJECTS = $(OBJ_SPEC) convert$(ARCH).o mdd$(ARCH).o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = ranlib libdtm$(ARCH).a"
|
||||
next :
|
||||
next :
|
||||
make internal "CFLAGS = -DNEXT " \
|
||||
"OBJECTS = $(OBJ) convert.o mdd.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
@ -105,19 +105,19 @@ indy: $(OBJ) convert.o
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = "
|
||||
|
||||
cray :
|
||||
cray :
|
||||
make internal "CFLAGS = -DCRAY" "CFT = cft77" \
|
||||
"OBJECTS = $(OBJ) craycvt.o crayrtns.o" \
|
||||
"ARCHIVE = bld q" \
|
||||
"RANLIB_CMD = "
|
||||
make libdtmf77.a "CFLAGS = -DCRAY" "CFT = cft77" \
|
||||
"OBJECTS = $(OBJ) craycvt.o crayrtns.o sdsF.o" \
|
||||
"ARCHIVE = bld q"
|
||||
convex :
|
||||
"ARCHIVE = bld q"
|
||||
convex :
|
||||
make internal "CFLAGS = -DCONVEX -fi" \
|
||||
"OBJECTS = $(OBJ) mdd.o convert.o" "ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = ranlib libdtm.a"
|
||||
ibm :
|
||||
ibm :
|
||||
make internal "CFLAGS = -DRS6000" "OBJECTS = $(OBJ) mdd.o convert.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = ranlib libdtm.a"
|
||||
@ -125,11 +125,11 @@ hp :
|
||||
make internal "CFLAGS = -Aa -D_HPUX_SOURCE" "OBJECTS = $(OBJ) mdd.o convert.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = "
|
||||
dec :
|
||||
dec :
|
||||
make internal "CFLAGS = -DDEC" "OBJECTS = $(OBJ) mdd.o deccvt.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = ar ts libdtm.a"
|
||||
vax :
|
||||
vax :
|
||||
make internal "CFLAGS = -DVAX" "OBJECTS = $(OBJ) mdd.o vaxcvt.o" \
|
||||
"ARCHIVE = ar rv" \
|
||||
"RANLIB_CMD = "
|
||||
@ -160,12 +160,12 @@ clean::
|
||||
|
||||
install::
|
||||
-mv $(DIR)/lib/libdtm.a $(DIR)/lib/libdtm.bak
|
||||
cp *.a $(DIR)/lib
|
||||
cp *.a $(DIR)/lib
|
||||
-ranlib $(DIR)/lib/libdtm.a
|
||||
-rm -f $(DIR)/include/dtm.h $(DIR)/include/sds.h
|
||||
-rm -f $(DIR)/include/ris.h $(DIR)/include/db.h
|
||||
-rm -f $(DIR)/include/mdd.h $(DIR)/include/sdl.h
|
||||
-rm -f $(DIR)/include/debug.h $(DIR)/include/arch.h
|
||||
cp dtm.h debug.h sds.h ris.h db.h mdd.h sdl.h arch.h $(DIR)/include
|
||||
cp dtm.h debug.h sds.h ris.h db.h mdd.h sdl.h arch.h $(DIR)/include
|
||||
|
||||
include $(DEPENDS)
|
||||
include $(DEPENDS)
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
/*********************************************************************
|
||||
**
|
||||
** $Header: /X11/mosaic/cvsroot/xmosaic3/libdtm/arch.h,v 1.5 1996/06/06 19:47:12 spowers Exp $
|
||||
** $Header: /X11/mosaic/cvsroot/xmosaic3/libdtm/arch.h,v 1.5 1996/06/06 19:47:12 spowers Exp $
|
||||
**
|
||||
**********************************************************************/
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
*
|
||||
* Revision 1.7 92/04/30 20:27:05 jplevyak
|
||||
* Changed Version to 2.3
|
||||
*
|
||||
*
|
||||
* Revision 1.6 1992/04/14 22:59:57 jefft
|
||||
* included sys/limits.h instead of sys/limit.h
|
||||
*
|
||||
@ -56,7 +56,7 @@
|
||||
* Revision 1.4 92/03/10 22:07:10 jplevyak
|
||||
* Added changed for PC/MAC from Quincey Koziol (koziol@ncsa.uiuc.edu)
|
||||
* with modification.
|
||||
*
|
||||
*
|
||||
* Revision 1.3 1992/03/10 16:52:43 jefft
|
||||
* modified convex define to __convex__
|
||||
*
|
||||
@ -70,8 +70,8 @@
|
||||
|
||||
/*
|
||||
The intent of this file is to provide a standard set of
|
||||
architecturally descriptive preprocessor definitions by
|
||||
examining the preprocessor identifiers that are defined
|
||||
architecturally descriptive preprocessor definitions by
|
||||
examining the preprocessor identifiers that are defined
|
||||
in the native compiler running in the default mode.
|
||||
|
||||
Please feel free to add to or correct this file.
|
||||
@ -87,21 +87,21 @@
|
||||
SUN - generally any machine by Sun Microsystems
|
||||
SGI - Silicon Graphics
|
||||
CRAY - Cray Research
|
||||
CONVEX - Convex
|
||||
CONVEX - Convex
|
||||
CM - Connection Machine
|
||||
IBM
|
||||
APPLE
|
||||
HP
|
||||
IBM
|
||||
APPLE
|
||||
HP
|
||||
DEC
|
||||
COMMODORE
|
||||
General OS
|
||||
DOS
|
||||
General OS
|
||||
DOS
|
||||
UNIX
|
||||
MACOS
|
||||
AMIGA
|
||||
VMS
|
||||
AMIGA
|
||||
VMS
|
||||
OS2
|
||||
General Processor
|
||||
General Processor
|
||||
SPARC
|
||||
MIPS
|
||||
68000
|
||||
@ -110,8 +110,8 @@
|
||||
80386
|
||||
VAX
|
||||
PA - HP Percision Architecture
|
||||
RS6000
|
||||
Specific Interesting Qualities
|
||||
RS6000
|
||||
Specific Interesting Qualities
|
||||
BIG_ENDIAN
|
||||
LITTLE_ENDIAN
|
||||
WORD_SIZE - values include 16, 32, 64 (bits)
|
||||
@ -121,12 +121,12 @@
|
||||
|
||||
( possible interesting definitions )
|
||||
mc68k unix unixpc (hp 68k ?)
|
||||
mc68000
|
||||
mc68000
|
||||
_I386 i386 AIX _AIX (PS2 running AIX)
|
||||
alliant (68000 unix)
|
||||
vax mc68k32 PORTAR (altos? 30068)
|
||||
vax mc68k32 PORTAR (altos? 30068)
|
||||
apollo aegis unix (??) (apollo)
|
||||
i80386 (compac?) BSD
|
||||
i80386 (compac?) BSD
|
||||
convex unix (32 bit)
|
||||
__convex_c1__
|
||||
__convex_c2__
|
||||
@ -196,7 +196,7 @@
|
||||
# else
|
||||
/* assume */
|
||||
# define _ARCH_BIG_ENDIAN
|
||||
# define _ARCH_68000
|
||||
# define _ARCH_68000
|
||||
# endif
|
||||
#elif defined( NEXT )
|
||||
# define _ARCH_NEXT
|
||||
@ -209,7 +209,7 @@
|
||||
# define _ARCH_CRAY
|
||||
# define _ARCH_UNIX
|
||||
# define _ARCH_SYSV /* A rough approximation */
|
||||
# define _ARCH_BIG_ENDIAN /* ?? */
|
||||
# define _ARCH_BIG_ENDIAN /* ?? */
|
||||
# define _ARCH_WORD_SIZE 64
|
||||
#elif defined(vax)
|
||||
# define _ARCH_DEC
|
||||
@ -230,7 +230,7 @@
|
||||
#define _ARCH_WORD_SIZE 32
|
||||
#define _ARCH_LITTLE_ENDIAN
|
||||
#define _ARCH_PROTO
|
||||
#elif defined( _IBMR2 )
|
||||
#elif defined( _IBMR2 )
|
||||
#define _ARCH_IBM
|
||||
#define _ARCH_RS6000
|
||||
#elif defined( AMIGA )
|
||||
@ -238,7 +238,7 @@
|
||||
# define _ARCH_COMMODORE
|
||||
# define _ARCH_AMIGA
|
||||
# define _ARCH_BIG_ENDIAN
|
||||
# define _ARCH_68000
|
||||
# define _ARCH_68000
|
||||
# define _ARCH_WORD_SIZE 32
|
||||
#elif defined ( MS_DOS ) || defined(__TURBOC__)
|
||||
# define _ARCH_MSDOS
|
||||
@ -256,14 +256,14 @@
|
||||
#elif defined ( THINK_C ) || defined( applec )
|
||||
# define _ARCH_APPLE
|
||||
# define _ARCH_MACOS
|
||||
# define _ARCH_68000
|
||||
# define _ARCH_68000
|
||||
# define _ARCH_BIG_ENDIAN
|
||||
# define _ARCH_WORD_SIZE 32
|
||||
# define _ARCH_PROTO
|
||||
#elif defined( alliant )
|
||||
/* ?? */
|
||||
# define _ARCH_UNIX
|
||||
# define _ARCH_68000
|
||||
# define _ARCH_68000
|
||||
# define _ARCH_BIG_ENDIAN
|
||||
# define _ARCH_WORD_SIZE 32
|
||||
#elif defined( __convex__ ) || defined( __convex_c1__ ) || defined( __convex_c2__ )
|
||||
@ -278,13 +278,13 @@
|
||||
*/
|
||||
#if !defined( _ARCH_UNIX ) && !defined( _ARCH_MSDOS ) && !defined( _ARCH_VMS ) \
|
||||
&& !defined( _ARCH_MACOS ) && !defined( _ARCH_AMIGA ) && !defined( _ARCH_OS2)
|
||||
# if defined( unix )
|
||||
# if defined( unix )
|
||||
# define _ARCH_UNIX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( _ARCH_BSD ) && !defined( _ARCH_SYSV ) && defined( _ARCH_UNIX )
|
||||
# if defined( USG )
|
||||
# if defined( USG )
|
||||
# define _ARCH_SYSV
|
||||
# endif
|
||||
#endif
|
||||
@ -294,7 +294,7 @@
|
||||
|| defined( mc68020 ) || defined( mc68010 )
|
||||
# define _ARCH_68000
|
||||
# if !defined( _ARCH_BIG_ENDIAN )
|
||||
# define _ARCH_BIG_ENDIAN
|
||||
# define _ARCH_BIG_ENDIAN
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
@ -51,7 +51,7 @@ static void DTMsigioHandler( sig, code, scp, addr )
|
||||
char *addr;
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
/*
|
||||
Unfortunately, not one of the parameters listed above
|
||||
provides even the slightest help in determinine WHICH
|
||||
port is now ready for input, and any system calls
|
||||
@ -68,7 +68,7 @@ static void DTMsigioHandler( sig, code, scp, addr )
|
||||
if ( !DTMpt[i]->callback ) continue;
|
||||
port = i;
|
||||
dtm_map_port_external(&port);
|
||||
#if 0
|
||||
#if 0
|
||||
if ((ready = DTMavailRead( port ))== DTMERROR) continue;
|
||||
if ( ready == DTM_PORT_READY ) {
|
||||
DBGMSG( "DTMsigioHandler calling user routine\n" );
|
||||
@ -99,7 +99,7 @@ int dtm_sigio( fd )
|
||||
#endif
|
||||
DTMerrno = DTMSOCK;
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
#ifdef __hpux
|
||||
if (flags = ioctl( fd, FIOSSAIOSTAT, &sigio_on ) == -1 ) {
|
||||
#else
|
||||
@ -107,7 +107,7 @@ int dtm_sigio( fd )
|
||||
#endif
|
||||
DTMerrno = DTMSOCK;
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
return DTM_OK;
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ int DTMreadReady( int port, void (*pfn)() )
|
||||
int DTMreadReady( port, pfn )
|
||||
int32 port;
|
||||
void (*pfn)();
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
DTMPORT * pp;
|
||||
|
||||
@ -136,14 +136,14 @@ int DTMreadReady( port, pfn )
|
||||
if ( pp->porttype != INPORTTYPE ) {
|
||||
DTMerrno = DTMBADPORT;
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
DBGMSG1( "DTMreadReady port has sockfd %d\n", pp->sockfd );
|
||||
#ifndef _ARCH_MSDOS
|
||||
if ( (int)signal( SIGIO, DTMsigioHandler) == -1 ) {
|
||||
DBGMSG( "DTMreadReady signal failed\n" );
|
||||
DTMerrno = DTMSOCK;
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
pp->callback = pfn;
|
||||
{
|
||||
@ -151,12 +151,12 @@ int DTMreadReady( port, pfn )
|
||||
if( dtm_sigio( pp->sockfd )== DTMERROR) {
|
||||
DTMerrno = DTMSOCK;
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
FOR_EACH_IN_PORT( inp, pp ) {
|
||||
if (dtm_sigio( inp->fd )== DTMERROR) {
|
||||
DTMerrno = DTMSOCK;
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return DTM_OK;
|
||||
|
@ -48,7 +48,7 @@
|
||||
*
|
||||
* Revision 1.3 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.2 1991/06/11 15:21:13 sreedhar
|
||||
* disclaimer added
|
||||
*
|
||||
|
@ -45,7 +45,7 @@
|
||||
*
|
||||
* Revision 1.4 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.3 1991/06/11 15:21:41 sreedhar
|
||||
* disclaimer added
|
||||
*
|
||||
@ -55,7 +55,7 @@
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:29:13 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -38,7 +38,7 @@ c Plugging DTM in...
|
||||
c
|
||||
c Revision 1.3 91/06/13 21:23:57 jefft
|
||||
c added type of function to prevent returning of a float
|
||||
c
|
||||
c
|
||||
c Revision 1.2 1991/06/11 15:21:54 sreedhar
|
||||
c disclaimer added
|
||||
c
|
||||
|
@ -38,7 +38,7 @@ c Plugging DTM in...
|
||||
c
|
||||
c Revision 1.4 91/06/11 15:21:47 sreedhar
|
||||
c disclaimer added
|
||||
c
|
||||
c
|
||||
c Revision 1.3 1991/05/16 04:40:13 jefft
|
||||
c Fixed bugs in TRIPLET conversion
|
||||
c
|
||||
@ -47,7 +47,7 @@ c Fixed bug in Cray floating point conversion routines.
|
||||
c
|
||||
c Revision 1.1 90/11/08 16:30:17 jefft
|
||||
c Initial revision
|
||||
c
|
||||
c
|
||||
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
*
|
||||
* Revision 1.8 92/04/30 20:27:05 jplevyak
|
||||
* Changed Version to 2.3
|
||||
*
|
||||
*
|
||||
* Revision 1.7 1991/11/15 19:42:34 jplevyak
|
||||
* Removed dependancy on dtmint.h
|
||||
*
|
||||
@ -52,10 +52,10 @@
|
||||
*
|
||||
* Revision 1.4 91/09/26 20:13:12 jplevyak
|
||||
* Changed to allow setting of debug flags at run time.
|
||||
*
|
||||
*
|
||||
* Revision 1.3 91/08/15 19:10:25 sreedhar
|
||||
* Changes for logical portname version
|
||||
*
|
||||
*
|
||||
* Revision 1.2 1991/06/11 15:22:30 sreedhar
|
||||
* disclaimer added
|
||||
*
|
||||
@ -65,7 +65,7 @@
|
||||
*/
|
||||
|
||||
#ifndef DEBUG_INC
|
||||
#define DEBUG_INC
|
||||
#define DEBUG_INC
|
||||
|
||||
#define DBGFLOW(s) if (uDTMdbg & DTM_DBG_MSG) fprintf(stderr, s)
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
*
|
||||
* Revision 1.4 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.3 1992/04/03 18:25:50 jplevyak
|
||||
* Fixed indice computation problem.
|
||||
*
|
||||
@ -61,7 +61,7 @@
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:40:06 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
|
||||
#endif
|
||||
|
||||
@ -92,14 +92,14 @@ static int dtm_short(mode, buf, size)
|
||||
{
|
||||
int nShorts, i;
|
||||
DBGFLOW("# dtm_short called.\n");
|
||||
|
||||
|
||||
nShorts = (mode == DTMLOCAL) ? (size / 2) : size;
|
||||
if (buf)
|
||||
for ( i = 0; i < nShorts ; i++ ) {
|
||||
swap(*buf, *(buf+1));
|
||||
buf += 2;
|
||||
buf += 2;
|
||||
}
|
||||
|
||||
|
||||
return ((mode == DTMLOCAL) ? (size / 2) : (size * 2));
|
||||
}
|
||||
|
||||
|
282
libdtm/dtm.c
282
libdtm/dtm.c
@ -64,7 +64,7 @@
|
||||
*
|
||||
* Revision 1.46 92/05/05 22:27:50 jplevyak
|
||||
* Corrected X interface code.
|
||||
*
|
||||
*
|
||||
* Revision 1.45 1992/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
@ -81,7 +81,7 @@
|
||||
*
|
||||
* Revision 1.41 92/03/18 22:25:44 jplevyak
|
||||
* Fix DTMEOF bug with absolute addressed.
|
||||
*
|
||||
*
|
||||
* Revision 1.40 1992/03/16 20:38:36 creiman
|
||||
* Added #include "arch.h"
|
||||
*
|
||||
@ -119,7 +119,7 @@
|
||||
*
|
||||
* Revision 1.29 92/01/25 14:44:04 jplevyak
|
||||
* Fixed minor bug with DTM_ASYNC and another in AvailWrite
|
||||
*
|
||||
*
|
||||
* Revision 1.28 1992/01/14 19:40:09 creiman
|
||||
* #ifndef macintosh for accept_read_connections call to dtm_sigio
|
||||
*
|
||||
@ -170,7 +170,7 @@
|
||||
*
|
||||
* Revision 1.13 91/10/14 16:46:18 jplevyak
|
||||
* Added loop for detecting dropped connections during beginRead.
|
||||
*
|
||||
*
|
||||
* Revision 1.12 1991/10/11 20:21:50 jplevyak
|
||||
* Fixed bug with multiple senders one receiver.
|
||||
* Added function DTMcheckRoute.
|
||||
@ -182,7 +182,7 @@
|
||||
* Revision 1.10 91/09/26 20:22:43 jplevyak
|
||||
* First stage of reorganization. Use external/internal port mapping.
|
||||
* Use repackaged dtm_get_nlist and select_one. Fix bugs with availWrite.
|
||||
*
|
||||
*
|
||||
* Revision 1.9 1991/09/13 17:34:10 sreedhar
|
||||
* changes for DTMSYNC, DTMNOSYNC quality of service
|
||||
*
|
||||
@ -204,7 +204,7 @@
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:12:20 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -216,33 +216,33 @@
|
||||
|
||||
3. Sender awaits "ack from seq start" from the receiver.
|
||||
Receipt of ack by sender guarantees the sender that
|
||||
receiver will definitely accept at least the first user message
|
||||
receiver will definitely accept at least the first user message
|
||||
sent by the sender. Sender can then send as many user messages
|
||||
as it wants to ( they would be accepted by receiver ).
|
||||
|
||||
4. Sender sends the user's header message and user data messages.
|
||||
4. Sender sends the user's header message and user data messages.
|
||||
|
||||
3. Receiver will keep accepting user messages on current
|
||||
3. Receiver will keep accepting user messages on current
|
||||
connection unless a new connection request is received, which
|
||||
would be accepted after bumping the current connection.
|
||||
|
||||
4. Sender would send "Messages over" message after it sends all user
|
||||
messages. Receiver would accept same.
|
||||
|
||||
Graphic picture
|
||||
Graphic picture
|
||||
|
||||
Sender Receiver
|
||||
|
||||
Connect request
|
||||
-------------->
|
||||
Connect request
|
||||
-------------->
|
||||
|
||||
Sequence starts |
|
||||
--------------> |
|
||||
|
|
||||
Ack for seq start |
|
||||
<---------------- |
|
||||
|
|
||||
User header |
|
||||
|
|
||||
User header |
|
||||
--------------> |
|
||||
| --> a sequence of
|
||||
| BEGINWRITE,
|
||||
@ -263,13 +263,13 @@
|
||||
...............
|
||||
|
||||
|
||||
A "sequence starts" message can be sent in availWrite or
|
||||
beginWrite.
|
||||
A "sequence starts" message can be sent in availWrite or
|
||||
beginWrite.
|
||||
|
||||
When no "Ack for header" is received or a write fails.
|
||||
|
||||
Note that the "ack for header", "message over" and "sequence starts"
|
||||
messages are called called "ack" in DTM terminology ( send_ack,
|
||||
messages are called called "ack" in DTM terminology ( send_ack,
|
||||
recv_ack calls used for all these ).
|
||||
*/
|
||||
|
||||
@ -438,12 +438,12 @@ static int make_out_connections( pp )
|
||||
|
||||
FOR_EACH_OUT_PORT( pcur, pp ) {
|
||||
if( pcur->connfd == DTM_NO_CONNECTION) {
|
||||
if( dtm_connect( &pcur->sockaddr, &pcur->connfd )
|
||||
if( dtm_connect( &pcur->sockaddr, &pcur->connfd )
|
||||
== DTMERROR ) {
|
||||
DBGFLOW( "make_out_connections: dtm_connect fails \n" );
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return DTM_OK;
|
||||
}
|
||||
@ -457,7 +457,7 @@ static int clear_write_flags(DTMPORT *pp )
|
||||
#else
|
||||
static int clear_write_flags( pp )
|
||||
DTMPORT *pp;
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
Outport * pcur;
|
||||
|
||||
@ -471,7 +471,7 @@ static int clear_write_flags( pp )
|
||||
/*
|
||||
verify_out_connections()
|
||||
Ensure that their is a connection on each out port.
|
||||
*/
|
||||
*/
|
||||
#ifdef DTM_PROTOTYPES
|
||||
static int verify_out_connections(DTMPORT *pp )
|
||||
#else
|
||||
@ -485,7 +485,7 @@ static int verify_out_connections( pp )
|
||||
if( pcur->connfd == DTM_NO_CONNECTION) {
|
||||
DTMerrno = DTMPORTINIT;
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
return DTM_OK;
|
||||
}
|
||||
@ -510,7 +510,7 @@ static int check_header_write_ack( pp )
|
||||
if ( pcur->connfd == DTM_NO_CONNECTION ) continue;
|
||||
if( !( pcur->availwrite ) ) {
|
||||
int32 tmp;
|
||||
if( (pp->qservice == DTM_SYNC) || ((pp->qservice == DTM_ASYNC) &&
|
||||
if( (pp->qservice == DTM_SYNC) || ((pp->qservice == DTM_ASYNC) &&
|
||||
(dtm_select( pcur->connfd, &tmp, 0 ) == TRUE && tmp >= 4))) {
|
||||
do {
|
||||
int temp;
|
||||
@ -524,7 +524,7 @@ static int check_header_write_ack( pp )
|
||||
*/
|
||||
}
|
||||
} while ( dtm_select( pcur->connfd, &tmp, 0 ) == TRUE &&
|
||||
tmp >= 4);
|
||||
tmp >= 4);
|
||||
pcur->availwrite = TRUE;
|
||||
}
|
||||
}
|
||||
@ -546,7 +546,7 @@ static int check_header_write_ack( pp )
|
||||
static void make_write_iov(IOV_BUF *iov,int fStartSeq,int fEndSeq,char *hdr,
|
||||
int hdrsize,VOIDPTR data,int datasize )
|
||||
#else
|
||||
static void make_write_iov( iov, fStartSeq, fEndSeq, hdr, hdrsize,
|
||||
static void make_write_iov( iov, fStartSeq, fEndSeq, hdr, hdrsize,
|
||||
data, datasize )
|
||||
IOV_BUF *iov;
|
||||
int fStartSeq;
|
||||
@ -567,7 +567,7 @@ static void make_write_iov( iov, fStartSeq, fEndSeq, hdr, hdrsize,
|
||||
|
||||
if ( fStartSeq ) {
|
||||
DBGMSG( "make_write_iov: making start seq\n" );
|
||||
iov->rts_data = DTM_RTS;
|
||||
iov->rts_data = DTM_RTS;
|
||||
STDINT( iov->rts_data );
|
||||
iov->iovec[ i ].iov_base = (char *)&iov->rts_data ;
|
||||
#define SEQ_START_LEN 4
|
||||
@ -581,7 +581,7 @@ static void make_write_iov( iov, fStartSeq, fEndSeq, hdr, hdrsize,
|
||||
if ( hdrsize != 0 ) {
|
||||
DBGMSG( "make_write_iov: making header\n" );
|
||||
iov->hdr_size = hdrsize ;
|
||||
STDINT( iov->hdr_size );
|
||||
STDINT( iov->hdr_size );
|
||||
iov->iovec[ i ].iov_base = (char *)&iov->hdr_size ;
|
||||
iov->iovec[ i ].iov_len = 4 ;
|
||||
i += 1 ;
|
||||
@ -612,8 +612,8 @@ static void make_write_iov( iov, fStartSeq, fEndSeq, hdr, hdrsize,
|
||||
DBGMSG( "make_write_iov: making endseq\n" );
|
||||
iov->end_data = DTM_EOT ;
|
||||
STDINT( iov->end_data );
|
||||
iov->iovec[ i ].iov_base = (char *)&iov->end_data ;
|
||||
iov->iovec[ i ].iov_len = 4 ;
|
||||
iov->iovec[ i ].iov_base = (char *)&iov->end_data ;
|
||||
iov->iovec[ i ].iov_len = 4 ;
|
||||
i += 1 ;
|
||||
iov->iovsize += 4;
|
||||
}
|
||||
@ -646,27 +646,27 @@ static int writev_buffer( pp, iov_buf, fStartSeq )
|
||||
|
||||
if ( fStartSeq ) {
|
||||
if (pcur->availwrite || pcur->seqstart ) {
|
||||
DBGMSG1( "writev: dropping start seq = %x\n",
|
||||
DBGMSG1( "writev: dropping start seq = %x\n",
|
||||
(pcur->availwrite?1:0) | (pcur->seqstart?10:0));
|
||||
/* we have already sent the sequence start, skip it */
|
||||
iov++;
|
||||
iovsize -= SEQ_START_LEN;
|
||||
iovlen -= 1;
|
||||
}
|
||||
pcur->seqstart = TRUE;
|
||||
}
|
||||
pcur->seqstart = TRUE;
|
||||
}
|
||||
DBGMSG1( "writev_buffer: iovlen = %d\n", iovlen );
|
||||
DBGMSG1( "writev_buffer: iovsize = %d\n", iovsize );
|
||||
DBGMSG1( "writev_buffer: ptr iov = %X\n", iov );
|
||||
DBGMSG1( "writev_buffer: first ptr word = %X\n", iov[0].iov_base );
|
||||
DBGMSG1( "writev_buffer: first word = %d\n",
|
||||
DBGMSG1( "writev_buffer: first word = %d\n",
|
||||
*(int *)((iov[0]).iov_base));
|
||||
status = dtm_writev_buffer( pcur->connfd, iov, iovlen, iovsize,
|
||||
NULL, 0);
|
||||
|
||||
DBGINT( "writev_buffer - status = %d\n", status);
|
||||
DBGINT( "writev_buffer - status = %d\n", status);
|
||||
|
||||
if( status < 0 ) {
|
||||
if( status < 0 ) {
|
||||
DBGINT( "dtm_writev_buffer - errno = %d\n", errno );
|
||||
if( DTMerrno == DTMEOF ) {
|
||||
CHECK_ERR( destroy_out_port( pp, &pcur ));
|
||||
@ -702,16 +702,16 @@ static int32 select_one( connfd )
|
||||
FD_SET( connfd, &readmask );
|
||||
|
||||
#ifdef __hpux
|
||||
ret = select( FD_SETSIZE, (int *)&readmask, (int *)0, (int *)0,
|
||||
ret = select( FD_SETSIZE, (int *)&readmask, (int *)0, (int *)0,
|
||||
#else
|
||||
ret = select( FD_SETSIZE, &readmask, (fd_set *)0, (fd_set *)0,
|
||||
ret = select( FD_SETSIZE, &readmask, (fd_set *)0, (fd_set *)0,
|
||||
#endif
|
||||
&timeout );
|
||||
&timeout );
|
||||
if ( ret > 0 ) {
|
||||
int32 count;
|
||||
ioctl( connfd, FIONREAD, &count );
|
||||
DBGMSG1( "select_one: got count = %d\n", count );
|
||||
ret = count;
|
||||
ret = count;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -735,11 +735,11 @@ static int select_one_connection( connfd )
|
||||
FD_SET( connfd, &readmask );
|
||||
|
||||
#ifdef __hpux
|
||||
return select( FD_SETSIZE, (int *)&readmask, (int *)0, (int *)0,
|
||||
return select( FD_SETSIZE, (int *)&readmask, (int *)0, (int *)0,
|
||||
#else
|
||||
return select( FD_SETSIZE, &readmask, (fd_set *)0, (fd_set *)0,
|
||||
return select( FD_SETSIZE, &readmask, (fd_set *)0, (fd_set *)0,
|
||||
#endif
|
||||
&timeout );
|
||||
&timeout );
|
||||
}
|
||||
|
||||
/*
|
||||
@ -749,15 +749,15 @@ static int select_one_connection( connfd )
|
||||
#ifdef DTM_PROTOTYPES
|
||||
static Inport * new_in_port(DTMPORT *pp,int fd )
|
||||
#else
|
||||
static Inport * new_in_port( pp, fd )
|
||||
static Inport * new_in_port( pp, fd )
|
||||
DTMPORT * pp;
|
||||
int fd;
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
Inport * inp;
|
||||
|
||||
if ( (inp = (Inport *) malloc( sizeof(Inport) )) == NULL ) {
|
||||
DTMerrno = DTMMEM;
|
||||
DTMerrno = DTMMEM;
|
||||
return (Inport *) DTMERROR;
|
||||
}
|
||||
memset(inp,0,sizeof(Inport));
|
||||
@ -775,14 +775,14 @@ static Inport * new_in_port( pp, fd )
|
||||
#ifdef PUT_NEW_IN_PORTS_AT_END
|
||||
{
|
||||
Inport * endp;
|
||||
endp = pp->in;
|
||||
if ( endp == NULL )
|
||||
endp = pp->in;
|
||||
if ( endp == NULL )
|
||||
pp->in = inp;
|
||||
else {
|
||||
while ( endp->next != NULL ) endp = endp->next;
|
||||
endp->next = inp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
inp->next = pp->in;
|
||||
pp->in = inp;
|
||||
@ -794,8 +794,8 @@ static Inport * new_in_port( pp, fd )
|
||||
void dtm_handle_in( caddr_t client_data, int * fd, void * id)
|
||||
#else
|
||||
void dtm_handle_in( client_data, fd, id )
|
||||
caddr_t client_data;
|
||||
int * fd;
|
||||
caddr_t client_data;
|
||||
int * fd;
|
||||
void * id;
|
||||
#endif
|
||||
{
|
||||
@ -812,10 +812,10 @@ void dtm_handle_in( client_data, fd, id )
|
||||
dtm_set_Xcallback
|
||||
|
||||
This function may seem a little strange, after all why have a variable
|
||||
(pp->XaddInput) which has only one valid value (XtAddInput).
|
||||
The problem is that we don't want to include the X libraries
|
||||
unless we have to. By using this variable which is only set
|
||||
if the function that will cause this function to get called
|
||||
(pp->XaddInput) which has only one valid value (XtAddInput).
|
||||
The problem is that we don't want to include the X libraries
|
||||
unless we have to. By using this variable which is only set
|
||||
if the function that will cause this function to get called
|
||||
is included... which causes the inclusion of the X libraries, we
|
||||
avoid the undefined external error.
|
||||
*/
|
||||
@ -835,7 +835,7 @@ void dtm_set_Xcallback( pp, inp )
|
||||
/* you didn't see this */
|
||||
int p; for ( p = 0; p < DTMptCount ; p++ ) if ( pp == DTMpt[p] ) break;
|
||||
if ( pp->porttype == INPORTTYPE && pp->XaddInput ) {
|
||||
inp->XinputId = pp->XaddInput( inp->fd, XtInputReadMask,
|
||||
inp->XinputId = pp->XaddInput( inp->fd, XtInputReadMask,
|
||||
dtm_handle_in, (caddr_t) p);
|
||||
}
|
||||
}
|
||||
@ -855,7 +855,7 @@ int dtm_accept_read_connections(DTMPORT *pp,int fWait )
|
||||
#else
|
||||
int dtm_accept_read_connections( pp, fWait )
|
||||
DTMPORT * pp;
|
||||
int fWait;
|
||||
int fWait;
|
||||
#endif
|
||||
{
|
||||
struct timeval timeout ;
|
||||
@ -878,16 +878,16 @@ int dtm_accept_read_connections( pp, fWait )
|
||||
|
||||
/* No connection yet, await one and accept */
|
||||
|
||||
DBGINT( "dtm_accept_read_connection: pp -> sockfd = %d\n",
|
||||
DBGINT( "dtm_accept_read_connection: pp -> sockfd = %d\n",
|
||||
pp -> sockfd );
|
||||
if( (fd = dtm_accept( pp->sockfd, &pp->sockaddr, fWait ? &timeout : 0))
|
||||
if( (fd = dtm_accept( pp->sockfd, &pp->sockaddr, fWait ? &timeout : 0))
|
||||
== DTMERROR ) {
|
||||
if ( !fWait ) return DTM_OK;
|
||||
DTMerrno = DTMTIMEOUT ;
|
||||
return DTMERROR;
|
||||
}
|
||||
DBGINT( "dtm_accept_read_connection: got fd = %d\n", fd );
|
||||
CHECK_ERR( inp = new_in_port( pp, fd ));
|
||||
CHECK_ERR( inp = new_in_port( pp, fd ));
|
||||
#ifndef _ARCH_MACOS
|
||||
if ( pp->callback ) dtm_sigio( fd );
|
||||
if ( pp->Xcallback ) dtm_set_Xcallback( pp, inp );
|
||||
@ -904,13 +904,13 @@ int dtm_accept_read_connections( pp, fWait )
|
||||
|
||||
/*
|
||||
DTMselectRead()
|
||||
Function to test
|
||||
a) for existence of a new connection or a new
|
||||
Function to test
|
||||
a) for existence of a new connection or a new
|
||||
message header to be read on a set of DTM ports OR
|
||||
b) for whether data is available to be read on a
|
||||
b) for whether data is available to be read on a
|
||||
set of sockets.
|
||||
|
||||
Return values :
|
||||
Return values :
|
||||
DTM_PORT_READY if at least a DTM port or
|
||||
socket has something to be
|
||||
read.
|
||||
@ -920,7 +920,7 @@ int dtm_accept_read_connections( pp, fWait )
|
||||
error.
|
||||
|
||||
Each port has status field. Possible values
|
||||
for status field are -
|
||||
for status field are -
|
||||
|
||||
DTM_PORT_READY something available to be read.
|
||||
DTM_PORT_NOT_READY nothing available to be read.
|
||||
@ -963,14 +963,14 @@ int DTMselectRead( dtmset, dtmnum, sockset, socknum, period )
|
||||
/* Set up DTM ports to be selected on */
|
||||
|
||||
for( p1 = dtmset, index = 0 ; index < dtmnum ; index++, p1++ ) {
|
||||
reg DTMPORT *pp ;
|
||||
int port_internal;
|
||||
reg DTMPORT *pp ;
|
||||
int port_internal;
|
||||
reg Inport *inp;
|
||||
|
||||
/* Select status is error if port entry is
|
||||
not initialised.
|
||||
/* Select status is error if port entry is
|
||||
not initialised.
|
||||
*/
|
||||
if( (port_internal = dtm_map_port_internal( p1->port ))
|
||||
if( (port_internal = dtm_map_port_internal( p1->port ))
|
||||
== DTMERROR ) {
|
||||
p1->status = DTMERROR ;
|
||||
continue ;
|
||||
@ -981,11 +981,11 @@ int DTMselectRead( dtmset, dtmnum, sockset, socknum, period )
|
||||
|
||||
/* look for new connection request */
|
||||
|
||||
FD_SET( pp -> sockfd, fchk );
|
||||
FD_SET( pp -> sockfd, fchk );
|
||||
|
||||
/* look for data in existing connection (if it exists) */
|
||||
FOR_EACH_IN_PORT( inp, pp ) {
|
||||
FD_SET( inp->fd, fchk );
|
||||
FD_SET( inp->fd, fchk );
|
||||
}
|
||||
p1->status = DTM_PORT_NOT_READY ;
|
||||
}
|
||||
@ -994,21 +994,21 @@ int DTMselectRead( dtmset, dtmnum, sockset, socknum, period )
|
||||
|
||||
for( p2 = sockset, index = 0 ; index < socknum ; index++, p2++ ) {
|
||||
FD_SET( p2 -> sockfd, fchk );
|
||||
p2 -> status = DTM_PORT_NOT_READY ;
|
||||
}
|
||||
p2 -> status = DTM_PORT_NOT_READY ;
|
||||
}
|
||||
#ifdef __hpux
|
||||
nf = select( FD_SETSIZE, (int *)fchk, (int *)0, (int *)0,
|
||||
nf = select( FD_SETSIZE, (int *)fchk, (int *)0, (int *)0,
|
||||
#else
|
||||
nf = select( FD_SETSIZE, fchk, (fd_set *)0, (fd_set *)0,
|
||||
nf = select( FD_SETSIZE, fchk, (fd_set *)0, (fd_set *)0,
|
||||
#endif
|
||||
period < 0 ? NULL : &timeout );
|
||||
|
||||
/* Select returns error */
|
||||
/* Select returns error */
|
||||
|
||||
if( nf < 0 ) {
|
||||
DBGINT( "DTMselectRead: select error %d \n", errno );
|
||||
DTMerrno = DTMSELECT ;
|
||||
return DTMERROR ;
|
||||
if( nf < 0 ) {
|
||||
DBGINT( "DTMselectRead: select error %d \n", errno );
|
||||
DTMerrno = DTMSELECT ;
|
||||
return DTMERROR ;
|
||||
}
|
||||
|
||||
/* None of the DTM ports or sockets have anything to be read */
|
||||
@ -1016,7 +1016,7 @@ int DTMselectRead( dtmset, dtmnum, sockset, socknum, period )
|
||||
if( nf == 0 ) {
|
||||
DBGFLOW( "DTMselectRead: Nothing to read\n" );
|
||||
return DTM_PORT_NOT_READY ;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check whether any DTM port has something to be read */
|
||||
|
||||
@ -1027,14 +1027,14 @@ int DTMselectRead( dtmset, dtmnum, sockset, socknum, period )
|
||||
|
||||
if ((port_internal= dtm_map_port_internal( p1->port )) == DTMERROR)
|
||||
continue;
|
||||
|
||||
|
||||
pp = DTMpt[ port_internal ];
|
||||
if (pp->porttype == INPORTTYPE) {
|
||||
fNewConnections = fNewConnections ||
|
||||
(select_one_connection( pp->sockfd ) > 0);
|
||||
p1->status = DTM_PORT_NOT_READY;
|
||||
} else {
|
||||
if (select_one_connection( pp->sockfd ) > 0)
|
||||
if (select_one_connection( pp->sockfd ) > 0)
|
||||
fReady = p1->status = DTM_PORT_READY;
|
||||
else p1->status = DTM_PORT_NOT_READY;
|
||||
continue;
|
||||
@ -1049,7 +1049,7 @@ int DTMselectRead( dtmset, dtmnum, sockset, socknum, period )
|
||||
continue;
|
||||
}
|
||||
p1->status = DTM_PORT_READY;
|
||||
}
|
||||
}
|
||||
inp = inp->next;
|
||||
}
|
||||
if ( p1->status == DTM_PORT_READY ) fReady = DTM_PORT_READY;
|
||||
@ -1058,14 +1058,14 @@ int DTMselectRead( dtmset, dtmnum, sockset, socknum, period )
|
||||
/* Check whether any socket has something to be read */
|
||||
|
||||
for( p2 = sockset, index = 0 ; index < socknum ; index++, p2++ ) {
|
||||
p2 -> status = FD_ISSET( p2 -> sockfd, fchk ) ?
|
||||
p2 -> status = FD_ISSET( p2 -> sockfd, fchk ) ?
|
||||
DTM_PORT_READY : DTM_PORT_NOT_READY ;
|
||||
if ( p2->status == DTM_PORT_READY ) fReady = DTM_PORT_READY;
|
||||
}
|
||||
|
||||
DBGFLOW( "DTMselectRead done loop\n" );
|
||||
|
||||
} while (!fReady && (fNewConnections || fFalsePositive));
|
||||
} while (!fReady && (fNewConnections || fFalsePositive));
|
||||
|
||||
return fReady ;
|
||||
}
|
||||
@ -1076,7 +1076,7 @@ static Inport * inc_in_port(DTMPORT *pp,Inport *inp )
|
||||
static Inport * inc_in_port( pp, inp )
|
||||
DTMPORT * pp;
|
||||
Inport * inp;
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
if ( inp == NULL || inp->next == NULL )
|
||||
return pp->in;
|
||||
@ -1089,7 +1089,7 @@ static void inc_nextToRead(DTMPORT *pp )
|
||||
static void inc_nextToRead( pp )
|
||||
DTMPORT * pp;
|
||||
#endif
|
||||
{
|
||||
{
|
||||
pp->nextToRead = inc_in_port( pp, pp->nextToRead );
|
||||
}
|
||||
|
||||
@ -1106,7 +1106,7 @@ int dtm_destroy_in_port( inp, pp )
|
||||
if ( pp->Xcallback ) pp->XremoveInput( inp->XinputId );
|
||||
|
||||
close( inp->fd );
|
||||
|
||||
|
||||
if ( pp->nextToRead == inp )
|
||||
inc_nextToRead( pp );
|
||||
if ( pp->nextToRead == inp )
|
||||
@ -1136,7 +1136,7 @@ int dtm_destroy_in_port( inp, pp )
|
||||
return DTM_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
send_cts()
|
||||
@ -1148,7 +1148,7 @@ static int send_cts(DTMPORT *pp,int fWait )
|
||||
static int send_cts( pp, fWait )
|
||||
DTMPORT * pp;
|
||||
int fWait;
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
Inport * inp = pp->nextToRead;
|
||||
Inport * endp;
|
||||
@ -1157,7 +1157,7 @@ static int send_cts( pp, fWait )
|
||||
DBGMSG( "send_cts: <[\n" );
|
||||
|
||||
/*
|
||||
If we have no ports return OK
|
||||
If we have no ports return OK
|
||||
*/
|
||||
if ( inp == NULL ) inp = pp->in;
|
||||
if ( inp == NULL ) return DTM_OK;
|
||||
@ -1171,7 +1171,7 @@ static int send_cts( pp, fWait )
|
||||
if ( inp == endp ) {
|
||||
if ( !fWait ) return DTM_OK;
|
||||
else break;
|
||||
}
|
||||
}
|
||||
}
|
||||
pp->nextToRead = inp;
|
||||
|
||||
@ -1186,7 +1186,7 @@ static int send_cts( pp, fWait )
|
||||
if ( !inp->fCTSsent && ((fWait && (iSent == 1 )) ||
|
||||
(dtm_select( inp->fd, &tmp, 0 ) == TRUE && tmp >= 4))) {
|
||||
if ( dtm_send_ack( inp->fd, DTM_CTS ) == DTMERROR) {
|
||||
CHECK_ERR( dtm_destroy_in_port( inp, pp ));
|
||||
CHECK_ERR( dtm_destroy_in_port( inp, pp ));
|
||||
/*
|
||||
Never hurts to start at the top.
|
||||
*/
|
||||
@ -1202,9 +1202,9 @@ static int send_cts( pp, fWait )
|
||||
iSent = 0;
|
||||
continue;
|
||||
}
|
||||
inp->fCTSsent = TRUE;
|
||||
inp->fCTSsent = TRUE;
|
||||
inp->blocklen = DTM_NEW_DATASET;
|
||||
}
|
||||
}
|
||||
inp = inc_in_port( pp, inp );
|
||||
}
|
||||
DBGMSG( "send_cts: ]>\n" );
|
||||
@ -1216,7 +1216,7 @@ static int accept_one_header(DTMPORT *pp,void *header,int size )
|
||||
#else
|
||||
static int accept_one_header( pp, header, size )
|
||||
DTMPORT * pp;
|
||||
void * header;
|
||||
void * header;
|
||||
int size;
|
||||
#endif
|
||||
{
|
||||
@ -1227,23 +1227,23 @@ static int accept_one_header( pp, header, size )
|
||||
if ( inp == NULL || !inp->fCTSsent || inp->fGotHeader ) {
|
||||
DTMerrno = DTMCALL;
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
|
||||
DBGMSG1( "Accepting RTS on %d\n", inp->fd );
|
||||
if (dtm_recv_ack( inp->fd, &ack ) == DTMERROR ) {
|
||||
dtm_destroy_in_port( inp, pp );
|
||||
dtm_destroy_in_port( inp, pp );
|
||||
return DTMERROR;
|
||||
}
|
||||
if( ack != DTM_RTS ) {
|
||||
DTMerrno = DTMBADACK;
|
||||
DBGMSG1( "Something other than RTS received %d\n", ack );
|
||||
dtm_destroy_in_port( inp, pp );
|
||||
dtm_destroy_in_port( inp, pp );
|
||||
return DTMERROR;
|
||||
}
|
||||
#if 0
|
||||
/* There are no header ack */
|
||||
if ( dtm_send_ack( inp->fd, DTM_CTS ) == DTMERROR) {
|
||||
dtm_destroy_in_port( inp, pp );
|
||||
dtm_destroy_in_port( inp, pp );
|
||||
return DTMERROR;
|
||||
}
|
||||
#endif
|
||||
@ -1262,7 +1262,7 @@ static int accept_one_header( pp, header, size )
|
||||
/*
|
||||
DTMcheckRoute()
|
||||
Check whether new routing information has come in.
|
||||
Returns:
|
||||
Returns:
|
||||
*/
|
||||
#ifdef DTM_PROTOTYPES
|
||||
int DTMcheckRoute(int port )
|
||||
@ -1289,16 +1289,16 @@ int DTMcheckRoute( port )
|
||||
Function to test for existence of a new connection or
|
||||
a new message header to be read on a given DTM port.
|
||||
|
||||
Return values : TRUE if either new connection
|
||||
request or something new
|
||||
Return values : TRUE if either new connection
|
||||
request or something new
|
||||
to be read is available on
|
||||
given port.
|
||||
DTMERROR on select error.
|
||||
DTMERROR on select error.
|
||||
FALSE otherwise.
|
||||
|
||||
Notes :
|
||||
|
||||
DTMavailRead is basically call to DTMselectRead for
|
||||
DTMavailRead is basically call to DTMselectRead for
|
||||
given port with 0 timeout.
|
||||
*/
|
||||
#ifdef DTM_PROTOTYPES
|
||||
@ -1318,7 +1318,7 @@ int DTMavailRead( p )
|
||||
DTMerrno = DTMNOERR;
|
||||
|
||||
/* Note: the port here is an external port since that
|
||||
is what selectRead expects
|
||||
is what selectRead expects
|
||||
*/
|
||||
dtmnum = 1 ;
|
||||
dtmset.port = p ;
|
||||
@ -1331,7 +1331,7 @@ int DTMavailRead( p )
|
||||
DBGMSG1( "DTMavailRead send_cts returned error %d\n", DTMerrno );
|
||||
if ( DTMerrno == DTMEOF ) fAnyReady = FALSE ;
|
||||
else return DTMERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
DBGMSG( "DTMavailRead done\n" );
|
||||
return fAnyReady;
|
||||
@ -1386,7 +1386,7 @@ int DTMgetConnectionCount(port, n_connections)
|
||||
message is read.
|
||||
|
||||
Return values : >= 0 on success.
|
||||
DTMERROR on some error.
|
||||
DTMERROR on some error.
|
||||
*/
|
||||
#ifdef DTM_PROTOTYPES
|
||||
int DTMbeginRead(int p,VOIDPTR header,int size )
|
||||
@ -1406,8 +1406,8 @@ int DTMbeginRead( p, header, size )
|
||||
|
||||
CHECK_ERR( p = dtm_map_port_internal( p ));
|
||||
pp = DTMpt[p];
|
||||
|
||||
while ( TRUE ) {
|
||||
|
||||
while ( TRUE ) {
|
||||
CHECK_ERR( dtm_accept_read_connections( pp, DTM_WAIT));
|
||||
if ( send_cts( pp, DTM_WAIT ) == DTMERROR) {
|
||||
if ( DTMerrno == DTMEOF ) continue;
|
||||
@ -1415,8 +1415,8 @@ int DTMbeginRead( p, header, size )
|
||||
}
|
||||
if ( pp->nextToRead == NULL ) continue;
|
||||
DBGFLOW( "DTMbeginRead before accept_one_header.\n" );
|
||||
if (( count = accept_one_header( pp, header, size )) == DTMERROR ) {
|
||||
if ( DTMerrno == DTMEOF ) continue;
|
||||
if (( count = accept_one_header( pp, header, size )) == DTMERROR ) {
|
||||
if ( DTMerrno == DTMEOF ) continue;
|
||||
return DTMERROR;
|
||||
}
|
||||
break;
|
||||
@ -1428,7 +1428,7 @@ int DTMbeginRead( p, header, size )
|
||||
|
||||
/*
|
||||
DTMreadDataset()
|
||||
Function to read user messages.
|
||||
Function to read user messages.
|
||||
|
||||
Return values : number of bytes read, on success
|
||||
DTMERROR on error
|
||||
@ -1466,7 +1466,7 @@ int DTMreadDataset(p, ds, size, type)
|
||||
/* fill buffer from network */
|
||||
|
||||
/*
|
||||
Assume that the caller has checked for EOT
|
||||
Assume that the caller has checked for EOT
|
||||
*/
|
||||
CHECK_ERR( size = dtm_read_buffer( inp->fd, &inp->blocklen, ds, size));
|
||||
|
||||
@ -1512,22 +1512,22 @@ int DTMendRead( p )
|
||||
dtm_discard, DISCARDSIZE) > 0 );
|
||||
inp->fCTSsent = FALSE;
|
||||
inp->fGotHeader = FALSE;
|
||||
return DTM_OK ;
|
||||
return DTM_OK ;
|
||||
}
|
||||
|
||||
/*
|
||||
Function to combine reading of header/data.
|
||||
|
||||
|
||||
Return values : number of bytes read, on success
|
||||
DTMERROR on error
|
||||
DTMERROR on error
|
||||
|
||||
Notes : This function is really there for completeness
|
||||
sake ( it complements DTMwriteMsg ). It is not
|
||||
very clear how a user can use it effectively
|
||||
( since he has to know data size beforehand,
|
||||
in which case he need not have a header ).
|
||||
|
||||
Hence, implementation of this function is to
|
||||
|
||||
Hence, implementation of this function is to
|
||||
just call beginRead, readDataset and endRead
|
||||
in that order.
|
||||
*/
|
||||
@ -1565,7 +1565,7 @@ int DTMreadMsg( p, hdr, hdrsize, data, datasize, datatype )
|
||||
|
||||
Return values : TRUE if subsequent write will
|
||||
succeed.
|
||||
FALSE subsequent write will wait/fail.
|
||||
FALSE subsequent write will wait/fail.
|
||||
DTMERROR if port is not initialised or
|
||||
server ( UDP/TCP ) port not
|
||||
yet acquired etc.
|
||||
@ -1603,12 +1603,12 @@ int DTMavailWrite( port )
|
||||
err_count = 0 ;
|
||||
rstatus = DTM_PORT_READY ;
|
||||
|
||||
FOR_EACH_OUT_PORT( pcur, pp ) {
|
||||
FOR_EACH_OUT_PORT( pcur, pp ) {
|
||||
|
||||
/* Connect to all new active sockets */
|
||||
|
||||
if( pcur->connfd == DTM_NO_CONNECTION ) {
|
||||
if( dtm_quick_connect( &pcur->sockaddr, &pcur->connfd )
|
||||
if( dtm_quick_connect( &pcur->sockaddr, &pcur->connfd )
|
||||
== DTMERROR ) {
|
||||
++err_count ;
|
||||
continue ;
|
||||
@ -1628,14 +1628,14 @@ int DTMavailWrite( port )
|
||||
/* send RTS to new sockets */
|
||||
|
||||
if( dtm_send_ack( pcur->connfd, DTM_RTS ) == DTMERROR ) {
|
||||
if( DTMerrno == DTMEOF )
|
||||
if( DTMerrno == DTMEOF )
|
||||
CHECK_ERR( destroy_out_port( pp, &pcur ));
|
||||
++err_count ;
|
||||
continue ;
|
||||
}
|
||||
}
|
||||
pcur->seqstart = TRUE ;
|
||||
}
|
||||
|
||||
|
||||
nf = select_one( pcur->connfd );
|
||||
|
||||
if( nf < 0 ) {
|
||||
@ -1648,10 +1648,10 @@ int DTMavailWrite( port )
|
||||
/* No ack yet */
|
||||
|
||||
if( nf == 0 ) {
|
||||
if( pp->qservice == DTM_SYNC )
|
||||
if( pp->qservice == DTM_SYNC )
|
||||
rstatus = DTM_PORT_NOT_READY ;
|
||||
continue ;
|
||||
}
|
||||
}
|
||||
|
||||
/* Receive ack */
|
||||
|
||||
@ -1661,7 +1661,7 @@ int DTMavailWrite( port )
|
||||
CHECK_ERR( destroy_out_port( pp, &pcur ));
|
||||
++err_count ;
|
||||
continue ;
|
||||
}
|
||||
}
|
||||
|
||||
/* port is available for write */
|
||||
|
||||
@ -1674,7 +1674,7 @@ int DTMavailWrite( port )
|
||||
At some future point we may want to send the status
|
||||
of err_count to the server.
|
||||
*/
|
||||
pp->fLastWasSuccessfulAvailWrite = ( err_count == 0 )
|
||||
pp->fLastWasSuccessfulAvailWrite = ( err_count == 0 )
|
||||
&& ( rstatus == DTM_PORT_READY );
|
||||
return ( err_count != 0 ) ? DTM_PORT_NOT_READY : rstatus ;
|
||||
}
|
||||
@ -1688,7 +1688,7 @@ int DTMavailWrite( port )
|
||||
int DTMbeginWrite(int port,VOIDPTR header,int size )
|
||||
#else
|
||||
int DTMbeginWrite( port, header, size )
|
||||
int port ;
|
||||
int port ;
|
||||
VOIDPTR header;
|
||||
int size ;
|
||||
#endif
|
||||
@ -1702,8 +1702,8 @@ int DTMbeginWrite( port, header, size )
|
||||
if ( pp->fDiscard ) {
|
||||
CHECK_ERR( dtm_check_server( pp, DTM_DONT_WAIT ));
|
||||
if ( pp->fDiscard ) return DTM_OK;
|
||||
}
|
||||
if ( !pp->fLastWasSuccessfulAvailWrite )
|
||||
}
|
||||
if ( !pp->fLastWasSuccessfulAvailWrite )
|
||||
CHECK_ERR( dtm_check_server( pp, DTM_WAIT ));
|
||||
CHECK_ERR( make_out_connections( pp ));
|
||||
make_write_iov( &iov_buf, START_SEQ, NO_END_SEQ, header, size, NULL, 0 );
|
||||
@ -1734,7 +1734,7 @@ int DTMwriteDataset(p, ds, size, type)
|
||||
IOV_BUF iov_buf;
|
||||
|
||||
CHECK_ERR( p = dtm_map_port_internal( p ));
|
||||
pp = DTMpt[p];
|
||||
pp = DTMpt[p];
|
||||
if ( pp->fDiscard ) return DTM_OK;
|
||||
CHECK_ERR( verify_out_connections( pp ));
|
||||
size = (*DTMconvertRtns[(int)type]) ( DTMSTD, ds, size );
|
||||
@ -1760,12 +1760,12 @@ int DTMendWrite( port )
|
||||
reg Outport * pcur ;
|
||||
|
||||
CHECK_ERR( port = dtm_map_port_internal( port ));
|
||||
pp = DTMpt[port];
|
||||
pp = DTMpt[port];
|
||||
/*
|
||||
Check for endWrite before begin
|
||||
*/
|
||||
FOR_EACH_OUT_PORT( pcur, pp ) {
|
||||
if( pcur->connfd == DTM_NO_CONNECTION ) continue;
|
||||
FOR_EACH_OUT_PORT( pcur, pp ) {
|
||||
if( pcur->connfd == DTM_NO_CONNECTION ) continue;
|
||||
if ((pp->qservice == DTM_SYNC && !pcur->availwrite) ||
|
||||
!pcur->seqstart ) {
|
||||
DTMerrno = DTMCALL;
|
||||
@ -1774,7 +1774,7 @@ int DTMendWrite( port )
|
||||
}
|
||||
if ( pp->fDiscard ) return DTM_OK;
|
||||
CHECK_ERR( verify_out_connections( pp ));
|
||||
make_write_iov( &iov_buf, NO_START_SEQ, END_SEQ, NULL, 0, NULL, 0 );
|
||||
make_write_iov( &iov_buf, NO_START_SEQ, END_SEQ, NULL, 0, NULL, 0 );
|
||||
CHECK_ERR( writev_buffer( pp, &iov_buf, NO_START_SEQ ));
|
||||
CHECK_ERR( clear_write_flags( pp ));
|
||||
return DTM_OK;
|
||||
@ -1820,8 +1820,8 @@ int DTMwriteMsg( p, hdr, hdrsize, data, datasize, datatype )
|
||||
if ( pp->fDiscard ) {
|
||||
CHECK_ERR( dtm_check_server( pp, DTM_DONT_WAIT ));
|
||||
if ( pp->fDiscard ) return DTM_OK;
|
||||
}
|
||||
if ( !pp->fLastWasSuccessfulAvailWrite )
|
||||
}
|
||||
if ( !pp->fLastWasSuccessfulAvailWrite )
|
||||
CHECK_ERR( dtm_check_server( pp, DTM_WAIT ));
|
||||
CHECK_ERR( make_out_connections( pp ));
|
||||
CHECK_ERR( verify_out_connections( pp ));
|
||||
|
38
libdtm/dtm.h
38
libdtm/dtm.h
@ -21,7 +21,7 @@
|
||||
|
||||
/*************************************************************************
|
||||
**
|
||||
** dtm.h -
|
||||
** dtm.h -
|
||||
**
|
||||
*************************************************************************/
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
*
|
||||
* Revision 1.32 92/05/06 16:40:17 jefft
|
||||
* Modified prototype on DTMaddInput
|
||||
*
|
||||
*
|
||||
* Revision 1.31 1992/04/30 20:27:05 jplevyak
|
||||
* Changed Version to 2.3
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
*
|
||||
* Revision 1.29 92/03/20 21:14:40 jplevyak
|
||||
* Add DTMgetPortAddr and remove DTMgetPortName
|
||||
*
|
||||
*
|
||||
* Revision 1.28 1992/03/13 18:20:31 jefft
|
||||
* dtm.h depended on TRUE being defined before it was included. This word
|
||||
* TRUE was changed to 1 and FALSE to 0
|
||||
@ -63,23 +63,23 @@
|
||||
*
|
||||
* Revision 1.25 92/02/18 14:02:36 jplevyak
|
||||
* Added prototype for DTMaddInPortSocket.
|
||||
*
|
||||
*
|
||||
* Revision 1.24 92/01/30 19:28:24 jplevyak
|
||||
* add prototypes
|
||||
*
|
||||
*
|
||||
* Revision 1.23 1992/01/02 16:31:56 dweber
|
||||
* Reorganized the DTM class and MSG class
|
||||
*
|
||||
* Revision 1.22 91/12/13 22:34:48 jefft
|
||||
* Removed DTMtitle and DTMtype constants. Added dtm_(sg)et_address macros.
|
||||
* Added MSG(sg)etString macros.
|
||||
*
|
||||
*
|
||||
* Revision 1.21 91/12/13 15:37:55 dweber
|
||||
* Fixed DTMHL bugs and re-ordered some macros for clarification
|
||||
*
|
||||
*
|
||||
* Revision 1.20 91/12/12 22:55:27 jefft
|
||||
* Add numbers to the comments beside the DTM errors
|
||||
*
|
||||
*
|
||||
* Revision 1.19 1991/12/10 22:15:56 jefft
|
||||
* fixed DTMgetAddress macro (it was calling dtm_set_char).
|
||||
*
|
||||
@ -96,7 +96,7 @@
|
||||
* Revision 1.15 91/10/11 20:23:31 jplevyak
|
||||
* Added prototype for DTMcheckRoute,
|
||||
* Changed DTMSYNC, DTMNOSYNC to DTM_SYNC, DTM_ASYNC.
|
||||
*
|
||||
*
|
||||
* Revision 1.14 1991/10/10 14:23:43 jplevyak
|
||||
* All prototypes are now included and tested.
|
||||
*
|
||||
@ -105,10 +105,10 @@
|
||||
*
|
||||
* Revision 1.12 91/09/18 15:27:54 jplevyak
|
||||
* Added extern definition for DTMinit()
|
||||
*
|
||||
*
|
||||
* Revision 1.11 91/09/13 17:36:05 sreedhar
|
||||
* DTMSYNC, DTMNOSYNC added
|
||||
*
|
||||
*
|
||||
* Revision 1.10 1991/09/13 15:31:45 jefft
|
||||
* fixed DTMHL macro, it should not have taken an arguement.
|
||||
*
|
||||
@ -136,7 +136,7 @@
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:31:19 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@
|
||||
#define DTM_PROTOTYPES
|
||||
#define DTM_PROTO(x) x
|
||||
#else
|
||||
#define DTM_PROTO(x) ()
|
||||
#define DTM_PROTO(x) ()
|
||||
#endif
|
||||
|
||||
/* DTM constants */
|
||||
@ -220,7 +220,7 @@ typedef enum {
|
||||
NOTE: the strings that describe the errors in DTMerr
|
||||
are located in fatal.c. Any changes to this list
|
||||
must be accompanied by a corresponding change there.
|
||||
*/
|
||||
*/
|
||||
#define DTMERROR -1
|
||||
#define DTM_OK DTMNOERR
|
||||
|
||||
@ -282,21 +282,21 @@ extern int DTMreadDataset DTM_PROTO(( int p, VOIDPTR ds, int size, DTMTYPE type)
|
||||
extern int DTMwriteDataset DTM_PROTO(( int p, VOIDPTR ds, int size, DTMTYPE type));
|
||||
extern int DTMendRead DTM_PROTO(( int port ));
|
||||
extern int DTMendWrite DTM_PROTO(( int port ));
|
||||
extern int DTMreadMsg DTM_PROTO(( int p, char *hdr, int hdrsize,
|
||||
extern int DTMreadMsg DTM_PROTO(( int p, char *hdr, int hdrsize,
|
||||
VOIDPTR data, int datasize, int datatype ));
|
||||
extern int DTMdestroyPort DTM_PROTO(( int port));
|
||||
extern char *DTMerrmsg();
|
||||
extern int DTMgetPortAddr DTM_PROTO(( int port, char * addr, int length ));
|
||||
extern int DTMgetReturnPortName DTM_PROTO(( int port, char *** addrs,
|
||||
int * n_addrs));
|
||||
extern int DTMselectRead DTM_PROTO(( Dtm_set *dtmset, int dtmnum,
|
||||
extern int DTMselectRead DTM_PROTO(( Dtm_set *dtmset, int dtmnum,
|
||||
Sock_set *sockset, int socknum, int period ));
|
||||
extern void DTMsetGroup DTM_PROTO(( char * header, DTMCMD cmd, char * parent,
|
||||
extern void DTMsetGroup DTM_PROTO(( char * header, DTMCMD cmd, char * parent,
|
||||
char * self ));
|
||||
extern int DTMgetGroup DTM_PROTO(( char * header, DTMCMD cmd, char * parent,
|
||||
extern int DTMgetGroup DTM_PROTO(( char * header, DTMCMD cmd, char * parent,
|
||||
char * self ));
|
||||
extern int DTMsendRoute DTM_PROTO(( int fd, char * sendto_addr, int addcount,
|
||||
char **add_addresses, int delcount,
|
||||
char **add_addresses, int delcount,
|
||||
char **del_addresses ));
|
||||
extern int DTMcheckRoute DTM_PROTO(( int port ));
|
||||
/* Not implemented Yet */
|
||||
|
@ -39,7 +39,7 @@
|
||||
*
|
||||
* Revision 1.7 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.6 1992/03/10 22:07:10 jplevyak
|
||||
* Added changed for PC/MAC from Quincey Koziol (koziol@ncsa.uiuc.edu)
|
||||
* with modification.
|
||||
@ -58,7 +58,7 @@
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:31:46 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
|
||||
#endif
|
||||
|
||||
@ -112,7 +112,7 @@ int DTMGPA(p, s, len)
|
||||
int *p, *len;
|
||||
_fcd s;
|
||||
#endif
|
||||
{
|
||||
{
|
||||
char portaddr[128];
|
||||
|
||||
|
||||
@ -120,7 +120,7 @@ int DTMGPA(p, s, len)
|
||||
return DTMERROR;
|
||||
|
||||
if (strlen(portaddr) > *len) {
|
||||
strncpy(_fcdtocp(s), portaddr, *len);
|
||||
strncpy(_fcdtocp(s), portaddr, *len);
|
||||
return DTMERROR;
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ int DTMBW(p, header, size)
|
||||
len = _fcdlen(header);
|
||||
strncpy(buffer, _fcdtocp(header), len);
|
||||
buffer[len] = '\0';
|
||||
|
||||
|
||||
return DTMbeginWrite(*p, buffer, len+1);
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
||||
*
|
||||
* Revision 1.33 92/05/05 22:27:50 jplevyak
|
||||
* Corrected X interface code.
|
||||
*
|
||||
*
|
||||
* Revision 1.32 1992/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
@ -71,7 +71,7 @@
|
||||
*
|
||||
* Revision 1.29 92/03/20 21:14:40 jplevyak
|
||||
* Remove comments about DTMgetPortName
|
||||
*
|
||||
*
|
||||
* Revision 1.28 1992/03/16 20:38:36 creiman
|
||||
* Added #include "arch.h"
|
||||
*
|
||||
@ -99,7 +99,7 @@
|
||||
*
|
||||
* Revision 1.20 91/11/22 21:31:00 jplevyak
|
||||
* Added initialization for fDiscard (fGotList and fLastWasSuccessfull...)
|
||||
*
|
||||
*
|
||||
* Revision 1.19 1991/10/29 22:05:53 sreedhar
|
||||
* <sys/malloc.h> for CONVEX
|
||||
*
|
||||
@ -120,17 +120,17 @@
|
||||
* Major reorganization. Dynamically allocate port table. Encode a
|
||||
* key in the external ports to detect stale ports. Rename and
|
||||
* comment functions.
|
||||
*
|
||||
*
|
||||
* Revision 1.13 91/09/18 15:28:11 jplevyak
|
||||
* Added some external definitions for shared functions.
|
||||
*
|
||||
*
|
||||
* Revision 1.12 91/09/16 11:25:37 jplevyak
|
||||
* Fix bug, use of uninitialized register variable in function
|
||||
* DTMdestroyPort
|
||||
*
|
||||
*
|
||||
* Revision 1.11 91/09/13 20:09:31 sreedhar
|
||||
* supporting :9900, absence of env variable
|
||||
*
|
||||
*
|
||||
* Revision 1.10 1991/09/13 18:57:13 sreedhar
|
||||
* removed DTMinit() fn., added qservice in some places
|
||||
*
|
||||
@ -151,13 +151,13 @@
|
||||
*
|
||||
* Revision 1.3 91/01/09 14:10:04 jefft
|
||||
* Now ignoring SIGPIPE signals.
|
||||
*
|
||||
*
|
||||
* Revision 1.2 90/11/21 10:53:08 jefft
|
||||
* Modified DTMgetPortAddr to return IP address instead of hostname.
|
||||
*
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:21:54 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "arch.h"
|
||||
@ -185,11 +185,11 @@
|
||||
/*
|
||||
CONTENTS
|
||||
|
||||
STATIC
|
||||
STATIC
|
||||
|
||||
init_port() - initialize DTM port.
|
||||
grow_ports() - enlarge the DTM port table
|
||||
initialize() - initialize DTM library
|
||||
initialize() - initialize DTM library
|
||||
get_init_port() - find a new port and initialize it
|
||||
set_out_port_address() - set a physical out port adress
|
||||
free_port() - free the internal port structure
|
||||
@ -205,7 +205,7 @@
|
||||
DTMmakeInPort() - make a DTM input port
|
||||
DTMmakeOutPort() - make a DTM output port
|
||||
DTMdestroyPort() - close and free a DTM port
|
||||
DTMgetPortAddr() - returns the main port address
|
||||
DTMgetPortAddr() - returns the main port address
|
||||
|
||||
END CONTENTS */
|
||||
|
||||
@ -273,7 +273,7 @@ static int init_port( port, porttype, qservice )
|
||||
|
||||
/* Output port data init */
|
||||
|
||||
pp->out = NULL ;
|
||||
pp->out = NULL ;
|
||||
pp->fLastWasSuccessfulAvailWrite = FALSE;
|
||||
pp->fGotList = FALSE;
|
||||
pp->fDiscard = FALSE;
|
||||
@ -287,7 +287,7 @@ static int init_port( port, porttype, qservice )
|
||||
*/
|
||||
static int grow_ports( VOID )
|
||||
{
|
||||
if ( ( DTMpt = (DTMPORT **) realloc( (void *) DTMpt, (DTMptCount +
|
||||
if ( ( DTMpt = (DTMPORT **) realloc( (void *) DTMpt, (DTMptCount +
|
||||
DTM_PORTS_GROW) * sizeof(DTMPORT))) == NULL ) {
|
||||
DTMerrno = DTMMEM;
|
||||
DTMERR("initialize: insufficient memory for port table.");
|
||||
@ -310,7 +310,7 @@ static int grow_ports( VOID )
|
||||
Initailized DTM by allocating memory for dtm_discard
|
||||
and DTMpt ( the port table ).
|
||||
*/
|
||||
static int initialize( VOID )
|
||||
static int initialize( VOID )
|
||||
{
|
||||
/* get the debug option flag */
|
||||
if ( getenv( "DTMDEBUG" ) ) uDTMdbg = -1;
|
||||
@ -358,7 +358,7 @@ static int get_init_port( portname, porttype, qservice )
|
||||
|
||||
/* check for library initialization */
|
||||
if( !DTM_INITIALIZED ) CHECK_ERR( initialize());
|
||||
|
||||
|
||||
/* find first open DTM port */
|
||||
while ( tries-- ) {
|
||||
for (port=0; port < DTMptCount; port+=1) {
|
||||
@ -366,7 +366,7 @@ static int get_init_port( portname, porttype, qservice )
|
||||
CHECK_ERR(init_port( port, porttype, qservice ));
|
||||
strncpy( DTMpt[port]->portname, portname, (PNAMELEN - 1) );
|
||||
DTMpt[ port ]->portname[ PNAMELEN - 1 ] = '\0' ;
|
||||
DTMpt[ port ]->key = DTMportSequenceNumber++;
|
||||
DTMpt[ port ]->key = DTMportSequenceNumber++;
|
||||
return port;
|
||||
}
|
||||
}
|
||||
@ -394,18 +394,18 @@ static int set_out_port_address( port, addr )
|
||||
Port aPort ;
|
||||
Outport *outp ;
|
||||
|
||||
DBGINT( "set_out_port_address: Physical TCP portname - %x ",
|
||||
DBGINT( "set_out_port_address: Physical TCP portname - %x ",
|
||||
ntohl( addr.sin_addr.s_addr ));
|
||||
DBGINT( "%d\n", ntohs( addr.sin_port ));
|
||||
|
||||
aPort.portid = addr.sin_port ;
|
||||
aPort.nethostid = addr.sin_addr.s_addr ;
|
||||
aPort.nethostid = addr.sin_addr.s_addr ;
|
||||
CHECK_ERR( outp = dtm_new_out_port( &aPort ));
|
||||
|
||||
DTMpt[port]->out = outp ;
|
||||
DTMpt[port]->out = outp ;
|
||||
|
||||
return DTM_OK;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DTM_PROTOTYPES
|
||||
static int free_port(int port )
|
||||
@ -414,15 +414,15 @@ static int free_port( port )
|
||||
int port;
|
||||
#endif
|
||||
{
|
||||
Outport * outport = DTMpt[ port ]->out;
|
||||
Outport * outport = DTMpt[ port ]->out;
|
||||
Outport * tempPort;
|
||||
int returnValue = DTM_OK;
|
||||
int returnValue = DTM_OK;
|
||||
|
||||
while ( outport != NULL ) {
|
||||
tempPort = outport->next;
|
||||
#ifdef FREE_RETURNS_INT
|
||||
if ( free( outport ) != 0 ) {
|
||||
DTMerrno = DTMCORPT;
|
||||
DTMerrno = DTMCORPT;
|
||||
returnValue = DTMERROR;
|
||||
break;
|
||||
}
|
||||
@ -430,10 +430,10 @@ static int free_port( port )
|
||||
free( outport );
|
||||
#endif
|
||||
outport = tempPort;
|
||||
}
|
||||
}
|
||||
#ifdef FREE_RETURNS_INT
|
||||
if ( free( DTMpt[ port ] ) != 0 ) {
|
||||
DTMerrno = DTMCORPT;
|
||||
DTMerrno = DTMCORPT;
|
||||
returnValue = DTMERROR;
|
||||
}
|
||||
#else
|
||||
@ -455,14 +455,14 @@ static int register_port(int port )
|
||||
#else
|
||||
static int register_port( port )
|
||||
int port;
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
int fd ;
|
||||
S_ADDR addr ;
|
||||
char *naddr ;
|
||||
|
||||
CHECK_ERR( naddr = dtm_get_naddr( &addr, &fd ));
|
||||
if(dtm_nsend_sockaddr(fd, naddr, dtm_get_refname(), DTMpt[port]->portname,
|
||||
if(dtm_nsend_sockaddr(fd, naddr, dtm_get_refname(), DTMpt[port]->portname,
|
||||
&DTMpt[ port ]->sockaddr ) < 0 ) {
|
||||
DTMdestroyPort( DTMpt[port]->sockfd ) ;
|
||||
DTMerrno = DTMTIMEOUT;
|
||||
@ -495,15 +495,15 @@ int dtm_map_port_internal( port )
|
||||
|
||||
if ( ( thePort ) >= DTMptCount ) {
|
||||
DTMerrno = DTMBADPORT;
|
||||
return DTMERROR;
|
||||
return DTMERROR;
|
||||
}
|
||||
if ( DTMpt[ thePort ] == NULL ) {
|
||||
DTMerrno = DTMBADPORT;
|
||||
return DTMERROR;
|
||||
return DTMERROR;
|
||||
}
|
||||
if ( ( port >> DTM_PORT_KEY_SHIFT ) != DTMpt[ thePort ]->key ) {
|
||||
DTMerrno = DTMBADPORT;
|
||||
return DTMERROR;
|
||||
return DTMERROR;
|
||||
}
|
||||
return thePort;
|
||||
}
|
||||
@ -515,7 +515,7 @@ void dtm_map_port_external( port )
|
||||
int32 *port;
|
||||
#endif
|
||||
{
|
||||
*port = *port | (DTMpt[ *port ]->key << DTM_PORT_KEY_SHIFT);
|
||||
*port = *port | (DTMpt[ *port ]->key << DTM_PORT_KEY_SHIFT);
|
||||
}
|
||||
|
||||
|
||||
@ -544,11 +544,11 @@ int DTMmakeInPort(portname, qservice )
|
||||
|
||||
CHECK_ERR(port = get_init_port(portname, INPORTTYPE, qservice ));
|
||||
DBGMSG2("DTMmakeInPort port %d addr %X\n", port, DTMpt[port] );
|
||||
CHECK_ERR(dtm_init_sockaddr( &DTMpt[ port ]->sockaddr,
|
||||
CHECK_ERR(dtm_init_sockaddr( &DTMpt[ port ]->sockaddr,
|
||||
DTMpt[ port ]->portname, &fLogicalName ));
|
||||
DTMpt[port]->fLogical = fLogicalName;
|
||||
|
||||
if ((DTMpt[port]->sockfd = dtm_socket_init( &DTMpt[port]->sockaddr,
|
||||
if ((DTMpt[port]->sockfd = dtm_socket_init( &DTMpt[port]->sockaddr,
|
||||
INPORTTYPE, fLogicalName )) == DTMERROR ) {
|
||||
free_port(port);
|
||||
return DTMERROR ;
|
||||
@ -564,7 +564,7 @@ int DTMmakeInPort(portname, qservice )
|
||||
|
||||
|
||||
/*
|
||||
DTMmakeOutPort()
|
||||
DTMmakeOutPort()
|
||||
Create and initialze a new port.
|
||||
portname may be a logical or a physical port.
|
||||
qservice is reserved for future use.
|
||||
@ -576,7 +576,7 @@ int DTMmakeOutPort(char *portname,int qservice )
|
||||
int DTMmakeOutPort(portname, qservice )
|
||||
char *portname;
|
||||
int qservice ;
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
int port;
|
||||
int fLogicalName = TRUE;
|
||||
@ -585,10 +585,10 @@ int DTMmakeOutPort(portname, qservice )
|
||||
DBGFLOW("DTMmakeOutPort called.\n");
|
||||
|
||||
CHECK_ERR( (port = get_init_port( portname, OUTPORTTYPE, qservice)));
|
||||
CHECK_ERR((dtm_init_sockaddr(&addr, DTMpt[port]->portname,&fLogicalName)));
|
||||
CHECK_ERR((dtm_init_sockaddr(&addr, DTMpt[port]->portname,&fLogicalName)));
|
||||
DTMpt[port]->fLogical = fLogicalName;
|
||||
|
||||
if( !fLogicalName ) CHECK_ERR( set_out_port_address( port, addr ));
|
||||
if( !fLogicalName ) CHECK_ERR( set_out_port_address( port, addr ));
|
||||
|
||||
if( (DTMpt[port] -> sockfd = dtm_socket_init( &DTMpt[port] -> sockaddr,
|
||||
OUTPORTTYPE, fLogicalName )) == DTMERROR ) {
|
||||
@ -614,7 +614,7 @@ int DTMdestroyPort(int port)
|
||||
#else
|
||||
int DTMdestroyPort(port)
|
||||
int port;
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
reg DTMPORT *pp ;
|
||||
|
||||
@ -634,7 +634,7 @@ int DTMdestroyPort(port)
|
||||
|
||||
if( pp -> porttype == INPORTTYPE ) {
|
||||
register Inport *pcur ;
|
||||
FOR_EACH_IN_PORT( pcur, pp ) {
|
||||
FOR_EACH_IN_PORT( pcur, pp ) {
|
||||
if( pcur->fd != DTM_NO_CONNECTION ) {
|
||||
if ( pp->Xcallback ) pp->XremoveInput( pcur->XinputId );
|
||||
close( pcur->fd ) ;
|
||||
@ -643,11 +643,11 @@ int DTMdestroyPort(port)
|
||||
} else {
|
||||
register Outport *pcur ;
|
||||
|
||||
FOR_EACH_OUT_PORT( pcur, pp ) {
|
||||
FOR_EACH_OUT_PORT( pcur, pp ) {
|
||||
if( pcur->connfd != DTM_NO_CONNECTION ) close( pcur->connfd ) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* free space allocated for port */
|
||||
|
||||
free_port( port );
|
||||
@ -686,7 +686,7 @@ int DTMgetPortAddr(port, addr, length)
|
||||
sprintf(pnum, ":%d", ntohs( DTMpt[port]->sockaddr.sin_port ) );
|
||||
if ( strlen( pnum ) + strlen( addr ) + 1 > length ) {
|
||||
DTMerrno = DTMBUFOVR;
|
||||
return DTMERROR;
|
||||
return DTMERROR;
|
||||
}
|
||||
strcat(addr, pnum);
|
||||
|
||||
@ -704,7 +704,7 @@ static char * dtm_addr_to_a( addr )
|
||||
uint32 hnum = addr.sin_addr.s_addr;
|
||||
unsigned char * p_hnum = (unsigned char *) &hnum;
|
||||
|
||||
sprintf(addr_buf, "%d.%d.%d.%d:%d",
|
||||
sprintf(addr_buf, "%d.%d.%d.%d:%d",
|
||||
p_hnum[0], p_hnum[1], p_hnum[2], p_hnum[3], ntohs( addr.sin_port ));
|
||||
return addr_buf;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
*
|
||||
* Revision 1.28 92/05/05 22:27:50 jplevyak
|
||||
* Corrected X interface code.
|
||||
*
|
||||
*
|
||||
* Revision 1.27 1992/04/30 20:27:05 jplevyak
|
||||
* Changed Version to 2.3
|
||||
*
|
||||
@ -62,13 +62,13 @@
|
||||
*
|
||||
* Revision 1.20 92/02/27 23:59:56 jplevyak
|
||||
* Fixup prototype problems.
|
||||
*
|
||||
*
|
||||
* Revision 1.19 1992/01/30 19:28:50 jplevyak
|
||||
* Add support for c++ type external definitions.
|
||||
*
|
||||
* Revision 1.18 92/01/24 18:45:50 jefft
|
||||
* Removed prototypes for dtm_set_<type> and dtm_get_<type>, added them to dtm.h
|
||||
*
|
||||
*
|
||||
* Revision 1.17 1991/12/16 19:44:04 jefft
|
||||
* Fixed bug with defining of NULL macro
|
||||
*
|
||||
@ -97,13 +97,13 @@
|
||||
* Major reorganization. Made this file compatible with dtm.h. Moved
|
||||
* redundant out. Added several configuration parameters, added
|
||||
* prototypes for internally global functions.
|
||||
*
|
||||
*
|
||||
* Revision 1.9 91/09/18 15:28:50 jplevyak
|
||||
* Added some external definitions for shared functions.
|
||||
*
|
||||
*
|
||||
* Revision 1.8 91/09/13 17:37:37 sreedhar
|
||||
* MAX132 instead of MAXBUFSIZE
|
||||
*
|
||||
*
|
||||
* Revision 1.7 1991/08/15 19:10:53 sreedhar
|
||||
* Changes for logical portname version
|
||||
*
|
||||
@ -121,10 +121,10 @@
|
||||
*
|
||||
* Revision 1.2 90/11/21 12:35:44 jefft
|
||||
* Removed trailing comma from DTM error enum type.
|
||||
*
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:32:03 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@
|
||||
#endif
|
||||
|
||||
/* Added to shut up the SGI compiler which quotes ANSI regulations at
|
||||
you.
|
||||
you.
|
||||
*/
|
||||
#ifdef DTM_PROTOTYPES
|
||||
struct sockaddr;
|
||||
@ -163,7 +163,7 @@ struct iovec;
|
||||
#define INIT(x)
|
||||
#endif
|
||||
|
||||
#define reg register
|
||||
#define reg register
|
||||
|
||||
|
||||
/*
|
||||
@ -261,7 +261,7 @@ struct iovec;
|
||||
*/
|
||||
#define MAX132 132 /* max space of 132 */
|
||||
#define SEP " " /* blank as separator */
|
||||
#define COLON ":" /* colon as separator */
|
||||
#define COLON ":" /* colon as separator */
|
||||
|
||||
#ifndef NULL
|
||||
# if defined( _STDC_ ) || defined( __STDC__ )
|
||||
@ -272,33 +272,33 @@ struct iovec;
|
||||
#endif
|
||||
|
||||
#define FOR_EACH_OUT_PORT( pcur, pp ) \
|
||||
for ( pcur = pp->out; pcur != NULL ; pcur = pcur->next )
|
||||
for ( pcur = pp->out; pcur != NULL ; pcur = pcur->next )
|
||||
#define FOR_EACH_IN_PORT( inp, pp ) \
|
||||
for ( inp = pp->in; inp != NULL ; inp = inp->next )
|
||||
|
||||
|
||||
/*
|
||||
PORT STRUCTURES
|
||||
/*
|
||||
PORT STRUCTURES
|
||||
*/
|
||||
|
||||
typedef struct sockaddr_in S_ADDR;
|
||||
|
||||
typedef struct Port
|
||||
typedef struct Port
|
||||
{
|
||||
uint32 nethostid ;
|
||||
uint16 portid ;
|
||||
} Port ;
|
||||
|
||||
typedef struct Outport
|
||||
typedef struct Outport
|
||||
{
|
||||
S_ADDR sockaddr ; /* Socket family, netid/hostid, portid */
|
||||
int32 connfd ; /* connection fd */
|
||||
int availwrite ; /* port availability for write */
|
||||
int seqstart ; /* "Sequence start" message sent or not */
|
||||
struct Outport * next; /* link to next outport */
|
||||
int32 connfd ; /* connection fd */
|
||||
int availwrite ; /* port availability for write */
|
||||
int seqstart ; /* "Sequence start" message sent or not */
|
||||
struct Outport * next; /* link to next outport */
|
||||
} Outport ;
|
||||
|
||||
#define DTM_NEW_DATASET -1
|
||||
#define DTM_NEW_DATASET -1
|
||||
typedef struct Inport {
|
||||
int32 fd; /* connection fds */
|
||||
int32 blocklen; /* records no. of bytes read */
|
||||
@ -315,27 +315,27 @@ typedef struct Inport {
|
||||
to restore the assertion
|
||||
#endif
|
||||
#endif
|
||||
XtInputId XinputId;
|
||||
XtInputId XinputId;
|
||||
#else
|
||||
int XinputId;
|
||||
#endif
|
||||
struct Inport * next;
|
||||
} Inport;
|
||||
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
S_ADDR sockaddr ;
|
||||
S_ADDR sockaddr ;
|
||||
/* Socket family, netid/hostid, portid */
|
||||
int32 sockfd ; /* Main socket of port
|
||||
int32 sockfd ; /* Main socket of port
|
||||
Outport - UDP socket
|
||||
Inport - TCP socket
|
||||
*/
|
||||
#ifdef _XtIntrinsic_h
|
||||
XtInputId XinputId;
|
||||
XtInputId XinputId;
|
||||
#else
|
||||
int XinputId;
|
||||
#endif
|
||||
|
||||
|
||||
int fLogical;
|
||||
char portname[ PNAMELEN ] ; /* Logical portname */
|
||||
|
||||
@ -375,11 +375,11 @@ typedef struct
|
||||
GLOBAL VARIABLES
|
||||
*/
|
||||
|
||||
#define DTM_INITIALIZED (DTMpt != NULL)
|
||||
#define DTM_INITIALIZED (DTMpt != NULL)
|
||||
#define DTM_PORTS_INITIAL 20
|
||||
#define DTM_PORTS_GROW 20
|
||||
global DTMPORT **DTMpt INIT( NULL );
|
||||
global int32 DTMptCount INIT( 0 );
|
||||
global int32 DTMptCount INIT( 0 );
|
||||
global int32 DTMportSequenceNumber INIT( 1 );
|
||||
|
||||
#ifdef _ARCH_MSDOS
|
||||
@ -420,7 +420,7 @@ extern int dtm_nsend_sockaddr DTM_PROTO(( int fd, char * sendto_addr,
|
||||
char * refname, char * portname, S_ADDR * sockaddr ));
|
||||
extern Outport * dtm_new_out_port DTM_PROTO(( Port * port ));
|
||||
#define DTM_PORT_MASK 0xFFFF
|
||||
#define DTM_PORT_KEY_SHIFT 16
|
||||
#define DTM_PORT_KEY_SHIFT 16
|
||||
extern int dtm_map_port_internal DTM_PROTO(( int32 port ));
|
||||
extern void dtm_map_port_external DTM_PROTO(( int32 * port ));
|
||||
#define DTM_WAIT TRUE
|
||||
@ -433,26 +433,26 @@ extern int dtm_destroy_in_port DTM_PROTO(( Inport * inp, DTMPORT * pp ));
|
||||
extern int dtm_writev_buffer DTM_PROTO(( int fd, struct iovec *iov,
|
||||
int32 iovlen, int32 iovsize,
|
||||
struct sockaddr * addr, int addrlen ));
|
||||
extern int dtm_read_buffer DTM_PROTO(( int d, int32 * blocklen,
|
||||
extern int dtm_read_buffer DTM_PROTO(( int d, int32 * blocklen,
|
||||
void * buffer, int length ));
|
||||
extern int dtm_recv_header DTM_PROTO((int fd , void * header,
|
||||
extern int dtm_recv_header DTM_PROTO((int fd , void * header,
|
||||
int length));
|
||||
extern int dtm_read_header DTM_PROTO((int fd , void * header,
|
||||
int length));
|
||||
extern int dtm_parse_ipaddr DTM_PROTO(( char * source,
|
||||
extern int dtm_parse_ipaddr DTM_PROTO(( char * source,
|
||||
unsigned long * dest ));
|
||||
extern int dtm_quick_select DTM_PROTO(( int socket, int32 * count ));
|
||||
extern int dtm_select DTM_PROTO(( int fd, int32 * count,
|
||||
extern int dtm_select DTM_PROTO(( int fd, int32 * count,
|
||||
int32 time ));
|
||||
extern int dtm_accept DTM_PROTO(( int fd, S_ADDR * sn,
|
||||
extern int dtm_accept DTM_PROTO(( int fd, S_ADDR * sn,
|
||||
struct timeval * timeout ));
|
||||
extern int dtm_connect DTM_PROTO(( S_ADDR * sn, int * sockret ));
|
||||
extern int dtm_quick_connect DTM_PROTO(( S_ADDR * sn, int * sockret ));
|
||||
extern int dmt_end_connect DTM_PROTO(( int32 socket ));
|
||||
extern int dmt_end_connect DTM_PROTO(( int32 socket ));
|
||||
extern unsigned long dtm_get_ipaddr DTM_PROTO(( char * ipaddrstr ));
|
||||
extern int dtm_socket_init DTM_PROTO(( S_ADDR * sockaddr, int porttype,
|
||||
extern int dtm_socket_init DTM_PROTO(( S_ADDR * sockaddr, int porttype,
|
||||
int fLogicalName ));
|
||||
extern int dtm_init_sockaddr DTM_PROTO(( S_ADDR * sockaddr,
|
||||
extern int dtm_init_sockaddr DTM_PROTO(( S_ADDR * sockaddr,
|
||||
char * portname,
|
||||
int * pfLogicalName ));
|
||||
extern int dtm_ninit DTM_PROTO(( void ));
|
||||
@ -463,13 +463,13 @@ extern char * dtm_find_tag DTM_PROTO(( char *, char *));
|
||||
extern int dtm_accept_read_connections DTM_PROTO(( DTMPORT *pp,int fWait ));
|
||||
extern void dtm_set_Xcallback DTM_PROTO(( DTMPORT *pp, Inport * inp ));
|
||||
#ifdef _XtIntrinsic_h
|
||||
extern void dtm_handle_in DTM_PROTO(( caddr_t client_data,
|
||||
extern void dtm_handle_in DTM_PROTO(( caddr_t client_data,
|
||||
int * fd, XtInputId * in ));
|
||||
#else
|
||||
extern void dtm_handle_in DTM_PROTO(( caddr_t client_data,
|
||||
extern void dtm_handle_in DTM_PROTO(( caddr_t client_data,
|
||||
int * fd, void * in ));
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
@ -48,7 +48,7 @@
|
||||
*
|
||||
* Revision 1.8 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.7 1992/03/10 22:07:10 jplevyak
|
||||
* Added changed for PC/MAC from Quincey Koziol (koziol@ncsa.uiuc.edu)
|
||||
* with modification.
|
||||
@ -58,7 +58,7 @@
|
||||
*
|
||||
* Revision 1.5 91/09/26 20:24:21 jplevyak
|
||||
* Added debug.h as include file.
|
||||
*
|
||||
*
|
||||
* Revision 1.4 1991/06/11 15:19:36 sreedhar
|
||||
* disclaimer added
|
||||
*
|
||||
@ -70,7 +70,7 @@
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:32:18 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
|
||||
#endif
|
||||
*/
|
||||
@ -341,7 +341,7 @@ int DTMgetGroup(h, cmd, parent, self)
|
||||
}
|
||||
else
|
||||
*parent = '\0';
|
||||
|
||||
|
||||
h = strchr(h, ' ')+1;
|
||||
|
||||
/* get self name */
|
||||
|
@ -53,7 +53,7 @@
|
||||
*
|
||||
* Revision 1.19 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
|
||||
#endif
|
||||
*/
|
||||
@ -76,7 +76,7 @@
|
||||
#endif
|
||||
|
||||
#if !defined _ARCH_MACOS & !defined NEXT
|
||||
# ifdef CONVEX
|
||||
# ifdef CONVEX
|
||||
# include <sys/malloc.h>
|
||||
# else
|
||||
# include <malloc.h>
|
||||
@ -96,7 +96,7 @@ static void del_nlist DTM_PROTO(( DTMPORT *pp, int count ));
|
||||
static void add_nlist DTM_PROTO(( DTMPORT *pp, int count ));
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
Function to initialise self's reference name from environment
|
||||
variable passed by nameserver.
|
||||
|
||||
@ -105,7 +105,7 @@ static void add_nlist DTM_PROTO(( DTMPORT *pp, int count ));
|
||||
|
||||
Notes : Environment variable - DTM_REFNAME
|
||||
*/
|
||||
|
||||
|
||||
#ifdef DTM_PROTOTYPES
|
||||
static int init_refname(char *refname,int len )
|
||||
#else
|
||||
@ -163,11 +163,11 @@ void dtm_display_buf( outp, portname )
|
||||
DBGINT( "dtm_display_buf: Logical port %s\n", portname );
|
||||
while ( outp != NULL );
|
||||
{
|
||||
DBGINT( "dtm_display_buf: Nethostid = %x\n",
|
||||
DBGINT( "dtm_display_buf: Nethostid = %x\n",
|
||||
ntohl( outp -> sockaddr.sin_addr.s_addr) );
|
||||
DBGINT( "dtm_display_buf: Portid = %d\n",
|
||||
DBGINT( "dtm_display_buf: Portid = %d\n",
|
||||
ntohs( outp -> sockaddr.sin_port) );
|
||||
outp = outp->next;
|
||||
outp = outp->next;
|
||||
}
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ Outport * dtm_new_out_port(Port *port )
|
||||
Outport * dtm_new_out_port( port )
|
||||
Port * port;
|
||||
#endif
|
||||
{
|
||||
{
|
||||
Outport * p;
|
||||
|
||||
if ( (p = (Outport *) malloc( sizeof( Outport ))) == NULL ) {
|
||||
@ -226,8 +226,8 @@ static void del_nlist( pp, count )
|
||||
outpLast = NULL;
|
||||
for ( outp = pp->out ; outp != NULL ; outp = outpNext ) {
|
||||
outpNext = outp->next;
|
||||
if ((outp->sockaddr.sin_port == port.portid ) &&
|
||||
(outp-> sockaddr.sin_addr.s_addr == port.nethostid)) {
|
||||
if ((outp->sockaddr.sin_port == port.portid ) &&
|
||||
(outp-> sockaddr.sin_addr.s_addr == port.nethostid)) {
|
||||
if ( outpLast==NULL ) pp->out = outp->next;
|
||||
else outpLast->next = outp->next;
|
||||
free( outp );
|
||||
@ -276,9 +276,9 @@ int dtm_check_server( pp, fWait )
|
||||
int addcount;
|
||||
|
||||
/* If it is not a logical port is is not listed with the server */
|
||||
|
||||
|
||||
if ( !pp->fLogical ) return DTM_OK;
|
||||
|
||||
|
||||
/* Check for new or first routing list */
|
||||
|
||||
fWait = fWait && (pp->out == NULL);
|
||||
@ -301,11 +301,11 @@ int dtm_check_server( pp, fWait )
|
||||
|
||||
/* Ack the route message */
|
||||
#if 0
|
||||
CHECK_ERR( dtm_nsend_ackroute( portname ));
|
||||
CHECK_ERR( dtm_nsend_ackroute( portname ));
|
||||
#endif
|
||||
|
||||
/* Process the routing message */
|
||||
|
||||
|
||||
{
|
||||
char * msg_type = strtok( mbuf, SEP );
|
||||
if (!strcmp( msg_type, MROUTEID)) {
|
||||
@ -318,7 +318,7 @@ int dtm_check_server( pp, fWait )
|
||||
return addcount;
|
||||
} else if ( !strcmp( msg_type, MDISCARD ) ) {
|
||||
pp->fDiscard = atoi( strtok( NULL, SEP));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -34,17 +34,17 @@
|
||||
*
|
||||
* Revision 1.5 92/04/30 20:27:05 jplevyak
|
||||
* Changed Version to 2.3
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Purpose : Header file for name server interaction
|
||||
Purpose : Header file for name server interaction
|
||||
Notes :
|
||||
|
||||
Message format:
|
||||
Message format:
|
||||
|
||||
Portid - nethostid:portid
|
||||
Portid - nethostid:portid
|
||||
Header - opcode
|
||||
|
||||
DTM to nameserver
|
||||
@ -52,7 +52,7 @@
|
||||
Send message length.
|
||||
|
||||
Mreg - Header refname portname Portid
|
||||
Mackroute - Header refname portname
|
||||
Mackroute - Header refname portname
|
||||
|
||||
Nameserver to DTM
|
||||
|
||||
@ -65,11 +65,11 @@
|
||||
Nethostid is in dotted decimal notation of internet.
|
||||
*/
|
||||
|
||||
#define MREGID "REGISTER"
|
||||
#define MREGID "REGISTER"
|
||||
#define MREG "%s %s %s %s:%d"
|
||||
#define MROUTEID "ROUTE"
|
||||
#define MROUTEID "ROUTE"
|
||||
#define MROUTE "%s %d %d" /* %s:%d %s:%d .... */
|
||||
#define MACKROUTEID "ROUTE_ACK"
|
||||
#define MACKROUTE "%s %s %s"
|
||||
#define MACKROUTEID "ROUTE_ACK"
|
||||
#define MACKROUTE "%s %s %s"
|
||||
#define MDISCARDID "DISCARD"
|
||||
#define MDISCARD "%s %d"
|
||||
|
@ -48,7 +48,7 @@
|
||||
*
|
||||
* Revision 1.8 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.7 1992/03/10 22:07:10 jplevyak
|
||||
* Added changed for PC/MAC from Quincey Koziol (koziol@ncsa.uiuc.edu)
|
||||
* with modification.
|
||||
@ -64,10 +64,10 @@
|
||||
* Added several new errors, changed the DTMerrmsg function to detect
|
||||
* and return 'unknown error:' errors. Generally encorporated the
|
||||
* good features of sherr (from the libtest directory).
|
||||
*
|
||||
*
|
||||
* Revision 1.3 91/06/25 20:13:28 creiman
|
||||
* Removed varargs and dtm_fatal.
|
||||
*
|
||||
*
|
||||
* Revision 1.2 1991/06/11 15:19:57 sreedhar
|
||||
* disclaimer added
|
||||
*
|
||||
@ -133,11 +133,11 @@ char *DTMerrmsg(quiet)
|
||||
int quiet;
|
||||
#endif
|
||||
{
|
||||
char * strUnknown = "unknown error: %d";
|
||||
char * strUnknown = "unknown error: %d";
|
||||
char strOut[60];
|
||||
char * strErr;
|
||||
|
||||
if ( DTMerrno < (sizeof(err_msg)/sizeof(char *)))
|
||||
if ( DTMerrno < (sizeof(err_msg)/sizeof(char *)))
|
||||
strErr = err_msg[(int)DTMerrno];
|
||||
else {
|
||||
sprintf( strOut, strUnknown, DTMerrno);
|
||||
@ -145,7 +145,7 @@ char *DTMerrmsg(quiet)
|
||||
}
|
||||
|
||||
if (!quiet)
|
||||
fprintf(stderr, "\nDTMerrno = %d: %s\n", DTMerrno,
|
||||
fprintf(stderr, "\nDTMerrno = %d: %s\n", DTMerrno,
|
||||
strErr);
|
||||
return strErr;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
/************************************************************************
|
||||
**
|
||||
** mdd.c - Multi-Dimensional Data set routines
|
||||
**
|
||||
**
|
||||
*************************************************************************/
|
||||
|
||||
/*********************************************************************
|
||||
@ -53,7 +53,7 @@
|
||||
*
|
||||
* Revision 1.5 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.4 1992/03/10 22:07:10 jplevyak
|
||||
* Added changed for PC/MAC from Quincey Koziol (koziol@ncsa.uiuc.edu)
|
||||
* with modification.
|
||||
@ -185,7 +185,7 @@ int MDDgetMinMax(h, min, max)
|
||||
|
||||
h = strchr(h, ' ') + 1;
|
||||
*max = (float)atof(h);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
*
|
||||
* Revision 1.4 92/04/30 20:27:05 jplevyak
|
||||
* Changed Version to 2.3
|
||||
*
|
||||
*
|
||||
* Revision 1.3 1992/03/10 22:07:10 jplevyak
|
||||
* Added changed for PC/MAC from Quincey Koziol (koziol@ncsa.uiuc.edu)
|
||||
* with modification.
|
||||
|
@ -47,14 +47,14 @@
|
||||
*
|
||||
* Revision 1.7 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
|
||||
#endif
|
||||
*/
|
||||
/*
|
||||
|
||||
Purpose : Functions to initialise name server address, fd and to
|
||||
to return it.
|
||||
to return it.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -74,10 +74,10 @@
|
||||
|
||||
static struct sockaddr_in nsaddr ; /* name server's address */
|
||||
static int nssockfd = -1 ; /* name server's socket */
|
||||
static char nameserver[ MAX132 ] ;
|
||||
/*
|
||||
static char nameserver[ MAX132 ] ;
|
||||
/*
|
||||
name server address -
|
||||
dotted decimal: port number
|
||||
dotted decimal: port number
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -87,10 +87,10 @@ static char nameserver[ MAX132 ] ;
|
||||
Return values : DTMERROR on error.
|
||||
DTM_OK on success.
|
||||
Notes :
|
||||
Environment variable format :
|
||||
|
||||
Environment variable format :
|
||||
|
||||
DTM_NAMESERVER=nethostid:portid
|
||||
|
||||
|
||||
e.g. DTM_NAMESERVER=141.142.221.66:9900
|
||||
*/
|
||||
#ifdef DTM_PROTOTYPES
|
||||
@ -107,10 +107,10 @@ int dtm_ninit()
|
||||
DTMERR( "dtm_ninit: Env not setup" );
|
||||
return DTMERROR ;
|
||||
}
|
||||
|
||||
|
||||
/* Initialise name server's address, used in send() */
|
||||
|
||||
strncpy( nameserver, p, MAX132 );
|
||||
strncpy( nameserver, p, MAX132 );
|
||||
|
||||
DBGINT( "dtm_ninit: Nameserver is %s\n", nameserver );
|
||||
|
||||
@ -126,11 +126,11 @@ int dtm_ninit()
|
||||
|
||||
*portstr++ = '\0';
|
||||
|
||||
nsaddr.sin_addr.s_addr = inet_addr( p ) ;
|
||||
nsaddr.sin_addr.s_addr = inet_addr( p ) ;
|
||||
nsaddr.sin_port = (unsigned short)atol( portstr ) ;
|
||||
|
||||
DBGMSG1("dtm_ninit: Nethostid = %x\n", ntohl( nsaddr.sin_addr.s_addr) );
|
||||
DBGMSG1("dtm_ninit: Portid = %d\n", ntohs( nsaddr.sin_port) );
|
||||
DBGMSG1("dtm_ninit: Portid = %d\n", ntohs( nsaddr.sin_port) );
|
||||
}
|
||||
|
||||
/* Acquire socket to be used for sending to name server */
|
||||
|
@ -53,7 +53,7 @@
|
||||
*
|
||||
* Revision 1.15 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
|
||||
#endif
|
||||
*/
|
||||
@ -124,7 +124,7 @@ static int dtm_send_control( fd, msg, msize, sendto_addr )
|
||||
sendaddr[ MAX132 - 1 ] = '\0' ;
|
||||
|
||||
sockaddr.sin_family = AF_INET ;
|
||||
CHECK_ERR( dtm_init_sockaddr( &sockaddr, sendaddr, &fLogical));
|
||||
CHECK_ERR( dtm_init_sockaddr( &sockaddr, sendaddr, &fLogical));
|
||||
|
||||
/* Prepare iovec and send message length */
|
||||
|
||||
@ -138,10 +138,10 @@ static int dtm_send_control( fd, msg, msize, sendto_addr )
|
||||
{
|
||||
DBGFLOW( "dtm_send_control: message length send error\n" );
|
||||
return status ;
|
||||
}
|
||||
}
|
||||
|
||||
/* Prepare iovec and send message */
|
||||
|
||||
|
||||
iov[ 0 ].iov_base = msg ;
|
||||
iov[ 0 ].iov_len = msize ;
|
||||
|
||||
@ -168,10 +168,10 @@ int DTMsendDiscard( fd, sendto_addr, set_or_clear )
|
||||
|
||||
sprintf( mbuf, MDISCARD, MROUTEID, set_or_clear );
|
||||
|
||||
DBGFLOW( "DTMsendDiscard: Message:- " );
|
||||
DBGFLOW( "DTMsendDiscard: Message:- " );
|
||||
DBGFLOW( mbuf ); DBGFLOW( "\n" );
|
||||
|
||||
return dtm_send_control( fd, mbuf, (strlen( mbuf ) + 1), sendto_addr );
|
||||
return dtm_send_control( fd, mbuf, (strlen( mbuf ) + 1), sendto_addr );
|
||||
}
|
||||
|
||||
/*
|
||||
@ -193,8 +193,8 @@ int DTMsendDiscard( fd, sendto_addr, set_or_clear )
|
||||
int DTMsendRoute(int fd,char *sendto_addr,int addcount,char **add_addresses,
|
||||
int delcount, char **del_addresses )
|
||||
#else
|
||||
int DTMsendRoute( fd, sendto_addr, addcount, add_addresses,
|
||||
delcount, del_addresses )
|
||||
int DTMsendRoute( fd, sendto_addr, addcount, add_addresses,
|
||||
delcount, del_addresses )
|
||||
int fd; /* output socket */
|
||||
char *sendto_addr; /* destination address addr:port number */
|
||||
int addcount; /* number of addresses to connect to */
|
||||
@ -212,18 +212,18 @@ int DTMsendRoute( fd, sendto_addr, addcount, add_addresses,
|
||||
sprintf( mbuf, MROUTE, MROUTEID, delcount, addcount ) ;
|
||||
while( delcount-- ) {
|
||||
strncat( mbuf, " ", (MAX132-1));
|
||||
strncat( mbuf, del_addresses[ delcount ], (MAX132 - 1));
|
||||
strncat( mbuf, del_addresses[ delcount ], (MAX132 - 1));
|
||||
}
|
||||
while( addcount-- ) {
|
||||
strncat( mbuf, " ", (MAX132-1));
|
||||
strncat( mbuf, add_addresses[ addcount ], (MAX132 - 1));
|
||||
strncat( mbuf, add_addresses[ addcount ], (MAX132 - 1));
|
||||
}
|
||||
mbuf[ MAX132 - 1 ] = '\0' ;
|
||||
mbuf[ MAX132 - 1 ] = '\0' ;
|
||||
|
||||
DBGFLOW( "DTMsendRoute: Message:- " );
|
||||
DBGFLOW( "DTMsendRoute: Message:- " );
|
||||
DBGFLOW( mbuf ); DBGFLOW( "\n" );
|
||||
|
||||
return dtm_send_control( fd, mbuf, (strlen( mbuf ) + 1), sendto_addr );
|
||||
return dtm_send_control( fd, mbuf, (strlen( mbuf ) + 1), sendto_addr );
|
||||
}
|
||||
|
||||
/*
|
||||
@ -254,10 +254,10 @@ int dtm_nsend_ackroute( portname )
|
||||
sprintf( mbuf, MACKROUTE, MACKROUTEID, refname, portname );
|
||||
mbuf[ MAX132 - 1 ] = '\0' ;
|
||||
|
||||
DBGFLOW( "dtm_nsend_ackroute: Message:- " );
|
||||
DBGFLOW( "dtm_nsend_ackroute: Message:- " );
|
||||
DBGFLOW( mbuf ); DBGFLOW( "\n" );
|
||||
|
||||
return dtm_send_control( fd, mbuf, (strlen( mbuf ) + 1), sendto_addr );
|
||||
return dtm_send_control( fd, mbuf, (strlen( mbuf ) + 1), sendto_addr );
|
||||
}
|
||||
|
||||
/*
|
||||
@ -326,7 +326,7 @@ int DTMrecvRegistration(fd, buffer, len)
|
||||
messages and sending routing messages.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifdef DTM_PROTOTYPES
|
||||
int DTMmakeNameServerPort(char *portid)
|
||||
#else
|
||||
@ -335,7 +335,7 @@ int DTMmakeNameServerPort(portid)
|
||||
#endif
|
||||
{
|
||||
struct sockaddr_in saddr;
|
||||
|
||||
|
||||
|
||||
saddr.sin_family = AF_INET;
|
||||
saddr.sin_addr.s_addr = htonl(0);
|
||||
|
@ -47,7 +47,7 @@
|
||||
*
|
||||
* Revision 1.9 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.8 1992/03/10 22:07:10 jplevyak
|
||||
* Added changed for PC/MAC from Quincey Koziol (koziol@ncsa.uiuc.edu)
|
||||
* with modification.
|
||||
@ -57,13 +57,13 @@
|
||||
*
|
||||
* Revision 1.6 92/01/24 19:12:55 dweber
|
||||
* *** empty log message ***
|
||||
*
|
||||
*
|
||||
* Revision 1.5 91/11/04 12:57:55 dweber
|
||||
* Deleted (via comments) superfluous functions. Later to be removed.
|
||||
*
|
||||
*
|
||||
* Revision 1.4 91/09/26 20:26:11 jplevyak
|
||||
* Use dtminit.h for access to internally global functions.
|
||||
*
|
||||
*
|
||||
* Revision 1.3 1991/06/11 15:21:05 sreedhar
|
||||
* disclaimer added
|
||||
*
|
||||
|
16
libdtm/ris.h
16
libdtm/ris.h
@ -34,29 +34,29 @@
|
||||
*
|
||||
* Revision 1.11 92/04/30 20:27:05 jplevyak
|
||||
* Changed Version to 2.3
|
||||
*
|
||||
*
|
||||
* Revision 1.10 1992/02/21 13:48:04 dweber
|
||||
* Fixed prototyping problem in RISgetType.
|
||||
*
|
||||
* Revision 1.9 92/02/18 16:22:04 dweber
|
||||
* Added functions for setting/getting associated palette names.
|
||||
* (RISsetPaletteName and RISgetPaletteName)
|
||||
*
|
||||
*
|
||||
* Revision 1.8 92/01/24 19:12:55 dweber
|
||||
* *** empty log message ***
|
||||
*
|
||||
*
|
||||
* Revision 1.7 91/11/18 11:48:57 dweber
|
||||
* Returned the RISsize definition and changed PALsize to PALelements for same reason
|
||||
*
|
||||
*
|
||||
* Revision 1.6 91/11/04 15:06:08 dweber
|
||||
* Added PAL size commands
|
||||
*
|
||||
*
|
||||
* Revision 1.5 91/11/04 12:58:36 dweber
|
||||
* Added RIS types and removed 8/24 bit distinction from class level.
|
||||
*
|
||||
*
|
||||
* Revision 1.4 91/09/10 15:07:32 jefft
|
||||
* cleaned-up message class macros.
|
||||
*
|
||||
*
|
||||
* Revision 1.3 1991/06/11 15:23:04 sreedhar
|
||||
* disclaimer added
|
||||
*
|
||||
@ -65,7 +65,7 @@
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:38:04 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
@ -69,7 +69,7 @@
|
||||
*
|
||||
* Revision 1.19 92/05/14 19:27:48 jefft
|
||||
* modified dtm_recv_reliable
|
||||
*
|
||||
*
|
||||
* Revision 1.18 1992/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
@ -82,7 +82,7 @@
|
||||
* Revision 1.15 92/03/10 22:07:10 jplevyak
|
||||
* Added changed for PC/MAC from Quincey Koziol (koziol@ncsa.uiuc.edu)
|
||||
* with modification.
|
||||
*
|
||||
*
|
||||
* Revision 1.14 1992/03/02 18:29:41 jplevyak
|
||||
* Fixed bug in EAGAIN handling.
|
||||
*
|
||||
@ -103,7 +103,7 @@
|
||||
*
|
||||
* Revision 1.7 91/08/20 15:56:06 sreedhar
|
||||
* Removed unused functions - dtm_write_buffer, dtm_send, dtm_recv
|
||||
*
|
||||
*
|
||||
* Revision 1.6 1991/08/15 18:56:52 sreedhar
|
||||
* Changes for logical portname version
|
||||
*
|
||||
@ -159,8 +159,8 @@
|
||||
CONTENTS
|
||||
|
||||
|
||||
dtm_read_buffer() - attempts to fill the next dtm buffer.
|
||||
dtm_recv_header() - Function to read header and return size.
|
||||
dtm_read_buffer() - attempts to fill the next dtm buffer.
|
||||
dtm_recv_header() - Function to read header and return size.
|
||||
dtm_recv_ack() - receive message ackowledgement
|
||||
tm_send_ack() - send message acknowledgement
|
||||
dtm_writev_buffer() - sends the buffers to receiving process.
|
||||
@ -200,7 +200,7 @@ static int ready_bytes( d, length )
|
||||
fd_set mask;
|
||||
struct timeval timeout ;
|
||||
|
||||
|
||||
|
||||
/* set the select timeout value */
|
||||
timeout.tv_sec = 2;
|
||||
timeout.tv_usec = 0;
|
||||
@ -235,7 +235,7 @@ static int ready_bytes( d, length )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Reliably read from a port in the face of signals and other
|
||||
@ -288,7 +288,7 @@ int dtm_recv_reliable( d, buffer, length )
|
||||
}
|
||||
|
||||
/*
|
||||
* dtm_read_buffer() - attempts to fill the next dtm buffer. The
|
||||
* dtm_read_buffer() - attempts to fill the next dtm buffer. The
|
||||
* blocklen variable must be set to DTM_NEW_DATASET after each dataset
|
||||
* to force recv_buffer to move the next dataset.
|
||||
*/
|
||||
@ -307,8 +307,8 @@ int dtm_read_buffer(d, blocklen, buffer, length)
|
||||
DBGMSG1("dtm_recv_buffer: attempting to read %d bytes.\n", length);
|
||||
DBGMSG1("dtm_recv_buffer: initial blocklen = %d\n", *blocklen);
|
||||
|
||||
/* if block length is DTM_NEW_DATASET this is a new dataset
|
||||
* get initial block count
|
||||
/* if block length is DTM_NEW_DATASET this is a new dataset
|
||||
* get initial block count
|
||||
*/
|
||||
if (*blocklen == DTM_NEW_DATASET) {
|
||||
CHECK_ERR(dtm_recv_reliable(d, (char *)blocklen, 4));
|
||||
@ -320,8 +320,8 @@ int dtm_read_buffer(d, blocklen, buffer, length)
|
||||
while (TRUE) {
|
||||
|
||||
/* if block length is 0, because last call to fill_buffer hit
|
||||
* the EOS or because this dataset is zero length, return 0
|
||||
* to indicate the end of dataset.
|
||||
* the EOS or because this dataset is zero length, return 0
|
||||
* to indicate the end of dataset.
|
||||
*/
|
||||
if (*blocklen == 0)
|
||||
return 0;
|
||||
@ -335,7 +335,7 @@ int dtm_read_buffer(d, blocklen, buffer, length)
|
||||
|
||||
/* decrement block length, if 0 get next block length */
|
||||
*blocklen -= (length - count);
|
||||
if (*blocklen == 0)
|
||||
if (*blocklen == 0)
|
||||
*blocklen = DTM_NEW_DATASET;
|
||||
|
||||
/* if block length is 0 now, the EOS will be returned on */
|
||||
@ -362,7 +362,7 @@ int dtm_read_buffer(d, blocklen, buffer, length)
|
||||
DBGINT("blocklen = %d\n", *blocklen);
|
||||
|
||||
/* if block length is 0 now, the correct count will be */
|
||||
/* returned now, and EOS on the next call to fill_buffer */
|
||||
/* returned now, and EOS on the next call to fill_buffer */
|
||||
if (*blocklen == 0)
|
||||
return count;
|
||||
|
||||
@ -411,9 +411,9 @@ int dtm_read_header( fd, buf, buflen )
|
||||
|
||||
/*
|
||||
dtm_recv_header()
|
||||
Function to read header and return size.
|
||||
Function to read header and return size.
|
||||
|
||||
Notes : If buffer is too small, dump remainder of header
|
||||
Notes : If buffer is too small, dump remainder of header
|
||||
and return error.
|
||||
Actually, this is function to read length of data and
|
||||
then to receive that much data - the data is called header
|
||||
@ -437,7 +437,7 @@ int dtm_recv_header( d, header, length )
|
||||
DBGMSG1("dtm_recv_header: buf length = %d.\n", length);
|
||||
|
||||
/* get header length */
|
||||
|
||||
|
||||
if( (readcnt = recvfrom(d, (char *)&headerlen, 4, 0, ( struct sockaddr *)&from,
|
||||
( int *)&fromlen)) != 4) {
|
||||
/* somehow hit EOF, return DTMEOF instead */
|
||||
@ -460,19 +460,19 @@ int dtm_recv_header( d, header, length )
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOCALINT(headerlen);
|
||||
DBGMSG("dtm_recv_header: got length.\n");
|
||||
|
||||
/* read the header */
|
||||
/* read the header */
|
||||
|
||||
readcnt = (length > headerlen) ? headerlen : length ;
|
||||
header = (void *) (((char *) header) + readcnt);
|
||||
|
||||
while(readcnt) {
|
||||
if( (tmp = recvfrom(d, ((char *)header) - readcnt, readcnt, 0,
|
||||
( struct sockaddr *)&from, ( int *)&fromlen)) > 0)
|
||||
if( (tmp = recvfrom(d, ((char *)header) - readcnt, readcnt, 0,
|
||||
( struct sockaddr *)&from, ( int *)&fromlen)) > 0)
|
||||
readcnt -= tmp;
|
||||
else {
|
||||
DTMerrno = DTMREAD;
|
||||
@ -480,24 +480,24 @@ int dtm_recv_header( d, header, length )
|
||||
}
|
||||
}
|
||||
|
||||
/* check for header greater than buffer size provided */
|
||||
/* check for header greater than buffer size provided */
|
||||
|
||||
if( length >= headerlen )
|
||||
if( length >= headerlen )
|
||||
return headerlen;
|
||||
else {
|
||||
/* discard remaining header */
|
||||
|
||||
readcnt = headerlen - length;
|
||||
while (readcnt) {
|
||||
if ((tmp = recvfrom(d, dtm_discard, readcnt, 0,
|
||||
(struct sockaddr *)&from, (int *)&fromlen)) > 0)
|
||||
if ((tmp = recvfrom(d, dtm_discard, readcnt, 0,
|
||||
(struct sockaddr *)&from, (int *)&fromlen)) > 0)
|
||||
readcnt -= tmp;
|
||||
else {
|
||||
DTMerrno = DTMREAD;
|
||||
return DTMERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DTMerrno = DTMHEADER;
|
||||
return DTMERROR;
|
||||
}
|
||||
@ -508,7 +508,7 @@ int dtm_recv_header( d, header, length )
|
||||
|
||||
Notes : Berkeley implementation returns 0 from recv
|
||||
if socket connection breaks while waiting in
|
||||
recv system call. System V returns -1 and
|
||||
recv system call. System V returns -1 and
|
||||
ECONNRESET in errno for same error.
|
||||
|
||||
For historical reasons, DTMEOF is returned when
|
||||
@ -532,16 +532,16 @@ int dtm_recv_ack( d, ack )
|
||||
|
||||
if( (tmp = recv( d, (char *)ack, 4, 0 )) != 4 ) {
|
||||
DBGINT( "Recv_ack errno = %d\n", errno ) ;
|
||||
if( tmp == 0 )
|
||||
if( tmp == 0 )
|
||||
/* Courtesy Berkeley */
|
||||
|
||||
DTMerrno = DTMEOF ;
|
||||
else {
|
||||
if( errno == ECONNRESET )
|
||||
if( errno == ECONNRESET )
|
||||
/* Courtesy system V */
|
||||
|
||||
DTMerrno = DTMEOF;
|
||||
else
|
||||
else
|
||||
DTMerrno = DTMREAD;
|
||||
}
|
||||
return DTMERROR;
|
||||
@ -636,7 +636,7 @@ int dtm_writev_failed( fd, msgbuf, tmp )
|
||||
for ( i = 0; i < msgbuf->msg_iovlen; i++ ) {
|
||||
done -= iov[i].iov_len;
|
||||
if ( done > 0 ) continue;
|
||||
if ( dtm_send_some( fd, iov[i].iov_base + done + iov[i].iov_len,
|
||||
if ( dtm_send_some( fd, iov[i].iov_base + done + iov[i].iov_len,
|
||||
(- done )) == DTMERROR )
|
||||
return DTMERROR;
|
||||
done = 0;
|
||||
@ -664,17 +664,17 @@ int dtm_writev_buffer( fd, iov, iovlen, iovsize, addr, addrlen )
|
||||
int todo;
|
||||
|
||||
DBGINT("# dtm_writev_buffer called, fd %d.\n", fd );
|
||||
|
||||
msgbuf.msg_name = (caddr_t)addr ;
|
||||
|
||||
msgbuf.msg_name = (caddr_t)addr ;
|
||||
msgbuf.msg_namelen = addrlen ;
|
||||
msgbuf.msg_iov = iov ;
|
||||
msgbuf.msg_iovlen = iovlen ;
|
||||
msgbuf.msg_accrights = 0 ;
|
||||
|
||||
if( (tmp = sendmsg( fd, &msgbuf, 0 )) != iovsize )
|
||||
if( (tmp = sendmsg( fd, &msgbuf, 0 )) != iovsize )
|
||||
return dtm_writev_failed( fd, &msgbuf, tmp );
|
||||
|
||||
DBGINT( "dtm_writev_buffer tmp = %d\n", tmp );
|
||||
|
||||
|
||||
return DTM_OK ;
|
||||
}
|
||||
|
12
libdtm/sdl.c
12
libdtm/sdl.c
@ -22,7 +22,7 @@
|
||||
/************************************************************************
|
||||
**
|
||||
** sdl.c - Surface Description Language
|
||||
**
|
||||
**
|
||||
*************************************************************************/
|
||||
|
||||
/*
|
||||
@ -43,20 +43,20 @@
|
||||
*
|
||||
* Revision 1.9 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.8 1992/04/06 15:58:56 jplevyak
|
||||
* Fixed levels of indirection on some arguments for non-prototype
|
||||
* machines.
|
||||
*
|
||||
* Revision 1.7 92/04/03 12:39:33 dweber
|
||||
* Fixed SDLbounds bug.
|
||||
*
|
||||
*
|
||||
* Revision 1.6 92/04/03 12:33:10 dweber
|
||||
* Added bounding box functions.
|
||||
*
|
||||
*
|
||||
* Revision 1.5 91/09/10 15:09:00 jefft
|
||||
* I removed all functionality from this file, HA!
|
||||
*
|
||||
*
|
||||
* Revision 1.4 1991/07/18 16:29:15 jefft
|
||||
* corrected the spelling of "primitive"
|
||||
*
|
||||
@ -68,7 +68,7 @@
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:38:33 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
12
libdtm/sdl.h
12
libdtm/sdl.h
@ -22,7 +22,7 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** Surface Description Language include file - contains constants used
|
||||
** with the SDL header type.
|
||||
** with the SDL header type.
|
||||
**
|
||||
**
|
||||
**
|
||||
@ -46,13 +46,13 @@
|
||||
*
|
||||
* Revision 1.13 92/04/30 20:27:05 jplevyak
|
||||
* Changed Version to 2.3
|
||||
*
|
||||
*
|
||||
* Revision 1.12 1992/04/03 12:39:42 dweber
|
||||
* Fixed SDLbounds bug.
|
||||
*
|
||||
* Revision 1.11 92/04/03 12:33:23 dweber
|
||||
* Added bounding box functions.
|
||||
*
|
||||
*
|
||||
* Revision 1.10 1992/02/25 20:36:35 dweber
|
||||
* Fixed another prototyping clash, SDLgetPrimitive.
|
||||
*
|
||||
@ -64,10 +64,10 @@
|
||||
*
|
||||
* Revision 1.7 91/11/01 10:10:28 dweber
|
||||
* Added SDLtristrip
|
||||
*
|
||||
*
|
||||
* Revision 1.6 91/09/10 15:07:55 jefft
|
||||
* cleaned-up message class macros.
|
||||
*
|
||||
*
|
||||
* Revision 1.5 1991/07/25 22:22:27 jefft
|
||||
* Added transformation triplet enum types
|
||||
*
|
||||
@ -83,7 +83,7 @@
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:38:51 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SDL_INC
|
||||
|
16
libdtm/sds.c
16
libdtm/sds.c
@ -22,7 +22,7 @@
|
||||
/************************************************************************
|
||||
**
|
||||
** sds.c - Scientific Data Set utility routines.
|
||||
**
|
||||
**
|
||||
*************************************************************************/
|
||||
/*
|
||||
#ifdef RCSLOG
|
||||
@ -47,7 +47,7 @@
|
||||
*
|
||||
* Revision 1.12 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.11 1992/03/16 20:39:10 creiman
|
||||
* Changed declaration of SDSgetMinMax to match prototype. (Changed doubles
|
||||
* to floats)
|
||||
@ -67,22 +67,22 @@
|
||||
*
|
||||
* Revision 1.7 91/12/18 02:42:41 dweber
|
||||
* Oops. Guess I forgot to change getRanks name.
|
||||
*
|
||||
*
|
||||
* Revision 1.6 1991/12/18 02:41:53 dweber
|
||||
* Added SDSgetRank
|
||||
*
|
||||
* Revision 1.5 91/12/09 12:12:27 dweber
|
||||
* Deleted the function SDSconvert
|
||||
*
|
||||
*
|
||||
* Revision 1.4 91/09/26 20:20:52 jplevyak
|
||||
* Minor header file reorganization.
|
||||
*
|
||||
*
|
||||
* Revision 1.3 91/09/13 18:01:21 jplevyak
|
||||
* Fixed minor bug w/extra argument in call.
|
||||
*
|
||||
*
|
||||
* Revision 1.2 91/06/11 15:20:50 sreedhar
|
||||
* disclaimer added
|
||||
*
|
||||
*
|
||||
* Revision 1.1 1990/11/08 16:39:09 jefft
|
||||
* Initial revision
|
||||
*
|
||||
@ -213,7 +213,7 @@ int SDSgetMinMax(h, min, max)
|
||||
|
||||
h = strchr(h, ' ') + 1;
|
||||
*max = (float)atof(h);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
*
|
||||
* Revision 1.8 92/04/30 20:27:37 jplevyak
|
||||
* Changed Version to 2.3
|
||||
*
|
||||
*
|
||||
* Revision 1.7 1992/03/16 21:03:18 creiman
|
||||
* Changed SDSsetMinMax prototype to use floats. NOT related to the change in
|
||||
* sds.c for SDSgetMinMax. This is getting confusing...
|
||||
@ -55,10 +55,10 @@
|
||||
*
|
||||
* Revision 1.4 92/01/24 19:13:51 dweber
|
||||
* Added header lenght macros
|
||||
*
|
||||
*
|
||||
* Revision 1.3 91/09/10 15:07:10 jefft
|
||||
* cleaned-up message class macros.
|
||||
*
|
||||
*
|
||||
* Revision 1.2 1991/06/11 15:22:52 sreedhar
|
||||
* disclaimer added
|
||||
*
|
||||
@ -97,7 +97,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern void SDSsetDimensions DTM_PROTO(( char* h, int rank, int *dims ));
|
||||
extern int SDSgetDimensions DTM_PROTO(( char* h, int * rank, int* dims,
|
||||
extern int SDSgetDimensions DTM_PROTO(( char* h, int * rank, int* dims,
|
||||
int len ));
|
||||
extern int SDSgetRank DTM_PROTO(( char* h, int * rank ));
|
||||
extern int SDSnumElements DTM_PROTO(( int rank, int *dims ));
|
||||
|
@ -44,7 +44,7 @@
|
||||
*
|
||||
* Revision 1.5 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -52,14 +52,14 @@
|
||||
*
|
||||
* Revision 1.28 92/04/30 20:25:27 jplevyak
|
||||
* Changed Version to 2.3.
|
||||
*
|
||||
*
|
||||
* Revision 1.27 1992/04/06 15:58:49 jplevyak
|
||||
* Fixed minor problems for machines little Endian machines.
|
||||
*
|
||||
* Revision 1.26 92/03/10 22:07:10 jplevyak
|
||||
* Added changed for PC/MAC from Quincey Koziol (koziol@ncsa.uiuc.edu)
|
||||
* with modification.
|
||||
*
|
||||
*
|
||||
* Revision 1.25 1992/02/28 03:40:24 jplevyak
|
||||
* int/long confict fix (no diff on workstations)
|
||||
* ,
|
||||
@ -100,13 +100,13 @@
|
||||
*
|
||||
* Revision 1.14 91/09/26 20:21:55 jplevyak
|
||||
* Cosmetics
|
||||
*
|
||||
*
|
||||
* Revision 1.13 91/09/18 15:33:08 jplevyak
|
||||
* Added additional parameter to dtm_socket_init
|
||||
*
|
||||
*
|
||||
* Revision 1.12 91/09/13 20:28:52 sreedhar
|
||||
* accept :9900 change
|
||||
*
|
||||
*
|
||||
* Revision 1.11 1991/09/13 20:13:35 sreedhar
|
||||
* take current host as default
|
||||
*
|
||||
@ -131,14 +131,14 @@
|
||||
*
|
||||
* Revision 1.3 90/11/21 12:43:15 jefft
|
||||
* Fixed portibility problem with dtm_get_ipaddr.
|
||||
*
|
||||
*
|
||||
* Revision 1.2 90/11/21 10:54:18 jefft
|
||||
* Added new routine, dtm_get_ipaddr. It returns an ascii string of the
|
||||
* current hosts IP address.
|
||||
*
|
||||
*
|
||||
* Revision 1.1 90/11/08 16:39:40 jefft
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -197,7 +197,7 @@ static int buf_size = DTM_BUFF_SIZE;
|
||||
/*
|
||||
dtm_parse_ipaddr()
|
||||
Check whetherer given address string is in dotted
|
||||
decimal notation and if so, to return the address in network byte
|
||||
decimal notation and if so, to return the address in network byte
|
||||
order.
|
||||
|
||||
Return values : TRUE, if in dotted decimal notation.
|
||||
@ -282,9 +282,9 @@ int dtm_select( s, count, time )
|
||||
FD_SET( s, &filedes );
|
||||
|
||||
#ifdef __hpux
|
||||
if( (*count = select( 32, (int *)&filedes, (int *)NULL, (int *)NULL,
|
||||
if( (*count = select( 32, (int *)&filedes, (int *)NULL, (int *)NULL,
|
||||
#else
|
||||
if( (*count = select( 32, &filedes, (fd_set *)NULL, (fd_set *)NULL,
|
||||
if( (*count = select( 32, &filedes, (fd_set *)NULL, (fd_set *)NULL,
|
||||
#endif
|
||||
&timeout ) )) {
|
||||
ioctl( s, FIONREAD, count );
|
||||
@ -312,8 +312,8 @@ int dtm_accept( s, sn, timeout )
|
||||
DBGFLOW( "dtm_accept called.\n");
|
||||
DBGMSG1( "dtm_accept: sockfd = %d\n", s );
|
||||
|
||||
/*
|
||||
Await connect for specified time period only.
|
||||
/*
|
||||
Await connect for specified time period only.
|
||||
|
||||
if timeout == NULL, it means just goahead and accept,
|
||||
else wait for specified period and accept only if
|
||||
@ -321,12 +321,12 @@ int dtm_accept( s, sn, timeout )
|
||||
*/
|
||||
|
||||
if ( timeout ) {
|
||||
fd_set readmask ;
|
||||
fd_set readmask ;
|
||||
fd_set *fchk = &readmask ;
|
||||
int nf ;
|
||||
|
||||
FD_ZERO( fchk );
|
||||
FD_SET( s, fchk );
|
||||
FD_SET( s, fchk );
|
||||
|
||||
#ifdef __hpux
|
||||
nf = select( FD_SETSIZE, (int *)fchk, (int *)0, (int *)0, timeout );
|
||||
@ -337,7 +337,7 @@ int dtm_accept( s, sn, timeout )
|
||||
DBGINT( "dtm_accept: select errno %d\n", errno );
|
||||
DTMerrno = DTMSELECT ;
|
||||
return DTMERROR ;
|
||||
}
|
||||
}
|
||||
|
||||
if ( nf == 0 ) {
|
||||
/* No connect request in specified time */
|
||||
@ -376,9 +376,9 @@ int dtm_connect(sn, s)
|
||||
int refusedcount = 0;
|
||||
|
||||
DBGFLOW("dtm_connect called.\n");
|
||||
DBGINT( "dtm_connect: s_addr = %x\n",
|
||||
DBGINT( "dtm_connect: s_addr = %x\n",
|
||||
ntohl( sn -> sin_addr.s_addr ) );
|
||||
DBGINT( "dtm_connect: sin_port = %d\n",
|
||||
DBGINT( "dtm_connect: sin_port = %d\n",
|
||||
ntohs( sn -> sin_port ));
|
||||
|
||||
while (TRUE) {
|
||||
@ -411,7 +411,7 @@ int dtm_connect(sn, s)
|
||||
/* connect complete, set working socket to original socket */
|
||||
*s = d;
|
||||
setsockopt(*s, IPPROTO_TCP, TCP_NODELAY, (char *)&d, sizeof d);
|
||||
setsockopt(*s, SOL_SOCKET, SO_SNDBUF, (char *)&buf_size,
|
||||
setsockopt(*s, SOL_SOCKET, SO_SNDBUF, (char *)&buf_size,
|
||||
sizeof(int));
|
||||
return DTM_OK;
|
||||
}
|
||||
@ -492,11 +492,11 @@ int dtm_end_connect(s)
|
||||
|
||||
|
||||
/*
|
||||
Return values :
|
||||
Return values :
|
||||
On success,
|
||||
Direct - host address in network byte order.
|
||||
Indirect - *ipaddr has host address in dotted
|
||||
decimal notation.
|
||||
Indirect - *ipaddr has host address in dotted
|
||||
decimal notation.
|
||||
|
||||
On error, 0.
|
||||
Notes:
|
||||
@ -553,7 +553,7 @@ unsigned long dtm_get_ipaddr( ipaddrstr )
|
||||
}
|
||||
|
||||
DBGINT( "dtm_get_ipaddr: dotted decimal address = '%s'\n", ipaddrstr );
|
||||
return inet_addr( ipaddrstr ) ;
|
||||
return inet_addr( ipaddrstr ) ;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -576,17 +576,17 @@ int dtm_socket_init( sockaddr, porttype, fLogicalName )
|
||||
int sockaddrsize = sizeof (struct sockaddr_in);
|
||||
char buf[128];
|
||||
|
||||
DBGMSG1( "dtm_socket_init: sockaddr -> s_addr = %x\n",
|
||||
DBGMSG1( "dtm_socket_init: sockaddr -> s_addr = %x\n",
|
||||
ntohl( sockaddr -> sin_addr.s_addr) );
|
||||
DBGMSG1( "dtm_socket_init: sockaddr -> sin_port = %d\n",
|
||||
DBGMSG1( "dtm_socket_init: sockaddr -> sin_port = %d\n",
|
||||
ntohs( sockaddr -> sin_port) );
|
||||
|
||||
sockaddr -> sin_family = AF_INET ;
|
||||
sockaddr -> sin_family = AF_INET ;
|
||||
if ( fLogicalName ) {
|
||||
/*
|
||||
Logical name had been supplied for makeport.
|
||||
/*
|
||||
Logical name had been supplied for makeport.
|
||||
Assign port from system ( sin_port = 0 ), and accept
|
||||
from all network interfaces for multi-homed host
|
||||
from all network interfaces for multi-homed host
|
||||
( INADDR_ANY ).
|
||||
*/
|
||||
sockaddr -> sin_addr.s_addr = htonl( INADDR_ANY );
|
||||
@ -606,7 +606,7 @@ int dtm_socket_init( sockaddr, porttype, fLogicalName )
|
||||
}
|
||||
|
||||
if( (sockfd = socket( sockaddr -> sin_family, type, protocol )) < 0 ) {
|
||||
DTMerrno = DTMSOCK ;
|
||||
DTMerrno = DTMSOCK ;
|
||||
DBGINT( "dtm_socket_init: socket create error %d", errno );
|
||||
return DTMERROR ;
|
||||
}
|
||||
@ -623,27 +623,27 @@ int dtm_socket_init( sockaddr, porttype, fLogicalName )
|
||||
|
||||
DBGFLOW( "dtm_socket_init: Before bind\n" );
|
||||
DBGINT( "dtm_socket_init: sockfd = %d\n", sockfd );
|
||||
DBGINT( "dtm_socket_init: sockaddr -> family = %d\n",
|
||||
DBGINT( "dtm_socket_init: sockaddr -> family = %d\n",
|
||||
sockaddr -> sin_family );
|
||||
DBGINT( "dtm_socket_init: sockaddr -> s_addr = %x\n",
|
||||
DBGINT( "dtm_socket_init: sockaddr -> s_addr = %x\n",
|
||||
ntohl( sockaddr -> sin_addr.s_addr) );
|
||||
DBGINT( "dtm_socket_init: sockaddr -> sin_port = %d\n",
|
||||
DBGINT( "dtm_socket_init: sockaddr -> sin_port = %d\n",
|
||||
ntohs( sockaddr -> sin_port) );
|
||||
|
||||
if( bind( sockfd, (struct sockaddr *)sockaddr,
|
||||
if( bind( sockfd, (struct sockaddr *)sockaddr,
|
||||
sizeof( struct sockaddr_in ) ) < 0 ) {
|
||||
DTMerrno = DTMSOCK ;
|
||||
DBGMSG1( "dtm_socket_init: could not bind to sockaddr, errno = %d\n",
|
||||
DBGMSG1( "dtm_socket_init: could not bind to sockaddr, errno = %d\n",
|
||||
errno );
|
||||
return DTMERROR;
|
||||
}
|
||||
|
||||
/* Listen at socket for TCP port, buffer for 5 pending connections */
|
||||
|
||||
if( porttype == INPORTTYPE )
|
||||
if( porttype == INPORTTYPE )
|
||||
listen( sockfd, 5 );
|
||||
|
||||
/*
|
||||
/*
|
||||
Get the actual assigned (port) address ( netid/hostid/portid )
|
||||
- netid/hostid from dtm_get_ipaddr(),portid from getsockname().
|
||||
|
||||
@ -667,9 +667,9 @@ int dtm_socket_init( sockaddr, porttype, fLogicalName )
|
||||
}
|
||||
|
||||
DBGFLOW( "dtm_socket_init: Verify nethostid/portid\n" );
|
||||
DBGINT( "dtm_socket_init: Nethostid = %x\n",
|
||||
ntohl( sockaddr -> sin_addr.s_addr ) );
|
||||
DBGINT( "dtm_socket_init: Portid = %d \n",
|
||||
DBGINT( "dtm_socket_init: Nethostid = %x\n",
|
||||
ntohl( sockaddr -> sin_addr.s_addr ) );
|
||||
DBGINT( "dtm_socket_init: Portid = %d \n",
|
||||
ntohs( sockaddr -> sin_port ) );
|
||||
|
||||
DBGINT( "dtm_socket_init: exit sockfd = %d\n", sockfd );
|
||||
@ -719,7 +719,7 @@ int dtm_init_sockaddr( sockaddr, portname, pfLogicalName )
|
||||
DBGFLOW( "dtm_init_sockaddr called\n" );
|
||||
|
||||
if( lportname[0] == ':' ) {
|
||||
host = NULL ;
|
||||
host = NULL ;
|
||||
port = lportname + 1;
|
||||
} else {
|
||||
if( (port = strchr( lportname, ':' )) == NULL ) {
|
||||
@ -728,7 +728,7 @@ int dtm_init_sockaddr( sockaddr, portname, pfLogicalName )
|
||||
sockaddr -> sin_port = htons( 0 );
|
||||
sockaddr -> sin_addr.s_addr = htonl(0);
|
||||
*pfLogicalName = TRUE;
|
||||
DBGINT( "dtm_init_sockaddr: sin_port = %d\n",
|
||||
DBGINT( "dtm_init_sockaddr: sin_port = %d\n",
|
||||
ntohs( sockaddr->sin_port ));
|
||||
return DTM_OK;
|
||||
}
|
||||
@ -737,15 +737,15 @@ int dtm_init_sockaddr( sockaddr, portname, pfLogicalName )
|
||||
}
|
||||
*pfLogicalName = FALSE;
|
||||
|
||||
/*
|
||||
Physical format - hostname is either in dotted decimal
|
||||
/*
|
||||
Physical format - hostname is either in dotted decimal
|
||||
notation ( call ipaddr() ) or direct or missing.
|
||||
*/
|
||||
|
||||
if( host == NULL ) {
|
||||
gethostname( hostname, sizeof hostname );
|
||||
host = hostname ;
|
||||
}
|
||||
}
|
||||
DBGINT( "dtm_init_sockaddr: host %s\n", host );
|
||||
DBGINT( "dtm_init_sockaddr: port %s\n", port );
|
||||
|
||||
@ -768,7 +768,7 @@ int dtm_init_sockaddr( sockaddr, portname, pfLogicalName )
|
||||
/* Fill in port id */
|
||||
sockaddr -> sin_port = htons((unsigned short)atol( port ));
|
||||
|
||||
DBGINT( "dtm_init_sockaddr: nethostid = %x\n",
|
||||
DBGINT( "dtm_init_sockaddr: nethostid = %x\n",
|
||||
ntohl( sockaddr -> sin_addr.s_addr ));
|
||||
DBGINT( "dtm_init_sockaddr: portid = %d\n", ntohs( sockaddr -> sin_port) );
|
||||
|
||||
|
@ -17,11 +17,11 @@
|
||||
#define SRV_FUNC_LOCK_REQUEST 7
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
*
|
||||
* for a connect message:
|
||||
* SRVclass SRVid SRV_FUNC_CONNECT SRVInPort SRVVString SRVnumber
|
||||
* for a disconnect message:
|
||||
* SRVclass SRVid SRV_FUNC_DISCONNECT SRVInPort
|
||||
* SRVclass SRVid SRV_FUNC_DISCONNECT SRVInPort
|
||||
* for a lock:
|
||||
* SRVclass SRVid SRV_FUNC_LOCK SRVLock
|
||||
* for a lock:
|
||||
@ -31,7 +31,7 @@
|
||||
* for a user leaving:
|
||||
* SRVclass SRVid SRV_FUNC_REMOVE_USER SRVInPort
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* SRVsetClass(char *header,char *title) */
|
||||
/* SRVcompareClass(char *header,char *title, int maxTitleLength) */
|
||||
|
@ -47,7 +47,7 @@
|
||||
/* TXTsetReplaceAll(char *header) */
|
||||
/* Boolean TXTshouldReplaceAll(char *header,int garbage) */
|
||||
#define TXTsetReplaceAll(h) dtm_set_int(h,TXTra,1)
|
||||
#define TXTshouldReplaceAll(h,i) (dtm_get_int(h,TXTra,&(i)) == -1)?0:1
|
||||
#define TXTshouldReplaceAll(h,i) (dtm_get_int(h,TXTra,&(i)) == -1)?0:1
|
||||
|
||||
/* TXTsetDimension(char *header,int numBytes) */
|
||||
/* TXTgetDimension(char *header,int &numBytes) */
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
/*********************************************************************
|
||||
**
|
||||
* $Header: /X11/mosaic/cvsroot/xmosaic3/libdtm/uio.h,v 1.3 1995/01/12 02:33:40 spowers Exp $
|
||||
* $Header: /X11/mosaic/cvsroot/xmosaic3/libdtm/uio.h,v 1.3 1995/01/12 02:33:40 spowers Exp $
|
||||
**
|
||||
**********************************************************************/
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
*
|
||||
* Revision 1.2 92/04/30 20:27:37 jplevyak
|
||||
* Changed Version to 2.3
|
||||
*
|
||||
*
|
||||
* Revision 1.1 1992/03/06 22:51:22 jplevyak
|
||||
* Initial revision
|
||||
*
|
||||
|
@ -298,7 +298,7 @@ int size;
|
||||
}
|
||||
else if (c1 & 0x60) { /* denormalized value */
|
||||
register int shft;
|
||||
|
||||
|
||||
shft = (c1 & 0x40) ? 1 : 2; /* shift needed to normalize */
|
||||
/* shift mantissa */
|
||||
/* note last bit of exp set to 1 implicitly */
|
||||
@ -533,7 +533,7 @@ int size;
|
||||
}
|
||||
else if (c1 & 0x0c) { /* denormalized value */
|
||||
register int shft;
|
||||
|
||||
|
||||
shft = (c1 & 0x08) ? 1 : 2; /* shift needed to normalize */
|
||||
/* shift mantissa */
|
||||
/* note last bit of exp set to 1 implicitly */
|
||||
|
12
libdtm/x.c
12
libdtm/x.c
@ -43,7 +43,7 @@
|
||||
*
|
||||
* Revision 1.4 92/05/05 22:27:50 jplevyak
|
||||
* Corrected X interface code.
|
||||
*
|
||||
*
|
||||
* Revision 1.3 1992/05/04 22:05:55 jplevyak
|
||||
* Declare DTMaddInput external
|
||||
*
|
||||
@ -121,12 +121,12 @@ void dtm_handle_new_out( client_data, fd, id )
|
||||
automatically handled.
|
||||
*/
|
||||
#ifdef DTM_PROTOTYPES
|
||||
int DTMaddInput( int p_ext, caddr_t condition,
|
||||
int DTMaddInput( int p_ext, caddr_t condition,
|
||||
XtInputCallbackProc proc, caddr_t client_data )
|
||||
#else
|
||||
int DTMaddInput( p_ext, condition, proc, client_data )
|
||||
int p_ext;
|
||||
caddr_t condition;
|
||||
caddr_t condition;
|
||||
XtInputCallbackProc proc;
|
||||
caddr_t client_data;
|
||||
#endif
|
||||
@ -148,14 +148,14 @@ int DTMaddInput( p_ext, condition, proc, client_data )
|
||||
/*
|
||||
Set up callback for new connections
|
||||
*/
|
||||
XtAddInput( pp->sockfd, XtInputReadMask, dtm_handle_new_in,
|
||||
XtAddInput( pp->sockfd, XtInputReadMask, dtm_handle_new_in,
|
||||
(caddr_t) p );
|
||||
FOR_EACH_IN_PORT( inp, pp ) {
|
||||
inp->XinputId = XtAddInput( inp->fd, XtInputReadMask,
|
||||
inp->XinputId = XtAddInput( inp->fd, XtInputReadMask,
|
||||
dtm_handle_in, (caddr_t) p );
|
||||
}
|
||||
} else {
|
||||
XtAddInput( pp->sockfd, XtInputReadMask, dtm_handle_new_out,
|
||||
XtAddInput( pp->sockfd, XtInputReadMask, dtm_handle_new_out,
|
||||
(caddr_t) p );
|
||||
}
|
||||
return DTM_OK;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
/*
|
||||
* A minimalistic constraint widget
|
||||
*
|
||||
* Sun Sep 12 20:03:49 GMT 1993 Gustaf Neumann
|
||||
* Sun Sep 12 20:03:49 GMT 1993 Gustaf Neumann
|
||||
*/
|
||||
#include "../config.h"
|
||||
#ifndef MOTIF
|
||||
@ -70,7 +70,7 @@ DrawingAreaClassRec drawingAreaClassRec = {
|
||||
{ /* constraint_class fields */
|
||||
/* subresourses */ NULL,
|
||||
/* subresource_count */ 0,
|
||||
/* constraint_size */ 0,
|
||||
/* constraint_size */ 0,
|
||||
/* initialize */ NULL, /*ConstraintInitialize,*/
|
||||
/* destroy */ NULL,
|
||||
/* set_values */ NULL, /*ConstraintSetValues,*/
|
||||
@ -157,9 +157,9 @@ static Boolean ConstraintSetValues(current, request, new, args, num_args)
|
||||
Cardinal *num_args;
|
||||
{
|
||||
/*
|
||||
register DrawingAreaConstraints cfc =
|
||||
register DrawingAreaConstraints cfc =
|
||||
(DrawingAreaConstraints) current->core.constraints;
|
||||
register DrawingAreaConstraints nfc =
|
||||
register DrawingAreaConstraints nfc =
|
||||
(DrawingAreaConstraints) new->core.constraints;
|
||||
*/
|
||||
return( FALSE );
|
||||
@ -184,7 +184,7 @@ static XtGeometryResult PreferredGeometry( widget, request, reply )
|
||||
{
|
||||
/*
|
||||
DrawingAreaWidget w = (DrawingAreaWidget)widget;
|
||||
*/
|
||||
*/
|
||||
return XtGeometryNo;
|
||||
}
|
||||
|
||||
|
@ -31,5 +31,5 @@ typedef struct _DrawingAreaClassRec *DrawingAreaWidgetClass;
|
||||
typedef struct _DrawingAreaRec *DrawingAreaWidget;
|
||||
|
||||
extern WidgetClass drawingAreaWidgetClass;
|
||||
|
||||
|
||||
#endif /* _XawDrawingArea_h */
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Purpose: to parse Hypertext widget contents into appropriate PostScript
|
||||
*
|
||||
* Author: Ameet A. Raval & Frans van Hoesel & Andrew Ford
|
||||
* (aar@gfdl.gov & hoesel@chem.rug.nl).
|
||||
* (aar@gfdl.gov & hoesel@chem.rug.nl).
|
||||
* send bugreports to hoesel@chem.rug.nl
|
||||
*
|
||||
* Institution: for Ameet A. Raval:
|
||||
@ -24,7 +24,7 @@
|
||||
* Montpelier, Bristol, BS6 5HR, GB
|
||||
* E-mail: andrew@icarus.demon.co.uk
|
||||
*
|
||||
* Date: 1 aug 1993
|
||||
* Date: 1 aug 1993
|
||||
* Modification: 8 nov 1993
|
||||
* o added support for bold/italics courier
|
||||
* o removed unused or no longer needed stuff
|
||||
@ -49,8 +49,8 @@
|
||||
* WE MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR
|
||||
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
|
||||
* WARRANTY. WE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE
|
||||
* USERS OF THIS SOFTWARE.
|
||||
*
|
||||
* USERS OF THIS SOFTWARE.
|
||||
*
|
||||
* pieces of code are taken from xvps by kind
|
||||
* permission of John Bradley.
|
||||
*
|
||||
@ -121,7 +121,7 @@ extern int SwapElements();
|
||||
PSprintf("%s\n", txt[i]) ; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/* STREQ tests whether two strings are equal. */
|
||||
#define STREQ(a, b) (strcmp((a), (b)) == 0)
|
||||
|
||||
@ -165,7 +165,7 @@ PAGE_DIMENS_T;
|
||||
PAGE_DIMENS_T page_dimens;
|
||||
PAGE_DIMENS_T a4_page_dimens = {
|
||||
297 * MM,
|
||||
210 * MM,
|
||||
210 * MM,
|
||||
20 * MM,
|
||||
20 * MM,
|
||||
20 * MM,
|
||||
@ -201,7 +201,7 @@ extern Colormap installed_cmap;
|
||||
* screen
|
||||
*
|
||||
*/
|
||||
static float
|
||||
static float
|
||||
GetDpi(HTMLWidget hw)
|
||||
{
|
||||
Screen *s = XtScreen(hw);
|
||||
@ -228,17 +228,17 @@ GetDpi(HTMLWidget hw)
|
||||
* in this call, otherwise it returns EOF (just as printf does)
|
||||
*
|
||||
*/
|
||||
static int
|
||||
static int
|
||||
PSprintf(char *format, ...)
|
||||
{
|
||||
int len;
|
||||
char *s;
|
||||
va_list args;
|
||||
|
||||
if (PS_size - PS_len < 1024)
|
||||
if (PS_size - PS_len < 1024)
|
||||
{
|
||||
PS_size += 1024;
|
||||
if ((s = (char *) realloc(PS_string, PS_size)) == NULL)
|
||||
if ((s = (char *) realloc(PS_string, PS_size)) == NULL)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (htmlwTrace) {
|
||||
@ -254,7 +254,7 @@ PSprintf(char *format, ...)
|
||||
/* this is a hack to make it work on systems were vsprintf(s,...)
|
||||
* returns s, instead of the len.
|
||||
*/
|
||||
if (len != EOF && len != 0)
|
||||
if (len != EOF && len != 0)
|
||||
PS_len += strlen(PS_string+PS_len);
|
||||
va_end(args);
|
||||
return(len);
|
||||
@ -270,13 +270,13 @@ PSprintf(char *format, ...)
|
||||
* PSprintf).
|
||||
*
|
||||
*/
|
||||
static int
|
||||
static int
|
||||
PShex(unsigned char val, int flush)
|
||||
{
|
||||
static unsigned char hexline[80];
|
||||
static char digit[] = "0123456789abcdef";
|
||||
|
||||
if (!flush)
|
||||
if (!flush)
|
||||
{
|
||||
hexline[PS_hexi++] = (char) digit[((unsigned) val >>
|
||||
(unsigned) 4) & (unsigned) 0x0f];
|
||||
@ -287,7 +287,7 @@ PShex(unsigned char val, int flush)
|
||||
/* Changed from ">78" to ">77" on advice of
|
||||
debra@info.win.tue.nl (Paul De Bra). */
|
||||
|
||||
if ((flush && PS_hexi) || (PS_hexi>77))
|
||||
if ((flush && PS_hexi) || (PS_hexi>77))
|
||||
{
|
||||
hexline[PS_hexi] = '\0';
|
||||
PS_hexi=0;
|
||||
@ -306,13 +306,13 @@ PShex(unsigned char val, int flush)
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
{
|
||||
PS_fontstyle fn;
|
||||
int style, size;
|
||||
int fs;
|
||||
|
||||
static PS_fontstyle fontstyle[17] =
|
||||
static PS_fontstyle fontstyle[17] =
|
||||
{
|
||||
RF, IF, BF, FF, BF, BF, BF, BF, BF,
|
||||
BF, IF, FF, FF, FB, FI, FB, FI
|
||||
@ -323,7 +323,7 @@ PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
/* fontsizes as set in gui.c and in HTML.c (listing font is only
|
||||
* defined in HTML.c)
|
||||
*/
|
||||
static int fontsizes[4][3][17] =
|
||||
static int fontsizes[4][3][17] =
|
||||
{
|
||||
/* times font sizes */
|
||||
{
|
||||
@ -351,7 +351,7 @@ PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
}
|
||||
};
|
||||
|
||||
/* next is for each fontfamily the ascent value as given by the
|
||||
/* next is for each fontfamily the ascent value as given by the
|
||||
* medium sized bold x-font (the regular font has the same
|
||||
* ascent value for both the medium and the large size Century
|
||||
* font).
|
||||
@ -446,12 +446,12 @@ PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
|
||||
/* check size, by looking at the size of the regular font */
|
||||
size = 1;
|
||||
if (hw->html.bold_font->ascent > medium_fontascent[fontfamily])
|
||||
if (hw->html.bold_font->ascent > medium_fontascent[fontfamily])
|
||||
{
|
||||
/* large font */
|
||||
size = 2;
|
||||
}
|
||||
else if (hw->html.bold_font->ascent < medium_fontascent[fontfamily])
|
||||
else if (hw->html.bold_font->ascent < medium_fontascent[fontfamily])
|
||||
{
|
||||
/* small font */
|
||||
size = 0;
|
||||
@ -460,7 +460,7 @@ PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
fs = fontsizes[fontfamily][size][style];
|
||||
PS_fontascent = fontascent[fontfamily][size][style];
|
||||
|
||||
if (fn != PS_oldfn || fs != PS_oldfs)
|
||||
if (fn != PS_oldfn || fs != PS_oldfs)
|
||||
{
|
||||
PSprintf( "%2s %d SF\n", fnchar[fn], fs);
|
||||
PS_oldfn=fn, PS_oldfs=fs;
|
||||
@ -475,26 +475,26 @@ PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
* Any accumulated footnotes are output and the outstanding footnote count
|
||||
* reset to zero. Footnotes are preceded by a footnote rule and each footnote
|
||||
* is consists of a raised mark and the footnote text (i.e. the url). The mark
|
||||
* is in a smaller font than the text. The ideas are filched from LaTeX.
|
||||
* is in a smaller font than the text. The ideas are filched from LaTeX.
|
||||
*/
|
||||
static void
|
||||
PSshowpage(void)
|
||||
{
|
||||
PSprintf("restore\n");
|
||||
if (n_saved_ftns > 0)
|
||||
if (n_saved_ftns > 0)
|
||||
{
|
||||
int i;
|
||||
|
||||
PSprintf("gsave 0.2 setlinewidth newpath %.2f %.2f M %.2f 0 RL stroke\n",
|
||||
PSprintf("gsave 0.2 setlinewidth newpath %.2f %.2f M %.2f 0 RL stroke\n",
|
||||
page_dimens.left_margin,
|
||||
(page_dimens.bot_margin + (footnote_ptsize * n_saved_ftns) + 4),
|
||||
(page_dimens.text_width * 0.4));
|
||||
for (i = 0; n_saved_ftns; n_saved_ftns--, i++)
|
||||
for (i = 0; n_saved_ftns; n_saved_ftns--, i++)
|
||||
{
|
||||
PSprintf("newpath %.2f %.2f M RF %.2f SF (%d) S 3 -2 R RF %d SF (%s) S\n",
|
||||
PSprintf("newpath %.2f %.2f M RF %.2f SF (%d) S 3 -2 R RF %d SF (%s) S\n",
|
||||
page_dimens.left_margin,
|
||||
page_dimens.bot_margin + 5 + (n_saved_ftns - 1) * footnote_ptsize,
|
||||
(0.7 * footnote_ptsize), cur_ftn_no - n_saved_ftns,
|
||||
(0.7 * footnote_ptsize), cur_ftn_no - n_saved_ftns,
|
||||
footnote_ptsize, footnotes[i]);
|
||||
}
|
||||
PSprintf("grestore\n");
|
||||
@ -512,10 +512,10 @@ PSshowpage(void)
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PSnewpage(void)
|
||||
PSnewpage(void)
|
||||
{
|
||||
PS_curr_page++;
|
||||
|
||||
|
||||
/* the PostScript reference Manual states that the Page: Tag
|
||||
should have a label and a ordinal; otherwise programs like
|
||||
psutils fail -gustaf */
|
||||
@ -534,7 +534,7 @@ PSnewpage(void)
|
||||
* PSinit_latin1 - handle ISO encoding
|
||||
*
|
||||
* print out initializing PostScript text for ISO Latin1 font encoding
|
||||
* This code is copied from the Idraw program (from Stanford's InterViews
|
||||
* This code is copied from the Idraw program (from Stanford's InterViews
|
||||
* package), courtesy of Steinar Kjaernsr|d, steinar@ifi.uio.no
|
||||
*
|
||||
*/
|
||||
@ -595,7 +595,7 @@ PSinit_latin1(void)
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PSinit(void)
|
||||
PSinit(void)
|
||||
{
|
||||
PS_size = PS_len = PS_offset = PS_hexi = PS_page_offset = 0;
|
||||
PS_start_y = 0;
|
||||
@ -637,8 +637,8 @@ PSinit(void)
|
||||
* title title of document
|
||||
* date date modified/printed
|
||||
*/
|
||||
static void
|
||||
PSheader(char *title, int font, char *url, char *time_str)
|
||||
static void
|
||||
PSheader(char *title, int font, char *url, char *time_str)
|
||||
{
|
||||
static char *notitle="Untitled";
|
||||
int set_to_null=0;
|
||||
@ -680,7 +680,7 @@ PSheader(char *title, int font, char *url, char *time_str)
|
||||
time_t clock = time(NULL);
|
||||
|
||||
#if !defined(VMS) || defined (__DECC)
|
||||
strftime(time_buf, sizeof(time_buf),
|
||||
strftime(time_buf, sizeof(time_buf),
|
||||
"Printed %a %b %e %T %Y", localtime(&clock));
|
||||
#else
|
||||
sprintf(time_buf,"Printed %s",asctime(localtime(&clock)));
|
||||
@ -732,16 +732,16 @@ PSheader(char *title, int font, char *url, char *time_str)
|
||||
PSprintf("/title (%s) D\n", title);
|
||||
PSprintf("/date (%s) D\n", time_str);
|
||||
PSconst_out(txt);
|
||||
|
||||
|
||||
/* Output the newpage definition. */
|
||||
|
||||
|
||||
PSprintf("/NP {");
|
||||
if (HTML_Print_Headers)
|
||||
if (HTML_Print_Headers)
|
||||
{
|
||||
PSprintf("gsave 0.4 setlinewidth\n");
|
||||
PSprintf(" newpath %.2f %.2f M %.2f 0 RL stroke",
|
||||
PSprintf(" newpath %.2f %.2f M %.2f 0 RL stroke",
|
||||
page_dimens.left_margin,
|
||||
(page_dimens.bot_margin + page_dimens.text_height),
|
||||
(page_dimens.bot_margin + page_dimens.text_height),
|
||||
page_dimens.text_width);
|
||||
PSprintf(" newpath %.2f %.2f M %.2f 0 RL stroke\n",
|
||||
page_dimens.left_margin, page_dimens.bot_margin,
|
||||
@ -751,7 +751,7 @@ PSheader(char *title, int font, char *url, char *time_str)
|
||||
(page_dimens.bot_margin + page_dimens.text_height + 6), title);
|
||||
PSprintf(" nstr cvs dup stringwidth pop pgno stringwidth pop add\n");
|
||||
PSprintf(" %.2f E sub %.2f M pgno S S\n",
|
||||
(page_dimens.left_margin + page_dimens.text_width),
|
||||
(page_dimens.left_margin + page_dimens.text_width),
|
||||
(page_dimens.bot_margin + page_dimens.text_height + 6));
|
||||
PSprintf(" BF 10 SF %.2f %.2f M (%s) S\n",
|
||||
page_dimens.left_margin, page_dimens.bot_margin - 12, url);
|
||||
@ -760,11 +760,11 @@ PSheader(char *title, int font, char *url, char *time_str)
|
||||
page_dimens.bot_margin - 12);
|
||||
}
|
||||
PSprintf(" %.2f %.2f translate %.5f %.5f scale } D\n",
|
||||
page_dimens.left_margin,
|
||||
page_dimens.left_margin,
|
||||
page_dimens.bot_margin + page_dimens.text_height,
|
||||
Points_Pixel, Points_Pixel);
|
||||
PSinit_latin1();
|
||||
|
||||
|
||||
PSprintf("%%%%EndProlog\n");
|
||||
|
||||
if (set_to_null) {
|
||||
@ -802,9 +802,9 @@ PStrailer(void)
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PSmoveto(int x, int y)
|
||||
PSmoveto(int x, int y)
|
||||
{
|
||||
if (y > PS_start_y + Pixels_Page)
|
||||
if (y > PS_start_y + Pixels_Page)
|
||||
{
|
||||
PS_start_y = y;
|
||||
PSshowpage();
|
||||
@ -824,7 +824,7 @@ PSmoveto(int x, int y)
|
||||
static void
|
||||
PSmove_offset(int offset)
|
||||
{
|
||||
if (offset != PS_offset)
|
||||
if (offset != PS_offset)
|
||||
{
|
||||
PSprintf("0 %d R\n", PS_offset - offset );
|
||||
PS_offset = offset;
|
||||
@ -836,12 +836,12 @@ PSmove_offset(int offset)
|
||||
* Return an indication of whether or not the current element has a footnote.
|
||||
*
|
||||
* an element has a footnote if it is text or an image and its anchorHRef is not null.
|
||||
* If the element is a textual element with an anchorHRef, that has been split across
|
||||
* If the element is a textual element with an anchorHRef, that has been split across
|
||||
* lines then it should be followed by a linefeed element and a text element with the
|
||||
* same anchorHRef. In this case say that the element doesn't have a footnote so as
|
||||
* to avoid duplicate footnotes.
|
||||
*/
|
||||
static int
|
||||
static int
|
||||
has_footnote(struct ele_rec *el)
|
||||
{
|
||||
int rc = 0;
|
||||
@ -904,10 +904,10 @@ has_footnote(struct ele_rec *el)
|
||||
static void
|
||||
PSfootnote(char *href, double height)
|
||||
{
|
||||
PSprintf("gsave 0 %.2f R RF %d SF (%d) S grestore\n",
|
||||
PSprintf("gsave 0 %.2f R RF %d SF (%d) S grestore\n",
|
||||
height, footnote_ptsize, cur_ftn_no++);
|
||||
|
||||
if (n_saved_ftns == ftn_array_size)
|
||||
if (n_saved_ftns == ftn_array_size)
|
||||
{
|
||||
ftn_array_size += 16;
|
||||
if (!footnotes) {
|
||||
@ -917,7 +917,7 @@ PSfootnote(char *href, double height)
|
||||
footnotes = (char **)realloc((void *)footnotes,
|
||||
(ftn_array_size * sizeof(char *)));
|
||||
}
|
||||
if (footnotes == NULL)
|
||||
if (footnotes == NULL)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (htmlwTrace) {
|
||||
@ -948,9 +948,9 @@ PStext(HTMLWidget hw, struct ele_rec *eptr, int fontfamily, String s)
|
||||
unsigned char ch;
|
||||
int underline = eptr->underline_number;
|
||||
int ascent;
|
||||
|
||||
|
||||
PSfont(hw, eptr->font, fontfamily); /* set font */
|
||||
if (PS_fontascent == 0)
|
||||
if (PS_fontascent == 0)
|
||||
ascent = eptr->font->ascent;
|
||||
else
|
||||
ascent = PS_fontascent;
|
||||
@ -961,7 +961,7 @@ PStext(HTMLWidget hw, struct ele_rec *eptr, int fontfamily, String s)
|
||||
every character stored as an octal escape (worst case scenario). */
|
||||
|
||||
s2 = (String) malloc(strlen(s) * 4 + 1);
|
||||
if (s2 == NULL)
|
||||
if (s2 == NULL)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (htmlwTrace) {
|
||||
@ -982,14 +982,14 @@ PStext(HTMLWidget hw, struct ele_rec *eptr, int fontfamily, String s)
|
||||
*stmp++ = B_SLASH;
|
||||
*stmp++ = ch;
|
||||
}
|
||||
else if (ch > (unsigned char) MAX_ASCII)
|
||||
else if (ch > (unsigned char) MAX_ASCII)
|
||||
{
|
||||
/* convert to octal */
|
||||
*stmp++ = B_SLASH;
|
||||
*stmp++ = ((ch >> 6) & 007) + '0';
|
||||
*stmp++ = ((ch >> 3) & 007) + '0';
|
||||
*stmp++ = (ch & 007) + '0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*stmp++ = ch;
|
||||
@ -997,7 +997,7 @@ PStext(HTMLWidget hw, struct ele_rec *eptr, int fontfamily, String s)
|
||||
}
|
||||
*(stmp) = '\0';
|
||||
PSprintf("(%s)%c\n", s2, (underline)?'U':'S');
|
||||
if (HTML_Print_Footers && has_footnote(eptr))
|
||||
if (HTML_Print_Footers && has_footnote(eptr))
|
||||
{
|
||||
PSfootnote(eptr->anchorHRef, 0.7 * ascent);
|
||||
}
|
||||
@ -1012,10 +1012,10 @@ PStext(HTMLWidget hw, struct ele_rec *eptr, int fontfamily, String s)
|
||||
* of two. The size of the higher level bullets is just somewhat smaller
|
||||
*
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
PSbullet(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
{
|
||||
int width = ( eptr->font->max_bounds.lbearing
|
||||
int width = ( eptr->font->max_bounds.lbearing
|
||||
+ eptr->font->max_bounds.rbearing);
|
||||
int offset = eptr->y_offset + eptr->font->ascent;
|
||||
int level = eptr->indent_level;
|
||||
@ -1123,7 +1123,7 @@ PSwidget(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
* does the run-length encoding. This is done to reduce the file size and
|
||||
* therefore the time to send the file to the printer. You get longer
|
||||
* processing time instead.
|
||||
*
|
||||
*
|
||||
* rle is encoded as such:
|
||||
* <count> <value> # 'run' of count+1 equal pixels
|
||||
* <count | 0x80> <count+1 data bytes> # count+1 non-equal pixels
|
||||
@ -1131,18 +1131,18 @@ PSwidget(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
*
|
||||
* returns length of the rleline vector
|
||||
*
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
PSrle_encode(unsigned char *scanline,
|
||||
PSrle_encode(unsigned char *scanline,
|
||||
unsigned char *rleline,
|
||||
int wide)
|
||||
int wide)
|
||||
{
|
||||
int i, j, blocklen, isrun, rlen;
|
||||
unsigned char block[256], pix;
|
||||
|
||||
blocklen = isrun = rlen = 0;
|
||||
|
||||
for (i = 0; i < wide; i++)
|
||||
for (i = 0; i < wide; i++)
|
||||
{
|
||||
/* there are 5 possible states:
|
||||
* 0: block empty.
|
||||
@ -1154,23 +1154,23 @@ PSrle_encode(unsigned char *scanline,
|
||||
|
||||
pix = scanline[i];
|
||||
|
||||
if (!blocklen)
|
||||
if (!blocklen)
|
||||
{
|
||||
/* case 0: empty */
|
||||
block[blocklen++] = pix;
|
||||
isrun = 1;
|
||||
}
|
||||
else if (isrun)
|
||||
else if (isrun)
|
||||
{
|
||||
if (pix == block[blocklen-1])
|
||||
{
|
||||
{
|
||||
/* case 1: isrun, prev==cur */
|
||||
block[blocklen++] = pix;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
/* case 2: isrun, prev!=cur */
|
||||
if (blocklen>1)
|
||||
if (blocklen>1)
|
||||
{
|
||||
/* we have a run block to flush */
|
||||
rleline[rlen++] = blocklen-1;
|
||||
@ -1188,12 +1188,12 @@ PSrle_encode(unsigned char *scanline,
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
/* not a run */
|
||||
if (pix == block[blocklen-1])
|
||||
if (pix == block[blocklen-1])
|
||||
{
|
||||
/* case 3: non-run, prev==cur */
|
||||
if (blocklen>1)
|
||||
if (blocklen>1)
|
||||
{
|
||||
/* have a non-run block to flush */
|
||||
rleline[rlen++] = (blocklen-1) | 0x80;
|
||||
@ -1202,7 +1202,7 @@ PSrle_encode(unsigned char *scanline,
|
||||
/* start new run block with pix */
|
||||
block[0] = pix;
|
||||
blocklen = isrun = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* blocklen<=1 turn into a run */
|
||||
@ -1210,17 +1210,17 @@ PSrle_encode(unsigned char *scanline,
|
||||
block[blocklen++] = pix;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
/* case 4: non-run, prev!=cur */
|
||||
block[blocklen++] = pix;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* max block length. flush */
|
||||
if (blocklen == 128)
|
||||
{
|
||||
if (isrun)
|
||||
if (isrun)
|
||||
{
|
||||
rleline[rlen++] = blocklen-1;
|
||||
rleline[rlen++] = block[0];
|
||||
@ -1256,7 +1256,7 @@ PSrle_encode(unsigned char *scanline,
|
||||
|
||||
|
||||
/*
|
||||
* PScolor_image - created postscript colorimage operator
|
||||
* PScolor_image - created postscript colorimage operator
|
||||
*
|
||||
* spits out code that checks if the PostScript device in question
|
||||
* knows about the 'colorimage' operator. If it doesn't, it defines
|
||||
@ -1265,8 +1265,8 @@ PSrle_encode(unsigned char *scanline,
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
PScolor_image(void)
|
||||
static void
|
||||
PScolor_image(void)
|
||||
{
|
||||
static char *txt[] = {
|
||||
|
||||
@ -1316,21 +1316,21 @@ PScolor_image(void)
|
||||
|
||||
PSconst_out(txt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* PScolormap - write colormap
|
||||
*
|
||||
* spits out code for the colormap of the following image
|
||||
* if !color, it spits out a mono-ized graymap
|
||||
*
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PScolormap(int color,
|
||||
int nc,
|
||||
int *rmap,
|
||||
int *gmap,
|
||||
int *bmap)
|
||||
PScolormap(int color,
|
||||
int nc,
|
||||
int *rmap,
|
||||
int *gmap,
|
||||
int *bmap)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1340,12 +1340,12 @@ PScolormap(int color,
|
||||
/* load up the colormap */
|
||||
PSprintf("currentfile cmap readhexstring\n");
|
||||
|
||||
for (i=0; i<nc; i++)
|
||||
for (i=0; i<nc; i++)
|
||||
{
|
||||
if (color)
|
||||
if (color)
|
||||
PSprintf("%02x%02x%02x ", rmap[i]>>8,
|
||||
gmap[i]>>8, bmap[i]>>8);
|
||||
else
|
||||
else
|
||||
PSprintf("%02x ", MONO(rmap[i], gmap[i], bmap[i]));
|
||||
if ((i%10) == 9)
|
||||
PSprintf("\n");
|
||||
@ -1357,10 +1357,10 @@ PScolormap(int color,
|
||||
|
||||
/*
|
||||
* PSrle_cmapimage - define rlecmapimage operator
|
||||
*
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PSrle_cmapimage(int color)
|
||||
PSrle_cmapimage(int color)
|
||||
{
|
||||
|
||||
static char *txt[] = {
|
||||
@ -1413,11 +1413,11 @@ PSrle_cmapimage(int color)
|
||||
};
|
||||
|
||||
PSconst_out(txt);
|
||||
if (color)
|
||||
if (color)
|
||||
{
|
||||
PSconst_out(txt_color);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
PSconst_out(txt_gray);
|
||||
}
|
||||
@ -1439,14 +1439,14 @@ PSwrite_bw(unsigned char *pic, int w, int h, int flipbw)
|
||||
int i, j;
|
||||
int err=0;
|
||||
unsigned char outbyte, bitnum, bit;
|
||||
|
||||
|
||||
outbyte = bitnum = 0;
|
||||
for (i=0; i<h && err != EOF; i++) {
|
||||
for (j=0; j<w && err != EOF; j++) {
|
||||
bit = *(pic++);
|
||||
outbyte = (outbyte<<1) | ((bit)&0x01);
|
||||
bitnum++;
|
||||
|
||||
|
||||
if (bitnum==8) {
|
||||
if (flipbw)
|
||||
outbyte = ~outbyte & 0xff;
|
||||
@ -1463,7 +1463,7 @@ PSwrite_bw(unsigned char *pic, int w, int h, int flipbw)
|
||||
}
|
||||
}
|
||||
err=PShex('\0', True); /* Flush the hex buffer if needed */
|
||||
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1475,15 +1475,15 @@ PSwrite_bw(unsigned char *pic, int w, int h, int flipbw)
|
||||
* rectangle is shown.
|
||||
* If anchor is set, a black border is shown around the image.
|
||||
* Positioning is not exactly that of Xmosaic's screen, but close enough.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
static void
|
||||
PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
{
|
||||
ImageInfo *img = eptr->pic_data;
|
||||
unsigned char *imgp = img->image_data;
|
||||
int anchor = (eptr->anchorHRef != NULL);
|
||||
int anchor = (eptr->anchorHRef != NULL);
|
||||
int ncolors = img->num_colors;
|
||||
int i, j;
|
||||
int w = img->width;
|
||||
@ -1504,7 +1504,7 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
|
||||
|
||||
PSmove_offset(eptr->y_offset);
|
||||
if (anchor)
|
||||
if (anchor)
|
||||
{
|
||||
/* draw an outline by drawing a slightly larger black square
|
||||
* below the actual image
|
||||
@ -1515,8 +1515,8 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
PSprintf("grestore\n");
|
||||
extra = 4;
|
||||
}
|
||||
|
||||
if (imgp == NULL)
|
||||
|
||||
if (imgp == NULL)
|
||||
{
|
||||
/* image was not available... do something instead
|
||||
* draw an empty square for example
|
||||
@ -1534,20 +1534,20 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
return;
|
||||
}
|
||||
|
||||
/* this is a hack to see if the image is Black & White,
|
||||
/* this is a hack to see if the image is Black & White,
|
||||
* Greyscale or 8 bit color
|
||||
* assume it's bw if it has only one or two colors, both some grey's
|
||||
* assume it's greyscale if all the colors (>2) are grey
|
||||
* Images with only one color do occur too.
|
||||
*/
|
||||
|
||||
if ( ( (ncolors == 2)
|
||||
|
||||
if ( ( (ncolors == 2)
|
||||
&& ( (Isgray(img,0) && Isgray(img,1))
|
||||
|| (Is_bg(img,0) && Is_fg(img,1))
|
||||
|| (Is_bg(img,0) && Is_fg(img,1))
|
||||
|| (Is_fg(img,0) && Is_bg(img,1)) ))
|
||||
|| ( (ncolors == 1)
|
||||
&& (Isgray(img,0)
|
||||
|| Is_bg(img,0)
|
||||
|| Is_bg(img,0)
|
||||
|| Is_fg(img,0))))
|
||||
{
|
||||
colortype = F_BWDITHER;
|
||||
@ -1569,13 +1569,13 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* build a temporary dictionary */
|
||||
PSprintf("20 dict begin\n\n");
|
||||
|
||||
/* define string to hold a scanline's worth of data */
|
||||
PSprintf("/pix %d string def\n\n", slen);
|
||||
|
||||
|
||||
/* position and scaling */
|
||||
PSprintf("gsave currentpoint %d sub translate", h);
|
||||
if (anchor)
|
||||
@ -1583,45 +1583,45 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
else
|
||||
PSprintf(" 0 2 translate");
|
||||
PSprintf(" %d %d scale\n", w, h);
|
||||
|
||||
if (colortype == F_BWDITHER)
|
||||
|
||||
if (colortype == F_BWDITHER)
|
||||
{
|
||||
/* 1-bit dither code uses 'image' */
|
||||
int flipbw = 0;
|
||||
|
||||
|
||||
/* set if color#0 is 'white' */
|
||||
if ((ncolors == 2 &&
|
||||
MONO(img->reds[0], img->greens[0],img->blues[0]) >
|
||||
MONO(img->reds[1], img->greens[1], img->blues[1])) ||
|
||||
(ncolors == 1 &&
|
||||
(ncolors == 1 &&
|
||||
MONO(img->reds[0], img->greens[0],img->blues[0]) >
|
||||
MONO(127, 127, 127) ))
|
||||
{
|
||||
flipbw=1;
|
||||
flipbw=1;
|
||||
}
|
||||
|
||||
|
||||
/* dimensions of data */
|
||||
PSprintf("%d %d %d\n", w, h, bits);
|
||||
|
||||
|
||||
/* mapping matrix */
|
||||
PSprintf("[%d 0 0 %d 0 %d]\n\n", w, -h, h);
|
||||
|
||||
|
||||
PSprintf("{currentfile pix readhexstring pop}\n");
|
||||
PSprintf("image\n");
|
||||
|
||||
/* write the actual image data */
|
||||
err = PSwrite_bw(imgp, w, h, flipbw);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* all other formats */
|
||||
unsigned char *rleline = (unsigned char *) NULL;
|
||||
int rlen;
|
||||
|
||||
|
||||
/* if we're using color, make sure 'colorimage' is defined */
|
||||
if (colorps)
|
||||
PScolor_image();
|
||||
|
||||
|
||||
PScolormap(colorps, ncolors, img->reds, img->greens, img->blues);
|
||||
PSrle_cmapimage(colorps);
|
||||
|
||||
@ -1630,9 +1630,9 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
/* mapping matrix */
|
||||
PSprintf("[%d 0 0 %d 0 %d]\n", w, -h, h);
|
||||
PSprintf("rlecmapimage\n");
|
||||
|
||||
|
||||
rleline = (unsigned char *) malloc(w * 2);
|
||||
if (!rleline)
|
||||
if (!rleline)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (htmlwTrace) {
|
||||
@ -1643,7 +1643,7 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i<h && err != EOF; i++)
|
||||
for (i=0; i<h && err != EOF; i++)
|
||||
{
|
||||
rlen = PSrle_encode(imgp, rleline, w);
|
||||
imgp += w;
|
||||
@ -1653,14 +1653,14 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
}
|
||||
free(rleline);
|
||||
}
|
||||
|
||||
|
||||
/* stop using temporary dictionary */
|
||||
PSprintf("end\n");
|
||||
PSprintf("grestore\n");
|
||||
|
||||
|
||||
/* move currentpoint just right of image */
|
||||
PSprintf("%d 0 R\n", w + extra);
|
||||
if (HTML_Print_Footers && has_footnote(eptr))
|
||||
PSprintf("%d 0 R\n", w + extra);
|
||||
if (HTML_Print_Footers && has_footnote(eptr))
|
||||
{
|
||||
PSmove_offset(0);
|
||||
PSfootnote(eptr->anchorHRef, 2.0);
|
||||
@ -1699,11 +1699,11 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
* 2: new century schoolbook
|
||||
* 3: lucida
|
||||
*/
|
||||
String ParseTextToPSString(HTMLWidget hw,
|
||||
String ParseTextToPSString(HTMLWidget hw,
|
||||
struct ele_rec *elist,
|
||||
struct ele_rec *startp,
|
||||
struct ele_rec *endp,
|
||||
int start_pos,
|
||||
int start_pos,
|
||||
int end_pos,
|
||||
int space_width,
|
||||
int lmargin,
|
||||
@ -1720,11 +1720,11 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
struct ele_rec *end;
|
||||
struct ele_rec *last;
|
||||
struct ele_rec *tmpptr;
|
||||
unsigned long fg_pixel, bg_pixel;
|
||||
unsigned long fg_pixel, bg_pixel;
|
||||
int footnotes_this_page = 0;
|
||||
int footnotes_this_line;
|
||||
int reserved_space;
|
||||
|
||||
|
||||
if (startp == NULL)
|
||||
return(NULL);
|
||||
|
||||
@ -1733,17 +1733,17 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
* Get the foreground and background colors so we can check later
|
||||
* for black&white documents
|
||||
*/
|
||||
XtVaGetValues (hw->html.view,
|
||||
XtVaGetValues (hw->html.view,
|
||||
#ifdef MOTIF
|
||||
XtNforeground, &fg_pixel,
|
||||
#endif
|
||||
XtNbackground, &bg_pixel,
|
||||
XtNbackground, &bg_pixel,
|
||||
NULL);
|
||||
#ifndef MOTIF
|
||||
XtVaGetValues ((Widget)hw,
|
||||
XtVaGetValues ((Widget)hw,
|
||||
XtNforeground, &fg_pixel,
|
||||
NULL);
|
||||
#endif
|
||||
#endif
|
||||
fg_color.pixel = fg_pixel;
|
||||
bg_color.pixel = bg_pixel;
|
||||
XQueryColor(XtDisplay(hw->html.view),
|
||||
@ -1758,12 +1758,12 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
DefaultColormap(XtDisplay(hw->html.view),
|
||||
DefaultScreen(XtDisplay(hw->html.view)))),
|
||||
&bg_color);
|
||||
|
||||
|
||||
/* this piece of code is needed if the user selects a portion
|
||||
* of the document with the mouse.
|
||||
* I think it will never be used, but I left it in anyway. F.
|
||||
*/
|
||||
if (SwapElements(startp, endp, start_pos, end_pos))
|
||||
if (SwapElements(startp, endp, start_pos, end_pos))
|
||||
{
|
||||
start = endp;
|
||||
end = startp;
|
||||
@ -1776,7 +1776,7 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
start = startp;
|
||||
end = endp;
|
||||
}
|
||||
|
||||
|
||||
/* Setup page size according to user preference. */
|
||||
|
||||
if (HTML_Print_Paper_Size_A4)
|
||||
@ -1785,10 +1785,10 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
page_dimens = us_letter_page_dimens;
|
||||
|
||||
page_dimens.text_height = ( page_dimens.page_height
|
||||
- page_dimens.top_margin
|
||||
- page_dimens.top_margin
|
||||
- page_dimens.bot_margin);
|
||||
page_dimens.text_width = ( page_dimens.page_width
|
||||
- page_dimens.left_margin
|
||||
- page_dimens.left_margin
|
||||
- page_dimens.right_margin);
|
||||
|
||||
/* Calculate the number of Postscript points per pixel of current
|
||||
@ -1808,10 +1808,10 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
* wide), but I guess that the hw->html.doc_width includes some
|
||||
* left and right margins, so it seems to work in practice.
|
||||
*/
|
||||
if (pagewidth > page_dimens.text_width)
|
||||
if (pagewidth > page_dimens.text_width)
|
||||
Points_Pixel = Points_Pixel * page_dimens.text_width / pagewidth;
|
||||
Pixels_Page = (int) (page_dimens.text_height / Points_Pixel);
|
||||
|
||||
Pixels_Page = (int) (page_dimens.text_height / Points_Pixel);
|
||||
|
||||
PSinit();
|
||||
PSheader(hw->html.title, fontfamily, url, time_str);
|
||||
PSnewpage();
|
||||
@ -1819,14 +1819,14 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
last = start;
|
||||
eptr = start;
|
||||
|
||||
while ((eptr != NULL) && (eptr != end))
|
||||
while ((eptr != NULL) && (eptr != end))
|
||||
{
|
||||
/* Skip the special internal text added for multi-page
|
||||
* documents.
|
||||
*/
|
||||
if (eptr->internal == True)
|
||||
if (eptr->internal == True)
|
||||
{
|
||||
if (eptr->type == E_LINEFEED)
|
||||
if (eptr->type == E_LINEFEED)
|
||||
{
|
||||
PS_page_offset += eptr->line_height;
|
||||
}
|
||||
@ -1835,14 +1835,14 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
}
|
||||
|
||||
/* check if this is a newline */
|
||||
if (line != eptr->line_number)
|
||||
if (line != eptr->line_number)
|
||||
{
|
||||
/* calculate max height */
|
||||
height = 0;
|
||||
footnotes_this_line = 0;
|
||||
line = eptr->line_number;
|
||||
tmpptr = eptr;
|
||||
while (tmpptr != NULL && tmpptr->line_number == line)
|
||||
while (tmpptr != NULL && tmpptr->line_number == line)
|
||||
{
|
||||
if (tmpptr->line_height > height)
|
||||
height = tmpptr->line_height;
|
||||
@ -1856,18 +1856,18 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
xpos = 0;
|
||||
|
||||
/* check if line fits completly on page */
|
||||
|
||||
|
||||
reserved_space = 0;
|
||||
if (footnotes_this_page || footnotes_this_line)
|
||||
if (footnotes_this_page || footnotes_this_line)
|
||||
{
|
||||
reserved_space = ( ( footnote_space
|
||||
+ ( footnote_ptsize
|
||||
* ( footnotes_this_page
|
||||
* ( footnotes_this_page
|
||||
+ footnotes_this_line)))
|
||||
/ Points_Pixel);
|
||||
}
|
||||
|
||||
if (ypos + height + reserved_space > PS_start_y + Pixels_Page)
|
||||
if (ypos + height + reserved_space > PS_start_y + Pixels_Page)
|
||||
{
|
||||
PS_start_y = ypos;
|
||||
PSshowpage();
|
||||
@ -1877,24 +1877,24 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
footnotes_this_page += footnotes_this_line;
|
||||
PSmoveto( xpos, ypos);
|
||||
}
|
||||
|
||||
|
||||
switch (eptr->type)
|
||||
|
||||
switch (eptr->type)
|
||||
{
|
||||
case E_TEXT:
|
||||
PStext(hw, eptr, fontfamily,
|
||||
(String)((eptr == start) ? (eptr->edata + start_pos) : eptr->edata));
|
||||
break;
|
||||
|
||||
case E_BULLET:
|
||||
case E_BULLET:
|
||||
PSbullet(hw, eptr, fontfamily);
|
||||
break;
|
||||
|
||||
case E_IMAGE:
|
||||
case E_IMAGE:
|
||||
PSimage(hw, eptr, fontfamily);
|
||||
break;
|
||||
|
||||
case E_LINEFEED:
|
||||
case E_LINEFEED:
|
||||
break;
|
||||
|
||||
case E_HRULE:
|
||||
@ -1913,7 +1913,7 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
last = eptr;
|
||||
eptr = eptr->next;
|
||||
}
|
||||
|
||||
|
||||
PSshowpage();
|
||||
PStrailer();
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Purpose: to parse Hypertext widget contents into appropriate PostScript
|
||||
*
|
||||
* Author: Ameet A. Raval & Frans van Hoesel & Andrew Ford
|
||||
* (aar@gfdl.gov & hoesel@chem.rug.nl).
|
||||
* (aar@gfdl.gov & hoesel@chem.rug.nl).
|
||||
* send bugreports to hoesel@chem.rug.nl
|
||||
*
|
||||
* Institution: for Ameet A. Raval:
|
||||
@ -24,7 +24,7 @@
|
||||
* Montpelier, Bristol, BS6 5HR, GB
|
||||
* E-mail: andrew@icarus.demon.co.uk
|
||||
*
|
||||
* Date: 1 aug 1993
|
||||
* Date: 1 aug 1993
|
||||
* Modification: 8 nov 1993
|
||||
* o added support for bold/italics courier
|
||||
* o removed unused or no longer needed stuff
|
||||
@ -49,8 +49,8 @@
|
||||
* WE MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR
|
||||
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
|
||||
* WARRANTY. WE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE
|
||||
* USERS OF THIS SOFTWARE.
|
||||
*
|
||||
* USERS OF THIS SOFTWARE.
|
||||
*
|
||||
* pieces of code are taken from xvps by kind
|
||||
* permission of John Bradley.
|
||||
*
|
||||
@ -121,7 +121,7 @@ extern int SwapElements();
|
||||
PSprintf("%s\n", txt[i]) ; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/* STREQ tests whether two strings are equal. */
|
||||
#define STREQ(a, b) (strcmp((a), (b)) == 0)
|
||||
|
||||
@ -165,7 +165,7 @@ PAGE_DIMENS_T;
|
||||
PAGE_DIMENS_T page_dimens;
|
||||
PAGE_DIMENS_T a4_page_dimens = {
|
||||
297 * MM,
|
||||
210 * MM,
|
||||
210 * MM,
|
||||
20 * MM,
|
||||
20 * MM,
|
||||
20 * MM,
|
||||
@ -201,7 +201,7 @@ extern Colormap installed_cmap;
|
||||
* screen
|
||||
*
|
||||
*/
|
||||
static float
|
||||
static float
|
||||
GetDpi(HTMLWidget hw)
|
||||
{
|
||||
Screen *s = XtScreen(hw);
|
||||
@ -228,7 +228,7 @@ GetDpi(HTMLWidget hw)
|
||||
* in this call, otherwise it returns EOF (just as printf does)
|
||||
*
|
||||
*/
|
||||
static int
|
||||
static int
|
||||
PSprintf(format, va_alist)
|
||||
char* format;
|
||||
va_dcl
|
||||
@ -237,10 +237,10 @@ PSprintf(format, va_alist)
|
||||
char *s;
|
||||
va_list args;
|
||||
|
||||
if (PS_size - PS_len < 1024)
|
||||
if (PS_size - PS_len < 1024)
|
||||
{
|
||||
PS_size += 1024;
|
||||
if ((s = (char *) realloc(PS_string, PS_size)) == NULL)
|
||||
if ((s = (char *) realloc(PS_string, PS_size)) == NULL)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (htmlwTrace) {
|
||||
@ -256,7 +256,7 @@ PSprintf(format, va_alist)
|
||||
/* this is a hack to make it work on systems were vsprintf(s,...)
|
||||
* returns s, instead of the len.
|
||||
*/
|
||||
if (len != EOF && len != 0)
|
||||
if (len != EOF && len != 0)
|
||||
PS_len += strlen(PS_string+PS_len);
|
||||
va_end(args);
|
||||
return(len);
|
||||
@ -272,13 +272,13 @@ PSprintf(format, va_alist)
|
||||
* PSprintf).
|
||||
*
|
||||
*/
|
||||
static int
|
||||
static int
|
||||
PShex(unsigned char val, int flush)
|
||||
{
|
||||
static unsigned char hexline[80];
|
||||
static char digit[] = "0123456789abcdef";
|
||||
|
||||
if (!flush)
|
||||
if (!flush)
|
||||
{
|
||||
hexline[PS_hexi++] = (char) digit[((unsigned) val >>
|
||||
(unsigned) 4) & (unsigned) 0x0f];
|
||||
@ -289,7 +289,7 @@ PShex(unsigned char val, int flush)
|
||||
/* Changed from ">78" to ">77" on advice of
|
||||
debra@info.win.tue.nl (Paul De Bra). */
|
||||
|
||||
if ((flush && PS_hexi) || (PS_hexi>77))
|
||||
if ((flush && PS_hexi) || (PS_hexi>77))
|
||||
{
|
||||
hexline[PS_hexi] = '\0';
|
||||
PS_hexi=0;
|
||||
@ -308,13 +308,13 @@ PShex(unsigned char val, int flush)
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
{
|
||||
PS_fontstyle fn;
|
||||
int style, size;
|
||||
int fs;
|
||||
|
||||
static PS_fontstyle fontstyle[17] =
|
||||
static PS_fontstyle fontstyle[17] =
|
||||
{
|
||||
RF, IF, BF, FF, BF, BF, BF, BF, BF,
|
||||
BF, IF, FF, FF, FB, FI, FB, FI
|
||||
@ -325,7 +325,7 @@ PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
/* fontsizes as set in gui.c and in HTML.c (listing font is only
|
||||
* defined in HTML.c)
|
||||
*/
|
||||
static int fontsizes[4][3][17] =
|
||||
static int fontsizes[4][3][17] =
|
||||
{
|
||||
/* times font sizes */
|
||||
{
|
||||
@ -353,7 +353,7 @@ PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
}
|
||||
};
|
||||
|
||||
/* next is for each fontfamily the ascent value as given by the
|
||||
/* next is for each fontfamily the ascent value as given by the
|
||||
* medium sized bold x-font (the regular font has the same
|
||||
* ascent value for both the medium and the large size Century
|
||||
* font).
|
||||
@ -448,12 +448,12 @@ PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
|
||||
/* check size, by looking at the size of the regular font */
|
||||
size = 1;
|
||||
if (hw->html.bold_font->ascent > medium_fontascent[fontfamily])
|
||||
if (hw->html.bold_font->ascent > medium_fontascent[fontfamily])
|
||||
{
|
||||
/* large font */
|
||||
size = 2;
|
||||
}
|
||||
else if (hw->html.bold_font->ascent < medium_fontascent[fontfamily])
|
||||
else if (hw->html.bold_font->ascent < medium_fontascent[fontfamily])
|
||||
{
|
||||
/* small font */
|
||||
size = 0;
|
||||
@ -462,7 +462,7 @@ PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
fs = fontsizes[fontfamily][size][style];
|
||||
PS_fontascent = fontascent[fontfamily][size][style];
|
||||
|
||||
if (fn != PS_oldfn || fs != PS_oldfs)
|
||||
if (fn != PS_oldfn || fs != PS_oldfs)
|
||||
{
|
||||
PSprintf( "%2s %d SF\n", fnchar[fn], fs);
|
||||
PS_oldfn=fn, PS_oldfs=fs;
|
||||
@ -477,26 +477,26 @@ PSfont(HTMLWidget hw, XFontStruct *font, int fontfamily)
|
||||
* Any accumulated footnotes are output and the outstanding footnote count
|
||||
* reset to zero. Footnotes are preceded by a footnote rule and each footnote
|
||||
* is consists of a raised mark and the footnote text (i.e. the url). The mark
|
||||
* is in a smaller font than the text. The ideas are filched from LaTeX.
|
||||
* is in a smaller font than the text. The ideas are filched from LaTeX.
|
||||
*/
|
||||
static void
|
||||
PSshowpage(void)
|
||||
{
|
||||
PSprintf("restore\n");
|
||||
if (n_saved_ftns > 0)
|
||||
if (n_saved_ftns > 0)
|
||||
{
|
||||
int i;
|
||||
|
||||
PSprintf("gsave 0.2 setlinewidth newpath %.2f %.2f M %.2f 0 RL stroke\n",
|
||||
PSprintf("gsave 0.2 setlinewidth newpath %.2f %.2f M %.2f 0 RL stroke\n",
|
||||
page_dimens.left_margin,
|
||||
(page_dimens.bot_margin + (footnote_ptsize * n_saved_ftns) + 4),
|
||||
(page_dimens.text_width * 0.4));
|
||||
for (i = 0; n_saved_ftns; n_saved_ftns--, i++)
|
||||
for (i = 0; n_saved_ftns; n_saved_ftns--, i++)
|
||||
{
|
||||
PSprintf("newpath %.2f %.2f M RF %.2f SF (%d) S 3 -2 R RF %d SF (%s) S\n",
|
||||
PSprintf("newpath %.2f %.2f M RF %.2f SF (%d) S 3 -2 R RF %d SF (%s) S\n",
|
||||
page_dimens.left_margin,
|
||||
page_dimens.bot_margin + 5 + (n_saved_ftns - 1) * footnote_ptsize,
|
||||
(0.7 * footnote_ptsize), cur_ftn_no - n_saved_ftns,
|
||||
(0.7 * footnote_ptsize), cur_ftn_no - n_saved_ftns,
|
||||
footnote_ptsize, footnotes[i]);
|
||||
}
|
||||
PSprintf("grestore\n");
|
||||
@ -514,10 +514,10 @@ PSshowpage(void)
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PSnewpage(void)
|
||||
PSnewpage(void)
|
||||
{
|
||||
PS_curr_page++;
|
||||
|
||||
|
||||
/* the PostScript reference Manual states that the Page: Tag
|
||||
should have a label and a ordinal; otherwise programs like
|
||||
psutils fail -gustaf */
|
||||
@ -536,7 +536,7 @@ PSnewpage(void)
|
||||
* PSinit_latin1 - handle ISO encoding
|
||||
*
|
||||
* print out initializing PostScript text for ISO Latin1 font encoding
|
||||
* This code is copied from the Idraw program (from Stanford's InterViews
|
||||
* This code is copied from the Idraw program (from Stanford's InterViews
|
||||
* package), courtesy of Steinar Kjaernsr|d, steinar@ifi.uio.no
|
||||
*
|
||||
*/
|
||||
@ -597,7 +597,7 @@ PSinit_latin1(void)
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PSinit(void)
|
||||
PSinit(void)
|
||||
{
|
||||
PS_size = PS_len = PS_offset = PS_hexi = PS_page_offset = 0;
|
||||
PS_start_y = 0;
|
||||
@ -639,8 +639,8 @@ PSinit(void)
|
||||
* title title of document
|
||||
* date date modified/printed
|
||||
*/
|
||||
static void
|
||||
PSheader(char *title, int font, char *url, char *time_str)
|
||||
static void
|
||||
PSheader(char *title, int font, char *url, char *time_str)
|
||||
{
|
||||
static char *notitle="Untitled";
|
||||
int set_to_null=0;
|
||||
@ -682,7 +682,7 @@ PSheader(char *title, int font, char *url, char *time_str)
|
||||
time_t clock = time(NULL);
|
||||
|
||||
#if !defined(VMS) || defined (__DECC)
|
||||
strftime(time_buf, sizeof(time_buf),
|
||||
strftime(time_buf, sizeof(time_buf),
|
||||
"Printed %a %b %e %T %Y", localtime(&clock));
|
||||
#else
|
||||
sprintf(time_buf,"Printed %s",asctime(localtime(&clock)));
|
||||
@ -734,16 +734,16 @@ PSheader(char *title, int font, char *url, char *time_str)
|
||||
PSprintf("/title (%s) D\n", title);
|
||||
PSprintf("/date (%s) D\n", time_str);
|
||||
PSconst_out(txt);
|
||||
|
||||
|
||||
/* Output the newpage definition. */
|
||||
|
||||
|
||||
PSprintf("/NP {");
|
||||
if (HTML_Print_Headers)
|
||||
if (HTML_Print_Headers)
|
||||
{
|
||||
PSprintf("gsave 0.4 setlinewidth\n");
|
||||
PSprintf(" newpath %.2f %.2f M %.2f 0 RL stroke",
|
||||
PSprintf(" newpath %.2f %.2f M %.2f 0 RL stroke",
|
||||
page_dimens.left_margin,
|
||||
(page_dimens.bot_margin + page_dimens.text_height),
|
||||
(page_dimens.bot_margin + page_dimens.text_height),
|
||||
page_dimens.text_width);
|
||||
PSprintf(" newpath %.2f %.2f M %.2f 0 RL stroke\n",
|
||||
page_dimens.left_margin, page_dimens.bot_margin,
|
||||
@ -753,7 +753,7 @@ PSheader(char *title, int font, char *url, char *time_str)
|
||||
(page_dimens.bot_margin + page_dimens.text_height + 6), title);
|
||||
PSprintf(" nstr cvs dup stringwidth pop pgno stringwidth pop add\n");
|
||||
PSprintf(" %.2f E sub %.2f M pgno S S\n",
|
||||
(page_dimens.left_margin + page_dimens.text_width),
|
||||
(page_dimens.left_margin + page_dimens.text_width),
|
||||
(page_dimens.bot_margin + page_dimens.text_height + 6));
|
||||
PSprintf(" BF 10 SF %.2f %.2f M (%s) S\n",
|
||||
page_dimens.left_margin, page_dimens.bot_margin - 12, url);
|
||||
@ -762,11 +762,11 @@ PSheader(char *title, int font, char *url, char *time_str)
|
||||
page_dimens.bot_margin - 12);
|
||||
}
|
||||
PSprintf(" %.2f %.2f translate %.5f %.5f scale } D\n",
|
||||
page_dimens.left_margin,
|
||||
page_dimens.left_margin,
|
||||
page_dimens.bot_margin + page_dimens.text_height,
|
||||
Points_Pixel, Points_Pixel);
|
||||
PSinit_latin1();
|
||||
|
||||
|
||||
PSprintf("%%%%EndProlog\n");
|
||||
|
||||
if (set_to_null) {
|
||||
@ -804,9 +804,9 @@ PStrailer(void)
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PSmoveto(int x, int y)
|
||||
PSmoveto(int x, int y)
|
||||
{
|
||||
if (y > PS_start_y + Pixels_Page)
|
||||
if (y > PS_start_y + Pixels_Page)
|
||||
{
|
||||
PS_start_y = y;
|
||||
PSshowpage();
|
||||
@ -826,7 +826,7 @@ PSmoveto(int x, int y)
|
||||
static void
|
||||
PSmove_offset(int offset)
|
||||
{
|
||||
if (offset != PS_offset)
|
||||
if (offset != PS_offset)
|
||||
{
|
||||
PSprintf("0 %d R\n", PS_offset - offset );
|
||||
PS_offset = offset;
|
||||
@ -838,12 +838,12 @@ PSmove_offset(int offset)
|
||||
* Return an indication of whether or not the current element has a footnote.
|
||||
*
|
||||
* an element has a footnote if it is text or an image and its anchorHRef is not null.
|
||||
* If the element is a textual element with an anchorHRef, that has been split across
|
||||
* If the element is a textual element with an anchorHRef, that has been split across
|
||||
* lines then it should be followed by a linefeed element and a text element with the
|
||||
* same anchorHRef. In this case say that the element doesn't have a footnote so as
|
||||
* to avoid duplicate footnotes.
|
||||
*/
|
||||
static int
|
||||
static int
|
||||
has_footnote(struct ele_rec *el)
|
||||
{
|
||||
int rc = 0;
|
||||
@ -906,10 +906,10 @@ has_footnote(struct ele_rec *el)
|
||||
static void
|
||||
PSfootnote(char *href, double height)
|
||||
{
|
||||
PSprintf("gsave 0 %.2f R RF %d SF (%d) S grestore\n",
|
||||
PSprintf("gsave 0 %.2f R RF %d SF (%d) S grestore\n",
|
||||
height, footnote_ptsize, cur_ftn_no++);
|
||||
|
||||
if (n_saved_ftns == ftn_array_size)
|
||||
if (n_saved_ftns == ftn_array_size)
|
||||
{
|
||||
ftn_array_size += 16;
|
||||
if (!footnotes) {
|
||||
@ -919,7 +919,7 @@ PSfootnote(char *href, double height)
|
||||
footnotes = (char **)realloc((void *)footnotes,
|
||||
(ftn_array_size * sizeof(char *)));
|
||||
}
|
||||
if (footnotes == NULL)
|
||||
if (footnotes == NULL)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (htmlwTrace) {
|
||||
@ -950,9 +950,9 @@ PStext(HTMLWidget hw, struct ele_rec *eptr, int fontfamily, String s)
|
||||
unsigned char ch;
|
||||
int underline = eptr->underline_number;
|
||||
int ascent;
|
||||
|
||||
|
||||
PSfont(hw, eptr->font, fontfamily); /* set font */
|
||||
if (PS_fontascent == 0)
|
||||
if (PS_fontascent == 0)
|
||||
ascent = eptr->font->ascent;
|
||||
else
|
||||
ascent = PS_fontascent;
|
||||
@ -963,7 +963,7 @@ PStext(HTMLWidget hw, struct ele_rec *eptr, int fontfamily, String s)
|
||||
every character stored as an octal escape (worst case scenario). */
|
||||
|
||||
s2 = (String) malloc(strlen(s) * 4 + 1);
|
||||
if (s2 == NULL)
|
||||
if (s2 == NULL)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (htmlwTrace) {
|
||||
@ -984,14 +984,14 @@ PStext(HTMLWidget hw, struct ele_rec *eptr, int fontfamily, String s)
|
||||
*stmp++ = B_SLASH;
|
||||
*stmp++ = ch;
|
||||
}
|
||||
else if (ch > (unsigned char) MAX_ASCII)
|
||||
else if (ch > (unsigned char) MAX_ASCII)
|
||||
{
|
||||
/* convert to octal */
|
||||
*stmp++ = B_SLASH;
|
||||
*stmp++ = ((ch >> 6) & 007) + '0';
|
||||
*stmp++ = ((ch >> 3) & 007) + '0';
|
||||
*stmp++ = (ch & 007) + '0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*stmp++ = ch;
|
||||
@ -999,7 +999,7 @@ PStext(HTMLWidget hw, struct ele_rec *eptr, int fontfamily, String s)
|
||||
}
|
||||
*(stmp) = '\0';
|
||||
PSprintf("(%s)%c\n", s2, (underline)?'U':'S');
|
||||
if (HTML_Print_Footers && has_footnote(eptr))
|
||||
if (HTML_Print_Footers && has_footnote(eptr))
|
||||
{
|
||||
PSfootnote(eptr->anchorHRef, 0.7 * ascent);
|
||||
}
|
||||
@ -1014,10 +1014,10 @@ PStext(HTMLWidget hw, struct ele_rec *eptr, int fontfamily, String s)
|
||||
* of two. The size of the higher level bullets is just somewhat smaller
|
||||
*
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
PSbullet(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
{
|
||||
int width = ( eptr->font->max_bounds.lbearing
|
||||
int width = ( eptr->font->max_bounds.lbearing
|
||||
+ eptr->font->max_bounds.rbearing);
|
||||
int offset = eptr->y_offset + eptr->font->ascent;
|
||||
int level = eptr->indent_level;
|
||||
@ -1125,7 +1125,7 @@ PSwidget(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
* does the run-length encoding. This is done to reduce the file size and
|
||||
* therefore the time to send the file to the printer. You get longer
|
||||
* processing time instead.
|
||||
*
|
||||
*
|
||||
* rle is encoded as such:
|
||||
* <count> <value> # 'run' of count+1 equal pixels
|
||||
* <count | 0x80> <count+1 data bytes> # count+1 non-equal pixels
|
||||
@ -1133,18 +1133,18 @@ PSwidget(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
*
|
||||
* returns length of the rleline vector
|
||||
*
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
PSrle_encode(unsigned char *scanline,
|
||||
PSrle_encode(unsigned char *scanline,
|
||||
unsigned char *rleline,
|
||||
int wide)
|
||||
int wide)
|
||||
{
|
||||
int i, j, blocklen, isrun, rlen;
|
||||
unsigned char block[256], pix;
|
||||
|
||||
blocklen = isrun = rlen = 0;
|
||||
|
||||
for (i = 0; i < wide; i++)
|
||||
for (i = 0; i < wide; i++)
|
||||
{
|
||||
/* there are 5 possible states:
|
||||
* 0: block empty.
|
||||
@ -1156,23 +1156,23 @@ PSrle_encode(unsigned char *scanline,
|
||||
|
||||
pix = scanline[i];
|
||||
|
||||
if (!blocklen)
|
||||
if (!blocklen)
|
||||
{
|
||||
/* case 0: empty */
|
||||
block[blocklen++] = pix;
|
||||
isrun = 1;
|
||||
}
|
||||
else if (isrun)
|
||||
else if (isrun)
|
||||
{
|
||||
if (pix == block[blocklen-1])
|
||||
{
|
||||
{
|
||||
/* case 1: isrun, prev==cur */
|
||||
block[blocklen++] = pix;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
/* case 2: isrun, prev!=cur */
|
||||
if (blocklen>1)
|
||||
if (blocklen>1)
|
||||
{
|
||||
/* we have a run block to flush */
|
||||
rleline[rlen++] = blocklen-1;
|
||||
@ -1190,12 +1190,12 @@ PSrle_encode(unsigned char *scanline,
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
/* not a run */
|
||||
if (pix == block[blocklen-1])
|
||||
if (pix == block[blocklen-1])
|
||||
{
|
||||
/* case 3: non-run, prev==cur */
|
||||
if (blocklen>1)
|
||||
if (blocklen>1)
|
||||
{
|
||||
/* have a non-run block to flush */
|
||||
rleline[rlen++] = (blocklen-1) | 0x80;
|
||||
@ -1204,7 +1204,7 @@ PSrle_encode(unsigned char *scanline,
|
||||
/* start new run block with pix */
|
||||
block[0] = pix;
|
||||
blocklen = isrun = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* blocklen<=1 turn into a run */
|
||||
@ -1212,17 +1212,17 @@ PSrle_encode(unsigned char *scanline,
|
||||
block[blocklen++] = pix;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
/* case 4: non-run, prev!=cur */
|
||||
block[blocklen++] = pix;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* max block length. flush */
|
||||
if (blocklen == 128)
|
||||
{
|
||||
if (isrun)
|
||||
if (isrun)
|
||||
{
|
||||
rleline[rlen++] = blocklen-1;
|
||||
rleline[rlen++] = block[0];
|
||||
@ -1258,7 +1258,7 @@ PSrle_encode(unsigned char *scanline,
|
||||
|
||||
|
||||
/*
|
||||
* PScolor_image - created postscript colorimage operator
|
||||
* PScolor_image - created postscript colorimage operator
|
||||
*
|
||||
* spits out code that checks if the PostScript device in question
|
||||
* knows about the 'colorimage' operator. If it doesn't, it defines
|
||||
@ -1267,8 +1267,8 @@ PSrle_encode(unsigned char *scanline,
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
PScolor_image(void)
|
||||
static void
|
||||
PScolor_image(void)
|
||||
{
|
||||
static char *txt[] = {
|
||||
|
||||
@ -1318,21 +1318,21 @@ PScolor_image(void)
|
||||
|
||||
PSconst_out(txt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* PScolormap - write colormap
|
||||
*
|
||||
* spits out code for the colormap of the following image
|
||||
* if !color, it spits out a mono-ized graymap
|
||||
*
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PScolormap(int color,
|
||||
int nc,
|
||||
int *rmap,
|
||||
int *gmap,
|
||||
int *bmap)
|
||||
PScolormap(int color,
|
||||
int nc,
|
||||
int *rmap,
|
||||
int *gmap,
|
||||
int *bmap)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1342,12 +1342,12 @@ PScolormap(int color,
|
||||
/* load up the colormap */
|
||||
PSprintf("currentfile cmap readhexstring\n");
|
||||
|
||||
for (i=0; i<nc; i++)
|
||||
for (i=0; i<nc; i++)
|
||||
{
|
||||
if (color)
|
||||
if (color)
|
||||
PSprintf("%02x%02x%02x ", rmap[i]>>8,
|
||||
gmap[i]>>8, bmap[i]>>8);
|
||||
else
|
||||
else
|
||||
PSprintf("%02x ", MONO(rmap[i], gmap[i], bmap[i]));
|
||||
if ((i%10) == 9)
|
||||
PSprintf("\n");
|
||||
@ -1359,10 +1359,10 @@ PScolormap(int color,
|
||||
|
||||
/*
|
||||
* PSrle_cmapimage - define rlecmapimage operator
|
||||
*
|
||||
*
|
||||
*/
|
||||
static void
|
||||
PSrle_cmapimage(int color)
|
||||
PSrle_cmapimage(int color)
|
||||
{
|
||||
|
||||
static char *txt[] = {
|
||||
@ -1415,11 +1415,11 @@ PSrle_cmapimage(int color)
|
||||
};
|
||||
|
||||
PSconst_out(txt);
|
||||
if (color)
|
||||
if (color)
|
||||
{
|
||||
PSconst_out(txt_color);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
PSconst_out(txt_gray);
|
||||
}
|
||||
@ -1441,14 +1441,14 @@ PSwrite_bw(unsigned char *pic, int w, int h, int flipbw)
|
||||
int i, j;
|
||||
int err=0;
|
||||
unsigned char outbyte, bitnum, bit;
|
||||
|
||||
|
||||
outbyte = bitnum = 0;
|
||||
for (i=0; i<h && err != EOF; i++) {
|
||||
for (j=0; j<w && err != EOF; j++) {
|
||||
bit = *(pic++);
|
||||
outbyte = (outbyte<<1) | ((bit)&0x01);
|
||||
bitnum++;
|
||||
|
||||
|
||||
if (bitnum==8) {
|
||||
if (flipbw)
|
||||
outbyte = ~outbyte & 0xff;
|
||||
@ -1465,7 +1465,7 @@ PSwrite_bw(unsigned char *pic, int w, int h, int flipbw)
|
||||
}
|
||||
}
|
||||
err=PShex('\0', True); /* Flush the hex buffer if needed */
|
||||
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1477,15 +1477,15 @@ PSwrite_bw(unsigned char *pic, int w, int h, int flipbw)
|
||||
* rectangle is shown.
|
||||
* If anchor is set, a black border is shown around the image.
|
||||
* Positioning is not exactly that of Xmosaic's screen, but close enough.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
static void
|
||||
PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
{
|
||||
ImageInfo *img = eptr->pic_data;
|
||||
unsigned char *imgp = img->image_data;
|
||||
int anchor = (eptr->anchorHRef != NULL);
|
||||
int anchor = (eptr->anchorHRef != NULL);
|
||||
int ncolors = img->num_colors;
|
||||
int i, j;
|
||||
int w = img->width;
|
||||
@ -1506,7 +1506,7 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
|
||||
|
||||
PSmove_offset(eptr->y_offset);
|
||||
if (anchor)
|
||||
if (anchor)
|
||||
{
|
||||
/* draw an outline by drawing a slightly larger black square
|
||||
* below the actual image
|
||||
@ -1517,8 +1517,8 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
PSprintf("grestore\n");
|
||||
extra = 4;
|
||||
}
|
||||
|
||||
if (imgp == NULL)
|
||||
|
||||
if (imgp == NULL)
|
||||
{
|
||||
/* image was not available... do something instead
|
||||
* draw an empty square for example
|
||||
@ -1536,20 +1536,20 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
return;
|
||||
}
|
||||
|
||||
/* this is a hack to see if the image is Black & White,
|
||||
/* this is a hack to see if the image is Black & White,
|
||||
* Greyscale or 8 bit color
|
||||
* assume it's bw if it has only one or two colors, both some grey's
|
||||
* assume it's greyscale if all the colors (>2) are grey
|
||||
* Images with only one color do occur too.
|
||||
*/
|
||||
|
||||
if ( ( (ncolors == 2)
|
||||
|
||||
if ( ( (ncolors == 2)
|
||||
&& ( (Isgray(img,0) && Isgray(img,1))
|
||||
|| (Is_bg(img,0) && Is_fg(img,1))
|
||||
|| (Is_bg(img,0) && Is_fg(img,1))
|
||||
|| (Is_fg(img,0) && Is_bg(img,1)) ))
|
||||
|| ( (ncolors == 1)
|
||||
&& (Isgray(img,0)
|
||||
|| Is_bg(img,0)
|
||||
|| Is_bg(img,0)
|
||||
|| Is_fg(img,0))))
|
||||
{
|
||||
colortype = F_BWDITHER;
|
||||
@ -1571,13 +1571,13 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* build a temporary dictionary */
|
||||
PSprintf("20 dict begin\n\n");
|
||||
|
||||
/* define string to hold a scanline's worth of data */
|
||||
PSprintf("/pix %d string def\n\n", slen);
|
||||
|
||||
|
||||
/* position and scaling */
|
||||
PSprintf("gsave currentpoint %d sub translate", h);
|
||||
if (anchor)
|
||||
@ -1585,45 +1585,45 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
else
|
||||
PSprintf(" 0 2 translate");
|
||||
PSprintf(" %d %d scale\n", w, h);
|
||||
|
||||
if (colortype == F_BWDITHER)
|
||||
|
||||
if (colortype == F_BWDITHER)
|
||||
{
|
||||
/* 1-bit dither code uses 'image' */
|
||||
int flipbw = 0;
|
||||
|
||||
|
||||
/* set if color#0 is 'white' */
|
||||
if ((ncolors == 2 &&
|
||||
MONO(img->reds[0], img->greens[0],img->blues[0]) >
|
||||
MONO(img->reds[1], img->greens[1], img->blues[1])) ||
|
||||
(ncolors == 1 &&
|
||||
(ncolors == 1 &&
|
||||
MONO(img->reds[0], img->greens[0],img->blues[0]) >
|
||||
MONO(127, 127, 127) ))
|
||||
{
|
||||
flipbw=1;
|
||||
flipbw=1;
|
||||
}
|
||||
|
||||
|
||||
/* dimensions of data */
|
||||
PSprintf("%d %d %d\n", w, h, bits);
|
||||
|
||||
|
||||
/* mapping matrix */
|
||||
PSprintf("[%d 0 0 %d 0 %d]\n\n", w, -h, h);
|
||||
|
||||
|
||||
PSprintf("{currentfile pix readhexstring pop}\n");
|
||||
PSprintf("image\n");
|
||||
|
||||
/* write the actual image data */
|
||||
err = PSwrite_bw(imgp, w, h, flipbw);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* all other formats */
|
||||
unsigned char *rleline = (unsigned char *) NULL;
|
||||
int rlen;
|
||||
|
||||
|
||||
/* if we're using color, make sure 'colorimage' is defined */
|
||||
if (colorps)
|
||||
PScolor_image();
|
||||
|
||||
|
||||
PScolormap(colorps, ncolors, img->reds, img->greens, img->blues);
|
||||
PSrle_cmapimage(colorps);
|
||||
|
||||
@ -1632,9 +1632,9 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
/* mapping matrix */
|
||||
PSprintf("[%d 0 0 %d 0 %d]\n", w, -h, h);
|
||||
PSprintf("rlecmapimage\n");
|
||||
|
||||
|
||||
rleline = (unsigned char *) malloc(w * 2);
|
||||
if (!rleline)
|
||||
if (!rleline)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (htmlwTrace) {
|
||||
@ -1645,7 +1645,7 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i<h && err != EOF; i++)
|
||||
for (i=0; i<h && err != EOF; i++)
|
||||
{
|
||||
rlen = PSrle_encode(imgp, rleline, w);
|
||||
imgp += w;
|
||||
@ -1655,14 +1655,14 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
}
|
||||
free(rleline);
|
||||
}
|
||||
|
||||
|
||||
/* stop using temporary dictionary */
|
||||
PSprintf("end\n");
|
||||
PSprintf("grestore\n");
|
||||
|
||||
|
||||
/* move currentpoint just right of image */
|
||||
PSprintf("%d 0 R\n", w + extra);
|
||||
if (HTML_Print_Footers && has_footnote(eptr))
|
||||
PSprintf("%d 0 R\n", w + extra);
|
||||
if (HTML_Print_Footers && has_footnote(eptr))
|
||||
{
|
||||
PSmove_offset(0);
|
||||
PSfootnote(eptr->anchorHRef, 2.0);
|
||||
@ -1701,11 +1701,11 @@ PSimage(HTMLWidget hw, struct ele_rec *eptr, int fontfamily)
|
||||
* 2: new century schoolbook
|
||||
* 3: lucida
|
||||
*/
|
||||
String ParseTextToPSString(HTMLWidget hw,
|
||||
String ParseTextToPSString(HTMLWidget hw,
|
||||
struct ele_rec *elist,
|
||||
struct ele_rec *startp,
|
||||
struct ele_rec *endp,
|
||||
int start_pos,
|
||||
int start_pos,
|
||||
int end_pos,
|
||||
int space_width,
|
||||
int lmargin,
|
||||
@ -1722,11 +1722,11 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
struct ele_rec *end;
|
||||
struct ele_rec *last;
|
||||
struct ele_rec *tmpptr;
|
||||
unsigned long fg_pixel, bg_pixel;
|
||||
unsigned long fg_pixel, bg_pixel;
|
||||
int footnotes_this_page = 0;
|
||||
int footnotes_this_line;
|
||||
int reserved_space;
|
||||
|
||||
|
||||
if (startp == NULL)
|
||||
return(NULL);
|
||||
|
||||
@ -1735,17 +1735,17 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
* Get the foreground and background colors so we can check later
|
||||
* for black&white documents
|
||||
*/
|
||||
XtVaGetValues (hw->html.view,
|
||||
XtVaGetValues (hw->html.view,
|
||||
#ifdef MOTIF
|
||||
XtNforeground, &fg_pixel,
|
||||
#endif
|
||||
XtNbackground, &bg_pixel,
|
||||
XtNbackground, &bg_pixel,
|
||||
NULL);
|
||||
#ifndef MOTIF
|
||||
XtVaGetValues ((Widget)hw,
|
||||
XtVaGetValues ((Widget)hw,
|
||||
XtNforeground, &fg_pixel,
|
||||
NULL);
|
||||
#endif
|
||||
#endif
|
||||
fg_color.pixel = fg_pixel;
|
||||
bg_color.pixel = bg_pixel;
|
||||
XQueryColor(XtDisplay(hw->html.view),
|
||||
@ -1760,12 +1760,12 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
DefaultColormap(XtDisplay(hw->html.view),
|
||||
DefaultScreen(XtDisplay(hw->html.view)))),
|
||||
&bg_color);
|
||||
|
||||
|
||||
/* this piece of code is needed if the user selects a portion
|
||||
* of the document with the mouse.
|
||||
* I think it will never be used, but I left it in anyway. F.
|
||||
*/
|
||||
if (SwapElements(startp, endp, start_pos, end_pos))
|
||||
if (SwapElements(startp, endp, start_pos, end_pos))
|
||||
{
|
||||
start = endp;
|
||||
end = startp;
|
||||
@ -1778,7 +1778,7 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
start = startp;
|
||||
end = endp;
|
||||
}
|
||||
|
||||
|
||||
/* Setup page size according to user preference. */
|
||||
|
||||
if (HTML_Print_Paper_Size_A4)
|
||||
@ -1787,10 +1787,10 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
page_dimens = us_letter_page_dimens;
|
||||
|
||||
page_dimens.text_height = ( page_dimens.page_height
|
||||
- page_dimens.top_margin
|
||||
- page_dimens.top_margin
|
||||
- page_dimens.bot_margin);
|
||||
page_dimens.text_width = ( page_dimens.page_width
|
||||
- page_dimens.left_margin
|
||||
- page_dimens.left_margin
|
||||
- page_dimens.right_margin);
|
||||
|
||||
/* Calculate the number of Postscript points per pixel of current
|
||||
@ -1810,10 +1810,10 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
* wide), but I guess that the hw->html.doc_width includes some
|
||||
* left and right margins, so it seems to work in practice.
|
||||
*/
|
||||
if (pagewidth > page_dimens.text_width)
|
||||
if (pagewidth > page_dimens.text_width)
|
||||
Points_Pixel = Points_Pixel * page_dimens.text_width / pagewidth;
|
||||
Pixels_Page = (int) (page_dimens.text_height / Points_Pixel);
|
||||
|
||||
Pixels_Page = (int) (page_dimens.text_height / Points_Pixel);
|
||||
|
||||
PSinit();
|
||||
PSheader(hw->html.title, fontfamily, url, time_str);
|
||||
PSnewpage();
|
||||
@ -1821,14 +1821,14 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
last = start;
|
||||
eptr = start;
|
||||
|
||||
while ((eptr != NULL) && (eptr != end))
|
||||
while ((eptr != NULL) && (eptr != end))
|
||||
{
|
||||
/* Skip the special internal text added for multi-page
|
||||
* documents.
|
||||
*/
|
||||
if (eptr->internal == True)
|
||||
if (eptr->internal == True)
|
||||
{
|
||||
if (eptr->type == E_LINEFEED)
|
||||
if (eptr->type == E_LINEFEED)
|
||||
{
|
||||
PS_page_offset += eptr->line_height;
|
||||
}
|
||||
@ -1837,14 +1837,14 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
}
|
||||
|
||||
/* check if this is a newline */
|
||||
if (line != eptr->line_number)
|
||||
if (line != eptr->line_number)
|
||||
{
|
||||
/* calculate max height */
|
||||
height = 0;
|
||||
footnotes_this_line = 0;
|
||||
line = eptr->line_number;
|
||||
tmpptr = eptr;
|
||||
while (tmpptr != NULL && tmpptr->line_number == line)
|
||||
while (tmpptr != NULL && tmpptr->line_number == line)
|
||||
{
|
||||
if (tmpptr->line_height > height)
|
||||
height = tmpptr->line_height;
|
||||
@ -1858,18 +1858,18 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
xpos = 0;
|
||||
|
||||
/* check if line fits completly on page */
|
||||
|
||||
|
||||
reserved_space = 0;
|
||||
if (footnotes_this_page || footnotes_this_line)
|
||||
if (footnotes_this_page || footnotes_this_line)
|
||||
{
|
||||
reserved_space = ( ( footnote_space
|
||||
+ ( footnote_ptsize
|
||||
* ( footnotes_this_page
|
||||
* ( footnotes_this_page
|
||||
+ footnotes_this_line)))
|
||||
/ Points_Pixel);
|
||||
}
|
||||
|
||||
if (ypos + height + reserved_space > PS_start_y + Pixels_Page)
|
||||
if (ypos + height + reserved_space > PS_start_y + Pixels_Page)
|
||||
{
|
||||
PS_start_y = ypos;
|
||||
PSshowpage();
|
||||
@ -1879,24 +1879,24 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
footnotes_this_page += footnotes_this_line;
|
||||
PSmoveto( xpos, ypos);
|
||||
}
|
||||
|
||||
|
||||
switch (eptr->type)
|
||||
|
||||
switch (eptr->type)
|
||||
{
|
||||
case E_TEXT:
|
||||
PStext(hw, eptr, fontfamily,
|
||||
(String)((eptr == start) ? (eptr->edata + start_pos) : eptr->edata));
|
||||
break;
|
||||
|
||||
case E_BULLET:
|
||||
case E_BULLET:
|
||||
PSbullet(hw, eptr, fontfamily);
|
||||
break;
|
||||
|
||||
case E_IMAGE:
|
||||
case E_IMAGE:
|
||||
PSimage(hw, eptr, fontfamily);
|
||||
break;
|
||||
|
||||
case E_LINEFEED:
|
||||
case E_LINEFEED:
|
||||
break;
|
||||
|
||||
case E_HRULE:
|
||||
@ -1915,7 +1915,7 @@ String ParseTextToPSString(HTMLWidget hw,
|
||||
last = eptr;
|
||||
eptr = eptr->next;
|
||||
}
|
||||
|
||||
|
||||
PSshowpage();
|
||||
PStrailer();
|
||||
|
||||
|
212
libhtmlw/HTML.c
212
libhtmlw/HTML.c
@ -337,7 +337,7 @@ static XtResource resources[] =
|
||||
{ WbNtitleText,
|
||||
WbCTitleText, XtRString, sizeof (char *),
|
||||
XtOffset (HTMLWidget, html.title),
|
||||
XtRString, (char *) NULL
|
||||
XtRString, (char *) NULL
|
||||
},
|
||||
|
||||
/*
|
||||
@ -593,21 +593,21 @@ static XtResource resources[] =
|
||||
},
|
||||
/* end amb */
|
||||
{ WbNpreviouslyVisitedTestFunction,
|
||||
WbCPreviouslyVisitedTestFunction, XtRPointer,
|
||||
WbCPreviouslyVisitedTestFunction, XtRPointer,
|
||||
sizeof (XtPointer),
|
||||
XtOffset (HTMLWidget, html.previously_visited_test),
|
||||
XtRImmediate, (caddr_t) NULL
|
||||
},
|
||||
|
||||
|
||||
{ WbNresolveImageFunction,
|
||||
WbCResolveImageFunction, XtRPointer,
|
||||
WbCResolveImageFunction, XtRPointer,
|
||||
sizeof (XtPointer),
|
||||
XtOffset (HTMLWidget, html.resolveImage),
|
||||
XtRImmediate, (caddr_t) NULL
|
||||
},
|
||||
|
||||
|
||||
{ WbNresolveDelayedImage,
|
||||
WbCResolveDelayedImage, XtRPointer,
|
||||
WbCResolveDelayedImage, XtRPointer,
|
||||
sizeof (XtPointer),
|
||||
XtOffset (HTMLWidget, html.resolveDelayedImage),
|
||||
XtRImmediate, (caddr_t) NULL
|
||||
@ -615,12 +615,12 @@ static XtResource resources[] =
|
||||
|
||||
{
|
||||
WbNpointerMotionCallback,
|
||||
WbCPointerMotionCallback, XtRPointer,
|
||||
WbCPointerMotionCallback, XtRPointer,
|
||||
sizeof (XtPointer),
|
||||
XtOffset (HTMLWidget, html.pointer_motion_callback),
|
||||
XtRImmediate, (caddr_t) NULL
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -674,12 +674,12 @@ HTMLClassRec htmlClassRec = {
|
||||
},
|
||||
|
||||
{ /* constraint_class fields */
|
||||
NULL, /* resource list */
|
||||
0, /* num resources */
|
||||
0, /* constraint size */
|
||||
NULL, /* init proc */
|
||||
NULL, /* destroy proc */
|
||||
NULL, /* set values proc */
|
||||
NULL, /* resource list */
|
||||
0, /* num resources */
|
||||
0, /* constraint size */
|
||||
NULL, /* init proc */
|
||||
NULL, /* destroy proc */
|
||||
NULL, /* set values proc */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
@ -691,13 +691,13 @@ HTMLClassRec htmlClassRec = {
|
||||
NULL, /* syn_cont_resources */
|
||||
0, /* num_syn_cont_resources */
|
||||
XmInheritParentProcess, /* parent_process */
|
||||
NULL, /* extension */
|
||||
NULL, /* extension */
|
||||
},
|
||||
#endif /* MOTIF */
|
||||
|
||||
{ /* html_class fields */
|
||||
{ /* html_class fields */
|
||||
0 /* none */
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -710,7 +710,7 @@ extern int hacked_y;
|
||||
WidgetClass htmlWidgetClass = (WidgetClass)&htmlClassRec;
|
||||
|
||||
static Cursor in_anchor_cursor = (Cursor)NULL;
|
||||
static char *mailToKludgeSubject = NULL;
|
||||
static char *mailToKludgeSubject = NULL;
|
||||
static char *mailToKludgeURL = NULL;
|
||||
|
||||
char *cattrs[]={"text","bgcolor","alink","vlink","link",NULL};
|
||||
@ -836,7 +836,7 @@ hw_do_color(Widget w, char *att, char *cname)
|
||||
}
|
||||
|
||||
cmap = hw->core.colormap;
|
||||
|
||||
|
||||
val=cname;
|
||||
if (*val!='#') {
|
||||
if (XAllocNamedColor(XtDisplay(w),cmap,cname,&col,&ecol)) {
|
||||
@ -868,22 +868,22 @@ hw_do_color(Widget w, char *att, char *cname)
|
||||
t[0]=val[4];
|
||||
t[1]=val[5];
|
||||
sscanf(t,"%x",&b);
|
||||
|
||||
|
||||
col.red = ((unsigned) r) << 8;
|
||||
col.green = ((unsigned) g) << 8;
|
||||
col.blue = ((unsigned) b) << 8;
|
||||
col.flags = DoRed | DoGreen | DoBlue;
|
||||
|
||||
|
||||
if (!XAllocColor(XtDisplay(w),cmap,&col)) {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!my_strcasecmp(att,"text")) {
|
||||
hw->manager.foreground = col.pixel;
|
||||
}
|
||||
@ -891,11 +891,11 @@ hw_do_color(Widget w, char *att, char *cname)
|
||||
/* calculate shadow colors */
|
||||
calc = XmGetColorCalculation();
|
||||
calc(&col, &fg, &sel, &ts, &bs);
|
||||
if (XAllocColor(XtDisplay(w),cmap,&ts))
|
||||
if (XAllocColor(XtDisplay(w),cmap,&ts))
|
||||
hw->manager.top_shadow_color = ts.pixel;
|
||||
if (XAllocColor(XtDisplay(w),cmap,&bs))
|
||||
if (XAllocColor(XtDisplay(w),cmap,&bs))
|
||||
hw->manager.bottom_shadow_color = bs.pixel;
|
||||
|
||||
|
||||
hw->core.background_pixel = col.pixel;
|
||||
hw->html.view->core.background_pixel = col.pixel ;
|
||||
hw->html.activeAnchor_bg = col.pixel;
|
||||
@ -909,7 +909,7 @@ hw_do_color(Widget w, char *att, char *cname)
|
||||
if (!my_strcasecmp(att,"alink")) {
|
||||
hw->html.activeAnchor_fg = col.pixel;
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -951,7 +951,7 @@ XGCValues values;
|
||||
#define MAX_Y_EXP_DIFF 10 /*pixels between exposes to make one expose area*/
|
||||
|
||||
/*
|
||||
* Process an expose event in the View (or drawing area). This
|
||||
* Process an expose event in the View (or drawing area). This
|
||||
* Can be a regular expose event, or perhaps a GraphicsExpose Event.
|
||||
*/
|
||||
static void
|
||||
@ -1100,7 +1100,7 @@ goto single_expose;
|
||||
x1 = nx + nwidth;
|
||||
changed=1;
|
||||
}
|
||||
|
||||
|
||||
if (y1 < (ny + nheight)) {
|
||||
y1 = ny + nheight;
|
||||
changed=1;
|
||||
@ -1190,7 +1190,7 @@ ScrollWidgets(hw)
|
||||
((y+wptr->height)>0 &&
|
||||
(y+wptr->height)<=hw->html.view_height)) &&
|
||||
((x>0 &&
|
||||
x<=hw->html.view_width) ||
|
||||
x<=hw->html.view_width) ||
|
||||
((x+wptr->width)>0 &&
|
||||
(x+wptr->width)<=hw->html.view_width))) {
|
||||
wptr->seeable=1;
|
||||
@ -1271,7 +1271,7 @@ ScrollToPos(w, hw, value)
|
||||
if (value > hw->html.scroll_y)
|
||||
{
|
||||
int dy;
|
||||
|
||||
|
||||
dy = value - hw->html.scroll_y;
|
||||
if (dy > hw->html.view_height)
|
||||
{
|
||||
@ -1314,7 +1314,7 @@ ScrollToPos(w, hw, value)
|
||||
else if (value < hw->html.scroll_y)
|
||||
{
|
||||
int dy;
|
||||
|
||||
|
||||
dy = hw->html.scroll_y - value;
|
||||
if (dy > hw->html.view_height)
|
||||
{
|
||||
@ -1347,7 +1347,7 @@ ScrollToPos(w, hw, value)
|
||||
ViewRedisplay(hw,
|
||||
0, 0,
|
||||
hw->html.view_width, dy);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1364,7 +1364,7 @@ ScrollToPos(w, hw, value)
|
||||
if (value > hw->html.scroll_x)
|
||||
{
|
||||
int dx;
|
||||
|
||||
|
||||
dx = value - hw->html.scroll_x;
|
||||
if (dx > hw->html.view_width)
|
||||
{
|
||||
@ -1407,7 +1407,7 @@ ScrollToPos(w, hw, value)
|
||||
else if (value < hw->html.scroll_x)
|
||||
{
|
||||
int dx;
|
||||
|
||||
|
||||
dx = hw->html.scroll_x - value;
|
||||
if (dx > hw->html.view_width)
|
||||
{
|
||||
@ -1484,7 +1484,7 @@ ScrollMove(w, client_data, call_data)
|
||||
currentLength = hw->html.view_height;
|
||||
value = hw->html.scroll_y + scrollDir * currentLength;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
totalLength = hw->html.doc_width;
|
||||
currentLength = hw->html.view_width;
|
||||
@ -1493,7 +1493,7 @@ ScrollMove(w, client_data, call_data)
|
||||
|
||||
if (value > (int)totalLength) value = totalLength;
|
||||
if (value < 0) value = 0;
|
||||
|
||||
|
||||
setScrollBar(w, value, totalLength, currentLength);
|
||||
ScrollToPos(w, hw, value);
|
||||
#endif
|
||||
@ -1508,14 +1508,14 @@ JumpMove(w, client_data, call_data)
|
||||
caddr_t call_data;
|
||||
{
|
||||
HTMLWidget hw = (HTMLWidget)client_data;
|
||||
int value = (int)(*(float *)call_data *
|
||||
(w == hw->html.vbar ?
|
||||
hw->html.doc_height :
|
||||
int value = (int)(*(float *)call_data *
|
||||
(w == hw->html.vbar ?
|
||||
hw->html.doc_height :
|
||||
hw->html.doc_width));
|
||||
ScrollToPos(w, hw, value);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Create the horizontal and vertical scroll bars.
|
||||
@ -1544,10 +1544,10 @@ CreateScrollbars(
|
||||
XtSetArg(arg[argcnt], XxNwidth, 10); argcnt++;
|
||||
XtSetArg(arg[argcnt], XxNheight, 10); argcnt++;
|
||||
hw->html.view = XtCreateWidget("View",
|
||||
#ifdef MOTIF
|
||||
#ifdef MOTIF
|
||||
xmDrawingAreaWidgetClass,
|
||||
#else
|
||||
drawingAreaWidgetClass,
|
||||
drawingAreaWidgetClass,
|
||||
#endif
|
||||
(Widget)hw, arg, argcnt);
|
||||
XtManageChild(hw->html.view);
|
||||
@ -1728,7 +1728,7 @@ ConfigScrollBars(
|
||||
*/
|
||||
#ifdef MOTIF
|
||||
vx = hw->manager.shadow_thickness;
|
||||
vy = hw->manager.shadow_thickness;
|
||||
vy = hw->manager.shadow_thickness;
|
||||
#else
|
||||
vx = vy = 0;
|
||||
#endif
|
||||
@ -1741,7 +1741,7 @@ ConfigScrollBars(
|
||||
vy += HbarHeight(hw);
|
||||
}
|
||||
XtMoveWidget(hw->html.view, vx, vy);
|
||||
XtResizeWidget(hw->html.view, hw->html.view_width,
|
||||
XtResizeWidget(hw->html.view, hw->html.view_width,
|
||||
hw->html.view_height,
|
||||
hw->html.view->core.border_width);
|
||||
/*
|
||||
@ -1757,7 +1757,7 @@ ConfigScrollBars(
|
||||
* the viewing area
|
||||
*/
|
||||
XtResizeWidget(hw->html.vbar, hw->html.vbar->core.width,
|
||||
hw->html.view_height + (2 *
|
||||
hw->html.view_height + (2 *
|
||||
#ifdef MOTIF
|
||||
hw->manager.shadow_thickness
|
||||
#else
|
||||
@ -1779,16 +1779,16 @@ ConfigScrollBars(
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (htmlwTrace) {
|
||||
fprintf (stderr, "view_height %d, doc_height %d\n",
|
||||
fprintf (stderr, "view_height %d, doc_height %d\n",
|
||||
hw->html.view_height, hw->html.doc_height);
|
||||
}
|
||||
#endif
|
||||
#ifdef NOT_RIGHT
|
||||
/* Eric -- your previous equation wasn't doing it.
|
||||
This isn't either... */
|
||||
ss =
|
||||
ss =
|
||||
(int)((float)hw->html.view_height *
|
||||
((float)hw->html.view_height /
|
||||
((float)hw->html.view_height /
|
||||
(float)(hw->html.doc_height - (int)hw->html.view_height)));
|
||||
if (ss > hw->html.view_height)
|
||||
{
|
||||
@ -1855,14 +1855,14 @@ ConfigScrollBars(
|
||||
XtSetArg(arg[argcnt], XmNvalue, hw->html.scroll_y); argcnt++;
|
||||
XtSetArg(arg[argcnt], XmNsliderSize, ss); argcnt++;
|
||||
XtSetArg(arg[argcnt], XmNincrement, DEFAULT_INCREMENT); argcnt++;
|
||||
XtSetArg(arg[argcnt], XmNpageIncrement,
|
||||
hw->html.view_height > DEFAULT_INCREMENT ?
|
||||
XtSetArg(arg[argcnt], XmNpageIncrement,
|
||||
hw->html.view_height > DEFAULT_INCREMENT ?
|
||||
hw->html.view_height - DEFAULT_INCREMENT : 1); argcnt++;
|
||||
XtSetValues(hw->html.vbar, arg, argcnt);
|
||||
#else
|
||||
setScrollBar(hw->html.vbar,
|
||||
setScrollBar(hw->html.vbar,
|
||||
hw->html.scroll_y,
|
||||
hw->html.doc_height,
|
||||
hw->html.doc_height,
|
||||
hw->html.view_height);
|
||||
#endif /* MOTIF */
|
||||
|
||||
@ -1970,14 +1970,14 @@ ConfigScrollBars(
|
||||
XtSetArg(arg[argcnt], XmNvalue, hw->html.scroll_x); argcnt++;
|
||||
XtSetArg(arg[argcnt], XmNsliderSize, ss); argcnt++;
|
||||
XtSetArg(arg[argcnt], XmNincrement, DEFAULT_INCREMENT); argcnt++;
|
||||
XtSetArg(arg[argcnt], XmNpageIncrement,
|
||||
hw->html.view_width > DEFAULT_INCREMENT ?
|
||||
XtSetArg(arg[argcnt], XmNpageIncrement,
|
||||
hw->html.view_width > DEFAULT_INCREMENT ?
|
||||
hw->html.view_width - DEFAULT_INCREMENT : 1); argcnt++;
|
||||
XtSetValues(hw->html.hbar, arg, argcnt);
|
||||
#else
|
||||
setScrollBar(hw->html.hbar,
|
||||
setScrollBar(hw->html.hbar,
|
||||
hw->html.scroll_x,
|
||||
hw->html.doc_width,
|
||||
hw->html.doc_width,
|
||||
hw->html.view_width);
|
||||
#endif /* MOTIF */
|
||||
}
|
||||
@ -2026,7 +2026,7 @@ ReformatWindow(
|
||||
if (hw->core.width <= swidth)
|
||||
{
|
||||
hw->core.width = swidth + 10;
|
||||
}
|
||||
}
|
||||
new_width = hw->core.width - swidth - (2 * st);
|
||||
temp = FormatAll(hw, &new_width);
|
||||
|
||||
@ -2216,19 +2216,19 @@ Initialize(
|
||||
if (new->core.width == 0)
|
||||
{
|
||||
new->core.width = new->html.margin_width << 1 ;
|
||||
}
|
||||
}
|
||||
if (new->core.width == 0)
|
||||
{
|
||||
new->core.width = 10 ;
|
||||
}
|
||||
}
|
||||
if (new->core.height == 0)
|
||||
{
|
||||
new->core.height = new->html.margin_height << 1 ;
|
||||
}
|
||||
}
|
||||
if (new->core.height == 0)
|
||||
{
|
||||
new->core.height = 10 ;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure the underline numbers are within bounds.
|
||||
@ -2236,22 +2236,22 @@ Initialize(
|
||||
if (new->html.num_anchor_underlines < 0)
|
||||
{
|
||||
new->html.num_anchor_underlines = 0;
|
||||
}
|
||||
}
|
||||
if (new->html.num_anchor_underlines > MAX_UNDERLINES)
|
||||
{
|
||||
new->html.num_anchor_underlines = MAX_UNDERLINES;
|
||||
}
|
||||
}
|
||||
if (new->html.num_visitedAnchor_underlines < 0)
|
||||
{
|
||||
new->html.num_visitedAnchor_underlines = 0;
|
||||
}
|
||||
}
|
||||
if (new->html.num_visitedAnchor_underlines > MAX_UNDERLINES)
|
||||
{
|
||||
new->html.num_visitedAnchor_underlines = MAX_UNDERLINES;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the raw text with the HTML parser. And set the formatted
|
||||
* Parse the raw text with the HTML parser. And set the formatted
|
||||
* element list to NULL.
|
||||
*/
|
||||
new->html.html_objects = HTMLParse(NULL, request->html.raw_text,new);
|
||||
@ -2463,7 +2463,7 @@ ViewClearAndRefresh(
|
||||
#endif
|
||||
{
|
||||
int r,b;
|
||||
|
||||
|
||||
/*
|
||||
* Only refresh if we have a window already.
|
||||
* (if we have a GC we have a window)
|
||||
@ -2482,7 +2482,7 @@ ViewClearAndRefresh(
|
||||
hw->manager.top_shadow_color ? 0 : 1;
|
||||
hw->manager.bottom_shadow_color =
|
||||
hw->manager.bottom_shadow_color ? 0 : 1;
|
||||
|
||||
|
||||
XtVaSetValues(hw->html.view,
|
||||
XmNbackground, hw->core.background_pixel,
|
||||
XmNtopShadowColor, r,
|
||||
@ -2494,7 +2494,7 @@ ViewClearAndRefresh(
|
||||
XmNtopShadowColor, r,
|
||||
XmNbottomShadowColor, b,
|
||||
NULL);
|
||||
|
||||
|
||||
XClearArea(XtDisplay(hw), XtWindow(hw->html.view),
|
||||
0, 0, 0, 0, False);
|
||||
ViewRedisplay(hw, 0, 0,
|
||||
@ -2612,7 +2612,7 @@ Resize(
|
||||
if (hw->core.width <= swidth)
|
||||
{
|
||||
hw->core.width = swidth + 10 ;
|
||||
}
|
||||
}
|
||||
|
||||
if (hw->html.use_vbar == True)
|
||||
{
|
||||
@ -3989,7 +3989,7 @@ TrackMotion(w, event, params, num_params)
|
||||
}
|
||||
|
||||
eptr = LocateElement(hw, x, y, &epos);
|
||||
|
||||
|
||||
/* We're hitting a new anchor if eptr exists and
|
||||
eptr != cached tracked element and anchorHRef != NULL. */
|
||||
if (eptr != NULL && eptr != hw->html.cached_tracked_ele &&
|
||||
@ -4002,7 +4002,7 @@ TrackMotion(w, event, params, num_params)
|
||||
}
|
||||
/* We're leaving an anchor if eptr exists and
|
||||
a cached ele exists and we're not entering a new anchor. */
|
||||
else if (eptr != NULL && hw->html.cached_tracked_ele != NULL &&
|
||||
else if (eptr != NULL && hw->html.cached_tracked_ele != NULL &&
|
||||
eptr->anchorHRef == NULL)
|
||||
{
|
||||
LEAVING_ANCHOR (hw);
|
||||
@ -4014,13 +4014,13 @@ TrackMotion(w, event, params, num_params)
|
||||
|
||||
|
||||
|
||||
/* We're adding a subject attribute to the anchor tag
|
||||
/* We're adding a subject attribute to the anchor tag
|
||||
of course this subject attribute is dependent on that the HREF attribute
|
||||
is set to a mailto URL. I think this is a kludge. libwww is not set up
|
||||
for this, so to minimize modifications, this routine exists for
|
||||
for this, so to minimize modifications, this routine exists for
|
||||
libwww:HTSendMaitlTo() to call to get the subject for the mailto URL.
|
||||
The static globals mailToKludgeSubject, etc are set in HTMLInput when
|
||||
an anchor is clicked.
|
||||
an anchor is clicked.
|
||||
*/
|
||||
GetMailtoKludgeInfo(url,subject)
|
||||
char **url;
|
||||
@ -4051,7 +4051,7 @@ _HTMLInput(
|
||||
String *params, /* unused */
|
||||
Cardinal *num_params) /* unused */
|
||||
#endif
|
||||
{
|
||||
{
|
||||
HTMLWidget hw = (HTMLWidget)XtParent(w);
|
||||
struct ele_rec *eptr;
|
||||
WbAnchorCallbackData cbdata;
|
||||
@ -4353,16 +4353,16 @@ _HTMLpwdInput(
|
||||
char *keySymString;
|
||||
char *star = "*";
|
||||
int length, passwdLength, i, insertPos, maxLength;
|
||||
Boolean stringInPlace;
|
||||
|
||||
Boolean stringInPlace;
|
||||
|
||||
if (event->type == KeyPress)
|
||||
{
|
||||
HTMLWidget hw = (HTMLWidget)XtParent(w);
|
||||
WidgetInfo *wptr;
|
||||
|
||||
if (XtClass((Widget)hw) != htmlWidgetClass)
|
||||
if (XtClass((Widget)hw) != htmlWidgetClass)
|
||||
return; /* it was not for us */
|
||||
|
||||
|
||||
/*
|
||||
* find the structure for this widget
|
||||
*/
|
||||
@ -4378,7 +4378,7 @@ _HTMLpwdInput(
|
||||
|
||||
passwdLength = wptr->password ? strlen(wptr->password) : 0;
|
||||
|
||||
length = XLookupString((XKeyEvent *)event,
|
||||
length = XLookupString((XKeyEvent *)event,
|
||||
buffer, 50, &ks, NULL);
|
||||
keySymString = XKeysymToString(ks);
|
||||
XtVaGetValues(w,
|
||||
@ -4404,7 +4404,7 @@ _HTMLpwdInput(
|
||||
|
||||
if ((!strcmp("BackSpace",keySymString))
|
||||
|| (!strcmp("Backspace",keySymString))
|
||||
|| (!strcmp("Delete",keySymString)) )
|
||||
|| (!strcmp("Delete",keySymString)) )
|
||||
{
|
||||
insertPos --;
|
||||
|
||||
@ -4421,7 +4421,7 @@ _HTMLpwdInput(
|
||||
}
|
||||
#endif
|
||||
|
||||
XtCallActionProc(w,
|
||||
XtCallActionProc(w,
|
||||
insertPos>-1 ? "delete-previous-character" :
|
||||
"delete-next-character",
|
||||
event, NULL,0);
|
||||
@ -4440,15 +4440,15 @@ _HTMLpwdInput(
|
||||
if (passwdLength < maxLength)
|
||||
{
|
||||
char *pwd = wptr->password =
|
||||
(char *)realloc(wptr->password,
|
||||
(char *)realloc(wptr->password,
|
||||
sizeof(char)*(passwdLength+2));
|
||||
for (i=passwdLength+1; i>insertPos; i--)
|
||||
pwd[i] = pwd[i-1];
|
||||
|
||||
|
||||
pwd[insertPos] = buffer[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if (wptr->password == NULL)
|
||||
wptr->password = (char *)malloc(sizeof(char)*2);
|
||||
@ -4508,19 +4508,19 @@ SetValues(
|
||||
if (request->html.num_anchor_underlines < 0)
|
||||
{
|
||||
new->html.num_anchor_underlines = 0;
|
||||
}
|
||||
}
|
||||
if (request->html.num_anchor_underlines > MAX_UNDERLINES)
|
||||
{
|
||||
new->html.num_anchor_underlines = MAX_UNDERLINES;
|
||||
}
|
||||
}
|
||||
if (request->html.num_visitedAnchor_underlines < 0)
|
||||
{
|
||||
new->html.num_visitedAnchor_underlines = 0;
|
||||
}
|
||||
}
|
||||
if (request->html.num_visitedAnchor_underlines > MAX_UNDERLINES)
|
||||
{
|
||||
new->html.num_visitedAnchor_underlines = MAX_UNDERLINES;
|
||||
}
|
||||
}
|
||||
|
||||
/*reformatted = 0;*/
|
||||
if ((request->html.raw_text != current->html.raw_text)||
|
||||
@ -4778,7 +4778,7 @@ ConvertSelection(w, selection, target, type, value, length, format)
|
||||
bcopy((char*)std_targets, (char*)targetP,
|
||||
sizeof(Atom)*std_length);
|
||||
*/
|
||||
memcpy((char*)targetP, (char*)std_targets,
|
||||
memcpy((char*)targetP, (char*)std_targets,
|
||||
sizeof(Atom)*std_length);
|
||||
XtFree((char*)std_targets);
|
||||
*type = XA_ATOM;
|
||||
@ -5209,7 +5209,7 @@ HTMLGotoId(Widget w, int element_id, int correction)
|
||||
#else
|
||||
ScrollToPos(hw->html.vbar, hw, newy);
|
||||
ScrollToPos(hw->html.hbar, hw, 0);
|
||||
setScrollBar(hw->html.vbar, newy,
|
||||
setScrollBar(hw->html.vbar, newy,
|
||||
hw->html.doc_height,
|
||||
hw->html.view_height);
|
||||
#endif
|
||||
@ -6104,7 +6104,7 @@ HTMLSetText(Widget w, char *text, char *header_text, char *footer_text, int elem
|
||||
InitBody((Widget)hw);
|
||||
|
||||
/* restore default colors as required */
|
||||
|
||||
|
||||
if(hw->manager.foreground != hw->html.foreground_SAVE) {
|
||||
XFreeColors(XtDisplay(hw),hw->core.colormap,
|
||||
&hw->manager.foreground,1,0);
|
||||
@ -6115,12 +6115,12 @@ HTMLSetText(Widget w, char *text, char *header_text, char *footer_text, int elem
|
||||
&hw->html.anchor_fg,1,0);
|
||||
hw->html.anchor_fg = hw->html.anchor_fg_SAVE;
|
||||
}
|
||||
if(hw->html.visitedAnchor_fg != hw->html.visitedAnchor_fg_SAVE){
|
||||
if(hw->html.visitedAnchor_fg != hw->html.visitedAnchor_fg_SAVE){
|
||||
XFreeColors(XtDisplay(hw),hw->core.colormap,
|
||||
&hw->html.visitedAnchor_fg,1,0);
|
||||
hw->html.visitedAnchor_fg = hw->html.visitedAnchor_fg_SAVE;
|
||||
}
|
||||
if(hw->html.activeAnchor_fg != hw->html.activeAnchor_fg_SAVE){
|
||||
if(hw->html.activeAnchor_fg != hw->html.activeAnchor_fg_SAVE){
|
||||
XFreeColors(XtDisplay(hw),hw->core.colormap,
|
||||
&hw->html.activeAnchor_fg,1,0);
|
||||
hw->html.activeAnchor_fg = hw->html.activeAnchor_fg_SAVE;
|
||||
@ -6129,13 +6129,13 @@ HTMLSetText(Widget w, char *text, char *header_text, char *footer_text, int elem
|
||||
XFreeColors(XtDisplay(hw),hw->core.colormap,
|
||||
&hw->manager.top_shadow_color,1,0);
|
||||
hw->manager.top_shadow_color = hw->html.top_color_SAVE;
|
||||
}
|
||||
}
|
||||
if(hw->html.bottom_color_SAVE != hw->manager.bottom_shadow_color){
|
||||
XFreeColors(XtDisplay(hw),hw->core.colormap,
|
||||
&hw->manager.bottom_shadow_color,1,0);
|
||||
hw->manager.bottom_shadow_color = hw->html.bottom_color_SAVE;
|
||||
}
|
||||
if(hw->core.background_pixel != hw->html.background_SAVE){
|
||||
}
|
||||
if(hw->core.background_pixel != hw->html.background_SAVE){
|
||||
XFreeColors(XtDisplay(hw),hw->core.colormap,
|
||||
&hw->core.background_pixel,1,0);
|
||||
hw->html.activeAnchor_bg = hw->html.activeAnchor_bg_SAVE;
|
||||
@ -6277,7 +6277,7 @@ HTMLSetText(Widget w, char *text, char *header_text, char *footer_text, int elem
|
||||
/*
|
||||
* Display the new text
|
||||
*/
|
||||
ViewClearAndRefresh(hw);
|
||||
ViewClearAndRefresh(hw);
|
||||
|
||||
/*
|
||||
* Clear any previous selection
|
||||
@ -6897,7 +6897,7 @@ HTMLSearchText (Widget w, char *pattern, ElementRef *m_start, ElementRef *m_end,
|
||||
}
|
||||
|
||||
/* the following is a hack to make the html widget not acknowledge
|
||||
any button events while it is busy so that the rbm will not grab the
|
||||
any button events while it is busy so that the rbm will not grab the
|
||||
server. Hopefully this will be removed when the application is re-written
|
||||
to pay more attention to the event loop - TPR 2/9/96 */
|
||||
|
||||
@ -6913,8 +6913,8 @@ void HTMLSetAppInsensitive(Widget hw)
|
||||
height = hw->core.height;
|
||||
|
||||
/* ???? Should this be cast to a HTMLWidget and XtWindow changed to html.view*/
|
||||
sens_win = XCreateWindow(XtDisplay((Widget) hw), XtWindow(hw), x,
|
||||
y, width, height, 0,CopyFromParent, InputOnly,
|
||||
sens_win = XCreateWindow(XtDisplay((Widget) hw), XtWindow(hw), x,
|
||||
y, width, height, 0,CopyFromParent, InputOnly,
|
||||
CopyFromParent, 0, NULL);
|
||||
XMapRaised(XtDisplay((Widget) hw), sens_win);
|
||||
}
|
||||
@ -6931,7 +6931,7 @@ void HTMLSetAppSensitive(Widget hw)
|
||||
*
|
||||
* Fixed up and rewritten by SWP...
|
||||
*/
|
||||
void HTMLDrawBackgroundImage(Widget wid, int x, int y, int width,
|
||||
void HTMLDrawBackgroundImage(Widget wid, int x, int y, int width,
|
||||
int height) {
|
||||
|
||||
int w_whole=0, h_whole=0,
|
||||
@ -6966,7 +6966,7 @@ HTMLWidget hw = (HTMLWidget) wid;
|
||||
* Figure out the height of the area to draw.
|
||||
* If there is a height offset, index the number of height tiles.
|
||||
*/
|
||||
w_start_offset = (x+hw->html.scroll_x) % hw->html.bg_width;
|
||||
w_start_offset = (x+hw->html.scroll_x) % hw->html.bg_width;
|
||||
if (w_start_offset || (!w_start_offset && width<hw->html.bg_width)) {
|
||||
w_whole++;
|
||||
start_width=hw->html.bg_width-w_start_offset;
|
||||
@ -7129,7 +7129,7 @@ void HTMLSetFocusPolicy(Widget w, int to)
|
||||
else
|
||||
{
|
||||
XtVaSetValues(shell, XmNkeyboardFocusPolicy, XmEXPLICIT, NULL);
|
||||
/* when we have preference dialog this will have to
|
||||
/* when we have preference dialog this will have to
|
||||
undo all the translations that are currently installed
|
||||
in the widgets and set the keyboardFocus policy of the
|
||||
toplevel shell to pointer */
|
||||
|
@ -134,7 +134,7 @@ extern int HTMLSearchText (Widget w, char *pattern,
|
||||
extern void HTMLSetAppInsensitive(Widget hw);
|
||||
extern void HTMLSetAppSensitive(Widget hw);
|
||||
extern void HTMLTraverseTabGroups();
|
||||
extern void HTMLDrawBackgroundImage(Widget w, int x, int y, int width,
|
||||
extern void HTMLDrawBackgroundImage(Widget w, int x, int y, int width,
|
||||
int height);
|
||||
extern void HTMLSetFocusPolicy(Widget w, int to);
|
||||
#endif /* _NO_PROTO */
|
||||
@ -259,7 +259,7 @@ typedef struct table_field {
|
||||
int colWidth; /* uniform width for all element in this col*/
|
||||
int rowHeight; /* uniform hieght for all element in the row*/
|
||||
Boolean header; /* is this field created with <TH> or <TD> */
|
||||
|
||||
|
||||
/* contents */
|
||||
FieldType type;
|
||||
char *text;
|
||||
@ -429,9 +429,9 @@ struct delay_rec {
|
||||
#define M_TABLE_HEADER 47
|
||||
#define M_TABLE_ROW 48
|
||||
#define M_TABLE_DATA 49
|
||||
#define M_SUP 50
|
||||
#define M_SUB 51
|
||||
#define M_FIGURE 52
|
||||
#define M_SUP 50
|
||||
#define M_SUB 51
|
||||
#define M_FIGURE 52
|
||||
#define M_COMMENT 53
|
||||
#define M_DOC_HEAD 54 /* amb 2 */
|
||||
#define M_UNDERLINED 55 /* amb 2 */
|
||||
|
@ -144,7 +144,7 @@ typedef struct _HTMLPart
|
||||
Pixmap bgmap_SAVE;
|
||||
Pixmap bgclip_SAVE;
|
||||
int bg_height;
|
||||
int bg_width;
|
||||
int bg_width;
|
||||
|
||||
Pixel foreground_SAVE;
|
||||
Pixel anchor_fg_SAVE;
|
||||
@ -152,9 +152,9 @@ typedef struct _HTMLPart
|
||||
Pixel activeAnchor_fg_SAVE;
|
||||
Pixel activeAnchor_bg_SAVE;
|
||||
Pixel top_color_SAVE;
|
||||
Pixel bottom_color_SAVE;
|
||||
Pixel bottom_color_SAVE;
|
||||
Pixel background_SAVE;
|
||||
|
||||
|
||||
int num_anchor_underlines;
|
||||
int num_visitedAnchor_underlines;
|
||||
Boolean dashed_anchor_lines;
|
||||
@ -191,7 +191,7 @@ typedef struct _HTMLPart
|
||||
XtPointer previously_visited_test;
|
||||
XtPointer resolveImage;
|
||||
XtPointer resolveDelayedImage;
|
||||
|
||||
|
||||
XtPointer pointer_motion_callback;
|
||||
|
||||
/* PRIVATE */
|
||||
|
@ -564,7 +564,7 @@ CreateElement(hw, type, fp, x, y, edata, w, h, bw)
|
||||
eptr->anchorSubject = ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_SUBJECT);
|
||||
if (!eptr->anchorSubject) {
|
||||
eptr->anchorSubject =
|
||||
eptr->anchorSubject =
|
||||
ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_TITLE);
|
||||
}
|
||||
@ -691,7 +691,7 @@ CreateElement(hw, type, fp, x, y, edata, w, h, bw)
|
||||
eptr->underline_number = 0;
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
if (eptr->edata != NULL)
|
||||
{
|
||||
free((char *)eptr->edata);
|
||||
@ -728,7 +728,7 @@ CreateElement(hw, type, fp, x, y, edata, w, h, bw)
|
||||
eptr->anchorSubject= ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_SUBJECT);
|
||||
if (!eptr->anchorSubject) {
|
||||
eptr->anchorSubject =
|
||||
eptr->anchorSubject =
|
||||
ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_TITLE);
|
||||
}
|
||||
@ -773,7 +773,7 @@ CreateElement(hw, type, fp, x, y, edata, w, h, bw)
|
||||
eptr->anchorSubject = ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_SUBJECT);
|
||||
if (!eptr->anchorSubject) {
|
||||
eptr->anchorSubject =
|
||||
eptr->anchorSubject =
|
||||
ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_TITLE);
|
||||
}
|
||||
@ -963,7 +963,7 @@ SetElement(hw, type, fp, x, y, edata, w, h, bw)
|
||||
eptr->anchorSubject= ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_SUBJECT);
|
||||
if (!eptr->anchorSubject) {
|
||||
eptr->anchorSubject =
|
||||
eptr->anchorSubject =
|
||||
ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_TITLE);
|
||||
}
|
||||
@ -1226,7 +1226,7 @@ SetElement(hw, type, fp, x, y, edata, w, h, bw)
|
||||
ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_SUBJECT);
|
||||
if (!eptr->anchorSubject) {
|
||||
eptr->anchorSubject =
|
||||
eptr->anchorSubject =
|
||||
ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_TITLE);
|
||||
}
|
||||
@ -1307,7 +1307,7 @@ SetElement(hw, type, fp, x, y, edata, w, h, bw)
|
||||
eptr->anchorSubject = ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_SUBJECT);
|
||||
if (!eptr->anchorSubject) {
|
||||
eptr->anchorSubject =
|
||||
eptr->anchorSubject =
|
||||
ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_TITLE);
|
||||
}
|
||||
@ -1466,7 +1466,7 @@ SetElement(hw, type, fp, x, y, edata, w, h, bw)
|
||||
eptr->anchorSubject= ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_SUBJECT);
|
||||
if (!eptr->anchorSubject) {
|
||||
eptr->anchorSubject =
|
||||
eptr->anchorSubject =
|
||||
ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_TITLE);
|
||||
}
|
||||
@ -1527,7 +1527,7 @@ SetElement(hw, type, fp, x, y, edata, w, h, bw)
|
||||
eptr->anchorSubject= ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_SUBJECT);
|
||||
if (!eptr->anchorSubject) {
|
||||
eptr->anchorSubject =
|
||||
eptr->anchorSubject =
|
||||
ParseMarkTag(AnchorText,
|
||||
MT_ANCHOR, AT_TITLE);
|
||||
}
|
||||
@ -1591,7 +1591,7 @@ SetElement(hw, type, fp, x, y, edata, w, h, bw)
|
||||
|
||||
|
||||
/*
|
||||
* Change our drawing font
|
||||
* Change our drawing font
|
||||
*/
|
||||
void
|
||||
NewFont(fp)
|
||||
@ -2206,7 +2206,7 @@ PreformatPlace(hw, mptr, x, y, width)
|
||||
SetElement(hw, E_TEXT, currentFont,
|
||||
line_x, *y, line, NULL, NULL, IMAGE_DEFAULT_BORDER);
|
||||
/*
|
||||
* Save width here to avoid an
|
||||
* Save width here to avoid an
|
||||
* XTextExtents call later.
|
||||
*/
|
||||
Current->width = *x - line_x + 1;
|
||||
@ -2270,7 +2270,7 @@ PreformatPlace(hw, mptr, x, y, width)
|
||||
SetElement(hw, E_TEXT, currentFont,
|
||||
line_x, *y, line, NULL, NULL, IMAGE_DEFAULT_BORDER);
|
||||
/*
|
||||
* Save width here to avoid an
|
||||
* Save width here to avoid an
|
||||
* XTextExtents call later.
|
||||
*/
|
||||
Current->width = *x - line_x + 1;
|
||||
@ -2498,7 +2498,7 @@ FormatPlace(hw, mptr, x, y, width)
|
||||
SetElement(hw, E_TEXT, currentFont,
|
||||
line_x, *y, line, NULL, NULL, IMAGE_DEFAULT_BORDER);
|
||||
/*
|
||||
* Save width here to avoid an
|
||||
* Save width here to avoid an
|
||||
* XTextExtents call later.
|
||||
*/
|
||||
Current->width = *x - line_x + 1;
|
||||
@ -2651,7 +2651,7 @@ FormatPlace(hw, mptr, x, y, width)
|
||||
SetElement(hw, E_TEXT, currentFont,
|
||||
line_x, *y, line, NULL, NULL, IMAGE_DEFAULT_BORDER);
|
||||
/*
|
||||
* Save width here to avoid an
|
||||
* Save width here to avoid an
|
||||
* XTextExtents call later.
|
||||
*/
|
||||
Current->width = *x - line_x + 1;
|
||||
@ -2679,7 +2679,7 @@ FormatPlace(hw, mptr, x, y, width)
|
||||
SetElement(hw, E_TEXT, currentFont,
|
||||
line_x, *y, line, NULL, NULL, IMAGE_DEFAULT_BORDER);
|
||||
/*
|
||||
* Save width here to avoid an
|
||||
* Save width here to avoid an
|
||||
* XTextExtents call later.
|
||||
*/
|
||||
Current->width = *x - line_x + 1;
|
||||
@ -2711,8 +2711,8 @@ int extra;
|
||||
|
||||
extra = 10;
|
||||
|
||||
LineFeed(hw, x, y);
|
||||
SetElement(hw, E_TABLE, currentFont, *x, *y, (char *) mptr, NULL, NULL, IMAGE_DEFAULT_BORDER);
|
||||
LineFeed(hw, x, y);
|
||||
SetElement(hw, E_TABLE, currentFont, *x, *y, (char *) mptr, NULL, NULL, IMAGE_DEFAULT_BORDER);
|
||||
if (!Current->table_data) {
|
||||
/* no table */
|
||||
return 0;
|
||||
@ -2724,7 +2724,7 @@ int extra;
|
||||
BaseLine = Current->table_data->height;
|
||||
|
||||
*x += Current->width + 1;
|
||||
LineFeed(hw, x, y);
|
||||
LineFeed(hw, x, y);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2769,7 +2769,7 @@ ImagePlace(hw, mptr, x, y, width)
|
||||
SetElement(hw, E_TEXT, currentFont,
|
||||
*x, *y, tptr, NULL, NULL, IMAGE_DEFAULT_BORDER);
|
||||
/*
|
||||
* Save width here to avoid an
|
||||
* Save width here to avoid an
|
||||
* XTextExtents call later.
|
||||
*/
|
||||
Current->width = all.width;
|
||||
@ -2877,7 +2877,7 @@ ImagePlace(hw, mptr, x, y, width)
|
||||
* Yank out the name field, and stick it in text.
|
||||
* We may use this for ALT to at some later date.
|
||||
*/
|
||||
if (Current->pic_data != NULL)
|
||||
if (Current->pic_data != NULL)
|
||||
{
|
||||
tptr = ParseMarkTag(mptr->start, MT_IMAGE, "NAME");
|
||||
/*temp******/
|
||||
@ -2895,7 +2895,7 @@ ImagePlace(hw, mptr, x, y, width)
|
||||
* change the size, or anchor status of the image, thus we MUST
|
||||
* doit before we muck with the Baseline and stuff.
|
||||
*/
|
||||
if (Current->pic_data != NULL)
|
||||
if (Current->pic_data != NULL)
|
||||
{
|
||||
/*
|
||||
* Handle the USEMAP attribute of IMG tags. This is used for
|
||||
@ -2949,7 +2949,7 @@ ImagePlace(hw, mptr, x, y, width)
|
||||
*/
|
||||
tptr = ParseMarkTag(mptr->start, MT_IMAGE, "ALIGN");
|
||||
/*temp******/
|
||||
if (!tptr)
|
||||
if (!tptr)
|
||||
{
|
||||
tptr = ParseMarkTag(mptr->start, MT_FIGURE, "ALIGN");
|
||||
}
|
||||
@ -4865,7 +4865,7 @@ FormatChunk(hw, x, y)
|
||||
* Format all objects
|
||||
*/
|
||||
mptr = hw->html.html_objects;
|
||||
Last = NULL;
|
||||
Last = NULL;
|
||||
while (mptr != NULL)
|
||||
{
|
||||
TriggerMarkChanges(hw, &mptr, x, y);
|
||||
@ -5781,7 +5781,7 @@ XGCValues values;
|
||||
eptr->pic_data, 0);
|
||||
if (eptr->pic_data->transparent &&
|
||||
eptr->pic_data->clip==None) {
|
||||
eptr->pic_data->clip =
|
||||
eptr->pic_data->clip =
|
||||
XCreatePixmapFromBitmapData
|
||||
(XtDisplay(hw),
|
||||
XtWindow(hw->html.view),
|
||||
@ -5881,7 +5881,7 @@ XGCValues values;
|
||||
values.clip_x_origin=x+extra;
|
||||
values.clip_y_origin=y+extra;
|
||||
valuemask=GCClipMask|GCClipXOrigin|GCClipYOrigin;
|
||||
XChangeGC(XtDisplay(hw),
|
||||
XChangeGC(XtDisplay(hw),
|
||||
hw->html.drawGC,
|
||||
valuemask, &values);
|
||||
|
||||
@ -6004,7 +6004,7 @@ PlaceLine(hw, line)
|
||||
break;
|
||||
case E_LINEFEED:
|
||||
if(!hw->html.bg_image)
|
||||
LinefeedRefresh(hw, eptr);
|
||||
LinefeedRefresh(hw, eptr);
|
||||
break;
|
||||
case E_IMAGE:
|
||||
ImageRefresh(hw, eptr);
|
||||
|
@ -465,20 +465,20 @@ MakeImage(dsp, data, width, height, depth, img_info, clip)
|
||||
bit_data = (unsigned char *)malloc(width * height * 2);
|
||||
bitp = bit_data;
|
||||
datap = data;
|
||||
|
||||
|
||||
theVisual = DefaultVisual(dsp, DefaultScreen(dsp));
|
||||
rshift = 15 - highbit(theVisual->red_mask);
|
||||
gshift = 15 - highbit(theVisual->green_mask);
|
||||
bshift = 15 - highbit(theVisual->blue_mask);
|
||||
bmap_order = BitmapBitOrder(dsp);
|
||||
|
||||
|
||||
for (w = (width * height); w > 0; w--)
|
||||
{
|
||||
temp = (((img_info->reds[(int)*datap] >> rshift) &
|
||||
temp = (((img_info->reds[(int)*datap] >> rshift) &
|
||||
theVisual->red_mask) |
|
||||
((img_info->greens[(int)*datap] >> gshift) &
|
||||
((img_info->greens[(int)*datap] >> gshift) &
|
||||
theVisual->green_mask) |
|
||||
((img_info->blues[(int)*datap] >> bshift) &
|
||||
((img_info->blues[(int)*datap] >> bshift) &
|
||||
theVisual->blue_mask));
|
||||
if (bmap_order == MSBFirst)
|
||||
{
|
||||
|
@ -241,7 +241,7 @@ ClearJot(hw, w, width, height)
|
||||
|
||||
jptr = GetJot(w);
|
||||
if (jptr == NULL)
|
||||
{
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@ -253,7 +253,7 @@ ClearJot(hw, w, width, height)
|
||||
hw->html.drawGC,
|
||||
0, 0, jptr->width, jptr->height);
|
||||
}
|
||||
|
||||
|
||||
FreeStrokes(jptr->strokes);
|
||||
jptr->strokes = NULL;
|
||||
jptr->last_stroke = NULL;
|
||||
@ -319,7 +319,7 @@ EVJotExpose(w, data, event)
|
||||
|
||||
jptr = GetJot(w);
|
||||
if (jptr == NULL)
|
||||
{
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@ -360,7 +360,7 @@ EVJotPress(w, data, event)
|
||||
|
||||
jptr = GetJot(w);
|
||||
if (jptr == NULL)
|
||||
{
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@ -409,12 +409,12 @@ EVJotMove(w, data, event)
|
||||
|
||||
jptr = GetJot(w);
|
||||
if (jptr == NULL)
|
||||
{
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (jptr->drawing == False)
|
||||
{
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@ -463,12 +463,12 @@ EVJotRelease(w, data, event)
|
||||
|
||||
jptr = GetJot(w);
|
||||
if (jptr == NULL)
|
||||
{
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (jptr->drawing == False)
|
||||
{
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@ -521,7 +521,7 @@ EJB_JOTfromJot(w)
|
||||
|
||||
jptr = GetJot(w);
|
||||
if (jptr == NULL)
|
||||
{
|
||||
{
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@ -648,12 +648,12 @@ JOTfromJot(w, buffer_len)
|
||||
|
||||
jptr = GetJot(w);
|
||||
if (jptr == NULL)
|
||||
{
|
||||
{
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
dlen = sizeof(MY_INK_POINT) * jptr->stroke_cnt;
|
||||
|
||||
|
||||
dataArray = (MY_INK_POINT *)malloc(dlen);
|
||||
cnt = 0;
|
||||
sptr = jptr->strokes;
|
||||
@ -692,7 +692,7 @@ JOTfromJot(w, buffer_len)
|
||||
pptr = (INK_PENDATA_RECORD *)malloc(inkRecordPenDataSize(dlen));
|
||||
pptr->header.recordType = inkRecordPenData;
|
||||
pptr->header.recordLength = inkRecordPenDataSize(dlen);
|
||||
pptr->bounds.origin.x = jptr->min_x;
|
||||
pptr->bounds.origin.x = jptr->min_x;
|
||||
pptr->bounds.origin.y = jptr->min_y;
|
||||
pptr->bounds.size.w = jptr->max_x - jptr->min_x + 1;
|
||||
pptr->bounds.size.h = jptr->max_y - jptr->min_y + 1;
|
||||
@ -719,7 +719,7 @@ JOTfromJot(w, buffer_len)
|
||||
bcopy((char *)pptr, (char *)(buffer + inkRecordBundleSize),
|
||||
inkRecordPenDataSize(dlen));
|
||||
*/
|
||||
memcpy((char *)(buffer + inkRecordBundleSize), (char *)pptr,
|
||||
memcpy((char *)(buffer + inkRecordBundleSize), (char *)pptr,
|
||||
inkRecordPenDataSize(dlen));
|
||||
/*
|
||||
bcopy((char *)eptr, (char *)(buffer + inkRecordBundleSize +
|
||||
|
@ -245,7 +245,7 @@ clean_white_space(txt)
|
||||
}
|
||||
|
||||
/*
|
||||
* If there are more words, insert a space and if space was
|
||||
* If there are more words, insert a space and if space was
|
||||
* removed move up remaining text.
|
||||
*/
|
||||
*start++ = ' ';
|
||||
@ -323,7 +323,7 @@ ExpandEscapes(esc, endp, termination)
|
||||
{
|
||||
int escLen, ampLen;
|
||||
cnt = 0;
|
||||
escLen = strlen(esc);
|
||||
escLen = strlen(esc);
|
||||
while (AmpEscapes[cnt].tag != NULL)
|
||||
{
|
||||
ampLen = strlen(AmpEscapes[cnt].tag);
|
||||
@ -657,7 +657,7 @@ get_mark(start, endp)
|
||||
ptr += 2;
|
||||
while ((*ptr != '\0') && ((*ptr == ' ') || (*ptr == '\n')
|
||||
|| (*ptr == '-') ))
|
||||
ptr++; /* skip spaces and newlines */
|
||||
ptr++; /* skip spaces and newlines */
|
||||
if (*ptr == '>') /* completed end comment */
|
||||
{
|
||||
*endp = ptr;
|
||||
@ -1048,13 +1048,13 @@ HTMLParse(old_list, str, hw)
|
||||
tmp_bgname=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mark->next = NULL;
|
||||
current = AddObj(&list, current, mark, preformat);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
start = (char *)(end + 1);
|
||||
|
||||
@ -1483,7 +1483,7 @@ AnchorTag(ptrp, startp, endp)
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* For a tag with no value, this is a boolean flag.
|
||||
* Return the string "1" so we know the tag is there.
|
||||
|
@ -22,8 +22,8 @@ extern char *ParseMarkTag();
|
||||
extern int htmlwTrace;
|
||||
#endif
|
||||
|
||||
/* Allocate a TableField and initialize to default values
|
||||
* return 0 on failure
|
||||
/* Allocate a TableField and initialize to default values
|
||||
* return 0 on failure
|
||||
*/
|
||||
static TableField *NewTableField()
|
||||
{
|
||||
@ -39,7 +39,7 @@ TableField *tf;
|
||||
tf->contHoriz = False;
|
||||
tf->maxWidth = DEFAULT_FIELD_WIDTH;
|
||||
tf->minWidth = DEFAULT_FIELD_WIDTH;
|
||||
tf->maxHeight = DEFAULT_FIELD_HEIGHT;
|
||||
tf->maxHeight = DEFAULT_FIELD_HEIGHT;
|
||||
tf->minHeight = DEFAULT_FIELD_HEIGHT;
|
||||
tf->header = False;
|
||||
|
||||
@ -87,11 +87,11 @@ char *end;
|
||||
|
||||
|
||||
|
||||
/* PourText() this routine pours a text string of a particular font into a
|
||||
rectangular area of specified dimensions. The return value is a list of
|
||||
/* PourText() this routine pours a text string of a particular font into a
|
||||
rectangular area of specified dimensions. The return value is a list of
|
||||
text lines that will fit within the given width.
|
||||
If a height is specified, then text will be truncated if necessary to fit.
|
||||
If height is 0, then all of the text is in the list.
|
||||
If height is 0, then all of the text is in the list.
|
||||
The actual pixel height of the text is returned in variable height.
|
||||
*/
|
||||
int PourText(text,font,width,height,percentVertSpace,formattedText,numberOfLines)
|
||||
@ -131,7 +131,7 @@ int y;
|
||||
*numberOfLines = 0;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
textList = ListCreate();
|
||||
stringWidth = XTextWidth(font,text,strlen(text));
|
||||
if (stringWidth < width) {
|
||||
@ -154,7 +154,7 @@ int y;
|
||||
GetWord(textPtr,&wordStart,&wordEnd);
|
||||
wordLength = (int) (wordEnd - wordStart);
|
||||
wordWidth = XTextWidth(font,wordStart, wordLength);
|
||||
if ((builtWidth + spaceWidth + wordWidth) < width) {
|
||||
if ((builtWidth + spaceWidth + wordWidth) < width) {
|
||||
/* then add to line */
|
||||
if (builtWidth) {
|
||||
/* only add space if something on line already*/
|
||||
@ -164,7 +164,7 @@ int y;
|
||||
strncat(tmpBuff, wordStart, wordLength);
|
||||
builtWidth += wordWidth;
|
||||
}
|
||||
else if (wordWidth < width) {
|
||||
else if (wordWidth < width) {
|
||||
/* start new line */
|
||||
ListAddEntry(textList, strdup(tmpBuff));
|
||||
*tmpBuff = '\0';
|
||||
@ -174,10 +174,10 @@ int y;
|
||||
strncat(tmpBuff, wordStart, wordLength);
|
||||
builtWidth += wordWidth;
|
||||
}
|
||||
else {
|
||||
else {
|
||||
/* word is too big to fit on a line */
|
||||
/* so break up word */
|
||||
|
||||
|
||||
/* start new line */
|
||||
ListAddEntry(textList, strdup(tmpBuff));
|
||||
*tmpBuff = '\0';
|
||||
@ -190,10 +190,10 @@ int y;
|
||||
while ((*wordEnd) && (width > wordWidth)) {
|
||||
wordEnd++;
|
||||
wordLength = (int) (wordEnd - wordStart);
|
||||
wordWidth = XTextWidth(font,wordStart,
|
||||
wordWidth = XTextWidth(font,wordStart,
|
||||
wordLength);
|
||||
}
|
||||
|
||||
|
||||
strncat(tmpBuff, wordStart, wordLength);
|
||||
builtWidth += wordWidth;
|
||||
|
||||
@ -244,7 +244,7 @@ int y;
|
||||
*numberOfLines = numLines;
|
||||
|
||||
return(numLines);
|
||||
|
||||
|
||||
} /* PourText() */
|
||||
|
||||
|
||||
@ -331,7 +331,7 @@ int x,y;
|
||||
|
||||
|
||||
/* move 2D link list table to an array for speed */
|
||||
if (!(t->table = (TableField *) malloc(sizeof(TableField)
|
||||
if (!(t->table = (TableField *) malloc(sizeof(TableField)
|
||||
* t->numColumns * t->numRows))) {
|
||||
return(0); /* out of memory */
|
||||
}
|
||||
@ -341,7 +341,7 @@ int x,y;
|
||||
x = 0;
|
||||
field = (TableField *) ListHead(rowList);
|
||||
while (field) {
|
||||
memcpy(&(t->table[y * t->numColumns + x]), field,
|
||||
memcpy(&(t->table[y * t->numColumns + x]), field,
|
||||
sizeof(TableField));
|
||||
x++;
|
||||
field = (TableField *) ListNext(rowList);
|
||||
@ -349,10 +349,10 @@ int x,y;
|
||||
y++;
|
||||
rowList = (List) ListNext(tableList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return(1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* return the number of connected fields */
|
||||
@ -422,7 +422,7 @@ int maxWidthOfColumn;
|
||||
int maxHeightOfRow;
|
||||
int sumMinWidth; /* summation of max widths */
|
||||
int maxWidthOfRow;
|
||||
int minWidthOfRow;
|
||||
int minWidthOfRow;
|
||||
int numAdjacent;
|
||||
float percentToShrink;
|
||||
int accumulateColWidth;
|
||||
@ -455,9 +455,9 @@ int accumulateColWidth;
|
||||
minWidthOfRow += field->minWidth;
|
||||
}
|
||||
/* save the length of the longest and shortest row */
|
||||
sumMaxWidth = (sumMaxWidth > maxWidthOfRow) ?
|
||||
sumMaxWidth = (sumMaxWidth > maxWidthOfRow) ?
|
||||
sumMaxWidth : maxWidthOfRow;
|
||||
sumMinWidth = (sumMinWidth > minWidthOfRow) ?
|
||||
sumMinWidth = (sumMinWidth > minWidthOfRow) ?
|
||||
sumMinWidth : minWidthOfRow;
|
||||
}
|
||||
|
||||
@ -508,15 +508,15 @@ int accumulateColWidth;
|
||||
/* find widest field in column */
|
||||
maxWidthOfColumn = 0;
|
||||
for (y = 0; y < t->numRows; y++ ) {
|
||||
maxWidthOfColumn =
|
||||
(maxWidthOfColumn >
|
||||
maxWidthOfColumn =
|
||||
(maxWidthOfColumn >
|
||||
t->table[y * t->numColumns + x].maxWidth)?
|
||||
maxWidthOfColumn :
|
||||
maxWidthOfColumn :
|
||||
t->table[y * t->numColumns+x].maxWidth;
|
||||
}
|
||||
/* assign uniform width to column */
|
||||
for (y = 0; y < t->numRows; y++) {
|
||||
t->table[y*t->numColumns + x].colWidth
|
||||
t->table[y*t->numColumns + x].colWidth
|
||||
= maxWidthOfColumn
|
||||
+ 2 * FIELD_BORDER_SPACE;
|
||||
}
|
||||
@ -525,10 +525,10 @@ int accumulateColWidth;
|
||||
/* find highest of minimum heights */
|
||||
maxHeightOfRow = 0;
|
||||
for (x=0; x < t->numColumns; x++) {
|
||||
maxHeightOfRow =
|
||||
(maxHeightOfRow >
|
||||
maxHeightOfRow =
|
||||
(maxHeightOfRow >
|
||||
t->table[y * t->numColumns + x].minHeight)?
|
||||
maxHeightOfRow:
|
||||
maxHeightOfRow:
|
||||
t->table[y * t->numColumns+x].minHeight;
|
||||
}
|
||||
/* assign uniform height to row */
|
||||
@ -575,7 +575,7 @@ int accumulateColWidth;
|
||||
/* format it */
|
||||
for (y = 0; y < t->numRows; y++) {
|
||||
field = &(t->table[y*t->numColumns+x]);
|
||||
field->colWidth = (int) (percentToShrink *
|
||||
field->colWidth = (int) (percentToShrink *
|
||||
((float) CalculateMaxWidthOfColumn(t,x)));
|
||||
field->rowHeight = 0;
|
||||
numAdjacent = TableHowManyConnectedHorizFields
|
||||
@ -587,7 +587,7 @@ int accumulateColWidth;
|
||||
(percentToShrink *
|
||||
((float) CalculateMaxWidthOfColumn(t,xx))));
|
||||
}
|
||||
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (htmlwTrace) {
|
||||
fprintf(stderr,"About to call PourText\n");
|
||||
@ -653,17 +653,17 @@ int accumulateColWidth;
|
||||
}
|
||||
/* assign height */
|
||||
for (x = 0; x < t->numColumns; x++) {
|
||||
t->table[y * t->numColumns + x].rowHeight =
|
||||
t->table[y * t->numColumns + x].rowHeight =
|
||||
maxHeightOfRow;
|
||||
}
|
||||
}
|
||||
|
||||
/* make sure all widths in a column are the same size */
|
||||
for (x = 0; x < t->numColumns; x++) {
|
||||
maxWidthOfColumn = 0;
|
||||
maxWidthOfColumn = 0;
|
||||
/* find biggest Width for this column */
|
||||
for (y = 0; y < t->numRows; y++) {
|
||||
maxWidthOfColumn = (maxWidthOfColumn >
|
||||
maxWidthOfColumn = (maxWidthOfColumn >
|
||||
t->table[y*t->numColumns+x].colWidth)?
|
||||
maxWidthOfColumn:
|
||||
t->table[y*t->numColumns+x].colWidth;
|
||||
@ -673,7 +673,7 @@ int accumulateColWidth;
|
||||
t->table[y*t->numColumns+x].colWidth = maxWidthOfColumn;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -740,7 +740,7 @@ Boolean expandedSomething;
|
||||
/* check for and take care of previous rowspans */
|
||||
if (rowCount > 1) {
|
||||
/* get field above this one */
|
||||
previousRow = (List) ListGetIndexedEntry(tableList,
|
||||
previousRow = (List) ListGetIndexedEntry(tableList,
|
||||
rowCount - 2);/*zero indexed*/
|
||||
aboveField =(TableField *)ListGetIndexedEntry(previousRow,
|
||||
*columnCount);
|
||||
@ -837,7 +837,7 @@ Boolean fixed;
|
||||
}
|
||||
m = m->next;
|
||||
}
|
||||
|
||||
|
||||
if (field->header) {
|
||||
field->font = hw->html.plainbold_font;
|
||||
}
|
||||
@ -904,7 +904,7 @@ char *tptr;
|
||||
while(TableExpandFields(tableList, rowList,
|
||||
rowCount, &columnCount));
|
||||
|
||||
/* if: is this the first container <tr> or the
|
||||
/* if: is this the first container <tr> or the
|
||||
separator */
|
||||
if (ListHead(ListHead(tableList))) {
|
||||
rowList = ListCreate();
|
||||
@ -1111,8 +1111,8 @@ int yy;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
placeY = y + height/2 +
|
||||
(field->font->max_bounds.ascent
|
||||
placeY = y + height/2 +
|
||||
(field->font->max_bounds.ascent
|
||||
- field->font->max_bounds.descent)/2;
|
||||
*/
|
||||
|
||||
@ -1158,7 +1158,7 @@ int x,y;
|
||||
x++;
|
||||
if (x < t->numColumns) {
|
||||
/* do width */
|
||||
while ((x < t->numColumns) &&
|
||||
while ((x < t->numColumns) &&
|
||||
t->table[y * t->numColumns + x].contHoriz) {
|
||||
(*expandWidth) += t->table[y * t->numColumns + x].colWidth;
|
||||
x++;
|
||||
@ -1169,14 +1169,14 @@ int x,y;
|
||||
y++;
|
||||
if (y < t->numRows) {
|
||||
/* do height */
|
||||
while ((y < t->numRows) &&
|
||||
while ((y < t->numRows) &&
|
||||
t->table[y * t->numColumns + x].contVert) {
|
||||
(*expandHeight) += t->table[y * t->numColumns+x].rowHeight;
|
||||
y++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1216,7 +1216,7 @@ int expandedWidth,expandedHeight;
|
||||
if (eptr->table_data->borders){
|
||||
/*
|
||||
XDrawRectangle(XtDisplay(hw), XtWindow(hw->html.view),
|
||||
hw->html.drawGC,
|
||||
hw->html.drawGC,
|
||||
x+(eptr->table_data->borders/2),y+eptr->table_data->borders,
|
||||
eptr->table_data->bwidth,
|
||||
eptr->table_data->bheight);
|
||||
@ -1237,14 +1237,14 @@ int expandedWidth,expandedHeight;
|
||||
/* draw field borders */
|
||||
if (eptr->table_data->borders){
|
||||
if (!field->contVert) { /* draw above line */
|
||||
XDrawLine(XtDisplay(hw),
|
||||
XDrawLine(XtDisplay(hw),
|
||||
XtWindow(hw->html.view),
|
||||
hw->html.drawGC,
|
||||
/*hw->manager.bottom_shadow_GC,*/
|
||||
vertMarker, horizMarker,
|
||||
vertMarker + colWidth, horizMarker);
|
||||
/*
|
||||
XDrawLine(XtDisplay(hw),
|
||||
XDrawLine(XtDisplay(hw),
|
||||
XtWindow(hw->html.view),
|
||||
hw->manager.top_shadow_GC,
|
||||
vertMarker, horizMarker+1,
|
||||
@ -1252,7 +1252,7 @@ int expandedWidth,expandedHeight;
|
||||
*/
|
||||
}
|
||||
if (!field->contHoriz) { /* draw left side*/
|
||||
XDrawLine(XtDisplay(hw),
|
||||
XDrawLine(XtDisplay(hw),
|
||||
XtWindow(hw->html.view),
|
||||
hw->html.drawGC,
|
||||
vertMarker, horizMarker,
|
||||
@ -1272,10 +1272,10 @@ int expandedWidth,expandedHeight;
|
||||
|
||||
vertMarker += colWidth;
|
||||
field++;
|
||||
}
|
||||
}
|
||||
|
||||
horizMarker += rowHeight;
|
||||
}
|
||||
}
|
||||
|
||||
XSetLineAttributes(XtDisplay(hw),
|
||||
hw->html.drawGC,
|
||||
|
@ -118,7 +118,7 @@ char **ParseCommaList();
|
||||
void FreeCommaList();
|
||||
char *MapOptionReturn();
|
||||
|
||||
static char traversal_table[] =
|
||||
static char traversal_table[] =
|
||||
"\
|
||||
~Shift ~Meta ~Ctrl <Key> Tab: traversal_forward()\n\
|
||||
Shift ~Meta ~Ctrl <Key> Tab: traversal_back()\n\
|
||||
@ -524,7 +524,7 @@ CollectSubmitInfo(fptr, name_list, value_list)
|
||||
cbdata.attribute_count--;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
/*** cvarela@ncsa.uiuc.edu: August 17, 1994
|
||||
Adding multiple submit buttons support ***/
|
||||
/* mods 3/11/95 -- amb */
|
||||
@ -1478,7 +1478,7 @@ PrepareFormEnd(hw, w, fptr)
|
||||
FormInfo *fptr;
|
||||
{
|
||||
#ifdef MOTIF
|
||||
XtAddCallback(w, XmNactivateCallback,
|
||||
XtAddCallback(w, XmNactivateCallback,
|
||||
(XtCallbackProc)CBSubmitForm, (caddr_t)fptr);
|
||||
#else
|
||||
XtAddCallback(w, XtNcallback,
|
||||
@ -1494,7 +1494,7 @@ PrepareFormReset(hw, w, fptr)
|
||||
FormInfo *fptr;
|
||||
{
|
||||
#ifdef MOTIF
|
||||
XtAddCallback(w, XmNactivateCallback,
|
||||
XtAddCallback(w, XmNactivateCallback,
|
||||
(XtCallbackProc)CBResetForm, (caddr_t)fptr);
|
||||
#else
|
||||
XtAddCallback(w, XtNcallback,
|
||||
@ -2256,9 +2256,9 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
{
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable("<Btn1Down>: Arm() traversal_current()"));
|
||||
}
|
||||
|
||||
@ -2324,7 +2324,7 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
w = XmCreateToggleButton(hw->html.view, widget_name,
|
||||
arg, argcnt);
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
|
||||
XtSetMappedWhenManaged(w, False);
|
||||
@ -2362,7 +2362,7 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
w = XmCreatePushButton(hw->html.view, widget_name,
|
||||
arg, argcnt);
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
XtSetMappedWhenManaged(w, False);
|
||||
XtManageChild(w);
|
||||
@ -2400,7 +2400,7 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
w = XmCreatePushButton(hw->html.view, widget_name,
|
||||
arg, argcnt);
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
XtSetMappedWhenManaged(w, False);
|
||||
XtManageChild(w);
|
||||
@ -2432,7 +2432,7 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
w = XmCreatePushButton(hw->html.view, widget_name,
|
||||
arg, argcnt);
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
XtSetMappedWhenManaged(w, False);
|
||||
XtManageChild(w);
|
||||
@ -2655,7 +2655,7 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
XtManageChild(button);
|
||||
XmStringFree(label);
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
XtOverrideTranslations(button,
|
||||
XtOverrideTranslations(button,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
if ((vlist_cnt > 0)&&
|
||||
(vlist[0] != NULL)&&
|
||||
@ -2688,9 +2688,9 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
XtSetArg(arg[argcnt], XmNx, x); argcnt++;
|
||||
XtSetArg(arg[argcnt], XmNy, y); argcnt++;
|
||||
/* kill margins */
|
||||
XtSetArg(arg[argcnt], XmNmarginWidth, 0);
|
||||
XtSetArg(arg[argcnt], XmNmarginWidth, 0);
|
||||
argcnt++;
|
||||
XtSetArg(arg[argcnt], XmNmarginHeight, 0);
|
||||
XtSetArg(arg[argcnt], XmNmarginHeight, 0);
|
||||
argcnt++;
|
||||
XtSetArg(arg[argcnt], XmNsubMenuId, pulldown);
|
||||
argcnt++;
|
||||
@ -2714,12 +2714,12 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
widget_name, arg, argcnt);
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
{
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
XtOverrideTranslations(pulldown,
|
||||
XtOverrideTranslations(pulldown,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
}
|
||||
|
||||
|
||||
argcnt = 0;
|
||||
|
||||
xmstr = XmStringCreateSimple ("");
|
||||
@ -2822,10 +2822,10 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
w = XmCreateList(scroll, widget_name,
|
||||
arg, argcnt);
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
XtManageChild(w);
|
||||
|
||||
|
||||
w = scroll;
|
||||
|
||||
for (i=0; i<list_cnt; i++)
|
||||
@ -2903,10 +2903,10 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
w = XmCreateTextField(hw->html.view, widget_name,
|
||||
arg, argcnt);
|
||||
XtOverrideTranslations(w, XtParseTranslationTable(text_translations));
|
||||
|
||||
|
||||
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
/*
|
||||
* The proper order here is XtSetMappedWhenManaged, XtManageChild. But a bug
|
||||
@ -3012,9 +3012,9 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
XtOverrideTranslations(w, XtParseTranslationTable(text_translations));
|
||||
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
|
||||
|
||||
|
||||
w = scroll;
|
||||
|
||||
@ -3061,7 +3061,7 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
type = W_TEXTAREA;
|
||||
cols = atoi(list[0]);
|
||||
rows = atoi(list[1]);
|
||||
|
||||
|
||||
/* be a textfield if only one row */
|
||||
if(rows==1)
|
||||
type=W_TEXTFIELD;
|
||||
@ -3117,7 +3117,7 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
widget_name, arg, argcnt);
|
||||
XtOverrideTranslations(w, XtParseTranslationTable(text_translations));
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
}
|
||||
/*
|
||||
@ -3158,7 +3158,7 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
XtManageChild(w);
|
||||
XtOverrideTranslations(w, XtParseTranslationTable(text_translations));
|
||||
if(!hw->html.focus_follows_mouse)
|
||||
XtOverrideTranslations(w,
|
||||
XtOverrideTranslations(w,
|
||||
XtParseTranslationTable(traversal_table));
|
||||
|
||||
|
||||
@ -3216,7 +3216,7 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
height = 0;
|
||||
}
|
||||
|
||||
wptr = AddNewWidget(hw, fptr, w, type, id, x, y, width,
|
||||
wptr = AddNewWidget(hw, fptr, w, type, id, x, y, width,
|
||||
height, name, value, mapping, checked);
|
||||
}
|
||||
else
|
||||
@ -3280,7 +3280,7 @@ MakeWidget(hw, text, x, y, id, fptr)
|
||||
WidgetInfo *wptr;
|
||||
Dimension width, height;
|
||||
|
||||
|
||||
|
||||
wlist = hw->html.widget_list;
|
||||
while (wlist != NULL)
|
||||
{
|
||||
@ -4148,13 +4148,13 @@ unsigned long bp=BlackPixel(XtDisplay(hw),DefaultScreen(XtDisplay(hw)));
|
||||
|
||||
void traversal_forward(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params)
|
||||
{
|
||||
{
|
||||
HTMLTraverseTabGroups(w, XmTRAVERSE_NEXT_TAB_GROUP);
|
||||
}
|
||||
|
||||
void traversal_back(Widget w, XEvent *event,
|
||||
String *params, Cardinal *num_params)
|
||||
{
|
||||
{
|
||||
HTMLTraverseTabGroups(w, XmTRAVERSE_PREV_TAB_GROUP);
|
||||
}
|
||||
|
||||
@ -4227,7 +4227,7 @@ void HTMLTraverseTabGroups(Widget w, int how)
|
||||
top = (Widget) hw;
|
||||
while(!XtIsTopLevelShell(top))
|
||||
top = XtParent(top);
|
||||
|
||||
|
||||
switch(how)
|
||||
{
|
||||
case XmTRAVERSE_NEXT_TAB_GROUP:
|
||||
@ -4251,7 +4251,7 @@ void HTMLTraverseTabGroups(Widget w, int how)
|
||||
}
|
||||
|
||||
/* automagickly scroll */
|
||||
if(XtIsManaged(hw->html.vbar) &&
|
||||
if(XtIsManaged(hw->html.vbar) &&
|
||||
(lptr->y > (hw->html.view_height+hw->html.scroll_y-10)))
|
||||
{
|
||||
int val, ss, in, pg_in, amount;
|
||||
@ -4273,7 +4273,7 @@ void HTMLTraverseTabGroups(Widget w, int how)
|
||||
Widget text;
|
||||
XtVaGetValues(lptr->w, XmNworkWindow, &text, NULL);
|
||||
XtSetKeyboardFocus(top, text);
|
||||
}
|
||||
}
|
||||
else
|
||||
XtSetKeyboardFocus(top, lptr->w);
|
||||
break;
|
||||
@ -4298,7 +4298,7 @@ void HTMLTraverseTabGroups(Widget w, int how)
|
||||
}
|
||||
|
||||
/* automagickly scroll */
|
||||
if(XtIsManaged(hw->html.vbar) &&
|
||||
if(XtIsManaged(hw->html.vbar) &&
|
||||
(lptr->y < hw->html.scroll_y+10))
|
||||
{
|
||||
int val, ss, in, pg_in, amount;
|
||||
@ -4329,9 +4329,9 @@ void HTMLTraverseTabGroups(Widget w, int how)
|
||||
break;
|
||||
case XmTRAVERSE_CURRENT:
|
||||
lptr = hw->html.widget_list;
|
||||
|
||||
|
||||
/* check parent to allow for text areas (lptr->w would be scroll) */
|
||||
while(lptr!=NULL)
|
||||
while(lptr!=NULL)
|
||||
{
|
||||
if((lptr->w == w) || (lptr->w == XtParent(w)))
|
||||
break;
|
||||
|
@ -2,7 +2,7 @@ LIBTARGET = libhtmlw.a
|
||||
|
||||
all: $(LIBTARGET)
|
||||
|
||||
CFILES = HTML.c HTMLlists.c HTMLformat.c HTMLparse.c HTMLimages.c HTMLwidgets.c HTML-PSformat.c DrawingArea.c HTMLjot.c HTMLtable.c list.c
|
||||
CFILES = HTML.c HTMLlists.c HTMLformat.c HTMLparse.c HTMLimages.c HTMLwidgets.c HTML-PSformat.c DrawingArea.c HTMLjot.c HTMLtable.c list.c
|
||||
|
||||
OBJS = $(CFILES:.c=.o)
|
||||
$(OBJS): HTML.h HTMLP.h
|
||||
|
@ -1,7 +1,7 @@
|
||||
# @configure_output@
|
||||
# This file is used by Autoconf to make the real Makefile.
|
||||
# DO NOT EDIT THIS FILE!
|
||||
# If you want to change something do it to the Makefile autoconf
|
||||
# If you want to change something do it to the Makefile autoconf
|
||||
# creates. You should never have to edit this file.
|
||||
|
||||
CC= @CC@
|
||||
@ -14,7 +14,7 @@ LIBTARGET = libhtmlw.a
|
||||
|
||||
all: $(LIBTARGET)
|
||||
|
||||
CFILES = HTML.c HTMLlists.c HTMLformat.c HTMLparse.c HTMLimages.c HTMLwidgets.c HTML-PSformat.c DrawingArea.c HTMLjot.c HTMLtable.c list.c
|
||||
CFILES = HTML.c HTMLlists.c HTMLformat.c HTMLparse.c HTMLimages.c HTMLwidgets.c HTML-PSformat.c DrawingArea.c HTMLjot.c HTMLtable.c list.c
|
||||
|
||||
OBJS = $(CFILES:.c=.o)
|
||||
$(OBJS): HTML.h HTMLP.h
|
||||
|
@ -2,7 +2,7 @@ LIBTARGET = libhtmlw.a
|
||||
|
||||
all: $(LIBTARGET)
|
||||
|
||||
CFILES = HTML.c HTMLlists.c HTMLformat.c HTMLparse.c HTMLimages.c HTMLwidgets.c HTML-PSformat.c DrawingArea.c HTMLjot.c HTMLtable.c list.c
|
||||
CFILES = HTML.c HTMLlists.c HTMLformat.c HTMLparse.c HTMLimages.c HTMLwidgets.c HTML-PSformat.c DrawingArea.c HTMLjot.c HTMLtable.c list.c
|
||||
|
||||
OBJS = $(CFILES:.c=.o)
|
||||
$(OBJS): HTML.h HTMLP.h
|
||||
|
@ -8,18 +8,18 @@
|
||||
** of representatives of Slate Corporation, Lotus Development Corporation,
|
||||
** GO, Microsoft, Apple, General Magic, and others.
|
||||
**
|
||||
** This document and the accompanying code samples on disk comprise Version
|
||||
** 1.0 of the Jot specification for the storage and interchange of electronic
|
||||
** ink data. Permission is granted to incorporate and otherwise use any
|
||||
** portion of the specification. You may make copies of the specification
|
||||
** for distribution to others, provided you include the notice "Copyright
|
||||
** This document and the accompanying code samples on disk comprise Version
|
||||
** 1.0 of the Jot specification for the storage and interchange of electronic
|
||||
** ink data. Permission is granted to incorporate and otherwise use any
|
||||
** portion of the specification. You may make copies of the specification
|
||||
** for distribution to others, provided you include the notice "Copyright
|
||||
** 1993, Slate Corporation. All Rights Reserved" on both the document and
|
||||
** the disk label. You may not modify this specification without written
|
||||
** the disk label. You may not modify this specification without written
|
||||
** permission from Slate Corporation.
|
||||
**
|
||||
** The specification is provided "as is" without warranty of any kind. Slate
|
||||
** further disclaims all implied warranties of merchantability or of fitness
|
||||
** for a particular purpose. The entire risk arising out of the use or
|
||||
** The specification is provided "as is" without warranty of any kind. Slate
|
||||
** further disclaims all implied warranties of merchantability or of fitness
|
||||
** for a particular purpose. The entire risk arising out of the use or
|
||||
** performance of the specification remains with you.
|
||||
**
|
||||
**--------------------------------------------------------------------------
|
||||
@ -54,10 +54,10 @@
|
||||
** electronic ink data interchange, and neither assumes nor dictates the
|
||||
** nature of how the application deals with ink data internally. The format
|
||||
** is not intended to be the "internal" ink format of an application, though
|
||||
** there is no reason why it could not serve such a purpose.
|
||||
** there is no reason why it could not serve such a purpose.
|
||||
**
|
||||
** The scope and goals of this format design are limited to the represent-
|
||||
** ation of electronic ink data embedded in some other electronic document,
|
||||
** ation of electronic ink data embedded in some other electronic document,
|
||||
** not to the larger document itself (such as an e-mail or enhanced word-
|
||||
** processing data file).
|
||||
**
|
||||
@ -70,28 +70,28 @@
|
||||
** or sub-strokes, and then storing a list of encodings of these sub-strokes.
|
||||
** In other words, Jot preserves all information about the original input as
|
||||
** opposed attempting any sort of abstract characterization of the input.
|
||||
**
|
||||
**
|
||||
** The storage format has a number of properties:
|
||||
**
|
||||
**
|
||||
** * Simple. Typical operations on the ink data are easy. If you only wish
|
||||
** to read stroke coordinates and bounding information from the data,
|
||||
** complex information that might be present will not hinder the process.
|
||||
** Likewise, it is easy to write out just simple information. The
|
||||
** complex information is all optional.
|
||||
**
|
||||
** * Compact. The storage format is intended to be as compact as possible
|
||||
**
|
||||
** * Compact. The storage format is intended to be as compact as possible
|
||||
** without sacrificing simplicity or fidelity. Optional information such
|
||||
** as time stamps or color specifications occupy space only when they are
|
||||
** present. Specifications that apply to many strokes (such as line width
|
||||
** or color) are represented just once.
|
||||
**
|
||||
**
|
||||
** * Compression. The stroke information that describes the ink can
|
||||
** optionally be represented in a compressed format. Compression
|
||||
** techniques include both compression and reduction of the ink data.
|
||||
**
|
||||
**
|
||||
** * Inclusive. The format is capable of storing every property of ink
|
||||
** conceivable as of today.
|
||||
**
|
||||
** conceivable as of today.
|
||||
**
|
||||
** * Expandable and Compatible. The format is expandable, so as developers
|
||||
** discover new information that should be recorded in an ink storage
|
||||
** format, these new features can be added without changing the behavior of
|
||||
@ -100,21 +100,21 @@
|
||||
** applications reading older versions of the format. Likewise, new
|
||||
** application programs can handle previous versions of the format without
|
||||
** special work.
|
||||
**
|
||||
**
|
||||
** The format is not designed to easily support lots of in-memory
|
||||
** manipulation of the ink data, such as deleting strokes, changing line
|
||||
** widths, and so on. A format supporting these types of manipulations would
|
||||
** be at odds with the above goals. All the information needed to perform
|
||||
** these manipulations is present in this data format, so an application
|
||||
** might augment this format to facilitate manipulation of the ink data.
|
||||
**
|
||||
**
|
||||
** Applications are likely to use some other format internally for real-time
|
||||
** ink manipulation. Many operating environments provide some internal means
|
||||
** for storing and manipulating ink data, the details of which may be hidden
|
||||
** to some extent from the application designer. Many such real-time data
|
||||
** structures store fewer types of and/or less information (such as not
|
||||
** preserving information about the tablet point data rate) than are covered
|
||||
** in this definition.
|
||||
** in this definition.
|
||||
**
|
||||
**------------------------------------------------------------------------*/
|
||||
|
||||
@ -141,15 +141,15 @@
|
||||
** April 12, 1993 - Release of version 0.99 of the specification. Moved
|
||||
** reference sections 28 and 29 to a separate file called
|
||||
** sample.h
|
||||
** May 01, 1993 - Release of version 1.00 of the specification.
|
||||
** Changed INK_OFFSET_RECORD units from twips to pen
|
||||
** May 01, 1993 - Release of version 1.00 of the specification.
|
||||
** Changed INK_OFFSET_RECORD units from twips to pen
|
||||
** units for consistency and ease of implementation.
|
||||
** Fixed a typo in reference section 26.0 in the diagram.
|
||||
** The text accompanying the diagram was correct.
|
||||
** Fixed a typo in reference section 27.0. The old text
|
||||
** "delta-X == 0 or 1" was replaced with the correct text
|
||||
** "delta-X == 2". The accompanying diagram was correct.
|
||||
** Removed all sizeof() constructs and replaced with
|
||||
** Removed all sizeof() constructs and replaced with
|
||||
** appropriate #defines to reduce compiler dependencies.
|
||||
** Tagged all struct definitions with tag_ prefix.
|
||||
** Added comments and reordered some existing comments.
|
||||
@ -171,12 +171,12 @@
|
||||
** storage of point data in "standard compression" format. Sign bits are
|
||||
** used to indicate item types, so the bytes are stored high-order to low-
|
||||
** order (exactly opposite). See the sample code and reference section 23.0
|
||||
** for more information on the compressed format. Uncompressed data is
|
||||
** for more information on the compressed format. Uncompressed data is
|
||||
** written in Intel order.
|
||||
**
|
||||
** All structures are packed for the purposes of writing to a stream.
|
||||
**
|
||||
** Signed integer values are two's-complement. Rectangles are stored
|
||||
**
|
||||
** Signed integer values are two's-complement. Rectangles are stored
|
||||
** x,y,w,h.
|
||||
**
|
||||
** These definitions are intended to insulate the sample ink compaction and
|
||||
@ -193,13 +193,13 @@
|
||||
** Record Sequence
|
||||
** ---------------
|
||||
**
|
||||
** In this document, one piece of ink data is called an ink bundle.
|
||||
** In this document, one piece of ink data is called an ink bundle.
|
||||
** Typically this might correspond to the strokes that make up the ink from
|
||||
** the time when the pen touches down until the user finishes writing
|
||||
** (usually determined by a timeout or the pen leaving proximity). Thus an
|
||||
** ink bundle usually contains many ink strokes, and the strokes do not have
|
||||
** to describe a continuous line of ink.
|
||||
**
|
||||
**
|
||||
** As stated in reference section 5.0, all data conforming to this
|
||||
** specification appears as a stream of ink bundles each of which must begin
|
||||
** with an INK_BUNDLE_RECORD and end with an INK_END_RECORD. There may be
|
||||
@ -215,7 +215,7 @@
|
||||
** INK_GROUP_RECORD optional // tags the following PENDATA
|
||||
** INK_PENDATA_RECORD recommended // actual points
|
||||
** INK_GROUP_RECORD optional // tags the following PENDATA
|
||||
** INK_PENDATA_RECORD recommended // actual points
|
||||
** INK_PENDATA_RECORD recommended // actual points
|
||||
** INK_PENDATA_RECORD recommended // more points in same group
|
||||
** INK_SCALE_RESET_RECORD optional // resets to default scaling/offset
|
||||
** INK_PENDATA_RECORD recommended // actual points
|
||||
@ -223,32 +223,32 @@
|
||||
** INK_END_RECORD required // end of bundle number one
|
||||
**
|
||||
** It is perfectly reasonable to write out only the following (though doing
|
||||
** so will cause the ink to be rendered in a completely default manner --
|
||||
** so will cause the ink to be rendered in a completely default manner --
|
||||
** black hairline width at 1:1 scaling with offset 0):
|
||||
**
|
||||
** INK_BUNDLE_RECORD
|
||||
** INK_PENDATA_RECORD
|
||||
** INK_END_RECORD
|
||||
**
|
||||
**
|
||||
**
|
||||
** Specification Revisions
|
||||
** -----------------------
|
||||
**
|
||||
** Future enhancements to this specification may modify certain record types.
|
||||
** It is guaranteed that any record modified in a subsequent revision of the
|
||||
** specification will be a strict superset of that record's definition in any
|
||||
** previous revision of the specification. That is, modified record types
|
||||
** will only be lengthened, not shortened. If a particular record type must
|
||||
** be extended such that it would not be a superset of the original, a new
|
||||
** record type would be added to cover that particular extension.
|
||||
**
|
||||
** This extension strategy has two important ramifications:
|
||||
**
|
||||
** 1) A reading application should *ALWAYS* use the size of a record as
|
||||
** Future enhancements to this specification may modify certain record types.
|
||||
** It is guaranteed that any record modified in a subsequent revision of the
|
||||
** specification will be a strict superset of that record's definition in any
|
||||
** previous revision of the specification. That is, modified record types
|
||||
** will only be lengthened, not shortened. If a particular record type must
|
||||
** be extended such that it would not be a superset of the original, a new
|
||||
** record type would be added to cover that particular extension.
|
||||
**
|
||||
** This extension strategy has two important ramifications:
|
||||
**
|
||||
** 1) A reading application should *ALWAYS* use the size of a record as
|
||||
** recorded in the record structure itself (i.e., the recordLength field
|
||||
** of the INK_RECORD_HEADERx structure) rather than the sizeof() or any
|
||||
** other size determined at compile time to determine how may bytes to
|
||||
** read as the data structures are parsed. This is due to the fact that
|
||||
** other size determined at compile time to determine how may bytes to
|
||||
** read as the data structures are parsed. This is due to the fact that
|
||||
** a record may grow in a future revision of the standard. The only
|
||||
** exception to this rule is the INK_BUNDLE_RECORD which contains a
|
||||
** version number that will be modified with each change to that record.
|
||||
@ -256,17 +256,17 @@
|
||||
** version used at compile time, the size of the record should exactly
|
||||
** match the #define of inkRecordBundleSize.
|
||||
**
|
||||
** 2) Any particular record may be read into a target data structure up to
|
||||
** the size of the target data structure and the rest may be ignored.
|
||||
** This is due to the 'strict superset' rule which means that any
|
||||
** 2) Any particular record may be read into a target data structure up to
|
||||
** the size of the target data structure and the rest may be ignored.
|
||||
** This is due to the 'strict superset' rule which means that any
|
||||
** extension of any record type must leave the meaning, content, and size
|
||||
** of any existing fields as is. So, for example, if an INK_SCALE_RECORD
|
||||
** was modified by adding 2 bytes, the reading application can safely read
|
||||
** the data into the INK_SCALE_RECORD known at compile time and throw
|
||||
** away the extra two bytes: the header, x, and y will be in the same
|
||||
** away the extra two bytes: the header, x, and y will be in the same
|
||||
** place and will have the same meaning.
|
||||
**
|
||||
**
|
||||
**
|
||||
** Files of Ink
|
||||
** ------------
|
||||
**
|
||||
@ -386,14 +386,14 @@ typedef struct tag_XY16 {
|
||||
} XY16, FAR *P_XY16;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** Note:
|
||||
** Note:
|
||||
** Angles from vertical can exceed +-90 degrees: in this case, the "back" end
|
||||
** of the stylus is nearer the tablet surface than the "front" end.
|
||||
**-------------------------------------------------------------------------*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** Note:
|
||||
** Standard compaction will normally store angles in nibbles, or single
|
||||
** Note:
|
||||
** Standard compaction will normally store angles in nibbles, or single
|
||||
** bytes, rather than in four-byte records.
|
||||
**-------------------------------------------------------------------------*/
|
||||
|
||||
@ -505,7 +505,7 @@ typedef U16 INK_RECORD_TYPE, FAR *P_INK_RECORD_TYPE;
|
||||
)
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** Note: most compilers will not generate code for the above macro but will
|
||||
** Note: most compilers will not generate code for the above macro but will
|
||||
** determine the proper value at compile time.
|
||||
**-------------------------------------------------------------------------*/
|
||||
|
||||
@ -598,7 +598,7 @@ typedef struct tag_INK_RECORD_HEADER32 {
|
||||
** the following minimum requirements:
|
||||
**
|
||||
** 1) header.recordType == INK_RECORD_BUNDLE
|
||||
** 2) header.recordLength >= inkRecordBundleSize (See general notes in
|
||||
** 2) header.recordLength >= inkRecordBundleSize (See general notes in
|
||||
** reference section 1.0 for important information about record sizes.)
|
||||
** 3) compactionType is an expected and supported value
|
||||
** 4) penUnitsPerX and penUnitsPerY seem reasonable and expected:
|
||||
@ -628,7 +628,7 @@ typedef struct tag_INK_END_RECORD {
|
||||
** data, while smaller, is still whole. That is, compression under Jot is
|
||||
** loss-less. Compaction refers to a process where certain pieces of less
|
||||
** important data are actually omitted from the stream and are possibly
|
||||
** reconstructed by the reader of the data.
|
||||
** reconstructed by the reader of the data.
|
||||
**
|
||||
** Using Jot, a writing application may choose to compress only, compact only
|
||||
** or use some combination. The standard compression mechanism defined here
|
||||
@ -654,13 +654,13 @@ typedef U8 INK_COMPACTION_TYPE, FAR *P_INK_COMPACTION_TYPE;
|
||||
/*************************/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** The INK_BUNDLE_FLAGS contain some flags that apply to an entire bundle.
|
||||
** The INK_BUNDLE_FLAGS contain some flags that apply to an entire bundle.
|
||||
** If you wanted to store several pieces of ink that had different
|
||||
** INK_BUNDLE_FLAGS, you would do it by storing several different bundles.
|
||||
**
|
||||
** Advisory flags:
|
||||
**
|
||||
** inkPointsRemoved
|
||||
** inkPointsRemoved
|
||||
** Indicates whether all original points are still present or whether
|
||||
** some points were removed to save space. For applications that are
|
||||
** only interested in the visual aspects of ink, many points can be
|
||||
@ -677,12 +677,12 @@ typedef U8 INK_COMPACTION_TYPE, FAR *P_INK_COMPACTION_TYPE;
|
||||
** replacing individual points with an "elided point" item does not
|
||||
** constitute removing points. ("Elided" means omitted or skipped).
|
||||
**
|
||||
** inkProxDataRemoved
|
||||
** inkProxDataRemoved
|
||||
** Indicates that the original points between strokes (proximity) were
|
||||
** removed to save space. An out-of-prox point should be stored between
|
||||
** strokes to delimit them. Some applications depend on knowing the
|
||||
** time between strokes or at the ends of strokes for certain
|
||||
** functions.
|
||||
** functions.
|
||||
**
|
||||
** Note:
|
||||
** "Proximity" is defined as the stylus being close enough to the tablet
|
||||
@ -691,17 +691,17 @@ typedef U8 INK_COMPACTION_TYPE, FAR *P_INK_COMPACTION_TYPE;
|
||||
** recommended practice is to include "out of proximity" points in the
|
||||
** recorded ink data when they are used as part of determining the
|
||||
** amount of time a stylus was out of contact with the tablet, or for
|
||||
** triggering the completion of an action such as a "gesture".
|
||||
** triggering the completion of an action such as a "gesture".
|
||||
**
|
||||
** inkStrokeLimitsPresent
|
||||
** inkStrokeLimitsPresent
|
||||
** Indicates that INK_BUTTONS items are also present, and that they
|
||||
** indicate what the storing app decided the stroke start/end points
|
||||
** were. (Note: the reading application may otherwise use a different
|
||||
** algorithm for using tip force values to delimit strokes.)
|
||||
** algorithm for using tip force values to delimit strokes.)
|
||||
**
|
||||
** Note:
|
||||
** If inkStrokeLimitsPresent is set, then inkButtonDataPresent must also
|
||||
** be set.
|
||||
** be set.
|
||||
**
|
||||
** Data flags:
|
||||
**
|
||||
@ -716,7 +716,7 @@ typedef U8 INK_COMPACTION_TYPE, FAR *P_INK_COMPACTION_TYPE;
|
||||
** the offset value is added ("pre-multiply")
|
||||
** rather than after ("post-multiply")
|
||||
**
|
||||
** Note:
|
||||
** Note:
|
||||
** A previous draft version included a provision for compacting data to an
|
||||
** approximation based on Bezier curves. Initial results did not show
|
||||
** promise in terms of efficiency and performance.
|
||||
@ -728,7 +728,7 @@ typedef U8 INK_COMPACTION_TYPE, FAR *P_INK_COMPACTION_TYPE;
|
||||
** not be used directly to render the data. The definition of these anchor
|
||||
** and control points, and the example code for the approximation and
|
||||
** regeneration of the "true" coordinates could not be worked out at this
|
||||
** time.
|
||||
** time.
|
||||
**
|
||||
** Some standard values for pen units per meter follow:
|
||||
**
|
||||
@ -742,7 +742,7 @@ typedef U8 INK_COMPACTION_TYPE, FAR *P_INK_COMPACTION_TYPE;
|
||||
**
|
||||
** The specific format for each of these types of data is described in the
|
||||
** INK_PENDATA_RECORD documentation (reference section 8.0).
|
||||
**
|
||||
**
|
||||
** Note:
|
||||
** The order in which these flags are defined has nothing to do with the
|
||||
** order in which the data appears in the INK_POINT structure when reading
|
||||
@ -798,7 +798,7 @@ typedef struct tag_INK_BUNDLE_RECORD {
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** A penData record contains the actual pen data for one or more pen strokes.
|
||||
** The bounds applies to all the strokes contained within this record.
|
||||
** The bounds applies to all the strokes contained within this record.
|
||||
** Multiple strokes are typically grouped into one record to increase the
|
||||
** efficiency of the compression algorithm, though strokes may be stored
|
||||
** individually, if desired.
|
||||
@ -823,7 +823,7 @@ typedef struct tag_INK_BUNDLE_RECORD {
|
||||
** written by other applications that might group multiple strokes
|
||||
** into a single INK_PENDATA_RECORD.
|
||||
**
|
||||
** Note:
|
||||
** Note:
|
||||
** In practice, our experience is that unpacking the data in order to compute
|
||||
** the bounds for each stroke to check for strokes that intrude into a given
|
||||
** region is not an excessive burden. The checks that would have been done
|
||||
@ -860,31 +860,31 @@ typedef struct tag_INK_PENDATA_RECORD {
|
||||
** of one) is represented as 0x00010000, a scale of 0.5 as 0x00008000.
|
||||
**
|
||||
** Note:
|
||||
** All ink is located relative to the lower-left (0,0) corner of a logical
|
||||
** page or window. Scale and offset operations are cumulative, much in the
|
||||
** All ink is located relative to the lower-left (0,0) corner of a logical
|
||||
** page or window. Scale and offset operations are cumulative, much in the
|
||||
** same way as in PostScript. One begins with a normalized graphics state
|
||||
** and sequentially applies the scale and offset operations to that matrix.
|
||||
** and sequentially applies the scale and offset operations to that matrix.
|
||||
** The INK_SCALE_RESET record returns the graphics state to its default state
|
||||
** (i.e., the transformation matrix is set to an identity matrix and the
|
||||
** offset is reset to the default of 0). By default, scaling is applied
|
||||
** after adding in any offset specified in an INK_OFFSET_RECORD. If the ink
|
||||
** bundle has the inkPreMultiplyScale bit set, for all ink in that bundle
|
||||
** scaling is applied before adding in any offset.
|
||||
**
|
||||
**
|
||||
** As used in this format, ink scale and offset values are set by the storing
|
||||
** application, to be applied by the rendering application. If the storing
|
||||
** application collected the ink at scales of (2.0,2.0), the storing
|
||||
** application should insert an INK_SCALE_RECORD with a scale of (0.5,0.5)
|
||||
** for the rendering application to multiply all ink X and Y coordinates by.
|
||||
**
|
||||
** It is the responsibility of the storing application to deal with any
|
||||
** It is the responsibility of the storing application to deal with any
|
||||
** effects from round-off or truncation error due to the limits of precision
|
||||
** in the FIXED_FRACTION values used in INK_SCALE_RECORDs.
|
||||
**
|
||||
** An ink scale record indicates a scale change that stays in effect until
|
||||
** another ink scale record is encountered. Ink scale values compound: if
|
||||
** the current scale is (2.0,2.0) and an INK_SCALE_RECORD is encountered with
|
||||
** scale of (2.0,3.0), the scale to be applied to ink then becomes(4.0,6.0).
|
||||
** scale of (2.0,3.0), the scale to be applied to ink then becomes(4.0,6.0).
|
||||
** In absence of any ink scale record, the default ink scale is unity. In
|
||||
** general, a typical usage pattern for an application that supports drawing
|
||||
** ink while zoomed at scale is to record a number of strokes at a given
|
||||
@ -940,10 +940,10 @@ typedef struct tag_INK_SCALE_RECORD {
|
||||
** would have an offset position, markup ink over an entire form would not
|
||||
** have a offset position (or would have an offset position of (0,0) and a
|
||||
** scale of (1,1)) because it is relative to the entire form coordinate
|
||||
** system, not relative to some piece in the form.
|
||||
** system, not relative to some piece in the form.
|
||||
**
|
||||
** Note:
|
||||
** This approach allows a reader to "blindly" apply the scale and offset
|
||||
** This approach allows a reader to "blindly" apply the scale and offset
|
||||
** values specified to ink data, and puts the burden for computing
|
||||
** compounding of multiple zoom levels, etc., on the writing application.
|
||||
**
|
||||
@ -993,10 +993,10 @@ typedef struct tag_INK_SCALE_RESET_RECORD {
|
||||
** "erase" function, such as the ability to erase annotation ink on an
|
||||
** "original" document (perhaps a FAX image) the "erase" color restores the
|
||||
** background image where painted. The "background image" is defined by the
|
||||
** rendering application.
|
||||
** rendering application.
|
||||
**
|
||||
** Applications which do not support a true "erase" function may interpret
|
||||
** this as some other drawing function, such as drawing the "background"
|
||||
** this as some other drawing function, such as drawing the "background"
|
||||
** color.
|
||||
**
|
||||
**------------------------------------------------------------------------*/
|
||||
@ -1022,8 +1022,8 @@ typedef struct tag_INK_COLOR_RECORD {
|
||||
/*-------------------------------------------------------------------------
|
||||
** Standardized opacity values:
|
||||
** A recommended practice is that an opacity value of 128 (midway between
|
||||
** 0 and 255) be used for "highlighter" colors. A recommended practice is
|
||||
** that grey values as defined below be used for "standard grey"
|
||||
** 0 and 255) be used for "highlighter" colors. A recommended practice is
|
||||
** that grey values as defined below be used for "standard grey"
|
||||
** highlighters.
|
||||
**-------------------------------------------------------------------------*/
|
||||
|
||||
@ -1055,7 +1055,7 @@ typedef struct tag_INK_COLOR_RECORD {
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** Time is measured in milliseconds.
|
||||
**
|
||||
**
|
||||
** Note:
|
||||
** Because of the difficulty synchronizing clocks on different machines
|
||||
** at the time granularity of digitizing tablets, and because the "editing"
|
||||
@ -1069,12 +1069,12 @@ typedef struct tag_INK_COLOR_RECORD {
|
||||
** End time records are not required. The interpretation of an end time
|
||||
** which is in conflict with the end time inferred from the assumed data rate
|
||||
** of points and the number of points (including elided points) is not
|
||||
** defined.
|
||||
** defined.
|
||||
**
|
||||
** Start time is the time for the first point in the following penData record
|
||||
** and end time is the time of the last point in the following penData
|
||||
** record, because if you are recording tip force, the exact definition of
|
||||
** pen up and pen down may be fuzzy and/or application dependent.
|
||||
** pen up and pen down may be fuzzy and/or application dependent.
|
||||
**
|
||||
**------------------------------------------------------------------------*/
|
||||
|
||||
@ -1107,7 +1107,7 @@ typedef struct tag_INK_END_TIME_RECORD {
|
||||
/*-------------------------------------------------------------------------
|
||||
** INK_PENDATA_RECORDs can be grouped. If they are grouped, each
|
||||
** INK_PENDATA_RECORD can be assigned a group number. All
|
||||
** INK_PENDATA_RECORDs with the same group number belong to the same group.
|
||||
** INK_PENDATA_RECORDs with the same group number belong to the same group.
|
||||
**
|
||||
** The exact interpretation of grouping is up the applications involved.
|
||||
** Writing applications may group ink data, but not all reading applications
|
||||
@ -1156,7 +1156,7 @@ typedef struct tag_INK_GROUP_RECORD {
|
||||
/**************************/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** Some applications may support the idea of rendering ink as if it were
|
||||
** Some applications may support the idea of rendering ink as if it were
|
||||
** drawn by a certain shaped pen tip. The most common pen tips would be
|
||||
** round or rectangular. The exact details of how to render a given pen
|
||||
** tip will be application specific, but this record states what pen tip
|
||||
@ -1169,15 +1169,15 @@ typedef struct tag_INK_GROUP_RECORD {
|
||||
** at the end of the structure.
|
||||
**
|
||||
** The writing application should be aware that the reading application will
|
||||
** only do "the best possible" job of rendering and that fully compliant
|
||||
** only do "the best possible" job of rendering and that fully compliant
|
||||
** reading applications may not be able to render certain nib types and/or
|
||||
** colors. Both reading and writing applications should pay particular
|
||||
** attention to the following notes regarding defaults and ink drawn at a
|
||||
** width of zero.
|
||||
**
|
||||
**
|
||||
** A pen tip which is drawing ink in zero width renders at the minimum
|
||||
** visible width the reading application will support.
|
||||
**
|
||||
**
|
||||
** A recommended practice is that ink which should not render (should this
|
||||
** be called for) be drawn with a color value of (0,0,0, 0), i.e., black,
|
||||
** completely transparent.
|
||||
@ -1185,14 +1185,14 @@ typedef struct tag_INK_GROUP_RECORD {
|
||||
** Pen tip size should scale when an INK_SCALE_RECORD is encountered. The
|
||||
** writing application should write a new INK_PENTIP_RECORD after an
|
||||
** INK_SCALE_RECORD if the writing application does not want the pen tip
|
||||
** size to scale along with the ink. If the pen tip scales to zero width,
|
||||
** size to scale along with the ink. If the pen tip scales to zero width,
|
||||
** it should be rendered by the reading application according to the comment
|
||||
** above.
|
||||
**
|
||||
** The default pen tip if no pentip record exists is INK_PENTIP_ROUND, with a
|
||||
** width of one twip. The dimensions of a round nib specify diameter, not
|
||||
** radius: the X/Y coordinate is the center of this diameter. Similarly, for
|
||||
** for rectangular nibs, the X/Y coordinate is the center of the rectangle.
|
||||
** for rectangular nibs, the X/Y coordinate is the center of the rectangle.
|
||||
**
|
||||
** Note:
|
||||
** This specification does not specify information for an algorithmic
|
||||
@ -1201,7 +1201,7 @@ typedef struct tag_INK_GROUP_RECORD {
|
||||
** application to draw wider ink as the user presses down harder with the
|
||||
** stylus. Applications wishing to implement such features may do so using
|
||||
** application-specific record types for this revision of the specification.
|
||||
**
|
||||
**
|
||||
**------------------------------------------------------------------------*/
|
||||
|
||||
typedef S16 INK_PENTIP, FAR *P_INK_PENTIP;
|
||||
@ -1248,7 +1248,7 @@ typedef struct tag_INK_PENTIP_RECORD {
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** For some applications, it will be important to know the sampling rate of
|
||||
** the pen digitizer.
|
||||
** the pen digitizer.
|
||||
**
|
||||
** This record would likely be present once in a bundle and would typically
|
||||
** be after the INK_BUNDLE_RECORD, but before the first pen data.
|
||||
@ -1259,7 +1259,7 @@ typedef struct tag_INK_PENTIP_RECORD {
|
||||
** ink at the specified rate. It is likely that most types of rendering
|
||||
** applications will render ink as rapidly as possible to construct a display
|
||||
** in minimum time, and that some types of animation applications will
|
||||
** intentionally set an arbitrary sampling rate to vary the display rate.
|
||||
** intentionally set an arbitrary sampling rate to vary the display rate.
|
||||
**
|
||||
** Note:
|
||||
** For hardware which supports a highly variable sampling rate, the writing
|
||||
@ -1328,15 +1328,15 @@ typedef struct tag_INK_UNITS_PER_Z_RECORD {
|
||||
** start and end are likely to differ, a recommended practice for writing
|
||||
** applications that use the tip force value to determine the "touch" points
|
||||
** in a stroke is to mark those points using the touch bit in the INK_BUTTONS
|
||||
** structure.
|
||||
** structure.
|
||||
**
|
||||
** It is also recommended that vendors supporting tip force sensing in their
|
||||
** hardware linearize their transducers to the greatest extent possible.
|
||||
** hardware linearize their transducers to the greatest extent possible.
|
||||
**
|
||||
** Because of the likelihood that tip force transducers may not be accurately
|
||||
** linearized, negative tip force values, while perhaps somewhat absurd
|
||||
** are possible and are permitted in this specification.
|
||||
**
|
||||
** are possible and are permitted in this specification.
|
||||
**
|
||||
**------------------------------------------------------------------------*/
|
||||
|
||||
typedef struct tag_INK_UNITS_PER_FORCE_RECORD {
|
||||
@ -1366,8 +1366,8 @@ typedef struct tag_INK_UNITS_PER_FORCE_RECORD {
|
||||
** subRecordTypes that they wish to use. Then, using these subRecordTypes
|
||||
** they can put a wide variety of information into the file. By examining
|
||||
** the appData signature and comparing it to theirs, an application can
|
||||
** decide whether it knows how to interpret the various subRecordtypes.
|
||||
**
|
||||
** decide whether it knows how to interpret the various subRecordtypes.
|
||||
**
|
||||
**------------------------------------------------------------------------*/
|
||||
|
||||
typedef struct tag_INK_APP_RECORD {
|
||||
@ -1393,16 +1393,16 @@ typedef struct tag_INK_APP_RECORD {
|
||||
** Uncompacted point format:
|
||||
** -------------------------
|
||||
**
|
||||
** This structure immediately follows the rest of the INK_PENDATA_RECORD.
|
||||
** This structure immediately follows the rest of the INK_PENDATA_RECORD.
|
||||
** The structure has several optional components, present or not present as
|
||||
** indicated by the INK_BUNDLE_FLAGS in the INK_BUNDLE_RECORD. The format is
|
||||
** a sequence of "point values", each containing all the scalar data for each
|
||||
** sampled tablet point.
|
||||
**
|
||||
** sampled tablet point.
|
||||
**
|
||||
** In the uncompacted format, there is a single structure that contains all
|
||||
** of the state information for each point from the tablet. Components not
|
||||
** present (as indicated by the INK_BUNDLE_FLAGS) are just that: not present,
|
||||
** do not exist, do not occupy space.
|
||||
** do not exist, do not occupy space.
|
||||
**
|
||||
** Compacted point format:
|
||||
** -----------------------
|
||||
@ -1416,7 +1416,7 @@ typedef struct tag_INK_APP_RECORD {
|
||||
** force data, and explicit starts and ends of strokes: the starts and ends
|
||||
** of the strokes are then points that were considered to be such by the
|
||||
** original application storing the data. The INK_BUTTONS record reflects
|
||||
** the state of the next X/Y point following.
|
||||
** the state of the next X/Y point following.
|
||||
**
|
||||
**------------------------------------------------------------------------*/
|
||||
|
||||
@ -1493,12 +1493,12 @@ typedef U32 INK_BUTTONS, FAR * P_INK_BUTTONS;
|
||||
/**************************/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** INK_POINT data. The INK_POINT structure varies in size depending on
|
||||
** INK_POINT data. The INK_POINT structure varies in size depending on
|
||||
** flags set in the bundle header. The XY32 position is always present, but
|
||||
** the force, rho, height, angle, and buttons members are only present when
|
||||
** indicated by the corresponding flag in the bundle header. When optional
|
||||
** data is present, it is present in the order defined by this structure;
|
||||
** that is, position, force, height, rho, angle, and finally buttons.
|
||||
** that is, position, force, height, rho, angle, and finally buttons.
|
||||
**
|
||||
** The INK_POINT structure has the following elements:
|
||||
**
|
||||
@ -1511,20 +1511,20 @@ typedef U32 INK_BUTTONS, FAR * P_INK_BUTTONS;
|
||||
** height - optional, present if inkHeightDataPresent is asserted
|
||||
** Units are in pen unitsPerZ as specified by inkPointDefaultUnitsPerZ or
|
||||
** by an INK_UNITS_PER_Z_RECORD, whichever is appropriate. Units increase
|
||||
** as the stylus is taken away from the tablet. Zero means "just in
|
||||
** as the stylus is taken away from the tablet. Zero means "just in
|
||||
** contact". Negative values could possibly result from spring action if
|
||||
** the stylus is pressed hard, or if the tablet is not perfectly accurate.
|
||||
** rho - optional, present if inkRotationDataPresent is asserted
|
||||
** Angles are measured in degrees from some nominal orientation of
|
||||
** "stylus button on top" (somewhat arbitrary). Angles increase with
|
||||
** Angles are measured in degrees from some nominal orientation of
|
||||
** "stylus button on top" (somewhat arbitrary). Angles increase with
|
||||
** clockwise rotation as seen from the rear end of the stylus.
|
||||
** angle - optional, present if inkAngleDataPresent is asserted
|
||||
** Angles are measured in pen angle units from the vertical. Theta
|
||||
** Angles are measured in pen angle units from the vertical. Theta
|
||||
** increases in the positive-X direction, phi in the positive-Y.
|
||||
** buttons - optional, present if inkButtonDataPresent is asserted
|
||||
**
|
||||
**
|
||||
** When the INK_BUNDLE_RECORD member compactionType is inkStdCompression,
|
||||
** all data in this structure is compressed according to the methods
|
||||
** all data in this structure is compressed according to the methods
|
||||
** described in reference section 23.0. For more details on how to interpret
|
||||
** the compressed data stream, see the sample code. The bundle flags which
|
||||
** indicate whether a particular piece of data is present are used regardless
|
||||
@ -1532,12 +1532,12 @@ typedef U32 INK_BUTTONS, FAR * P_INK_BUTTONS;
|
||||
** in compressed format, it is NOT written in Intel order but rather most
|
||||
** significant byte first. In compressed form, some of the eight bit delta
|
||||
** values are reserved for button data and elided (skipped) point counts.
|
||||
** This has two important ramifications. 1) When expecting a point,
|
||||
** This has two important ramifications. 1) When expecting a point,
|
||||
** compacted button data or elided point data may be encountered instead, and
|
||||
** 2) when the inkButtonDataPresent flag is asserted in the bundle header,
|
||||
** button data will appear in the place of a point and not in addition to a
|
||||
** point. If inkButtonDataPresent is not asserted, the reader need not check
|
||||
** the point data for the special case of button data; however, the point
|
||||
** the point data for the special case of button data; however, the point
|
||||
** data must still be checked to see if it is a count of elided points rather
|
||||
** than an actual point.
|
||||
**
|
||||
@ -1561,7 +1561,7 @@ typedef struct tag_INK_POINT {
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** The following default values are assumed before the start of any
|
||||
** The following default values are assumed before the start of any
|
||||
** INK_BUNDLE:
|
||||
**
|
||||
**------------------------------------------------------------------------*/
|
||||
@ -1587,7 +1587,7 @@ typedef struct tag_INK_POINT {
|
||||
**
|
||||
** A recommended practice is always to use the compacted point format, not
|
||||
** the uncompacted point format. Sample code for reading and writing the
|
||||
** compacted format is included in an appendix.
|
||||
** compacted format is included in an appendix.
|
||||
**
|
||||
** This structure also immediately follows the rest of the
|
||||
** INK_PENDATA_RECORD.
|
||||
@ -1601,10 +1601,10 @@ typedef struct tag_INK_POINT {
|
||||
** The storing application, as an alternative to eliminating points, can
|
||||
** specify a "skip" record for elided points. The skipRecord indicates that
|
||||
** a number of points were skipped, and the reading application is free to
|
||||
** insert values for the elided points (interpolating where appropriate).
|
||||
** insert values for the elided points (interpolating where appropriate).
|
||||
** The intent is to allow for accurate time information to be maintained
|
||||
** between time stamps for synchronization with recorded voice, press-hold
|
||||
** gesture recognition, etc.
|
||||
** gesture recognition, etc.
|
||||
**
|
||||
** Compacted data is written most significant byte first so that reading
|
||||
** applications can read the first byte and determine (from the top two bits)
|
||||
@ -1618,9 +1618,9 @@ typedef struct tag_INK_POINT {
|
||||
** and MAX_S7. Similarly, the reserved encoding for 8 bit deltas are all 8
|
||||
** bit delta pairs where both X and Y are within the inclusive range MIN_S3
|
||||
** and MAX_S3. In revision 1.0 of Jot, three of the reserved encodings for 8
|
||||
** bit deltas are used for special cases: skip counts (reference section
|
||||
** bit deltas are used for special cases: skip counts (reference section
|
||||
** 27.0) and button changes (reference section 26.0).
|
||||
**
|
||||
**
|
||||
** x/y position:
|
||||
** ------------
|
||||
**
|
||||
@ -1744,7 +1744,7 @@ typedef struct tag_INK_POINT {
|
||||
** |1|0|(S3 delta-theta)|(S3 delta-phi)|
|
||||
** -------------------------------------
|
||||
**
|
||||
** Note:
|
||||
** Note:
|
||||
** Leading bit values of |1|1| are reserved
|
||||
**
|
||||
**------------------------------------------------------------------------*/
|
||||
@ -1760,16 +1760,16 @@ typedef struct tag_INK_POINT {
|
||||
** Since the X/Y data is always present, we use some of the reserved delta
|
||||
** encodings to encode button states and elided (skipped) points. We use the
|
||||
** 8-bit delta encodings that are unused: the values that can fit into the
|
||||
** smaller 4-bit delta encodings.
|
||||
** smaller 4-bit delta encodings.
|
||||
**
|
||||
** Button/tip records:
|
||||
** ------------------
|
||||
**
|
||||
** It is assumed that the state of barrel buttons and the touching sensor on
|
||||
** the stylus change infrequently. A compacted button/tip record is only
|
||||
** included when the state changes in one of the switches. The button state
|
||||
** value applies to the X/Y point immediately following the button state
|
||||
** record.
|
||||
** included when the state changes in one of the switches. The button state
|
||||
** value applies to the X/Y point immediately following the button state
|
||||
** record.
|
||||
**
|
||||
**
|
||||
** (Taken from 8-bit byte delta X/Y: two bytes total)
|
||||
@ -1779,7 +1779,7 @@ typedef struct tag_INK_POINT {
|
||||
** (delta-X) (delta-Y)
|
||||
**
|
||||
** An eight-bit delta with delta-X == 0 or 1, and delta-Y in the range
|
||||
** (-4..3) indicates a button state encoding.
|
||||
** (-4..3) indicates a button state encoding.
|
||||
**
|
||||
** It is likely to be the case that many hardware platforms have only one
|
||||
** barrel button.
|
||||
@ -1794,10 +1794,10 @@ typedef struct tag_INK_POINT {
|
||||
**
|
||||
** The lowest order bit of the delta-X bits is used to indicate that
|
||||
** additional bytes follow: "1" indicates that the next byte is used for the
|
||||
** next 7 barrel buttons with state. The high order bit of each sequential
|
||||
** next 7 barrel buttons with state. The high order bit of each sequential
|
||||
** byte in the series is "1" if an additional byte must be fetched, "0"
|
||||
** otherwise. In these additional bytes, the additional buttons are
|
||||
** associated in order starting with the low-order bit.
|
||||
** otherwise. In these additional bytes, the additional buttons are
|
||||
** associated in order starting with the low-order bit.
|
||||
**
|
||||
**------------------------------------------------------------------------*/
|
||||
|
||||
@ -1825,10 +1825,10 @@ typedef struct tag_INK_POINT {
|
||||
** skip count value.
|
||||
**
|
||||
** The elided points are points removed between the point immediately prior
|
||||
** to the skipped-point record and the point immediately afterward. This
|
||||
** implies that at least one point must follow every skip record (though
|
||||
** to the skipped-point record and the point immediately afterward. This
|
||||
** implies that at least one point must follow every skip record (though
|
||||
** the point may not appear next in the stream if there are intervening
|
||||
** button state transitions). Reading applications that are interested in
|
||||
** button state transitions). Reading applications that are interested in
|
||||
** recovering elided points will typically interpolate. Skip counts of zero
|
||||
** are meaningless and not permitted.
|
||||
**
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
@ -18,7 +18,7 @@
|
||||
* list contains pointers to the head, tail, and current list position.
|
||||
* the list itsself is doubly linked with both next and previous pointers.
|
||||
*
|
||||
* ddt
|
||||
* ddt
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "listP.h"
|
||||
@ -166,7 +166,7 @@ struct LISTINSTANCE *m;
|
||||
FREE(m);
|
||||
}
|
||||
FREE(theList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -202,7 +202,7 @@ struct LISTINSTANCE *l;
|
||||
theList->current = l;
|
||||
|
||||
theList->listCount++;
|
||||
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ struct LISTINSTANCE *l;
|
||||
theList->current = l;
|
||||
|
||||
return(NIL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -297,7 +297,7 @@ List theList;
|
||||
char *entry;
|
||||
int count;
|
||||
struct LISTINSTANCE *saveCurrent;
|
||||
*/
|
||||
*/
|
||||
if (theList) {
|
||||
return(theList->listCount);
|
||||
}
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
@ -27,7 +27,7 @@ struct LISTINSTANCE {
|
||||
struct LISTSTRUCT {
|
||||
struct LISTINSTANCE *head;
|
||||
struct LISTINSTANCE *tail;
|
||||
struct LISTINSTANCE *current;
|
||||
struct LISTINSTANCE *current;
|
||||
int listCount;
|
||||
};
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
@ -152,7 +152,7 @@ struct LISTINSTANCE *m;
|
||||
FREE(m);
|
||||
}
|
||||
FREE(theList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -186,7 +186,7 @@ struct LISTINSTANCE *l;
|
||||
}
|
||||
|
||||
theList->current = l;
|
||||
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ struct LISTINSTANCE *l;
|
||||
theList->current = l;
|
||||
|
||||
return(NIL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
@ -27,7 +27,7 @@ struct LISTINSTANCE {
|
||||
struct LISTSTRUCT {
|
||||
struct LISTINSTANCE *head;
|
||||
struct LISTINSTANCE *tail;
|
||||
struct LISTINSTANCE *current;
|
||||
struct LISTINSTANCE *current;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
|
142
libnet/net.c
142
libnet/net.c
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
@ -62,8 +62,8 @@ static char rcs_id[] = "$Id: net.c,v 1.4 1995/10/15 18:48:57 spowers Exp $";
|
||||
* most case.
|
||||
*
|
||||
*
|
||||
* mods:
|
||||
* 2/22/93 (ddt) print out message if user has loaded unsupported
|
||||
* mods:
|
||||
* 2/22/93 (ddt) print out message if user has loaded unsupported
|
||||
* dimensional array
|
||||
*/
|
||||
|
||||
@ -261,7 +261,7 @@ SQueue *sq;
|
||||
while(sq) {
|
||||
if (sq->netPort == netPort) {
|
||||
ListDeleteEntry(sendQueue,sq);
|
||||
if (sq->failCB)
|
||||
if (sq->failCB)
|
||||
sq->failCB(sq->data,sq->failCBData);
|
||||
FREE(sq->header);
|
||||
FREE(sq);
|
||||
@ -278,7 +278,7 @@ static int NetUserListAdd(name)
|
||||
char *name;
|
||||
{
|
||||
char *p;
|
||||
|
||||
|
||||
if ((!name) || (!strlen(name)))
|
||||
return(-1);
|
||||
p = (char *) ListHead(userList);
|
||||
@ -341,7 +341,7 @@ void DEFUN(NetSetUserID,(user), char *user)
|
||||
else if (!user && userID)
|
||||
userID = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static DOCB *NetSearchByName(name,list)
|
||||
char *name;
|
||||
@ -357,7 +357,7 @@ DOCB *docb;
|
||||
docb = (DOCB *) ListNext(list);
|
||||
}
|
||||
return((DOCB *) 0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -372,11 +372,11 @@ caddr_t changeData;
|
||||
void (*destroy)(); /* Data object destroyed callback */
|
||||
caddr_t destroyData;
|
||||
{
|
||||
DOCB *docb;
|
||||
DOCB *docb;
|
||||
char itsNew;
|
||||
|
||||
/*Yeah this is huge,repetitive and could easily be condensed, but it
|
||||
wasn't when I started, and I don't feel like changing it now
|
||||
wasn't when I started, and I don't feel like changing it now
|
||||
condensed on Feb 93 by gbourhis */
|
||||
#define REGISTERMODULE(list) \
|
||||
do { \
|
||||
@ -455,13 +455,13 @@ caddr_t destroyData;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int DimensionsEqual(dim1,rank1,dim2,rank2)
|
||||
static int DimensionsEqual(dim1,rank1,dim2,rank2)
|
||||
int *dim1,rank1,*dim2,rank2;
|
||||
{
|
||||
register int x;
|
||||
@ -475,7 +475,7 @@ register int x;
|
||||
}
|
||||
|
||||
|
||||
static void CopyDimensions(dim1,rank1,dim2,rank2)
|
||||
static void CopyDimensions(dim1,rank1,dim2,rank2)
|
||||
/* copies dim2 to dim1 */
|
||||
int *dim1,*rank1;
|
||||
int *dim2,rank2;
|
||||
@ -653,7 +653,7 @@ int numPortNames;
|
||||
else if (dtmFlowControl == DTM_SYNC) {
|
||||
printf("Just made an SYNC out netPort=%x port %x (%s)\n",
|
||||
n,n->port,n->portName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("********Just made an *UNKOWN* out port %s (%d)\n",
|
||||
n->portName,n->port);
|
||||
@ -676,7 +676,7 @@ char *outPortAddr;
|
||||
return(NetInternalCreateOutPort(outPortAddr,TRUE));
|
||||
}
|
||||
|
||||
static void NetChangeOutPort(address,oldOut)
|
||||
static void NetChangeOutPort(address,oldOut)
|
||||
char *address;
|
||||
NetPort *oldOut;
|
||||
{
|
||||
@ -781,8 +781,8 @@ int num;
|
||||
strcpy(d->label,title);
|
||||
d->dot = DOT_SDL;
|
||||
SDLgetPrimitive(header,&(d->dost));
|
||||
|
||||
if ((num = DTMreadDataset(n->port, primbuff,
|
||||
|
||||
if ((num = DTMreadDataset(n->port, primbuff,
|
||||
MAX_SDL_VERTICES, DTM_TRIPLET)) == DTMERROR){
|
||||
ErrMesg("Error reading DTM SDL");
|
||||
NetReject(n->port,header);
|
||||
@ -800,7 +800,7 @@ int num;
|
||||
d->entity = ENT_Network;
|
||||
|
||||
return(d);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static Com *NetReadCOM(n,header)
|
||||
@ -882,7 +882,7 @@ int size;
|
||||
d->dost = DOST_Double;
|
||||
elementSize = sizeof(double);
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
d->dost = DOST_Char;
|
||||
elementSize = 1;
|
||||
printf(
|
||||
@ -892,8 +892,8 @@ int size;
|
||||
VDATAgetNumRecords(header,&(d->dim[1]));
|
||||
d->rank = 2;
|
||||
VDATAgetPathLength(header,&(d->pathLength));
|
||||
if (!(d->magicPath = (VdataPathElement **)
|
||||
MALLOC(sizeof(VdataPathElement *)
|
||||
if (!(d->magicPath = (VdataPathElement **)
|
||||
MALLOC(sizeof(VdataPathElement *)
|
||||
* d->pathLength))){
|
||||
ErrMesg("Out of Memory reading VDATA path\n");
|
||||
DTMendRead(n->port);
|
||||
@ -937,7 +937,7 @@ int size;
|
||||
}
|
||||
DTMendRead(n->port);
|
||||
return(d);
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -972,7 +972,7 @@ int stat;
|
||||
return(0);
|
||||
}
|
||||
|
||||
for(x = 0, size = 1; x < rank; x++)
|
||||
for(x = 0, size = 1; x < rank; x++)
|
||||
size *= dims[x];
|
||||
|
||||
ANIMgetID(header,id,DTM_STRING_SIZE);
|
||||
@ -1003,7 +1003,7 @@ int stat;
|
||||
case DTM_DOUBLE:
|
||||
dostType = DOST_Double;
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
dostType = DOST_Char;
|
||||
printf(
|
||||
"SDS of unknown type just received casting to char\n");
|
||||
@ -1261,7 +1261,7 @@ char id[DTM_STRING_SIZE];
|
||||
}
|
||||
}
|
||||
|
||||
if (DTMreadDataset(n->port,d->data,xdim*ydim,DTM_CHAR) ==
|
||||
if (DTMreadDataset(n->port,d->data,xdim*ydim,DTM_CHAR) ==
|
||||
DTMERROR) {
|
||||
ErrMesg("Error reading RIS dataset");
|
||||
NetReject(n->port,header);
|
||||
@ -1339,7 +1339,7 @@ static char title[DTM_STRING_SIZE];
|
||||
DTMendRead(n->port);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
t.textString[t.dim] = '\0';
|
||||
#ifdef DEBUG
|
||||
printf("NetReadText(): *t.textString = %c dim = %d\n",
|
||||
@ -1490,7 +1490,7 @@ List *list;
|
||||
char *portName;
|
||||
{
|
||||
NetPort *netPort;
|
||||
|
||||
|
||||
netPort = (NetPort *) ListHead(list);
|
||||
while (netPort) {
|
||||
if (!strcmp(portName,netPort->portName)) {
|
||||
@ -1541,7 +1541,7 @@ char buff[256];
|
||||
#endif
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
sprintf(buff,
|
||||
"Just established a connection with\n%s (%s)\n",
|
||||
s.id,s.inPort);
|
||||
@ -1585,7 +1585,7 @@ char buff[256];
|
||||
}
|
||||
else {
|
||||
/***** this assumes only one out port **********/
|
||||
ListDeleteEntry(netOutList,ListHead(netOutList));
|
||||
ListDeleteEntry(netOutList,ListHead(netOutList));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1640,7 +1640,7 @@ char buff[256];
|
||||
}
|
||||
strcpy(s.inPort,s.netPort->portName);
|
||||
return(&s);
|
||||
|
||||
|
||||
} /* NetReadDTM() */
|
||||
|
||||
|
||||
@ -1712,7 +1712,7 @@ int runType;
|
||||
ANIMgetID(header,id,80);
|
||||
a.id = id;
|
||||
ANIMgetFrame(header,&(a.frameNumber));
|
||||
if (-1 == ANIMgetFunc(header,(&func)))
|
||||
if (-1 == ANIMgetFunc(header,(&func)))
|
||||
a.func = AF_NO_FUNC;
|
||||
else {
|
||||
switch(func) {
|
||||
@ -1727,7 +1727,7 @@ int runType;
|
||||
break;
|
||||
};
|
||||
}
|
||||
if (-1 == ANIMgetRunType(header,(&runType)))
|
||||
if (-1 == ANIMgetRunType(header,(&runType)))
|
||||
a.runType= ART_NONE;
|
||||
else {
|
||||
switch (runType) {
|
||||
@ -1742,7 +1742,7 @@ int runType;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
a.data = 0;
|
||||
return(&a);
|
||||
#endif
|
||||
@ -1822,7 +1822,7 @@ static Col col;
|
||||
col.title = title;
|
||||
col.id = UserID;
|
||||
col.func = "DOODLE";
|
||||
if (sendDiscrete)
|
||||
if (sendDiscrete)
|
||||
col.selType = COL_DOODLE_DISC;
|
||||
else
|
||||
col.selType = COL_DOODLE_CONT;
|
||||
@ -1831,7 +1831,7 @@ static Col col;
|
||||
return(&col);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void NetCallDestroyCallback(list,d)
|
||||
List list;
|
||||
Data *d;
|
||||
@ -1894,7 +1894,7 @@ static AnimMesg a;
|
||||
a.func = AF_NO_FUNC;
|
||||
a.runType = ART_NONE;
|
||||
a.data = d;
|
||||
|
||||
|
||||
/* distribute data */
|
||||
if (!DataInList(d)) {
|
||||
DataAddEntry(d);
|
||||
@ -2016,7 +2016,7 @@ char *ExceptModuleName;
|
||||
else {
|
||||
d = *dSend;
|
||||
}
|
||||
|
||||
|
||||
/* distribute data */
|
||||
if (!DataInList(d)) {
|
||||
DataAddEntry(d);
|
||||
@ -2052,7 +2052,7 @@ register char *p;
|
||||
if (!(docb = (DOCB *) ListNext(PALList)))
|
||||
return(0); /* none to distribute to */
|
||||
}
|
||||
|
||||
|
||||
/* get data field make a new one if doesn't exist */
|
||||
if (!(d = DataSearchByLabelAndDOT(title,DOT_Palette8))) {
|
||||
if (!(d = DataNew())) {
|
||||
@ -2099,7 +2099,7 @@ register char *p;
|
||||
return(1);
|
||||
#endif
|
||||
} /* NetPALDistribute() */
|
||||
|
||||
|
||||
#undef CALLCB
|
||||
#define CALLCB(List, CallB, CallData, ClientData) \
|
||||
do { \
|
||||
@ -2204,7 +2204,7 @@ int i;
|
||||
|
||||
else if (PALcompareClass(header)) {
|
||||
if (!(docb = (DOCB *) ListHead(PALList))) {
|
||||
NetReject(n->port,header);
|
||||
NetReject(n->port,header);
|
||||
return(0);
|
||||
}
|
||||
if (d = NetReadPal(n,header)) {
|
||||
@ -2216,12 +2216,12 @@ int i;
|
||||
CALLCB(PALList, changeCB, d, changeData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}/* PAL */
|
||||
|
||||
else if (RIScompareClass(header)) {
|
||||
if (!(docb = (DOCB *) ListHead(RIS8List))) {
|
||||
NetReject(n->port,header);
|
||||
NetReject(n->port,header);
|
||||
return(0);
|
||||
}
|
||||
if (d = NetReadRIS8(n,header)) {
|
||||
@ -2233,11 +2233,11 @@ int i;
|
||||
CALLCB(RIS8List, changeCB, d, changeData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}/* RIS */
|
||||
else if (TXTcompareClass(header)) {
|
||||
if (!(docb = (DOCB *) ListHead(TXTList))) {
|
||||
NetReject(n->port,header);
|
||||
NetReject(n->port,header);
|
||||
return(0);
|
||||
}
|
||||
if (t = NetReadText(n,header)) {
|
||||
@ -2254,7 +2254,7 @@ int i;
|
||||
} /*SRV*/
|
||||
else if (COLcompareClass(header)) {
|
||||
if (!(docb = (DOCB *) ListHead(COLList))) {
|
||||
NetReject(n->port,header);
|
||||
NetReject(n->port,header);
|
||||
return(0);
|
||||
}
|
||||
if (c = NetReadCOL(n,header)) {
|
||||
@ -2298,7 +2298,7 @@ int i;
|
||||
}
|
||||
}
|
||||
else {
|
||||
NetReject(n->port,header);
|
||||
NetReject(n->port,header);
|
||||
}
|
||||
|
||||
return(d);
|
||||
@ -2311,7 +2311,7 @@ List netPortList;
|
||||
int port;
|
||||
{
|
||||
NetPort *netPort;
|
||||
|
||||
|
||||
netPort = (NetPort *) ListHead(netPortList);
|
||||
while (netPort) {
|
||||
if (netPort->port == port) {
|
||||
@ -2368,7 +2368,7 @@ NetPort *n;
|
||||
|
||||
/* printf("NetClientPollAndRead(): I've been called\n");*/
|
||||
#endif
|
||||
n = (NetPort *) ListHead(netInList);
|
||||
n = (NetPort *) ListHead(netInList);
|
||||
while (n) {
|
||||
while (DTMavailRead(n->port)) {
|
||||
#ifdef DEBUG
|
||||
@ -2432,9 +2432,9 @@ int status;
|
||||
#ifdef USE_WRITEMSG
|
||||
if (DTMERROR == DTMwriteMsg(netPort->port,
|
||||
header,strlen(header)+1,
|
||||
data,num,type))
|
||||
data,num,type))
|
||||
#else
|
||||
status = DTMbeginWrite(netPort->port,header,strlen(header)+1);
|
||||
status = DTMbeginWrite(netPort->port,header,strlen(header)+1);
|
||||
#ifdef DEBUG
|
||||
printf("NetSend():sent header \"%s\" to %s\n",header,netPort->portName);
|
||||
#endif
|
||||
@ -2489,7 +2489,7 @@ long num AND
|
||||
DTMTYPE type AND
|
||||
void (*cb) PARAMS((GenericPtr data, caddr_t cbData)) AND
|
||||
caddr_t cbData AND
|
||||
void (*failCB) PARAMS((GenericPtr data, caddr_t failCBData)) AND
|
||||
void (*failCB) PARAMS((GenericPtr data, caddr_t failCBData)) AND
|
||||
caddr_t failCBData AND
|
||||
int doQueue) /* TRUE -> Save and resend; FALSE -> let client resend*/
|
||||
|
||||
@ -2502,7 +2502,7 @@ int status;
|
||||
#ifdef DEBUG
|
||||
printf("no out port: discarding %s\n",header);
|
||||
#endif
|
||||
if (failCB)
|
||||
if (failCB)
|
||||
failCB(data,failCBData);
|
||||
return(-1);
|
||||
}
|
||||
@ -2547,7 +2547,7 @@ int status;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
if (cb)
|
||||
if (cb)
|
||||
cb(data,cbData);
|
||||
}
|
||||
return(0);
|
||||
@ -2588,13 +2588,13 @@ int status;
|
||||
}
|
||||
else {
|
||||
/* couldn't send now and no queuing, so call failCB()*/
|
||||
if (failCB)
|
||||
if (failCB)
|
||||
failCB(data,failCBData);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
else if (status == 1) {
|
||||
if (cb)
|
||||
if (cb)
|
||||
cb(data,cbData);
|
||||
return(1);
|
||||
}
|
||||
@ -2604,7 +2604,7 @@ int status;
|
||||
return(-1);
|
||||
}
|
||||
return(-1);
|
||||
|
||||
|
||||
} /* NetClientSendMessage() */
|
||||
|
||||
|
||||
@ -2630,7 +2630,7 @@ time_t t;
|
||||
port->portName,
|
||||
sq->netPort,
|
||||
sq->netPort->portName);
|
||||
fprintf(stderr,"*");
|
||||
fprintf(stderr,"*");
|
||||
}
|
||||
#endif
|
||||
while (sq) {
|
||||
@ -2807,7 +2807,7 @@ register long i;
|
||||
NetMakeCOLFromDoodle(title,a,length+1,sendDiscrete),
|
||||
moduleName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
status = NetClientSendMessage(netPort,header,a,(length + 1),
|
||||
COL_TRIPLET, NetFreeDataCB, 0,0,0,doQueue);
|
||||
@ -3367,7 +3367,7 @@ DEFUN(_NetSendRaster8,(netPort,d,shouldCopy,
|
||||
else
|
||||
NetRISDistribute(&d, moduleName);
|
||||
|
||||
|
||||
|
||||
if (shouldCopy) {
|
||||
int buffSize = d->dim[0] * d->dim[1] * sizeof(char);
|
||||
register int x;
|
||||
@ -3432,7 +3432,7 @@ int status;
|
||||
ANIMsetClass(header);
|
||||
ANIMsetTitle(header,title);
|
||||
ANIMsetID(header,userID);
|
||||
|
||||
|
||||
switch (command) {
|
||||
case AF_STOP:
|
||||
ANIMsetFunc(header,ANIM_FUNC_STOP);
|
||||
@ -3475,7 +3475,7 @@ NetPort *netPort;
|
||||
Data *d;
|
||||
int shouldCopy; /* should this data be copied before returning? */
|
||||
/* if not, charData and palette8 must not be freed or */
|
||||
/* changed until data is sent */
|
||||
/* changed until data is sent */
|
||||
int distributeInternally; /* boolean */
|
||||
char *moduleName; /* Send internally to all DOCB except this one */
|
||||
/* in most cases this would be the calling module's name*/
|
||||
@ -3542,10 +3542,10 @@ char *nodeName;
|
||||
char *field;
|
||||
int numRecords;
|
||||
int numElements;
|
||||
int type;
|
||||
int type;
|
||||
char *vdata;
|
||||
int shouldCopy; /* copy Vdata before returning in case of delayed send */
|
||||
int distributeInternally;
|
||||
int distributeInternally;
|
||||
char *moduleName; /* distribute Internally to all except */
|
||||
{
|
||||
#if 0
|
||||
@ -3612,7 +3612,7 @@ int size;
|
||||
numRecords * numElements,
|
||||
dtmType,0,0,0,0,1);
|
||||
}
|
||||
|
||||
|
||||
return(status);
|
||||
#endif
|
||||
}
|
||||
@ -3654,7 +3654,7 @@ Data *nextD;
|
||||
moduleName,FALSE);
|
||||
break;
|
||||
case DOT_Image:
|
||||
if ( (nextD)
|
||||
if ( (nextD)
|
||||
&& (nextD->dot == DOT_Palette8)
|
||||
&& !nextD->associated )
|
||||
nextD->associated = d->label;
|
||||
@ -3690,7 +3690,7 @@ Data *nextD;
|
||||
#endif
|
||||
status = -1;
|
||||
break;
|
||||
|
||||
|
||||
};
|
||||
d = nextD;
|
||||
}
|
||||
@ -3711,9 +3711,9 @@ char header[DTM_MAX_HEADER];
|
||||
COMsetID(header,userID);
|
||||
COMsetDomain(header,domain);
|
||||
COMsetMesg(header,message);
|
||||
|
||||
|
||||
return(NetClientSendMessage(netPort,header,0,0,0,cb,0,failCB,0,1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
#if 0 /* not used */
|
||||
@ -3786,7 +3786,7 @@ time_t now;
|
||||
ecbd->cbData = cbData;
|
||||
ecbd->failCB = failCB;
|
||||
ecbd->failCBData = failCBData;
|
||||
|
||||
|
||||
|
||||
EXECsetClass(header);
|
||||
EXECsetID(header,userID);
|
||||
@ -3879,7 +3879,7 @@ caddr_t failCBData;
|
||||
{
|
||||
char header[DTM_MAX_HEADER];
|
||||
char tmp[DTM_STRING_SIZE];
|
||||
|
||||
|
||||
MSGsetClass(header);
|
||||
COLsetID(header, userID);
|
||||
strncpy(tmp, message, DTM_STRING_SIZE - 1);
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
@ -68,7 +68,7 @@ typedef struct {
|
||||
short int *data;
|
||||
} Dol;
|
||||
|
||||
typedef enum { AF_NO_FUNC, AF_STOP, AF_FPLAY, AF_RPLAY
|
||||
typedef enum { AF_NO_FUNC, AF_STOP, AF_FPLAY, AF_RPLAY
|
||||
} AnimFunc;
|
||||
|
||||
typedef enum { ART_NONE, ART_SINGLE, ART_CONT, ART_BOUNCE
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
@ -25,7 +25,7 @@ typedef struct {
|
||||
} ExecHostStatusReturn;
|
||||
|
||||
typedef union {
|
||||
ExecHostStatusReturn hsReturn;
|
||||
ExecHostStatusReturn hsReturn;
|
||||
} ExecRetInfo;
|
||||
|
||||
typedef struct {
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
@ -47,7 +47,7 @@ Data *DataNew()
|
||||
|
||||
d->expandX = d->expandY = 1.0;
|
||||
}
|
||||
|
||||
|
||||
return(d);
|
||||
}
|
||||
|
||||
@ -55,9 +55,9 @@ void DataDestroy(d)
|
||||
Data *d;
|
||||
{
|
||||
(void)ListDeleteEntry(dataList,d);
|
||||
if (d->label)
|
||||
if (d->label)
|
||||
FREE(d->label);
|
||||
if (d->data)
|
||||
if (d->data)
|
||||
FREE(d->data);
|
||||
FREE(d);
|
||||
}
|
||||
@ -109,7 +109,7 @@ Data *d;
|
||||
|
||||
d = (Data *) ListHead(dataList);
|
||||
while (d) {
|
||||
if ((d->label)&&((!strcmp(s,d->label)) && (d->dot == dot)
|
||||
if ((d->label)&&((!strcmp(s,d->label)) && (d->dot == dot)
|
||||
&& (d->dost == dost))) {
|
||||
return(d);
|
||||
}
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
@ -88,4 +88,4 @@ extern Data *DataSearchByLabelAndDOTAndDOST
|
||||
PARAMS((char *s, int dot, int dost));
|
||||
extern int DataInList PARAMS((Data *d));
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
# @configure_output@
|
||||
# This file is used by Autoconf to make the real Makefile.
|
||||
# DO NOT EDIT THIS FILE!
|
||||
# If you want to change something do it to the Makefile autoconf
|
||||
# If you want to change something do it to the Makefile autoconf
|
||||
# creates. You should never have to edit this file.
|
||||
|
||||
CC= @CC@
|
||||
|
@ -10,7 +10,7 @@
|
||||
#ifdef ELLIPSIS_TEST
|
||||
void usage_statement(void);
|
||||
#endif
|
||||
int compact_string(char *main_string, char *ellipsis_string,
|
||||
int compact_string(char *main_string, char *ellipsis_string,
|
||||
int num_chars, int mode, int eLength);
|
||||
|
||||
#ifdef ELLIPSIS_TEST
|
||||
@ -54,7 +54,7 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
|
||||
|
||||
int compact_string(char *main_string, char *ellipsis_string,
|
||||
int compact_string(char *main_string, char *ellipsis_string,
|
||||
int num_chars, int mode, int eLength) {
|
||||
|
||||
int string_len;
|
||||
@ -71,7 +71,7 @@ int compact_string(char *main_string, char *ellipsis_string,
|
||||
switch(mode) {
|
||||
|
||||
case 1: {
|
||||
|
||||
|
||||
puff = num_chars - eLength;
|
||||
feem = string_len - puff;
|
||||
|
||||
@ -130,9 +130,9 @@ int compact_string(char *main_string, char *ellipsis_string,
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
case 3: {
|
||||
|
||||
|
||||
puff = num_chars - eLength;
|
||||
feem = string_len - puff;
|
||||
|
||||
@ -151,9 +151,9 @@ int compact_string(char *main_string, char *ellipsis_string,
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
default: {
|
||||
#ifdef ELLIPSIS_TEST
|
||||
usage_statement();
|
||||
@ -162,7 +162,7 @@ int compact_string(char *main_string, char *ellipsis_string,
|
||||
return(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
ellipsis_string[num_chars]='\0';
|
||||
|
@ -447,7 +447,7 @@ int my_strncasecmp(char *str1, char *str2, int n)
|
||||
return -1;
|
||||
if(str1[i]+offset1>str2[i]+offset2)
|
||||
return 1;
|
||||
/*
|
||||
/*
|
||||
if (toupper(str1[i])<toupper(str2[i])) {
|
||||
return(-1);
|
||||
}
|
||||
|
@ -757,9 +757,9 @@ $NEW_DESCRIPTOR (string_interval);
|
||||
/*
|
||||
* Written by: Tommy Reilly
|
||||
*
|
||||
* Simple function that stat's a file to see if it exists.
|
||||
* Simple function that stat's a file to see if it exists.
|
||||
*
|
||||
* Simple returns 1 or 0.
|
||||
* Simple returns 1 or 0.
|
||||
*/
|
||||
int file_exists(char* name)
|
||||
{
|
||||
@ -783,7 +783,7 @@ int file_exists(char* name)
|
||||
* Written by: Tommy Reilly (with major code snarfing from Scott Powers)
|
||||
*
|
||||
* This is essentially Scott's my_move function re-written without rename
|
||||
* and without erasing the source file.
|
||||
* and without erasing the source file.
|
||||
*
|
||||
* If "overwrite" is true, the destination file will automatically be
|
||||
* overwritten. If it is false and the file exists, my_move will return
|
||||
@ -810,32 +810,32 @@ int my_copy(char *src, char *dest, char *retBuf, int bufsize, int overwrite)
|
||||
char *cmd;
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
if (!retBuf)
|
||||
|
||||
if (!retBuf)
|
||||
{
|
||||
return(SYS_NO_RETBUF);
|
||||
}
|
||||
|
||||
if (!src || !*src)
|
||||
if (!src || !*src)
|
||||
{
|
||||
strcpy(retBuf,"There was no source file specified.\n");
|
||||
return(SYS_NO_SRC_FILE);
|
||||
}
|
||||
|
||||
if (!dest || !*dest)
|
||||
|
||||
if (!dest || !*dest)
|
||||
{
|
||||
strcpy(retBuf,"There was no destination file specified.\n");
|
||||
return(SYS_NO_DEST_FILE);
|
||||
}
|
||||
|
||||
|
||||
*retBuf='\0';
|
||||
|
||||
if (!overwrite)
|
||||
|
||||
if (!overwrite)
|
||||
{
|
||||
#if defined(MULTINET) && defined(__alpha)
|
||||
if (decc$stat(dest,&dest_stat))
|
||||
#else
|
||||
if (stat(dest,&dest_stat))
|
||||
if (stat(dest,&dest_stat))
|
||||
#endif
|
||||
{
|
||||
sprintf(retBuf,"Stat [%s] error:\n File already exists.\n",dest);
|
||||
@ -843,64 +843,64 @@ int my_copy(char *src, char *dest, char *retBuf, int bufsize, int overwrite)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifndef VMS /* Must copy file header as well as contents. PGE */
|
||||
if ((fd_src=open(src,O_RDONLY))==(-1))
|
||||
if ((fd_src=open(src,O_RDONLY))==(-1))
|
||||
{
|
||||
copy_error=strdup(my_strerror(errno));
|
||||
|
||||
if (!copy_error)
|
||||
if (!copy_error)
|
||||
{
|
||||
strcpy(retBuf,"There was not enough memory allocate.\n");
|
||||
return(SYS_NO_MEMORY);
|
||||
}
|
||||
|
||||
if (strlen(copy_error)>(bufsize-strlen(retBuf)))
|
||||
|
||||
if (strlen(copy_error)>(bufsize-strlen(retBuf)))
|
||||
{
|
||||
fprintf(stderr,"%s\n",copy_error);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
sprintf(retBuf,"%sCopy([%s] to [%s]) error:\n %s\n\n",retBuf,src,dest,copy_error);
|
||||
}
|
||||
free(copy_error);
|
||||
|
||||
|
||||
return(SYS_SRC_OPEN_FAIL);
|
||||
}
|
||||
|
||||
if ((fd_dest=open(dest,O_WRONLY|O_CREAT,0644))==(-1))
|
||||
|
||||
if ((fd_dest=open(dest,O_WRONLY|O_CREAT,0644))==(-1))
|
||||
{
|
||||
copy_error=strdup(my_strerror(errno));
|
||||
|
||||
if (!copy_error)
|
||||
if (!copy_error)
|
||||
{
|
||||
strcpy(retBuf,"There was not enough memory allocate.\n");
|
||||
return(SYS_NO_MEMORY);
|
||||
}
|
||||
|
||||
if (strlen(copy_error)>(bufsize-strlen(retBuf)))
|
||||
|
||||
if (strlen(copy_error)>(bufsize-strlen(retBuf)))
|
||||
{
|
||||
fprintf(stderr,"%s\n",copy_error);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
sprintf(retBuf,"%sCopy([%s] to [%s]) error:\n %s\n\n",retBuf,src,dest,copy_error);
|
||||
}
|
||||
free(copy_error);
|
||||
|
||||
|
||||
close(fd_src);
|
||||
|
||||
|
||||
return(SYS_DEST_OPEN_FAIL);
|
||||
}
|
||||
|
||||
|
||||
/*both files open and ready*/
|
||||
while (n_src>0)
|
||||
while (n_src>0)
|
||||
{
|
||||
n_src=read(fd_src,buf,BUFSIZ-1);
|
||||
if (n_src>0)
|
||||
if (n_src>0)
|
||||
{
|
||||
n_dest=write(fd_dest,buf,n_src);
|
||||
if (n_dest>0)
|
||||
if (n_dest>0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -909,7 +909,7 @@ int my_copy(char *src, char *dest, char *retBuf, int bufsize, int overwrite)
|
||||
sprintf(retBuf,"Write([%s]) error:\n %s\n\n",dest,my_strerror(errno));
|
||||
return(SYS_WRITE_FAIL);
|
||||
}
|
||||
if (!n_src)
|
||||
if (!n_src)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -918,10 +918,10 @@ int my_copy(char *src, char *dest, char *retBuf, int bufsize, int overwrite)
|
||||
sprintf(retBuf,"Read([%s]) error:\n %s\n\n",src,my_strerror(errno));
|
||||
return(SYS_READ_FAIL);
|
||||
}
|
||||
|
||||
|
||||
close(fd_src);
|
||||
close(fd_dest);
|
||||
|
||||
|
||||
#else /* VMS, PGE */
|
||||
cmd = malloc(sizeof(char) * (20 + strlen(src) + strlen(dest)));
|
||||
if(!cmd)
|
||||
@ -935,13 +935,13 @@ int my_copy(char *src, char *dest, char *retBuf, int bufsize, int overwrite)
|
||||
#endif /* VMS, PGE */
|
||||
|
||||
return(SYS_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Written by: Tommy Reilly (originally by Scott Powers I think)
|
||||
*
|
||||
* This is a function that finds the users home directory.
|
||||
* This is a function that finds the users home directory.
|
||||
*
|
||||
* Return Values:
|
||||
* SYS_NO_MEMORY -- No memory to allocate with.
|
||||
@ -953,7 +953,7 @@ int get_home(char **ret)
|
||||
#ifndef VMS /* PGE */
|
||||
char *home = NULL;
|
||||
struct passwd *pwdent;
|
||||
|
||||
|
||||
if(!(home = getenv("HOME")))
|
||||
{
|
||||
if (!(pwdent=getpwuid(getuid())))
|
||||
@ -962,7 +962,7 @@ int get_home(char **ret)
|
||||
*ret=NULL;
|
||||
return(SYS_INTERNAL_FAIL);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
/*
|
||||
home = malloc(sizeof(char) * (strlen(pwdent->pw_dir) + 1));
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Ben Fried deserves credit for writing the code that upon which
|
||||
* this source is based. ADC
|
||||
* this source is based. ADC
|
||||
*/
|
||||
#include "../config.h"
|
||||
#include "../config.h"
|
||||
|
||||
#if defined(KRB4) || defined(KRB5)
|
||||
|
||||
@ -122,7 +122,7 @@ int scheme_login(scheme)
|
||||
* Returns 1 if pipe open fails
|
||||
* Returns 0 otherwise (even if klog fails!)
|
||||
***************************************************************************/
|
||||
int AFSgetTGT(username, password, err_string)
|
||||
int AFSgetTGT(username, password, err_string)
|
||||
char *err_string, *username, *password;
|
||||
{
|
||||
char reason[256];
|
||||
@ -222,7 +222,7 @@ int k4getTGT(username, password, err_string)
|
||||
#endif /* KRB4 */
|
||||
#ifdef KRB5
|
||||
/****************************************************************************
|
||||
* k5getTGT() -- calls K5 libraries to get TGT (non-AFS)
|
||||
* k5getTGT() -- calls K5 libraries to get TGT (non-AFS)
|
||||
* most of this was copied from the Krb5 kinit.c
|
||||
*
|
||||
* Returns 0 on success (err_string = "")
|
||||
@ -279,7 +279,7 @@ int k5getTGT(username, password, err_string)
|
||||
}
|
||||
|
||||
my_creds.server = server;
|
||||
my_creds.times.starttime = 0;
|
||||
my_creds.times.starttime = 0;
|
||||
my_creds.times.endtime = 0; /* now + KRB5_DEFAULT_LIFE; */
|
||||
my_creds.times.renew_till = 0;
|
||||
|
||||
@ -292,9 +292,9 @@ int k5getTGT(username, password, err_string)
|
||||
if (code) {
|
||||
sprintf(err_string,"krb5_get_in_tkt error: %s", error_message(code));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -354,7 +354,7 @@ int str_to_kdata(in_str, out_str)
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* compose_kerberos_auth_string
|
||||
* compose_kerberos_auth_string
|
||||
*
|
||||
* Accepts: scheme (one of the HTAA_KERBEROS values)
|
||||
* hostname
|
||||
@ -426,7 +426,7 @@ char *compose_kerberos_auth_string(scheme, hostname)
|
||||
if (!k5context) {
|
||||
krb5_init_context(&k5context);
|
||||
if (code) {
|
||||
sprintf(krb_err_str,"Error initializing Kerb5 context: %s\n",error_message(code));
|
||||
sprintf(krb_err_str,"Error initializing Kerb5 context: %s\n",error_message(code));
|
||||
application_user_info_wait(krb_err_str);
|
||||
return (char *) NULL;
|
||||
}
|
||||
@ -441,11 +441,11 @@ char *compose_kerberos_auth_string(scheme, hostname)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
code = krb5_mk_req(k5context, &k5auth_context, AP_OPTS_USE_SESSION_KEY,
|
||||
"khttp", hostname, NULL, k5ccache, &k5ap_req);
|
||||
|
||||
if (!code) {
|
||||
if (!code) {
|
||||
|
||||
/* get username from credentials cache */
|
||||
|
||||
@ -467,7 +467,7 @@ char *compose_kerberos_auth_string(scheme, hostname)
|
||||
return (char *) NULL;
|
||||
}
|
||||
|
||||
krb5_sname_to_principal(k5context, hostname, "khttp",
|
||||
krb5_sname_to_principal(k5context, hostname, "khttp",
|
||||
KRB5_NT_SRV_HST, &k5serverp);
|
||||
|
||||
memset((char *)&k5in_creds, 0, sizeof(k5in_creds));
|
||||
@ -480,7 +480,7 @@ char *compose_kerberos_auth_string(scheme, hostname)
|
||||
|
||||
code = krb5_get_credentials(k5context,KRB5_GC_CACHED,k5ccache,&k5in_creds,&k5out_creds);
|
||||
|
||||
if ((code == KRB5_CC_NOTFOUND) || (now >= k5out_creds->times.endtime)) {
|
||||
if ((code == KRB5_CC_NOTFOUND) || (now >= k5out_creds->times.endtime)) {
|
||||
/* replace "Matching creds not found" */
|
||||
sprintf(krb_err_str,"Kerberos ticket expired\n");
|
||||
code = 666;
|
||||
@ -497,7 +497,7 @@ char *compose_kerberos_auth_string(scheme, hostname)
|
||||
sprintf(krb_err_str,"krb5_mk_req: %s\n",error_message(code));
|
||||
}
|
||||
}
|
||||
else {
|
||||
else {
|
||||
pass = kdata_to_str(k5ap_req.data, k5ap_req.length);
|
||||
}
|
||||
}
|
||||
@ -548,7 +548,7 @@ char *compose_kerberos_auth_string(scheme, hostname)
|
||||
* validate_kerberos_server_auth
|
||||
* Accepts: scheme (one of the HTAA_KERBEROS values)
|
||||
* the Authorization line from the request
|
||||
* Returns: NIL on success, T on failure
|
||||
* Returns: NIL on success, T on failure
|
||||
(currently return value not used)
|
||||
************************************************************************/
|
||||
int validate_kerberos_server_auth(scheme, str)
|
||||
@ -587,7 +587,7 @@ int validate_kerberos_server_auth(scheme, str)
|
||||
else if (scheme == HTAA_KERBEROS_V4) {
|
||||
retval = k4validate_kerberos_server_auth(str);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#ifdef KRB5
|
||||
else if (scheme == HTAA_KERBEROS_V5) {
|
||||
retval = k5validate_kerberos_server_auth(str);
|
||||
@ -644,9 +644,9 @@ int k4validate_kerberos_server_auth(str)
|
||||
|
||||
if (ntohl(*(long *)k4authent.dat) != k4checksum + 1) {
|
||||
fprintf(stderr,"\n\nchecksum just doesn't check out\n\n");
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -663,7 +663,7 @@ int k5validate_kerberos_server_auth(instr)
|
||||
|
||||
k5ap_rep.length = str_to_kdata(instr, tmpstr);
|
||||
|
||||
if (k5ap_rep.length == 0)
|
||||
if (k5ap_rep.length == 0)
|
||||
return 1;
|
||||
|
||||
k5ap_rep.data = tmpstr;
|
||||
@ -672,7 +672,7 @@ int k5validate_kerberos_server_auth(instr)
|
||||
|
||||
krb5_free_ap_rep_enc_part(k5context, k5ap_rep_result);
|
||||
|
||||
if (code)
|
||||
if (code)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
@ -167,20 +167,20 @@ PUBLIC void HTAASetup_clearall (HTList *s)
|
||||
** On Exit: password information is gone.
|
||||
**
|
||||
** May 1996 PLB Created.
|
||||
**
|
||||
**
|
||||
*/
|
||||
PUBLIC void HTAAServer_clear ()
|
||||
{
|
||||
HTList *n, *nn;
|
||||
HTAAServer *s;
|
||||
|
||||
|
||||
n = server_table;
|
||||
while (n) {
|
||||
nn = n->next;
|
||||
s = (HTAAServer *)n->object;
|
||||
if (s) {
|
||||
#ifndef DISABLE_TRACE
|
||||
if (www2Trace)
|
||||
if (www2Trace)
|
||||
fprintf(stderr, "Clearing passwd info for %s\n", s->hostname?s->hostname:"NULL");
|
||||
#endif
|
||||
HTAARealm_clearall (s->realms);
|
||||
@ -192,9 +192,9 @@ PUBLIC void HTAAServer_clear ()
|
||||
n = nn;
|
||||
}
|
||||
server_table = NULL;
|
||||
secret_key = NULL;
|
||||
current_setup = NULL;
|
||||
current_hostname = NULL;
|
||||
secret_key = NULL;
|
||||
current_setup = NULL;
|
||||
current_hostname = NULL;
|
||||
current_docname = NULL;
|
||||
}
|
||||
|
||||
@ -231,7 +231,7 @@ PRIVATE HTAAServer *HTAAServer_new ARGS2(WWW_CONST char*, hostname,
|
||||
if (hostname) StrAllocCopy(server->hostname, hostname);
|
||||
|
||||
if (!server_table) server_table = HTList_new();
|
||||
|
||||
|
||||
HTList_addObject(server_table, (void*)server);
|
||||
|
||||
return server;
|
||||
@ -284,7 +284,7 @@ PRIVATE HTAAServer *HTAAServer_lookup ARGS2(WWW_CONST char *, hostname,
|
||||
|
||||
|
||||
|
||||
/*************************** HTAASetup *******************************/
|
||||
/*************************** HTAASetup *******************************/
|
||||
|
||||
|
||||
/* PRIVATE HTAASetup_lookup()
|
||||
@ -306,7 +306,7 @@ PRIVATE HTAAServer *HTAAServer_lookup ARGS2(WWW_CONST char *, hostname,
|
||||
** Otherwise, a HTAASetup structure representing
|
||||
** the protected server setup on the corresponding
|
||||
** document tree.
|
||||
**
|
||||
**
|
||||
*/
|
||||
PRIVATE HTAASetup *HTAASetup_lookup ARGS3(WWW_CONST char *, hostname,
|
||||
int, portnumber,
|
||||
@ -453,7 +453,7 @@ PRIVATE void HTAASetup_updateSpecifics ARGS2(HTAASetup *, setup,
|
||||
** On Entry:
|
||||
** realm_table a list of realm objects
|
||||
**
|
||||
** On Exit:
|
||||
** On Exit:
|
||||
** returns: Nothing. realm_table is no longer valid.
|
||||
*/
|
||||
PUBLIC void HTAARealm_clearall ARGS1(HTList *, realm_table)
|
||||
@ -468,10 +468,10 @@ PUBLIC void HTAARealm_clearall ARGS1(HTList *, realm_table)
|
||||
if (r) {
|
||||
|
||||
#ifdef PAUL_IS_A_GIMP
|
||||
if (www2Trace)
|
||||
if (www2Trace)
|
||||
fprintf(stderr, "Clearing %s %s:%s\n",
|
||||
r->realmname?r->realmname:"NULL",
|
||||
r->realmname?r->username:"NULL",
|
||||
r->realmname?r->realmname:"NULL",
|
||||
r->realmname?r->username:"NULL",
|
||||
r->realmname?r->password:"NULL");
|
||||
|
||||
#endif
|
||||
@ -504,7 +504,7 @@ PRIVATE HTAARealm *HTAARealm_lookup ARGS2(HTList *, realm_table,
|
||||
if (realm_table && realmname) {
|
||||
HTList *cur = realm_table;
|
||||
HTAARealm *realm;
|
||||
|
||||
|
||||
while (NULL != (realm = (HTAARealm*)HTList_nextObject(cur))) {
|
||||
if (0==strcmp(realm->realmname, realmname))
|
||||
return realm;
|
||||
@ -624,11 +624,11 @@ PRIVATE char *compose_auth_string ARGS2(HTAAScheme, scheme,
|
||||
/* for MD5 -- DXP */
|
||||
char * nonce; /* Server specified integer value */
|
||||
char * opaque; /* more random MD5 junk... */
|
||||
|
||||
|
||||
|
||||
FREE(result); /* From previous call */
|
||||
|
||||
if ((scheme != HTAA_BASIC && scheme != HTAA_PUBKEY && scheme != HTAA_MD5)
|
||||
if ((scheme != HTAA_BASIC && scheme != HTAA_PUBKEY && scheme != HTAA_MD5)
|
||||
|| !setup ||
|
||||
!setup->scheme_specifics || !setup->scheme_specifics[scheme] ||
|
||||
!setup->server || !setup->server->realms)
|
||||
@ -675,7 +675,7 @@ PRIVATE char *compose_auth_string ARGS2(HTAAScheme, scheme,
|
||||
if (!realm->password)
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
len = strlen(realm->username ? realm->username : "") +
|
||||
strlen(realm->password ? realm->password : "") + 3;
|
||||
|
||||
@ -740,13 +740,13 @@ PRIVATE char *compose_auth_string ARGS2(HTAAScheme, scheme,
|
||||
if (!opaque)
|
||||
return "";
|
||||
|
||||
if (!(A1 = (unsigned char*)malloc(strlen(realm->username) +
|
||||
strlen(realm->realmname) +
|
||||
if (!(A1 = (unsigned char*)malloc(strlen(realm->username) +
|
||||
strlen(realm->realmname) +
|
||||
strlen(realm->password) + 3 + 1)))
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
|
||||
if (!(A2 = (unsigned char*)malloc(4 + strlen(current_docname) + 1 + 1 )))
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
|
||||
/* make A1 */
|
||||
*A1 = (unsigned char)0;
|
||||
@ -768,18 +768,18 @@ PRIVATE char *compose_auth_string ARGS2(HTAAScheme, scheme,
|
||||
strcat((char*)A2, "\0");
|
||||
|
||||
if (!(md5_cleartext = (unsigned char*)malloc(100 + 1)))
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
if (!(md5_ciphertext = (unsigned char*)malloc(100 + 1)))
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
if (!(hex1 = (unsigned char*)malloc(32 + 1)))
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
if (!(hex2 = (unsigned char*)malloc(32 + 1)))
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
if (!(digest1 = (unsigned char*)malloc(16)))
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
if (!(digest2 = (unsigned char*)malloc(16)))
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
|
||||
outofmem(__FILE__, "compose_auth_string");
|
||||
|
||||
MD5Mem(A1, strlen((char*)A1), digest1);
|
||||
MD5Mem(A2, strlen((char*)A2), digest2);
|
||||
|
||||
@ -886,7 +886,7 @@ PUBLIC char *HTAA_composeAuth ARGS3(WWW_CONST char *, hostname,
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (www2Trace)
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"Composing Authorization for %s:%d/%s\n",
|
||||
hostname, portnumber, docname);
|
||||
#endif
|
||||
@ -900,7 +900,7 @@ PUBLIC char *HTAA_composeAuth ARGS3(WWW_CONST char *, hostname,
|
||||
retry = NO;
|
||||
|
||||
current_portnumber = portnumber;
|
||||
|
||||
|
||||
if (hostname) StrAllocCopy(current_hostname, hostname);
|
||||
else FREE(current_hostname);
|
||||
|
||||
@ -908,7 +908,7 @@ PUBLIC char *HTAA_composeAuth ARGS3(WWW_CONST char *, hostname,
|
||||
else FREE(current_docname);
|
||||
}
|
||||
else retry = YES;
|
||||
|
||||
|
||||
if (!current_setup || !retry)
|
||||
current_setup = HTAASetup_lookup(hostname, portnumber, docname);
|
||||
|
||||
@ -974,7 +974,7 @@ PUBLIC char *HTAA_composeAuth ARGS3(WWW_CONST char *, hostname,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* BROWSER PUBLIC HTAA_shouldRetryWithAuth()
|
||||
**
|
||||
** DETERMINES IF WE SHOULD RETRY THE SERVER
|
||||
@ -1034,7 +1034,7 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS3(char *, start_of_headers,
|
||||
char *fieldname = HTNextField(&p);
|
||||
char *arg1 = HTNextField(&p);
|
||||
char *args = p;
|
||||
|
||||
|
||||
if (0==my_strcasecmp(fieldname, "WWW-Authenticate:")) {
|
||||
if (HTAA_UNKNOWN != (scheme = HTAAScheme_enum(arg1))) {
|
||||
HTList_addObject(valid_schemes, (void*)scheme);
|
||||
@ -1087,7 +1087,7 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS3(char *, start_of_headers,
|
||||
/* So we have already tried with authorization. */
|
||||
/* Either we don't have access or username or */
|
||||
/* password was misspelled. */
|
||||
|
||||
|
||||
/* Update scheme-specific parameters */
|
||||
/* (in case they have expired by chance). */
|
||||
HTAASetup_updateSpecifics(current_setup, scheme_specifics);
|
||||
@ -1115,7 +1115,7 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS3(char *, start_of_headers,
|
||||
}
|
||||
if (!template)
|
||||
template = HTAA_makeProtectionTemplate(current_docname);
|
||||
current_setup = HTAASetup_new(server,
|
||||
current_setup = HTAASetup_new(server,
|
||||
template,
|
||||
valid_schemes,
|
||||
scheme_specifics);
|
||||
|
@ -1,31 +1,31 @@
|
||||
/* BROWSER SIDE ACCESS AUTHORIZATION MODULE
|
||||
|
||||
|
||||
This module is the browser side interface to Access Authorization (AA) package. It
|
||||
contains code only for browser.
|
||||
|
||||
|
||||
Important to know about memory allocation:
|
||||
|
||||
|
||||
Routines in this module use dynamic allocation, but free automatically all the memory
|
||||
reserved by them.
|
||||
|
||||
|
||||
Therefore the caller never has to (and never should) free() any object returned by
|
||||
these functions.
|
||||
|
||||
|
||||
Therefore also all the strings returned by this package are only valid until the next
|
||||
call to the same function is made. This approach is selected, because of the nature of
|
||||
access authorization: no string returned by the package needs to be valid longer than
|
||||
until the next call.
|
||||
|
||||
|
||||
This also makes it easy to plug the AA package in: you don't have to ponder whether to
|
||||
free()something here or is it done somewhere else (because it is always done somewhere
|
||||
else).
|
||||
|
||||
|
||||
The strings that the package needs to store are copied so the original strings given as
|
||||
parameters to AA functions may be freed or modified with no side effects.
|
||||
|
||||
|
||||
Also note:The AA package does not free() anything else than what it has itself
|
||||
allocated.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HTAABROW_H
|
||||
@ -48,19 +48,19 @@ Routines for Browser Side Recording of AA Info
|
||||
Most of the browser-side AA is done by the following two functions (which are called
|
||||
from file HTTP.c so the browsers using libwww only need to be linked with the new
|
||||
library and not be changed at all):
|
||||
|
||||
|
||||
HTAA_composeAuth() composes the Authorization: line contents, if the AA package
|
||||
thinks that the given document is protected. Otherwise this function returns NULL.
|
||||
This function also calls the functions HTPrompt(),HTPromptPassword() and HTConfirm()
|
||||
to get the username, password and some confirmation from the user.
|
||||
|
||||
|
||||
HTAA_shouldRetryWithAuth() determines whether to retry the request with AA or with a
|
||||
new AA (in case username or password was misspelled).
|
||||
|
||||
HTAA_TryWithAuth() sets up everything for an automatic first try with authentication.
|
||||
|
||||
HTAA_ClearAuth() clears the currently allocated authentication record.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* PUBLIC HTAA_composeAuth()
|
||||
@ -156,19 +156,19 @@ PUBLIC void HTAA_ClearAuth NOPARAMS;
|
||||
#ifdef PEM_AUTH
|
||||
/*
|
||||
* PUBLIC HTAA_makecommand()
|
||||
*
|
||||
*
|
||||
* ENCRYPT AN HTTP REQUEST, AND ENCAPSULATE IT IN
|
||||
* A NEW HTTP PEM AUTHORIZED REQUEST
|
||||
*
|
||||
*
|
||||
* ON ENTRY:
|
||||
* command the HTTP request
|
||||
*
|
||||
*
|
||||
* ON EXIT:
|
||||
* returns the new HTTP request with PEM
|
||||
*
|
||||
* Do not free this string. This function *requires* that the
|
||||
*
|
||||
* Do not free this string. This function *requires* that the
|
||||
* HTAA_composeAuth function has been called prior to it.
|
||||
*
|
||||
*
|
||||
*/
|
||||
PUBLIC char *HTAA_makecommand PARAMS((char * command, char **body, int *bl));
|
||||
#endif /* PEM_AUTH */
|
||||
|
@ -129,7 +129,7 @@ PRIVATE int read_item ARGS4(FILE *, fp,
|
||||
** READ A FIELD FROM A PASSWORD, GROUP
|
||||
** OR ACCESS CONTROL LIST FILE
|
||||
** i.e. an item terminated by colon,
|
||||
** end-of-line, or end-of-file.
|
||||
** end-of-line, or end-of-file.
|
||||
** ON ENTRY:
|
||||
** fp is the file to read the characters from
|
||||
** contents is the character array to put the characters
|
||||
|
@ -1,14 +1,14 @@
|
||||
/* FILE ROUTINES FOR ACCESS AUTHORIZATION PACKAGE
|
||||
|
||||
|
||||
This module implements the routines used for accessing (and parsing) the files used in
|
||||
the access authorization:
|
||||
|
||||
|
||||
password file
|
||||
|
||||
|
||||
group file
|
||||
|
||||
|
||||
access control list (ACL) file
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@ -37,23 +37,23 @@
|
||||
Naming conventions
|
||||
|
||||
Record is an entire line in file.
|
||||
|
||||
|
||||
Field is an entity separated by colons and/or by end-of-line.
|
||||
|
||||
|
||||
List is a field in which there are items separated by commas.
|
||||
|
||||
|
||||
Record-oriented Read Routines
|
||||
|
||||
Password, group and ACL are internally read in by the following functions:
|
||||
|
||||
|
||||
HTAAFile_nextRec() skips to the beginning of the next record (must be called even
|
||||
after the last field of a record is read to proceed to the next
|
||||
record).
|
||||
|
||||
|
||||
HTAAFile_readField() reads a field (separated by colons).
|
||||
|
||||
|
||||
HTAAFile_readList() reads a field containing a comma-separated list of items.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* PUBLIC HTAAFile_nextRec()
|
||||
|
@ -81,14 +81,14 @@ PUBLIC int HTAA_getUid NOARGS
|
||||
if (isNumber(current_prot->uid_name)) {
|
||||
if (NULL != (pw = getpwuid(atoi(current_prot->uid_name)))) {
|
||||
#ifndef DISABLE_TRACE
|
||||
if (www2Trace) fprintf(stderr,
|
||||
if (www2Trace) fprintf(stderr,
|
||||
"%s(%s) returned (%s:%s:%d:%d:...)\n",
|
||||
"HTAA_getUid: getpwuid",
|
||||
current_prot->uid_name,
|
||||
pw->pw_name, pw->pw_passwd,
|
||||
pw->pw_uid, pw->pw_gid);
|
||||
#endif
|
||||
return pw->pw_uid;
|
||||
return pw->pw_uid;
|
||||
}
|
||||
}
|
||||
else { /* User name (not a number) */
|
||||
@ -118,9 +118,9 @@ PUBLIC int HTAA_getUid NOARGS
|
||||
** Default is 65534 (nogroup).
|
||||
*/
|
||||
PUBLIC int HTAA_getGid NOARGS
|
||||
{
|
||||
{
|
||||
struct group *gr = NULL;
|
||||
|
||||
|
||||
if (current_prot && current_prot->gid_name) {
|
||||
if (isNumber(current_prot->gid_name)) {
|
||||
if (NULL != (gr = getgrgid(atoi(current_prot->gid_name)))) {
|
||||
@ -137,7 +137,7 @@ PUBLIC int HTAA_getGid NOARGS
|
||||
else { /* Group name (not number) */
|
||||
if (NULL != (gr = getgrnam(current_prot->gid_name))) {
|
||||
#ifndef DISABLE_TRACE
|
||||
if (www2Trace) fprintf(stderr,
|
||||
if (www2Trace) fprintf(stderr,
|
||||
"%s(\"%s\") returned (%s:%s:%d:...)\n",
|
||||
"HTAA_getGid: getgrnam",
|
||||
current_prot->gid_name,
|
||||
@ -216,9 +216,9 @@ PRIVATE void HTAA_parseProtFile ARGS2(HTAAProt *, prot,
|
||||
break;
|
||||
|
||||
if (lex_item == LEX_ALPH_STR) { /* Valid setup record */
|
||||
|
||||
|
||||
StrAllocCopy(fieldname, lex_buffer);
|
||||
|
||||
|
||||
if (LEX_FIELD_SEP != (lex_item = lex(fp)))
|
||||
unlex(lex_item); /* If someone wants to use colon */
|
||||
/* after field name it's ok, but */
|
||||
@ -245,7 +245,7 @@ PRIVATE void HTAA_parseProtFile ARGS2(HTAAProt *, prot,
|
||||
"authentication scheme:",
|
||||
lex_buffer);
|
||||
#endif
|
||||
|
||||
|
||||
if (LEX_ITEM_SEP != (lex_item = lex(fp)))
|
||||
break;
|
||||
/*
|
||||
@ -282,7 +282,7 @@ PRIVATE void HTAA_parseProtFile ARGS2(HTAAProt *, prot,
|
||||
HTAssocList_add(prot->values, fieldname, lex_buffer);
|
||||
lex_item = lex(fp); /* Read record separator */
|
||||
#ifndef DISABLE_TRACE
|
||||
if (www2Trace) fprintf(stderr,
|
||||
if (www2Trace) fprintf(stderr,
|
||||
"%s `%s' bound to value `%s'\n",
|
||||
"HTAA_parseProtFile: Name",
|
||||
fieldname, lex_buffer);
|
||||
@ -347,7 +347,7 @@ PRIVATE HTAAProt *HTAAProt_new ARGS3(WWW_CONST char *, cur_docname,
|
||||
|
||||
if (!prot_cache)
|
||||
prot_cache = HTList_new();
|
||||
|
||||
|
||||
while (NULL != (cache_item = (HTAAProtCache*)HTList_nextObject(cur))) {
|
||||
if (!strcmp(cache_item->prot_filename, prot_filename))
|
||||
break;
|
||||
@ -536,7 +536,7 @@ PUBLIC HTAAProt *HTAA_getDefaultProtection NOARGS
|
||||
if (!current_prot) {
|
||||
current_prot = default_prot;
|
||||
default_prot = NULL;
|
||||
}
|
||||
}
|
||||
return current_prot;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* PROTECTION SETUP FILE
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HTAAPROT_H
|
||||
@ -39,15 +39,15 @@ typedef struct {
|
||||
Callbacks for rule system
|
||||
|
||||
The following three functioncs are called by the rule system:
|
||||
|
||||
|
||||
HTAA_clearProtections() when starting to translate a filename
|
||||
|
||||
|
||||
HTAA_setDefaultProtection() when "defprot" rule is matched
|
||||
|
||||
|
||||
HTAA_setCurrentProtection() when "protect" rule is matched
|
||||
|
||||
|
||||
Protection setup files are cached by these functions.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* PUBLIC HTAA_setDefaultProtection()
|
||||
@ -117,11 +117,11 @@ Getting Protection Settings
|
||||
|
||||
HTAA_getCurrentProtection() returns the current protection mode (if there was a
|
||||
"protect" rule). NULL, if no "protect" rule has been matched.
|
||||
|
||||
|
||||
HTAA_getDefaultProtection() sets the current protection mode to what it was set to
|
||||
by "defprot" rule and also returns it (therefore after this call also
|
||||
HTAA_getCurrentProtection() returns the same structure.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* PUBLIC HTAA_getCurrentProtection()
|
||||
|
@ -119,7 +119,7 @@ PUBLIC char *HTAA_statusMessage NOARGS
|
||||
|
||||
/* Success */
|
||||
case HTAA_OK:
|
||||
return "AA: Access should be ok but something went wrong";
|
||||
return "AA: Access should be ok but something went wrong";
|
||||
break;
|
||||
|
||||
/* Others */
|
||||
@ -176,7 +176,7 @@ PRIVATE char *status_name ARGS1(HTAAFailReasonType, reason)
|
||||
} /* switch */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -272,7 +272,7 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(WWW_CONST char *, pathname
|
||||
"host", HTClientHost);
|
||||
else fprintf(stderr, "%s %s %s %s\n",
|
||||
"HTAA_checkAuthorization: request from",
|
||||
HTClientHost,
|
||||
HTClientHost,
|
||||
"accepted by only mask match (no ACL, only",
|
||||
"Protect rule, and only mask enabled)");
|
||||
}
|
||||
@ -338,7 +338,7 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(WWW_CONST char *, pathname
|
||||
? htaa_user->username : "NOT-AUTHENTICATED"));
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
/*
|
||||
** Check mask group
|
||||
*/
|
||||
if (prot->mask_group) {
|
||||
@ -358,7 +358,7 @@ PRIVATE HTAAFailReasonType check_authorization ARGS4(WWW_CONST char *, pathname
|
||||
#ifndef DISABLE_TRACE
|
||||
else if (www2Trace) fprintf(stderr, "%s %s %s %s %s\n",
|
||||
"HTAA_checkAuthorization: request from",
|
||||
HTClientHost,
|
||||
HTClientHost,
|
||||
"accepted by just mask group match",
|
||||
"(no ACL, only Protect rule, and only",
|
||||
"mask enabled)");
|
||||
@ -436,7 +436,7 @@ PUBLIC int HTAA_checkAuthorization ARGS4(WWW_CONST char *, url,
|
||||
char *local_copy = NULL;
|
||||
HTAAMethod method = HTAAMethod_enum(method_name);
|
||||
HTAAScheme scheme = HTAAScheme_enum(scheme_name);
|
||||
|
||||
|
||||
/*
|
||||
** Translate into absolute pathname, and
|
||||
** check for "protect" and "defprot" rules.
|
||||
@ -453,7 +453,7 @@ PUBLIC int HTAA_checkAuthorization ARGS4(WWW_CONST char *, url,
|
||||
char *localname = HTLocalName(pathname);
|
||||
free(pathname);
|
||||
pathname = localname;
|
||||
}
|
||||
}
|
||||
FREE(local_copy);
|
||||
|
||||
HTAAFailReason = check_authorization(pathname, method,
|
||||
@ -621,7 +621,7 @@ PUBLIC char *HTAA_composeAuthHeaders NOARGS
|
||||
#endif
|
||||
} /* scheme valid for requested document */
|
||||
} /* for every scheme */
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1,31 +1,31 @@
|
||||
/* SERVER SIDE ACCESS AUTHORIZATION MODULE
|
||||
|
||||
|
||||
This module is the server side interface to Access Authorization (AA) package. It
|
||||
contains code only for server.
|
||||
|
||||
|
||||
Important to know about memory allocation:
|
||||
|
||||
|
||||
Routines in this module use dynamic allocation, but free automatically all the memory
|
||||
reserved by them.
|
||||
|
||||
|
||||
Therefore the caller never has to (and never should) free() any object returned by
|
||||
these functions.
|
||||
|
||||
|
||||
Therefore also all the strings returned by this package are only valid until the next
|
||||
call to the same function is made. This approach is selected, because of the nature of
|
||||
access authorization: no string returned by the package needs to be valid longer than
|
||||
until the next call.
|
||||
|
||||
|
||||
This also makes it easy to plug the AA package in: you don't have to ponder whether to
|
||||
free()something here or is it done somewhere else (because it is always done somewhere
|
||||
else).
|
||||
|
||||
|
||||
The strings that the package needs to store are copied so the original strings given as
|
||||
parameters to AA functions may be freed or modified with no side effects.
|
||||
|
||||
|
||||
Also note:The AA package does not free() anything else than what it has itself
|
||||
allocated.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HTAASERV_H
|
||||
@ -50,7 +50,7 @@
|
||||
Check Access Authorization
|
||||
|
||||
HTAA_checkAuthorization() is the main access authorization function.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* PUBLIC HTAA_checkAuthorization()
|
||||
|
@ -76,7 +76,7 @@ PUBLIC HTAAScheme HTAAScheme_enum ARGS1(WWW_CONST char*, name)
|
||||
*cur = TOUPPER(*cur);
|
||||
cur++;
|
||||
}
|
||||
|
||||
|
||||
if (!strncmp(upcased, "NONE", 4))
|
||||
return HTAA_NONE;
|
||||
else if (!strncmp(upcased, "BASIC", 5))
|
||||
@ -112,7 +112,7 @@ PUBLIC char *HTAAScheme_name ARGS1(HTAAScheme, scheme)
|
||||
case HTAA_PUBKEY: return "Pubkey"; break;
|
||||
case HTAA_KERBEROS_V4: return "KerberosV4"; break;
|
||||
case HTAA_KERBEROS_V5: return "KerberosV5"; break;
|
||||
case HTAA_MD5: return "Digest"; break;
|
||||
case HTAA_MD5: return "Digest"; break;
|
||||
case HTAA_UNKNOWN: return "UNKNOWN"; break;
|
||||
default: return "THIS-IS-A-BUG";
|
||||
}
|
||||
@ -227,7 +227,7 @@ PUBLIC BOOL HTAAMethod_inList ARGS2(HTAAMethod, method,
|
||||
** returns YES, if filename matches the template.
|
||||
** NO, otherwise.
|
||||
*/
|
||||
PUBLIC BOOL HTAA_templateMatch ARGS2(WWW_CONST char *, template,
|
||||
PUBLIC BOOL HTAA_templateMatch ARGS2(WWW_CONST char *, template,
|
||||
WWW_CONST char *, filename)
|
||||
{
|
||||
WWW_CONST char *p = template;
|
||||
@ -236,7 +236,7 @@ PUBLIC BOOL HTAA_templateMatch ARGS2(WWW_CONST char *, template,
|
||||
|
||||
for( ; *p && *q && *p == *q; p++, q++) /* Find first mismatch */
|
||||
; /* do nothing else */
|
||||
|
||||
|
||||
if (!*p && !*q) return YES; /* Equally long equal strings */
|
||||
else if ('*' == *p) { /* Wildcard */
|
||||
p++; /* Skip wildcard character */
|
||||
@ -376,7 +376,7 @@ PUBLIC HTAssocList *HTAA_parseArgList ARGS1(char *, str)
|
||||
}
|
||||
}
|
||||
else { /* No name, just a value */
|
||||
if (*cur == ',')
|
||||
if (*cur == ',')
|
||||
*(cur++) = (char)0; /* Terminate value */
|
||||
/* else last value on line (already terminated by NULL) */
|
||||
StrAllocCopy(name, "nnn"); /* Room for item order number */
|
||||
@ -497,7 +497,7 @@ PUBLIC char *HTAA_getUnfoldedLine NOARGS
|
||||
|
||||
|
||||
/* Unfolding */
|
||||
|
||||
|
||||
if (peek_for_folding) {
|
||||
if (*cur != ' ' && *cur != '\t')
|
||||
return line; /* Ok, no continuation line */
|
||||
@ -511,7 +511,7 @@ PUBLIC char *HTAA_getUnfoldedLine NOARGS
|
||||
while (cur < end_pointer && *cur != '\n') /* Find the end-of-line */
|
||||
cur++; /* (or end-of-buffer). */
|
||||
|
||||
|
||||
|
||||
/* Terminating line */
|
||||
|
||||
if (cur < end_pointer) { /* So *cur==LF, terminate line */
|
||||
|
@ -1,30 +1,30 @@
|
||||
/* Utilities for the Authorization parts of libwww
|
||||
COMMON PARTS OF AUTHORIZATION MODULE TO BOTH SERVER AND BROWSER
|
||||
|
||||
|
||||
This module is the interface to the common parts of Access Authorization (AA) package
|
||||
for both server and browser. Important to know about memory allocation:
|
||||
|
||||
|
||||
Routines in this module use dynamic allocation, but free automatically all the memory
|
||||
reserved by them.
|
||||
|
||||
|
||||
Therefore the caller never has to (and never should) free() any object returned by
|
||||
these functions.
|
||||
|
||||
|
||||
Therefore also all the strings returned by this package are only valid until the next
|
||||
call to the same function is made. This approach is selected, because of the nature of
|
||||
access authorization: no string returned by the package needs to be valid longer than
|
||||
until the next call.
|
||||
|
||||
|
||||
This also makes it easy to plug the AA package in: you don't have to ponder whether to
|
||||
free() something here or is it done somewhere else (because it is always done somewhere
|
||||
else).
|
||||
|
||||
|
||||
The strings that the package needs to store are copied so the original strings given as
|
||||
parameters to AA functions may be freed or modified with no side effects.
|
||||
|
||||
|
||||
Also note: The AA package does not free() anything else than what it has itself
|
||||
allocated.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HTAAUTIL_H
|
||||
@ -88,10 +88,10 @@ Default filenames
|
||||
Datatype definitions
|
||||
|
||||
HTAASCHEME
|
||||
|
||||
|
||||
The enumeration HTAAScheme represents the possible authentication schemes used by the
|
||||
WWW Access Authorization.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
@ -110,7 +110,7 @@ typedef enum {
|
||||
/*
|
||||
|
||||
ENUMERATION TO REPRESENT HTTP METHODS
|
||||
|
||||
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
|
@ -61,7 +61,7 @@ PUBLIC char *HTAA_getAclFilename ARGS1(WWW_CONST char *, pathname)
|
||||
*filename = '\0'; /* Truncate filename off from directory path */
|
||||
filename++; /* and the filename begins from the next character */
|
||||
}
|
||||
|
||||
|
||||
StrAllocCopy(acl_path, directory); /* Also frees acl_path */
|
||||
/* from previous call. */
|
||||
StrAllocCat(acl_path, "/");
|
||||
@ -156,7 +156,7 @@ PUBLIC GroupDef *HTAA_getAclEntry ARGS3(FILE *, acl_file,
|
||||
char *buf;
|
||||
|
||||
if (!acl_file) return NULL; /* ACL doesn't exist */
|
||||
|
||||
|
||||
if (group_def) {
|
||||
GroupDef_delete(group_def); /* From previous call */
|
||||
group_def = NULL;
|
||||
@ -170,7 +170,7 @@ PUBLIC GroupDef *HTAA_getAclEntry ARGS3(FILE *, acl_file,
|
||||
|
||||
if (!(buf = (char*)malloc((strlen(filename)+2)*sizeof(char))))
|
||||
outofmem(__FILE__, "HTAA_getAuthorizedGroups");
|
||||
|
||||
|
||||
while (EOF != HTAAFile_readField(acl_file, buf, len+1)) {
|
||||
if (HTAA_templateMatch(buf, filename)) {
|
||||
HTList *methods = HTList_new();
|
||||
@ -180,7 +180,7 @@ PUBLIC GroupDef *HTAA_getAclEntry ARGS3(FILE *, acl_file,
|
||||
fprintf(stderr,
|
||||
"Filename '%s' matched template '%s', allowed methods:",
|
||||
filename, buf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (HTAAMethod_inList(method, methods)) { /* right method? */
|
||||
#ifndef DISABLE_TRACE
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ACCESS CONTROL LIST ROUTINES
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HTACL_H
|
||||
|
@ -66,7 +66,7 @@ PUBLIC char * HTClientHost = 0; /* Name of remote login host if any */
|
||||
*/
|
||||
|
||||
PUBLIC HTFormat HTOutputFormat = NULL;
|
||||
PUBLIC HTStream* HTOutputStream = NULL; /* For non-interactive, set this */
|
||||
PUBLIC HTStream* HTOutputStream = NULL; /* For non-interactive, set this */
|
||||
|
||||
PUBLIC BOOL using_gateway = NO; /* are we using a gateway? */
|
||||
PUBLIC BOOL using_proxy = NO; /* are we using a proxy gateway? */
|
||||
@ -142,7 +142,7 @@ PRIVATE int get_physical ARGS3(
|
||||
char * host = NULL;
|
||||
struct Proxy *GetNoProxy();
|
||||
extern int useKeepAlive;
|
||||
|
||||
|
||||
HTAnchor_setPhysical(anchor, addr);
|
||||
|
||||
access = HTParse(HTAnchor_physical(anchor),
|
||||
@ -348,7 +348,7 @@ PRIVATE int HTLoad ARGS4(
|
||||
|
||||
while (1) {
|
||||
if (status < 0) return status; /* Can't resolve or forbidden */
|
||||
|
||||
|
||||
retry=5;
|
||||
|
||||
retry_proxy:
|
||||
@ -428,9 +428,9 @@ PUBLIC HTStream *HTSaveStream ARGS1(HTParentAnchor *, anchor)
|
||||
{
|
||||
HTProtocol * p = HTAnchor_protocol(anchor);
|
||||
if (!p) return NULL;
|
||||
|
||||
|
||||
return (*p->saveStream)(anchor);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -449,7 +449,7 @@ PUBLIC HTStream *HTSaveStream ARGS1(HTParentAnchor *, anchor)
|
||||
**
|
||||
** On Exit,
|
||||
** returns 1 Success in opening document
|
||||
** 0 Failure
|
||||
** 0 Failure
|
||||
** -1 Interrupted
|
||||
**
|
||||
*/
|
||||
@ -468,7 +468,7 @@ PRIVATE int HTLoadDocument ARGS4(
|
||||
|
||||
use_this_url_instead = NULL;
|
||||
|
||||
/* We LOVE goto's!
|
||||
/* We LOVE goto's!
|
||||
*
|
||||
* Let's rephrase this..._You_ love goto's...we _abhore_ goto's. People who
|
||||
* LOVE goto's should be shot.
|
||||
@ -480,7 +480,7 @@ PRIVATE int HTLoadDocument ARGS4(
|
||||
#endif
|
||||
|
||||
status = HTLoad(full_address, anchor, format_out, sink);
|
||||
|
||||
|
||||
if (status == HT_LOADED) {
|
||||
#ifndef DISABLE_TRACE
|
||||
if (www2Trace) {
|
||||
@ -498,9 +498,9 @@ PRIVATE int HTLoadDocument ARGS4(
|
||||
#ifndef DISABLE_TRACE
|
||||
if (www2Trace)
|
||||
{
|
||||
fprintf (stderr, "HTAccess: '%s' is a redirection URL.\n",
|
||||
fprintf (stderr, "HTAccess: '%s' is a redirection URL.\n",
|
||||
full_address);
|
||||
fprintf (stderr, "HTAccess: Redirecting to '%s'\n",
|
||||
fprintf (stderr, "HTAccess: Redirecting to '%s'\n",
|
||||
redirecting_url);
|
||||
}
|
||||
#endif
|
||||
@ -518,26 +518,26 @@ PRIVATE int HTLoadDocument ARGS4(
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (status == HT_NO_DATA) {
|
||||
#ifndef DISABLE_TRACE
|
||||
if (www2Trace) {
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"HTAccess: `%s' has been accessed, No data left.\n",
|
||||
full_address);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (status<0) { /* Failure in accessing a document */
|
||||
#ifndef DISABLE_TRACE
|
||||
if (www2Trace) fprintf(stderr,
|
||||
if (www2Trace) fprintf(stderr,
|
||||
"HTAccess: Can't access `%s'\n", full_address);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* If you get this, then please find which routine is returning
|
||||
a positive unrecognised error code! */
|
||||
|
||||
@ -561,7 +561,7 @@ PRIVATE int HTLoadDocument ARGS4(
|
||||
**
|
||||
** On Exit,
|
||||
** returns 1 Success in opening document
|
||||
** 0 Failure
|
||||
** 0 Failure
|
||||
** -1 Interrupted
|
||||
**
|
||||
**
|
||||
@ -591,7 +591,7 @@ PUBLIC int HTLoadAbsolute ARGS1(WWW_CONST char *,addr)
|
||||
**
|
||||
** On Exit,
|
||||
** returns YES Success in opening document
|
||||
** NO Failure
|
||||
** NO Failure
|
||||
**
|
||||
**
|
||||
*/
|
||||
@ -619,7 +619,7 @@ PUBLIC BOOL HTLoadToStream ARGS3(
|
||||
**
|
||||
** On Exit,
|
||||
** returns YES Success in opening document
|
||||
** NO Failure
|
||||
** NO Failure
|
||||
**
|
||||
**
|
||||
*/
|
||||
|
@ -1,13 +1,13 @@
|
||||
/* HTAccess: Access manager for libwww
|
||||
ACCESS MANAGER
|
||||
|
||||
|
||||
This module keeps a list of valid protocol (naming scheme)
|
||||
specifiers with associated access code. It allows documents to be
|
||||
loaded given various combinations of parameters. New access
|
||||
protocols may be registered at any time.
|
||||
|
||||
|
||||
Part of the libwww library .
|
||||
|
||||
|
||||
*/
|
||||
#ifndef HTACCESS_H
|
||||
#define HTACCESS_H
|
||||
@ -54,17 +54,17 @@ extern HTFormat HTOutputFormat; /* To convert on load, set this */
|
||||
Load a document from relative name
|
||||
|
||||
ON ENTRY,
|
||||
|
||||
|
||||
relative_name The relative address of the file to be accessed.
|
||||
|
||||
|
||||
here The anchor of the object being searched
|
||||
|
||||
|
||||
ON EXIT,
|
||||
|
||||
|
||||
returns YES Success in opening file
|
||||
|
||||
|
||||
NO Failure
|
||||
|
||||
|
||||
*/
|
||||
extern BOOL HTLoadRelative PARAMS((
|
||||
WWW_CONST char * relative_name,
|
||||
@ -76,25 +76,25 @@ extern BOOL HTLoadRelative PARAMS((
|
||||
Load a document from absolute name
|
||||
|
||||
ON ENTRY,
|
||||
|
||||
|
||||
addr The absolute address of the document to be accessed.
|
||||
|
||||
|
||||
filter if YES, treat document as HTML
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
ON EXIT,
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
returns YES Success in opening document
|
||||
|
||||
|
||||
NO Failure
|
||||
|
||||
|
||||
*/
|
||||
extern int HTLoadAbsolute PARAMS((WWW_CONST char * addr));
|
||||
|
||||
@ -104,19 +104,19 @@ extern int HTLoadAbsolute PARAMS((WWW_CONST char * addr));
|
||||
Load a document from absolute name to a stream
|
||||
|
||||
ON ENTRY,
|
||||
|
||||
|
||||
addr The absolute address of the document to be accessed.
|
||||
|
||||
|
||||
filter if YES, treat document as HTML
|
||||
|
||||
|
||||
ON EXIT,
|
||||
|
||||
|
||||
returns YES Success in opening document
|
||||
|
||||
|
||||
NO Failure
|
||||
|
||||
|
||||
Note: This is equivalent to HTLoadDocument
|
||||
|
||||
|
||||
*/
|
||||
extern BOOL HTLoadToStream PARAMS((WWW_CONST char * addr, BOOL filter,
|
||||
HTStream * sink));
|
||||
@ -127,13 +127,13 @@ extern BOOL HTLoadToStream PARAMS((WWW_CONST char * addr, BOOL filter,
|
||||
Make a stream for Saving object back
|
||||
|
||||
ON ENTRY,
|
||||
|
||||
|
||||
anchor is valid anchor which has previously beeing loaded
|
||||
|
||||
|
||||
ON EXIT,
|
||||
|
||||
|
||||
returns 0 if error else a stream to save the object to.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@ -148,13 +148,13 @@ Register an access method
|
||||
|
||||
typedef struct _HTProtocol {
|
||||
char * name;
|
||||
|
||||
|
||||
int (*load)PARAMS((
|
||||
WWW_CONST char * full_address,
|
||||
HTParentAnchor * anchor,
|
||||
HTFormat format_out,
|
||||
HTStream* sink));
|
||||
|
||||
|
||||
HTStream* (*saveStream)PARAMS((HTParentAnchor * anchor));
|
||||
|
||||
} HTProtocol;
|
||||
|
@ -7,7 +7,7 @@
|
||||
** History
|
||||
**
|
||||
** Nov 1990 Written in Objective-C for the NeXT browser (TBL)
|
||||
** 24-Oct-1991 (JFG), written in C, browser-independant
|
||||
** 24-Oct-1991 (JFG), written in C, browser-independant
|
||||
** 21-Nov-1991 (JFG), first complete version
|
||||
**
|
||||
** (c) Copyright CERN 1991 - See Copyright.html
|
||||
@ -40,7 +40,7 @@ PRIVATE HTList **adult_table=0; /* Point to table of lists of all parents */
|
||||
PRIVATE HTParentAnchor * HTParentAnchor_new
|
||||
NOARGS
|
||||
{
|
||||
HTParentAnchor *newAnchor =
|
||||
HTParentAnchor *newAnchor =
|
||||
(HTParentAnchor *) calloc (1, sizeof (HTParentAnchor)); /* zero-filled */
|
||||
newAnchor->parent = newAnchor;
|
||||
return newAnchor;
|
||||
@ -168,7 +168,7 @@ HTAnchor * HTAnchor_findAddress
|
||||
|
||||
/* If the address represents a sub-anchor, we recursively load its parent,
|
||||
then we create a child anchor within that document. */
|
||||
if (tag && *tag)
|
||||
if (tag && *tag)
|
||||
{
|
||||
char *docAddress = HTParse(address, "", PARSE_ACCESS | PARSE_HOST |
|
||||
PARSE_PATH | PARSE_PUNCTUATION);
|
||||
@ -179,8 +179,8 @@ HTAnchor * HTAnchor_findAddress
|
||||
free (tag);
|
||||
return (HTAnchor *) foundAnchor;
|
||||
}
|
||||
|
||||
else { /* If the address has no anchor tag,
|
||||
|
||||
else { /* If the address has no anchor tag,
|
||||
check whether we have this node */
|
||||
int hash;
|
||||
WWW_CONST char *p;
|
||||
@ -189,7 +189,7 @@ HTAnchor * HTAnchor_findAddress
|
||||
HTParentAnchor * foundAnchor;
|
||||
|
||||
free (tag);
|
||||
|
||||
|
||||
/* Select list from hash table */
|
||||
for(p=address, hash=0; *p; p++)
|
||||
hash = (hash * 3 + (*(unsigned char*)p))
|
||||
@ -210,7 +210,7 @@ HTAnchor * HTAnchor_findAddress
|
||||
return (HTAnchor *) foundAnchor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Node not found : create new anchor */
|
||||
foundAnchor = HTParentAnchor_new ();
|
||||
#ifndef DISABLE_TRACE
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* ASSOCIATION LIST FOR STORING NAME-VALUE PAIRS
|
||||
|
||||
|
||||
Lookups from assosiation list are not case-sensitive.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HTASSOC_H
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user