From 28ca9458282823a172f24d42585ff0c45b1c8d19 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 7 May 1996 14:49:12 +0000 Subject: Mon May 6 09:51:05 1996 Roland McGrath * stdio/linewrap.c: New file. * stdio/Makefile (routines): Add linewrap. * stdio/stdio.h [__USE_GNU]: Declare line_wrap_stream, line_unwrap_stream. --- stdio/stdio.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'stdio/stdio.h') diff --git a/stdio/stdio.h b/stdio/stdio.h index 349b9c3..efaf2b9 100644 --- a/stdio/stdio.h +++ b/stdio/stdio.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -353,6 +353,22 @@ extern FILE *fmemopen __P ((__ptr_t __s, size_t __len, __const char *__modes)); necessary. *BUFLOC and *SIZELOC are updated with the buffer's location and the number of characters written on fflush or fclose. */ extern FILE *open_memstream __P ((char **__bufloc, size_t *__sizeloc)); + + +/* Modify STREAM so that it prefixes lines written on it with *LMARGIN + spaces and limits them to *RMARGIN columns total. If WRAP is not null, + words that extend past *RMARGIN are wrapped by replacing the whitespace + before them with a newline and *WRAP spaces. Otherwise, chars beyond + *RMARGIN are simply dropped until a newline. Returns STREAM after + modifying it, or NULL if there was an error. The pointers passed are + stored in the stream and so must remain valid until `line_unwrap_stream' + is called; the values pointed to can be changed between stdio calls. */ +extern FILE *line_wrap_stream __P ((FILE *__stream, + size_t *__lmargin, size_t *__rmargin, + size_t *__wrap)); + +/* Remove the hooks placed in STREAM by `line_wrap_stream'. */ +extern void line_unwrap_stream __P ((FILE *__stream)); #endif -- cgit v1.1