getln2.3
来自「linux下qmail的源码 本人加了一些注释」· 3 代码 · 共 65 行
3
65 行
.TH getln2 3.SH NAMEgetln2 \- read one line of data.SH SYNTAX.B #include <getln.h>int \fBgetln2\fP(&\fIss\fR,&\fIsa\fR,&\fIcont\fR,&\fIclen\fR,\fIsep\fR);substdio \fIss\fR;.brstralloc \fIsa\fR;.brchar *\fIcont\fR;.brunsigned int \fIclen\fR;.brint \fIsep\fR;.SH DESCRIPTION.B getln2reads a line of characters, terminated by a .I sepcharacter,from.IR ss .The line is returned in two pieces.The first piece is stored in.IR sa .The second piece is.IR cont ,a pointer to.I clencharacters inside the.I ssbuffer.The second piece must be copied somewhere elsebefore.I ssis used again.If.B getln2sees end-of-input before it sees.IR sep ,it sets.I clento 0 and does not set.IR cont .It puts the partial line into.IR sa ..B getln2normally returns 0.If it runs out of memory,or encounters an error from.IR ss ,it returns -1,setting.B errnoappropriately..SH "SEE ALSO"stralloc(3),substdio(3),getln(3)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?