leafnode  1.12.0
About: Leafnode is a store & forward NNTP proxy for small (dialup) sites.
  Fossies Dox: leafnode-1.12.0.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

getline.c File Reference
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
#include "leafnode.h"
#include "getline.h"
#include "critmem.h"
Include dependency graph for getline.c:

Go to the source code of this file.


ssize_t _getline (char *to, size_t size, FILE *stream)
ssize_t getline (char **pto, size_t *size, FILE *stream)

Function Documentation

◆ _getline()

ssize_t _getline ( char *  to,
size_t  size,
FILE *  stream 

getline.c - fetch a single line from a stdio stream, arbitrary length. Copyright (C) 2000 - 2002 Matthias Andree matth.nosp@m.ias..nosp@m.andre.nosp@m.e@gm.nosp@m.x.de

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or(at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Definition at line 28 of file getline.c.

Referenced by getline().

◆ getline()

ssize_t getline ( char **  pto,
size_t *  size,
FILE *  stream 

Clean-room reimplementation of getline, API compatible with glibc2.

  • >= 0 count of characters read
  • -1 for EOF/error

Definition at line 54 of file getline.c.

References _getline(), critmalloc(), and critrealloc().

Referenced by ygetaline().