diff options
| author | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
| commit | 69aec538b456402170dc723af417ba5c05389c32 (patch) | |
| tree | e6f34c543f17c6392447ea337b2e2868212424d1 /dnscname.c | |
| download | qmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2 qmail-69aec538b456402170dc723af417ba5c05389c32.zip | |
qmail 1.03 import
Diffstat (limited to 'dnscname.c')
| -rw-r--r-- | dnscname.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/dnscname.c b/dnscname.c new file mode 100644 index 0000000..b3cd6f1 --- /dev/null +++ b/dnscname.c | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #include "substdio.h" | ||
| 2 | #include "subfd.h" | ||
| 3 | #include "stralloc.h" | ||
| 4 | #include "dns.h" | ||
| 5 | #include "dnsdoe.h" | ||
| 6 | #include "readwrite.h" | ||
| 7 | #include "exit.h" | ||
| 8 | |||
| 9 | stralloc sa = {0}; | ||
| 10 | |||
| 11 | void main(argc,argv) | ||
| 12 | int argc; | ||
| 13 | char **argv; | ||
| 14 | { | ||
| 15 | if (!argv[1]) _exit(100); | ||
| 16 | |||
| 17 | if (!stralloc_copys(&sa,argv[1])) | ||
| 18 | { substdio_putsflush(subfderr,"out of memory\n"); _exit(111); } | ||
| 19 | |||
| 20 | dns_init(0); | ||
| 21 | dnsdoe(dns_cname(&sa)); | ||
| 22 | substdio_putflush(subfdout,sa.s,sa.len); | ||
| 23 | substdio_putsflush(subfdout,"\n"); | ||
| 24 | _exit(0); | ||
| 25 | } | ||
