📄 ip.c
字号:
/* ip.c -- Magic C++ ip format translate
(Mostly) portable public-domain implementation
-- Copyright(C) 2003 Magicunix Infomation Technology Limited
This file is part of magicd.
magicd is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
For details, see the Magic C++ World-Wide-Web page,
`http://www.magicunix.com',
or send a mail to the Magic C++ developers <support@magicunix.com>.
*/
#include "fmt.h"
#include "ip.h"
unsigned int ip_fmt(s,ip)
char *s;
struct ip_address *ip;
{
unsigned int len;
unsigned int i;
len = 0;
i = fmt_ulong(s,(unsigned long) ip->d[0]); len += i; if (s) s += i;
i = fmt_str(s,"."); len += i; if (s) s += i;
i = fmt_ulong(s,(unsigned long) ip->d[1]); len += i; if (s) s += i;
i = fmt_str(s,"."); len += i; if (s) s += i;
i = fmt_ulong(s,(unsigned long) ip->d[2]); len += i; if (s) s += i;
i = fmt_str(s,"."); len += i; if (s) s += i;
i = fmt_ulong(s,(unsigned long) ip->d[3]); len += i; if (s) s += i;
return len;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -