Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
756 B

.TH ip4_fmt 3
.SH NAME
ip4_fmt \- write a formatted ASCII representation of an IPv4 number
.SH SYNTAX
.B #include <ip4.h>
unsigned int \fBip4_fmt\fP(char *\fIdest\fR,const char \fIip\fR[4]);
.SH DESCRIPTION
ip4_fmt formats an IPv4 number in dotted-decimal ASCII representation
from \fIip\fR and writes the result into \fIdest\fR. It returns the
number of bytes written.
If \fIdest\fR equals FMT_LEN (i.e. is zero), ip4_fmt returns the number
of bytes it would have written.
ip4_fmt does not append \\0.
For convenience, ip4.h defines the integer IP4_FMT to be big enough to
contain every possible ip4_fmt output plus \\0.
.SH EXAMPLE
#include <ip4.h>
char buf[IP4_FMT];
char ip[4];
buf[ip4_fmt(buf,ip)]=0;
.SH "SEE ALSO"
ip4_scan(3), ip6_fmt(3)