home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: steveh@orbital.demon.co.uk (Stephen Hebditch)
- Subject: v39i039: slurp - A passive NNTP transfer client, v1.08, Part03/03
- Message-ID: <1993Aug22.013251.28647@sparky.sterling.com>
- X-Md4-Signature: 435ec2b2056796af11bef56b6edceaf1
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Sun, 22 Aug 1993 01:32:51 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: steveh@orbital.demon.co.uk (Stephen Hebditch)
- Posting-number: Volume 39, Issue 39
- Archive-name: slurp/part03
- Environment: ANSI-C, UNIX
- Supersedes: slurp: Volume 36, Issue 13-14
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: fakesyslog.h slurp.sys time.c
- # Wrapped by kent@sparky on Sat Aug 21 20:28:15 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 3 (of 3)."'
- if test -f 'fakesyslog.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'fakesyslog.h'\"
- else
- echo shar: Extracting \"'fakesyslog.h'\" \(953 characters\)
- sed "s/^X//" >'fakesyslog.h' <<'END_OF_FILE'
- X/*
- X * Fake syslog definitions.
- X *
- X * @(#)fakesyslog.h 1.1 (Berkeley) 12/18/87
- X */
- X
- X#ifdef FAKESYSLOG
- X
- X/*
- X * Facility codes
- X */
- X
- X#define LOG_KERN 0
- X#define LOG_USER 0
- X#define LOG_MAIL 0
- X#define LOG_DAEMON 0
- X#define LOG_AUTH 0
- X#define LOG_SYSLOG 0
- X#define LOG_LPR 0
- X#define LOG_NEWS 0
- X#define LOG_LOCAL0 0
- X#define LOG_LOCAL1 0
- X#define LOG_LOCAL2 0
- X#define LOG_LOCAL3 0
- X#define LOG_LOCAL4 0
- X#define LOG_LOCAL5 0
- X#define LOG_LOCAL6 0
- X#define LOG_LOCAL7 0
- X
- X#define LOG_NFACILITIES 0
- X#define LOG_FACMASK 0
- X
- X/*
- X * Priorities
- X */
- X
- X#define LOG_EMERG 0
- X#define LOG_ALERT 0
- X#define LOG_CRIT 0
- X#define LOG_ERR 0
- X#define LOG_WARNING 0
- X#define LOG_NOTICE 0
- X#define LOG_INFO 0
- X#define LOG_DEBUG 0
- X
- X#define LOG_PRIMASK 0
- X
- X/*
- X * arguments to setlogmask.
- X */
- X
- X#define LOG_MASK(pri) 0
- X#define LOG_UPTO(pri) 0
- X
- X/*
- X * Option flags for openlog.
- X */
- X
- X#define LOG_PID 1
- X#define LOG_CONS 0
- X#define LOG_ODELAY 0
- X#define LOG_NDELAY 0
- X#define LOG_NOWAIT 0
- X
- X#endif FAKESYSLOG
- END_OF_FILE
- if test 953 -ne `wc -c <'fakesyslog.h'`; then
- echo shar: \"'fakesyslog.h'\" unpacked with wrong size!
- fi
- # end of 'fakesyslog.h'
- fi
- if test -f 'slurp.sys' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'slurp.sys'\"
- else
- echo shar: Extracting \"'slurp.sys'\" \(1205 characters\)
- sed "s/^X//" >'slurp.sys' <<'END_OF_FILE'
- X# slurp.sys - which newsgroups we wish to take from each NNTP server
- X#
- X# Format is
- X# hostname/sublist:groups/distributions:flags:username/password
- X#
- X# * Entries for a particular host can be continued on more than one
- X# line by using a '\' at the end of the line.
- X# * There is no limit on the length of each line.
- X# * Whitespace is only allowed in comments - nowhere else!
- X# * Comments begin with a '#'.
- X# * Distributions are *not* recommended if you want a reasonable
- X# throughput and don't want to increase the server load too much...
- X# * Possible flags are
- X# i don't load /save unretrieved messsage IDs
- X# l use local time, not that at the server
- X# r do a 'mode reader' command
- X# * If username/password are supplied then they will be used with the
- X# NNTP simple authorisation protocol.
- X#
- X
- X# Demon feed
- Xnews.demon.co.uk:demon*,!demon.msdos.announce,alt.fan.chicken.wrestling,\
- Xuk.*,!uk.net.maps,rec.video.satellite,comp.unix.sys5.r4,\
- Xrec.arts.tv.uk,ba.broadcast
- X
- X# Orbital feed #1
- Xorbital.demon.co.uk/1:cix.*,alt.bbs.*,!alt.bbs.lists*
- X
- X# Orbital feed #2
- Xorbital.demon.co.uk/2:rec.radio.*,alt.bbs,alt.bbs.internet,alt.irc,\
- Xnews.software.*:il:newserv/lick21
- X
- X# END OF FILE
- END_OF_FILE
- if test 1205 -ne `wc -c <'slurp.sys'`; then
- echo shar: \"'slurp.sys'\" unpacked with wrong size!
- fi
- # end of 'slurp.sys'
- fi
- if test -f 'time.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'time.c'\"
- else
- echo shar: Extracting \"'time.c'\" \(1691 characters\)
- sed "s/^X//" >'time.c' <<'END_OF_FILE'
- X/*
- X * time - obtain the time from the remote server
- X *
- X * Copyright (C) 1992/93 Stephen Hebditch. All rights reserved.
- X * TQM Communications, BCM Box 225, London, WC1N 3XX.
- X * steveh@orbital.demon.co.uk +44 836 825962
- X *
- X * See README for more information and disclaimers
- X *
- X * Obtain the current time from the remote server in standard unix time
- X * format for use with the next NEWNEWS. If the client is unable to
- X * connect to the time server or the read fails then the error is
- X * reported and the program is exited.
- X *
- X * $Id: time.c,v 1.7 1993/06/07 11:20:27 root Exp $
- X *
- X * $Log: time.c,v $
- X * Revision 1.7 1993/06/07 11:20:27 root
- X * Removed unistd.h inclusion.
- X * Display time since epoch at server as unsigned.
- X *
- X * Revision 1.5 1993/03/01 18:09:12 root
- X * Made the epoch constant an unsigned long.
- X *
- X * Revision 1.4 1993/02/14 15:10:01 root
- X * No changes.
- X *
- X * Revision 1.0 1992/08/92
- X * Initial coding.
- X *
- X */
- X
- X#include "slurp.h"
- X
- X#include <netinet/in.h>
- X
- X
- X time_t
- Xserver_time (char *hostname)
- X {
- X int server, ret;
- X u_long timebuf;
- X
- X/* First open the socket */
- X
- X if ((server = tcp_open (hostname, "time")) < 0)
- X return ((time_t) 0);
- X
- X ret = read (server, &timebuf, 4);
- X
- X/* Close the socket and check we got 4 bytes */
- X
- X (void) close (server);
- X
- X if (ret != 4)
- X {
- X log_ret ("server_time: Read error on time server socket");
- X return ((time_t) 0);
- X }
- X
- X/* Convert byte order if needed */
- X
- X timebuf = ntohl (timebuf);
- X
- X if (debug_flag)
- X (void) fprintf (stderr, "time is currently %lu at server %s\n",
- X timebuf, hostname);
- X
- X/* Convert the time from seconds since 1900 to seconds since 1970 */
- X
- X return ((time_t) (timebuf - 2208988800UL));
- X }
- X
- X/* END-OF-FILE */
- END_OF_FILE
- if test 1691 -ne `wc -c <'time.c'`; then
- echo shar: \"'time.c'\" unpacked with wrong size!
- fi
- # end of 'time.c'
- fi
- echo shar: End of archive 3 \(of 3\).
- cp /dev/null ark3isdone
- MISSING=""
- for I in 1 2 3 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 3 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-