From 2705d66b49502c9683631b0254013c9f8b42ca38 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Wed, 29 Dec 1999 17:50:34 +0000 Subject: [PATCH] Connect fparseln(3) for mailwrapper(8) --- lib/libutil/Makefile | 4 ++-- lib/libutil/fparseln.3 | 3 ++- lib/libutil/fparseln.c | 10 ++++++++-- lib/libutil/libutil.h | 10 ++++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index 48db2a184fa5..e06f22713a13 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -7,11 +7,11 @@ SHLIB_MINOR= 2 CFLAGS+=-Wall -DLIBC_SCCS -I${.CURDIR} -I${.CURDIR}/../../sys SRCS= login.c login_tty.c logout.c logwtmp.c pty.c setproctitle.c \ login_cap.c login_class.c login_auth.c login_times.c login_ok.c \ - _secure_path.c uucplock.c property.c auth.c realhostname.c + _secure_path.c uucplock.c property.c auth.c realhostname.c fparseln.c MAN3+= login.3 login_auth.3 login_tty.3 logout.3 logwtmp.3 pty.3 \ setproctitle.3 login_cap.3 login_class.3 login_times.3 login_ok.3 \ _secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \ - trimdomain.3 + trimdomain.3 fparseln.3 MAN5+= login.conf.5 auth.conf.5 MLINKS+= property.3 properties_read.3 property.3 properties_free.3 MLINKS+= property.3 property_find.3 diff --git a/lib/libutil/fparseln.3 b/lib/libutil/fparseln.3 index a5ea8dbe1ba6..ea1facd4566a 100644 --- a/lib/libutil/fparseln.3 +++ b/lib/libutil/fparseln.3 @@ -1,4 +1,5 @@ .\" $NetBSD: fparseln.3,v 1.7 1999/07/02 15:49:12 simonb Exp $ +.\" $FreeBSD$ .\" .\" Copyright (c) 1997 Christos Zoulas. All rights reserved. .\" @@ -36,7 +37,7 @@ .Sh LIBRARY .Lb libutil .Sh SYNOPSIS -.Fd #include +.Fd #include .Ft "char *" .Fo "fparseln" .Fa "FILE *stream" "size_t *len" "size_t *lineno" diff --git a/lib/libutil/fparseln.c b/lib/libutil/fparseln.c index cd4d3ddf3d12..f294bfe0a45d 100644 --- a/lib/libutil/fparseln.c +++ b/lib/libutil/fparseln.c @@ -1,4 +1,5 @@ /* $NetBSD: fparseln.c,v 1.9 1999/09/20 04:48:06 lukem Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -31,15 +32,16 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fparseln.c,v 1.9 1999/09/20 04:48:06 lukem Exp $"); +__RCSID("$FreeBSD$"); #endif +#include #include #include #include #include #include -#include +#include static int isescaped __P((const char *, const char *, int)); @@ -55,8 +57,10 @@ isescaped(sp, p, esc) const char *cp; size_t ne; +#if 0 _DIAGASSERT(sp != NULL); _DIAGASSERT(p != NULL); +#endif /* No escape character */ if (esc == '\0') @@ -92,7 +96,9 @@ fparseln(fp, size, lineno, str, flags) int cnt; char esc, con, nl, com; +#if 0 _DIAGASSERT(fp != NULL); +#endif len = 0; buf = NULL; diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h index f41c66590cd2..492370043f7a 100644 --- a/lib/libutil/libutil.h +++ b/lib/libutil/libutil.h @@ -60,6 +60,9 @@ void properties_free __P((properties list)); char *property_find __P((properties list, const char *name)); char *auth_getval __P((const char *name)); int realhostname __P((char *host, size_t hsize, const struct in_addr *ip)); +#ifdef _STDIO_H_ /* avoid adding new includes */ +char *fparseln __P((FILE *, size_t *, size_t *, const char[3], int)); +#endif __END_DECLS #define UU_LOCK_INUSE (1) @@ -78,4 +81,11 @@ __END_DECLS #define HOSTNAME_INVALIDADDR (2) #define HOSTNAME_INVALIDNAME (3) +/* fparseln(3) */ +#define FPARSELN_UNESCESC 0x01 +#define FPARSELN_UNESCCONT 0x02 +#define FPARSELN_UNESCCOMM 0x04 +#define FPARSELN_UNESCREST 0x08 +#define FPARSELN_UNESCALL 0x0f + #endif /* !_LIBUTIL_H_ */