Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2022-05-03 | Fixed #define style. | Alejandro Colomar | 1 | -46/+23 | |
We had a mix of styles for declaring function-like macros: Style A: #define \ foo() \ do { \ ... \ } while (0) Style B: #define foo() \ do { \ ... \ } while (0) We had a similar number of occurences of each style: $ grep -rnI '^\w*(.*\\' | wc -l 244 $ grep -rn 'define.*(.*)' | wc -l 239 (Those regexes aren't perfect, but a very decent approximation.) Real examples: $ find src -type f | xargs sed -n '/^nxt_double_is_zero/,/^$/p' nxt_double_is_zero(f) \ (fabs(f) <= FLT_EPSILON) $ find src -type f | xargs sed -n '/define nxt_http_field_set/,/^$/p' #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) I'd like to standardize on a single style for them, and IMO, having the identifier in the same line as #define is a better option for the following reasons: - Programmers are used to `#define foo() ...` (readability). - One less line of code. - The program for finding them is really simple (see below). function grep_ngx_func() { if (($# != 1)); then >&2 echo "Usage: ${FUNCNAME[0]} <func>"; return 1; fi; find src -type f \ | grep '\.[ch]$' \ | xargs grep -l "$1" \ | sort \ | xargs pcregrep -Mn "(?s)^\$[\w\s*]+?^$1\(.*?^}"; find src -type f \ | grep '\.[ch]$' \ | xargs grep -l "$1" \ | sort \ | xargs pcregrep -Mn "(?s)define $1\(.*?^$" \ | sed -E '1s/^[^:]+:[0-9]+:/&\n\n/'; } $ grep_ngx_func Usage: grep_ngx_func <func> $ grep_ngx_func nxt_http_field_set 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) $ grep_ngx_func nxt_sprintf src/nxt_sprintf.c:56: 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; } ................ Scripted change: ................ $ find src -type f \ | grep '\.[ch]$' \ | xargs sed -i '/define *\\$/{N;s/ *\\\n/ /;s/ //}' | |||||
2021-10-26 | Custom implementation of Base64 decoding function. | Valentin Bartenev | 1 | -0/+2 | |
Compared to the previous implementation based on OpenSSL, the new implementation has these advantages: 1. Strict and reliable detection of invalid strings, including strings with less than 4 bytes of garbage at the end; 2. Allows to use Base64 strings without '=' padding. | |||||
2020-08-20 | Isolation: mount tmpfs by default. | Tiago Natel de Moura | 1 | -0/+10 | |
2020-05-15 | Fixed global constant declaration (appeared in 9af10e099d09). | Valentin Bartenev | 1 | -1/+1 | |
This fixes building with GCC 10, which is default to -fno-common. See: https://gcc.gnu.org/gcc-10/porting_to.html | |||||
2020-05-14 | Router: decode uri and args. | Axel Duch | 1 | -0/+3 | |
2020-03-30 | Configuration: support for rational numbers. | Valentin Bartenev | 1 | -0/+5 | |
2020-03-27 | Added nxt_is_complex_uri_encoded()/nxt_encode_complex_uri(). | Valentin Bartenev | 1 | -0/+3 | |
2019-10-10 | Changed nxt_memcasecmp() interface to avoid casts. | Igor Sysoev | 1 | -1/+1 | |
2019-09-19 | Basic support for serving static files. | Valentin Bartenev | 1 | -0/+1 | |
2019-09-16 | Configuration: added ability to access object members with slashes. | Valentin Bartenev | 1 | -0/+2 | |
Now URI encoding can be used to escape "/" in the request path: GET /config/listeners/unix:%2Fpath%2Fto%2Fsocket/ | |||||
2019-02-26 | Introduced nxt_memcpy_upcase(). | Igor Sysoev | 1 | -0/+2 | |
2018-06-25 | Removed '\r' and '\n' artifact macros. | Igor Sysoev | 1 | -13/+0 | |
2018-06-25 | Introduced nxt_length() macro. | Valentin Bartenev | 1 | -3/+3 | |
2017-10-05 | Improved applications versions handling. | Valentin Bartenev | 1 | -0/+9 | |
2017-08-17 | The new module configuration interface. | Igor Sysoev | 1 | -1/+1 | |
Configuration and building example: ./configure ./configure python ./configure php ./configure go make all or ./configure make nginext ./configure python make python ./configure php make php ./configure go make go Modules configuration options and building examples: ./configure python --module=python2 --config=python2.7-config make python2 ./configure php --module=php7 --config=php7.0-config --lib-path=/usr/local/php7.0 make php7 ./configure go --go=go1.6 --go-path=${HOME}/go1.6 make go1.6 | |||||
2017-08-16 | Renamed nxt_str_copy() to nxt_str_cstrz(). | Valentin Bartenev | 1 | -1/+1 | |
2017-06-20 | Using new memory pool implementation. | Igor Sysoev | 1 | -3/+3 | |
2017-02-01 | nxt_str_t changes. | Igor Sysoev | 1 | -42/+43 | |
2017-01-17 | Initial version. | Igor Sysoev | 1 | -0/+173 | |