Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-03-20 19:09:44 +0300
committerIgor Sysoev <igor@sysoev.ru>2003-03-20 19:09:44 +0300
commitdc479b4d98d5b65b78689c5282a31c70efadd928 (patch)
tree7caf32d89eec03484b14ebe74dfefd2a80c8fa02 /src/core
parent90ace68b69606b885578686e19d499a50d5e80b7 (diff)
nginx-0.0.1-2003-03-20-19:09:44 import
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_core.h2
-rw-r--r--src/core/ngx_string.c70
-rw-r--r--src/core/ngx_string.h1
3 files changed, 72 insertions, 1 deletions
diff --git a/src/core/ngx_core.h b/src/core/ngx_core.h
index 8170f858d..882b256eb 100644
--- a/src/core/ngx_core.h
+++ b/src/core/ngx_core.h
@@ -6,7 +6,7 @@
#define NGX_ERROR -1
#define NGX_DONE NGX_ERROR
#define NGX_AGAIN -2
-#define NGX_WAITING -3
+#define NGX_BUSY -3
#define NGX_DECLINED -4
#define NGX_ALERT -5
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
index 9e32b56f5..4beb11d67 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -1,5 +1,6 @@
#include <ngx_config.h>
+#include <ngx_core.h>
#include <ngx_string.h>
@@ -19,3 +20,72 @@ char *ngx_cpystrn(char *dst, char *src, size_t n)
return dst;
}
+
+
+int ngx_atoi(char *line, size_t n)
+{
+ int value;
+
+ for (value = 0; n--; line++) {
+ if (*line < '0' || *line > '9') {
+ return NGX_ERROR;
+ }
+
+ value = value * 10 + (*line - '0');
+ }
+
+ return value;
+}
+
+
+#if 0
+char *ngx_psprintf(ngx_pool_t *p, const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+
+ while (*fmt) {
+ switch(*fmt++) {
+ case '%':
+ switch(*fmt++) {
+ case 's':
+ s = va_arg(args, char *);
+ n += ngx_strlen(s);
+ break;
+
+ default:
+ n++;
+ }
+ default:
+ n++;
+ }
+ }
+
+ str = ngx_palloc(p, n);
+
+ va_start(args, fmt);
+
+ for (i = 0; i < n; i++) {
+ switch(*fmt++) {
+ case '%':
+ switch(*fmt++) {
+ case 's':
+ s = va_arg(args, char *);
+ while (str[i++] = s);
+ break;
+
+ default:
+ n++;
+ }
+ default:
+ str[i] = *fmt;
+ }
+ }
+
+ len += ngx_vsnprintf(errstr + len, sizeof(errstr) - len - 1, fmt, args);
+
+ va_end(args);
+
+}
+#endif
diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h
index c9d5d8049..8566d46e8 100644
--- a/src/core/ngx_string.h
+++ b/src/core/ngx_string.h
@@ -49,6 +49,7 @@ typedef struct {
#define ngx_cpymem(dst, src, n) memcpy(dst, src, n) + n
char *ngx_cpystrn(char *dst, char *src, size_t n);
+int ngx_atoi(char *line, size_t n);
#endif /* _NGX_STRING_H_INCLUDED_ */