07 2013 档案

nginx main函数
摘要:源代码:int ngx_cdeclmain(int argc, char *const *argv){ ngx_int_t i; ngx_log_t *log; ngx_cycle_t *cycle, init_cycle; ngx_core_conf_t *ccf; ngx_debug_init(); if (ngx_strerror_init() != NGX_OK) { return 1; } if (ngx_get_options(argc, argv) != NGX_OK) { ... 阅读全文

posted @ 2013-07-31 10:32 andyhe 阅读(753) 评论(0) 推荐(0) 编辑

nginx 日志模块
摘要:ngx_http_log_module.c数据结构typedef struct { void **main_conf; void **srv_conf; void **loc_conf;} ngx_http_conf_ctx_t;typedef struct ngx_http_log_op_s ngx_http_log_op_t;typedef u_char *(*ngx_http_log_op_run_pt) (ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t ... 阅读全文

posted @ 2013-07-25 17:07 andyhe 阅读(593) 评论(0) 推荐(0) 编辑

nginx 源码阅读 core
摘要:ngx_config.h数据对齐#define ngx_align(d, a) (((d) + (a - 1)) & ~(a - 1))ngx_core.h#define ngx_abs(value) (((value) >= 0) ? (value) : - (value))#define ngx_max(val1, val2) ((val1 val2) ? (val2) : (val1))数据结构ngx_arraytypedef struct { void *elts; ngx_uint_t nelts; size_t size; ... 阅读全文

posted @ 2013-07-25 10:54 andyhe 阅读(268) 评论(0) 推荐(0) 编辑

c字符数组里的中文
摘要:char *p ="你abc";strlen(p); //6 utf-8编码中 阅读全文

posted @ 2013-07-19 10:36 andyhe 阅读(523) 评论(0) 推荐(0) 编辑

linux NULL 的定义
摘要:#undef NULL#if defined(__cplusplus)#define NULL 0#else#define NULL ((void *)0)#endif 阅读全文

posted @ 2013-07-19 00:01 andyhe 阅读(1301) 评论(0) 推荐(0) 编辑

c字符指针与字符数组的区别
摘要:1.定义char *pchar; //定义了指针,没赋值之前不能使用。如果:printf("*pchar:%c\n",*pchar); 出现段错误Segmentation fault (core dumped)gcc 中pchar 指向了0这个虚拟地址空间。显然个空间并没有物理地址映射。char arrchar[10]; //分配了空间#include void main(){ char *pchar; char achar[10]; printf("pchar: %x\n",pchar); printf("&pchar: %x\n&q 阅读全文

posted @ 2013-07-18 22:20 andyhe 阅读(252) 评论(0) 推荐(0) 编辑

导航

点击右上角即可分享
微信分享提示