#include
#include
typedef struct ngx_buf_s ngx_buf_t;
struct ngx_buf_s
{
char name[32];
unsigned memory:1;
unsigned mmap:1;
unsigned flush:1;
};
int main(int argc, char **argv)
{
ngx_buf_t buf;
memset(&buf, 0, sizeof(ngx_buf_t));
strcpy(buf.name, "hello world!");
buf.memory = 1;
buf.mmap = 0;
buf.flush = 1;
printf("buf.name[%s]\n", buf.name);
printf("buf.memory[%d]\n", buf.memory);
printf("buf.mmap[%d]\n", buf.mmap);
printf("buf.flush[%d]\n", buf.flush);
return 0;
}
输出结果:
[fpf@localhost test]$ ./a.out
buf.name[hello world!]
buf.memory[1]
buf.mmap[0]
buf.flush[1]
阅读(4657) | 评论(1) | 转发(0) |