Klaus Demo nginx / 37cc165
ngx_strn2cmp() Igor Sysoev 15 years ago
2 changed file(s) with 26 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
486486
487487
488488 ngx_int_t
489 ngx_strn2cmp(u_char *s1, u_char *s2, size_t n1, size_t n2)
490 {
491 size_t n;
492 ngx_int_t m, z;
493
494 if (n1 <= n2) {
495 n = n1;
496 z = -1;
497
498 } else {
499 n = n2;
500 z = 1;
501 }
502
503 m = ngx_strncmp(s1, s2, n);
504
505 if (m || n1 == n2) {
506 return m;
507 }
508
509 return z;
510 }
511
512
513 ngx_int_t
489514 ngx_atoi(u_char *line, size_t n)
490515 {
491516 ngx_int_t value;
129129
130130 ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n);
131131 ngx_int_t ngx_rstrncasecmp(u_char *s1, u_char *s2, size_t n);
132 ngx_int_t ngx_strn2cmp(u_char *s1, u_char *s2, size_t n1, size_t n2);
132133
133134 ngx_int_t ngx_atoi(u_char *line, size_t n);
134135 ssize_t ngx_atosz(u_char *line, size_t n);