【问题标题】:Nginx suffix meaningNginx后缀含义
【发布时间】:2021-01-27 20:45:34
【问题描述】:

当我阅读 Nginx 源代码时。我经常遇到以_t(例如:ngx_http_request_t)和_s(ngx_http_request_s)结尾的变量名。谁能解释一下 t 和 s 是什么意思?

【问题讨论】:

  • ngx_http.h 中是typedef struct ngx_http_request_s ngx_http_request_t; 行。所以我猜一个是结构体,另一个是结构体的typedef。

标签: nginx naming


【解决方案1】:

根据 Nginx 的官方文档:http://nginx.org/en/docs/dev/development_guide.html

类型名称以“_t”后缀结尾。

_t 表示“类型”

指向自身的结构具有名称,以“_s”结尾。

_s 表示“自我”

【讨论】:

    猜你喜欢
    • 2011-05-21
    • 2023-03-29
    • 2011-10-10
    • 2016-03-29
    • 1970-01-01
    • 2016-06-27
    • 2017-09-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多