📄 getline.c
字号:
/*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.*//* Copyright 2002, Red Hat Inc. - all rights reserved */#include <stdio.h>extern ssize_t __getdelim (char **, size_t *, int, FILE *);ssize_t__getline (lptr, n, fp) char **lptr; size_t *n; FILE *fp;{ return __getdelim (lptr, n, '\n', fp);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -