return itoa_buf;
}
+// atol() with the kilo/mega/giga/tera/peta/exa extensions.
+// (zetta and yotta don't fit in 64 bits.)
+long atolx(char *c)
+{
+ char *suffixes="kmgtpe", *end;
+ long val = strtol(c, &c, 0);
+
+ end = strchr(suffixes, tolower(*c));
+ if (end) val *= 1024<<((end-suffixes)*10);
+ return val;
+}
+
// Return how long the file at fd is, if there's any way to determine it.
off_t fdlength(int fd)
{
void itoa_to_buf(int n, char *buf, unsigned buflen);
char *utoa(unsigned n);
char *itoa(int n);
+long atolx(char *c);
off_t fdlength(int fd);
struct dirtree *read_dirtree_node(char *path);
struct dirtree *read_dirtree(char *path, struct dirtree *parent);