Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.1 » SQL Anywhere 服务器 - 编程 » 数据库工具接口 (DBTools)

 

位字段

许多 DBTools 结构都使用位字段来以紧凑方式保存布尔信息。例如,备份结构包括以下位字段:

a_bit_field     backup_database : 1;
a_bit_field     backup_logfile  : 1;
a_bit_field     no_confirm  : 1;
a_bit_field     quiet       : 1;
a_bit_field     rename_log  : 1;
a_bit_field     truncate_log : 1;
a_bit_field     rename_local_log: 1;
a_bit_field     server_backup   : 1;

每个位字段的长度都是一位,这由结构声明中冒号右侧的 1 来指示。所使用的特定数据类型取决于指派给 a_bit_field 的值,此参数在 dbtools.h 的顶部设置且与操作系统相关。

将值 0 或 1 指派给位字段,以传递此结构中的布尔信息。