For example there are so many typedef
s to a 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, I know the structure name such as ngx_module_s
is ok to be used, why typedef
it with ngx_module_t
? Is this good design? And, what are the benefits to do this?
Is this kind of good practice when programming in the C language? And, what is the name of this practice? Why is it good or bad?