diff --git a/strconv/6.out b/strconv/6.out deleted file mode 100755 index b5b28792..00000000 Binary files a/strconv/6.out and /dev/null differ diff --git a/strconv/Makefile b/strconv/Makefile deleted file mode 100644 index c897d521..00000000 --- a/strconv/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2009 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -include $(GOROOT)/src/Make.inc - -TARG=dns/strconv -GOFILES=\ - strconv.go\ - -include $(GOROOT)/src/Make.pkg diff --git a/strconv/_gotest_.6 b/strconv/_gotest_.6 deleted file mode 100644 index d47f86ce..00000000 Binary files a/strconv/_gotest_.6 and /dev/null differ diff --git a/strconv/_test/dns/strconv.a b/strconv/_test/dns/strconv.a deleted file mode 100644 index 34dfab1f..00000000 Binary files a/strconv/_test/dns/strconv.a and /dev/null differ diff --git a/strconv/_testmain.6 b/strconv/_testmain.6 deleted file mode 100644 index 658d6c9d..00000000 Binary files a/strconv/_testmain.6 and /dev/null differ diff --git a/strconv/_testmain.go b/strconv/_testmain.go deleted file mode 100644 index c7c6fa4c..00000000 --- a/strconv/_testmain.go +++ /dev/null @@ -1,15 +0,0 @@ -package main - -import "dns/strconv" -import "testing" -import __regexp__ "regexp" - -var tests = []testing.InternalTest{ - {"strconv.TestConversion", strconv.TestConversion}, -} -var benchmarks = []testing.InternalBenchmark{} - -func main() { - testing.Main(__regexp__.MatchString, tests) - testing.RunBenchmarks(__regexp__.MatchString, benchmarks) -} diff --git a/strconv/strconv.go b/strconv/strconv.go deleted file mode 100644 index 33959eb0..00000000 --- a/strconv/strconv.go +++ /dev/null @@ -1,82 +0,0 @@ -package strconv - -import ( - "unicode" - conv "strconv" - "dns" -) - -const ( - m = 60 - h = m * m - d = 24 * h - w = 7 * d -) - -// Convert a Ttl to a value. Supported value 'm' for minutes, 'h' for hours -// 'w' for week and 'd' for days. Stuff like '1d1d' is legal and return the value of '2d' -func StringToSeconds(ttl string) (sec uint32, ok bool) { - num := "" - for _, k := range ttl { - if unicode.IsDigit(k) { - num += string(k) - } else { - i, _ := conv.Atoi(num) - switch k { - case 'm': - sec += uint32(i) * m - case 'h': - sec += uint32(i) * h - case 'd': - sec += uint32(i) * d - case 'w': - sec += uint32(i) * w - default: - return - } - num = "" - } - } - i, _ := conv.Atoi(num) - sec += uint32(i) - return -} - -func SecondsToString(val uint32) (str string) { - mod := val / w - if mod > 0 { - str += conv.Itoa(int(mod)) + "w" - } - val -= mod * w - - mod = val / d - if mod > 0 { - str += conv.Itoa(int(mod)) + "d" - } - val -= mod * d - - mod = val / h - if mod > 0 { - str += conv.Itoa(int(mod)) + "h" - } - val -= mod * h - - mod = val / m - if mod > 0 { - str += conv.Itoa(int(mod)) + "m" - } - val -= mod * m - - if val > 0 { - str += conv.Itoa(int(val)) - } - return -} - -// Read a string and convert it to the correct -// Resource Record. -func SetString(s string) dns.RR { - - k := new(dns.RR_DNSKEY) - return k -} diff --git a/strconv/ttl_test.go b/ttl_test.go similarity index 100% rename from strconv/ttl_test.go rename to ttl_test.go