debian/rules: Use `git' potty wrapper.
[qmail] / fmtqfn.c
CommitLineData
2117e02e
MW
1#include "fmtqfn.h"
2#include "fmt.h"
3#include "auto_split.h"
4
5unsigned int fmtqfn(s,dirslash,id,flagsplit)
6char *s;
7char *dirslash;
8unsigned long id;
9int flagsplit;
10{
11 unsigned int len;
12 unsigned int i;
13
14 len = 0;
15 i = fmt_str(s,dirslash); len += i; if (s) s += i;
16 if (flagsplit)
17 {
18 i = fmt_ulong(s,id % auto_split); len += i; if (s) s += i;
19 i = fmt_str(s,"/"); len += i; if (s) s += i;
20 }
21 i = fmt_ulong(s,id); len += i; if (s) s += i;
22 if (s) *s++ = 0; ++len;
23 return len;
24}