aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_file.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-10-22 16:38:26 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-10-22 16:38:26 +0000
commitdc9dd434aa1cfd24a98265742ff0ed4aeefc1f05 (patch)
treeceedf7b247bf2d5291da9c0cc2243fd3c3e505a9 /src/core/ngx_file.c
parent5bf3d25d69ecdbccaa98beeb089a7a6850529b89 (diff)
downloadnginx-dc9dd434aa1cfd24a98265742ff0ed4aeefc1f05.tar.gz
nginx-dc9dd434aa1cfd24a98265742ff0ed4aeefc1f05.zip
nginx-0.0.1-2003-10-22-20:38:26 import
Diffstat (limited to 'src/core/ngx_file.c')
-rw-r--r--src/core/ngx_file.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c
index 455b785fd..538adff1d 100644
--- a/src/core/ngx_file.c
+++ b/src/core/ngx_file.c
@@ -164,3 +164,44 @@ int ngx_next_temp_number(int collision)
return ngx_temp_number++;
}
+
+
+char *ngx_conf_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+{
+ char *p = conf;
+
+ int i, n;
+ ngx_str_t *value;
+ ngx_path_t *path, **pp;
+
+ pp = (ngx_path_t **) (p + cmd->offset);
+
+ if (*pp) {
+ return "is duplicate";
+ }
+
+ ngx_test_null(path, ngx_pcalloc(cf->pool, sizeof(ngx_path_t)), NULL);
+
+ *pp = path;
+
+ value = (ngx_str_t *) cf->args->elts;
+
+ path->name = value[1];
+
+ path->len = 0;
+
+ for (i = 0, n = 2; n < cf->args->nelts; i++, n++) {
+ path->level[i] = ngx_atoi(value[n].data, value[n].len);
+ if (path->level[i] == NGX_ERROR || path->level[i] == 0) {
+ return "invalid value";
+ }
+
+ path->len += path->level[i] + 1;
+ }
+
+ while (i < 3) {
+ path->level[i++] = 0;
+ }
+
+ return NULL;
+}