pkg://xvnews-2.3.2-6mdk.src.rpm:169416/xvnews-2.3.2.tar.gz
info downloads
xvnews-2.3.2/CHANGES 100644 4246 12 60354 5765312312 12664 0 ustar graaff staff This is a list of changes to each version of xvnews. Most recent
changes are listed first:
Changes 2.3 -> 2.3.1
--------------------
2.3.1 is a bug-fix release only. No new features have been added. Here
is a list of problems which should be fixed in this release.
o When talking to the NNTP server, take into account that the
connection may be lost (e.g. because of timeouts).
o If xvnews uses the POSIX regular expression routines, xvnews should
also free used expressions, otherwise memory will leak this way.
(With big KILL files this can be quite a leak!)
o When reading an article with a line starting with a dot xvnews
would stop reading the rest of the article, and then become confused
by it.
o With many subscribed groups xvnews could get into memory problems,
because no additional memory would be allocated.
o If a server has more than 5000 groups, and xvnews would have to
"view all groups", it would crash because of a hard-coded limit on the
number of groups.
o Subjects not starting with a letter would be sorted in the wrong
order.
Changes 2.2.1 -> 2.3
--------------------
User-visibly changes
o The information in the header is displayed differently, and only
displays the newsgroup name when reading a particular group.
o "Next subject" now leaves the group when no unread articles remain,
like "Next unread".
o Added a "c" option to match case-sensitive kill-rules.
Patch by John Durand.
o The quit button is replced with a menu. This menu contains the
default action "done", which iconifies xvnews, and a "quit" option,
which quits xvnews. Both options update the .newsrc file. Partly
based on a patch by John Durand.
o When viewing groups the "goto group" button is only available when
exactly one group is selected. Reported by Stefan Keuhnel.
o Added patches by Alec Muffet to enhance the single newsgroup mode.
Made a number of changes to make using xvnews with just a single
group more consistent.
o When a 'Kill Subject' was done with a number of articles already read,
the next selected article would be the first article in the list,
instead of the next unread article. Reported by Andrew Tefft.
o Date: headers in articles are now converted to local time.
Patch by D. Douglas Valkenaar.
o The undelete popup doesn't pop up anymore. Use a new command line
option (-u) to get the old behaviour. Patch by D. Douglas Valkenaar.
o The name of the group is now listed in the header of window. Patch
by D. Douglas Valkenaar.
o The maximum rescan time is changed to 1440 minutes (24 hours). This
longer rescan time allows for better use with dialup
lines. Reported by Pete Delaney.
o The Organization: header is no also shown in the abbreviated header.
o Articles are now sorted in a more sane way, with replies following
the original article. Also, numerical subjects are sorted properly.
Bug-fixes
---------
o Imakefile should now work. Fixed mostly using Juergen Zimmermann's
patches, but mistakes remaining are mine.
o Rewrote the subject-sorting code, fixed some small bugs, and made
some speedups in the sort routine.
o When using an external editor the signature would always be
appended regardless of the compile-time ADD_SIGNATURE
option. Reported by Vidiot.
o If no Follow-Up: header is present the Newsgroups: header is
used. Includes code to reconnect to the server. Patch by Andrei
Arkhipov.
o Some of the properties are not written when they don't have a
value. Patch by Andrei Arkhipov.
o The article bookkeeping routines have been rewritten. This should
fix some odd crashes, and article renumbering problems.
o Fixed a number of problems related to using an external
editor. Reported by Vidiot.
- A '%' in a .signature would be parsed as a format-string for
printf, resulting in interesting random signatures. Could be
considered a feature, but removed nonetheless.
- The "-- " separator for the signature, and the reference line
would be missing
o Fixed some additional inconsistencies with inclusion of signatures.
ADD_SIGNATURE should now always result in the correct behaviour.
o When an article would be printed (indicated by [print]), it could
not be marked as unread anymore. Reported by Thomas Oliver.
o When USE_INEWS_TO_POST was defined, and an external editor was
used, xvnews would use the internal posting method anyway, instead
of inews as indicated. Fixed, reported by Mark McIntosh.
o Fixed a bug where the next group would disappear from the display
when the current group would be unsubscribed while reading its
articles. Reported by Mark Jackson.
o Fixed some bugs with the counting of unread articles.
o Fixed some problems with newsgroups with names of more than 70
characters. This still isn't fully fixed. See the TODO file.
o The "all articles" button would not show all articles in the
newsgroup. Fixed.
o A infinite loop could happen while killing articles in a group.
Patch by Alexander I. Murashkin.
Additional functionality
------------------------
o xvnews now uses the LIST SUBSCRIPTIONS NNTP command to find the default
subscription when no .newsrc is present. Patch by Dave Hill.
o xvnews now uses the XGTITLE NNTP command. This command isn't
standard, but it is present with INN. This conserves both memory
and time, as descriptions of newsgroups are only read when
needed. LIST NEWSGROUPS will be used as a backup. Patches by Leif
Hedstrom.
o Support for LOCALE has been added. Default locale can be defined in
config.h. Patch by Andrei Arkhipov.
o Added support for handling of the nnrp passwd mechanism used by
INN. See comments in config.h. Patch by D. Douglas Valkenaar
o A new environment variable MAIL_ALIAS can be used to set the mail
alias in postings and e-mail. This can be used to use an alias
instead of a login name (which might be mandatory within a
company), or it can be used to add additional system names, as
happens with a number of Xerox machines.
Other
-----
o The CHANGES file is now rewritten in a better format (I hope)
o Changed put_server routine to use variable number of
arguments. This make the code cleaner, and gets rid of a number of
static buffers within the program.
o To enhance portability the regular expression code has been rewritten.
xvnews now uses internal routines, so that all portability dependencies
are contained within one file: xv_regex.c.
o Ported to FreeBSD, with help from James Robinson.
o Added a patch by Doug Shuck, which streamlined several things when
doing follow-ups.
o Made several speed-ups to the kill-file code, patch by Andrew
Tefft.
o A define has been added to keep the article window editable. Patch
by Bertrand Decouty.
--------------------
Changes 2.2 -> 2.2.1
o Fixed a bug which caused problems with long subject lines.
o Fixed a off-by-one bug which caused problems while sorting.
-------------------------
Changes 2.1betaPL4 -> 2.2
User-visible changes
o Article window is now always read-only to avoid confusion.
o '/usr/lib/sendmail -t' is now the default program to deliver mail.
Note that this has some consequences for the use of aliases. See
xconfig.h for details.
o The Makefiles have been rewritten. Support is now available for
sunos4, sunos5, and linux.
- suos5 uses the -R option when linking.
o All configurable options are now located in config.h.
o The default location of the news.record file changed to
$HOME/News/news.record.
o Changed the scanning routine for new news. xvnews now keeps
scanning until new news is detected. Note that if there is still
unread news, no scanning will occur at all. The previous behaviour
was to only check twice after iconizing.
o "Distribution: world" is not a valid distribution, and is being
frowned upon by many knowledgable people. xvnews now proposes an
empty Distribution: header. inews will handle its removal if
needed, but we can still easily substitute it with a value from the
menu.
Bug-fixes
o Several kinds of crashes could occur when using the
Search... menu. Fixed.
o xvnews could crash when going to a next article. Fixed.
o There is no longer a fixed boundary on the number of newsgroups and
the number of articles per newsgroup. Initial estimates can be set
in config.h. [Leif Hedstrom]
o stdarg is now the prefered way to use variable arguments. varargs
is only used is stdarg is not available.
o The list of new groups in now invisible during updates. Cuts back
on time, and looks much better. [Scott Hiles]
o With some versions of XView the TEXTSW lock up when including text.
Changed all places where text was loaded instead of included.
See also the TODO file, which describes a few of the instances
where this bug can still pop up. [Peter Maier]
o If the last article was found during a search, then the list didn't
always return to the currently selected article. Fixed. [Leif Neve]
o The window footer would always tell you there were subscribed
groups with unread articles, even if there weren't. [Doug Shuck]
o The problem where the first line of a list was'nt displayed
correctly also occured in the undelete popup. [Cyril Plisko]
o xvnews now handles unexpected quits better.
xvnews is now more carefull about trying to save the .newsrc file.
If xvnews is quit through the window manager it saves the .newsrc
file. However, I'm still not able to detect the window system itself
quitting. xvnews just dies in this case. As a compromise the .newsrc
is also saved whenever the window is iconified. [Douglas Shuck]
o A bug in the sorting routine made the first group unsubscribed when
sorting. [Douglas Shuck]
o Fixed problems with fonts in scrolling lists. [Alan Snyder]
Additional functionality
o There are more configurable options available:
- An inews-program can now be used for posting. It's location can be
specified in config.h [Geoff Ballinger]
- Specify the compress-program and extension. [Cyril Plisko]
- The program to deliver mail can be configured in config.h.
- Option to let xvnews include a signature or not. [Geoff
Ballinger]
o xvnews is now aware of INN, and will issue a "mode reader" command
to get a copy of NNRP. [Rob Montjoy]
Other
o Many code-changes to avoid warnings and enhance portability to
Linux. Also incorporated some of the changes in the DevGuide 3.0.1
libraries. Made Makefiles and rules work with GNU Make. Made xvnews
compile with GCC.
o Added a X-Newsreader: header to identify xvnews posts
This header will only be used in beta-test version. The official
release will not contain this header field.
o There is just one Makefile, with targets for SunOS 4, SunOS 5, and
Linux.
----------------------
Version 2.1 (4/24/92):
----------------------
-------------
Enhancements:
-------------
Added the ability to sort subjects in alphabetical order. Check out
the resource XVnews.sortSubjects and the properties window.
xvnews now kills crossposted articles automatically after one of them is read.
The resource XVnews.postEditor defines a different editor to use for composing
articles and forwarding/replying through email. Just define an editor in
the properties window under Editor (eg. shelltool -Wx large vi). Default
is the built-in xvnews post/email window.
If the xvnews window is iconic, upon the second automatic rescan xvnews will
disconnect from the news server until xvnews is opened again. There will then
be a rescan done when the window is opened. To change this time period, simply
adjust the auto rescan timer in the properties window. This helps save cpu
time and connections on the news server.
xvnews tries to remember what group was highlighted in the scrolling list
after an auto rescan or going to view groups.
When printing ([print]) or filtering ([filt]) an article, the correct
action is now displayed at the right hand edge of the article list.
Previously the messages were limited to [read], [unread], and [save].
You can now set the background color for the text window using the resource
XVnews.textback in the properties window.
Added file completion like action for matching groups.
Added support for extended GECO's format to postings.
The way an article's header is displyaed has changed slightly. The full header
option if the way the article header is stored on the news server, with no
changes. The abbreviated header should be mail compatible on all systems.
--------------------------
Bugs fixed in version 2.1:
--------------------------
Pinning up next or prev article menu and then exiting the group and then
selecting an entry from that menu would cause a crash.
Version 2.0 (2/11/92):
----------------------
patch2 bug fixes:
-----------------
Postings that had a line that began with a period should have been padded to
have 2 periods '..'.
Articles that were read in that had a line beginning with 2 periods should
have been edited to only have one period.
$NNTPSERVER would not override the default defined in xvnews.h
File chooser flashes during saves.
Added 'h' accelerator key as header toggle option.
When saving an article in mail format to a new file, a blank line would get
inserted as the first line.
patch1 bug fixes:
-----------------
Fixed a memory leak that occured when viewing groups. Could have leaked ~100K
if 'all subscribed', or regex match was used.
Core dumps with .newsrc lines longer than 3K.
Could get the same article in the undelete window more than once.
The wrong article could get included when searching for an article and then
posting a reply.
-------------
Enhancements:
-------------
[x]rn style kill files are now supported. Check under the Kill menu at the
article level.
Next and Previous article is now a menu which contains "next/prev article",
, "next unread", "next/prev subject", or "next/prev author". You can set
your favorite selection using ctrl-right mouse button and then xvnews will
save this as a resource when you hit the apply button in the properties
window.
Undelete popup was added that stores articles that have been killed. You can
add these killed articles back to the group. Check under the kill menu.
Added a "Load file..." option under include for posting. This allows you
to load a file as text, compressed & uuencoded, or just uuencoded to a
posting. You will also be informed of how many lines and bytes were included
into this window.
xvnews now checks for new newsgroups when it rescans. Checking for new groups was
only done at startup before.
Added resources for menu defaults. Just set your default menu item
(right mouse button + ctrl key) for Next, Prev, and Search menus, and then apply
properties will store you default selections so the next time xvnews is
started there is no need to set these defaults again.
Confirmation for catchup was added to the newsgroup level.
When using goto group, mark unread now works correctly and actually adds the article
back into the unread list.
Space bar is a keyboard accelerator that works similar to the space bar in [x]rn.
The environment variable DOTDIR can now be used to specify the directory that your
.newsrc is in.
xvnews now has 2 icons, one when there is unread news, one when there is no unread news.
The ability to have different .newsrc files for different news servers is now present.
First .newsrc-$NNTPSERVER is checked to see if it exists, if not, xvnews defaults
to .newsrc.
The environment variable SAVEDIR is used for specifying the default directory for
xvnews to save articles as well as load and store KILL files. If unset, the default
is ~/News.
When posting an article you now have the option of copying the article to a log
file, defined by the resource XVnews.logFile. The default file is $HOME/news.record.
Added an option to the Save menu "filter". This allows you to pipe articles
through a command when it is saved. The article is filtered in edited form.
xvnews now checks to see if you are running on a NNTP server or a INN server.
When an INN server is found, some things can be done for xvnews to run faster
which are automatically enabled. Examples are that with an INN server, you do
not have to close and reopen connections whenever you rescan for new groups
and articles. Also, xvnews uses the XPAT command for matching articles
This make searching much faster, but only allows the use of wildmat style
matching as opposed to regular expressions. For this reason, XPAT
searching is only used for searching for subject and author pervious
Still, the speedups from these searches are significant.
When posting or following up to an article when you are reading a group, xvnews
will look in $SAVEDIR/group first to try and find a .signature file. This is handy
for people who want to have different .signature files for different groups.
For example: To have a custom signature for sci.military, put a .signature
file in $SAVEDIR/sci/military.
The defaults NNTPSERVER, DOMAIN, and ORGANIZATION or now settable at compile
time by a couple of defines in xvnews.h.
--------------------------
Bugs fixed in version 2.0:
--------------------------
The tempfile used by xvnews is now /tmp/.xvnews.file.getpid(). This allows
you to have multiple programs running without conflicting with each other.
Saving article that had the full header displayed was incompatible with
mailtool.
Searching previous archives would fail to find original article. randolph@cognito
Some users have .newsrc lines greater than 2K which was the default. Bertrand.Decouty@irisa
A Summary line was added to the header for post-followup. randolph@cognito
Retrieving an article from the articles using the previous button would
sometimes cause a bus error due to using strcpy() as opposed to strncpy().
When reading a group and hitting all articles more than once, xvnews get confused
very quickly.
Some users had problems with certain security programs and xterminals not setting
the environment LOGNAME which xvnews looked for. exudnw@exu.ericsson.se
Some people get Memory insertion errors when reading articles if they don't have
Text.MaxDocumentSize set. many
Some machines seem to close socket connections rather quickly, so I changed the
parameters of the socket to hoepfully keep the connection alive longer. cary@scripps.edu
xvnews would sometimes crash on an unsubscribe function if no groups were
selected.
Keyboard accelerators would not function if goto group had been used to view
the news group.
If you unsubscribed to a group that you were reading, your .newsrc would not
have the articles that were read updated by that change. randolph@cognito.Eng
If xvnews.displaysize was set to a negative number, xvnews could crash in strange
places. Bertrand.Decouty@irisa.fr
When regex searching for articles, sometimes the article ordering would get
screwed up.
Version 1.1:
------------
-------------
Enhancements:
-------------
Major performance improvements for using goto group feature. Also speedups
should be noticed when you exit a view groups option.
Drag and Drop is back and should work for both V2 and V3 applications.
Changed the timeout parameters a little, xvnews now tries to connect to the
server 10 times before it times out. The wait time is 20 seconds * number
of tried connections so that the wait is gradually increasing.
--------------------------
Bugs fixed in version 1.1:
--------------------------
If the server you are on is running the new INN s/w, some articles
previously read may return after a rescan on high volume groups. naughton@green
Searching for subjects would find previously read articles. naughton@green
If your NNTP server returned a status of no posting(201), xvnews would fail
to connect to the server. lwv27@cas.org
Some groups with no articles read would be saved by xvnews as "group! 0-0".
This would cause certain versions of rn to give warning messages. bkm@wintermute
Hitting return on the Search string line for all matching groups should retrieve
the groups similar to hitting the view groups button. was@thresher
A subscribed newsgroup that has a number of cancelled articles, and when read in
had no article subjects available would sometimes crash.
Some domains would have the first character missing. Chris.Crampton@ecrc.de
Fixed a few more make clean problems.
Version 1.0:
Patch 1:
------------
--------------------------
Bugs fixed in version 1.0:
--------------------------
Some NNTP servers don't have the DISTRIBUTIONS files installed.
Symptoms were that posting would hang, or xvnews would hang on startup.
cflatter@zia.aoc.nrao.edu
If you had a zero length .newsrc or one that had no valid groups, xvnews
would crash. almo@usops.ebay.sun.com
make clean removed xvnews_ui.c xvnews_ui.h and xvnews_stubs.c.
Chris.Crampton@ecrc.de
If you hit unread on an article that was marked unread, it continued to decrement
the unread article counter.
Various Imakefile problems installing on certain machines. numerous people
Cursor was not placed properly in post/email popup.
If no .newsrc is found, the new .newsrc should be sorted in alphabetical order.
Otherwise, same as 0.8PL1. I just had to make xvnews version 1.0 to release xvnews.
---------------------------
Changes for xvnews 0.8 PL1:
---------------------------
Kill article now goes to the next unread article.
Kill understands that "foo" and "Re: foo" are the same subject.
Save->save in the articles panel saves to the file in the file saver popup
if the popup is displayed.
Posting now recongizes "&" in the fullname field of the password file as the login name of the user.
Catchup removes the save popup if it is up, just like next and done do.
Followup is now the default action under Post/E-Mail.
Followup windows now have the References line filled in correctly.
If you save an article using the file saver, if the file was new, the saver
would delete the filename making it difficult to save multiple articles
to one file. This is now fixed.
Regular expression searching for article text was kind of broken.
Regular expression searching for article text now highlights the text
you were searching for and scrolls to that point of the article.
Under Search->*prev, a prompt now asks you to confirm searching previously
read articles.
Searching for subject/author next/previous now goes to next unread article
after the current article you started at or are now reading. This works much
better for following threads.
Keyboard accelerators are available for certain functions.
Make sure that keyboard focus is in the center button panel (Click in it)
and accelerators can be used for:
Subscribed Groups:
'n' -- next group
'p' -- previous group
'L3' -- Properties popup
Unread Articles:
'n' -- next article
'p' -- previous article
'f' -- scroll text one page forward
'b' -- scroll text one page backward
's' -- save article
'q' -- exit reading articles
'k' -- kill current subject
'L3' -- Properties popup
'L9' -- Find next subject
Drag and Drop under OpenWindowsV2 no longer works.
-----------------------
Changes for xvnews 0.8:
-----------------------
Double click opens newsgroups as opposed to single clicks.
Support for unread articles in .newsrc file similar to rn/xrn(comma seperated list).
Change of save popup to use Guide file chooser.
No limit to number of e-mail/post popups open at one time, used to be 1.
Regular expression searching for newsgroups to be displayed.
Catchup now doesn't mark read articles marked as unread.
Catchup has a menu that allows catching up to the current article.
Deleted skip group (kludgy) button
Fixed some bugs with searching and group descriptions.
Change kill button to a menu and have subject and author options.
Allow to regular expression search on body of articles and entire header.
Changed including article to a button on popup window, similar to mailtool.
The biggest change is the support for the comma seperated list in the
.newsrc file. This means that any articles not marked read or saved will be
considered unread and will appear the next time you open the newsgroup. If
you are done with all the articles in any group, you should hit catchup to
leave the group.
The other change that will be immediatly noticable is the you have to dbl.
click to open a newsgroup now. That allows you to catchup or unsubscribe to
groups without opening them.
xvnews-2.3.2/Imakefile 100644 4246 12 2755 5641346317 13470 0 ustar graaff staff /* #include "config/XView.tmpl" */
/**/# Imakefile for xvnews.
/**/# If XView config files are not found,
/**/# setenv IMAKEINCLUDE '-I`pwd`/config -I$OPENWINHOME/lib/config'
#define IHaveSubdirs
#define PassCDebugFlags
#define HasInfoFiles YES
LIBGUIDE = guide/libguide
GUIDEXV = guide
SUBDIRS = $(LIBGUIDE) $(GUIDEXV)
XVIEWLIB = -lxview -lolgx -lX11
XVIEWDIR = /usr/openwin/lib
MakeSubdirs($(SUBDIRS))
DEFINES =
INCLUDES = -I$(GUIDEXV) -I$(LIBGUIDE) -I$(TOP)
SYS_LIBRARIES = #-lintl
# Add -linn to the following line if you want to support nnrp.passwd
LOCAL_LIBRARIES = -L$(GUIDEXV) -lguidexv -L$(LIBGUIDE) -lguide -L$(XVIEWDIR) $(XVIEWLIB)
ICONS = news.icon
HEADERS = xvnews.h codes.h utils.h xvnews_ui.h
INFOFILES = xvnews.info
MANPAGES = xvnews.man
OBJS = getdate.o main.o server.o textsw_regexp.o xv_articles.o xv_err.o \
xv_getauthor.o xv_init.o xv_init_newsrc.o xv_newsrc.o \
xv_parse_newsrc.o xv_post.o xv_props.o xv_regex.o xv_search.o \
xv_sort.o xv_stuff.o xvnews_stubs.o xvnews_ui.o xv_drag.o xv_kill.o
SRCS = getdate.y main.c server.c textsw_regexp.c xv_articles.c xv_err.c \
xv_getauthor.c xv_init.c xv_init_newsrc.c xv_newsrc.c \
xv_parse_newsrc.c xv_post.c xv_props.c xv_regex.c xv_search.c \
xv_sort.c xv_stuff.c xvnews_stubs.c xvnews_ui.c xv_drag.c xv_kill.c
ALLFILES = ${HEADERS} ${INFOFILES} ${MANPAGES} ${ICONS} ${SRCS}
AllTarget(xvnews)
clean::
rm -fr include
includes::
rm -fr include
ComplexProgramTarget(xvnews)
/* #include "config/XView.prog" */
xvnews-2.3.2/Makefile.dist 100644 4246 12 10272 5765313002 14262 0 ustar graaff staff # This file was generated by `gxv' from `xvnews.G'.
# Compiler flags.
CC = cc
CFLAGS += -O
CPPFLAGS += -Iguide -Iguide/libguide -I$(OPENWINHOME)/include
LDFLAGS += -Lguide -Lguide/libguide -L$(OPENWINHOME)/lib
LDLIBS += -lguidexv -lguide -lxview -lolgx -lX11
# Uncomment the following line to include INN's library (for nnrp.passwd)
# LDLIBS += -linn
# Possible flags for compatibility
# CFLAGS += -DNEED_STRCASECMP
# Parameters.
PROGRAM = xvnews
SOURCES.c = main.c server.c xv_articles.c xv_err.c xv_getauthor.c \
xv_init.c xv_init_newsrc.c xv_newsrc.c xv_post.c xv_props.c \
xv_regex.c xv_stuff.c xv_search.c xv_parse_newsrc.c \
textsw_regexp.c xv_drag.c xv_kill.c xv_sort.c
SOURCES.h = config.h
SOURCES.y = getdate.y
SOURCES.G = xvnews.G
STUBS.G = xvnews.G
# Derived parameters.
SOURCES = \
$(SOURCES.G) \
$(SOURCES.h) \
$(SOURCES.l) \
$(SOURCES.y) \
$(SOURCES.c)
TARGETS.c = \
$(SOURCES.G:%.G=%_ui.c) \
$(STUBS.G:%.G=%_stubs.c)
TARGETS.h = \
$(SOURCES.G:%.G=%_ui.h) \
$(SOURCES.l:%.l=%.h)
TARGETS.other = \
$(SOURCES.G:%.G=%.info)
TARGETS = \
$(TARGETS.other) \
$(TARGETS.h) \
$(TARGETS.c)
OBJECTS = \
$(SOURCES.c:%.c=%.o) \
$(SOURCES.y:%.y=%.o) \
$(TARGETS.c:%.c=%.o)
# Standard targets.
all:
@echo "Select one of the following targets with make"
@echo "(e.g. 'make sunos5')"
@echo ""
@echo "sunos5 - Solaris 2.x / SunOS 5.x"
@echo "sunos4 - Solaris 1.x / SunOS 4.x"
@echo "linux - Linux"
db-sunos5:
@echo "Making all in guide..."
@cd guide; ${MAKE} -f Makefile.dist "CC=${CC}" \
"CFLAGS=-I/export/graaff/debug_include -g -DSVR4" \
"RANLIB=touch"
@echo "Making all in guide/libguide..."
@cd guide/libguide; ${MAKE} -f Makefile.dist "CC=${CC}" \
"CFLAGS=-I/export/graaff/debug_include -g" "RANLIB=touch"
${MAKE} -f Makefile.dist xvnews "CC=${CC}" \
"CFLAGS=-I/export/graaff/debug_include -v -g -DSVR4 -DDEBUG" \
"LDFLAGS=${LDFLAGS} -g -R${OPENWINHOME}/lib -L/export/graaff/lib" \
"LDLIBS=-ldbmalloc ${LDLIBS} -lsocket -lnsl -lintl"
sunos5:
@echo "Making all in guide..."
@cd guide; ${MAKE} -f Makefile.dist "CC=${CC}" "CFLAGS=${CFLAGS} -DSVR4" "RANLIB=touch"
@echo "Making all in guide/libguide..."
@cd guide/libguide; ${MAKE} -f Makefile.dist "CC=${CC}" "RANLIB=touch"
${MAKE} -f Makefile.dist xvnews "CC=${CC}" "CFLAGS=${CFLAGS} -DSVR4" \
"LDFLAGS=${LDFLAGS} -R${OPENWINHOME}/lib" "LDLIBS=${LDLIBS} \
-lsocket -lnsl -lintl"
sunos4:
@echo "Making all in guide..."
@cd guide; ${MAKE} -f Makefile.dist "CC=${CC}" "CFLAGS=${CFLAGS}" "RANLIB=ranlib"
@echo "Making all in guide/libguide..."
@cd guide/libguide; ${MAKE} -f Makefile.dist "CC=${CC}" "RANLIB=ranlib"
${MAKE} -f Makefile.dist xvnews "CC=${CC}" "CFLAGS=${CFLAGS} -DUSE_FTIME"
linux:
@echo "Making all in guide..."
@cd guide; ${MAKE} -f Makefile.dist "CC=${CC}" "CFLAGS=${CFLAGS}" \
"RANLIB=ranlib"
@echo "Making all in guide/libguide..."
@cd guide/libguide; ${MAKE} -f Makefile.dist "CC=${CC}" "RANLIB=ranlib"
${MAKE} -f Makefile.dist xvnews "CC=${CC}"
db-linux:
@echo "Making all in guide..."
@cd guide; ${MAKE} -f Makefile.dist "CC=${CC}" "CFLAGS=${CFLAGS}" \
"RANLIB=ranlib"
@echo "Making all in guide/libguide..."
@cd guide/libguide; ${MAKE} -f Makefile.dist "CC=${CC}" "RANLIB=ranlib"
${MAKE} -f Makefile.dist xvnews "CFLAGS=-DDEBUG -Wall -g ${CFLAGS}" \
"LDFLAGS=-Lguide -Lguide/libguide -L/usr/openwin/lib -L/usr/X11R6/lib"
objects: $(SOURCES.c) $(SOURCES.h) $(SOURCES.y) $(TARGETS.c) $(TARGETS.h) $(OBJECTS)
sources: $(SOURCES)
targets: $(SOURCES) $(TARGETS)
$(PROGRAM): $(SOURCES.c) $(SOURCES.h) $(SOURCES.y) $(TARGETS.c) $(TARGETS.h) $(OBJECTS)
$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJECTS) $(LDLIBS)
$(PROGRAM).purify: $(SOURCES.c) $(SOURCES.h) $(TARGETS.c) $(TARGETS.h) $(OBJECTS)
purify $(LINK.c) -o $(PROGRAM) $(OBJECTS) $(LDLIBS)
# Targets to be used by a certain CASE tool.
stest: $(SOURCES.c) $(TARGETS.c) $(TARGETS.h) $(OBJECTS)
#load $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) \
-o $(PROGRAM) $(SOURCES.c) $(TARGETS.c) $(LDLIBS)
#%_ui.c + %_ui.h + %_stubs.c + %.info: %.G
#$(GUIDEHOME)/bin/gxv_merge $*
depend:
makedepend $(SOURCES.c) $(SOURCES.h)
clean:
@cd guide; ${MAKE} -f Makefile.dist clean
@cd guide/libguide; ${MAKE} -f Makefile.dist clean
$(RM) $(OBJECTS) core *~
xvnews-2.3.2/README 100644 4246 12 5332 5765313064 12531 0 ustar graaff staff xvnews -- an openlook newsreader
xvnews is an openlook newsreader that uses the XView 3 toolkit. It has
been tested using Sun OpenWindows version 2 and version 3 xnews
servers along with olvwm, olwm, and twm. I see no reason that xvnews
shouldn't run on any X windowing system that has access to the XView
libraries. The current version of xvnews is tested on both Solaris 1.x
and Solaris 2.x platforms, and on Linux.
How to build xvnews:
1. See the CHANGES file for changes made from the previous release.
2. Does an NNTP server exist on your network? If not, xvnews will not work.
3. Do you have version 3 of the XView toolkit? The latest version is
available on ftp.x.org in the contrib/xview3 directory, and it also
comes bundled with OpenWindowsV3.
If you don't have version3 of the XView toolkit, xvnews will not build.
4. Take a look at the defines in config.h for DOMAIN, NNTPSERVER,
and ORGANIZATION. You may want to change the value of these for
your site. You should also take a look at the other defines in
config.h.
5. Now you are ready to build xvnews. As of version 2.3, the preferred way
to build xvnews is using the Imakefiles, but the old Makefiles are
still present. Note that if you are using a Sun then your imake
system is probably installed the wrong way. (This is the default
:-( ) You will need to use the Makefile.dist described at b)
below.
a) Build xvnews using Imakefiles
It comes down to the usual. The following sequence should build all
Makefiles and xvnews.
xmkmf
make Makefiles
make
b) Build xvnews using the old Makefiles
The Makefile is named 'Makefile.dist'. This Makefile contains pre-defined
targets for Sun's Solaris 1.x and 2.x, and for Linux. Just typing
'make -f Makefile.dist' will show you the targets for those platforms.
You can then use this target to build xvnews.
(e.g. 'make -f Makefile.dist sunos5' will build xvnews for Solaris 2.x)
Note: you will see a number of warnings during compilation. These
are harmless, and mostly caused by problems within the XView
include files.
6. If you want a version of xvnews to run on OpenWindowsV2 as well as
OpenWindowsV3, statically link in libxview and libolgx. However,
this is no longer the default.
7. make
8. Read the man page (xvnews.1) for answers to your many questions.
9. If you have problems with xvnews, feel free to mail
J.J.deGraaff@twi.tudelft.nl
Updates and new versions of xvnews will be available at:
ftp.twi.tudelft.nl:/pub/news/
ftp.uu.net:/networking/news/readers/xvnews/
xvnews is compliant with items 1-9 of the "Good Net-Keeping Seal of
Approval, release 1.1" by Ron Newman.
I hope you have a good time reading news with xvnews,
Hans de Graaff
xvnews-2.3.2/TODO 100644 4246 12 30132 5701260220 12336 0 ustar graaff staff This file contains a list of things that people have asked about,
or that still need to be done. There are several classes of things:
bugs, enhancements, and features. Bugs should always be fixed,
enhancements correct or enhance already existing features. They also
have a large chance of being fixed. Finally, features add new
functionality to xvnews, but they also have the smallest chance of
being done. (Unless you send in a patch...)
This list is currently a bit of a mess, and many items have remained
on the list. I hope to have this cleaned up with the release of 2.4.
----------
Bugs:
o When using the command-line options to change the geometry weird
things can happen, such as scrollbars disappearing.
The same thing happens when different size fonts are being used.
From: Leif Neve.
o BUG: Properties->Font->Othertext->size doesn't change anything.
In fact, it isn't connected to anything. This fits with the rest of
the font stuff, which doesn't take well against changes.
Reported by: Bob Campbell.
o There seems to be a bug with SunOS 4.1.3_U1 (and possibly other
versions as well). This problem manifests itself whenever text is
appended to an already existing text-window. In this case the
text-window will become unreadable. An example of this behaviour
can be seen when the article in included during a forward or reply.
A work-around is to use the postEditor resource, which can be used
to define a different editor.
Another work-around, reported by Lawrence Rogers, is to get XView 3.2
in source distribution, and use it to compile xvnews with.
o There are problems with the way xvnews saves its properties:
When you do an apply in the properties window, apparently all your
current resources get put back onto your .Xdefaults. This tends
to screw a lot of people up. For example, some people here use xvnews
running on a sun and remotely displaying on an hp. The hp does not
read its resources from .Xdefaults. When someone does an apply
in xvnews, all the hp resources blow away anything in .Xdefaults,
which screws them up when they get on the sun.
By: Andrew Tefft
Saving the configuration to .Xdefaults saves things like
window.x: 25
window.y: 40
icon.x: 1085
icon.y: 237
Placing these generic, unqualified resources in the .Xdefaults file
effects all applications. This piles all icons on top of each
other, for instance.
By: Mike Jipping, Norman Pieniazek
o There still seem to be font problems.
By: Eckhard Rueggeberg
(Check Leif Hedstrom's code with -DFONT_FIX)
Also, some of the selectable fonts (e.g. Times) don't display special
characters correctly. Should look into this as well.
By: Richard Chen.
It should also be possible to use several different fonts (e.g.
cyrillic or kanji) in the text window. This should be user-definable.
o Applying defaults can cause a core dump such as:
> #0 0x21db0 in apply_props (item=748736, event=0xdffff05c) at xv_props.c:187
> 187 apply_font(bw->article_window, Props.listfont,
> (gdb) bt
> #0 0x21db0 in apply_props (item=748736, event=0xdffff05c) at xv_props.c:187
> #1 0xdf749b64 in SAVE_POPUP ()
> #2 0xdf7494d8 in SAVE_POPUP ()
> #3 0xdf753aec in SAVE_POPUP ()
o xvnews sometimes just hangs when posting. The article gets out ok,
but xvnews never returns from its loop. Some evidence seems to
indicate disks filling up while this happens. Other people have reported
a large number of nntpd's or inews processes popping up.
By: Leif Neve, Vidiot, and several others
o Long group names (over 70 characters or so) can cause crashes in xvnews.
Unfortunatly, this isn't easily solved. Some of the problems have
been fixed, but a complete fix requires a thorough rewrite of xvnews.
o xvnews shouldn't trash the .newsrc file, or at least it should keep a
backup around. [A patch is received]
o Printing might not work, check the defaults for different platforms.
o A catchup to the selected article will not do the right thing when
reading articles sorted. It should catchup all articles upto the
selected as they appear in the list, not as they are numbered. [
Pete Koch ]
-------------
Enhancements:
o It would be good to have a way to control the geometry of
sub-windows, such as the Deleted Articles window, without mucking
with the code.
From: Leif Neve.
o Post-window is currently about 84 characters wide. Would be nice if
this would be 80 instead.
From: Geoff.Ballinger@edinburgh.ac.uk
o The XView text-window appears to be inserting new-lines in
postings, but this doesn't actually happen. People who don't know
this often get flamed for using overly long lines. xvnews should
cope with this one way or another. I don't have a good solution yet.
From: Dave Brown <dbrown@cgs.c4.gmeds.com>
o Articles are saved as they appear on screen, which means they miss
some headers that would make it possible to read through them with a
mail-program (e.g. elm).
The main problem with this is the incorrect timestamp, which causes
the mailprograms to not read the folder. The new local time code
might help to solve this problem.
o Keep .newsrc in the same format as rn/trn (this probably means to
not include the unsubscribed groups). Also allow for bogus groups
to stay in the .newsrc (optionally), and clean the .newsrc when
desired.
o The From: line is built in a strange way. Sometimes a host is added
to the domain, and sometimes it is not. This might introduce some
problems. Look at the code, fix things if needed, and document the
correct behaviour.
By: Dennis Flaherty
o xvnews always rescans when uniconized? This can be a problem when
scanning takes a lot of time. [ Chie E. Tse ] It is caused because
xvnews detects that it is no longer connected to the newsserver. It
then rescans automatically. I could make an option out of this.
o It would be nice to be able to select a newsgroup using the middle
mouse button, instead of double clicking. This is also identical to
the way xrn operates. [ Wessel Kraaij ]
o It would be nice if the attribution line could be adjusted, for
instance with something like "In article %a, %u at %o (%m) posted
the following for all to read:", where the variables get filled in
by xvnews.
[Syed Zaeem Hosain]
o Not all people like xvnews to log their postings. I should make an
option to turn this off. [ noted by Greg Cisko ]
o Some of the actions currently require a confirmation. It might be
nice to make these confirmations an option. [Syed Zaeem Hosain]
o The current rescan strategy isn't great. Some people don't want
xvnews to stop scanning, other do, some people don't want xvnews to
scan when opening, others do. It should make some configurable
options out of those possibilities, and create widgets for them in
the properties sheet.
Also, hitting rescan doesn't update the rescan timer, so it is
possible to hit rescan, and be surprised by an automatic scan only
instances later. [Alec Muffet]
o xvnews should tell the user to expect shift/reduce warning in getdate.y.
o When sorting by subject replies should be sorted after their
original articles. Maybe use date: or References:, if possible.
By: Andrew Tefft
o It seems "Kill Subject" and "Search subject" use different search
strategies. This means searches with either method will be
inconsistent with each other.
o The new groups/view groups panel can be coming confusing (and
confused itself) when a larhe number of near-identical groups are
selected.
o When you are in "all news groups" mode, and you select a group with
no articles, then you are moved back to the list of subscribed
newsgroups.
o The file requester doesn't show any dot-files. Maybe it should show
them, or provide an option to toggle this.
o When adding KILL entries to the KILL file it should also be possible
to indicate that these should be case-insensitive.
By: John Durand.
o When an article is posted in a moderated group xvnews might not
report this well. Should look into this.
Based on report by Richard Chen.
o It should be possible to few full headers for particular articles on
a article-by-article basis.
By: me and Graham Robertson.
o Some sites would rather have just a username in the From: address
of mail, allowing them to do neat expansions and such. This is a
bit conflicting with posting, where a full address is needed.
o Stop displaying articles at ^L (page break), because this is often
used for spoilers and the like. [By: Vidiot]
o Should check whether all kinds of headers are handled
properly. Most notable, headers with additional lines preceded by a
tab might cause problems. For instance, when showing only selected
headers the continued headers also slip through. [Bertrand Decouty]
o Currently errors or problems when posting through inews are
silently ignored.
----------
Features:
o FEATURE: support for custom headers in the default post window.
E.g. XVnews.replyto: resource, but also user-defined headers.
o Use arbitrary filters (using shell commands?) instead of just
ROT13.
o FEATURE: Use NOV support (XOVER NNTP extension).
o FEATURE: prefetch one or all articles
o Select multiple articles for saving or filtering
o Virtual groups mode (a la strn)
o Use authinfo NNTP commands to supply a bit more information to the
NNTP server (e.g. for counting interest in articles). Brad
Templeton suggested this on the newsgroup.
o A way to hide read articles without exiting & re-entering a group
might be handy. exiting and re-entering can be slow on a big group.
Just to elaborate on this, a general "update" button inside a group
would be a possible implementation of this. This would update the kill
file rather than just updating the display to exclude read articles.
By: Andrew Tefft
o When doing a catchup, it doesn't seem to mark crossposts read in
all groups in which they appear. This kind of makes sense, since you
would have to scan each article and do something, rather than just updating
the current group's newsrc pointers. In fact I believe this is normal
rn behavior too. But I would like an option to mark all the cross-references
when I catch up.
By: Andrew Tefft
o Do the keyboard accelerators really work? Yes, but focus is always lost
from the command panel, so the accelerators don't really have the effect
intended.
o If an NNTP-connection is lost it has to be initiated again. If this takes
a long time (e.g. via PPP), then the system is locked, because the callback
doesn't return fast enough. Maybe put the NNTP code in a thread? (Shudder)
o Allow moving of newsgroups, such as in xrn. [Bertrand Decouty]
o Make xvnews behave like mailtool, with each article its own pinned
window. [Bertrand Decouty]
o Add an option to reply through mail, and followup to the newsgroup
with just one command.
By: Andrew Tefft.
o Clicking on a URL in a news article might take you to a
Web-browser, and look up that particular URL. Some Mac news reader
does this. [Mike Blandford]
o Be able to read/write remote .newsrc files (either through rcp or
ftp). Some people need to read news from two different sites, and
this might be a nice shortcut. [Mike Blandford]
o How about a news file reader/browser that reads in News files saved
by xvnews that allows you to search them as if they were actual
news posts. That way, you could reply, goto, and cut paste from
saved articles much easier.
By: Bob Campell
----------
Known problems that probably won't get fixed:
o xvnews doesn't update the descriptions when new groups arrive.
This won't get fixed because it would be very inefficient to do so.
If you have an NNTP server which supports the XGTITLE command (such
as INN), then you won't see this behaviour anyway.
o The article list flickers when clicking the next article button. This
is caused by the update of the line (the [read] indicator is added).
This also happens when clicking directly on an article, although it
is much less noticeable.
xvnews-2.3.2/codes.h 100644 4246 12 5610 5614735751 13122 0 ustar graaff staff #ifndef CODES_H
#define CODES_H
/*
*
* Copyright (c) 1988, 1989, 1990, 1991, Ellen M. Sentovich and Rick L. Spickelmier.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation.
*
*/
/*
* Response Codes for the NNTP Server
*
* First digit:
*
* 1xx Informative message
* 2xx Command ok
* 3xx Command ok so far, continue
* 4xx Command was correct, but couldn't be performed
* for some specified reason.
* 5xx Command unimplemented, incorrect, or a
* program error has occured.
*
* Second digit:
*
* x0x Connection, setup, miscellaneous
* x1x Newsgroup selection
* x2x Article selection
* x3x Distribution
* x4x Posting
*/
#define CHAR_INF '1'
#define CHAR_OK '2'
#define CHAR_CONT '3'
#define CHAR_ERR '4'
#define CHAR_FATAL '5'
#define INF_HELP 100 /* Help text on way */
#define INF_DEBUG 199 /* Debug output */
#define OK_CANPOST 200 /* Hello; you can post */
#define OK_NOPOST 201 /* Hello; you can't post */
#define OK_SLAVE 202 /* Slave status noted */
#define OK_GOODBYE 205 /* Closing connection */
#define OK_GROUP 211 /* Group selected */
#define OK_GROUPS 215 /* Newsgroups follow */
#define OK_ARTICLE 220 /* Article (head & body) follows */
#define OK_HEAD 221 /* Head follows */
#define OK_BODY 222 /* Body follows */
#define OK_NOTEXT 223 /* No text sent -- stat, next, last */
#define OK_NEWNEWS 230 /* New articles by message-id follow */
#define OK_NEWGROUPS 231 /* New newsgroups follow */
#define OK_XFERED 235 /* Article transferred successfully */
#define OK_POSTED 240 /* Article posted successfully */
#define OK_LIST 282 /* Description of group(s) follows */
#define CONT_XFER 335 /* Continue to send article */
#define CONT_POST 340 /* Continue to post article */
#define ERR_GOODBYE 400 /* Have to hang up for some reason */
#define ERR_NOGROUP 411 /* No such newsgroup */
#define ERR_NCING 412 /* Not currently in newsgroup */
#define ERR_NOCRNT 420 /* No current article selected */
#define ERR_NONEXT 421 /* No next article in this group */
#define ERR_NOPREV 422 /* No previous article in this group */
#define ERR_NOARTIG 423 /* No such article in this group */
#define ERR_NOART 430 /* No such article at all */
#define ERR_GOTIT 435 /* Already got that article, don't send */
#define ERR_XFERFAIL 436 /* Transfer failed */
#define ERR_XFERRJCT 437 /* Article rejected, don't resend */
#define ERR_NOPOST 440 /* Posting not allowed */
#define ERR_POSTFAIL 441 /* Posting failed */
#define ERR_COMMAND 500 /* Command not recognized */
#define ERR_CMDSYN 501 /* Command syntax error */
#define ERR_ACCESS 502 /* Access to server denied */
#define ERR_FAULT 503 /* Program fault, command not performed */
#endif
xvnews-2.3.2/compose.icon 100644 4246 12 3615 5605024157 14165 0 ustar graaff staff /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
*/
0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,
0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,
0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,
0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,
0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,
0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,
0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,
0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,
0x8888,0x8888,0x8888,0x889C,0x8888,0x8888,0x8888,0x88A2,
0x2222,0x2222,0x2222,0x2261,0x2222,0x2222,0x2222,0x2291,
0x8888,0x8888,0x8888,0x8989,0x8888,0x8888,0x8888,0x8A46,
0x2222,0x2222,0x2222,0x2622,0x2222,0x2222,0x2222,0x2B1A,
0x8888,0x8888,0x8888,0x9490,0x8888,0x8888,0x8888,0xA968,
0x2222,0x2222,0x2222,0x5262,0x2222,0x2222,0x2222,0xA4A2,
0x8888,0x8888,0x8889,0x4988,0x8888,0x8888,0x888A,0x9288,
0x23FF,0xFFFF,0xFFFD,0x27FF,0x23FF,0xFFFF,0xFFFA,0x4FFF,
0x8980,0x0000,0x0014,0x9003,0x89BC,0xDC00,0x0029,0x23FB,
0x23BE,0xFE00,0x0052,0x420B,0x2380,0x0000,0x00A4,0x820B,
0x89BB,0xB300,0x0149,0x020B,0x89BB,0xFB00,0x0292,0x020B,
0x2380,0x0000,0x0524,0x020B,0x23BD,0x9600,0x0A48,0x020B,
0x89BF,0xDF00,0x1490,0x03FB,0x8980,0x0000,0x2920,0x0003,
0x2380,0x0000,0x5240,0x0003,0x2380,0x0000,0xE480,0x0003,
0x8980,0x0001,0x2900,0x0003,0x8980,0x0001,0x1200,0x0003,
0x2380,0x0002,0x0C00,0x0003,0x2380,0x0002,0x1800,0x0003,
0x8980,0x000E,0x677C,0x0003,0x8980,0x000F,0xE7FC,0x0003,
0x2380,0x000E,0x0000,0x0003,0x2380,0x000C,0x0000,0x0003,
0x8980,0x000F,0x9DB0,0x0003,0x8980,0x000F,0x9FF0,0x0003,
0x2380,0x0000,0x0000,0x0003,0x2380,0x0000,0x0000,0x0003,
0x8980,0x000E,0x6ECE,0x0003,0x8980,0x000E,0x7FCE,0x0003,
0x2380,0x0000,0x0000,0x0003,0x2380,0x0000,0x0000,0x0003,
0x8980,0x0000,0x0000,0x0003,0x8980,0x0000,0x0000,0x0003,
0x23FF,0xFFFF,0xFFFF,0xFFFF,0x23FF,0xFFFF,0xFFFF,0xFFFF
xvnews-2.3.2/config/ 40755 4246 12 0 5766270462 13023 5 ustar graaff staff xvnews-2.3.2/config/XView.cf 100644 4246 12 24534 5605024163 14507 0 ustar graaff staff #ifndef XViewCf
#define XViewCf YES
/**/###########################################################################
/**/# @(#)XView.cf 1.8 10/4/91 SMI
/**/# XView.cf for XView release 3.0. Specify site preferences here.
/*
* When anything is changed here, you must remake all the Makefiles
* from the Imakefiles.
*
* First set the IMAKEINCLUDE environment variable to point to the
* config directory in your installed X11 release (usually
* /usr/lib/X11/config) and the config directory in the XView release.
* For example:
*
* using csh where <X11> stands for the top of your installed X11
* release and <XVIEW> stands for the top of the XView source
* release.
*
* % setenv IMAKEINCLUDE -I<X11>/lib/X11/config -I<XVIEW>/config
*
* or using sh or ksh:
*
* # IMAKEINCLUDE="-I<X11>/lib/X11/config -I<XVIEW>/config"
* # export IMAKEINCLUDE
*
* check the value of this with:
*
* echo "IMAKEINCLUDE = "$IMAKEINCLUDE
*
* Second, make the top level Makefile. For example:
*
* with the X.V11 release 5 from MIT installed and the X11 bin
* directory is already in your PATH.
*
* % imake -DUseInstalled -I<X11>/lib/X11/config -I./config
*
* Third, "make Makefiles", note "make World" will do a "make Makefiles".
*
* If you've already made the Makefiles once before, can just do another
* "make Makefiles" from the <XVIEW> directory.
*/
/****************************************************************************/
/****************************************************************************/
/*
* NOTE: Any of the values in this file or any of the other XView.* files
* can be overridden in the site.def file.
*
****************************************************************************/
/****************************************************************************/
/*
* If you have the Open Windows release 2.0 or 3.0 distribution from Sun
* Microsystems as your X environment, set this to YES. See next
* comment.
*
*/
#ifndef HasOpenWindows
#define HasOpenWindows NO
#endif
/*
* If you have Open Windows, then will need to set up the location of
* some files used by libxvps, client/clock.
* The default is set up as the environement variable "OPENWINHOME"
* preceeded by "$$" so it works correctly with make. If you would
* rather code in the location of Open Windows instead of using an
* environment variable, that will work as well. So, instead of setting
* this to be "$$OPENWINHOME", could set it to be "/home/openwin" if
* the "include" directory is found in /home/openwin/include or
* "/home/openwin/usr/" if the "include" directory is found in
* /home/openwin/usr/include.
*
* The OPENWINHOME environment variable should be set to point to the
* top of your OpenWindows distribution. In the case of XVPS, you will
* need write permission for the OpenWindows distribution to install the
* XVPS library. See also InstallInOpenwinHome.
*
*/
#if HasOpenWindows
# ifndef OpenWindowsHome
# define OpenWindowsHome $$OPENWINHOME
# endif
#endif
/*
* When you have permission to install a file into $OPENWINHOME,
* set the following value to YES for PostScript files in libxvps.
*/
#ifndef InstallInOpenwinHome
#define InstallInOpenwinHome NO
#endif
/*
* Where to install the XView distribution.
*
* By default XView will be installed wherever the X11R5 hiearchy is
* installed (via site.def). Defining XVDestDir will override this
* i.e. XView will be installed in XVDestDir instead.
*
* Note: The OpenLook fonts are always installed in the R5 hierarchy
* regardless of whether XVDestDir is defined or not. (see
* InstallOpenLookFonts below)
*
* To make this macro active, uncomment this set of defines and give it
* the appropriate value.
#ifndef XVDestDir
#define XVDestDir /home/xview
#endif
*/
/*
* Command to add object modules to the library.
*
* For compiling a second time, you might want to change the arguments
* for ar to be "rul" which will add a module if it is not already there.
* For quicker addition of modules, use the "clqv" flags to ar.
*/
#ifndef ArchiveCommand
#define ArchiveCommand ar rulv
#endif
/*
* Command to change the permissions of a file.
*/
#ifndef ChangePermissionsCommand
#define ChangePermissionsCommand chmod
#endif
/*
* Use PRE_R4_ICCCM only if you are compiling with X.V11R3.
* To do this change NO to YES for PreR4Server below. Note:
* these Imakefiles will require the rules in the R4 config
* directory and the scripts mkdirhier, and makedepend.
*
* See also InstallOpenLookFonts
*/
#ifndef PreR4Server
#define PreR4Server NO
#endif
/*
* If you already have the configuration information installed from
* the X.V11R5 distribution, set OnlyNeedsNewXViewConfigInstalled to
* YES below.
*
* By default, the X.V11R5 configuration files would have been
* installed in $(DESTDIR)/lib/X11/config (aka $(CONFIGDIR)).
*/
#ifndef OnlyNeedsNewXViewConfigInstalled
#define OnlyNeedsNewXViewConfigInstalled NO
#endif
/*
* If you would like the XView man pages to be installed in
* the same directory as the X.V11R5 man pages, then set
* InstallManPagesInXVDestDir below to NO.
*
* By default, these files would be installed in $(XVDESTDIR)/man
* and setting this to NO would install them in $(DESTDIR)/man.
*/
#ifndef InstallManPagesInXVDestDir
#define InstallManPagesInXVDestDir YES
#endif
/*
* If your server does not have the OpenLook fonts installed, then set
* InstallOpenLookFonts to YES below.
*
* The X.V11 Release 5 MIT server installs these by default.
* Any X.V11 release older than R4 will need these installed.
* The Open Windows Release 1.0.1 onward is based on X.V11 Release 4.
* These are unchanged from X.V11R4 and the XView 2 release.
*/
#ifndef InstallOpenLookFonts
#define InstallOpenLookFonts NO
#endif
/*
* If you want to install the private header files, set below value to
* YES. Some extensions will want to use the private header files, so
* if you will be doing alot of subclassing, set it to YES.
*/
#ifndef InstallPrivateHeaders
#define InstallPrivateHeaders YES
#endif
/*
* If you do want to install the conversion from SunView to XView
* scripts, set the following value to YES below.
*/
#ifndef InstallConversion
#define InstallConversion NO
#endif
/*
* If you are using SunOS 3.5 or another 4.2 BSD based operating system,
* add in the flag -DOLD_BSD_FDSETS to LibXViewDefines below.
*/
#ifndef LibXViewDefines
# if PreR4Server
# define LibXViewDefines -DPRE_R4_ICCCM
# else
# define LibXViewDefines
# endif
#endif
/*
* If you can compile with shared libraires, and want to at this time, * set WantToCompileSharedLibs to YES below.
*/
#ifndef WantToCompileSharedLibs
#define WantToCompileSharedLibs NO
#endif
/*
* To compile a shared library, set HasSharedLibraries to YES in
* the site.def file. Only do this if you really do have shared library
* capabilities in your operating system. By default, SunOS 4.x and
* older will build both a shared and a static library. Since building a
* shared library takes longer than a static one, you may want to make
* sure the static library builds first, then try the shared one.
*
* The name of this directive is SharedLibXView, but it applies to all
* the libraries: libxview, libolgx, and libxvps.
*/
#ifndef SharedLibXView
# if HasSharedLibraries && WantToCompileSharedLibs
#define SharedLibXView YES
# else
#define SharedLibXView NO
# endif
#endif
/*
* To compile a debugged version of the library, set DebugLibXView to YES
* below. This has not been tested.
*
* Note: a complete debugged library will be between 17 and 20 MB in
* size.
*/
#ifndef DebugLibXView
#define DebugLibXView NO
#endif
/*
* To compile a profiled version of the library, set ProfileLibXView to
* YES below. This has not been tested.
*/
#ifndef ProfileLibXView
#define ProfileLibXView NO
#endif
/*
* any machine without pixrect includes in /usr/include will
* need to set InstallPixrectHeaders to YES below.
*
* XView does not use the Pixrect library, it uses the Pixrect
* data structures as an internal structure to provide
* compatibility with programs which do use the Pixrect library.
*/
#ifndef InstallPixrectHeaders
#define InstallPixrectHeaders NO
#endif
/*
* Many of the images are not used by the library or the clients provided
* with the XView 3.0 public source release. The images are broken up
* into a group of "core" images which are used and "others" which are
* not used. To install images in addition to the "core" group, set the
* following variable to YES.
*/
#ifndef InstallAllImages
#define InstallAllImages NO
#endif
/*
* If you do not already have the textsw extras menu installed in
* /usr/lib/.text_extras_menu, then set RedefineTextExtrasMenu below
* to YES.
*/
#ifndef RedefineTextExtrasMenu
#define RedefineTextExtrasMenu NO
#endif
/*
* DEC 3100 Config options
*/
#ifdef UltrixArchitecture
# ifndef InstallCommand
# define InstallCommand /usr/bin/install
# endif
#endif
/*
* Assume that the X library has been built and installed.
* Set the Dependent X library to null to avoid make file conflicts.
*
* A dependent library means that the build will try to grab the library
* from within the source code hierarchy. If the library is not there,
* it will then attempt to build the library first.
*/
#ifndef XVDependentXLib
#define XVDependentXLib
#endif
/*
* The command to extract static strings from a source file and
* replace it with an index into a common hash table. The hash table
* is then compiled into the executable as a separate module.
*/
#ifndef ExtractStringCommand
#define ExtractStringCommand xstr
#endif
/*
* Messaging routines such as dgettext(), gettext() are part of
* XView 3.0. They are used for localized text handling i.e. so that
* error messages, button labels, etc. can be displayed in the current
* locale. By default, they are implemented using mmap(). Set OsHasMMap
* to NO if it is not available on your OS. An alternate method using
* malloc() and read() will be used instead.
*/
#ifndef OsHasMmap
#define OsHasMmap YES
#endif
/*
* The implementation of internationalization support in XView depends
* on the function setlocale(). If it is not available, set OsHasLocale
* to NO. A dummy stub setlocale() function will be defined (just to
* resolve some symbols) but XView will have it's internationalization
* features disabled.
*/
#ifndef OsHasLocale
#define OsHasLocale YES
#endif
#endif /* XViewCf */
xvnews-2.3.2/config/XView.lib 100644 4246 12 2227 5605024163 14640 0 ustar graaff staff /**/##########################################################################
/**/# @(#)XView.lib 1.2 10/1/91 SMI
/**/# XView.lib for XView release 3.0. Common commands for all library builds.
#ifdef BandAidCompiler
#include BandAidCompiler
#endif
install::
$(MKDIRHIER) $(LIBRARY_DEST)
#if DebugLibXView
InstallLibraryNoBuild(${LIBTARGET}_d,$(LIBRARY_DEST))
#endif
#if ProfileLibXView
InstallLibraryNoBuild(${LIBTARGET}_p,$(LIBRARY_DEST))
#endif
#if SharedLibXView
# if SortObjects
SubdirBuildSortedSharedLibraryTarget(${LIBTARGET},${SOREV},$(SHARED_DIR),$(OBJSORT),$(OBJLIST))
# else
SubdirBuildNormalSharedLibraryTarget(${LIBTARGET},${SOREV},$(SHARED_DIR))
# endif
# if !NoDataObjs
SubdirBuildNormalSharedLibraryDataTarget(${LIBTARGET},${SOREV},$(UNSHARED_DIR))
InstallSharedLibraryDataNoBuild(${LIBTARGET},${SOREV},$(LIBRARY_DEST))
# endif
InstallSharedLibraryNoBuild(${LIBTARGET},${SOREV},$(LIBRARY_DEST))
#endif
InstallLibraryNoBuild(${LIBTARGET}, $(LIBRARY_DEST))
SubdirLintLibraryBuild(${LIBTARGET},lint)
InstallLintLibrary(${LIBTARGET},$(LINT_LIBRARY_DEST))
#ifndef IncludePopulateSCCS
#define IncludePopulateSCCS YES
PopulateSCCSTree(h,$(ALLFILES))
#endif
xvnews-2.3.2/config/XView.prog 100644 4246 12 1010 5605024163 15026 0 ustar graaff staff /**/# @(#)XView.prog 1.2 10/1/91 SMI
PopulateSCCSTree(h,$(ALLFILES))
#if HasInfoFiles
install::
$(MKDIRHIER) $(HELP_DEST)
InstallNonExecList($(INFOFILES),$(HELP_DEST))
#endif
#if InstallSrcs
MakeDirectories(install, $(SRC_DEST)/examples/bin)
InstallMultiple($(PROGRAMS),$(SRC_DEST)/examples/bin)
MakeDirectories(install.srcs, $(SRC_DEST)/$(LOCATION))
InstallExampleSrcs($(INSTALL_SRCS),$(MAKEFILE_SIMPLE),$(SRC_DEST)/$(LOCATION))
#else
install.srcs::
#endif
includes::
install.man::
DependTarget()
LintTarget()
xvnews-2.3.2/config/XView.rules 100644 4246 12 42051 5605024163 15243 0 ustar graaff staff /**/###########################################################################
/**/# @(#)XView.rules 1.4 10/5/91 SMI
/**/# XView.rules for XView release 3.0. Imake rules needed by distribution.
/*
***********************************************************************
*
* Imake rules for XView
* *** DO NOT CHANGE ANYTHING BELOW THIS LINE! ***
*
***********************************************************************
*/
/*
* SubdirNormalLibTarget - create an "all::" target for a library;
*/
#ifndef SubdirNormalLibTarget
#define SubdirNormalLibTarget(libname, objlist) @@\
AllTarget(lib/**/libname.a) @@\
@@\
lib/**/libname.a:: objlist @@\
$(AR) $(TARGETDIR)$@ objlist
#endif /* SubdirNormalLibTarget */
/*
* SubdirProfiledLibTarget - create an "all::" target for a profiled library;
*/
#ifndef SubdirProfiledLibTarget
#define SubdirProfiledLibTarget(libname, objlist) @@\
AllTarget(lib/**/libname/**/_p.a) @@\
@@\
lib/**/libname/**/_p.a:: objlist @@\
( cd profiled; $(AR) ../$(TARGETDIR)$@ objlist )
#endif /* SubdirProfiledLibTarget */
/*
* SubdirDebuggedLibTarget - create an "all::" target for a debugged library;
*/
#ifndef SubdirDebuggedLibTarget
#define SubdirDebuggedLibTarget(libname, objlist) @@\
AllTarget(lib/**/libname/**/_d.a) @@\
@@\
lib/**/libname/**/_d.a:: objlist @@\
( cd debugger; $(AR) ../$(TARGETDIR)$@ objlist )
#endif /* SubdirDebuggedLibTarget */
/*
* SubdirCompoundLibTarget - create an "all::" target for a compound library;
* --same rule as SubdirNormalLibTarget--compatibility
*/
#ifndef SubdirCompoundLibTarget
#define SubdirCompoundLibTarget(libname, objlist) @@\
AllTarget(lib/**/libname.a) @@\
@@\
lib/**/libname.a:: objlist @@\
$(AR) $(TARGETDIR)$@ objlist
#endif /* SubdirCompoundLibTarget */
/*
* MakeAnythingSubdirs - go into subdirs to make anything for a given target;
*/
#ifndef MakeAnythingSubdirs
#define MakeAnythingSubdirs(name,dirs) @@\
name:: @@\
@case '${MFLAGS}' in *[ik]*) set +e;; esac; \ @@\
for i in dirs ;\ @@\
do \ @@\
(cd $$i ; echo "making name in $$i"; \ @@\
$(MAKE) PassCDebugFlags $(MFLAGS) name); \ @@\
done
#endif /* MakeAnythingSubdirs */
/*
* InstallLibraryNoBuild - install a library without first trying to build it;
*/
#ifndef InstallLibraryNoBuild
#define InstallLibraryNoBuild(libname,dest) @@\
install:: @@\
-$(INSTALL) -c $(INSTLIBFLAGS) lib/**/libname.a dest @@\
-$(RANLIB) $(RANLIBINSTFLAGS) dest/lib/**/libname.a
#endif /* InstallLibraryNoBuild */
/*
* SubdirNormalSharedLibraryTarget - generate rules to create a shared library;
* do not build it since this is for a subdirectory. Move the files to the
* shared library directory for all objects in solist.
*/
#ifndef SubdirNormalSharedLibraryTarget
#define SubdirNormalSharedLibraryTarget(libname,rev,solist,dir,sub) @@\
AllTarget(lib/**/libname.so.rev) @@\
@@\
lib/**/libname.so.rev:: solist @@\
-@if [ ! -d dir ]; then mkdir dir; else exit 0; fi @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
for i in solist; do (set -x; $(CP) sub/$$i dir); done
#endif /* SubdirNormalSharedLibraryTarget */
/*
* SubdirNormalSharedLibraryDataTarget - generate rules to create shlib data file;
* do not build it since this is for a subdirectory. Copy the files to the
* shared library data directory for all objects in salist. Delete the
* unneeded data modules from the ./shared directory.
*/
#ifndef SubdirNormalSharedLibraryDataTarget
#define SubdirNormalSharedLibraryDataTarget(libname,rev,salist,dir,sub) @@\
AllTarget(lib/**/libname.sa.rev) @@\
@@\
lib/**/libname.sa.rev:: salist @@\
-@if [ ! -d dir ]; then mkdir dir; else exit 0; fi @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\
for i in salist; do \ @@\
(set -x; $(CP) sub/$$i dir; $(CP) shared/$$i $(SHARED_DIR)); done
#endif /* SubdirNormalSharedLibraryDataTarget */
/*
* SubdirBuildNormalSharedLibraryTarget - generate rules to create a shared library;
* build it into a different name so that the we don't hose people by having
* the library gone for long periods. The lib<foo>.so part contains the entire
* library both text and data modules. The globally initialized data must be
* included in both the .so and the .sa parts of the library.
*/
#ifndef SubdirBuildNormalSharedLibraryTarget
#define SubdirBuildNormalSharedLibraryTarget(libname,rev,sodir) @@\
AllTarget(lib/**/libname.so.rev) @@\
@@\
lib/**/libname.so.rev:: @@\
$(RM) $@~ sodir/lib/**/libname.so.xs.o @@\
@if [ -f xstrings ]; then \ @@\
$(RM) strings; $(CP) xstrings strings; fi @@\
$(XSTR) -l $(XSTR_ARRAY) @@\
$(CC) $(PIC) $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) -c xs.c \ @@\
-o sodir/lib/**/libname.so.xs.o @@\
(cd sodir; $(LD) -assert pure-text -o ../$@~ ?*.o) @@\
-@if [ -f strings~ ]; then $(RM) strings~; else exit 0; fi @@\
$(RM) $@ xs.c @@\
$(MV) $@~ $@ @@\
@@\
clean:: @@\
$(RM) lib/**/libname.so.rev sodir/?*.o strings*
#endif /* SubdirBuildNormalSharedLibraryTarget */
/*
* SubdirBuildSortedSharedLibraryTarget - rules to create a sorted shlib;
* build it into a different name so that the we don't hose people by having
* the library gone for long periods. The lib<foo>.so part contains the entire
* library both text and data modules. The globally initialized data must be
* included in both the .so and the .sa parts of the library. Must have the
* sorting script and a list of objects to sort.
*/
#ifndef SubdirBuildSortedSharedLibraryTarget
#define SubdirBuildSortedSharedLibraryTarget(libname,rev,sodir,objsort,objlist) @@\
AllTarget(lib/**/libname.so.rev) @@\
@@\
lib/**/libname.so.rev:: @@\
$(RM) $@~ sodir/lib/**/libname.so.xs.o @@\
@if [ -f xstrings ]; then \ @@\
$(RM) strings; $(CP) xstrings strings; fi @@\
$(XSTR) -l $(XSTR_ARRAY) @@\
$(CC) $(PIC) $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) -c xs.c \ @@\
-o sodir/lib/**/libname.so.xs.o @@\
-@if [ ! -x objsort ];then $(CHMOD) 755 objsort;else exit 0;fi @@\
$(LD) `objsort objlist sodir` -assert pure-text -o $@~ @@\
@if [ -f strings~ ]; then $(RM) strings~; else exit 0; fi @@\
$(RM) $@ xs.c @@\
$(MV) $@~ $@ @@\
@@\
clean:: @@\
$(RM) lib/**/libname.so.rev sodir/?*.o strings* xstrings*
#endif /* SubdirBuildSortedSharedLibraryTarget */
/*
* SubdirBuildNormalSharedLibraryDataTarget - generate rules to create shlib data file;
* Do not use xstr or pic on the data file segments.
* The lib<foo>.sa part defines the interface for globally initialized data.
*/
#ifndef SubdirBuildNormalSharedLibraryDataTarget
#define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir) @@\
AllTarget(lib/**/libname.sa.rev) @@\
@@\
lib/**/libname.sa.rev:: @@\
$(RM) $@~ @@\
(cd sadir; $(AR) ../$@~ ?*.o) @@\
$(RM) $@ @@\
$(MV) $@~ $@ @@\
$(RANLIB) $@ @@\
@@\
clean:: @@\
$(RM) lib/**/libname.sa.rev sadir/?*.o
#endif /* SubdirBuildNormalSharedLibraryDataTarget */
/*
* SubdirSharedLibraryObjectRule - generate make rules to build
* "normal" SunOS style shared object files. XView absolutely requires
* the use of xstr to build a shared library; otherwise, the library will
* overflow the GLOBAL_OFFSET_TABLE for some architectures.
*/
#ifndef SubdirSharedLibraryObjectRule
#define SubdirSharedLibraryObjectRule() @@\
all:: @@\
-@if [ ! -d shared ]; then mkdir shared; else exit 0; fi @@\
-@if [ ! -f $(XSTR_STRINGS_FILE) ]; then \ @@\
touch $(XSTR_STRINGS_FILE); else exit 0; fi @@\
-@if [ ! -f strings ]; then \ @@\
$(LN) $(XSTR_STRINGS_FILE) strings; else exit 0; fi @@\
@@\
.c.o: @@\
$(RM) $@ shared/$@ @@\
$(CC) -E $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) $*.c \ @@\
| $(XSTR) -l $(XSTR_ARRAY) -c - @@\
$(CC) $(PIC) $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) -c x.c \ @@\
-o shared/$*.o @@\
$(RM) x.c @@\
$(CC) -c $(SHLIBDEF) $(CFLAGS) $*.c @@\
@@\
clean:: @@\
$(RM) strings* @@\
-@if [ -d shared ]; then echo " $(RM) shared/?*.o"; \ @@\
$(RM) shared/?*.o; else exit 0; fi @@\
#endif /* SubdirSharedLibraryObjectRule */
/*
* SubdirSharedAndDebuggedLibraryObjectRule - generate make rules to build shared,
* debuggable, and "normal" object files.
*/
#ifndef SubdirSharedAndDebuggedLibraryObjectRule
#define SubdirSharedAndDebuggedLibraryObjectRule() @@\
all:: @@\
-@if [ ! -d shared ]; then mkdir shared; else exit 0; fi @@\
-@if [ ! -f $(XSTR_STRINGS_FILE) ]; then \ @@\
touch $(XSTR_STRINGS_FILE); else exit 0; fi @@\
-@if [ -f strings ]; then $(RM) strings; else exit 0; fi @@\
$(LN) $(XSTR_STRINGS_FILE) strings @@\
-@if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi @@\
@@\
.c.o: @@\
$(RM) $@ shared/$@ debugger/$@ @@\
$(CC) -E $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) $*.c \ @@\
| $(XSTR) -l $(XSTR_ARRAY) -c - @@\
$(CC) $(PIC) $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) -c x.c \ @@\
-o shared/$*.o @@\
$(RM) x.c @@\
$(CC) -g -c $(SHLIBDEF) $(CFLAGS) $*.c @@\
$(CP) $*.o debugger/$*.o @@\
$(CC) -c $(SHLIBDEF) $(CFLAGS) $*.c @@\
@@\
clean:: @@\
$(RM) strings* @@\
-@if [ -d shared ]; then echo " $(RM) shared/?*.o"; \ @@\
$(RM) shared/?*.o; else exit 0; fi @@\
-@if [ -d debugger ]; then echo " $(RM) debugger/?*.o"; \ @@\
$(RM) debugger/?*.o; else exit 0; fi @@\
#endif /* SubdirSharedAndDebuggedLibraryObjectRule */
/*
* SubdirSpecialSharedAndDebuggedObjectRule - generate rules to compile a file
* with special flags and to make shared and debuggable versions.
* This rule does not use xstr so it may be used for data modules.
*/
#ifndef SubdirSpecialSharedAndDebuggedObjectRule
#define SubdirSpecialSharedAndDebuggedObjectRule(objs,depends,options) @@\
all:: @@\
-@if [ ! -d shared ]; then mkdir shared; else exit 0; fi @@\
-@if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi @@\
@@\
objs: depends @@\
$(RM) $@ shared/$@ debugger/$@ @@\
$(CC) $(PIC) -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) options $*.c @@\
$(CP) $*.o shared/$*.o @@\
$(CC) -g -c $(SHLIBDEF) $(CFLAGS) options $*.c @@\
$(CP) $*.o debugger/$*.o @@\
$(CC) -c $(SHLIBDEF) $(CFLAGS) options $*.c
#endif /* SubdirSpecialDebuggedAndProfiledObjectRule */
/*
* SubdirSpecialSharedObjectRule - generate rules to compile a file
* with special flags and to make shared versions.
* This rule does not use xstr so it may be used for data modules.
*/
#ifndef SubdirSpecialSharedObjectRule
#define SubdirSpecialSharedObjectRule(objs,depends,options) @@\
all:: @@\
-@if [ ! -d shared ]; then mkdir shared; else exit 0; fi @@\
@@\
objs: depends @@\
$(RM) $@ shared/$@ @@\
$(CC) $(PIC) -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) options $*.c @@\
$(CP) $*.o shared/$*.o @@\
$(CC) -c $(SHLIBDEF) $(CFLAGS) options $*.c
#endif /* SubdirSpecialSharedObjectRule */
/*
* AssemblerObjectRule - generate an object rule for assembler sources
*/
#ifndef AssemblerObjectRule
#define AssemblerObjectRule(objs,depends) @@\
@@\
objs: depends @@\
$(AS) $(AFLAGS) $*.s -o $*.o
#endif /* AssemblerObjectRule */
/*
* InstallSharedLibraryDataNoBuild - rules to install the shared library data
*/
#ifndef InstallSharedLibraryDataNoBuild
#define InstallSharedLibraryDataNoBuild(libname,rev,dest) @@\
install:: @@\
-$(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.sa.rev dest @@\
-$(RANLIB) $(RANLIBINSTFLAGS) dest/lib/**/libname.sa.rev
#endif /* InstallSharedLibraryDataNoBuild */
/*
* InstallSharedLibraryNoBuild - generate rules to install the shared library.
*/
#ifndef InstallSharedLibraryNoBuild
#define InstallSharedLibraryNoBuild(libname,rev,dest) @@\
install:: @@\
$(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.so.rev dest @@\
#endif /* InstallSharedLibraryNoBuild */
/*
* SubdirLintLibraryTarget - rules to build a lint library when have subdirs;
*/
#ifndef SubdirLintLibraryTarget
#define SubdirLintLibraryTarget(libname,destdir,srcs) @@\
lintlib:: @@\
-@if [ ! -d destdir ]; then mkdir destdir; else exit 0; fi @@\
$(RM) ?*.ln; @@\
@case '${MFLAGS}' in *[ik]*) set +e;; esac; \ @@\
for i in srcs ;\ @@\
do \ @@\
echo "linting $$i"; \ @@\
$(LINT) $(LINTFLAGS) -i -c $$i; \ @@\
if [ ! -f ?*.ln ]; then \ @@\
echo "lint failed for $$i"; \ @@\
else \ @@\
$(MV) ?*.ln destdir; \ @@\
fi \ @@\
done
#endif /* SubdirLintLibraryTarget */
/*
* SubdirLintLibraryBuild - rules to create a lint library with subdirs;
* Note that the lint library is always forced to be newer than the library
* itself.
*/
#ifndef SubdirLintLibraryBuild
#define SubdirLintLibraryBuild(libname,lintdir) @@\
lintlib:: llib-l/**/libname.ln @@\
@@\
llib-l/**/libname.ln: @@\
$(RM) $@ @@\
$(LINT) $(LINTLIBFLAG)/**/libname $(LINTFLAGS) lintdir/?*.ln @@\
@@\
clean:: @@\
$(RM) llib-l/**/libname.ln @@\
$(RM) lint/?*.ln @@\
@@\
install.ln:: lintlib
#endif /* LintLibraryBuild */
/*
* PopulateSCCSTree - rule to populate build tree from an SCCS archive
*/
#ifndef PopulateSCCSTree
#define PopulateSCCSTree(type,srcs) @@\
populate:: @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; @@\
-@if [ -type SCCS ]; then \ @@\
for i in srcs ; do sccs get $$i ; done ; \ @@\
elif [ -type SCCS- ]; then \ @@\
$(MV) SCCS- SCCS ; \ @@\
for i in srcs ; do sccs get $$i ; done ; \ @@\
$(MV) SCCS SCCS- ; \ @@\
else \ @@\
echo "SCCS or SCCS- do not exist" ; \ @@\
fi
#endif /* PopulateSCCSTree */
/*
* PopulateSubdirs - generate rules to recursively populate a source tree.
*/
#ifndef PopulateSubdirs
#define PopulateSubdirs(dirs) @@\
NamedTargetSubdirs(populate,dirs,"populating", /**/,populate)
#endif /* PopulateSubdirs */
/*
* LinkToFile - rule to make a link to one file
*/
#ifndef LinkToFile
#define LinkToFile(step,filename,linkname,dir) @@\
step:: filename @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; @@\
-@if [ ! -f dir/linkname ]; then \ @@\
echo "linking dir/linkname to filename..." \ @@\
echo " cd" dir; cd dir ; $(RM) linkname ; \ @@\
(set -x; $(LN) filename linkname); \ @@\
else \ @@\
echo "dir/linkname exists, no link made." ; \ @@\
fi
#endif /* LinkToFile */
/*
* StartNamedTarget - rule to enter a directory and start a target
*/
#ifndef StartNamedTarget
#define StartNamedTarget(step,dir,flags) @@\
step:: @@\
(cd dir ; $(MAKE) $(MFLAGS) flags step );
#endif /* StartNamedTarget */
/*
* InstallSupportList - rule to install a list of support files
*/
#ifndef InstallSupportList
#define InstallSupportList(srcs,dest) @@\
install:: @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; @@\
for i in srcs ;\ @@\
do \ @@\
echo "installing $$i"; \ @@\
$(RM) dest/$$i dest/.$$i; \ @@\
$(INSTALL) -c $(INSTDATFLAGS) $$i dest ; \ @@\
( cd dest; $(MV) $$i .$$i; $(LN) .$$i $$i ); \ @@\
done
#endif /* InstallSupportList */
/*
* InstallNonExecList - rule to install a list of help files
*/
#ifndef InstallNonExecList
#define InstallNonExecList(srcs,dest) @@\
install:: @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; @@\
for i in srcs ;\ @@\
do \ @@\
echo "installing $$i"; \ @@\
$(RM) dest/$$i ; \ @@\
$(INSTALL) -c $(INSTDATFLAGS) $$i dest ; \ @@\
done
#endif /* InstallNonExecList */
/*
* InstallExampleSrcs - rule to install example sources.
*/
#ifndef InstallExampleSrcs
#define InstallExampleSrcs(files,makefile,dest) @@\
install.srcs:: @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; @@\
for i in files ;\ @@\
do \ @@\
echo "installing $$i"; \ @@\
$(RM) dest/$$i ; \ @@\
$(INSTALL) -c $(INSTDATFLAGS) $$i dest ; \ @@\
done @@\
$(RM) dest/Makefile ; @@\
$(INSTALL) -c $(INSTDATFLAGS) makefile dest/Makefile
#endif /* InstallExampleSrcs */
/*
* InstallExampleSrcsNoMakefile - rule to install example sources that
* do not have Makefiles.
*/
#ifndef InstallExampleSrcsNoMakefile
#define InstallExampleSrcsNoMakefile(files,dest) @@\
install.srcs:: @@\
@case '${MFLAGS}' in *[i]*) set +e;; esac; @@\
for i in files ;\ @@\
do \ @@\
echo "installing $$i"; \ @@\
$(RM) dest/$$i ; \ @@\
$(INSTALL) -c $(INSTDATFLAGS) $$i dest ; \ @@\
done
#endif /* InstallExampleSrcsNoMakefile */
/*
* InstallSrcsSubdirs - generate rules to recursively install sources.
*/
#ifndef InstallSrcsSubdirs
#define InstallSrcsSubdirs(dirs) @@\
NamedTargetSubdirs(install.srcs,dirs,"installing srcs", /**/,install.srcs)
#endif /* InstallSrcsSubdirs */
xvnews-2.3.2/config/XView.tmpl 100644 4246 12 30005 5606465342 15072 0 ustar graaff staff #ifndef XViewTmpl
#define XViewTmpl YES
#include "XView.cf"
/**/###########################################################################
/**/# @(#)XView.tmpl 1.8 10/4/91 SMI
/**/# XView.tmpl for XView release 3.0. Template to add additional config
/**/# rules to those supplied with X Version 11 release 5.
/***************************************************************************/
/***************************************************************************/
/*
* NOTE:The variables that can be changed without significantly
* affecting the build process have been defined with the
* "#ifndef value, #define value, #endif" CPP notation which allows
* one to override any of these definitions in the site.def
* file. The site.def file is included before this file in the process of
* creating the Makefile.
*
***************************************************************************/
/***************************************************************************/
/*
* Where to install XView libraries
*/
#ifndef XVLibraryDestination
#define XVLibraryDestination $(XVDESTDIR)/lib
#endif
/*
* Where to install XView lint libraries
*/
#ifndef XVLintLibraryDestination
#define XVLintLibraryDestination $(XVDESTDIR)/lib/lint
#endif
/*
* Where to install the XView clients. By default, the MIT configuration
* files set this to be $(DESTDIR)/usr/bin/X11.
* These are set up to go into $(XVDESTDIR)/usr/bin/xview by default so
* these programs do not overwrite any others that may be installed
* on the system.
*/
#ifndef XVBinDest
#define XVBinDest $(XVDESTDIR)/bin
#endif
/*
* Where to install the XView man pages. By default, the MIT config
* files set this to be $(DESTDIR)/usr/man. This allows the XView.cf
* file to provide an obvious way to change the behavior without
* delving too much into the intricacies of Imake and associated
* conventions used by X.V11R4.
*/
#if InstallManPagesInXVDestDir
# ifndef XVManPath
# define XVManPath $(XVDESTDIR)/man
# endif
#else
# define XVManPath ManPath
#endif
/*
* Where to install the include files.
*/
#ifndef XVHeaderDest
#define XVHeaderDest $(XVDESTDIR)/include
#endif
/*
* Where to install the source examples.
*/
#ifndef XVSourceDest
#define XVSourceDest $(XVDESTDIR)/share/src/xview
#endif
/*
* Where to install the documentation files.
*/
#ifndef XVDocDest
#define XVDocDest $(XVDESTDIR)/share/doc/xview
#endif
/*
* Where to install the help files for spot help.
*/
#ifndef XVHelpDest
#define XVHelpDest $(LIBRARY_DEST)/help
#endif
/*
* Where to install the extra support files.
*/
#ifndef XVExtrasDest
#define XVExtrasDest $(LIBRARY_DEST)
#endif
/*
* What to call the text extras file and where to find it.
* By default, looks for "/usr/lib/.text_extras_menu".
*/
#ifndef TextExtrasMenuFileName
#define TextExtrasMenuFileName XVExtrasDest/**//.text_extras_menu
#endif
/*
* Work around small conflict with Project.tmpl file
*/
#if UseInstalled
MKDIRHIER = BourneShell BinDir/mkdirhier
#endif
#if OsHasLocale
LOCALE_DEFINES = -DOS_HAS_LOCALE
#endif
#if OsHasMmap
MMAP_DEFINES = -DOS_HAS_MMAP
#endif
DEFINES = $(LOCALE_DEFINES) $(MMAP_DEFINES)
#ifdef XVDestDir
XVDESTDIR = XVDestDir
LIBRARY_DEST = XVLibraryDestination
LINT_LIBRARY_DEST = XVLintLibraryDestination
BINDIR = XVBinDest
MANPATH = XVManPath
HEADER_DEST = XVHeaderDest
SRC_DEST = XVSourceDest
DOC_DEST = XVDocDest
#else
LIBRARY_DEST = $(USRLIBDIR)
LINT_LIBRARY_DEST = $(LINTLIBDIR)
HEADER_DEST = $(INCROOT)
#ifdef ProjectRoot
SRC_DEST = $(PROJECTROOT)/share/src/xview
DOC_DEST = $(PROJECTROOT)/share/doc/xview
#else
SRC_DEST = /usr/share/src/xview
DOC_DEST = /usr/share/doc/xview
#endif
#endif
/*
* If you do need these files installed, then put them in an XView
* location, so need to override the value for configdir.
* Also affects commands line when using Imake...
*/
#if !OnlyNeedsNewXViewConfigInstalled
# ifndef XVConfigdir
# define XVConfigdir $(LIBRARY_DEST)/config
# endif
CONFIGDIR = XVConfigdir
#endif
XVLIBSRC = $(TOP)/lib
HELP_DEST = XVHelpDest
LIBRARY_DEST_EXTRAS = XVExtrasDest
TEXT_EXTRAS_MENU = TextExtrasMenuFileName
AR = ArchiveCommand
CHMOD = ChangePermissionsCommand
#if HasOpenWindows
PSDIR = OpenWindowsHome/etc/NeWS
NEWSHDRS = OpenWindowsHome/include
NEWSLIBDIR = OpenWindowsHome/lib
CPSLIB = -L$(NEWSLIBDIR) -lcps
CPS = OpenWindowsHome/bin/cps
DESKSETDIR = OpenWindowsHome/lib
LIBDESKSET = -L$(DESKSETDIR) -ldeskset
#endif
/*
* DEC 3100 Config options
*/
#ifdef UltrixArchitecture
INSTALL = InstallCommand
#endif
/*
* Also, we assume that the X11 library has been built by this point, so
* override this variable with a null value.
*/
DEPXLIB = XVDependentXLib
/*
* Flags and rules used when compiling assembler source files
* Currently, these are not used, so commented out.
AFLAGS = -P
AS = as
*/
/*
* use the same trick X11R5 does for defining rules for installed libs
*/
#ifdef UseInstalled
#define _Use(a,b) a
#else
#define _Use(a,b) b
#endif
/*
* Temporary directory used during build process before the include
* files are installed. This is just a place where symbolic links are
* placed to point back to the actual files in the build hierarchy to
* save on disk space.
*/
#ifndef XVBuildIncludesDir
#define XVBuildIncludesDir $(TOP)/build
#endif
/*
* This is the path from the include directory to the top of the XView
* source hierarchy. By default, the includes install in
* <XVIEW>/build/include/name, so that would be three ".." directories
* back to get back to the <XVIEW> directory.
*/
#ifndef XVBuildIncludeTop
#define XVBuildIncludeTop ../../..
#endif
BUILDINCDIR = XVBuildIncludesDir
BUILDINCTOP = XVBuildIncludeTop
/*
* Used for installation of includes during build and installation
* afterwards.
*/
#ifndef XVIncludeDirName
#define XVIncludeDirName /include
#endif
INCDIR = XVIncludeDirName
/*
* The following names should not be changed as the XView library
* sources depend on these names being consistent.
*/
XVPUBINC = xview
XVPRIINC = xview_private
OLPUBINC = olgx
OLPRIINC = olgx_private
PSPUBINC = xvps
PSPRIINC = xvps_private
IMAGEINC = images
BITMAPINC = bitmaps
PIXRECT_INCDIR = $(INCDIR)/pixrect
XVPUB_INCDIR = $(INCDIR)/$(XVPUBINC)
XVPRI_INCDIR = $(INCDIR)/$(XVPRIINC)
OLPUB_INCDIR = $(INCDIR)/$(OLPUBINC)
OLPRI_INCDIR = $(INCDIR)/$(OLPRIINC)
PSPUB_INCDIR = $(INCDIR)/$(PSPUBINC)
PSPRI_INCDIR = $(INCDIR)/$(PSPRIINC)
IMAGE_INCDIR = $(INCDIR)/$(IMAGEINC)
BITMAP_INCDIR = $(INCDIR)/$(BITMAPINC)
PIXRECT_HEADER_DEST = $(HEADER_DEST)/pixrect
XVPUB_HEADER_DEST = $(HEADER_DEST)/$(XVPUBINC)
XVPRI_HEADER_DEST = $(HEADER_DEST)/$(XVPRIINC)
OLPUB_HEADER_DEST = $(HEADER_DEST)/$(OLPUBINC)
OLPRI_HEADER_DEST = $(HEADER_DEST)/$(OLPRIINC)
PSPUB_HEADER_DEST = $(HEADER_DEST)/$(PSPUBINC)
PSPRI_HEADER_DEST = $(HEADER_DEST)/$(PSPRIINC)
IMAGES_DEST = $(HEADER_DEST)/$(IMAGEINC)
BITMAP_DEST = $(HEADER_DEST)/$(BITMAPINC)
/*
* For pre-R4, FONTINSTDIR should be $(LIBDIR)/fonts, also need to
* change LIBDIR above to the location of fonts for pre-R4 servers.
* For R5, FONTINSTDIR should be $(LIBDIR)/fonts. Note, do not need to
* install fonts if you have X.V11R4 FCS or X.V11R5 FCS .
*/
#if InstallOpenLookFonts
# ifndef XVFontDest
# define XVFontDest $(LIBDIR)/fonts
# endif
# ifndef XVOLFontDest
# define XVOLFontDest $(FONTINSTDIR)
# endif
# ifndef XVTextFontDest
# define XVTextFontDest $(FONTINSTDIR)
# endif
FONTINSTDIR = XVFontDest
OPENLOOK_FONTINSTDIR = XVOLFontDest
TEXTFONT_FONTINSTDIR = XVTextFontDest
#endif
/*
* Rules for compiling lint library.
*/
LINTDIR = $(LINT_LIBRARY_DEST)
/*
* Definitions used for compiling shared libraries
*/
#if SharedLibXView
# ifndef InstSharedLibFlags
# define InstSharedLibFlags -m 0755
# endif
# ifndef PositionIndependentCodeFlag
# define PositionIndependentCodeFlag -pic
# endif
# ifndef ExtractedStringArrayName
# define ExtractedStringArrayName _libxview_xstr
# endif
# ifndef ObjectSortCommand
# define ObjectSortCommand ./objsort.sh
# endif
# ifndef ObjectOrderListFile
# define ObjectOrderListFile ./lorder-sparc
# endif
PIC = PositionIndependentCodeFlag
XSTR = ExtractStringCommand
XSTR_ARRAY = ExtractedStringArrayName
OBJSORT = ObjectSortCommand
OBJLIST = ObjectOrderListFile
INSTSHAREDLIBFLAGS = InstSharedLibFlags
#endif
/*
* If compiling with shared libraries, sort the objects in the .so
* library so the strings are at the top and the global data
* initialization routines are at the tail. Other ordering would
* need to be based on an analysis of usage patterns over time. If
* a module is omitted from the ORDER_FILE, it will be at the tail of
* the library by default.
*/
#if SharedLibXView
# ifndef SortObjects
# define SortObjects YES
# endif
#endif
/*
* set up compile time dependencies for XView clients.
* These rules would be very handy for the site.def file.
*/
#if SharedLibXView
DEPXVIEWLIB =
XVIEWLIB = -L$(LIBRARY_DEST) -lxview
#else
DEPXVIEWLIB = _Use($(LIBRARY_DEST),$(XVLIBSRC)/libxview)/libxview.a
XVIEWLIB = LoaderLibPrefix -L$(LIBRARY_DEST) -lxview
#endif
#if SharedLibXView
DEPOLGXLIB =
OLGXLIB = -L$(LIBRARY_DEST) -lolgx
#else
DEPOLGXLIB = _Use($(LIBRARY_DEST),$(XVLIBSRC)/libolgx)/libolgx.a
OLGXLIB = LoaderLibPrefix -L$(LIBRARY_DEST) -lolgx
#endif
#if SharedLibXView
DEPXVPSLIB =
XVPSLIB = -L$(LIBRARY_DEST) -lxvps
#else
DEPXVPSLIB = _Use($(LIBRARY_DEST),$(XVLIBSRC)/libxvps)/libxvps.a
XVPSLIB = LoaderLibPrefix -L$(LIBRARY_DEST) -lxvps
#endif
#if SharedLibX
XLIB = $(EXTENSIONLIB) -lX11
#else
XLIB = $(EXTENSIONLIB) LoaderLibPrefix -lX11
#endif
/*
* Define libraries for XView clients
*/
#ifndef XViewClientDepLibs
#define XViewClientDepLibs
#endif
#ifndef XViewClientLibs
#define XViewClientLibs $(XVIEWLIB) $(OLGXLIB) $(XLIB)
#endif
/*
* Define libraries for XView clients using XVPS
*/
#if HasOpenWindows
# ifndef XViewPSClientDepLibs
# define XViewPSClientDepLibs
# endif
# ifndef XViewPSClientLibs
# define XViewPSClientLibs $(XVPSLIB) $(XVIEWLIB) $(OLGXLIB) $(XLIB) $(CPSLIB)
# endif
#endif
/*
* Do not change this revision number unless you know why. This number,
* 3.1, corresponds to the one for the XView 3.0 release.
*/
#if SharedLibXView
# ifndef SharedXViewRev
# define SharedXViewRev 3.1
# endif
SOXVIEWREV = SharedXViewRev
SOOLGXREV = SharedXViewRev
# if HasOpenWindows
SOXVPSREV = 0.2
# endif
#endif
/*
* Define the subdir names for the text files and the data files for
* building a shared library.
*/
#if SharedLibXView
SODIR = shared
SADIR = unshared
#endif
/*
* If your machine does not understand "..", then can define these to be
* an absolute path instead of relative paths.
*/
#if SharedLibXView
SHARED_DIR = $(TARGETDIR)xshared
UNSHARED_DIR = $(TARGETDIR)xunshared
XSTR_STRINGS_FILE = $(TARGETDIR)xstrings
#endif
/*
* Define the product name and release used in Imakefiles...
*/
#ifndef ProductNameAndRelease
#define ProductNameAndRelease "XView release 3.0"
#endif
/*
* Include the XView specific makefile macros.
*/
#include "XView.rules"
#endif /* XViewTmpl */
xvnews-2.3.2/config.h 100644 4246 12 14022 5675277666 13324 0 ustar graaff staff /*
* This file is provided for unrestricted use
* provided that this legend is included on all tape media
* and as a part of the software program in whole or part. Users
* may copy or modify this file without charge, but are not authorized to
* license or distribute it to anyone else except as part of a product
* or program developed by the user.
*
* THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* This file is provided with no support and without any obligation on the
* part of Resumix, Inc. to assist in its use, correction,
* modification or enhancement.
*
* Resumix, Inc. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE
* OR ANY PART THEREOF.
*
* In no event will Resumix, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even
* if Resumix has been advised of the possibility of such damages.
*
* Resumix, Inc.
*/
#ifndef XVNEWS_CONFIG_H
#define XVNEWS_CONFIG_H
/* This file contains the configurable options of xvnews, please make
the changes needed below.
*/
/* Sets the default company name. Can be overridden by setting $ORGANIZATION */
#define ORGANIZATION "The unconfigured xvnews people"
/* The default NNTP server to connect to. Can be overridden by setting $NNTPSERVER */
#define NNTPSERVER "news"
/* The domain to use. Sets everything after the @ sign for postings. Can be
overridden by setting $DOMAIN.
*/
#define DOMAIN "unconfigured.xvnews.domain"
/* The host to put in headers for the Path line.
*/
#define PATH_HOST ""
/* Some sites that use CNEWS don't want to show the user news groups that
* have the status 'x' or '=' as these groups are really not available.
*/
#define CNEWS_DONT_SHOW 1
/* ADD_SIGNATURE defines whether a signature should be added
One reason not to add a signature is if this is also done
by another part of the news system, e.g. if you are posting
through inews
*/
#define ADD_SIGNATURE 1
/* USE_INEWS_TO_POST defines whether inews is used to post.
Normally you would post through xvnews directly, but certain
characteristics of your news system (such as security measures)
might require you to post through a version of inews.
INEWS_PROGRAM indicates the inews program to use. Some people have
noted problems using NNTP's inews while running B News. If you have
posting problems you might look into this.
Also note that you need a version of inews which accepts
articles on stdin. C News's inews doesn't, for instance.
Finally, be warned that the output of inews is not parsed,
which means that problems with posting will go undetected.
*/
#undef USE_INEWS_TO_POST
#define INEWS_PROGRAM "inews -h"
/* MAIL_PROGRAM is the program used to deliver mail messages.
/usr/lib/sendmail -t is a good choice, and should work on most systems
However, sendmail doesn't deal with personal aliases (such as those
in a users .mailrc. Therefor some people prefer a different local
mail program such as /ucr/ucb/mail or /usr/bin/mail.
Any program which can deliver messages delivered on stdin including
the To: and From: headers will do just fine.
Note that most mail programs need a '-t' option to work this way,
so you would change this to "/usr/ucb/Mail -t" on SunOs 4.x.x.
*/
#define MAIL_PROGRAM "/usr/lib/sendmail -t"
/* COMPRESS_PROGRAM is the program which compresses your files,
usually this will be compress. On SunOS 4.x, use /usr/ucb/compress,
on SunOS 5.x, use /usr/bin/compress. You could also use gzip, but
then you should also change the extension below to "gz".
*/
#define COMPRESS_PROGRAM "compress"
#define COMPRESS_EXTENSION "Z"
/* The following two defines set the initial number of articles in a
newsgroup and the initial number of newsgroups. Xvnews will update
these numbers if there are more articles or newsgroups, which means
you *could* define both numbers to be 1. However, for performance
reasons you will want to allocate some space upfront. You should
set these numbers to something a bit above your average situation.
*/
#define INIT_NUM_ARTICLES 256
#define INIT_NUM_GROUPS 2048
/* The following define can be used to point to the default
locale. Normally you can leave this empty, and the default locale
will be used. */
#define DEFAULT_LOCALE ""
/* The biggest problem porting xvnews so far is the regular
expression code. Essentially, there are three different types
of routines for this. I have a string bias towards POSIX
specifications, so those routines (regcomp, regexec) are the
default. On both Solaris 1.x and Solaris 2.x, change this to
SVR4_REGEX. On other systems you might try first
to see whether POSIX is supported. */
#undef POSIX_REGEX
#define SVR4_REGEX
#undef BSD_REGEX
/* xvnews needs to know the timezone you are in in order to present dates
in your own time. Unfortunatly, getting the timezone is one of those
things that make writing portable code so hard, because each system has
a different method. xvnews knows about two different methods: using ftime,
and using the timezone variable. The latter method is default, and seems
to be most common on modern Unix systems, but this won't work on SunOS 4.
Only define USE_FTIME if you get compilation errors like
'timezone undefined'. */
/* #define USE_FTIME */
/* If you use an INN server, you can configure it to send a
password to request authorization to read and post.
Define the following to activate this. You will also add the
inn library to the Makefile.dist or Imakefile. */
#undef USE_NNRP_PASSWD
/* Some people prefer to keep the article window editable, for
various reasons. By default, this is not enabled, as it might
confuse less knowledgable readers. Defining this should allow
you to edit the article window when reading news. */
#undef KEEP_ARTICLE_EDITABLE
#endif /* XVNEWS_CONFIG_H */
xvnews-2.3.2/copyso.cursor 100644 4246 12 3715 5605024157 14422 0 ustar graaff staff /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
*/
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x001F,0xFFFF,0xFFFF,0xF800,
0x0017,0x0000,0x0001,0xE800,
0x0010,0xF000,0x000E,0x0800,
0x0010,0x0E00,0x0070,0x0800,
0x0010,0x01C0,0x0780,0x0800,
0x0010,0x003C,0x3800,0x0800,
0x0010,0x00E3,0xC000,0x0800,
0x0010,0x00F8,0x0000,0x0800,
0x0010,0x00FE,0x0000,0x0800,
0x0010,0x007F,0x8000,0x0800,
0x0010,0x007F,0x8000,0x0800,
0x0010,0x003E,0x3C00,0x0800,
0x0010,0x003F,0x7C00,0x0800,
0x0010,0x001B,0xDD00,0x0800,
0x0010,0x0019,0x9D00,0x0800,
0x0010,0x0003,0x1D00,0x0800,
0x0010,0x0006,0x1D00,0x0800,
0x0010,0x0007,0xFD00,0x0800,
0x0010,0x0007,0xFD00,0x0800,
0x0010,0x0007,0xFD00,0x0800,
0x0010,0x0000,0x0100,0x0800,
0x0010,0x0001,0xFF00,0x0800,
0x0010,0x0000,0x0000,0x0800,
0x001F,0xFFFF,0xFFFF,0xF800,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000
xvnews-2.3.2/getdate.y 100644 4246 12 30106 5641346552 13476 0 ustar graaff staff %token ID MONTH DAY MERIDIAN NUMBER UNIT MUNIT SUNIT ZONE DAYZONE AGO
%{
/* Steven M. Bellovin (unc!smb) */
/* Dept. of Computer Science */
/* University of North Carolina at Chapel Hill */
/* @(#)getdate.y 2.13 9/16/86 */
#include <sys/types.h>
#include <ctype.h>
#include <time.h>
#define daysec (24L*60L*60L)
static int timeflag, zoneflag, dateflag, dayflag, relflag;
static time_t relsec, relmonth;
static int hh, mm, ss, merid, daylight;
static int dayord, dayreq;
static int month, day, year;
static int ourzone;
#define AM 1
#define PM 2
#define DAYLIGHT 1
#define STANDARD 2
#define MAYBE 3
%}
%%
timedate: /* empty */
| timedate item;
item: tspec =
{timeflag++;}
| zone =
{zoneflag++;}
| dtspec =
{dateflag++;}
| dyspec =
{dayflag++;}
| rspec =
{relflag++;}
| nspec;
nspec: NUMBER =
{if (timeflag && dateflag && !relflag) year = $1;
else {timeflag++;hh = $1/100;mm = $1%100;ss = 0;merid = 24;}};
tspec: NUMBER MERIDIAN =
{hh = $1; mm = 0; ss = 0; merid = $2;}
| NUMBER ':' NUMBER =
{hh = $1; mm = $3; merid = 24;}
| NUMBER ':' NUMBER MERIDIAN =
{hh = $1; mm = $3; merid = $4;}
| NUMBER ':' NUMBER NUMBER =
{hh = $1; mm = $3; merid = 24;
daylight = STANDARD; ourzone = -($4%100 + 60*$4/100);}
| NUMBER ':' NUMBER ':' NUMBER =
{hh = $1; mm = $3; ss = $5; merid = 24;}
| NUMBER ':' NUMBER ':' NUMBER MERIDIAN =
{hh = $1; mm = $3; ss = $5; merid = $6;}
| NUMBER ':' NUMBER ':' NUMBER NUMBER =
{hh = $1; mm = $3; ss = $5; merid = 24;
daylight = STANDARD; ourzone = -($6%100 + 60*$6/100);};
zone: ZONE =
{ourzone = $1; daylight = STANDARD;}
| DAYZONE =
{ourzone = $1; daylight = DAYLIGHT;};
dyspec: DAY =
{dayord = 1; dayreq = $1;}
| DAY ',' =
{dayord = 1; dayreq = $1;}
| NUMBER DAY =
{dayord = $1; dayreq = $2;};
dtspec: NUMBER '/' NUMBER =
{month = $1; day = $3;}
| NUMBER '/' NUMBER '/' NUMBER =
{month = $1; day = $3; year = $5;}
| MONTH NUMBER =
{month = $1; day = $2;}
| MONTH NUMBER ',' NUMBER =
{month = $1; day = $2; year = $4;}
| NUMBER MONTH =
{month = $2; day = $1;}
| NUMBER MONTH NUMBER =
{month = $2; day = $1; year = $3;};
rspec: NUMBER UNIT =
{relsec += 60L * $1 * $2;}
| NUMBER MUNIT =
{relmonth += $1 * $2;}
| NUMBER SUNIT =
{relsec += $1;}
| UNIT =
{relsec += 60L * $1;}
| MUNIT =
{relmonth += $1;}
| SUNIT =
{relsec++;}
| rspec AGO =
{relsec = -relsec; relmonth = -relmonth;};
%%
static int mdays[12] =
{31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
#define epoch 1970
extern struct tm *localtime();
time_t dateconv(mm, dd, yy, h, m, s, mer, zone, dayflag)
int mm, dd, yy, h, m, s, mer, zone, dayflag;
{
time_t tod, jdate;
register int i;
time_t timeconv();
if (yy < 0) yy = -yy;
if (yy < 100) yy += 1900;
mdays[1] = 28 + (yy%4 == 0 && (yy%100 != 0 || yy%400 == 0));
if (yy < epoch || yy > 1999 || mm < 1 || mm > 12 ||
dd < 1 || dd > mdays[--mm]) return (-1);
jdate = dd-1;
for (i=0; i<mm; i++) jdate += mdays[i];
for (i = epoch; i < yy; i++) jdate += 365 + (i%4 == 0);
jdate *= daysec;
jdate += zone * 60L;
if ((tod = timeconv(h, m, s, mer)) < 0) return (-1);
jdate += tod;
if (dayflag==DAYLIGHT || (dayflag==MAYBE&&localtime(&jdate)->tm_isdst))
jdate += -1*60*60;
return (jdate);
}
time_t dayconv(ord, day, now) int ord, day; time_t now;
{
register struct tm *loctime;
time_t tod;
time_t daylcorr();
tod = now;
loctime = localtime(&tod);
tod += daysec * ((day - loctime->tm_wday + 7) % 7);
tod += 7*daysec*(ord<=0?ord:ord-1);
return daylcorr(tod, now);
}
time_t timeconv(hh, mm, ss, mer) register int hh, mm, ss, mer;
{
if (mm < 0 || mm > 59 || ss < 0 || ss > 59) return (-1);
switch (mer) {
case AM: if (hh < 1 || hh > 12) return(-1);
return (60L * ((hh%12)*60L + mm)+ss);
case PM: if (hh < 1 || hh > 12) return(-1);
return (60L * ((hh%12 +12)*60L + mm)+ss);
case 24: if (hh < 0 || hh > 23) return (-1);
return (60L * (hh*60L + mm)+ss);
default: return (-1);
}
}
time_t monthadd(sdate, relmonth) time_t sdate, relmonth;
{
struct tm *ltime;
time_t dateconv();
time_t daylcorr();
int mm, yy;
if (relmonth == 0) return 0;
ltime = localtime(&sdate);
mm = 12*ltime->tm_year + ltime->tm_mon + relmonth;
yy = mm/12;
mm = mm%12 + 1;
return daylcorr(dateconv(mm, ltime->tm_mday, yy, ltime->tm_hour,
ltime->tm_min, ltime->tm_sec, 24, ourzone, MAYBE), sdate);
}
time_t daylcorr(future, now) time_t future, now;
{
int fdayl, nowdayl;
nowdayl = (localtime(&now)->tm_hour+1) % 24;
fdayl = (localtime(&future)->tm_hour+1) % 24;
return (future-now) + 60L*60L*(nowdayl-fdayl);
}
static char *lptr;
yylex()
{
extern int yylval;
int sign;
register char c;
register char *p;
char idbuf[20];
int pcnt;
for (;;) {
while (isspace(*lptr)) lptr++;
if (isdigit(c = *lptr) || c == '-' || c == '+') {
if (c== '-' || c == '+') {
if (c=='-') sign = -1;
else sign = 1;
if (!isdigit(*++lptr)) {
/* yylval = sign; return (NUMBER); */
return yylex(); /* skip the '-' sign */
}
} else sign = 1;
yylval = 0;
while (isdigit(c = *lptr++)) yylval = 10*yylval + c - '0';
yylval *= sign;
lptr--;
return (NUMBER);
} else if (isalpha(c)) {
p = idbuf;
while (isalpha(c = *lptr++) || c=='.')
if (p < &idbuf[sizeof(idbuf)-1])
*p++ = c;
*p = '\0';
lptr--;
return (lookup(idbuf));
}
else if (c == '(') {
pcnt = 0;
do {
c = *lptr++;
if (c == '\0') return(c);
else if (c == '(') pcnt++;
else if (c == ')') pcnt--;
} while (pcnt > 0);
}
else return (*lptr++);
}
}
struct table {
char *name;
int type, value;
};
struct table mdtab[] = {
{"January", MONTH, 1},
{"February", MONTH, 2},
{"March", MONTH, 3},
{"April", MONTH, 4},
{"May", MONTH, 5},
{"June", MONTH, 6},
{"July", MONTH, 7},
{"August", MONTH, 8},
{"September", MONTH, 9},
{"Sept", MONTH, 9},
{"October", MONTH, 10},
{"November", MONTH, 11},
{"December", MONTH, 12},
{"Sunday", DAY, 0},
{"Monday", DAY, 1},
{"Tuesday", DAY, 2},
{"Tues", DAY, 2},
{"Wednesday", DAY, 3},
{"Wednes", DAY, 3},
{"Thursday", DAY, 4},
{"Thur", DAY, 4},
{"Thurs", DAY, 4},
{"Friday", DAY, 5},
{"Saturday", DAY, 6},
{0, 0, 0}};
#define HRS *60
#define HALFHR 30
struct table mztab[] = {
{"a.m.", MERIDIAN, AM},
{"am", MERIDIAN, AM},
{"p.m.", MERIDIAN, PM},
{"pm", MERIDIAN, PM},
{"nst", ZONE, 3 HRS + HALFHR}, /* Newfoundland */
{"n.s.t.", ZONE, 3 HRS + HALFHR},
{"ast", ZONE, 4 HRS}, /* Atlantic */
{"a.s.t.", ZONE, 4 HRS},
{"adt", DAYZONE, 4 HRS},
{"a.d.t.", DAYZONE, 4 HRS},
{"est", ZONE, 5 HRS}, /* Eastern */
{"e.s.t.", ZONE, 5 HRS},
{"edt", DAYZONE, 5 HRS},
{"e.d.t.", DAYZONE, 5 HRS},
{"cst", ZONE, 6 HRS}, /* Central */
{"c.s.t.", ZONE, 6 HRS},
{"cdt", DAYZONE, 6 HRS},
{"c.d.t.", DAYZONE, 6 HRS},
{"mst", ZONE, 7 HRS}, /* Mountain */
{"m.s.t.", ZONE, 7 HRS},
{"mdt", DAYZONE, 7 HRS},
{"m.d.t.", DAYZONE, 7 HRS},
{"pst", ZONE, 8 HRS}, /* Pacific */
{"p.s.t.", ZONE, 8 HRS},
{"pdt", DAYZONE, 8 HRS},
{"p.d.t.", DAYZONE, 8 HRS},
{"yst", ZONE, 9 HRS}, /* Yukon */
{"y.s.t.", ZONE, 9 HRS},
{"ydt", DAYZONE, 9 HRS},
{"y.d.t.", DAYZONE, 9 HRS},
{"hst", ZONE, 10 HRS}, /* Hawaii */
{"h.s.t.", ZONE, 10 HRS},
{"hdt", DAYZONE, 10 HRS},
{"h.d.t.", DAYZONE, 10 HRS},
{"gmt", ZONE, 0 HRS},
{"g.m.t.", ZONE, 0 HRS},
{"bst", DAYZONE, 0 HRS}, /* British Summer Time */
{"b.s.t.", DAYZONE, 0 HRS},
{"eet", ZONE, 0 HRS}, /* European Eastern Time */
{"e.e.t.", ZONE, 0 HRS},
{"eest", DAYZONE, 0 HRS}, /* European Eastern Summer Time */
{"e.e.s.t.", DAYZONE, 0 HRS},
{"met", ZONE, -1 HRS}, /* Middle European Time */
{"m.e.t.", ZONE, -1 HRS},
{"mest", DAYZONE, -1 HRS}, /* Middle European Summer Time */
{"m.e.s.t.", DAYZONE, -1 HRS},
{"wet", ZONE, -2 HRS }, /* Western European Time */
{"w.e.t.", ZONE, -2 HRS },
{"west", DAYZONE, -2 HRS}, /* Western European Summer Time */
{"w.e.s.t.", DAYZONE, -2 HRS},
{"jst", ZONE, -9 HRS}, /* Japan Standard Time */
{"j.s.t.", ZONE, -9 HRS}, /* Japan Standard Time */
/* No daylight savings time */
{"aest", ZONE, -10 HRS}, /* Australian Eastern Time */
{"a.e.s.t.", ZONE, -10 HRS},
{"aesst", DAYZONE, -10 HRS}, /* Australian Eastern Summer Time */
{"a.e.s.s.t.", DAYZONE, -10 HRS},
{"acst", ZONE, -(9 HRS + HALFHR)}, /* Australian Central Time */
{"a.c.s.t.", ZONE, -(9 HRS + HALFHR)},
{"acsst", DAYZONE, -(9 HRS + HALFHR)}, /* Australian Central Summer */
{"a.c.s.s.t.", DAYZONE, -(9 HRS + HALFHR)},
{"awst", ZONE, -8 HRS}, /* Australian Western Time */
{"a.w.s.t.", ZONE, -8 HRS}, /* (no daylight time there, I'm told */
{0, 0, 0}};
struct table unittb[] = {
{"year", MUNIT, 12},
{"month", MUNIT, 1},
{"fortnight", UNIT, 14*24*60},
{"week", UNIT, 7*24*60},
{"day", UNIT, 1*24*60},
{"hour", UNIT, 60},
{"minute", UNIT, 1},
{"min", UNIT, 1},
{"second", SUNIT, 1},
{"sec", SUNIT, 1},
{0, 0, 0}};
struct table othertb[] = {
{"tomorrow", UNIT, 1*24*60},
{"yesterday", UNIT, -1*24*60},
{"today", UNIT, 0},
{"now", UNIT, 0},
{"last", NUMBER, -1},
{"this", UNIT, 0},
{"next", NUMBER, 2},
{"first", NUMBER, 1},
/* {"second", NUMBER, 2}, */
{"third", NUMBER, 3},
{"fourth", NUMBER, 4},
{"fifth", NUMBER, 5},
{"sixth", NUMBER, 6},
{"seventh", NUMBER, 7},
{"eigth", NUMBER, 8},
{"ninth", NUMBER, 9},
{"tenth", NUMBER, 10},
{"eleventh", NUMBER, 11},
{"twelfth", NUMBER, 12},
{"ago", AGO, 1},
{0, 0, 0}};
struct table milzone[] = {
{"a", ZONE, 1 HRS},
{"b", ZONE, 2 HRS},
{"c", ZONE, 3 HRS},
{"d", ZONE, 4 HRS},
{"e", ZONE, 5 HRS},
{"f", ZONE, 6 HRS},
{"g", ZONE, 7 HRS},
{"h", ZONE, 8 HRS},
{"i", ZONE, 9 HRS},
{"k", ZONE, 10 HRS},
{"l", ZONE, 11 HRS},
{"m", ZONE, 12 HRS},
{"n", ZONE, -1 HRS},
{"o", ZONE, -2 HRS},
{"p", ZONE, -3 HRS},
{"q", ZONE, -4 HRS},
{"r", ZONE, -5 HRS},
{"s", ZONE, -6 HRS},
{"t", ZONE, -7 HRS},
{"u", ZONE, -8 HRS},
{"v", ZONE, -9 HRS},
{"w", ZONE, -10 HRS},
{"x", ZONE, -11 HRS},
{"y", ZONE, -12 HRS},
{"z", ZONE, 0 HRS},
{0, 0, 0}};
lookup(id) char *id;
{
#define gotit (yylval=i->value, i->type)
#define getid for(j=idvar, k=id; *j++ = *k++; )
char idvar[20];
register char *j, *k;
register struct table *i;
int abbrev;
getid;
if (strlen(idvar) == 3) abbrev = 1;
else if (strlen(idvar) == 4 && idvar[3] == '.') {
abbrev = 1;
idvar[3] = '\0';
}
else abbrev = 0;
if (islower(*idvar)) *idvar = toupper(*idvar);
for (i = mdtab; i->name; i++) {
k = idvar;
for (j = i->name; *j++ == *k++;) {
if (abbrev && j==i->name+3) return gotit;
if (j[-1] == 0) return gotit;
}
}
getid;
for (i = mztab; i->name; i++)
if (strcmp(i->name, idvar) == 0) return gotit;
for (j = idvar; *j; j++)
if (isupper(*j)) *j = tolower(*j);
for (i=mztab; i->name; i++)
if (strcmp(i->name, idvar) == 0) return gotit;
getid;
for (i=unittb; i->name; i++)
if (strcmp(i->name, idvar) == 0) return gotit;
if (idvar[strlen(idvar)-1] == 's')
idvar[strlen(idvar)-1] = '\0';
for (i=unittb; i->name; i++)
if (strcmp(i->name, idvar) == 0) return gotit;
getid;
for (i = othertb; i->name; i++)
if (strcmp(i->name, idvar) == 0) return gotit;
getid;
if (strlen(idvar) == 1 && isalpha(*idvar)) {
if (isupper(*idvar)) *idvar = tolower(*idvar);
for (i = milzone; i->name; i++)
if (strcmp(i->name, idvar) == 0) return gotit;
}
return(ID);
}
time_t get_date(p, now, zone) char *p; time_t now; long zone;
{
#define mcheck(f) if (f>1) err++
time_t monthadd();
int err;
struct tm *lt;
time_t sdate, tod;
lptr = p;
if (now <= 0)
(void) time(&now);
lt = localtime(&now);
year = lt->tm_year;
month = lt->tm_mon+1;
day = lt->tm_mday;
relsec = 0; relmonth = 0;
timeflag=zoneflag=dateflag=dayflag=relflag=0;
daylight = MAYBE;
hh = mm = ss = 0;
merid = 24;
ourzone = zone;
if (err = yyparse()) return (-1);
mcheck(timeflag);
mcheck(zoneflag);
mcheck(dateflag);
mcheck(dayflag);
if (err) return (-1);
if (dateflag || timeflag || dayflag) {
sdate = dateconv(month,day,year,hh,mm,ss,merid,ourzone,daylight);
if (sdate < 0) return -1;
}
else {
sdate = now;
if (relflag == 0)
sdate -= (lt->tm_sec + lt->tm_min*60 +
lt->tm_hour*(60L*60L));
}
sdate += relsec;
sdate += monthadd(sdate, relmonth);
if (dayflag && !dateflag) {
tod = dayconv(dayord, dayreq, sdate);
sdate += tod;
}
return sdate;
}
yyerror(s) char *s;
{}
xvnews-2.3.2/guide/ 40755 4246 12 0 5766270473 12655 5 ustar graaff staff xvnews-2.3.2/guide/libguide/ 40755 4246 12 0 5766270476 14444 5 ustar graaff staff xvnews-2.3.2/guide/libguide/Imakefile 100644 4246 12 467 5606465774 16341 0 ustar graaff staff #include <Library.tmpl>
INCLUDES = -I..
HEADERS = gio.h guide.h guide_actions.h
SRCS = gio.c guide.c guide_actions.c gio_path.c
OBJS = gio.o guide.o guide_actions.o gio_path.o
NormalLibraryTarget(guide,$(OBJS))
InstallLibrary(guide,$(USRLIBDIR))
BuildIncludes($(HEADERS),$(HEADER_DEST),..)
DependTarget()
xvnews-2.3.2/guide/libguide/Makefile.dist 100644 4246 12 4775 5606466014 17144 0 ustar graaff staff #
# @(#)Makefile 2.4 91/08/14 Copyright 1990 Sun Microsystems
#
# This file is a product of Sun Microsystems, Inc. and is provided for
# unrestricted use provided that this legend is included on all tape
# media and as a part of the software program in whole or part. Users
# may copy or modify this file without charge, but are not authorized to
# license or distribute it to anyone else except as part of a product
# or program developed by the user.
#
# THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
# WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
# PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
#
# This file is provided with no support and without any obligation on the
# part of Sun Microsystems, Inc. to assist in its use, correction,
# modification or enhancement.
#
# SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
# INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE
# OR ANY PART THEREOF.
#
# In no event will Sun Microsystems, Inc. be liable for any lost revenue
# or profits or other special, indirect and consequential damages, even
# if Sun has been advised of the possibility of such damages.
#
# Sun Microsystems, Inc.
# 2550 Garcia Avenue
# Mountain View, California 94043
#
SOURCES.c = \
guide.c \
gio.c \
gio_path.c \
guide_actions.c
SOURCES.h = \
guide.h \
gio.h \
guide_actions.h
SOURCES = \
$(SOURCES.G) \
$(SOURCES.h) \
$(SOURCES.c)
TARGETS.c = \
$(SOURCES.G:%.G=%_ui.c) \
$(STUBS.G:%.G=%_stubs.c)
TARGETS.h = \
$(SOURCES.G:%.G=%_ui.h) \
$(SOURCES.l:%.l=%.h) \
$(SOURCES.y:%.y=%.h)
TARGETS.other = \
$(SOURCES.G:%.G=%.info)
TARGETS = \
$(TARGETS.other) \
$(TARGETS.h) \
$(TARGETS.c)
OBJECTS = \
$(SOURCES.c:%.c=%.o) \
$(TARGETS.c:%.c=%.o)
LIBRARY = libguide.a
PROJECTDIR = ..
DESTDIR = $(PROJECTDIR)
# Compiler flags.
CPPFLAGS += -O -I. -I$(OPENWINHOME)/include -I..
# Make information.
# Standard targets.
all: $(SOURCES) $(TARGETS) $(LIBRARY) $(PROGRAM)
objects: $(SOURCES.c) $(TARGETS.c) $(TARGETS.h) $(OBJECTS)
sources: $(SOURCES)
targets: $(SOURCES) $(TARGETS)
$(LIBRARY): $(LIBRARY)($(OBJECTS))
ar rv $@ $?
${RANLIB} $@
rm -f $?
cp libguide.a ..
$(LIBRARY)(%.o): %.c
$(COMPILE.c) $<
install: all
@-sccs check
install -d $(DESTDIR)/etc
install -m 444 $(TARGETS.other) $(DESTDIR)/etc
install -d $(DESTDIR)/lib
install -m 664 $(LIBRARY) $(DESTDIR)/lib
(cd $(DESTDIR)/lib ; ranlib -t $(LIBRARY) ; chmod 444 $(LIBRARY))
clean:
$(RM) $(OBJECTS) core libguide.a
xvnews-2.3.2/guide/libguide/gio.c 100644 4246 12 57454 5605024170 15476 0 ustar graaff staff /*
* This file is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify this file without charge, but are not authorized to
* license or distribute it to anyone else except as part of a product
* or program developed by the user.
*
* THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* This file is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even
* if Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
#ifndef lint
static char sccsid[] = "@(#)gio.c 2.28 91/08/26 Copyright 1989 Sun Microsystems";
#endif
/*
* GUIDE Intermediate Language (GIL) file input / output interface.
*
* This file implements the functions required to read and write GIL
* files. The GIL syntax is based on Lisp so that they may be read
* directly into a Lisp or Scheme interpreter.
*
* Many of these functions return a string to indicate the begin or
* end of a special sequence in the GIL syntax, for example, a list.
* Internally it is common to only use the first character returned.
* I did it this way so the functions are consistent and to allow
* for flexibility in the future.
*/
#include <stdio.h>
#include <ctype.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <malloc.h>
#include "guide.h"
#include "gio.h"
/*
* Delimiter for a full name.
*/
#define DELIMITER ':'
/*
* File pointers.
*/
static FILE *Inp = stdin;
static FILE *Outp = stdout;
/*
* Internal state variables.
*/
static char Indent[12]; /* indent string */
static int Indent_level;
static int Newline = TRUE; /* TRUE if on new output line */
static char Buf[MAXPATHLEN]; /* work buffer */
/*
* System error message definitions.
*/
extern int sys_nerr;
extern char *sys_errlist[];
/*
* Internal function declarations.
*/
static int gil_version();
static void skip_comments();
static char *get_token();
/*
* Return the string representation of a boolean.
*/
char *
#ifdef __STDC__
gio_boolean_string(int b)
#else
gio_boolean_string(b)
int b;
#endif
{
return b ? gio_true_string() : gio_false_string();
}
/*
* Close the input file.
*/
void
gio_close_input()
{
if (Inp != stdin)
{
fclose(Inp);
Inp = stdin;
}
}
/*
* Close the output file.
*/
void
gio_close_output()
{
if (Outp != stdout)
{
fflush(Outp);
ftruncate(fileno(Outp), ftell(Outp));
fclose(Outp);
Outp = stdout;
}
}
/*
* Return the comment string.
*/
char *
gio_comment_string()
{
return ";";
}
/*
* Return the boolean false string.
*/
char *
gio_false_string()
{
return "nil";
}
/*
* Return the file begin string.
*/
char *
gio_file_begin_string()
{
return "(";
}
/*
* Return the file end string.
*/
char *
gio_file_end_string()
{
return ")";
}
/*
* Get a boolean from the input file. Returns TRUE if successful.
*/
int
#ifdef __STDC__
gio_get_boolean(int *b)
#else
gio_get_boolean(b)
int *b;
#endif
{
char *p = get_token();
if (strcmp(p, gio_true_string()) == 0)
{
*b = TRUE;
return TRUE;
}
if (strcmp(p, gio_false_string()) == 0)
{
*b = FALSE;
return TRUE;
}
return FALSE;
}
/*
* Return whether we are at end-of-file.
*/
int
gio_get_eof()
{
int ch;
while (isspace(ch = fgetc(Inp)))
;
if (ch == EOF)
return TRUE;
ungetc(ch, Inp);
return FALSE;
}
/*
* Get the start of the file. Returns TRUE if successful.
*/
int
gio_get_file_begin()
{
int ch;
while (isspace(ch = fgetc(Inp)))
;
if (ch == *gio_file_begin_string())
return TRUE;
ungetc(ch, Inp);
return FALSE;
}
/*
* Get the end of the file. Returns TRUE if successful.
*/
int
gio_get_file_end()
{
int ch;
while (isspace(ch = fgetc(Inp)))
;
if (ch == *gio_file_end_string())
return TRUE;
ungetc(ch, Inp);
return FALSE;
}
/*
* Get a handler from the input file. Returns TRUE if successful.
* Sets the string pointer to a buffer allocated with malloc if the string
* is not empty, otherwise NULL. Handler could be a quoted string
* for special language cases (PostScript, Lisp, etc...) or just
* a simple name for C.
*/
int
#ifdef __STDC__
gio_get_handler(char **s)
#else
gio_get_handler(s)
char **s;
#endif
{
#define INC 32
int ch;
int lth; /* string length */
int c = 0; /* string count */
while (isspace(ch = fgetc(Inp)))
;
ungetc(ch, Inp);
if (ch != *gio_string_begin_string())
return gio_get_name(s);
else
{
*s = malloc(lth = INC);
*s[c++] = fgetc(Inp);
while (((ch = fgetc(Inp)) != EOF) &&
(ch != *gio_string_end_string()))
{
if (c + 2 == lth)
*s = realloc(*s, lth += INC);
if (ch == '\\')
ch = fgetc(Inp);
(*s)[c++] = (char) ch;
}
(*s)[c] = *gio_string_end_string();
(*s)[c+1] = '\0';
return TRUE;
}
#undef INC
}
/*
* Get an integer from the input file. Returns TRUE if successful.
*/
int
#ifdef __STDC__
gio_get_integer(int *i)
#else
gio_get_integer(i)
int *i;
#endif
{
char *p = get_token();
char *q;
long l = strtol(p, &q, 10);
if (p != q)
{
*i = (int) l;
return TRUE;
}
return FALSE;
}
/*
* Get a keyword from the input file. Returns TRUE if successful.
* The keyword is returned in a static buffer.
*/
int
#ifdef __STDC__
gio_get_keyword(char **s)
#else
gio_get_keyword(s)
char **s;
#endif
{
*s = get_token();
return TRUE;
}
/*
* Get a list as a string from the input file. Returns TRUE if successful.
* Sets the string pointer to a buffer allocated with malloc if the string
* is not empty, otherwise NULL.
*/
int
#ifdef __STDC__
gio_get_list(char **s)
#else
gio_get_list(s)
char **s;
#endif
{
#define INC 32
int ch;
int lth; /* string length */
int c; /* string count */
while (isspace(ch = fgetc(Inp)))
;
if (ch != *gio_list_begin_string())
{
ungetc(ch, Inp);
return FALSE;
}
if (gio_get_list_end())
{
*s = NULL;
return TRUE;
}
*s = malloc(lth = INC);
for (c = 0; (ch = fgetc(Inp)) != *gio_list_end_string(); c++)
{
if (c + 1 == lth)
*s = realloc(*s, lth += INC);
if (ch == '\\')
ch = fgetc(Inp);
(*s)[c] = (char) ch;
}
(*s)[c] = '\0';
return TRUE;
#undef INC
}
/*
* Get the start of a list from the input file. Returns TRUE if successful.
*/
int
gio_get_list_begin()
{
int ch;
while (isspace(ch = fgetc(Inp)))
;
if (ch == *gio_list_begin_string())
return TRUE;
ungetc(ch, Inp);
return FALSE;
}
/*
* Get the end of a list from the input file. Returns TRUE if successful.
*/
int
gio_get_list_end()
{
int ch;
while (isspace(ch = fgetc(Inp)))
;
if (ch == *gio_list_end_string())
return TRUE;
ungetc(ch, Inp);
return FALSE;
}
/*
* Get a symbol from the input file. Returns TRUE if successful.
* Sets the string pointer to a buffer allocated with malloc if the string
* is not empty, otherwise NULL.
*/
int
#ifdef __STDC__
gio_get_name(char **s)
#else
gio_get_name(s)
char **s;
#endif
{
char *p = get_token();
if (strcmp(p, gio_false_string()) == 0)
*s = NULL;
else {
*s = malloc(strlen(p) + 1);
strcpy(*s, p);
}
return TRUE;
}
/*
* Get the full name of an object in a gil file.
* The syntax of a full name is:
* (name) when the object is top-level;
* (parent name) when the object is not top-level;
* (parent name "item") when the object is a setting or
* menu item.
*/
int
#ifdef __STDC__
gio_get_full_name(char **parent, char **name, char **item)
#else
gio_get_full_name(parent, name, item)
char **parent;
char **name;
char **item;
#endif
{
char *tmp1, *tmp2;
*parent = NULL;
*name = NULL;
*item = NULL;
if (!gio_get_list_begin())
return FALSE;
if (!gio_get_name(&tmp1))
return FALSE;
if (gio_get_list_end())
{
*name = (char *)malloc(strlen(tmp1)+1);
strcpy(*name, tmp1);
return TRUE;
}
if (gio_get_string(&tmp2))
{
*name = (char *)malloc(strlen(tmp1)+1);
*item = (char *)malloc(strlen(tmp2)+1);
strcpy(*name, tmp1);
strcpy(*item, tmp2);
if (!gio_get_list_end())
return FALSE;
return TRUE;
}
*parent = (char *)malloc(strlen(tmp1)+1);
strcpy(*parent, tmp1);
free(tmp1);
if (gio_get_name(&tmp1))
{
*name = (char *)malloc(strlen(tmp1)+1);
if (!gio_get_list_end())
if (gio_get_string(&tmp2))
{
*item = (char *)malloc(strlen(tmp2)+1);
strcpy(*name, tmp1);
strcpy(*item, tmp2);
if (gio_get_list_end())
return TRUE;
return FALSE;
}
strcpy(*name, tmp1);
return TRUE;
}
return FALSE;
}
/*
* Get the full name of an object in a project file.
* The syntax of a full name is:
* interface:name when the object is top-level;
* interface:parent:name when the object is not top-level;
* interface:parent:name:"item" when the object is a setting or
* menu item.
*/
int
#ifdef __STDC__
gio_get_proj_full_name(char **interface, char **parent,
char **name, char **item)
#else
gio_get_proj_full_name(interface, parent, name, item)
char **interface;
char **parent;
char **name;
char **item;
#endif
{
char *tmp1, *tmp2;
*interface = NULL;
*parent = NULL;
*name = NULL;
*item = NULL;
if (!gio_get_list_begin())
return FALSE;
if (!gio_get_name(&tmp1))
return FALSE;
*interface = (char *)malloc(strlen(tmp1)+1);
strcpy(*interface, tmp1);
free(tmp1);
if (!gio_get_name(&tmp1))
return FALSE;
if (gio_get_list_end())
{
*name = (char *)malloc(strlen(tmp1)+1);
strcpy(*name, tmp1);
return TRUE;
}
if (gio_get_string(&tmp2))
{
*name = (char *)malloc(strlen(tmp1)+1);
*item = (char *)malloc(strlen(tmp2)+1);
strcpy(*name, tmp1);
strcpy(*item, tmp2);
if (!gio_get_list_end())
return FALSE;
return TRUE;
}
*parent = (char *)malloc(strlen(tmp1)+1);
strcpy(*parent, tmp1);
free(tmp1);
if (gio_get_name(&tmp1))
{
*name = (char *)malloc(strlen(tmp1)+1);
if (!gio_get_list_end())
if (gio_get_string(&tmp2))
{
*item = (char *)malloc(strlen(tmp2)+1);
strcpy(*name, tmp1);
strcpy(*item, tmp2);
if (gio_get_list_end())
return TRUE;
return FALSE;
}
strcpy(*name, tmp1);
return TRUE;
}
return FALSE;
}
/*
* Get the start of an object from the input file. Returns TRUE if successful.
*/
int
gio_get_object_begin()
{
int ch;
while (isspace(ch = fgetc(Inp)))
;
if (ch == *gio_object_begin_string())
return TRUE;
ungetc(ch, Inp);
return FALSE;
}
/*
* Get the end of an object from the input file. Returns TRUE if successful.
*/
int
gio_get_object_end()
{
int ch;
while (isspace(ch = fgetc(Inp)))
;
if (ch == *gio_object_end_string())
return TRUE;
ungetc(ch, Inp);
return FALSE;
}
/*
* Get a string from the input file. Returns TRUE if successful.
* Sets the string pointer to a buffer allocated with malloc if the string
* is not empty, otherwise NULL.
*/
int
#ifdef __STDC__
gio_get_string(char **s)
#else
gio_get_string(s)
char **s;
#endif
{
#define INC 32
int ch;
int lth; /* string length */
int c = 0; /* string count */
while (isspace(ch = fgetc(Inp)))
;
if (ch != *gio_string_begin_string())
{
ungetc(ch, Inp);
return FALSE;
}
if (gio_get_string_end())
{
*s = NULL;
return TRUE;
}
*s = malloc(lth = INC);
while (((ch = fgetc(Inp)) != EOF) && (ch != *gio_string_end_string()))
{
if (c + 1 == lth)
*s = realloc(*s, lth += INC);
if (ch == '\\')
ch = fgetc(Inp);
(*s)[c++] = (char) ch;
}
(*s)[c] = '\0';
return TRUE;
#undef INC
}
/*
* Get the start of a string from the input file. Returns TRUE if successful.
*/
int
gio_get_string_begin()
{
int ch;
while (isspace(ch = fgetc(Inp)))
;
if (ch == *gio_string_begin_string())
return TRUE;
ungetc(ch, Inp);
return FALSE;
}
/*
* Get the end of a string from the input file. Returns TRUE if successful.
*/
int
gio_get_string_end()
{
int ch;
if ((ch = fgetc(Inp)) == *gio_string_end_string())
return TRUE;
ungetc(ch, Inp);
return FALSE;
}
/*
* Write an integer to the output file.
*/
char *
#ifdef __STDC__
gio_integer_string(int i)
#else
gio_integer_string(i)
int i;
#endif
{
sprintf(Buf, "%d", i);
return Buf;
}
/*
* Return the string representation of a keyword.
*/
char *
#ifdef __STDC__
gio_keyword_string(char *s)
#else
gio_keyword_string(s)
char *s;
#endif
{
return s;
}
/*
* Return the list begin string.
*/
char *
gio_list_begin_string()
{
return "(";
}
/*
* Return the list end string.
*/
char *
gio_list_end_string()
{
return ")";
}
/*
* Return the string representation of a name.
*/
char *
#ifdef __STDC__
gio_name_string(char *s)
#else
gio_name_string(s)
char *s;
#endif
{
return s ? s : gio_false_string();
}
/*
* Return the object begin string.
*/
char *
gio_object_begin_string()
{
return "(";
}
/*
* Return the object end string.
*/
char *
gio_object_end_string()
{
return ")";
}
/*
* Open an input file. Returns NULL if successful, otherwise an error
* message.
*/
char *
#ifdef __STDC__
gio_open_gil_input(char *name)
#else
gio_open_gil_input(name)
char *name;
#endif
{
int v;
char *errmsg;
/*
* If the input file exists and is the correct version, open it
* and skip leading comments.
*/
if (Inp = fopen(name, "r"))
{
v = gil_version(Inp);
if ((v != 0) && (v <= G_VERSION))
{
skip_comments(Inp);
return NULL;
}
else
errmsg = "unrecognized file format"; /* No dgettext() wrapper on purpose */
}
else
errmsg = sys_errlist[errno];
/*
* Otherwise, return an error message.
*/
sprintf(Buf, "%s: %s", name, errmsg);
return Buf;
}
/*
* Open an output file. Returns NULL if successful, otherwise an error
* message.
*/
char *
#ifdef __STDC__
gio_open_gil_output(char *outfile)
#else
gio_open_gil_output(outfile)
char *outfile;
#endif
{
struct stat statbuf;
int version_written = FALSE;
/*
* Look for the specified output file.
*/
if (stat(outfile, &statbuf) != OK)
{
/* Output file does not exits. Open a new one.
*/
if (Outp = fopen(outfile, "w"))
{
/* First line is the version number.
*/
fprintf(Outp, "%s%d\n", G_VERSION_PREFIX, G_VERSION);
return NULL;
}
else
goto ERROR_EXIT;
}
/*
* The output file exists. Make sure we can successfully open it
* before backing it up.
*/
if (Outp = fopen(outfile, "a"))
{
char backup[MAXPATHLEN];
FILE *bakp = NULL;
char *comment = gio_comment_string();
int len = strlen(comment);
/*
* Rename existing file to a backup and start a new output file.
*/
fclose(Outp);
sprintf(backup, "%s.BAK", outfile);
if ((rename(outfile, backup) != OK) ||
!(bakp = fopen(backup, "r")) ||
!(Outp = fopen(outfile, "w")))
goto ERROR_EXIT; /* file access error */
/*
* Ignore any unrelated leading text until first comment (eg.
* garbage from mailtool).
*/
while (fgets(Buf, sizeof (Buf), bakp) &&
strncmp(Buf, comment, len) != 0)
;
/*
* Preserve any comments.
*/
do
{
if (!version_written)
{
/* First comment is always version number.
*/
fprintf(Outp, "%s%d\n",
G_VERSION_PREFIX,
G_VERSION);
version_written = TRUE;
}
else
fputs(Buf, Outp);
}
while (fgets(Buf, sizeof (Buf), bakp) &&
strncmp(Buf, comment, len) == 0);
fclose(bakp);
return NULL;
}
ERROR_EXIT:
/*
* Return a message if unsuccessful.
*/
sprintf(Buf, "%s: %s", outfile, sys_errlist[errno]);
return Buf;
}
/*
* Open an input proj file. Returns NULL if successful, otherwise an error
* message.
*/
char *
#ifdef __STDC__
gio_open_proj_input(char *name)
#else
gio_open_proj_input(name)
char *name;
#endif
{
return gio_open_gil_input(name);
}
/*
* Open an output proj file. Returns NULL if successful, otherwise an error
* message.
*/
char *
#ifdef __STDC__
gio_open_proj_output(char *name)
#else
gio_open_proj_output(name)
char *name;
#endif
{
return gio_open_gil_output(name);
}
/*
* Open an input resource file. Returns NULL is successful, otherwise
* an error message.
*/
char *
#ifdef __STDC__
gio_open_resfile_input(char *name)
#else
gio_open_resfile_input(name)
char *name;
#endif
{
return gio_open_gil_input(name);
}
/*
* Open an output file. Returns NULL if successful, otherwise an error
* message.
*/
char *
#ifdef __STDC__
gio_open_output(char *name)
#else
gio_open_output(name)
char *name;
#endif
{
if (Outp = fopen(name, "w"))
return NULL;
sprintf(Buf, "%s: %s", name, sys_errlist[errno]);
return Buf;
}
/*
* fprintf to the current output file.
*/
#ifdef __STDC__
void
gio_printf(char *fmt, ...)
#else
void
gio_printf(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
va_list args;
if (Newline)
fputs(Indent, Outp);
#ifdef __STDC__
va_start(args, fmt);
#else
va_start(args);
#endif
Newline = fmt[strlen(fmt) - 1] == '\n';
vfprintf(Outp, fmt, args);
va_end(args);
}
/*
* Write a character to the output file, preceeded by the indent string if we
* are on a new line.
*/
void
#ifdef __STDC__
gio_putc(char c)
#else
gio_putc(c)
char c;
#endif
{
if (Newline)
fputs(Indent, Outp);
fputc(c, Outp);
Newline = c == '\n';
}
/*
* Write characters to the output file, preceeded by the indent string if we
* are on a new line.
*/
void
#ifdef __STDC__
gio_puts(char *s)
#else
gio_puts(s)
char *s;
#endif
{
if (Newline)
fputs(Indent, Outp);
fputs(s, Outp);
Newline = s[strlen(s) - 1] == '\n';
}
/*
* Write a boolean to the output file.
*/
void
#ifdef __STDC__
gio_put_boolean(int b)
#else
gio_put_boolean(b)
int b;
#endif
{
gio_puts(b ? gio_true_string() : gio_false_string());
}
/*
* Write an integer to the output file.
*/
void
#ifdef __STDC__
gio_put_float(double d)
#else
gio_put_float(d)
double d;
#endif
{
sprintf(Buf, "%f", d);
gio_puts(Buf);
}
/*
* Write an integer to the output file.
*/
void
#ifdef __STDC__
gio_put_integer(int i)
#else
gio_put_integer(i)
int i;
#endif
{
sprintf(Buf, "%d", i);
gio_puts(Buf);
}
/*
* Write a keyword to the output file.
*/
void
#ifdef __STDC__
gio_put_keyword(char *s)
#else
gio_put_keyword(s)
char *s;
#endif
{
gio_puts(s);
}
/*
* Write a handler to the output file.
*/
void
#ifdef __STDC__
gio_put_handler(char *s)
#else
gio_put_handler(s)
char *s;
#endif
{
char *newstr;
char *p;
if (s && (s[0] == *gio_string_begin_string()) &&
(s[strlen(s)-1] == *gio_string_end_string())) {
newstr = malloc(strlen(s) + 1);
strcpy(newstr, s);
newstr[strlen(s)-1] = '\0';
fputc(*gio_string_begin_string(), Outp);
for (p = newstr+1; *p; p++) {
if ((*p == *gio_string_end_string()) || (*p == '\\'))
fputc('\\', Outp);
fputc(*p, Outp);
}
fputc(*gio_string_end_string(), Outp);
free(newstr);
} else
gio_put_name(s);
}
/*
* Write a name list to the output file.
*/
void
#ifdef __STDC__
gio_put_name(char *s)
#else
gio_put_name(s)
char *s;
#endif
{
gio_puts(s ? s : gio_false_string());
}
/*
* Write a full name to the output file.
*/
void
#ifdef __STDC__
gio_put_full_name(char *parent, char *name, char *item)
#else
gio_put_full_name(parent, name, item)
char *parent;
char *name;
char *item;
#endif
{
gio_puts(gio_list_begin_string());
if (parent)
{
gio_puts(parent);
gio_putc(' ');
}
if (name)
{
gio_puts(name);
}
if (item)
{
gio_putc(' ');
gio_put_string(item);
}
gio_puts(gio_list_end_string());
gio_putc('\n');
}
/*
* Write a full name (the project form) to the output file.
*/
void
#ifdef __STDC__
gio_put_proj_full_name(char *interface, char *parent, char *name, char *item)
#else
gio_put_proj_full_name(interface, parent, name, item)
char *interface;
char *parent;
char *name;
char *item;
#endif
{
gio_puts(gio_list_begin_string());
if (interface)
{
gio_puts(interface);
gio_putc(' ');
}
if (parent)
{
gio_puts(parent);
gio_putc(' ');
}
if (name)
{
gio_puts(name);
}
if (item)
{
gio_putc(' ');
gio_put_string(item);
}
gio_puts(gio_list_end_string());
gio_putc('\n');
}
/*
* Write a string to the output file.
*/
void
#ifdef __STDC__
gio_put_string(char *s)
#else
gio_put_string(s)
char *s;
#endif
{
gio_puts(gio_string_begin_string());
gio_put_string_to_file(s);
gio_puts(gio_string_end_string());
}
/*
* Write a string to the output file.
*/
void
#ifdef __STDC__
gio_put_string_to_file(char *s)
#else
gio_put_string_to_file(s)
char *s;
#endif
{
register char *p;
if (s)
for (p = s; *p; p++) {
if (*p == *gio_string_end_string() ||
*p == '\\')
fputc('\\', Outp);
fputc(*p, Outp);
}
}
/*
* Set the current indent level of the output file.
*/
void
#ifdef __STDC__
gio_set_indent(int level)
#else
gio_set_indent(level)
int level;
#endif
{
register int i;
for (i = 0; i != level; i++)
Indent[i] = '\t';
Indent[i] = '\0';
Indent_level = level;
}
/*
* Get the current indent level of the output file.
*/
int
gio_get_indent()
{
return Indent_level;
}
/*
* Return the string begin string.
*/
char *
gio_string_begin_string()
{
return "\"";
}
/*
* Return the string end string.
*/
char *
gio_string_end_string()
{
return "\"";
}
/*
* Return the string representation of a string. Truncates the string if
* it is too long.
*/
char *
#ifdef __STDC__
gio_string_string(char *s)
#else
gio_string_string(s)
char *s;
#endif
{
char *p;
int i = 0;
Buf[i++] = *gio_string_begin_string();
if (s)
for (p = s; *p && i < MAXPATHLEN - 4; p++)
{
if (*p == *gio_string_end_string())
Buf[i++] = '\\';
Buf[i++] = *p;
}
Buf[i++] = *gio_string_end_string();
Buf[i] = '\0';
return Buf;
}
/*
* Return the boolean true string.
*/
char *
gio_true_string()
{
return "t";
}
/*
* Internal utility functions.
*/
/*
* Get the next token from the input stream. It is assumed that we
* are not at end-of-file.
*/
static char *
get_token()
{
int ch;
int c = 0; /* character count */
while (isspace(ch = fgetc(Inp)))
;
do {
if (c < sizeof (Buf) - 1)
Buf[c++] = (char) ch;
} while (!isspace(ch = fgetc(Inp)) && ch != ')');
ungetc(ch, Inp);
Buf[c] = '\0';
return Buf;
}
/*
* Return whether a file contains a GIL file. Returns non-0 version
* number if true, otherwise FALSE. Leaves file positioned at the
* beginning of first comment (should be version number).
*/
static int
#ifdef __STDC__
gil_version(FILE *fp)
#else
gil_version(fp)
FILE *fp;
#endif
{
char *ascii_version_num;
char *tmp;
long int_version_num;
long first_char;
int version = 0;
int len = strlen(G_VERSION_PREFIX);
rewind(fp);
while(fgets(Buf, sizeof (Buf), fp))
{
/* Ignore lines until a GIL prefix is found.
*/
if (strncmp(Buf, G_VERSION_PREFIX, len) == 0)
{
/* Prefix matched. Point to the version number and
* convert it to an integer.
*/
first_char = ftell(fp);
Buf[strlen(Buf)-1] = '\0';
ascii_version_num = Buf + len;
int_version_num = strtol(ascii_version_num, &tmp, 10);
if(ascii_version_num != tmp)
version = (int) int_version_num;
fseek(fp, first_char, 0);
break;
}
}
return version;
}
/*
* Skip leading comments in a GIL file.
*/
static void
#ifdef __STDC__
skip_comments(FILE *fp)
#else
skip_comments(fp)
FILE *fp;
#endif
{
long pos;
for (;;) {
pos = ftell(fp);
if (!fgets(Buf, sizeof (Buf), fp) ||
Buf[0] != *gio_comment_string())
break;
}
fseek(fp, pos, 0);
}
xvnews-2.3.2/guide/libguide/gio.h 100644 4246 12 11316 5605024171 15467 0 ustar graaff staff /*
* @(#)gio.h 2.13 91/08/14 Copyright 1989 Sun Microsystems.
*
* This file is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify this file without charge, but are not authorized to
* license or distribute it to anyone else except as part of a product
* or program developed by the user.
*
* THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* This file is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even
* if Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
/*
* GUIDE Intermediate Language (GIL) file input / output interface.
*/
#ifndef guide_gio_DEFINED
#define guide_gio_DEFINED
#include <c_varieties.h>
/*
* Public functions.
*/
EXTERN_FUNCTION( char *gio_boolean_string, (int) );
EXTERN_FUNCTION( void gio_close_input, (_VOID_) );
EXTERN_FUNCTION( void gio_close_output, (_VOID_) );
EXTERN_FUNCTION( char *gio_comment_string, (_VOID_) );
EXTERN_FUNCTION( char *gio_false_string, (_VOID_) );
EXTERN_FUNCTION( int gio_get_boolean, (int *) );
EXTERN_FUNCTION( int gio_get_eof, (_VOID_) );
EXTERN_FUNCTION( int gio_get_file_begin, (_VOID_) );
EXTERN_FUNCTION( int gio_get_file_end, (_VOID_) );
EXTERN_FUNCTION( int gio_get_handler, (char **) );
EXTERN_FUNCTION( int gio_get_integer, (int *) );
EXTERN_FUNCTION( int gio_get_keyword, (char **) );
EXTERN_FUNCTION( int gio_get_list, (char **) );
EXTERN_FUNCTION( int gio_get_list_begin, (_VOID_) );
EXTERN_FUNCTION( int gio_get_list_end, (_VOID_) );
EXTERN_FUNCTION( int gio_get_name, (char **) );
EXTERN_FUNCTION( int gio_get_full_name, (char **, char **, char **) );
EXTERN_FUNCTION( int gio_get_proj_full_name, (char **, char **, char **, char **) );
EXTERN_FUNCTION( int gio_get_object_begin, (_VOID_) );
EXTERN_FUNCTION( int gio_get_object_end, (_VOID_) );
EXTERN_FUNCTION( int gio_get_string, (char **) );
EXTERN_FUNCTION( int gio_get_string_begin, (_VOID_) );
EXTERN_FUNCTION( int gio_get_string_end, (_VOID_) );
EXTERN_FUNCTION( char *gio_integer_string, (int) );
EXTERN_FUNCTION( char *gio_keyword_string, (char *) );
EXTERN_FUNCTION( char *gio_list_begin_string, (_VOID_) );
EXTERN_FUNCTION( char *gio_list_end_string, (_VOID_) );
EXTERN_FUNCTION( char *gio_name_string, (char *) );
EXTERN_FUNCTION( char *gio_object_begin_string, (_VOID_) );
EXTERN_FUNCTION( char *gio_object_end_string, (_VOID_) );
EXTERN_FUNCTION( char *gio_open_output, (char *) );
EXTERN_FUNCTION( char *gio_open_gil_input, (char *) );
EXTERN_FUNCTION( char *gio_open_gil_output, (char *) );
EXTERN_FUNCTION( char *gio_open_proj_input, (char *) );
EXTERN_FUNCTION( char *gio_open_proj_output, (char *) );
EXTERN_FUNCTION( char *gio_open_resfile_input,(char *) );
EXTERN_FUNCTION( void gio_printf, (char *, DOTDOTDOT) );
EXTERN_FUNCTION( void gio_putc, (char) );
EXTERN_FUNCTION( void gio_puts, (char *) );
EXTERN_FUNCTION( void gio_put_boolean, (int) );
EXTERN_FUNCTION( void gio_put_float, (double) );
EXTERN_FUNCTION( void gio_put_integer, (int) );
EXTERN_FUNCTION( void gio_put_keyword, (char *) );
EXTERN_FUNCTION( void gio_put_handler, (char *) );
EXTERN_FUNCTION( void gio_put_name, (char *) );
EXTERN_FUNCTION( void gio_put_full_name, (char *, char *, char *) );
EXTERN_FUNCTION( void gio_put_proj_full_name, (char *, char *, char *, char *) );
EXTERN_FUNCTION( void gio_put_string, (char *) );
EXTERN_FUNCTION( void gio_put_string_to_file, (char *) );
EXTERN_FUNCTION( void gio_set_indent, (int) );
EXTERN_FUNCTION( int gio_get_indent, (_VOID_) );
EXTERN_FUNCTION( char *gio_string_begin_string, (_VOID_) );
EXTERN_FUNCTION( char *gio_string_end_string, (_VOID_) );
EXTERN_FUNCTION( char *gio_string_string, (char *) );
EXTERN_FUNCTION( char *gio_true_string, (_VOID_) );
EXTERN_FUNCTION( int gio_expand_path, (char *) );
EXTERN_FUNCTION( int gio_expand_gil_path, (char *) );
EXTERN_FUNCTION( int gio_expand_proj_path, (char *) );
EXTERN_FUNCTION( int gio_is_gil_path, (char *) );
EXTERN_FUNCTION( int gio_is_proj_path, (char *) );
#endif ~guide_gio_DEFINED
xvnews-2.3.2/guide/libguide/gio_path.c 100644 4246 12 12445 5605024171 16502 0 ustar graaff staff /*
* This file is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify this file without charge, but are not authorized to
* license or distribute it to anyone else except as part of a product
* or program developed by the user.
*
* THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* This file is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even
* if Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
#ifndef lint
static char sccsid[] = "@(#)gio_path.c 2.9 91/08/26 Copyright 1989 Sun Microsystems";
#endif
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <pwd.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
#include "gio.h"
#define OK 0
#define ERROR -1
/*
* Functions to manipulate file paths.
*/
#define GIL_SUFFIX ".G"
#define PROJ_SUFFIX ".P"
/*
* Expand a path in place. Returns OK if successful, otherwise sets errno
* and returns ERROR.
*/
int
#ifdef __STDC__
gio_expand_path(char *path)
#else
gio_expand_path(path)
char *path;
#endif
{
void expand_path();
char buf[MAXPATHLEN];
expand_path(path, buf);
strcpy(path, buf);
return OK;
}
/*
* Expand a path to a GIL file in place. Returns OK if successful,
* otherwise sets errno and returns error.
*/
int
#ifdef __STDC__
gio_expand_gil_path(char *path)
#else
gio_expand_gil_path(path)
char *path;
#endif
{
if (gio_expand_path(path) != OK)
return ERROR;
if (gio_is_gil_path(path))
return OK;
if (strlen(path) + strlen(GIL_SUFFIX) >= MAXPATHLEN) {
errno = ENAMETOOLONG;
return ERROR;
}
strcat(path, GIL_SUFFIX);
return OK;
}
/*
* Expand a path to a project file in place.
*/
int
#ifdef __STDC__
gio_expand_proj_path(char *path)
#else
gio_expand_proj_path(path)
char *path;
#endif
{
if (gio_expand_path(path) != 0)
return ERROR;
if (gio_is_proj_path(path))
return OK;
if (strlen(path) + strlen(PROJ_SUFFIX) >= MAXPATHLEN) {
errno = ENAMETOOLONG;
return ERROR;
}
strcat(path, PROJ_SUFFIX);
return 0;
}
/*
* Return True if the given path ends with the gil suffix.
*/
int
#ifdef __STDC__
gio_is_gil_path(char *path)
#else
gio_is_gil_path(path)
char *path;
#endif
{
return (strcmp(path + strlen(path) - strlen(GIL_SUFFIX),
GIL_SUFFIX) == 0);
}
/*
* Return True if the given path ends with the project suffix.
*/
int
#ifdef __STDC__
gio_is_proj_path(char *path)
#else
gio_is_proj_path(path)
char *path;
#endif
{
return (strcmp(path + strlen(path) - strlen(PROJ_SUFFIX),
PROJ_SUFFIX) == 0);
}
/*
* expand_path from OpenWindows V2 FCS XView libraries
*
* Handles:
* ~/ => home dir
* ~user/ => user's home dir
* If the environment variable a = "foo" and b = "bar" then:
* $a => foo
* $a$b => foobar
* $a.c => foo.c
* xxx$a => xxxfoo
* ${a}! => foo!
* \$a => \$a
*
* Arguments:
* nm input string
* pathname buffer to output expanded path
*/
void
#ifdef __STDC__
expand_path(char *nm, char *buf)
#else
expand_path(nm, buf)
char *nm, *buf;
#endif
{
register char *s, *d;
char lnm[MAXPATHLEN];
int q;
register char *trimchars = "\n \t";
char *getenv();
/* Strip off leading & trailing whitespace and cr */
while (strchr(trimchars, *nm) != NULL)
nm++;
s = nm + (q = strlen(nm)) - 1;
while (q-- && strchr(trimchars, *s) != NULL)
*s = '\0';
s = nm;
d = lnm;
q = nm[0] == '\\' && nm[1] == '~';
/* Expand inline environment variables */
while (*d++ = *s)
{
if (*s == '\\') {
if (*(d - 1) = *++s)
{
s++;
continue;
} else
break;
}
else if (*s++ == '$') {
register char *start = d;
register braces = *s == '{';
register char *value;
while (*d++ = *s)
if (braces ? *s == '}' : !isalnum(*s))
break;
else
s++;
*--d = 0;
value = getenv(braces ? start + 1 : start);
if (value) {
for (d = start - 1; *d++ = *value++;);
d--;
if (braces && *s)
s++;
}
}
}
/* Expand ~ and ~user */
nm = lnm;
s = "";
if (nm[0] == '~' && !q) { /* prefix ~ */
if (nm[1] == '/' || nm[1] == 0)
{ /* ~/filename */
if (s = getenv("HOME"))
{
if (*++nm)
nm++;
}
}
else
{ /* ~user/filename */
register char *nnm;
register struct passwd *pw;
for (s = nm; *s && *s != '/'; s++);
nnm = *s ? s + 1 : s;
*s = 0;
pw = (struct passwd *) getpwnam(nm + 1);
if (pw == 0) {
*s = '/';
s = "";
} else {
nm = nnm;
s = pw->pw_dir;
}
}
}
d = buf;
if (*s) {
while (*d++ = *s++);
*(d - 1) = '/';
}
s = nm;
while (*d++ = *s++);
}
xvnews-2.3.2/guide/libguide/guide.c 100644 4246 12 64151 5605024170 16005 0 ustar graaff staff /*
* This file is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify this file without charge, but are not authorized to
* license or distribute it to anyone else except as part of a product
* or program developed by the user.
*
* THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* This file is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even
* if Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
#ifndef lint
static char sccsid[] = "@(#)guide.c 2.33 91/08/27 Copyright 1989 Sun Microsystems";
#endif
#include "guide.h"
/*
* Table of attribute name strings indexed by attribute. The entries in this
* table must match G_ATTRS.
*/
static char *attr_string[] =
{
":actions",
":anchor-object",
":anchor-point",
":background-color",
":busy-drop-glyph",
":button-type",
":choices",
":choice-defaults",
":choice-label-types",
":choice-colors",
":columns",
":column-alignment",
":connections",
":constant-width",
":default-drop-site",
":dnd-accept-cursor",
":dnd-accept-cursor-xhot",
":dnd-accept-cursor-yhot",
":dnd-cursor",
":dnd-cursor-xhot",
":dnd-cursor-yhot",
":draggable",
":done-handler",
":droppable",
":drop-target_width",
":drawing-model",
":events",
":event-handler",
":foreground-color",
":group-type",
":height",
":help",
":horizontal-offset",
":horizontal-scrollbar",
":horizontal-spacing",
":icon-file",
":icon-label",
":icon-mask-file",
":initial-list-glyphs",
":initial-list-values",
":initial-selections",
":initial-state",
":initial-value",
":international-db-begin",
":international-db-end",
":label",
":label-type",
":label-bold",
":layout-type",
":mapped",
":max-tick-string",
":max-value",
":max-value-string",
":members",
":menu-handler",
":menu-item-colors",
":menu-item-defaults",
":menu-item-handlers",
":menu-item-labels",
":menu-item-label-types",
":menu-item-menus",
":menu-item-states",
":menu",
":menu-title",
":menu-type",
":min-tick-string",
":min-value",
":min-value-string",
":multiple-selections",
":name",
":normal-drop-glyph",
":notify-handler",
":orientation",
":owner",
":pinnable",
":pinned",
":read-only",
":reference-point",
":repaint-proc",
":resizable",
":rows",
":row-alignment",
":scrollable-height",
":scrollable-width",
":selection-required",
":setting-type",
":show-border",
":show-endboxes",
":show-footer",
":show-range",
":show-value",
":slider-width",
":stored-length",
":text-type",
":ticks",
":title",
":type",
":user-data",
":value-length",
":value-underlined",
":value-x",
":value-y",
":vertical-offset",
":vertical-scrollbar",
":vertical-spacing",
":width",
":x",
":y",
0,
};
/*
* The actions strings.
* The order of these strings must match that in G_ACTION_ATTRS.
*/
static char *action_attr_string[] =
{
":from",
":when",
":to",
":function_type",
":arg_type",
":action",
0,
};
/*
* Table of attribute name strings indexed by attribute. The entries
* in this table must match G_PROJ_ATTRIS.
*/
static char *proj_attr_string[] =
{
":interfaces",
":actions",
":root_window",
0,
};
/*
* Table of attribute name strings indexed by attribute. The entries
* in this table must match G_RESFILE_ATTRS.
*/
static char *resfile_attr_string[] =
{
":type",
":events",
":actions",
":receivers",
0,
};
/*
* Table of argument type strings indexed by argument type. The
* entries in this table must match G_ARG_TYPES.
*/
static char *arg_type_string[] =
{
":void",
":integer",
":float",
":string",
0,
};
/*
* Table of function type strings indexed by argument type. The
* entries in this table must match G_FUNC_TYPES.
*/
static char *func_type_string[] =
{
":user-defined",
":function",
":code",
0,
};
/*
* Table of Initial State strings indexed by argument type. The
* entries in this table must match G_INITIAL_STATES.
*/
static char *initial_state_string[] =
{
":active",
":iconic",
":inactive",
":invisible",
":notselected",
":open",
":selected",
":visible",
0,
};
/*
* Table of button name strings indexed by button type. The entries in this
* table must match G_BUTTON_TYPES.
*/
static char *button_type_string[] =
{
":normal",
":abbreviated",
0,
};
/*
* Table of drawing model strings indexed by drawing model. The entries in
* this table must match G_DRAWING_MODELS.
*/
static char *drawing_model_string[] =
{
":xview",
":xwindows",
":postscript",
0,
};
/*
* Table of event name strings indexed by event type. The entries in this
* table must match G_EVENT_TYPES.
*/
static char *event_type_string[] =
{
":keyboard",
":keyboard-left",
":keyboard-right",
":keyboard-top",
":mouse",
":mouse-drag",
":mouse-enter",
":mouse-exit",
":mouse-move",
0,
};
/*
* Table of label name strings indexed by layout type. The entries in this
* table must match G_LABEL_TYPES.
*/
static char *label_type_string[] =
{
":string",
":glyph",
0,
};
/*
* Table of menu name strings indexed by menu type. The entries in this
* table must match G_MENU_TYPES.
*/
static char *menu_type_string[] =
{
":command",
":exclusive",
":nonexclusive",
0,
};
/*
* Table of layout name strings indexed by attribute. The entries in this
* table must match G_LAYOUT_TYPE.
*/
static char *layout_type_string[] =
{
":horizontal",
":vertical",
0,
};
/*
* Table of group type name strings indexed by attribute. The entries in this
* table must match G_GROUP_TYPE.
*/
static char *group_type_string[] =
{
"nil",
":row",
":column",
":row-column",
0,
};
/*
* Table of compass points. The entries in this table must match
* G_COMPASS_POINTS.
*/
static char *compass_point_string[] =
{
":north-west",
":north",
":north-east",
":west",
":center",
":east",
":south-west",
":south",
":south-east",
0,
};
/*
* Table of column alignment types. The entries in this table must match
* G_COL_ALIGNMENTS.
*/
static char *col_alignment_string[] =
{
":left-edges",
":labels",
":vertical-centers",
":right-edges",
0,
};
/*
* Table of row alignment types. The entries in this table must match
* G_ROW_ALIGNMENTS.
*/
static char *row_alignment_string[] =
{
":top-edges",
":horizontal-centers",
":bottom-edges",
0,
};
/*
* Setting types.
*/
static char *setting_type_string[] =
{
":exclusive",
":nonexclusive",
":check",
":stack", /* MOOSE - can this be changed to ":setting-stack"? */
0,
};
/*
* Text types.
*/
static char *text_type_string[] =
{
":alphanumeric",
":multiline",
":numeric",
0,
};
/*
* Table of object type name strings indexed by object type. The entries in
* this table must match G_TYPES.
*/
static char *type_string[] =
{
":base-window",
":button",
":canvas-pane",
":control-area",
":drop-target",
":gauge",
":group",
":menu",
":menu-items",
":message",
":popup-window",
":scrolling-list",
":setting",
":setting-items",
":slider",
":stack",
":term-pane",
":text-field",
":text-pane",
0,
};
/*
* Internal procedure declarations.
*/
static int lookup();
/*
* Return a list of object attributes for the specified object type.
*/
G_ATTRS *
#ifdef __STDC__
G_object_attrs(G_TYPES type)
#else
G_object_attrs(type)
G_TYPES type;
#endif
{
switch (type)
{
case G_BASE_WINDOW:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_INTERNATIONAL_DB_BEGIN,
G_WIDTH,
G_HEIGHT,
G_INTERNATIONAL_DB_END,
G_BACKGROUND_COLOR,
G_FOREGROUND_COLOR,
G_LABEL,
G_LABEL_TYPE,
G_MAPPED,
G_INITIAL_STATE,
G_SHOW_FOOTER,
G_RESIZABLE,
G_ICON,
G_ICON_LABEL,
G_ICON_MASK,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_BUTTON:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_CONSTANT_WIDTH,
G_INTERNATIONAL_DB_END,
G_BUTTON_TYPE,
G_FOREGROUND_COLOR,
G_LABEL,
G_LABEL_TYPE,
G_INITIAL_STATE,
G_MENU_NAME,
G_NOTIFY_HANDLER,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_CANVAS_PANE:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_INTERNATIONAL_DB_END,
G_BACKGROUND_COLOR,
G_FOREGROUND_COLOR,
G_INITIAL_STATE,
G_DRAGGABLE,
G_DROPPABLE,
G_DEFAULT_DROP_SITE,
G_MENU_NAME,
G_HSCROLL,
G_SCROLLABLE_WIDTH,
G_VSCROLL,
G_SCROLLABLE_HEIGHT,
G_REPAINT_PROC,
G_EVENT_HANDLER,
G_EVENTS,
G_DRAWING_MODEL,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_CONTROL_AREA:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_INTERNATIONAL_DB_END,
G_BACKGROUND_COLOR,
G_FOREGROUND_COLOR,
G_INITIAL_STATE,
G_SHOW_BORDER,
G_MENU_NAME,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_DROP_TARGET:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_DROP_TARGET_WIDTH,
G_INTERNATIONAL_DB_END,
G_DEFAULT_DROP_SITE,
G_DRAGGABLE,
G_DROPPABLE,
G_LABEL,
G_LABEL_TYPE,
G_NORMAL_DROP_GLYPH,
G_BUSY_DROP_GLYPH,
G_DND_CURSOR,
G_DND_CURSOR_XHOT,
G_DND_CURSOR_YHOT,
G_DND_ACCEPT_CURSOR,
G_DND_ACCEPT_CURSOR_XHOT,
G_DND_ACCEPT_CURSOR_YHOT,
G_FOREGROUND_COLOR,
G_INITIAL_STATE,
G_NOTIFY_HANDLER,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_GAUGE:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_VALUE_X,
G_VALUE_Y,
G_SLIDER_WIDTH,
G_TICKS,
G_INTERNATIONAL_DB_END,
G_FOREGROUND_COLOR,
G_LABEL,
G_LABEL_TYPE,
G_LAYOUT_TYPE,
G_ORIENTATION,
G_SHOW_RANGE,
G_MIN_VALUE,
G_MAX_VALUE,
G_MIN_TICK_STRING,
G_MAX_TICK_STRING,
G_INITIAL_VALUE,
G_INITIAL_STATE,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_GROUP:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_X,
G_Y,
G_GROUP_TYPE,
G_MEMBERS,
G_ROWS,
G_ROW_ALIGNMENT,
G_COLUMNS,
G_COL_ALIGNMENT,
G_HSPACING,
G_VSPACING,
G_ANCHOR_OBJECT,
G_ANCHOR_POINT,
G_REFERENCE_POINT,
/* MOOSE, JI18N - should this be part of groups???
G_INTERNATIONAL_DB_BEGIN,
G_INTERNATIONAL_DB_END,
*/
G_HOFFSET,
G_VOFFSET,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_MENU:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_HELP,
G_COLUMNS,
G_MENU_TYPE,
G_MENU_HANDLER,
G_MENU_TITLE,
G_MENU_ITEM_LABELS,
G_MENU_ITEM_LABEL_TYPES,
G_MENU_ITEM_STATES,
G_MENU_ITEM_DEFAULTS,
G_INITIAL_SELECTIONS,
G_MENU_ITEM_HANDLERS,
G_MENU_ITEM_MENUS,
G_MENU_ITEM_COLORS,
G_PINNABLE, /* must follow G_MENU_ITEM_* */
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_MESSAGE:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_INTERNATIONAL_DB_END,
G_FOREGROUND_COLOR,
G_LABEL,
G_LABEL_TYPE,
G_LABEL_BOLD,
G_INITIAL_STATE,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_POPUP_WINDOW:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_INTERNATIONAL_DB_BEGIN,
G_WIDTH,
G_HEIGHT,
G_INTERNATIONAL_DB_END,
G_BACKGROUND_COLOR,
G_FOREGROUND_COLOR,
G_LABEL,
G_LABEL_TYPE,
G_MAPPED,
G_INITIAL_STATE,
G_SHOW_FOOTER,
G_RESIZABLE,
G_PINNED,
G_DONE_HANDLER,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_SCROLLING_LIST:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_VALUE_X,
G_VALUE_Y,
G_ROWS,
G_INTERNATIONAL_DB_END,
G_FOREGROUND_COLOR,
G_LABEL,
G_TITLE,
G_LABEL_TYPE,
G_LAYOUT_TYPE,
G_READ_ONLY,
G_MULTIPLE_SELECTIONS,
G_SELECTION_REQUIRED,
G_INITIAL_STATE,
G_DROPPABLE,
G_DEFAULT_DROP_SITE,
G_MENU_NAME,
G_NOTIFY_HANDLER,
G_EVENT_HANDLER,
G_EVENTS,
G_INITIAL_LIST_VALUES,
G_INITIAL_LIST_GLYPHS,
G_INITIAL_SELECTIONS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_SETTING:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_VALUE_X,
G_VALUE_Y,
G_ROWS,
G_COLUMNS,
G_INTERNATIONAL_DB_END,
G_LAYOUT_TYPE,
G_FOREGROUND_COLOR,
G_SETTING_TYPE,
G_SELECTION_REQUIRED,
G_LABEL,
G_LABEL_TYPE,
G_NOTIFY_HANDLER,
G_EVENT_HANDLER,
G_EVENTS,
G_CHOICES,
G_CHOICE_LABEL_TYPES,
G_CHOICE_COLORS,
G_CHOICE_DEFAULTS,
G_INITIAL_SELECTIONS,
G_INITIAL_STATE,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_SLIDER:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_VALUE_X,
G_VALUE_Y,
G_SLIDER_WIDTH,
G_TICKS,
G_INTERNATIONAL_DB_END,
G_FOREGROUND_COLOR,
G_LABEL,
G_LABEL_TYPE,
G_LAYOUT_TYPE,
G_ORIENTATION,
G_SHOW_ENDBOXES,
G_SHOW_RANGE,
G_SHOW_VALUE,
G_MIN_VALUE,
G_MAX_VALUE,
G_MIN_VALUE_STRING,
G_MAX_VALUE_STRING,
G_MIN_TICK_STRING,
G_MAX_TICK_STRING,
G_INITIAL_VALUE,
G_INITIAL_STATE,
G_NOTIFY_HANDLER,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_STACK:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_MEMBERS,
G_USER_DATA,
-1,
};
return attrs;
}
case G_TERM_PANE:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_INTERNATIONAL_DB_END,
G_BACKGROUND_COLOR,
G_FOREGROUND_COLOR,
G_INITIAL_STATE,
G_SHOW_BORDER,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_TEXT_FIELD:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_VALUE_X,
G_VALUE_Y,
G_VALUE_LENGTH,
G_STORED_LENGTH,
G_ROWS,
G_INTERNATIONAL_DB_END,
G_FOREGROUND_COLOR,
G_TEXT_TYPE,
G_LABEL,
G_LABEL_TYPE,
G_LAYOUT_TYPE,
G_VALUE_UNDERLINED,
G_MAX_VALUE,
G_MIN_VALUE,
G_INITIAL_VALUE,
G_INITIAL_STATE,
G_READ_ONLY,
G_NOTIFY_HANDLER,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
case G_TEXT_PANE:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_INTERNATIONAL_DB_BEGIN,
G_X,
G_Y,
G_WIDTH,
G_HEIGHT,
G_INTERNATIONAL_DB_END,
G_BACKGROUND_COLOR,
G_FOREGROUND_COLOR,
G_INITIAL_STATE,
G_SHOW_BORDER,
G_READ_ONLY,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
default:
{
static G_ATTRS attrs[] =
{
G_TYPE,
G_NAME,
G_OWNER,
G_HELP,
G_EVENT_HANDLER,
G_EVENTS,
G_USER_DATA,
G_ACTIONS,
-1,
};
return attrs;
}
}
}
/*
* Return a list of action attributes.
*/
G_ACTION_ATTRS *
G_action_attrs()
{
static G_ACTION_ATTRS attrs[] =
{
G_ACTION_FROM,
G_ACTION_WHEN,
G_ACTION_TO,
G_ACTION_FUNC_TYPE,
G_ACTION_ARG_TYPE,
G_ACTION_OPERATION,
-1,
};
return attrs;
}
/*
* The list of attributes specifying the order of things written in the
* project file.
*/
G_PROJ_ATTRS *
G_project_attrs()
{
static G_PROJ_ATTRS proj_attrs[] =
{
G_INTERFACES,
G_PROJ_ACTIONS,
G_ROOT_WINDOW,
-1,
};
return proj_attrs;
}
/*
* Change an attribute into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_attr_to_string(G_ATTRS attr)
#else
G_attr_to_string(attr)
G_ATTRS attr;
#endif
{
return attr_string[attr];
}
/*
* Change a string into an attribute. Returns the attribute number if
* successful, otherwise -1.
*/
G_ATTRS
#ifdef __STDC__
G_string_to_attr(char *s)
#else
G_string_to_attr(s)
char *s;
#endif
{
return lookup(s, attr_string);
}
/*
* Return the action string given a symbolic attribute.
*/
char *
#ifdef __STDC__
G_action_attr_to_string(G_ACTION_ATTRS attr)
#else
G_action_attr_to_string(attr)
G_ACTION_ATTRS attr;
#endif
{
return action_attr_string[attr];
}
/*
* Return the action attribute given a string.
*/
G_ACTION_ATTRS
#ifdef __STDC__
G_string_to_action_attr(char *s)
#else
G_string_to_action_attr(s)
char *s;
#endif
{
return lookup(s, action_attr_string);
}
/*
* Returns the attribute string given the attribute number.
*/
char *
#ifdef __STDC__
G_proj_attr_to_string(G_PROJ_ATTRS attr)
#else
G_proj_attr_to_string(attr)
G_PROJ_ATTRS attr;
#endif
{
return proj_attr_string[attr];
}
/*
* Change a string into an attribute. Returns the attribute number if
* successful, otherwise -1.
*/
G_PROJ_ATTRS
#ifdef __STDC__
G_string_to_proj_attr(char *s)
#else
G_string_to_proj_attr(s)
char *s;
#endif
{
return lookup(s, proj_attr_string);
}
/*
* Change a string into an attribute. Returns the attribute number if
* successful, otherwise -1.
*/
G_RESFILE_ATTRS
#ifdef __STDC__
G_string_to_resfile_attr(char *s)
#else
G_string_to_resfile_attr(s)
char *s;
#endif
{
return lookup(s, resfile_attr_string);
}
/*
* Change a string into an argument type.
*/
G_ARG_TYPES
#ifdef __STDC__
G_string_to_arg_type(char *s)
#else
G_string_to_arg_type(s)
char *s;
#endif
{
return lookup(s, arg_type_string);
}
/*
* Change a string into an function type.
*/
G_FUNC_TYPES
#ifdef __STDC__
G_string_to_func_type(char *s)
#else
G_string_to_func_type(s)
char *s;
#endif
{
return lookup(s, func_type_string);
}
/*
* Change a button type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_button_type_to_string(G_BUTTON_TYPES val)
#else
G_button_type_to_string(val)
G_BUTTON_TYPES val;
#endif
{
return button_type_string[val];
}
/*
* Change a string into a button type.
*/
G_BUTTON_TYPES
#ifdef __STDC__
G_string_to_button_type(char *s)
#else
G_string_to_button_type(s)
char *s;
#endif
{
return lookup(s, button_type_string);
}
/*
* Change a drawing model into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_drawing_model_to_string(G_DRAWING_MODELS drawing_model)
#else
G_drawing_model_to_string(drawing_model)
G_DRAWING_MODELS drawing_model;
#endif
{
return drawing_model_string[drawing_model];
}
/*
* Change a string into an attribute. Returns the attribute number if
* successful, otherwise -1.
*/
G_DRAWING_MODELS
#ifdef __STDC__
G_string_to_drawing_model(char *s)
#else
G_string_to_drawing_model(s)
char *s;
#endif
{
return lookup(s, drawing_model_string);
}
/*
* Change an event type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_event_type_to_string(G_EVENT_TYPES event)
#else
G_event_type_to_string(event)
G_EVENT_TYPES event;
#endif
{
return event_type_string[event];
}
/*
* Change a string into an attribute. Returns the attribute number if
* successful, otherwise -1.
*/
G_EVENT_TYPES
#ifdef __STDC__
G_string_to_event_type(char *s)
#else
G_string_to_event_type(s)
char *s;
#endif
{
return lookup(s, event_type_string);
}
/*
* Change a label type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_label_type_to_string(G_LABEL_TYPES val)
#else
G_label_type_to_string(val)
G_LABEL_TYPES val;
#endif
{
return label_type_string[val];
}
/*
* Change a string into a label type.
*/
G_LABEL_TYPES
#ifdef __STDC__
G_string_to_label_type(char *s)
#else
G_string_to_label_type(s)
char *s;
#endif
{
return lookup(s, label_type_string);
}
/*
* Change a layout type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_layout_type_to_string(G_LAYOUT_TYPES val)
#else
G_layout_type_to_string(val)
G_LAYOUT_TYPES val;
#endif
{
return layout_type_string[val];
}
/*
* Change a string into a layout type.
*/
G_LAYOUT_TYPES
#ifdef __STDC__
G_string_to_layout_type(char *s)
#else
G_string_to_layout_type(s)
char *s;
#endif
{
return lookup(s, layout_type_string);
}
/*
* Change a group type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_group_type_to_string(G_GROUP_TYPES val)
#else
G_group_type_to_string(val)
G_GROUP_TYPES val;
#endif
{
return group_type_string[val];
}
/*
* Change a string into a group type.
*/
G_GROUP_TYPES
#ifdef __STDC__
G_string_to_group_type(char *s)
#else
G_string_to_group_type(s)
char *s;
#endif
{
return lookup(s, group_type_string);
}
/*
* Change a reference point into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_compass_point_to_string(G_COMPASS_POINTS val)
#else
G_compass_point_to_string(val)
G_COMPASS_POINTS val;
#endif
{
return compass_point_string[val];
}
/*
* Change a string into a group type.
*/
G_COMPASS_POINTS
#ifdef __STDC__
G_string_to_compass_point(char *s)
#else
G_string_to_compass_point(s)
char *s;
#endif
{
return lookup(s, compass_point_string);
}
/*
* Change a column alignment type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_col_alignment_to_string(G_COL_ALIGNMENTS val)
#else
G_col_alignment_to_string(val)
G_COL_ALIGNMENTS val;
#endif
{
return col_alignment_string[val];
}
/*
* Change a string into a column alignment type.
*/
G_COL_ALIGNMENTS
#ifdef __STDC__
G_string_to_col_alignment(char *s)
#else
G_string_to_col_alignment(s)
char *s;
#endif
{
return lookup(s, col_alignment_string);
}
/*
* Change a row alignment type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_row_alignment_to_string(G_ROW_ALIGNMENTS val)
#else
G_row_alignment_to_string(val)
G_ROW_ALIGNMENTS val;
#endif
{
return row_alignment_string[val];
}
/*
* Change a string into a row alignment type.
*/
G_ROW_ALIGNMENTS
#ifdef __STDC__
G_string_to_row_alignment(char *s)
#else
G_string_to_row_alignment(s)
char *s;
#endif
{
return lookup(s, row_alignment_string);
}
/*
* Change a menu type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_menu_type_to_string(G_MENU_TYPES val)
#else
G_menu_type_to_string(val)
G_MENU_TYPES val;
#endif
{
return menu_type_string[val];
}
/*
* Change a string into a menu type.
*/
G_MENU_TYPES
#ifdef __STDC__
G_string_to_menu_type(char *s)
#else
G_string_to_menu_type(s)
char *s;
#endif
{
return lookup(s, menu_type_string);
}
/*
* Change a setting type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_setting_type_to_string(G_SETTING_TYPES val)
#else
G_setting_type_to_string(val)
G_SETTING_TYPES val;
#endif
{
return setting_type_string[val];
}
/*
* Change a string into a setting type.
*/
G_SETTING_TYPES
#ifdef __STDC__
G_string_to_setting_type(char *s)
#else
G_string_to_setting_type(s)
char *s;
#endif
{
return lookup(s, setting_type_string);
}
/*
* Change a setting type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_text_type_to_string(G_TEXT_TYPES val)
#else
G_text_type_to_string(val)
G_TEXT_TYPES val;
#endif
{
return text_type_string[val];
}
/*
* Change a Initial State into a string. Returns a string.
*
*/
char *
#ifdef __STDC__
G_initial_state_to_string(G_INITIAL_STATES initial_state)
#else
G_initial_state_to_string(initial_state)
G_INITIAL_STATES initial_state;
#endif
{
return initial_state_string[initial_state];
}
/*
* Change a string into an Initial State. Returns the Initial State
* number if successful, otherwise -1.
*/
G_INITIAL_STATES
#ifdef __STDC__
G_string_to_initial_state(char *s)
#else
G_string_to_initial_state(s)
char *s;
#endif
{
return lookup(s, initial_state_string);
}
/*
* Change a string into a text type.
*/
G_TEXT_TYPES
#ifdef __STDC__
G_string_to_text_type(char *s)
#else
G_string_to_text_type(s)
char *s;
#endif
{
return lookup(s, text_type_string);
}
/*
* Change a type into a string. Returns a string.
*
* REMIND: error checking.
*/
char *
#ifdef __STDC__
G_type_to_string(G_TYPES type)
#else
G_type_to_string(type)
G_TYPES type;
#endif
{
return type_string[type];
}
/*
* Change a string into a type. Returns the type number if successful,
* otherwise -1.
*/
G_TYPES
#ifdef __STDC__
G_string_to_type(char *s)
#else
G_string_to_type(s)
char *s;
#endif
{
return lookup(s, type_string);
}
/*
* Search for a string in the specified table. Returns the table index if
* successful, otherwise -1.
*/
static int
#ifdef __STDC__
lookup(char *s, char **tab)
#else
lookup(s, tab)
char *s;
char **tab;
#endif
{
int i;
for (i = 0; tab[i]; i++)
if (strcmp(s, tab[i]) == 0)
return i;
return -1;
}
xvnews-2.3.2/guide/libguide/guide.h 100644 4246 12 22225 5605024171 16007 0 ustar graaff staff /*
* @(#)guide.h 2.24 91/08/27 Copyright 1989 Sun Microsystems.
*
* This file is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
* media and as a part of the software program in whole or part. Users
* may copy or modify this file without charge, but are not authorized to
* license or distribute it to anyone else except as part of a product
* or program developed by the user.
*
* THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
*
* This file is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
*
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE
* OR ANY PART THEREOF.
*
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even
* if Sun has been advised of the possibility of such damages.
*
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
#ifndef guide_guide_DEFINED
#define guide_guide_DEFINED
#include <c_varieties.h>
/*
* Miscellaneous definitions.
*/
#define OK 0
#define ERROR -1
#define TRUE 1
#define FALSE 0
/*
* String appended to an application name to form the GIL file.
*/
#define G_GIL_SUFFIX_STRING ".G"
/*
* GIL version string. The version number will be incremented when
* the format of GIL files is changed.
*/
#define G_VERSION 3
#define G_VERSION_PREFIX ";GIL-"
/*
* Public enumerated types.
*/
/*
* GUIDE object types.
*/
typedef enum
{
G_BASE_WINDOW,
G_BUTTON,
G_CANVAS_PANE,
G_CONTROL_AREA,
G_DROP_TARGET,
G_GAUGE,
G_GROUP,
G_MENU,
G_MENU_ITEMS,
G_MESSAGE,
G_POPUP_WINDOW,
G_SCROLLING_LIST,
G_SETTING,
G_SETTING_ITEMS,
G_SLIDER,
G_STACK,
G_TERM_PANE,
G_TEXT_FIELD,
G_TEXT_PANE,
} G_TYPES;
/*
* Argument type used in the resfile.
*/
typedef enum
{
G_VOID_TYPE,
G_INT_TYPE,
G_FLOAT_TYPE,
G_STRING_TYPE,
} G_ARG_TYPES;
/*
* Function type used in the resfile
*/
typedef enum
{
G_USER_TYPE,
G_FUNCTION_TYPE,
G_CODE_TYPE,
} G_FUNC_TYPES;
/*
* Button types.
*/
typedef enum
{
G_NORMAL,
G_ABBREVIATED,
} G_BUTTON_TYPES;
/*
* Drawing models.
*/
typedef enum
{
G_XVIEW,
G_XWINDOWS,
G_POSTSCRIPT,
} G_DRAWING_MODELS;
/*
* Label types.
*/
typedef enum
{
G_STRING,
G_GLYPH,
} G_LABEL_TYPES;
/*
* Layout types for the G_LAYOUT attribute.
*/
typedef enum
{
G_HORIZONTAL,
G_VERTICAL,
} G_LAYOUT_TYPES;
/*
* Types for the G_GROUP_TYPE attribute.
*/
typedef enum
{
G_NONE,
G_ROW,
G_COLUMN,
G_ROWCOLUMN,
} G_GROUP_TYPES;
/*
* Types for the G_{ANCHOR,REFERENCE}_POINT attributes.
*/
typedef enum
{
G_NORTHWEST,
G_NORTH,
G_NORTHEAST,
G_WEST,
G_CENTER,
G_EAST,
G_SOUTHWEST,
G_SOUTH,
G_SOUTHEAST,
} G_COMPASS_POINTS;
/*
* Types for the G_COL_ALIGNMENT attribute.
*/
typedef enum
{
G_LEFT_EDGES,
G_LABELS,
G_VCENTERS,
G_RIGHT_EDGES,
} G_COL_ALIGNMENTS;
/*
* Types for the G_ROW_ALIGNMENT attribute.
*/
typedef enum
{
G_TOP_EDGES,
G_HCENTERS,
G_BOTTOM_EDGES,
} G_ROW_ALIGNMENTS;
/*
* Menu types.
*/
typedef enum
{
G_COMMAND_MENU,
G_EXCLUSIVE_MENU,
G_NONEXCLUSIVE_MENU,
} G_MENU_TYPES;
/*
* Setting types.
*/
typedef enum
{
G_EXCLUSIVE,
G_NONEXCLUSIVE,
G_CHECK,
G_SETTING_STACK,
} G_SETTING_TYPES;
/*
* Event types.
*/
typedef enum
{
G_KEYBOARD,
G_KEYBOARD_LEFT,
G_KEYBOARD_RIGHT,
G_KEYBOARD_TOP,
G_MOUSE,
G_MOUSE_DRAG,
G_MOUSE_ENTER,
G_MOUSE_EXIT,
G_MOUSE_MOVE,
} G_EVENT_TYPES;
/*
* Text types.
*/
typedef enum
{
G_ALPHANUMERIC,
G_MULTILINE,
G_NUMERIC,
} G_TEXT_TYPES;
/*
* Intitial state types.
*/
typedef enum
{
G_ACTIVE,
G_ICONIC,
G_INACTIVE,
G_INVISIBLE,
G_NOTSELECTED,
G_OPEN,
G_SELECTED,
G_VISIBLE,
} G_INITIAL_STATES;
/*
* GUIDE object attributes.
*/
typedef enum
{
G_ACTIONS,
G_ANCHOR_OBJECT,
G_ANCHOR_POINT,
G_BACKGROUND_COLOR,
G_BUSY_DROP_GLYPH,
G_BUTTON_TYPE,
G_CHOICES,
G_CHOICE_DEFAULTS,
G_CHOICE_LABEL_TYPES,
G_CHOICE_COLORS,
G_COLUMNS,
G_COL_ALIGNMENT,
G_CONNECTIONS,
G_CONSTANT_WIDTH,
G_DEFAULT_DROP_SITE,
G_DND_ACCEPT_CURSOR,
G_DND_ACCEPT_CURSOR_XHOT,
G_DND_ACCEPT_CURSOR_YHOT,
G_DND_CURSOR,
G_DND_CURSOR_XHOT,
G_DND_CURSOR_YHOT,
G_DRAGGABLE,
G_DONE_HANDLER,
G_DROPPABLE,
G_DROP_TARGET_WIDTH,
G_DRAWING_MODEL,
G_EVENTS,
G_EVENT_HANDLER,
G_FOREGROUND_COLOR,
G_GROUP_TYPE,
G_HEIGHT,
G_HELP,
G_HOFFSET,
G_HSCROLL,
G_HSPACING,
G_ICON,
G_ICON_LABEL,
G_ICON_MASK,
G_INITIAL_LIST_GLYPHS,
G_INITIAL_LIST_VALUES,
G_INITIAL_SELECTIONS,
G_INITIAL_STATE,
G_INITIAL_VALUE,
G_INTERNATIONAL_DB_BEGIN,
G_INTERNATIONAL_DB_END,
G_LABEL,
G_LABEL_TYPE,
G_LABEL_BOLD,
G_LAYOUT_TYPE,
G_MAPPED,
G_MAX_TICK_STRING,
G_MAX_VALUE,
G_MAX_VALUE_STRING,
G_MEMBERS,
G_MENU_HANDLER,
G_MENU_ITEM_COLORS,
G_MENU_ITEM_DEFAULTS,
G_MENU_ITEM_HANDLERS,
G_MENU_ITEM_LABELS,
G_MENU_ITEM_LABEL_TYPES,
G_MENU_ITEM_MENUS,
G_MENU_ITEM_STATES,
G_MENU_NAME,
G_MENU_TITLE,
G_MENU_TYPE,
G_MIN_TICK_STRING,
G_MIN_VALUE,
G_MIN_VALUE_STRING,
G_MULTIPLE_SELECTIONS,
G_NAME,
G_NORMAL_DROP_GLYPH,
G_NOTIFY_HANDLER,
G_ORIENTATION,
G_OWNER,
G_PINNABLE,
G_PINNED,
G_READ_ONLY,
G_REFERENCE_POINT,
G_REPAINT_PROC,
G_RESIZABLE,
G_ROWS,
G_ROW_ALIGNMENT,
G_SCROLLABLE_HEIGHT,
G_SCROLLABLE_WIDTH,
G_SELECTION_REQUIRED,
G_SETTING_TYPE,
G_SHOW_BORDER,
G_SHOW_ENDBOXES,
G_SHOW_FOOTER,
G_SHOW_RANGE,
G_SHOW_VALUE,
G_SLIDER_WIDTH,
G_STORED_LENGTH,
G_TEXT_TYPE,
G_TICKS,
G_TITLE,
G_TYPE,
G_USER_DATA,
G_VALUE_LENGTH,
G_VALUE_UNDERLINED,
G_VALUE_X,
G_VALUE_Y,
G_VOFFSET,
G_VSCROLL,
G_VSPACING,
G_WIDTH,
G_X,
G_Y,
} G_ATTRS;
/*
* The action attributes.
*/
typedef enum
{
G_ACTION_FROM,
G_ACTION_WHEN,
G_ACTION_TO,
G_ACTION_FUNC_TYPE,
G_ACTION_ARG_TYPE,
G_ACTION_OPERATION,
} G_ACTION_ATTRS;
/*
* GUIDE project attributes.
*/
typedef enum
{
G_INTERFACES,
G_PROJ_ACTIONS,
G_ROOT_WINDOW,
} G_PROJ_ATTRS;
/*
* GUIDE resfile attributes.
*/
typedef enum
{
G_VALID_TYPE,
G_VALID_EVENTS,
G_VALID_ACTIONS,
G_VALID_RECEIVERS,
} G_RESFILE_ATTRS;
/*
* A struct used to read info from the static message table.
*/
typedef struct G_MSG_STRUCT
{
G_FUNC_TYPES func_type;
char *name;
G_ARG_TYPES arg_type;
} G_MSG_STRUCT;
/*
* Public function declarations.
*/
EXTERN_FUNCTION( G_ATTRS *G_object_attrs, (G_TYPES) );
EXTERN_FUNCTION( G_ACTION_ATTRS *G_action_attrs, (_VOID_) );
EXTERN_FUNCTION( G_PROJ_ATTRS *G_project_attrs, (_VOID_) );
EXTERN_FUNCTION( char *G_attr_to_string, (G_ATTRS) );
EXTERN_FUNCTION( G_ATTRS G_string_to_attr, (char *) );
EXTERN_FUNCTION( char *G_action_attr_to_string, (G_ACTION_ATTRS) );
EXTERN_FUNCTION( G_ACTION_ATTRS G_string_to_action_attr, (char *) );
EXTERN_FUNCTION( char *G_proj_attr_to_string, (G_PROJ_ATTRS) );
EXTERN_FUNCTION( G_PROJ_ATTRS G_string_to_proj_attr, (char *) );
EXTERN_FUNCTION( G_RESFILE_ATTRS G_string_to_resfile_attr,(char *) );
EXTERN_FUNCTION( G_ARG_TYPES G_string_to_arg_type, (char *) );
EXTERN_FUNCTION( char *G_drawing_model_to_string, (G_DRAWING_MODELS) );
EXTERN_FUNCTION( G_DRAWING_MODELS G_string_to_drawing_model, (char *) );
EXTERN_FUNCTION( char *G_event_type_to_string, (G_EVENT_TYPES) );
EXTERN_FUNCTION( G_EVENT_TYPES G_string_to_event_type, (char *) );
EXTERN_FUNCTION( char *G_label_type_to_string, (G_LABEL_TYPES) );
EXTERN_FUNCTION( G_LABEL_TYPES G_string_to_label_type, (char *) );
EXTERN_FUNCTION( char *G_layout_type_to_string, (G_LAYOUT_TYPES) );
EXTERN_FUNCTION( G_LAYOUT_TYPES