📄 netcommon.h
字号:
/* ---------------------------------------------------------------------------- CFL - A C Foundation Library Copyright (C) 1994-2003 Mark A Lindner This file is part of CFL. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ---------------------------------------------------------------------------- $Log: netcommon.h,v $ Revision 1.2 2003/06/22 09:42:03 markl Fixed compatiblity probems with int??_t types. Revision 1.1 2003/03/03 08:20:07 markl Initial checkin (clean compile on Solaris & OS X) ----------------------------------------------------------------------------*/#ifndef __cfl_netcommon_h#define __cfl_netcommon_h#include "config.h"#include <netdb.h>#include <netinet/in.h>#include <arpa/inet.h>#include <sys/time.h>#include <inttypes.h>#include "cfl/util.h"#ifndef HAVE_TYPE_IN_ADDR_Ttypedef uint32_t in_addr_t;#endif#ifndef HAVE_TYPE_IN_PORT_Ttypedef uint16_t in_port_t;#endif#define C_NET_BUFSZ 8192#define C_NET_CREATED 0#define C_NET_LISTENING 1#define C_NET_ACCEPTING 2#define C_NET_CONNECTED 3#define C_NET_SHUTDOWN 4#define C_NET_NTYPES 3extern const int __C_net_socktypes[C_NET_NTYPES];extern const char *__C_net_protocols[C_NET_NTYPES];extern c_bool_t __C_socket_addr2sock(struct sockaddr_in *sa, const char *addr);extern c_bool_t __C_socket_sock2addr(struct sockaddr_in *sa, char *addr, size_t addrsz);extern c_buffer_t *__C_net_get_buffer(void);#endif /* __cfl_netcommon_h *//* end of common header */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -