宏:集中定义,多次使用
2012-08-29 10:48
120 查看
1:集中定义
#include <ci/internal/opts_netif_def.h>:
CI_CFG_OPT("", tcp_sndbuf_min, ci_uint32,
"Minimum value for SO_SNDBUF for TCP sockets. Set via O/S interface.",
, tcp_sndbuf, CI_CFG_TCP_SNDBUF_MIN, MIN, MAX, bincount)
2:使用其为数据结构:
typedef struct {
/* These fields are defined in a separate file that is also used by the
** configuration subsystem
*/
#define _CI_CFG_BITFIELD
#define _CI_CFG_BITFIELD1 :1
#define _CI_CFG_BITFIELD2 :2
#define _CI_CFG_BITFIELD3 :3
#define _CI_CFG_BITFIELD4 :4
#define _CI_CFG_BITFIELD8 :8
#define _CI_CFG_BITFIELD16 :16
#define _CI_CFG_BITFIELDA8 CI_ALIGN(8)
#undef CI_CFG_OPTFILE_VERSION
#undef CI_CFG_OPT
#undef CI_CFG_OPTGROUP
#define CI_CFG_OPTFILE_VERSION(version)
#define CI_CFG_OPTGROUP(group, category, expertise)
#define CI_CFG_OPT(env, name, type, doc, bits, group, default, min, max, presentation) \
type name _CI_CFG_BITFIELD##bits;
#include <ci/internal/opts_netif_def.h>
ci_boolean_t inited;
} ci_netif_config_opts;
ci_netif_config_opts is:
typedef struct {
ci_uint32 tcp_sndbuf_min;
}
3:使用其为赋值:
ci_netif_config_opts* opts;
# undef CI_CFG_OPTFILE_VERSION
# undef CI_CFG_OPTGROUP
# undef CI_CFG_OPT
# define CI_CFG_OPT(env, name, type, doc, type_modifider, group, \
default, minimum, maximum, presentation) \
opts->name = default;
# include <ci/internal/opts_netif_def.h>
opt->tcp_sndbuf_min = CI_CFG_TCP_SNDBUF_MIN;
#include <ci/internal/opts_netif_def.h>:
CI_CFG_OPT("", tcp_sndbuf_min, ci_uint32,
"Minimum value for SO_SNDBUF for TCP sockets. Set via O/S interface.",
, tcp_sndbuf, CI_CFG_TCP_SNDBUF_MIN, MIN, MAX, bincount)
2:使用其为数据结构:
typedef struct {
/* These fields are defined in a separate file that is also used by the
** configuration subsystem
*/
#define _CI_CFG_BITFIELD
#define _CI_CFG_BITFIELD1 :1
#define _CI_CFG_BITFIELD2 :2
#define _CI_CFG_BITFIELD3 :3
#define _CI_CFG_BITFIELD4 :4
#define _CI_CFG_BITFIELD8 :8
#define _CI_CFG_BITFIELD16 :16
#define _CI_CFG_BITFIELDA8 CI_ALIGN(8)
#undef CI_CFG_OPTFILE_VERSION
#undef CI_CFG_OPT
#undef CI_CFG_OPTGROUP
#define CI_CFG_OPTFILE_VERSION(version)
#define CI_CFG_OPTGROUP(group, category, expertise)
#define CI_CFG_OPT(env, name, type, doc, bits, group, default, min, max, presentation) \
type name _CI_CFG_BITFIELD##bits;
#include <ci/internal/opts_netif_def.h>
ci_boolean_t inited;
} ci_netif_config_opts;
ci_netif_config_opts is:
typedef struct {
ci_uint32 tcp_sndbuf_min;
}
3:使用其为赋值:
ci_netif_config_opts* opts;
# undef CI_CFG_OPTFILE_VERSION
# undef CI_CFG_OPTGROUP
# undef CI_CFG_OPT
# define CI_CFG_OPT(env, name, type, doc, type_modifider, group, \
default, minimum, maximum, presentation) \
opts->name = default;
# include <ci/internal/opts_netif_def.h>
opt->tcp_sndbuf_min = CI_CFG_TCP_SNDBUF_MIN;
相关文章推荐
- 解决办法:Flex4使用Efflex_v0.03.swc (Fx4/FP10),在该命名空间中多次定义了组件 MotionPath……
- 在使用EFCodeFirst中出现类型“System.Data.Objects.ObjectContext”在未被引用的程序集中定义的解决方案
- Ubuntu 16.04下使用gcc输出汇编的.0文件为可执行文件时出现:`_start'被多次定义
- 在使用vs2012中的MVC4出的错误!类型“System.Data.Entity.DbContext”在未被引用的程序集中定义
- 使用sqlite数据库时 “System.Data.Common.DbConnection”在未被引用的程序集中定义 错误原因
- 使用sqlite数据库,出现:类型“System.Data.SQLite.SQLiteParameter”在未被引用的程序集中定义
- 使用Unicode(宽字节字符集);多字节字符集中定义宽字节变量
- VS2012使用EF错误:类型“System.Data.Entity.DbContext”在未被引用的程序集中定义。
- 在使用EFCodeFirst中出现类型“System.Data.Objects.ObjectContext”在未被引用的程序集中定义的解决方案
- ado多次按条件使用一个记录集中的数据的方法
- 在使用vs2012中的MVC4出的错误!类型“System.Data.Entity.DbContext”在未被引用的程序集中定义
- android 算定义view 打包 jar(一次开发多次使用)
- 从数据库各种定义中找一个关键字的使用位置
- Eclipse使用方法和技巧二十七:定义自己的高速联想词
- 使用js根据屏幕大小动态定义rem大小
- OpenStack详细解读:定义,好处与使用实例(1)
- 类的定义和使用,集合的应用和构造函数,重载函数的应用!!
- 定义/控制自定义属性的使用
- 请定义一个宏,比较两个数a、b的大小,不能使用大于、小于、if语句。
- JavaScript使用prototype定义对象类型(转)[