diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2022-05-09 15:00:06 +0200 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2022-05-09 15:00:06 +0200 |
commit | 003155eaa3e6dddf492317beb76cabc3fd9af3cd (patch) | |
tree | e25c56e159a5c94138b38908eab22732a196e795 /share | |
parent | dc3139d3c954f357393016aef2a6adb6d25e844f (diff) |
share/doc/grepc/examples/unit/*: Add examples
Add some examples of running grepc on the NGINX Unit repository.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'share')
-rw-r--r-- | share/doc/grepc/examples/unit/NXT_MAYBE_UNUSED | 10 | ||||
-rw-r--r-- | share/doc/grepc/examples/unit/nxt_http_field_set | 11 | ||||
-rw-r--r-- | share/doc/grepc/examples/unit/nxt_http_return_ctx_t | 8 | ||||
-rw-r--r-- | share/doc/grepc/examples/unit/nxt_http_route_rule_s | 21 | ||||
-rw-r--r-- | share/doc/grepc/examples/unit/nxt_http_route_rule_t | 26 | ||||
-rw-r--r-- | share/doc/grepc/examples/unit/nxt_inline | 5 | ||||
-rw-r--r-- | share/doc/grepc/examples/unit/nxt_sprintf | 22 | ||||
-rw-r--r-- | share/doc/grepc/examples/unit/nxt_uid_t | 5 |
8 files changed, 108 insertions, 0 deletions
diff --git a/share/doc/grepc/examples/unit/NXT_MAYBE_UNUSED b/share/doc/grepc/examples/unit/NXT_MAYBE_UNUSED new file mode 100644 index 0000000..5362305 --- /dev/null +++ b/share/doc/grepc/examples/unit/NXT_MAYBE_UNUSED @@ -0,0 +1,10 @@ + + +./src/nxt_clang.h:125: + +#define NXT_MAYBE_UNUSED __attribute__((__unused__)) + + +./src/nxt_clang.h:129: + +#define NXT_MAYBE_UNUSED diff --git a/share/doc/grepc/examples/unit/nxt_http_field_set b/share/doc/grepc/examples/unit/nxt_http_field_set new file mode 100644 index 0000000..fe47044 --- /dev/null +++ b/share/doc/grepc/examples/unit/nxt_http_field_set @@ -0,0 +1,11 @@ + + +./src/nxt_http.h:98: + +#define nxt_http_field_set(_field, _name, _value) \ + do { \ + (_field)->name_length = nxt_length(_name); \ + (_field)->value_length = nxt_length(_value); \ + (_field)->name = (u_char *) _name; \ + (_field)->value = (u_char *) _value; \ + } while (0) diff --git a/share/doc/grepc/examples/unit/nxt_http_return_ctx_t b/share/doc/grepc/examples/unit/nxt_http_return_ctx_t new file mode 100644 index 0000000..f3b506a --- /dev/null +++ b/share/doc/grepc/examples/unit/nxt_http_return_ctx_t @@ -0,0 +1,8 @@ + + +./src/nxt_http_return.c:17: + +typedef struct { + nxt_str_t location; + nxt_str_t encoded; +} nxt_http_return_ctx_t; diff --git a/share/doc/grepc/examples/unit/nxt_http_route_rule_s b/share/doc/grepc/examples/unit/nxt_http_route_rule_s new file mode 100644 index 0000000..61d747e --- /dev/null +++ b/share/doc/grepc/examples/unit/nxt_http_route_rule_s @@ -0,0 +1,21 @@ + + +./src/nxt_http_route.c:107: + +struct nxt_http_route_rule_s { + /* The object must be the first field. */ + nxt_http_route_object_t object:8; + uint32_t items; + + union { + uintptr_t offset; + + struct { + u_char *start; + uint16_t hash; + uint16_t length; + } name; + } u; + + nxt_http_route_pattern_t pattern[0]; +}; diff --git a/share/doc/grepc/examples/unit/nxt_http_route_rule_t b/share/doc/grepc/examples/unit/nxt_http_route_rule_t new file mode 100644 index 0000000..ad3f035 --- /dev/null +++ b/share/doc/grepc/examples/unit/nxt_http_route_rule_t @@ -0,0 +1,26 @@ + + +./src/nxt_http.h:202: + +typedef struct nxt_http_route_rule_s nxt_http_route_rule_t; + + +./src/nxt_http_route.c:107: + +struct nxt_http_route_rule_s { + /* The object must be the first field. */ + nxt_http_route_object_t object:8; + uint32_t items; + + union { + uintptr_t offset; + + struct { + u_char *start; + uint16_t hash; + uint16_t length; + } name; + } u; + + nxt_http_route_pattern_t pattern[0]; +}; diff --git a/share/doc/grepc/examples/unit/nxt_inline b/share/doc/grepc/examples/unit/nxt_inline new file mode 100644 index 0000000..e7ccbe9 --- /dev/null +++ b/share/doc/grepc/examples/unit/nxt_inline @@ -0,0 +1,5 @@ + + +./src/nxt_clang.h:11: + +#define nxt_inline static inline __attribute__((always_inline)) diff --git a/share/doc/grepc/examples/unit/nxt_sprintf b/share/doc/grepc/examples/unit/nxt_sprintf new file mode 100644 index 0000000..e140f54 --- /dev/null +++ b/share/doc/grepc/examples/unit/nxt_sprintf @@ -0,0 +1,22 @@ + + +./src/nxt_sprintf.h:15: + +NXT_EXPORT u_char *nxt_cdecl nxt_sprintf(u_char *buf, u_char *end, + const char *fmt, ...); + + +./src/nxt_sprintf.c:58: + +u_char * nxt_cdecl +nxt_sprintf(u_char *buf, u_char *end, const char *fmt, ...) +{ + u_char *p; + va_list args; + + va_start(args, fmt); + p = nxt_vsprintf(buf, end, fmt, args); + va_end(args); + + return p; +} diff --git a/share/doc/grepc/examples/unit/nxt_uid_t b/share/doc/grepc/examples/unit/nxt_uid_t new file mode 100644 index 0000000..6665f4f --- /dev/null +++ b/share/doc/grepc/examples/unit/nxt_uid_t @@ -0,0 +1,5 @@ + + +./src/nxt_credential.h:10: + +typedef uid_t nxt_uid_t; |