put tempnam.o into LIBOBJS.
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef pid_t
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
/* Define if you have the srand48 function. */
#undef HAVE_SRAND48
-/* Define if you have the strdup function. */
-#undef HAVE_STRDUP
-
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the syslog function. */
#undef HAVE_SYSLOG
-/* Define if you have the tempnam function. */
-#undef HAVE_TEMPNAM
-
/* Define if you have the timegm function. */
#undef HAVE_TIMEGM
/*
- * $Id: util.h,v 1.22 1996/10/09 15:34:15 wessels Exp $
+ * $Id: util.h,v 1.23 1996/10/15 23:32:47 wessels Exp $
*
* AUTHOR: Harvest Derived
*
#endif
#endif
-#if !HAVE_STRDUP
-extern char *strdup _PARAMS((char *));
-#endif
+extern char *getfullhostname _PARAMS((void));
+extern char *mkhttpdlogtime _PARAMS((time_t *));
+extern char *mkrfc850 _PARAMS((time_t));
+extern char *uudecode _PARAMS((char *));
extern char *xstrdup _PARAMS((char *));
-
-/* from xmalloc.c */
+extern char *xstrdup _PARAMS((char *));
+extern char *xstrerror _PARAMS((void));
+extern int tvSubMsec _PARAMS((struct timeval, struct timeval));
+extern time_t parse_rfc850 _PARAMS((char *str));
+extern void *xcalloc _PARAMS((int, size_t));
extern void *xmalloc _PARAMS((size_t));
extern void *xrealloc _PARAMS((void *, size_t));
-extern void *xcalloc _PARAMS((int, size_t));
+extern void Tolower _PARAMS((char *));
extern void xfree _PARAMS((void *));
-extern void xxfree _PARAMS((void *));
-extern char *xstrdup _PARAMS((char *));
-extern char *xstrerror _PARAMS((void));
-extern char *getfullhostname _PARAMS((void));
extern void xmemcpy _PARAMS((void *, void *, int));
-
-extern int tvSubMsec _PARAMS((struct timeval, struct timeval));
-
+extern void xxfree _PARAMS((void *));
#if XMALLOC_STATISTICS
void malloc_statistics _PARAMS((void (*)_PARAMS((int, int, void *)), void *));
#endif
-/* from debug.c */
-#ifndef MAX_DEBUG_LEVELS
-#define MAX_DEBUG_LEVELS 256
-#endif /* MAX_DEBUG_LEVELS */
-
-#ifndef MAIN
-extern int Harvest_do_debug;
-extern int Harvest_debug_levels[];
-#endif /* MAIN */
-
-#undef debug_ok_fast
-#if USE_NO_DEBUGGING
-#define debug_ok_fast(S,L) 0
-#else
-#define debug_ok_fast(S,L) \
- ( \
- (Harvest_do_debug) && \
- ((Harvest_debug_levels[S] == -2) || \
- ((Harvest_debug_levels[S] != -1) && \
- ((L) <= Harvest_debug_levels[S]))) \
- )
-#endif /* USE_NO_DEBUGGING */
-
-#undef Debug
-#if USE_NO_DEBUGGING
-#define Debug(section, level, X) /* empty */;
-#else
-#define Debug(section, level, X) \
- {if (debug_ok_fast((section),(level))) {Log X;}}
-#endif
-
-void debug_flag _PARAMS((char *));
-
-char *mkhttpdlogtime _PARAMS((time_t *));
-extern char *mkrfc850 _PARAMS((time_t));
-extern time_t parse_rfc850 _PARAMS((char *str));
-extern void init_log3 _PARAMS((char *pn, FILE * a, FILE * b));
-extern void debug_init _PARAMS((void));
-extern void log_errno2 _PARAMS((char *, int, char *));
-
-#ifdef __STDC__
-extern void Log _PARAMS((char *,...));
-extern void errorlog _PARAMS((char *,...));
-#else
-extern void Log _PARAMS(());
-extern void errorlog _PARAMS(());
-#endif /* __STDC__ */
-
-extern void Tolower _PARAMS((char *));
-
-extern char *uudecode _PARAMS((char *));
-
#endif /* ndef _UTIL_H_ */
#
# Darren Hardy, hardy@cs.colorado.edu, April 1994
#
-# $Id: Makefile.in,v 1.15 1996/10/13 10:04:20 wessels Exp $
+# $Id: Makefile.in,v 1.16 1996/10/15 23:32:48 wessels Exp $
#
prefix = @prefix@
srcdir = @srcdir@
LDFLAGS = @LDFLAGS@
XTRA_LIBS = @XTRA_LIBS@
RM = @RM@
+LIBOBJS = @LIBOBJS@
INCLUDE = -I../include -I$(srcdir)/../include
UTILOBJS = rfc850.o \
rfc1738.o \
util.o \
getfullhostname.o \
- tempnam.o \
base64.o \
- uudecode.o
+ uudecode.o \
+ $(LIBOBJS)
REGEXOBJS = GNUregex.o
LIBS = libmiscutil.a libregex.a
/*
- * $Id: util.c,v 1.21 1996/09/24 20:17:26 wessels Exp $
+ * $Id: util.c,v 1.22 1996/10/15 23:32:48 wessels Exp $
*
* DEBUG:
* AUTHOR: Harvest Derived
return xstrerror_buf;
}
-#if !HAVE_STRDUP
-/* define for systems that don't have strdup */
-char *
-strdup(char *s)
-{
- return (xstrdup(s));
-}
-#endif
-
-void
-xmemcpy(void *from, void *to, int len)
-{
-#if HAVE_MEMMOVE
- (void) memmove(from, to, len);
-#elif HAVE_BCOPY
- bcopy(to, from, len);
-#else
- (void) memcpy(from, to, len);
-#endif
-}
-
void
Tolower(char *q)
{
#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.in,v 1.47 1996/10/14 23:45:24 wessels Exp $
+# $Id: Makefile.in,v 1.48 1996/10/15 23:32:50 wessels Exp $
#
# Uncomment and customize the following to suit your needs:
#
AIO_LIBS = # @AIO_LIBS@
AUTH_OPT = # -DUSE_PROXY_AUTH=1
LOG_HDRS_OPT = # -DLOG_FULL_HEADERS=1
-ICMP_OPT = # -DUSE_ICMP=1
+ICMP_OPT = -DUSE_ICMP=1
DELAY_HACK = # -DDELAY_HACK=1
DEFINES = $(HOST_OPT) $(AIO_OPT) $(AUTH_OPT) $(LOG_HDRS_OPT) $(ICMP_OPT) \
$(DELAY_HACK)
/*
- * $Id: cachemgr.cc,v 1.36 1996/10/14 23:50:49 wessels Exp $
+ * $Id: cachemgr.cc,v 1.37 1996/10/15 23:32:51 wessels Exp $
*
* DEBUG: Section 0 CGI Cache Manager
* AUTHOR: Harvest Derived
sscanf(token, "%d", &obj_size);
token = strtok(tmp_line, w_space);
- store_time = strdup(token);
+ store_time = xstrdup(token);
token = strtok(tmp_line, w_space);
- obj_status = strdup(token);
+ obj_status = xstrdup(token);
token = strtok(tmp_line, w_space);
- last_ref = strdup(token);
+ last_ref = xstrdup(token);
token = strtok(tmp_line, w_space);
- ttl = strdup(token);
+ ttl = xstrdup(token);
token = strtok(tmp_line, w_space);
/* Active */
sscanf(token, "%d", &ref_cnt);
token = strtok(tmp_line, w_space);
- sto = strdup(token);
+ sto = xstrdup(token);
token = strtok(tmp_line, w_space);
- status = strdup(token);
+ status = xstrdup(token);
printf("<LI>Cache: <A HREF=\"%s\">%s</A><BR>",
url, url);
time_t time_val;
if ((s = strrchr(argv[0], '/')))
- progname = strdup(s + 1);
+ progname = xstrdup(s + 1);
else
- progname = strdup(argv[0]);
+ progname = xstrdup(argv[0]);
if ((s = getenv("SCRIPT_NAME")) != NULL) {
- script_name = strdup(s);
+ script_name = xstrdup(s);
}
strcpy(hostname, CACHEMGR_HOSTNAME);
/*
- * $Id: icmp.cc,v 1.21 1996/10/15 04:57:52 wessels Exp $
+ * $Id: icmp.cc,v 1.22 1996/10/15 23:32:51 wessels Exp $
*
* DEBUG: section 37 ICMP Routines
* AUTHOR: Duane Wessels
pecho->to = to;
pecho->opcode = (unsigned char) opcode;
pecho->psize = len;
- memcpy(pecho->payload, payload, len);
+ xmemcpy(pecho->payload, payload, len);
icmpQueueSend(pecho, sizeof(pingerEchoData) - 8192 + len, xfree);
}
StoreEntry *entry;
icp_common_t header;
char *url;
- memcpy(&header, buf, sizeof(icp_common_t));
+ xmemcpy(&header, buf, sizeof(icp_common_t));
url = buf + sizeof(icp_common_t);
if (neighbors_do_private_keys && header.reqnum) {
key = storeGeneratePrivateKey(url, METHOD_GET, header.reqnum);
return;
payload = get_free_8k_page();
len = sizeof(icp_common_t);
- memcpy(payload, header, len);
+ xmemcpy(payload, header, len);
strcpy(payload + len, url);
len += ulen + 1;
icmpSendEcho(to, S_ICMP_ICP, payload, len);
/*
- * $Id: ipcache.cc,v 1.74 1996/10/15 18:06:24 wessels Exp $
+ * $Id: ipcache.cc,v 1.75 1996/10/15 23:32:53 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
i->addrs.count = (unsigned char) addr_count;
i->addrs.in_addrs = xcalloc(addr_count, sizeof(struct in_addr));
for (k = 0; k < addr_count; k++)
- memcpy(&i->addrs.in_addrs[k].s_addr,
+ xmemcpy(&i->addrs.in_addrs[k].s_addr,
*(hp->h_addr_list + k),
hp->h_length);
i->status = IP_CACHED;
/*
- * $Id: pinger.cc,v 1.8 1996/10/15 18:06:25 wessels Exp $
+ * $Id: pinger.cc,v 1.9 1996/10/15 23:32:54 wessels Exp $
*
* DEBUG: section 37 ICMP Routines
* AUTHOR: Duane Wessels
if (payload) {
if (len > MAX_PAYLOAD)
len = MAX_PAYLOAD;
- memcpy(echo->payload, payload, len);
+ xmemcpy(echo->payload, payload, len);
icmp_pktsize += len;
}
icmp->icmp_cksum = in_cksum((u_short *) icmp, icmp_pktsize);
/*
- * $Id: store.cc,v 1.130 1996/10/10 22:19:36 wessels Exp $
+ * $Id: store.cc,v 1.131 1996/10/15 23:32:55 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
e->lock_count = 0;
BIT_RESET(e->flag, CLIENT_ABORT_REQUEST);
e->refcount = 0;
- e->lastref = squid_curtime;
+ e->lastref = timestamp;
e->timestamp = timestamp;
e->expires = expires;
e->lastmod = lastmod;
/*
- * $Id: tools.cc,v 1.73 1996/10/15 04:57:58 wessels Exp $
+ * $Id: tools.cc,v 1.74 1996/10/15 23:32:55 wessels Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
inaddrFromHostent(struct hostent *hp)
{
struct in_addr s;
- memcpy(&s.s_addr, hp->h_addr, sizeof(s.s_addr));
+ xmemcpy(&s.s_addr, hp->h_addr, sizeof(s.s_addr));
return s;
}