icon Top 9 categories map      RocketAware > man pages >

fparseln(3)

Tips: Browse or Search all pages for efficient awareness of more than 6000 of the most popular reusable and open source applications, functions, libraries, and FAQs.


The "RKT couplings" below include links to source code, updates, additional information, advice, FAQs, and overviews.


Home

Search all pages


Subjects

By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Math
Integer, Floating point, Matrix, Statistics, Boolean, ...

Processing
Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Communications
Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...

    

RocketLink!--> Man page versions:



FPARSELN(3)               OpenBSD Programmer's Manual              FPARSELN(3)

NAME
     fparseln - return the next logical line from a stream



SYNOPSIS
     #include <util.h>

     char *
     fparseln(FILE *stream, size_t *len, size_t *lineno, const char delim[3],
             int flags);

DESCRIPTION
     The fparseln() function returns a pointer to the next logical line from
     the stream referenced by stream. This string is null terminated and dy-
     namically allocated on each invocation. It is the responsibility of the
     caller to free the pointer.

     By default, if a character is escaped, both it and the preceding escape
     character will be present in the returned string.  Various flags alter
     this behaviour.

     The meaning of the arguments is as follows:

     stream  The stream to read from.

     len     If not NULL, the length of the string is stored in the memory lo-
             cation referenced by len.

     lineno  If not NULL, the value of the memory location to which lineno
             references is incremented by the number of lines actually read
             from the file.

     delim   Contains the escape, continuation, and comment characters.  If a
             character is NUL then processing for that character is disabled.
             If NULL, all characters default to values specified below.  The
             contents of delim is as follows:

             delim[0]  The escape character, which defaults to `\', is used to
                       remove any special meaning from the next character.

             delim[1]  The continuation character, which defaults to `\', is
                       used to indicate that the next line should be concate-
                       nated with the current one if this character is the
                       last character on the current line and is not escaped.

             delim[2]  The comment character, which defaults to `#', if not
                       escaped indicates the beginning of a comment that ex-
                       tends until the end of the current line.

     flags   If non-zero, alter the operation of fparseln().  The various
             flags, which may be OR'ed together, are:

             FPARSELN_UNESCCOMM  Remove escape preceding an escaped comment.

             FPARSELN_UNESCCONT  Remove escape preceding an escaped continua-
                                 tion.

             FPARSELN_UNESCESC   Remove escape preceding an escaped escape.

             FPARSELN_UNESCREST  Remove escape preceding any other character.

             FPARSELN_UNESCALL   All of the above.

RETURN VALUES
     Upon successful completion a pointer to the parsed line is returned; oth-
     erwise, NULL is returned.

     Internally, the fparseln() function uses fgetln(3),  so all error condi-
     tions that apply to fgetln(3) apply to fparseln() as well.  In addition
     fparseln() may set errno to ENOMEM and return NULL if it runs out of mem-
     ory.

SEE ALSO
     fgetln(3)

OpenBSD 2.6                    December 1, 1997                              2

Source: OpenBSD 2.6 man pages. Copyright: Portions are copyrighted by BERKELEY
SOFTWARE DESIGN, INC., The Regents of the University of California, Massachusetts
Institute of Technology, Free Software Foundation, FreeBSD Inc., and others.



(Corrections, notes, and links courtesy of RocketAware.com)


[Detailed Topics]


[Overview Topics]



RocketLink!--> Man page versions:






Rapid-Links: Search | About | Comments | Submit Path: RocketAware > man pages > fparseln.3/
RocketAware.com is a service of Mib Software
Copyright 1999, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments