📄 strprint.3
字号:
.\"(c) Copyright 1992, 1993 by Panagiotis Tsirigotis.\"All rights reserved. The file named COPYRIGHT specifies the terms .\"and conditions for redistribution..\".\" strprint.3,v 1.1.1.1 1994/04/26 19:08:12 hardy Exp.TH STRPRINT 3X "30 September 1992".SH NAMEstr_sprint, tr_sprintv, str_nprint, str_nprintv, str_print, str_printv, strx_sprint, strx_sprintv, strx_nprint, strx_nprintv, strx_print, strx_printv -- formatted conversion to string.SH SYNOPSIS.LP.nf.ft B#include "str.h".LP.ft Bchar *str_sprint( buf, format, ... )char *buf ;char *format ;.LP.ft Bchar *str_sprintv( buf, format, ap )char *buf ;char *format ;va_list ap ;.LP.ft Bint str_nprint( buf, format, ... )char *buf ;char *format ;.LP.ft Bint str_nprintv( buf, format, ap )char *buf ;char *format ;va_list ap ;.LP.ft Bvoid str_print( countp, buf, format, ... )int *countp ;char *buf ;char *format ;.LP.ft Bvoid str_printv( countp, buf, format, ap )int *countp ;char *buf ;char *format ;va_list ap ;.LP.ft Bchar *strx_sprint( buf, len, format, ... )char *buf ;int len ;char *format ;.LP.ft Bchar *strx_sprintv( buf, len, format, ap )char *buf ;int len ;char *format ;va_list ap ;.LP.ft Bint strx_nprint( buf, len, format, ... )char *buf ;int len ;char *format ;.LP.ft Bint strx_nprintv( buf, len, format, ap )char *buf ;int len ;char *format ;va_list ap ;.LP.ft Bvoid strx_print( countp, buf, len, format, ... )int *countp ;char *buf ;int len ;char *format ;.LP.ft Bvoid strx_printv( countp, buf, len, format, ap )int *countp ;char *buf ;int len ;char *format ;va_list ap ;.SH DESCRIPTION.LPAll functions are similar in functionality to \fIsprintf()\fR.Their only difference is in their return values. For information about theirconversion capabilities, check \fISprint(3)\fR..LPThe difference between the \fIstr_*\fR and the \fIstrx_*\fR functionsis that the latter take an extra argument, the size of the buffer, sothat they will never write beyond the end of the buffer. Writingbeyond the end of the buffer is possible with the \fIstr_*\fR functions.Invoking any of the \fIstrx_*\fR functions with the.I lenargument set to 0is the same as calling the equivalent \fIstr_*\fR function..LPAll functions will append a.SM NULat the end of.I buf(the \fIstrx_*\fR functions will not do this if it would cause a buffer overrun)..LP.B str_print(),.B str_printv(),.B strx_print(),and.B strx_printv()will put in.I "*countp"the number of characters placed in .I bufexcluding the ending.SM NUL(this happens only if.I "*countp"is not.SM NULL)..LPThe functions that have a name ending in 'v' are similar to those withoutthe 'v' at the end of their nameexcept that instead of accepting a variable number of arguments, theyexpect a \fIvarargs(3)\fR argument list..SH "RETURN VALUES".LP.B str_sprint(),.B str_sprintv(),.B strx_sprint(),and.B strx_sprintv()return.I buf..LP.B str_nprint(),.B str_nprintv(),.B strx_nprint(),and.B strx_nprintv()return the number of characters placed in .I bufexcluding the ending.SM NUL..SH "SEE ALSO"Sprint(3)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -