c - why typedef is used so widely in nginx? -
for example there many typedef
s huge number of structures in ngx_core.h
typedef struct ngx_module_s ngx_module_t; typedef struct ngx_conf_s ngx_conf_t; typedef struct ngx_cycle_s ngx_cycle_t; typedef struct ngx_pool_s ngx_pool_t; typedef struct ngx_chain_s ngx_chain_t; typedef struct ngx_log_s ngx_log_t; typedef struct ngx_array_s ngx_array_t; typedef struct ngx_open_file_s ngx_open_file_t; typedef struct ngx_command_s ngx_command_t; typedef struct ngx_file_s ngx_file_t; typedef struct ngx_event_s ngx_event_t; typedef struct ngx_event_aio_s ngx_event_aio_t; typedef struct ngx_connection_s ngx_connection_t;
in fact, know structure name such ngx_module_s
ok used, why typedef
ngx_module_t
? design? and, benefits this?
is kind of practice when programming in c language? and, name of practice? why or bad?
it's common practice. don't have use struct keyword each time declare variable.
Comments
Post a Comment