1. typedef struct {
    2. unsigned len:28;
    3. unsigned valid:1;
    4. unsigned no_cacheable:1;
    5. unsigned not_found:1;
    6. unsigned escape:1;
    7. u_char *data;
    8. } ngx_variable_value_t;
    1. for ( ;; ) {
    2. switch (*fmt) {
    3. case 'u':
    4. sign = 0;
    5. fmt++;
    6. continue;
    7. case 'm':
    8. max_width = 1;
    9. fmt++;
    10. continue;
    1. ssize_t
    2. ngx_atosz(u_char *line, size_t n)
    3. {
    4. ssize_t value, cutoff, cutlim;
    5. if (n == 0) {
    6. return NGX_ERROR;
    7. }
    8. cutoff = NGX_MAX_SIZE_T_VALUE / 10;
    9. cutlim = NGX_MAX_SIZE_T_VALUE % 10;
    10. for (value = 0; n--; line++) {
    11. if (*line < '0' || *line > '9') {
    12. return NGX_ERROR;
    13. }
    14. if (value >= cutoff && (value > cutoff || *line - '0' > cutlim)) {
    15. return NGX_ERROR;
    16. }
    17. value = value * 10 + (*line - '0');
    18. }
    19. return value;
    20. }
    1. #if (NGX_MEMCPY_LIMIT)
    2. void *
    3. ngx_memcpy(void *dst, const void *src, size_t n)
    4. {
    5. if (n > NGX_MEMCPY_LIMIT) {
    6. ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, "memcpy %uz bytes", n);
    7. ngx_debug_point();
    8. }
    9. return memcpy(dst, src, n);
    10. }
    11. #endif
    1. #define NGX_OK 0
    2. #define NGX_ERROR -1
    3. #define NGX_AGAIN -2
    4. #define NGX_BUSY -3
    5. #define NGX_DONE -4
    6. #define NGX_DECLINED -5
    7. #define NGX_ABORT -6