1fmt_ip4(3)                 Library Functions Manual                 fmt_ip4(3)
2
3
4

NAME

6       fmt_ip4 - write a formatted ASCII representation of an IPv4 number
7

SYNTAX

9       #include <ip4.h>
10
11       unsigned int fmt_ip4(char *dest,const char ip[4]);
12

DESCRIPTION

14       fmt_ip4  formats  an IPv4 number in dotted-decimal ASCII representation
15       from ip and writes the result into dest. It returns the number of bytes
16       written.
17
18       If  dest  equals  FMT_LEN (i.e. is zero), fmt_ip4 returns the number of
19       bytes it would have written.
20
21       fmt_ip4 does not append \0.
22
23       For convenience, ip4.h defines the integer IP4_FMT to be big enough  to
24       contain every possible fmt_ip4 output plus \0.
25

EXAMPLE

27       #include <ip4.h>
28
29         char buf[IP4_FMT];
30         char ip[4];
31         buf[fmt_ip4(buf,ip)]=0;
32

SEE ALSO

34       scan_ip4(3), fmt_ip6(3), inet_ntop(3)
35
36
37
38                                                                    fmt_ip4(3)
Impressum