"Fossies" - the Fresh Open Source Software Archive

Member "msmtp-1.8.5/src/stream.h" (13 Dec 2018, 1801 Bytes) of package /linux/privat/msmtp-1.8.5.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "stream.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.8.1_vs_1.8.2.

    1 /*
    2  * stream.h
    3  *
    4  * This file is part of msmtp, an SMTP client, and of mpop, a POP3 client.
    5  *
    6  * Copyright (C) 2005, 2007
    7  * Martin Lambers <marlam@marlam.de>
    8  *
    9  *   This program is free software; you can redistribute it and/or modify
   10  *   it under the terms of the GNU General Public License as published by
   11  *   the Free Software Foundation; either version 3 of the License, or
   12  *   (at your option) any later version.
   13  *
   14  *   This program is distributed in the hope that it will be useful,
   15  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
   16  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   17  *   GNU General Public License for more details.
   18  *
   19  *   You should have received a copy of the GNU General Public License
   20  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
   21  */
   22 
   23 #ifndef STREAM_H
   24 #define STREAM_H
   25 
   26 #include <stdio.h>
   27 
   28 
   29 /*
   30  * If a function with an 'errstr' argument returns a value != STREAM_EOK,
   31  * '*errstr' either points to an allocates string containing an error
   32  * description or is NULL.
   33  * If such a function returns STREAM_EOK, 'errstr' will not be changed.
   34  */
   35 #define STREAM_EOK              0       /* no error */
   36 #define STREAM_EIO              1       /* Input/output error */
   37 
   38 /*
   39  * stream_gets()
   40  *
   41  * Reads in at most one less than 'size' characters from 'f' and stores them
   42  * into the buffer pointed to by 'str'. Reading stops after an EOF or a newline.
   43  * If a newline is read, it is stored into the buffer. A '\0' is stored after
   44  * the last character in the buffer. The length of the resulting string (the
   45  * number of characters excluding the terminating '\0') will be stored in 'len'.
   46  * Used error codes: STREAM_EIO
   47  */
   48 int stream_gets(FILE *f, char *str, size_t size, size_t *len, char **errstr);
   49 
   50 #endif