摘要:源代码: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) { ...
阅读全文
摘要: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 ...
阅读全文
摘要: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; ...
阅读全文
摘要:char *p ="你abc";strlen(p); //6 utf-8编码中
阅读全文
摘要:#undef NULL#if defined(__cplusplus)#define NULL 0#else#define NULL ((void *)0)#endif
阅读全文
摘要: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
阅读全文