path separator.
git-svn-id: svn://svn.tartarus.org/sgt/agedu@8242
cda61777-01e9-0310-a592-
d414129be87e
perror("agedu: mmap");
return 1;
}
perror("agedu: mmap");
return 1;
}
+ pathsep = trie_pathsep(mappedfile);
/*
* Trim trailing slash, just in case.
/*
* Trim trailing slash, just in case.
perror("agedu: mmap");
return 1;
}
perror("agedu: mmap");
return 1;
}
+ pathsep = trie_pathsep(mappedfile);
/*
* Trim trailing slash, just in case.
/*
* Trim trailing slash, just in case.
perror("agedu: mmap");
return 1;
}
perror("agedu: mmap");
return 1;
}
+ pathsep = trie_pathsep(mappedfile);
maxpathlen = trie_maxpathlen(mappedfile);
buf = snewn(maxpathlen, char);
maxpathlen = trie_maxpathlen(mappedfile);
buf = snewn(maxpathlen, char);
perror("agedu: mmap");
return 1;
}
perror("agedu: mmap");
return 1;
}
+ pathsep = trie_pathsep(mappedfile);
dcfg.address = httpserveraddr;
dcfg.port = httpserverport;
dcfg.address = httpserveraddr;
dcfg.port = httpserverport;
off_t root, indexroot;
int count;
size_t maxpathlen;
off_t root, indexroot;
int count;
size_t maxpathlen;
};
/* Union only used for computing alignment */
};
/* Union only used for computing alignment */
th.root = th.count = 0;
th.indexroot = 0;
th.maxpathlen = 0;
th.root = th.count = 0;
th.indexroot = 0;
th.maxpathlen = 0;
+ th.pathsep = (unsigned char)pathsep;
tb_seek(tb, 0);
tb_write(tb, &th, sizeof(th));
tb_seek(tb, 0);
tb_write(tb, &th, sizeof(th));
th.root = triebuild_unwind(tb, 0, &th.count);
th.indexroot = 0;
th.maxpathlen = tb->maxpathlen;
th.root = triebuild_unwind(tb, 0, &th.count);
th.indexroot = 0;
th.maxpathlen = tb->maxpathlen;
+ th.pathsep = (unsigned char)pathsep;
tb_seek(tb, 0);
tb_write(tb, &th, sizeof(th));
tb_seek(tb, 0);
tb_write(tb, &th, sizeof(th));
+char trie_pathsep(const void *t)
+{
+ const struct trie_header *hdr = NODE(t, 0, trie_header);
+ return (char)hdr->pathsep;
+}
+
struct triewalk_switch {
const struct trie_switch *sw;
int pos, depth, count;
struct triewalk_switch {
const struct trie_switch *sw;
int pos, depth, count;
+ * Return the path separator character in use in the trie.
+ */
+char trie_pathsep(const void *t);
+
+/*
* Return the length of the longest pathname stored in the trie,
* including its trailing NUL.
*/
* Return the length of the longest pathname stored in the trie,
* including its trailing NUL.
*/