⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getline.c

📁 KPIT GNU Tools is a set of GNU development tools for Renesas microcontrollers.
💻 C
字号:
/* Copyright 2002, Red Hat Inc. - all rights reserved *//*FUNCTION<<getline>>---read a line from a fileINDEX        getlineANSI_SYNOPSIS        #include <stdio.h>        ssize_t getline(char **<[bufptr]>, size_t *<[n]>, FILE *<[fp]>);TRAD_SYNOPSIS        #include <stdio.h>        ssize_t getline(<[bufptr]>, <[n]>, <[fp]>)        char **<[bufptr]>;        size_t *<[n]>;        FILE *<[fp]>;DESCRIPTION<<getline>> reads a file <[fp]> up to and possibly including thenewline character.  The line is read into a buffer pointed toby <[bufptr]> and designated with size *<[n]>.  If the buffer isnot large enough, it will be dynamically grown by <<getdelim>>.As the buffer is grown, the pointer to the size <[n]> will beupdated.<<getline>> is equivalent to getdelim(bufptr, n, '\n', fp);RETURNS<<getline>> returns <<-1>> if no characters were successfully read,otherwise, it returns the number of bytes successfully read.at end of file, the result is nonzero.PORTABILITY<<getline>> is a glibc extension.No supporting OS subroutines are directly required.*/#include <_ansi.h>#include <stdio.h>extern ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *));ssize_t_DEFUN(__getline, (lptr, n, fp),       char **lptr _AND       size_t *n   _AND       FILE *fp){  return __getdelim (lptr, n, '\n', fp);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -