You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2015/11/21 01:42:26 UTC

[01/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/master e5b282f9a -> e95057f45


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/target.go
----------------------------------------------------------------------
diff --git a/newt/cli/target.go b/newt/cli/target.go
new file mode 100644
index 0000000..789c0d6
--- /dev/null
+++ b/newt/cli/target.go
@@ -0,0 +1,806 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cli
+
+import (
+	"bufio"
+	"fmt"
+	"log"
+	"os"
+	"path/filepath"
+	"sort"
+	"strconv"
+	"strings"
+)
+
+const TARGET_SECT_PREFIX = "_target_"
+
+type Target struct {
+	Vars map[string]string
+
+	Identities map[string]string
+
+	Capabilities []string
+
+	Dependencies []string
+
+	Cflags string
+	Lflags string
+	Aflags string
+
+	Name string
+
+	Arch string
+	Cdef string
+
+	Bsp string
+
+	Nest *Nest
+}
+
+// Check if the target specified by name exists for the Nest specified by
+// r
+func TargetExists(nest *Nest, name string) bool {
+	_, err := nest.GetConfig(TARGET_SECT_PREFIX+name, "name")
+	if err == nil {
+		return true
+	} else {
+		return false
+	}
+}
+
+func parseTargetStringSlice(str string) ([]string, error) {
+	slice := strings.Split(str, " ")
+	return slice, nil
+}
+
+func (t *Target) SetDefaults() error {
+	var err error
+
+	t.Name = t.Vars["name"]
+
+	// Must have an architecture set, default to sim.
+	if t.Vars["arch"] == "" {
+		t.Vars["arch"] = "sim"
+		t.Arch = "sim"
+	} else {
+		t.Arch = t.Vars["arch"]
+	}
+
+	t.Cdef = t.Vars["compiler_def"]
+	if t.Cdef == "" {
+		t.Cdef = "default"
+	}
+
+	t.Bsp = t.Vars["bsp"]
+	t.Cflags = t.Vars["cflags"]
+	t.Lflags = t.Vars["lflags"]
+
+	identities, err := parseTargetStringSlice(t.Vars["identities"])
+	if err != nil {
+		return err
+	}
+	t.Identities = map[string]string{}
+	for _, ident := range identities {
+	StatusMessage(VERBOSITY_VERBOSE, "  set default ident %s\n", ident)
+		t.Identities[ident] = t.Name
+	}
+	t.Capabilities, err = parseTargetStringSlice(t.Vars["capabilities"])
+	if err != nil {
+		return err
+	}
+
+	t.Dependencies, err = parseTargetStringSlice(t.Vars["dependencies"])
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (t *Target) HasIdentity(identity string) bool {
+	for cur, _ := range t.Identities {
+		if cur == identity {
+			return true
+		}
+	}
+
+	return false
+}
+
+// Load the target specified by name for the repository specified by r
+func LoadTarget(nest *Nest, name string) (*Target, error) {
+	t := &Target{
+		Nest: nest,
+	}
+
+	var err error
+
+	t.Vars, err = nest.GetConfigSect(TARGET_SECT_PREFIX + name)
+	if err != nil {
+		return nil, err
+	}
+
+	// Cannot have both a project and package set
+	err = t.SetDefaults()
+	if err != nil {
+		return nil, err
+	}
+
+	return t, nil
+}
+
+// Export a target, or all targets.  If exportAll is true, then all targets are exported, if false,
+// then only the target represented by targetName is exported
+func ExportTargets(nest *Nest, name string, exportAll bool, fp *os.File) error {
+	targets, err := GetTargets(nest)
+	if err != nil {
+		return err
+	}
+
+	for _, target := range targets {
+		log.Printf("[DEBUG] Exporting target %s", target.Name)
+
+		if !exportAll && target.Name != name {
+			continue
+		}
+
+		fmt.Fprintf(fp, "@target=%s\n", target.Name)
+
+		for k, v := range target.GetVars() {
+			fmt.Fprintf(fp, "%s=%s\n", k, v)
+		}
+	}
+	fmt.Fprintf(fp, "@endtargets\n")
+
+	return nil
+}
+
+func ImportTargets(nest *Nest, name string, importAll bool, fp *os.File) error {
+	s := bufio.NewScanner(fp)
+
+	var currentTarget *Target = nil
+
+	targets := make([]*Target, 0, 10)
+
+	if importAll {
+		StatusMessage(VERBOSITY_VERBOSE, "Importing all targets from %s",
+			fp.Name())
+	} else {
+		StatusMessage(VERBOSITY_VERBOSE, "Importing target %s from %s",
+			name, fp.Name())
+	}
+
+	for s.Scan() {
+		line := s.Text()
+
+		// scan lines
+		// lines defining a target start with @
+		if idx := strings.Index(line, "@"); idx == 0 {
+			// save existing target if it exists
+			if currentTarget != nil {
+				targets = append(targets, currentTarget)
+				currentTarget = nil
+			}
+
+			// look either for an end of target definitions, or a new target definition
+			if line == "@endtargets" {
+				break
+			} else {
+				elements := strings.SplitN(line, "=", 2)
+				// name is elements[0], and value is elements[1]
+
+				if importAll || elements[1] == name {
+					// create a current target
+					currentTarget = &Target{
+						Nest: nest,
+					}
+
+					var err error
+					currentTarget.Vars = map[string]string{}
+					if err != nil {
+						return err
+					}
+
+					currentTarget.Vars["name"] = elements[1]
+				}
+			}
+		} else {
+			if currentTarget != nil {
+				// target variables, set these on the current target
+				elements := strings.SplitN(line, "=", 2)
+				currentTarget.Vars[elements[0]] = elements[1]
+			}
+		}
+	}
+
+	if err := s.Err(); err != nil {
+		return err
+	}
+
+	for _, target := range targets {
+		if err := target.SetDefaults(); err != nil {
+			return err
+		}
+
+		if err := target.Save(); err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+// Get a list of targets for the repository specified by r
+func GetTargets(nest *Nest) ([]*Target, error) {
+	targets := []*Target{}
+	for sect, _ := range nest.Config {
+		if strings.HasPrefix(sect, TARGET_SECT_PREFIX) {
+			target, err := LoadTarget(nest, sect[len(TARGET_SECT_PREFIX):len(sect)])
+			if err != nil {
+				return nil, err
+			}
+
+			targets = append(targets, target)
+		}
+	}
+	return targets, nil
+}
+
+// Get a map[] of variables for this target
+func (t *Target) GetVars() map[string]string {
+	return t.Vars
+}
+
+// Return the compiler definition file for this target
+func (t *Target) GetCompiler() string {
+	path := t.Nest.BasePath + "/compiler/"
+	if t.Vars["compiler"] != "" {
+		path += t.Vars["compiler"]
+	} else {
+		path += t.Arch
+	}
+	path += "/"
+
+	return path
+}
+
+// Build the target
+func (t *Target) Build() error {
+	if t.Vars["project"] != "" {
+		StatusMessage(VERBOSITY_DEFAULT, "Building target %s (project = %s)\n",
+			t.Name, t.Vars["project"])
+		// Now load and build the project.
+		p, err := LoadProject(t.Nest, t, t.Vars["project"])
+		if err != nil {
+			return err
+		}
+		// The project is the target, and builds itself.
+		if err = p.Build(); err != nil {
+			return err
+		}
+	} else if t.Vars["egg"] != "" {
+		clutch, err := NewClutch(t.Nest)
+		if err != nil {
+			return err
+		}
+
+		err = clutch.Build(t, t.Vars["egg"], nil, nil)
+		if err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (t *Target) BuildClean(cleanAll bool) error {
+	if t.Vars["project"] != "" {
+		p, err := LoadProject(t.Nest, t, t.Vars["project"])
+		if err != nil {
+			return err
+		}
+
+		// The project is the target, and build cleans itself.
+		if err = p.BuildClean(cleanAll); err != nil {
+			return err
+		}
+	} else if t.Vars["egg"] != "" {
+		clutch, err := NewClutch(t.Nest)
+		if err != nil {
+			return err
+		}
+		err = clutch.BuildClean(t, t.Vars["egg"], cleanAll)
+		if err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (t *Target) Test(cmd string, flag bool) error {
+	clutch, err := NewClutch(t.Nest)
+	if err != nil {
+		return err
+	}
+
+	switch cmd {
+	case "test":
+		err = clutch.Test(t, t.Vars["egg"], flag)
+	case "testclean":
+		err = clutch.TestClean(t, t.Vars["egg"], flag)
+	default:
+		err = NewNewtError("Unknown command to Test() " + cmd)
+	}
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (t *Target) DeleteVar(name string) error {
+	targetCfgSect := TARGET_SECT_PREFIX + t.Vars["name"]
+
+	if err := t.Nest.DelConfig(targetCfgSect, name); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Save the target's configuration elements
+func (t *Target) Save() error {
+	nest := t.Nest
+
+	if _, ok := t.Vars["name"]; !ok {
+		return NewNewtError("Cannot save a target without a name")
+	}
+
+	targetCfg := TARGET_SECT_PREFIX + t.Vars["name"]
+
+	for k, v := range t.Vars {
+		if err := nest.SetConfig(targetCfg, k, v); err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (t *Target) Remove() error {
+	nest := t.Nest
+
+	if _, ok := t.Vars["name"]; !ok {
+		return NewNewtError("Cannot remove a target without a name")
+	}
+
+	cfgSect := TARGET_SECT_PREFIX + t.Vars["name"]
+
+	for k, _ := range t.Vars {
+		if err := nest.DelConfig(cfgSect, k); err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (t *Target) Download() error {
+	clutch, err := NewClutch(t.Nest)
+	if err != nil {
+		return err
+	}
+
+	egg, err := clutch.ResolveEggName(t.Bsp)
+	if err != nil {
+		return err
+	}
+
+	err = egg.LoadConfig(t, false)
+	if err != nil {
+		return err
+	}
+	if egg.DownloadScript == "" {
+		return NewNewtError(fmt.Sprintf("No egg.downloadscript defined for %s",
+			egg.FullName))
+	}
+	downloadScript := filepath.Join(egg.BasePath, egg.DownloadScript)
+
+	if t.Vars["project"] == "" {
+		return NewNewtError(fmt.Sprintf("No project associated with target %s",
+			t.Name))
+	}
+	p, err := LoadProject(t.Nest, t, t.Vars["project"])
+	if err != nil {
+		return err
+	}
+
+	os.Chdir(t.Nest.BasePath)
+
+	identString := ""
+	for ident, _ := range t.Identities {
+		identString = identString + ident
+	}
+
+	StatusMessage(VERBOSITY_DEFAULT, "Downloading with %s\n", downloadScript)
+	rsp, err := ShellCommand(fmt.Sprintf("%s %s %s", downloadScript,
+		filepath.Join(p.BinPath(), p.Name), identString))
+	if err != nil {
+		StatusMessage(VERBOSITY_DEFAULT, "%s", rsp);
+		return err
+	}
+
+	return nil
+}
+
+func (t *Target) Debug() error {
+	clutch, err := NewClutch(t.Nest)
+	if err != nil {
+		return err
+	}
+
+	egg, err := clutch.ResolveEggName(t.Bsp)
+	if err != nil {
+		return err
+	}
+
+	err = egg.LoadConfig(t, false)
+	if err != nil {
+		return err
+	}
+	if egg.DebugScript == "" {
+		return NewNewtError(fmt.Sprintf("No egg.debugscript defined for %s",
+			egg.FullName))
+	}
+	debugScript := filepath.Join(egg.BasePath, egg.DebugScript)
+
+	if t.Vars["project"] == "" {
+		return NewNewtError(fmt.Sprintf("No project associated with target %s",
+			t.Name))
+	}
+	p, err := LoadProject(t.Nest, t, t.Vars["project"])
+	if err != nil {
+		return err
+	}
+
+	os.Chdir(t.Nest.BasePath)
+
+	identString := ""
+	for ident, _ := range t.Identities {
+		identString = identString + ident
+	}
+
+	StatusMessage(VERBOSITY_DEFAULT, "Debugging with %s %s\n", debugScript, p.Name)
+
+	cmdLine := []string{debugScript, filepath.Join(p.BinPath(), p.Name)}
+	cmdLine = append(cmdLine, identString)
+	err = ShellInteractiveCommand(cmdLine)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+type MemSection struct {
+	Name   string
+	Offset uint64
+	EndOff uint64
+}
+type MemSectionArray []*MemSection
+
+func (array MemSectionArray) Len() int {
+	return len(array)
+}
+
+func (array MemSectionArray) Less(i, j int) bool {
+	return array[i].Offset < array[j].Offset
+}
+
+func (array MemSectionArray) Swap(i, j int) {
+	array[i], array[j] = array[j], array[i]
+}
+
+func MakeMemSection(name string, off uint64, size uint64) *MemSection {
+	memsection := &MemSection{
+		Name:   name,
+		Offset: off,
+		EndOff: off + size,
+	}
+	return memsection
+}
+
+func (m *MemSection) PartOf(addr uint64) bool {
+	if addr >= m.Offset && addr < m.EndOff {
+		return true
+	} else {
+		return false
+	}
+}
+
+/*
+ * We accumulate the size of libraries to elements in this.
+ */
+type EggSize struct {
+	Name  string
+	Sizes map[string]uint32 /* Sizes indexed by mem section name */
+}
+
+type EggSizeArray []*EggSize
+
+func (array EggSizeArray) Len() int {
+	return len(array)
+}
+
+func (array EggSizeArray) Less(i, j int) bool {
+	return array[i].Name < array[j].Name
+}
+
+func (array EggSizeArray) Swap(i, j int) {
+	array[i], array[j] = array[j], array[i]
+}
+
+func MakeEggSize(name string, memSections map[string]*MemSection) *EggSize {
+	eggSize := &EggSize{
+		Name: name,
+	}
+	eggSize.Sizes = make(map[string]uint32)
+	for secName, _ := range memSections {
+		eggSize.Sizes[secName] = 0
+	}
+	return eggSize
+}
+
+/*
+ * Go through GCC generated mapfile, and collect info about symbol sizes
+ */
+func ParseMapFileSizes(fileName string) (map[string]*EggSize, map[string]*MemSection,
+	error) {
+	var state int = 0
+
+	file, err := os.Open(fileName)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	memSections := make(map[string]*MemSection)
+	eggSizes := make(map[string]*EggSize)
+
+	scanner := bufio.NewScanner(file)
+	for scanner.Scan() {
+		switch state {
+		case 0:
+			if strings.Contains(scanner.Text(), "Memory Configuration") {
+				state = 1
+			}
+		case 1:
+			if strings.Contains(scanner.Text(), "Origin") {
+				state = 2
+			}
+		case 2:
+			if strings.Contains(scanner.Text(), "*default*") {
+				state = 3
+				continue
+			}
+			array := strings.Fields(scanner.Text())
+			offset, err := strconv.ParseUint(array[1], 0, 64)
+			if err != nil {
+				return nil, nil, NewNewtError("Can't parse mem info")
+			}
+			size, err := strconv.ParseUint(array[2], 0, 64)
+			if err != nil {
+				return nil, nil, NewNewtError("Can't parse mem info")
+			}
+			memSections[array[0]] = MakeMemSection(array[0], offset,
+				size)
+		case 3:
+			if strings.Contains(scanner.Text(),
+				"Linker script and memory map") {
+				state = 4
+			}
+		case 4:
+			var addrStr string = ""
+			var sizeStr string = ""
+			var srcFile string = ""
+
+			if strings.Contains(scanner.Text(), "/DISCARD/") ||
+				strings.HasPrefix(scanner.Text(), "OUTPUT(") {
+				/*
+				 * After this there is only discarded symbols
+				 */
+				state = 5
+				continue
+			}
+
+			array := strings.Fields(scanner.Text())
+			switch len(array) {
+			case 1:
+				/*
+				 * section name on it's own, e.g.
+				 * *(.text*)
+				 *
+				 * section name + symbol name, e.g.
+				 * .text.Reset_Handler
+				 *
+				 * ignore these for now
+				 */
+				continue
+			case 2:
+				/*
+				 * Either stuff from beginning to first useful data e.g.
+				 * END GROUP
+				 *
+				 * or address of symbol + symbol name, e.g.
+				 * 0x00000000080002c8                SystemInit
+				 *
+				 * or section names with multiple input things, e.g.
+				 * *(.ARM.extab* .gnu.linkonce.armextab.*)
+				 *
+				 * or space set aside in linker script e.g.
+				 * 0x0000000020002e80      0x400
+				 * (that's the initial stack)
+				 *
+				 * ignore these for now
+				 */
+				continue
+			case 3:
+				/*
+				 * address, size, and name of file, e.g.
+				 * 0x000000000800bb04     0x1050 /Users/marko/foo/tadpole/hw//mcu/stm/stm32f3xx/bin/blinky_f3/libstm32f3xx.a(stm32f30x_syscfg.o)
+				 *
+				 * padding, or empty areas defined in linker script:
+				 * *fill*         0x000000000800cb71        0x3
+				 *
+				 * output section name, location, size, e.g.:
+				 * .bss            0x0000000020000ab0     0x23d0
+				 */
+				/*
+				 * Record addr, size and name to find library.
+				 */
+				if array[0] == "*fill*" {
+					addrStr = array[1]
+					sizeStr = array[2]
+					srcFile = array[0]
+				} else {
+					addrStr = array[0]
+					sizeStr = array[1]
+					srcFile = array[2]
+				}
+			case 4:
+				/*
+				 * section, address, size, name of file, e.g.
+				 * COMMON         0x0000000020002d28        0x8 /Users/marko/foo/tadpole/libs//os/bin/blinky_f3/libos.a(os_arch_arm.o)
+				 *
+				 * linker script symbol definitions:
+				 * 0x0000000020002e80                _ebss = .
+				 *
+				 * crud, e.g.:
+				 * 0x8 (size before relaxing)
+				 */
+				addrStr = array[1]
+				sizeStr = array[2]
+				srcFile = array[3]
+			default:
+				continue
+			}
+			addr, err := strconv.ParseUint(addrStr, 0, 64)
+			if err != nil {
+				continue
+			}
+			size, err := strconv.ParseUint(sizeStr, 0, 64)
+			if err != nil {
+				continue
+			}
+			if size == 0 {
+				continue
+			}
+			tmpStrArr := strings.Split(srcFile, "(")
+			srcLib := filepath.Base(tmpStrArr[0])
+			for name, section := range memSections {
+				if section.PartOf(addr) {
+					eggSize := eggSizes[srcLib]
+					if eggSize == nil {
+						eggSize =
+							MakeEggSize(srcLib, memSections)
+						eggSizes[srcLib] = eggSize
+					}
+					eggSize.Sizes[name] += uint32(size)
+					break
+				}
+			}
+		default:
+		}
+	}
+	file.Close()
+	for name, section := range memSections {
+		StatusMessage(VERBOSITY_VERBOSE, "Mem %s: 0x%x-0x%x\n",
+			name, section.Offset, section.EndOff)
+	}
+
+	return eggSizes, memSections, nil
+}
+
+/*
+ * Return a printable string containing size data for the libraries
+ */
+func PrintSizes(libs map[string]*EggSize,
+	sectMap map[string]*MemSection) (string, error) {
+	ret := ""
+
+	/*
+	 * Order sections by offset, and display lib sizes in that order.
+	 */
+	memSections := make(MemSectionArray, len(sectMap))
+	var i int = 0
+	for _, sec := range sectMap {
+		memSections[i] = sec
+		i++
+	}
+	sort.Sort(memSections)
+
+	/*
+	 * Order libraries by name, and display them in that order.
+	 */
+	eggSizes := make(EggSizeArray, len(libs))
+	i = 0
+	for _, es := range libs {
+		eggSizes[i] = es
+		i++
+	}
+	sort.Sort(eggSizes)
+
+	for _, sec := range memSections {
+		ret += fmt.Sprintf("%7s ", sec.Name)
+	}
+	ret += "\n"
+	for _, es := range eggSizes {
+		for i := 0; i < len(memSections); i++ {
+			ret += fmt.Sprintf("%7d ", es.Sizes[memSections[i].Name])
+		}
+		ret += fmt.Sprintf("%s\n", es.Name)
+	}
+	return ret, nil
+}
+
+func (t *Target) GetSize() (string, error) {
+	if t.Vars["project"] != "" {
+		StatusMessage(VERBOSITY_DEFAULT, "Inspecting target %s (project = %s)\n",
+			t.Name, t.Vars["project"])
+		// Now load the project, mapfile settings
+		p, err := LoadProject(t.Nest, t, t.Vars["project"])
+		if err != nil {
+			return "", err
+		}
+
+		c, err := NewCompiler(t.GetCompiler(), t.Cdef, t.Name, []string{})
+		if err != nil {
+			return "", err
+		}
+		if c.ldMapFile != true {
+			return "", NewNewtError("Build does not generate mapfile")
+		}
+		mapFile := p.BinPath() + p.Name + ".elf.map"
+
+		eggSizes, memSections, err := ParseMapFileSizes(mapFile)
+		if err != nil {
+			return "", err
+		}
+		return PrintSizes(eggSizes, memSections)
+	}
+	return "", NewNewtError("Target needs a project")
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/util.go
----------------------------------------------------------------------
diff --git a/newt/cli/util.go b/newt/cli/util.go
new file mode 100644
index 0000000..a938bf1
--- /dev/null
+++ b/newt/cli/util.go
@@ -0,0 +1,357 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cli
+
+import (
+	"bufio"
+	"bytes"
+	"fmt"
+	"github.com/hashicorp/logutils"
+	"github.com/spf13/viper"
+	"io/ioutil"
+	"log"
+	"os"
+	"os/exec"
+	"os/signal"
+	"path/filepath"
+	"runtime"
+	"strings"
+	"syscall"
+	"time"
+)
+
+type NewtError struct {
+	Text       string
+	StackTrace []byte
+}
+
+var Logger *log.Logger
+var Verbosity int
+var OK_STRING = " ok!\n"
+
+const (
+	VERBOSITY_SILENT  = 0
+	VERBOSITY_QUIET   = 1
+	VERBOSITY_DEFAULT = 2
+	VERBOSITY_VERBOSE = 3
+)
+
+func (se *NewtError) Error() string {
+	return se.Text + "\n" + string(se.StackTrace)
+}
+
+func NewNewtError(msg string) *NewtError {
+	err := &NewtError{
+		Text:       msg,
+		StackTrace: make([]byte, 1<<16),
+	}
+
+	runtime.Stack(err.StackTrace, true)
+
+	return err
+}
+
+func NewtErrorNoTrace(msg string) *NewtError {
+	return &NewtError{
+		Text:       msg,
+		StackTrace: nil,
+	}
+}
+
+// Initialize the CLI module
+func Init(level string, silent bool, quiet bool, verbose bool) {
+	if level == "" {
+		level = "WARN"
+	}
+
+	filter := &logutils.LevelFilter{
+		Levels: []logutils.LogLevel{"DEBUG", "VERBOSE", "INFO",
+			"WARN", "ERROR"},
+		MinLevel: logutils.LogLevel(level),
+		Writer:   os.Stderr,
+	}
+
+	log.SetOutput(filter)
+
+	if silent {
+		Verbosity = VERBOSITY_SILENT
+	} else if quiet {
+		Verbosity = VERBOSITY_QUIET
+	} else if verbose {
+		Verbosity = VERBOSITY_VERBOSE
+	} else {
+		Verbosity = VERBOSITY_DEFAULT
+	}
+}
+
+func checkBoolMap(mapVar map[string]bool, item string) bool {
+	v, ok := mapVar[item]
+	return v && ok
+}
+
+// Read in the configuration file specified by name, in path
+// return a new viper config object if successful, and error if not
+func ReadConfig(path string, name string) (*viper.Viper, error) {
+	v := viper.New()
+	v.SetConfigType("yaml")
+	v.SetConfigName(name)
+	v.AddConfigPath(path)
+
+	err := v.ReadInConfig()
+	if err != nil {
+		return nil, NewNewtError(err.Error())
+	} else {
+		return v, nil
+	}
+}
+
+func GetStringIdentities(v *viper.Viper, idents map[string]string, key string) string {
+	val := v.GetString(key)
+
+	for ident, _ := range idents {
+		overwriteVal := v.GetString(key + "." + ident + ".OVERWRITE")
+		if overwriteVal != "" {
+			val = strings.Trim(overwriteVal, "\n")
+			break
+		}
+
+		appendVal := v.GetString(key + "." + ident)
+		if appendVal != "" {
+			val += " " + strings.Trim(appendVal, "\n")
+		}
+	}
+	return strings.TrimSpace(val)
+}
+
+func GetStringSliceIdentities(v *viper.Viper, idents map[string]string,
+	key string) []string {
+
+	val := v.GetStringSlice(key)
+
+	// string empty items
+	result := []string{}
+	for _, item := range val {
+		if item == "" || item == " " {
+			continue
+		}
+		result = append(result, item)
+	}
+
+	for item, _ := range idents {
+		result = append(result, v.GetStringSlice(key+"."+item)...)
+	}
+
+	return result
+}
+
+func NodeExist(path string) bool {
+	if _, err := os.Stat(path); err == nil {
+		return true
+	} else {
+		return false
+	}
+}
+
+// Check whether the node (either dir or file) specified by path exists
+func NodeNotExist(path string) bool {
+	if _, err := os.Stat(path); os.IsNotExist(err) {
+		return true
+	} else {
+		return false
+	}
+}
+
+func FileModificationTime(path string) (time.Time, error) {
+	fileInfo, err := os.Stat(path)
+	if err != nil {
+		epoch := time.Unix(0, 0)
+		if os.IsNotExist(err) {
+			return epoch, nil
+		} else {
+			return epoch, NewNewtError(err.Error())
+		}
+	}
+
+	return fileInfo.ModTime(), nil
+}
+
+// Execute the command specified by cmdStr on the shell and return results
+func ShellCommand(cmdStr string) ([]byte, error) {
+	log.Print("[VERBOSE] " + cmdStr)
+	cmd := exec.Command("sh", "-c", cmdStr)
+
+	o, err := cmd.CombinedOutput()
+	log.Print("[VERBOSE] o=" + string(o))
+	if err != nil {
+		return o, NewNewtError(err.Error())
+	} else {
+		return o, nil
+	}
+}
+
+// Run interactive shell command
+func ShellInteractiveCommand(cmdStr []string) error {
+	log.Print("[VERBOSE] " + cmdStr[0])
+
+	//
+	// Block SIGINT, at least.
+	// Otherwise Ctrl-C meant for gdb would kill newt.
+	//
+	c := make(chan os.Signal, 1)
+	signal.Notify(c, os.Interrupt)
+	signal.Notify(c, syscall.SIGTERM)
+	go func(){
+		<-c
+	}()
+
+	// Transfer stdin, stdout, and stderr to the new process
+	// and also set target directory for the shell to start in.
+	pa := os.ProcAttr {
+		Files: []*os.File{os.Stdin, os.Stdout, os.Stderr},
+	}
+
+	// Start up a new shell.
+	proc, err := os.StartProcess(cmdStr[0], cmdStr, &pa)
+	if err != nil {
+		signal.Stop(c)
+		return NewNewtError(err.Error())
+	}
+
+	// Release and exit
+	_, err = proc.Wait()
+	if err != nil {
+		signal.Stop(c)
+		return NewNewtError(err.Error())
+	}
+	signal.Stop(c)
+	return nil
+}
+
+func CopyFile(srcFile string, destFile string) error {
+	_, err := ShellCommand(fmt.Sprintf("mkdir -p %s", filepath.Dir(destFile)))
+	if err != nil {
+		return err
+	}
+	if _, err := ShellCommand(fmt.Sprintf("cp -Rf %s %s", srcFile,
+		destFile)); err != nil {
+		return err
+	}
+	return nil
+}
+
+func CopyDir(srcDir, destDir string) error {
+	return CopyFile(srcDir, destDir)
+}
+
+// Print Silent, Quiet and Verbose aware status messages
+func StatusMessage(level int, message string, args ...interface{}) {
+	if Verbosity >= level {
+		fmt.Printf(message, args...)
+	}
+}
+
+// Reads each line from the specified text file into an array of strings.  If a
+// line ends with a backslash, it is concatenated with the following line.
+func ReadLines(path string) ([]string, error) {
+	file, err := os.Open(path)
+	if err != nil {
+		return nil, NewNewtError(err.Error())
+	}
+	defer file.Close()
+
+	lines := []string{}
+	scanner := bufio.NewScanner(file)
+
+	for scanner.Scan() {
+		line := scanner.Text()
+		concatted := false
+
+		if len(lines) != 0 {
+			prevLine := lines[len(lines)-1]
+			if len(prevLine) > 0 && prevLine[len(prevLine)-1:] == "\\" {
+				prevLine = prevLine[:len(prevLine)-1]
+				prevLine += line
+				lines[len(lines)-1] = prevLine
+
+				concatted = true
+			}
+		}
+
+		if !concatted {
+			lines = append(lines, line)
+		}
+	}
+
+	if scanner.Err() != nil {
+		return lines, NewNewtError(scanner.Err().Error())
+	}
+
+	return lines, nil
+}
+
+// Determines if a file was previously built with a command line invocation
+// different from the one specified.
+//
+// @param dstFile               The output file whose build invocation is being
+//                                  tested.
+// @param cmd                   The command that would be used to generate the
+//                                  specified destination file.
+//
+// @return                      true if the command has changed or if the
+//                                  destination file was never built;
+//                              false otherwise.
+func CommandHasChanged(dstFile string, cmd string) bool {
+	cmdFile := dstFile + ".cmd"
+	prevCmd, err := ioutil.ReadFile(cmdFile)
+	if err != nil {
+		return true
+	}
+
+	return bytes.Compare(prevCmd, []byte(cmd)) != 0
+}
+
+// Writes a file containing the command-line invocation used to generate the
+// specified file.  The file that this function writes can be used later to
+// determine if the set of compiler options has changed.
+//
+// @param dstFile               The output file whose build invocation is being
+//                                  recorded.
+// @param cmd                   The command to write.
+func WriteCommandFile(dstFile string, cmd string) error {
+	cmdPath := dstFile + ".cmd"
+	err := ioutil.WriteFile(cmdPath, []byte(cmd), 0644)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Removes all duplicate strings from the specified array, while preserving
+// order.
+func UniqueStrings(elems []string) []string {
+	set := make(map[string]bool)
+	result := make([]string, 0)
+
+	for _, elem := range elems {
+		if !set[elem] {
+			result = append(result, elem)
+			set[elem] = true
+		}
+	}
+
+	return result
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/coding_style.txt
----------------------------------------------------------------------
diff --git a/newt/coding_style.txt b/newt/coding_style.txt
new file mode 100644
index 0000000..0fb9a12
--- /dev/null
+++ b/newt/coding_style.txt
@@ -0,0 +1,57 @@
+Newt Coding Style 
+-- 
+
+- Line length is fixed to no more than 90 characters
+
+- At least every function should have documentation above it in godoc format.
+Err on the side of more comments rather than fewer.
+
+- Where possible, the form: 
+
+    if err := func(); err != nil {
+        return err
+    }
+
+Is the preferred method of doing error checking.  Note that "err" should be 
+assigned using the := operator to avoid conflicting with enclosing scope. 
+
+- In cases where it is infeasible to create an error variable, i.e. when 
+using multiple assignments on structure properties, the err variable should 
+be defined at the top of the function scope.  i.e.: 
+
+    func (inst *Installer) SetName(name string) {
+        // declaration at the top of the function 
+        var err error 
+
+        // ...some code here...
+        inst.Name, err = inst.ParseString(name)
+        if err != nil {
+            return err
+        }
+    }
+        
+
+- Every object which requires allocation, shall follow this pattern:
+    - The object itself has an Init() function which accesses to initialize
+      the object.  e.g.: 
+
+        func (inst *Installer) Init() error {
+            // Initialization functions here
+        }
+
+    - There shall be a New<Object Name> function which allocates a new
+    object of <Object Name> type, and calls the init function prior to 
+    allocating the new object.  e.g.: 
+
+        func NewInstaller() (*Installer, error) {
+            inst := &Installer{}
+            if err := inst.Init(); err != nil {
+                return nil, err
+            }
+            return inst, nil
+        }
+
+- Accessors are for object properties SHOULD ALWAYS be provided when setting
+class properties.  For reading object properties, accessor functions are 
+should be provided where it makes sense (i.e. to provide an implementation 
+contract.) 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/design.txt
----------------------------------------------------------------------
diff --git a/newt/design.txt b/newt/design.txt
new file mode 100644
index 0000000..83a374e
--- /dev/null
+++ b/newt/design.txt
@@ -0,0 +1,370 @@
+                          Design of Newt System
+
+
+
+1. Introduction 
+
+
+The newt tool allows for building and distributing embedded projects.  It's 
+goal is to make it simple for developers to create a source project and 
+manage that project, with an embedded twist.  In embedded systems, the core 
+operating system is often built and distributed along with system libraries
+and applications.  Additionally, there is a fair amount of complexity in 
+managing driver interfaces, board support packages, and both development and 
+production builds.  Right now, all of this is done for every project, and 
+everybody does it in a different way.
+
+Newt introduces the following core concepts: 
+
+Repository
+    The base directory of your embedded software.  A repository can contain 
+    multiple projects, and reflect multiple end products.  It is meant to be 
+    a logical collection of your source code.
+
+Project
+    Projects represent the individual build configurations of your embedded 
+    system.  The project files are what dictate the resulting binary that is 
+    generated.
+
+Package 
+    Packages represent libraries that are distributed.  Packages have multiple
+    types (e.g. "bsp", "library", "os") that represent their function within 
+    the newt system.
+
+
+In order to bring sanity to your embedded life (lonelieness and cat obsession
+left as an exercise for the user), Newt allows you to: 
+
+Build architecture specific binaries 
+    Newt contains the ability to manage and build for multiple different CPU
+    architectures, project definitions and board support packages. 
+
+Manage your drivers, board support and libraries 
+    Newt provides an infrastructure that helps you manage board capabilities, 
+    and drivers based upon what low-level features your libraries and projects 
+    use. 
+
+Distribute Binaries 
+    Newt provides the ability to generate signed firmware images, suitable for
+    booting with n-boot.  Flash can also take n-boot images + project images 
+    and create a full flash map.  
+
+Distribute Source 
+    Newt makes it easy to distribute and download libraries.  By providing a
+    clear interface to the lower layer drivers, and dependency checking across
+    both architecture and board support package: newt makes it easy to 
+    develop reusable software components across embedded projects. 
+
+Test 
+    Newt provides a test framework that allows you to easily define regression
+    and unit tests, and have them run automatically.  
+
+
+2. Usage 
+
+To get started with newt, first create a new repository: 
+
+    $ newt create repo <fw> 
+
+This creates a new repository in the directory specified by <fw>. 
+
+The repository has the following contents: 
+    $ newt repo create test_repo_1
+    Repo test_repo_1 successfully created!
+    $ cd test_repo_1/
+    $ tree
+    .
+    ├── compiler
+    ├── hw
+    │   └── bsp
+    ├── libs
+    ├── project
+    └── repo.yml
+
+
+The arch/ directory contains the architecture specific information for the 
+new repository.  By default, the sim architecture and compiler is installed: 
+which allows you to build new projects and software on your native OS and 
+try it out.  
+
+The newt tool also creates a directory .<fw> -- this contains the
+environment and configuration information for the current project.  More 
+information about this directory is contained in Appendix A. 
+
+Once you have a repo, you can enter that repo, and begin composing your 
+project.
+
+The first step to composing a project is to setup a build environment and 
+board support package for that product.  There are a set of board support 
+packages and architectures available at the following URL: 
+http://www.github.com/XXX. 
+
+Let's start with the board support package for the STM32-E407, which is a 
+test board for the ARM Cortex-M4, provided by Olimex 
+(https://www.olimex.com/Products/ARM/ST/STM32-E407/open-source-hardware). 
+To install the Olimex board support package, cd into the <fw> directory 
+and type: 
+
+    $ newt install bsp http://www.github.com/XXX/STM32-E407 
+    Downloading Board Support Definition from 
+        http://www.github.com/XXX/STM32-E407 ... ok
+    Board Support Definition STM32-E407 requires ARM architecture to be 
+        installed (http://www.github.com/XXX/ARM), is that OK? [Y/n] y
+    Downloading ARM architecture support    ... ok
+    Successfully installed BSP for STM32-E407! 
+    $ 
+
+The "install bsp" command goes out and installs the board support package 
+defined by the URL provided in the link.  In this case, the bsp is defined 
+on github.  Once the newt tool downloads the BSP, it notices that the BSP 
+requires the ARM architecture to be installed, and its currently not in the 
+workspace.  Newt will then download the definiton from the github URL, and 
+install the necessary architecture information.   
+
+After the dependency to the compiler has been fufilled, the bsp support 
+packages are installed into the working directory.  After the command 
+has finished, the following directory structure should exist: 
+
+    $ tree 
+    .
+    └── arch/
+        └── sim/
+            └── compiler/
+                └── compiler.yml 
+        └── arm/
+            └── compiler/
+                └── arm-gcc
+                    └── bin 
+                        └── arm-gcc 
+                        └── arm-as  
+                        └── .. <snip> .. 
+                └── compiler.yml
+            └── include/
+                └── rt_CMSIS.h
+            └── mcu/
+                └── stm32/
+                    └── arch_gpio.c 
+                    └── arch_gpio.h 
+                    └── .. <snip> .. 
+    └── bsp
+        └── stm32-e407
+            └── layout 
+                └── debug 
+                    └── stm32-e407.lds  
+                └── prod  
+                    └── stm32-e407.lds  
+            └── stm32-e407.yml 
+            └── bsp_flash_layout.h 
+            └── bsp_boot.s 
+            └── .. <snip> .. 
+    └── .<fw>
+        └── <fw>.yml 
+        └── <fw>.db 
+
+
+As you can see, a couple of new directories were created: 
+
+arch/arm
+    Definition files specific to the ARM architecture.   This is directory 
+    contains generic definition files across multiple MCU architectures. 
+
+arch/arm/mcu/stm32
+    This directory contains definition files specific to the 
+    STM32 MCU.  This includes things like SPI and UART definitions.  
+
+arch/arm/compiler
+    The compiler for the ARM architecture definition.  This includes an 
+    up-to-date, tested version of the arm-gcc compiler.  By default Newt uses
+    this compiler, however it can be overridden to use a system compiler as 
+    well. 
+
+bsp/stm32-e407 
+    This directory contains the board support files specific to the 
+    STM32-E407 development board. 
+
+bsp/stm32-e407/layout
+    This contains the memory layouts for build layouts, which can often be 
+    different for debug and production builds (e.g. run out of SRAM for debug
+    and Flash for prod.) 
+
+
+The next step is to create a project that will build on the test board.  Let's 
+say the first project is "blink_leds" a project that will load onto the 
+STM32-E407 and blink LED1. 
+
+To create the project, in the main directory enter: 
+
+    $ newt create project blink_leds
+    Creating project blink_leds in project/ ... ok 
+    Creating project scaffolding for blink_leds ... ok
+    $ 
+
+This will create the following directory structure: 
+
+    $ tree 
+    ..<snip>.. (same as previous step) 
+    └── project
+        └── blink_leds
+            └── blink_leds.yml 
+            └── blink_leds.c
+    $ 
+
+The file blink_leds.c will contain base scaffolding in order to build: 
+
+    #include <newt/core.h> 
+
+    int 
+    main(int argc, char **argv)
+    {
+        while (1) { /* your code here */ }
+        return (0);
+    }
+
+
+In order to blink LEDs, the next step is to install the LED package.   The LED
+package contains a standard API definition for controlling board LEDs, and 
+the architecture and board specific definitions for LEDs. 
+
+    $ newt install driver http://www.github.com/XXX/led-driver
+    Downloading driver ... ok
+    Checking for necessary bsp support, bsps found: sim, STM32-E407 ... ok 
+    Installing driver ... ok 
+    $ 
+
+Installing the driver will create the following directories in the root 
+directory of your project: 
+
+    $ tree 
+    ..<snip>.. (same as previous step) 
+    └── drivers
+        └── led-driver 
+            └── led-driver.yml 
+            └── src
+                └── led-driver.c 
+            └── include 
+                └── led-driver.h 
+            └── bsp 
+                └── stm32-e407  
+                    └── stm32-e407.c  
+                    └── stm32-e407.h 
+
+This driver will then be accessible in your project.  The next step is to
+enable it in your project definition, in order to do that, enter: 
+
+    $ newt project blink_leds use driver led-driver
+    Enabling led-driver in blink_leds project.
+
+Now edit project/blink_leds/blink_leds.c, and write the following code: 
+
+    #include <newt/core.h> 
+    #include <led_driver/led_driver.h> 
+
+    int 
+    main(int argc, char **argv)
+    {
+        int toggle = 0; 
+
+        while (1) {
+            if ((toggle++ % 2) == 0) {
+                led_off(LED_DRIVER_LED1);
+            } else {
+                led_on(LED_DRIVER_LED1);
+            }
+        }
+
+        return (0);
+    }
+
+Once this file is edited, you can now build your project.  In order to 
+build an image that can be loaded on the board, create a build definition: 
+
+    $ newt build_def create blink_leds_arm_build 
+    $ newt build_def edit blink_leds_arm_build set bsp=stm32-e407 
+    $ newt build_def edit blink_leds_arm_build set project=blink_leds 
+    $ newt build_def edit blink_leds_arm_build set layout=debug 
+
+This build definition is stored in the project build definition, and can now
+be referenced with the newt build command: 
+
+    $ newt build blink_leds_arm_build  
+    Building project blink_leds with bsp stm32-e407, layout debug ... ok 
+    $ 
+
+In order to see the output of the build, check the bin/ directory in the base 
+directory of your repo: 
+
+    $ cd bin; tree 
+    └── bin
+        └── blink_leds 
+            └── stm32-e407 
+                └── blink_leds.elf  
+                └── blink_leds.map 
+
+
+In order to load these files onto your board using GDB, please see the 
+Debugger Support section of this document. 
+
+3. Packages 
+
+Newt distributes libraries in the form of source packages, making it easy to 
+bundle and reuse source code across multiple repositories and projects.  
+Outside of the core architecture & board specific setup, all source code in 
+a newt project should be encapsulated within a package.
+
+A package has the following directory structure: 
+
+    $ cd pkg/os; tree 
+    └── os
+        └── os.yml 
+        └── include
+            └── arch 
+                └── sim 
+                    └── os_arch.h 
+                └── arm 
+                    └── os_arch.h 
+            └── os 
+                └── os_mutex.h
+                └── os_sem.h 
+            └── os.h 
+        └── src
+            └── arch 
+                └── sim
+                    └── os_arch_sim.c 
+                └── arm
+                    └── os_arch_arm.c 
+            └── os_mutex.c 
+            └── os_sched.c  
+        └── test 
+            └── os_mutex_test 
+                └── os_mutex_test.c 
+
+Building a Package
+
+In order to build a package, either: 
+
+    a) Include it in a project definition, in which case it will be built as a 
+    library and linked with the main application. 
+
+    b) Build it with target "test" in which case the specified regression test 
+    will be executed.  If no regression test is specified, all regression tests
+    will be run. 
+
+
+Running a Package's Unit Tests 
+
+To run a package's unit tests, cd into the package directory and run newt build
+test: 
+
+    $ cd pkg/os
+    $ newt build test 
+    Building regression tests in OS
+    Building OS ... ok 
+    Building Regression Tests ... ok 
+    Running test os_mutex_test ... ok
+    $
+
+Including a Package in a Project file 
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/newt.go
----------------------------------------------------------------------
diff --git a/newt/newt.go b/newt/newt.go
new file mode 100644
index 0000000..86d32b4
--- /dev/null
+++ b/newt/newt.go
@@ -0,0 +1,1395 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package main
+
+import (
+	"fmt"
+	"git-wip-us.apache.org/repos/asf/incubator-mynewt-newt.git/newt/cli"
+	"github.com/spf13/cobra"
+	"log"
+	"os"
+	"path/filepath"
+	"regexp"
+	"sort"
+	"strings"
+)
+
+var ExitOnFailure bool = false
+var ExportAll bool = false
+var ImportAll bool = false
+var NewtVersion string = "0.1"
+var NewtLogLevel string = ""
+var NewtNest *cli.Nest
+var newtSilent bool
+var newtQuiet bool
+var newtVerbose bool
+var NewtBranchClutch string
+var NewtBranchEgg string
+
+func NewtUsage(cmd *cobra.Command, err error) {
+	if err != nil {
+		sErr := err.(*cli.NewtError)
+		log.Printf("[DEBUG] %s", sErr.StackTrace)
+		fmt.Fprintf(os.Stderr, "Error: %s\n", sErr.Text)
+	}
+
+	if cmd != nil {
+		cmd.Help()
+	}
+	os.Exit(1)
+}
+
+// Display help text with a max line width of 79 characters
+func formatHelp(text string) string {
+	// first compress all new lines and extra spaces
+	words := regexp.MustCompile("\\s+").Split(text, -1)
+	linelen := 0
+	fmtText := ""
+	for _, word := range words {
+		word = strings.Trim(word, "\n ") + " "
+		tmplen := linelen + len(word)
+		if tmplen >= 80 {
+			fmtText += "\n"
+			linelen = 0
+		}
+		fmtText += word
+		linelen += len(word)
+	}
+	return fmtText
+}
+
+// Extracts "<key>=<value>" strings from the supplied slice and inserts them
+// into the specified target's variable map.
+func extractTargetVars(args []string, t *cli.Target) error {
+	for i := 0; i < len(args); i++ {
+		pair := strings.SplitN(args[i], "=", 2)
+		if len(pair) != 2 {
+			return cli.NewNewtError("invalid argument: " + args[i])
+		}
+
+		t.Vars[pair[0]] = pair[1]
+	}
+
+	return nil
+}
+
+func targetSetCmd(cmd *cobra.Command, args []string) {
+	if len(args) != 2 {
+		NewtUsage(cmd,
+			cli.NewNewtError("Must specify two arguments (sect & k=v) to set"))
+	}
+
+	t, err := cli.LoadTarget(NewtNest, args[0])
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+	ar := strings.Split(args[1], "=")
+
+	t.Vars[ar[0]] = ar[1]
+
+	if err := t.Save(); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
+		"Target %s successfully set %s to %s\n", args[0], ar[0], ar[1])
+}
+
+func targetUnsetCmd(cmd *cobra.Command, args []string) {
+	if len(args) != 2 {
+		NewtUsage(cmd,
+			cli.NewNewtError("Must specify two arguments (sect & k) to unset"))
+	}
+
+	t, err := cli.LoadTarget(NewtNest, args[0])
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	if err := t.DeleteVar(args[1]); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
+		"Target %s successfully unset %s\n", args[0], args[1])
+}
+
+// Type for sorting an array of target pointers alphabetically by name.
+type ByName []*cli.Target
+
+func (a ByName) Len() int           { return len(a) }
+func (a ByName) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
+func (a ByName) Less(i, j int) bool { return a[i].Vars["name"] < a[j].Vars["name"] }
+
+func targetShowCmd(cmd *cobra.Command, args []string) {
+	dispSect := ""
+	if len(args) == 1 {
+		dispSect = args[0]
+	}
+
+	targets, err := cli.GetTargets(NewtNest)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	sort.Sort(ByName(targets))
+
+	for _, target := range targets {
+		if dispSect == "" || dispSect == target.Vars["name"] {
+			cli.StatusMessage(cli.VERBOSITY_QUIET, target.Vars["name"]+"\n")
+
+			vars := target.GetVars()
+			var keys []string
+			for k := range vars {
+				keys = append(keys, k)
+			}
+
+			sort.Strings(keys)
+			for _, k := range keys {
+				cli.StatusMessage(cli.VERBOSITY_QUIET, "	%s: %s\n", k, vars[k])
+			}
+		}
+	}
+}
+
+func targetCreateCmd(cmd *cobra.Command, args []string) {
+	if len(args) != 1 {
+		NewtUsage(cmd, cli.NewNewtError("Wrong number of args to create cmd."))
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Creating target "+args[0]+"\n")
+
+	if cli.TargetExists(NewtNest, args[0]) {
+		NewtUsage(cmd, cli.NewNewtError(
+			"Target already exists, cannot create target with same name."))
+	}
+
+	target := &cli.Target{
+		Nest: NewtNest,
+		Vars: map[string]string{},
+	}
+	target.Vars["name"] = args[0]
+
+	err := target.Save()
+	if err != nil {
+		NewtUsage(nil, err)
+	} else {
+		cli.StatusMessage(cli.VERBOSITY_DEFAULT,
+			"Target %s successfully created!\n", args[0])
+	}
+}
+
+func targetBuildCmd(cmd *cobra.Command, args []string) {
+	if len(args) < 1 {
+		NewtUsage(cmd, cli.NewNewtError("Must specify target to build"))
+	}
+
+	t, err := cli.LoadTarget(NewtNest, args[0])
+	if err != nil {
+		NewtUsage(nil, err)
+	}
+
+	if len(args) > 1 && args[1] == "clean" {
+		if len(args) > 2 && args[2] == "all" {
+			err = t.BuildClean(true)
+		} else {
+			err = t.BuildClean(false)
+		}
+		if err != nil {
+			NewtUsage(nil, err)
+		}
+	} else {
+		// Parse any remaining key-value pairs and insert them into the target.
+		err = extractTargetVars(args[1:], t)
+		if err != nil {
+			NewtUsage(nil, err)
+		}
+
+		err = t.Build()
+		if err != nil {
+			NewtUsage(nil, err)
+		}
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Successfully run!\n")
+}
+
+func targetDelCmd(cmd *cobra.Command, args []string) {
+	if len(args) < 1 {
+		NewtUsage(cmd, cli.NewNewtError("Must specify target to delete"))
+	}
+
+	t, err := cli.LoadTarget(NewtNest, args[0])
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	// Clean target prior to deletion; ignore errors during clean.
+	t.BuildClean(false)
+
+	if err := t.Remove(); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
+		"Target %s successfully removed\n", args[0])
+}
+
+func targetTestCmd(cmd *cobra.Command, args []string) {
+	if len(args) < 1 {
+		NewtUsage(cmd, cli.NewNewtError("Must specify target to build"))
+	}
+
+	t, err := cli.LoadTarget(NewtNest, args[0])
+	if err != nil {
+		NewtUsage(nil, err)
+	}
+
+	if len(args) > 1 && args[1] == "clean" {
+		if len(args) > 2 && args[2] == "all" {
+			err = t.Test("testclean", true)
+		} else {
+			err = t.Test("testclean", false)
+		}
+		if err != nil {
+			NewtUsage(nil, err)
+		}
+	} else {
+		// Parse any remaining key-value pairs and insert them into the target.
+		err = extractTargetVars(args[1:], t)
+		if err != nil {
+			NewtUsage(cmd, err)
+		}
+
+		err = t.Test("test", ExitOnFailure)
+		if err != nil {
+			NewtUsage(nil, err)
+		}
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Successfully run!\n")
+}
+
+func targetSizeCmd(cmd *cobra.Command, args []string) {
+	if len(args) < 1 {
+		NewtUsage(cmd, cli.NewNewtError("Must specify target for sizing"))
+	}
+
+	t, err := cli.LoadTarget(NewtNest, args[0])
+	if err != nil {
+		NewtUsage(nil, err)
+	}
+
+	txt, err := t.GetSize()
+	if err != nil {
+		NewtUsage(nil, err)
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "%s", txt)
+}
+
+func targetDownloadCmd(cmd *cobra.Command, args []string) {
+	if len(args) < 1 {
+		NewtUsage(cmd, cli.NewNewtError("Must specify target to download"))
+	}
+
+	t, err := cli.LoadTarget(NewtNest, args[0])
+	if err != nil {
+		NewtUsage(nil, err)
+	}
+
+	err = t.Download()
+	if err != nil {
+		NewtUsage(nil, err)
+	}
+}
+
+func targetDebugCmd(cmd *cobra.Command, args []string) {
+	if len(args) < 1 {
+		NewtUsage(cmd, cli.NewNewtError("Must specify target for debug"))
+	}
+
+	t, err := cli.LoadTarget(NewtNest, args[0])
+	if err != nil {
+		NewtUsage(nil, err)
+	}
+
+	err = t.Debug()
+	if err != nil {
+		NewtUsage(nil, err)
+	}
+}
+
+func targetExportCmd(cmd *cobra.Command, args []string) {
+	var targetName string
+	if ExportAll {
+		targetName = ""
+	} else {
+		if len(args) < 1 {
+			NewtUsage(cmd, cli.NewNewtError("Must either specify -a flag or name of "+
+				"target to export"))
+		}
+		targetName = args[0]
+	}
+
+	err := cli.ExportTargets(NewtNest, targetName, ExportAll, os.Stdout)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+}
+
+func targetImportCmd(cmd *cobra.Command, args []string) {
+	var targetName string
+	if ImportAll {
+		targetName = ""
+	} else {
+		if len(args) < 1 {
+			NewtUsage(cmd, cli.NewNewtError("Must either specify -a flag or name of "+
+				"target to import"))
+		}
+
+		targetName = args[0]
+	}
+
+	err := cli.ImportTargets(NewtNest, targetName, ImportAll, os.Stdin)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
+		"Target(s) successfully imported!\n")
+}
+
+func targetAddCmds(base *cobra.Command) {
+	targetHelpText := formatHelp(`Targets tell the newt tool how to build the source
+		code within a given nest.`)
+	targetHelpEx := "  newt target create <target-name>\n"
+	targetHelpEx += "  newt target set <target-name> <var-name>=<value>\n"
+	targetHelpEx += "  newt target unset <target-name> <var-name>\n"
+	targetHelpEx += "  newt target show <target-name>\n"
+	targetHelpEx += "  newt target delete <target-name>\n"
+	targetHelpEx += "  newt target build <target-name> [clean[ all]]\n"
+	targetHelpEx += "  newt target test <target-name> [clean[ all]]\n"
+	targetHelpEx += "  newt target size <target-name>\n"
+	targetHelpEx += "  newt target download <target-name>\n"
+	targetHelpEx += "  newt target debug <target-name>\n"
+	targetHelpEx += "  newt target export [-a -export-all] [<target-name>]\n"
+	targetHelpEx += "  newt target import [-a -import-all] [<target-name>]"
+
+	targetCmd := &cobra.Command{
+		Use:     "target",
+		Short:   "Set and view target information",
+		Long:    targetHelpText,
+		Example: targetHelpEx,
+		PersistentPreRun: func(cmd *cobra.Command, args []string) {
+			cli.Init(NewtLogLevel, newtSilent, newtQuiet, newtVerbose)
+
+			var err error
+			NewtNest, err = cli.NewNest()
+			if err != nil {
+				NewtUsage(nil, err)
+			}
+		},
+		Run: func(cmd *cobra.Command, args []string) {
+			cmd.Usage()
+		},
+	}
+
+	setHelpText := formatHelp(`Set a target variable (<var-name>) on target 
+		<target-name> to value <value>.`)
+	setHelpEx := "  newt target set <target-name> <var-name>=<value>\n"
+	setHelpEx += "  newt target set my_target1 var_name=value\n"
+	setHelpEx += "  newt target set my_target1 arch=cortex_m4"
+
+	setCmd := &cobra.Command{
+		Use:     "set",
+		Short:   "Set target configuration variable",
+		Long:    setHelpText,
+		Example: setHelpEx,
+		Run:     targetSetCmd,
+	}
+
+	targetCmd.AddCommand(setCmd)
+
+	unsetHelpText := formatHelp(`Unset a target variable (<var-name>) on target
+		<target-name>.`)
+	unsetHelpEx := "  newt target unset <target-name> <var-name>\n"
+	unsetHelpEx += "  newt target unset my_target1 var_name"
+
+	unsetCmd := &cobra.Command{
+		Use:     "unset",
+		Short:   "Unset target configuration variable",
+		Long:    unsetHelpText,
+		Example: unsetHelpEx,
+		Run:     targetUnsetCmd,
+	}
+
+	targetCmd.AddCommand(unsetCmd)
+
+	delHelpText := formatHelp(`Delete the target specified by <target-name>.`)
+	delHelpEx := "  newt target delete <target-name>\n"
+	delHelpEx += "  newt target delete my_target1"
+
+	delCmd := &cobra.Command{
+		Use:     "delete",
+		Short:   "Delete target",
+		Long:    delHelpText,
+		Example: delHelpEx,
+		Run:     targetDelCmd,
+	}
+
+	targetCmd.AddCommand(delCmd)
+
+	createHelpText := formatHelp(`Create a target specified by <target-name>.`)
+	createHelpEx := "  newt target create <target-name>\n"
+	createHelpEx += "  newt target create my_target1"
+
+	createCmd := &cobra.Command{
+		Use:     "create",
+		Short:   "Create a target",
+		Long:    createHelpText,
+		Example: createHelpEx,
+		Run:     targetCreateCmd,
+	}
+
+	targetCmd.AddCommand(createCmd)
+
+	showHelpText := formatHelp(`Show all the variables for the target specified 
+		by <target-name>.`)
+	showHelpEx := "  newt target show <target-name>\n"
+	showHelpEx += "  newt target show my_target1"
+
+	showCmd := &cobra.Command{
+		Use:     "show",
+		Short:   "View target configuration variables",
+		Long:    showHelpText,
+		Example: showHelpEx,
+		Run:     targetShowCmd,
+	}
+
+	targetCmd.AddCommand(showCmd)
+
+	buildHelpText := formatHelp(`Build the target specified by <target-name>.  
+		If clean is specified, then all the binaries and object files for this 
+		target will be removed.  If the all option is specified, all binaries 
+		and object files for all targets will be removed.`)
+	buildHelpEx := "  newt target build <target-name> [clean[ all]]\n"
+	buildHelpEx += "  newt target build my_target1\n"
+	buildHelpEx += "  newt target build my_target1 clean\n"
+	buildHelpEx += "  newt target build my_target1 clean all\n"
+
+	buildCmd := &cobra.Command{
+		Use:     "build",
+		Short:   "Build target",
+		Long:    buildHelpText,
+		Example: buildHelpEx,
+		Run:     targetBuildCmd,
+	}
+
+	targetCmd.AddCommand(buildCmd)
+
+	testHelpText := formatHelp(`Test the target specified by <target-name>.  If
+		clean is specified, then all the test binaries and object files for this 
+		target will be removed.  If the all option is specified, all test 
+		binaries and object files for all targets will be removed.`)
+	testHelpEx := "  newt target test <target-name> [clean, [all]]\n"
+	testHelpEx += "  newt target test mytarget1\n"
+	testHelpEx += "  newt target test mytarget1 clean\n"
+	testHelpEx += "  newt target test mytarget1 clean all"
+
+	testCmd := &cobra.Command{
+		Use:     "test",
+		Short:   "Test target",
+		Long:    testHelpText,
+		Example: testHelpEx,
+		Run:     targetTestCmd,
+	}
+
+	targetCmd.AddCommand(testCmd)
+
+	sizeHelpText := formatHelp(`Calculate the size of target components specified by
+		<target-name>.`)
+	sizeHelpEx := "  newt target size <target-name>\n"
+
+	sizeCmd := &cobra.Command{
+		Use:     "size",
+		Short:   "Size of the target",
+		Long:    sizeHelpText,
+		Example: sizeHelpEx,
+		Run:     targetSizeCmd,
+	}
+
+	targetCmd.AddCommand(sizeCmd)
+
+	downloadHelpText := formatHelp(`Download project image to target for
+		<target-name>.`)
+	downloadHelpEx := "  newt target download <target-name>\n"
+
+	downloadCmd := &cobra.Command{
+		Use:     "download",
+		Short:   "Download project to target",
+		Long:    downloadHelpText,
+		Example: downloadHelpEx,
+		Run:     targetDownloadCmd,
+	}
+	targetCmd.AddCommand(downloadCmd)
+
+	debugHelpText := formatHelp(`Download project image to target for
+		<target-name>.`)
+	debugHelpEx := "  newt target download <target-name>\n"
+
+	debugCmd := &cobra.Command{
+		Use:     "debug",
+		Short:   "Open debugger session to target",
+		Long:    debugHelpText,
+		Example: debugHelpEx,
+		Run:     targetDebugCmd,
+	}
+	targetCmd.AddCommand(debugCmd)
+
+	exportHelpText := formatHelp(`Export build targets from the current nest, and 
+		print them to standard output.  If the -a (or -export-all) option is 
+		specified, then all targets will be exported.  Otherwise, <target-name> 
+		must be specified, and only that target will be exported.`)
+	exportHelpEx := "  newt target export [-a -export-all] [<target-name>]\n"
+	exportHelpEx += "  newt target export -a > my_exports.txt\n"
+	exportHelpEx += "  newt target export my_target > my_target_export.txt"
+
+	exportCmd := &cobra.Command{
+		Use:     "export",
+		Short:   "Export target",
+		Long:    exportHelpText,
+		Example: exportHelpEx,
+		Run:     targetExportCmd,
+	}
+
+	exportCmd.PersistentFlags().BoolVarP(&ExportAll, "export-all", "a", false,
+		"If present, export all targets")
+
+	targetCmd.AddCommand(exportCmd)
+
+	importHelpText := formatHelp(`Import build targets from standard input.  If 
+		the -a (or -import-all) option is specified, then all targets will be 
+		imported.  Otherwise, a <target-name> must be specified, and only that 
+		target will be imported.`)
+	importHelpEx := "  newt target import [-a -import-all] [<target-name>]\n"
+	importHelpEx += "  newt target import -a < exported_targets.txt\n"
+	importHelpEx += "  newt target import ex_tgt_1 < exported_targets.txt"
+
+	importCmd := &cobra.Command{
+		Use:     "import",
+		Short:   "Import target",
+		Long:    importHelpText,
+		Example: importHelpEx,
+		Run:     targetImportCmd,
+	}
+
+	importCmd.PersistentFlags().BoolVarP(&ImportAll, "import-all", "a", false,
+		"If present, import all targets")
+
+	targetCmd.AddCommand(importCmd)
+
+	base.AddCommand(targetCmd)
+}
+
+func dispEgg(egg *cli.Egg) error {
+	cli.StatusMessage(cli.VERBOSITY_QUIET, "Egg %s, version %s\n",
+		egg.FullName, egg.Version)
+	cli.StatusMessage(cli.VERBOSITY_QUIET, "  path: %s\n",
+		filepath.Clean(egg.BasePath))
+	if egg.Capabilities != nil {
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "  capabilities: ")
+		caps, err := egg.GetCapabilities()
+		if err != nil {
+			return err
+		}
+		for _, capability := range caps {
+			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
+		}
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
+	}
+	if egg.ReqCapabilities != nil {
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "  required capabilities: ")
+		caps, err := egg.GetReqCapabilities()
+		if err != nil {
+			return err
+		}
+		for _, capability := range caps {
+			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
+		}
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
+	}
+	if len(egg.Deps) > 0 {
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "  deps: ")
+		for _, dep := range egg.Deps {
+			if dep == nil {
+				continue
+			}
+			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", dep)
+		}
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
+	}
+
+	if egg.LinkerScript != "" {
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "  linkerscript: %s\n",
+			egg.LinkerScript)
+	}
+	return nil
+}
+
+func dispEggShell(eggShell *cli.EggShell) error {
+	cli.StatusMessage(cli.VERBOSITY_QUIET, "Egg %s from clutch %s, version %s\n",
+		eggShell.FullName, eggShell.Clutch.Name, eggShell.Version)
+
+	if eggShell.Caps != nil {
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "  capabilities: ")
+		caps, err := eggShell.GetCapabilities()
+		if err != nil {
+			return err
+		}
+		for _, capability := range caps {
+			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
+		}
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
+	}
+	if eggShell.ReqCaps != nil {
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "  required capabilities: ")
+		caps, err := eggShell.GetReqCapabilities()
+		if err != nil {
+			return err
+		}
+		for _, capability := range caps {
+			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
+		}
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
+	}
+	if len(eggShell.Deps) > 0 {
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "  deps: ")
+		for _, dep := range eggShell.Deps {
+			if dep == nil {
+				continue
+			}
+			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", dep)
+		}
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
+	}
+
+	return nil
+}
+
+func eggListCmd(cmd *cobra.Command, args []string) {
+	eggMgr, err := cli.NewClutch(NewtNest)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+	if err := eggMgr.LoadConfigs(nil, false); err != nil {
+		NewtUsage(cmd, err)
+	}
+	for _, egg := range eggMgr.Eggs {
+		if err := dispEgg(egg); err != nil {
+			NewtUsage(cmd, err)
+		}
+	}
+}
+
+func eggCheckDepsCmd(cmd *cobra.Command, args []string) {
+	eggMgr, err := cli.NewClutch(NewtNest)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	if err := eggMgr.LoadConfigs(nil, false); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	if err := eggMgr.CheckDeps(); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
+		"Dependencies successfully resolved!\n")
+}
+
+func eggHuntCmd(cmd *cobra.Command, args []string) {
+	var err error
+
+	if len(args) != 1 {
+		NewtUsage(cmd,
+			cli.NewNewtError("Must specify string to hunt for"))
+	}
+
+	/*
+	 * First check local.
+	 */
+	eggMgr, err := cli.NewClutch(NewtNest)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+	if err := eggMgr.LoadConfigs(nil, false); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	found := false
+	for _, egg := range eggMgr.Eggs {
+		contains := strings.Contains(egg.FullName, args[0])
+		if contains == true {
+			cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Installed egg %s@%s\n",
+				egg.FullName, egg.Version)
+			found = true
+		}
+	}
+
+	/*
+	 * Then check remote clutches.
+	 */
+	clutches, err := NewtNest.GetClutches()
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+	for _, clutch := range clutches {
+		for _, eggShell := range clutch.EggShells {
+			contains := strings.Contains(eggShell.FullName, args[0])
+			if contains == true {
+				cli.StatusMessage(cli.VERBOSITY_DEFAULT,
+					"Clutch %s has egg %s@%s\n",
+					clutch.Name, eggShell.FullName,
+					eggShell.Version)
+				found = true
+			}
+		}
+	}
+
+	if found == false {
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "No egg found!\n")
+	}
+}
+
+func eggShowCmd(cmd *cobra.Command, args []string) {
+	var eggName string
+	var clutchName string = ""
+
+	if len(args) < 1 || len(args) > 2 {
+		NewtUsage(cmd,
+			cli.NewNewtError("Must specify full name of the egg"))
+	}
+
+	if len(args) == 1 {
+		eggName = args[0]
+	} else {
+		clutchName = args[0]
+		eggName = args[1]
+	}
+
+	eggMgr, err := cli.NewClutch(NewtNest)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+	if err := eggMgr.LoadConfigs(nil, false); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	egg, err := eggMgr.ResolveEggName(eggName)
+	if err == nil {
+		egg.LoadConfig(nil, false)
+		dispEgg(egg)
+	}
+
+	clutches, err := NewtNest.GetClutches()
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+	for _, clutch := range clutches {
+		if clutchName == "" || clutch.Name == clutchName {
+			eggShell, err := clutch.ResolveEggShellName(eggName)
+			if err == nil {
+				dispEggShell(eggShell)
+			}
+		}
+	}
+}
+
+func eggShellInstall(eggShell *cli.EggShell) error {
+	eggMgr, err := cli.NewClutch(NewtNest)
+	if err != nil {
+		return err
+	}
+
+	if err := eggMgr.LoadConfigs(nil, false); err != nil {
+		return err
+	}
+
+	_, err = eggMgr.ResolveEggName(eggShell.FullName)
+	if err == nil {
+		return cli.NewNewtError(fmt.Sprintf("Egg %s already installed!",
+			eggShell.FullName))
+	}
+	err = eggShell.Install(eggMgr, NewtBranchEgg)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func eggInstallCmd(cmd *cobra.Command, args []string) {
+	var eggName string
+	var clutchName string = ""
+	var clutch *cli.Clutch
+	var eggShell *cli.EggShell
+
+	if len(args) < 1 || len(args) > 2 {
+		NewtUsage(cmd,
+			cli.NewNewtError("Must specify full name of the egg"))
+	}
+
+	if len(args) == 1 {
+		eggName = args[0]
+	} else {
+		clutchName = args[0]
+		eggName = args[1]
+	}
+
+	/*
+	 * Find the eggShell to install.
+	 */
+	clutches, err := NewtNest.GetClutches()
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	if clutchName != "" {
+		clutch = clutches[clutchName]
+	}
+	if clutch != nil {
+		eggShell, err := clutch.ResolveEggShellName(eggName)
+		if err != nil {
+			NewtUsage(cmd, err)
+		}
+		err = eggShellInstall(eggShell)
+		if err != nil {
+			NewtUsage(cmd, err)
+		}
+		cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Installation was a success!\n")
+		return
+	}
+	eggShell = nil
+	for _, tmpClutch := range clutches {
+		if clutchName == "" || tmpClutch.Name == clutchName {
+			tmpEggShell, err := tmpClutch.ResolveEggShellName(eggName)
+			if err != nil && eggShell != nil {
+				NewtUsage(cmd,
+					cli.NewNewtError(fmt.Sprintf("Ambiguous source "+
+						"egg %s in clutches %s and %s",
+						eggName, clutch.Name, tmpClutch.Name)))
+			} else {
+				eggShell = tmpEggShell
+				clutch = tmpClutch
+			}
+		}
+	}
+
+	if eggShell == nil {
+		NewtUsage(cmd,
+			cli.NewNewtError(fmt.Sprintf("Can't find egg with name %s",
+				eggName)))
+	}
+
+	err = eggShellInstall(eggShell)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Installation was a success!\n")
+}
+
+func eggRemoveCmd(cmd *cobra.Command, args []string) {
+	if len(args) < 1 || len(args) > 2 {
+		NewtUsage(cmd,
+			cli.NewNewtError("Must specify full name of the egg"))
+	}
+
+	eggName := args[0]
+
+	eggMgr, err := cli.NewClutch(NewtNest)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+	if err := eggMgr.LoadConfigs(nil, false); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	egg, err := eggMgr.ResolveEggName(eggName)
+	if err != nil {
+		NewtUsage(cmd,
+			cli.NewNewtError(fmt.Sprintf("Egg %s has not been installed",
+				eggName)))
+	}
+	err = egg.Remove()
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Removed successfully!\n")
+}
+
+func eggAddCmds(baseCmd *cobra.Command) {
+	eggHelpText := formatHelp(`Commands to search, display and install eggs
+		in the current nest.  Eggs are newt's version of packages, and are 
+		the fundamental building blocks of nests.`)
+	eggHelpEx := "  newt egg list\n"
+	eggHelpEx += "  newt egg checkdeps\n"
+	eggHelpEx += "  newt egg hunt <egg-name>\n"
+	eggHelpEx += "  newt egg show [<clutch-name> ] <egg-name>\n"
+	eggHelpEx += "  newt egg install [<clutch-name> ] <egg-name>\n"
+	eggHelpEx += "  newt egg remove [<clutch-name> ] <egg-name>"
+
+	eggCmd := &cobra.Command{
+		Use:     "egg",
+		Short:   "Commands to list and inspect eggs on a nest",
+		Long:    eggHelpText,
+		Example: eggHelpEx,
+		PersistentPreRun: func(cmd *cobra.Command, args []string) {
+			cli.Init(NewtLogLevel, newtSilent, newtQuiet, newtVerbose)
+
+			var err error
+			NewtNest, err = cli.NewNest()
+			if err != nil {
+				NewtUsage(nil, err)
+			}
+		},
+		Run: func(cmd *cobra.Command, args []string) {
+			NewtUsage(cmd, nil)
+		},
+	}
+
+	listHelpText := formatHelp(`List all of the eggs in the current nest.`)
+	listHelpEx := "  newt egg list"
+
+	listCmd := &cobra.Command{
+		Use:     "list",
+		Short:   "List eggs in the current nest",
+		Long:    listHelpText,
+		Example: listHelpEx,
+		Run:     eggListCmd,
+	}
+
+	eggCmd.AddCommand(listCmd)
+
+	checkDepsHelpText := formatHelp(`Resolve all dependencies in the local 
+		nest.  This command goes through all eggs currently installed, checks
+		their dependencies, and prints any unresolved dependencies between 
+		eggs.`)
+	checkDepsHelpEx := "  newt egg checkdeps"
+
+	checkDepsCmd := &cobra.Command{
+		Use:     "checkdeps",
+		Short:   "Check egg dependencies",
+		Long:    checkDepsHelpText,
+		Example: checkDepsHelpEx,
+		Run:     eggCheckDepsCmd,
+	}
+
+	eggCmd.AddCommand(checkDepsCmd)
+
+	huntHelpText := formatHelp(`Hunt for an egg, specified by <egg-name>.  
+		The local nest, along with all remote nests (clutches) are 
+		searched.  All matched eggs are shown.`)
+	huntHelpEx := "  newt egg hunt <egg-name>"
+
+	huntCmd := &cobra.Command{
+		Use:     "hunt",
+		Short:   "Search for egg from clutches",
+		Long:    huntHelpText,
+		Example: huntHelpEx,
+		Run:     eggHuntCmd,
+	}
+
+	eggCmd.AddCommand(huntCmd)
+
+	showHelpText := formatHelp(`Show the contents of the egg, specified by 
+		<egg-name>.  <egg-name> is resolved using all the clutches installed
+		in the current nest or, if <clutch-name> is specified, only 
+		<clutch-name> will be searched.`)
+	showHelpEx := "  newt egg show [<clutch-name> ] <egg-name>"
+
+	showCmd := &cobra.Command{
+		Use:     "show",
+		Short:   "Show the contents of an egg.",
+		Long:    showHelpText,
+		Example: showHelpEx,
+		Run:     eggShowCmd,
+	}
+
+	eggCmd.AddCommand(showCmd)
+
+	installHelpText := formatHelp(`Install the egg specified by <egg-name> to 
+		the local nest. <egg-name> is searched for throughout the clutches in 
+		the local nest.  If <clutch-name> is specified, then only <clutch-name>
+		is searched for <egg-name>.`)
+	installHelpEx := "  newt egg install [<clutch-name> ] <egg-name>"
+
+	installCmd := &cobra.Command{
+		Use:     "install",
+		Short:   "Install an egg",
+		Long:    installHelpText,
+		Example: installHelpEx,
+		Run:     eggInstallCmd,
+	}
+
+	installCmd.Flags().StringVarP(&NewtBranchEgg, "branch", "b", "",
+		"Branch (or tag) of the clutch to install from.")
+
+	eggCmd.AddCommand(installCmd)
+
+	removeHelpText := formatHelp(`Remove the egg, specified by <egg-name> from 
+		the local nest.  If present the egg is taking only from the clutch 
+		specified by <clutch-name>.`)
+	removeHelpEx := "  newt egg remove [<clutch-name> ] <egg-name>"
+
+	removeCmd := &cobra.Command{
+		Use:     "remove",
+		Short:   "Remove an egg",
+		Long:    removeHelpText,
+		Example: removeHelpEx,
+		Run:     eggRemoveCmd,
+	}
+
+	eggCmd.AddCommand(removeCmd)
+
+	baseCmd.AddCommand(eggCmd)
+}
+
+func nestGenerateClutchCmd(cmd *cobra.Command, args []string) {
+	if len(args) != 2 {
+		NewtUsage(cmd,
+			cli.NewNewtError("Must specify name and URL to lay clutch file"))
+	}
+
+	clutchName := args[0]
+	clutchUrl := args[1]
+
+	clutch, err := cli.NewClutch(NewtNest)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+	clutch.Name = clutchName
+	clutch.RemoteUrl = clutchUrl
+
+	local, err := cli.NewClutch(NewtNest)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	if err := clutch.LoadFromClutch(local); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	clutchStr, err := clutch.Serialize()
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "%s", clutchStr)
+}
+
+func nestAddClutchCmd(cmd *cobra.Command, args []string) {
+	if len(args) != 2 {
+		NewtUsage(cmd,
+			cli.NewNewtError("Must specify both name and URL to "+
+				"larva install command"))
+	}
+
+	name := args[0]
+	url := args[1]
+
+	clutch, err := cli.NewClutch(NewtNest)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	if err := clutch.Install(name, url, NewtBranchClutch); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
+		"Clutch "+name+" successfully installed to Nest.\n")
+}
+
+func nestListClutchesCmd(cmd *cobra.Command, args []string) {
+	clutches, err := NewtNest.GetClutches()
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	for name, clutch := range clutches {
+		cli.StatusMessage(cli.VERBOSITY_QUIET,
+			"Remote clutch %s (eggshells: %d)\n", name, len(clutch.EggShells))
+	}
+}
+
+func nestCreateCmd(cmd *cobra.Command, args []string) {
+	if len(args) < 1 {
+		NewtUsage(cmd,
+			cli.NewNewtError("Must specify a nest name to create"))
+	}
+
+	wd, err := os.Getwd()
+	if err != nil {
+		NewtUsage(cmd, cli.NewNewtError(err.Error()))
+	}
+
+	nestDir := wd + "/" + args[0]
+	if len(args) > 1 {
+		nestDir = args[1]
+	}
+
+	tadpoleUrl := ""
+	if len(args) > 2 {
+		tadpoleUrl = args[2]
+	}
+
+	if err := cli.CreateNest(args[0], nestDir, tadpoleUrl); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
+		"Nest %s successfully created in %s\n", args[0], nestDir)
+}
+
+func nestShowClutchCmd(cmd *cobra.Command, args []string) {
+	if len(args) != 1 {
+		NewtUsage(cmd,
+			cli.NewNewtError("Must specify a clutch name to show-clutch command"))
+	}
+
+	clutch, err := cli.NewClutch(NewtNest)
+	if err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	if err := clutch.Load(args[0]); err != nil {
+		NewtUsage(cmd, err)
+	}
+
+	// Clutch loaded, now print out clutch information
+	cli.StatusMessage(cli.VERBOSITY_QUIET, "Clutch Name: %s\n", clutch.Name)
+	cli.StatusMessage(cli.VERBOSITY_QUIET, "Clutch URL: %s\n",
+		clutch.RemoteUrl)
+
+	i := 0
+	for _, eggShell := range clutch.EggShells {
+		i++
+		cli.StatusMessage(cli.VERBOSITY_QUIET, " %s@%s", eggShell.FullName,
+			eggShell.Version)
+		if i%4 == 0 {
+			cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
+		}
+	}
+	if i%4 != 0 {
+		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
+	}
+}
+
+func nestAddCmds(baseCmd *cobra.Command) {
+	var nestCmd *cobra.Command
+	var createCmd *cobra.Command
+
+	nestHelpText := formatHelp(`The nest commands help manage the local nest.
+		A nest represents the workspace for one or more projects, each project being a
+                collection of eggs (packages.)  In addition to containing eggs, a local nest contains the 
+		target (build) definitions, and a list of clutches (snapshots of remote nests 
+		which contain eggs that can be installed into the current nest.)`)
+	nestHelpEx := "  newt nest create <nest-name> [, <nest-skele-url>]\n"
+	nestHelpEx += "  newt nest list-clutches\n"
+	nestHelpEx += "  newt nest show-clutch <clutch-name>\n"
+	nestHelpEx += "  newt nest add-clutch <clutch-name> <clutch-url>\n"
+	nestHelpEx += "  newt nest generate-clutch <clutch-name> <clutch-url>"
+
+	nestCmd = &cobra.Command{
+		Use:     "nest",
+		Short:   "Commands to manage nests & clutches (remote egg repositories)",
+		Long:    nestHelpText,
+		Example: nestHelpEx,
+		PersistentPreRun: func(cmd *cobra.Command, args []string) {
+			cli.Init(NewtLogLevel, newtSilent, newtQuiet, newtVerbose)
+
+			var err error
+
+			if cmd != nestCmd && cmd != createCmd {
+				NewtNest, err = cli.NewNest()
+				if err != nil {
+					NewtUsage(cmd, err)
+				}
+			}
+		},
+		Run: func(cmd *cobra.Command, args []string) {
+			NewtUsage(cmd, nil)
+		},
+	}
+
+	createHelpText := formatHelp(`Create a new nest, specified by <nest-name>. 
+		If the optional <nest-url> parameter is specified, then download the 
+		skeleton of the nest file from that URL, instead of using the default.`)
+
+	createHelpEx := "  newt nest create <nest-name> [, <nest-url>]\n"
+	createHelpEx += "  newt nest create mynest"
+
+	createCmd = &cobra.Command{
+		Use:     "create",
+		Short:   "Create a new nest",
+		Long:    createHelpText,
+		Example: createHelpEx,
+		Run:     nestCreateCmd,
+	}
+
+	nestCmd.AddCommand(createCmd)
+
+	generateHelpText := formatHelp(`Generate a clutch file from a snapshot 
+	    of the eggs in the current directory.  generate-clutch takes two 
+		arguments, the name of the current nest and the URL at which 
+		the nest is located.`)
+
+	generateHelpEx := "  newt nest generate-clutch <name> <url>\n"
+	generateHelpEx += "  newt nest generate-clutch larva " +
+		"https://www.github.com/mynewt/larva"
+
+	generateCmd := &cobra.Command{
+		Use:     "generate-clutch",
+		Short:   "Generate a clutch file from the eggs in the current directory",
+		Long:    generateHelpText,
+		Example: generateHelpEx,
+		Run:     nestGenerateClutchCmd,
+	}
+
+	nestCmd.AddCommand(generateCmd)
+
+	addClutchHelpText := formatHelp(`Add a remote clutch to the current nest.
+	    When search for eggs to install, the clutch specified by clutch-name
+		and clutch-url will be searched for eggs that match the search.  This
+		includes both direct searches with newt egg hunt, as well as resolving
+		dependencies in egg.yml files.`)
+
+	addClutchHelpEx := "  newt nest add-clutch <clutch-name> <clutch-url>\n"
+	addClutchHelpEx += "  newt nest add-clutch larva " +
+		"https://www.github.com/mynewt/larva"
+
+	addClutchCmd := &cobra.Command{
+		Use:     "add-clutch",
+		Short:   "Add a remote clutch, and put it in the current nest",
+		Long:    addClutchHelpText,
+		Example: addClutchHelpEx,
+		Run:     nestAddClutchCmd,
+	}
+
+	addClutchCmd.Flags().StringVarP(&NewtBranchClutch, "branch", "b", "master",
+		"Branch (or tag) of the clutch to install from.")
+
+	nestCmd.AddCommand(addClutchCmd)
+
+	listClutchesHelpText := formatHelp(`List the clutches installed in the current
+		nest.  A clutch represents a collection of eggs in a nest.  List clutches
+		includes the current nest, along with any remote clutches that have been 
+		added using the add-clutch command.`)
+
+	listClutchesHelpEx := "  newt nest list-clutches"
+
+	listClutchesCmd := &cobra.Command{
+		Use:     "list-clutches",
+		Short:   "List the clutches installed in the current nest",
+		Long:    listClutchesHelpText,
+		Example: listClutchesHelpEx,
+		Run:     nestListClutchesCmd,
+	}
+
+	nestCmd.AddCommand(listClutchesCmd)
+
+	showClutchHelpText := formatHelp(`Show information about a clutch, given by the 
+		<clutch-name> parameter.  Displays the clutch name, URL and packages 
+		associated with a given clutch.`)
+
+	showClutchHelpEx := "  newt nest show-clutch <clutch-name>\n"
+	showClutchHelpEx += "  newt nest show-clutch larva"
+
+	showClutchCmd := &cobra.Command{
+		Use:     "show-clutch",
+		Short:   "Show an individual clutch in the current nest",
+		Long:    showClutchHelpText,
+		Example: showClutchHelpEx,
+		Run:     nestShowClutchCmd,
+	}
+
+	nestCmd.AddCommand(showClutchCmd)
+
+	baseCmd.AddCommand(nestCmd)
+}
+
+func parseCmds() *cobra.Command {
+	newtHelpText := formatHelp(`Newt allows you to create your own embedded 
+		project based on the Mynewt operating system.  Newt provides both 
+		build and package management in a single tool, which allows you to 
+		compose an embedded workspace, and set of projects, and then build
+		the necessary artifacts from those projects.  For more information 
+		on the Mynewt operating system, please visit 
+		https://www.github.com/mynewt/documentation.`)
+	newtHelpText += "\n\n" + formatHelp(`Please use the newt help command, 
+		and specify the name of the command you want help for, for help on 
+		how to use a specific command`)
+	newtHelpEx := "  newt\n"
+	newtHelpEx += "  newt help [<command-name>]\n"
+	newtHelpEx += "    For help on <command-name>.  If not specified, " +
+		"print this message."
+
+	newtCmd := &cobra.Command{
+		Use:     "newt",
+		Short:   "Newt is a tool to help you compose and build your own OS",
+		Long:    newtHelpText,
+		Example: newtHelpEx,
+		Run: func(cmd *cobra.Command, args []string) {
+			cmd.Help()
+		},
+	}
+
+	newtCmd.PersistentFlags().BoolVarP(&newtVerbose, "verbose", "v", false,
+		"Enable verbose output when executing commands.")
+	newtCmd.PersistentFlags().BoolVarP(&newtQuiet, "quiet", "q", false,
+		"Be quiet; only display error output.")
+	newtCmd.PersistentFlags().BoolVarP(&newtSilent, "silent", "s", false,
+		"Be silent; don't output anything.")
+	newtCmd.PersistentFlags().StringVarP(&NewtLogLevel, "loglevel", "l",
+		"WARN", "Log level, defaults to WARN.")
+
+	versHelpText := formatHelp(`Display the Newt version number.`)
+	versHelpEx := "  newt version"
+	versCmd := &cobra.Command{
+		Use:     "version",
+		Short:   "Display the Newt version number.",
+		Long:    versHelpText,
+		Example: versHelpEx,
+		Run: func(cmd *cobra.Command, args []string) {
+			fmt.Printf("Newt version: %s\n", NewtVersion)
+		},
+	}
+
+	newtCmd.AddCommand(versCmd)
+
+	targetAddCmds(newtCmd)
+	eggAddCmds(newtCmd)
+	nestAddCmds(newtCmd)
+
+	return newtCmd
+}
+
+func main() {
+	cmd := parseCmds()
+	cmd.Execute()
+}


[27/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/emitterc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/emitterc.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/emitterc.go
deleted file mode 100644
index 2befd55..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/emitterc.go
+++ /dev/null
@@ -1,1685 +0,0 @@
-package yaml
-
-import (
-	"bytes"
-)
-
-// Flush the buffer if needed.
-func flush(emitter *yaml_emitter_t) bool {
-	if emitter.buffer_pos+5 >= len(emitter.buffer) {
-		return yaml_emitter_flush(emitter)
-	}
-	return true
-}
-
-// Put a character to the output buffer.
-func put(emitter *yaml_emitter_t, value byte) bool {
-	if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {
-		return false
-	}
-	emitter.buffer[emitter.buffer_pos] = value
-	emitter.buffer_pos++
-	emitter.column++
-	return true
-}
-
-// Put a line break to the output buffer.
-func put_break(emitter *yaml_emitter_t) bool {
-	if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {
-		return false
-	}
-	switch emitter.line_break {
-	case yaml_CR_BREAK:
-		emitter.buffer[emitter.buffer_pos] = '\r'
-		emitter.buffer_pos += 1
-	case yaml_LN_BREAK:
-		emitter.buffer[emitter.buffer_pos] = '\n'
-		emitter.buffer_pos += 1
-	case yaml_CRLN_BREAK:
-		emitter.buffer[emitter.buffer_pos+0] = '\r'
-		emitter.buffer[emitter.buffer_pos+1] = '\n'
-		emitter.buffer_pos += 2
-	default:
-		panic("unknown line break setting")
-	}
-	emitter.column = 0
-	emitter.line++
-	return true
-}
-
-// Copy a character from a string into buffer.
-func write(emitter *yaml_emitter_t, s []byte, i *int) bool {
-	if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {
-		return false
-	}
-	p := emitter.buffer_pos
-	w := width(s[*i])
-	switch w {
-	case 4:
-		emitter.buffer[p+3] = s[*i+3]
-		fallthrough
-	case 3:
-		emitter.buffer[p+2] = s[*i+2]
-		fallthrough
-	case 2:
-		emitter.buffer[p+1] = s[*i+1]
-		fallthrough
-	case 1:
-		emitter.buffer[p+0] = s[*i+0]
-	default:
-		panic("unknown character width")
-	}
-	emitter.column++
-	emitter.buffer_pos += w
-	*i += w
-	return true
-}
-
-// Write a whole string into buffer.
-func write_all(emitter *yaml_emitter_t, s []byte) bool {
-	for i := 0; i < len(s); {
-		if !write(emitter, s, &i) {
-			return false
-		}
-	}
-	return true
-}
-
-// Copy a line break character from a string into buffer.
-func write_break(emitter *yaml_emitter_t, s []byte, i *int) bool {
-	if s[*i] == '\n' {
-		if !put_break(emitter) {
-			return false
-		}
-		*i++
-	} else {
-		if !write(emitter, s, i) {
-			return false
-		}
-		emitter.column = 0
-		emitter.line++
-	}
-	return true
-}
-
-// Set an emitter error and return false.
-func yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem string) bool {
-	emitter.error = yaml_EMITTER_ERROR
-	emitter.problem = problem
-	return false
-}
-
-// Emit an event.
-func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-	emitter.events = append(emitter.events, *event)
-	for !yaml_emitter_need_more_events(emitter) {
-		event := &emitter.events[emitter.events_head]
-		if !yaml_emitter_analyze_event(emitter, event) {
-			return false
-		}
-		if !yaml_emitter_state_machine(emitter, event) {
-			return false
-		}
-		yaml_event_delete(event)
-		emitter.events_head++
-	}
-	return true
-}
-
-// Check if we need to accumulate more events before emitting.
-//
-// We accumulate extra
-//  - 1 event for DOCUMENT-START
-//  - 2 events for SEQUENCE-START
-//  - 3 events for MAPPING-START
-//
-func yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool {
-	if emitter.events_head == len(emitter.events) {
-		return true
-	}
-	var accumulate int
-	switch emitter.events[emitter.events_head].typ {
-	case yaml_DOCUMENT_START_EVENT:
-		accumulate = 1
-		break
-	case yaml_SEQUENCE_START_EVENT:
-		accumulate = 2
-		break
-	case yaml_MAPPING_START_EVENT:
-		accumulate = 3
-		break
-	default:
-		return false
-	}
-	if len(emitter.events)-emitter.events_head > accumulate {
-		return false
-	}
-	var level int
-	for i := emitter.events_head; i < len(emitter.events); i++ {
-		switch emitter.events[i].typ {
-		case yaml_STREAM_START_EVENT, yaml_DOCUMENT_START_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT:
-			level++
-		case yaml_STREAM_END_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_END_EVENT, yaml_MAPPING_END_EVENT:
-			level--
-		}
-		if level == 0 {
-			return false
-		}
-	}
-	return true
-}
-
-// Append a directive to the directives stack.
-func yaml_emitter_append_tag_directive(emitter *yaml_emitter_t, value *yaml_tag_directive_t, allow_duplicates bool) bool {
-	for i := 0; i < len(emitter.tag_directives); i++ {
-		if bytes.Equal(value.handle, emitter.tag_directives[i].handle) {
-			if allow_duplicates {
-				return true
-			}
-			return yaml_emitter_set_emitter_error(emitter, "duplicate %TAG directive")
-		}
-	}
-
-	// [Go] Do we actually need to copy this given garbage collection
-	// and the lack of deallocating destructors?
-	tag_copy := yaml_tag_directive_t{
-		handle: make([]byte, len(value.handle)),
-		prefix: make([]byte, len(value.prefix)),
-	}
-	copy(tag_copy.handle, value.handle)
-	copy(tag_copy.prefix, value.prefix)
-	emitter.tag_directives = append(emitter.tag_directives, tag_copy)
-	return true
-}
-
-// Increase the indentation level.
-func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool) bool {
-	emitter.indents = append(emitter.indents, emitter.indent)
-	if emitter.indent < 0 {
-		if flow {
-			emitter.indent = emitter.best_indent
-		} else {
-			emitter.indent = 0
-		}
-	} else if !indentless {
-		emitter.indent += emitter.best_indent
-	}
-	return true
-}
-
-// State dispatcher.
-func yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-	switch emitter.state {
-	default:
-	case yaml_EMIT_STREAM_START_STATE:
-		return yaml_emitter_emit_stream_start(emitter, event)
-
-	case yaml_EMIT_FIRST_DOCUMENT_START_STATE:
-		return yaml_emitter_emit_document_start(emitter, event, true)
-
-	case yaml_EMIT_DOCUMENT_START_STATE:
-		return yaml_emitter_emit_document_start(emitter, event, false)
-
-	case yaml_EMIT_DOCUMENT_CONTENT_STATE:
-		return yaml_emitter_emit_document_content(emitter, event)
-
-	case yaml_EMIT_DOCUMENT_END_STATE:
-		return yaml_emitter_emit_document_end(emitter, event)
-
-	case yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE:
-		return yaml_emitter_emit_flow_sequence_item(emitter, event, true)
-
-	case yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE:
-		return yaml_emitter_emit_flow_sequence_item(emitter, event, false)
-
-	case yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE:
-		return yaml_emitter_emit_flow_mapping_key(emitter, event, true)
-
-	case yaml_EMIT_FLOW_MAPPING_KEY_STATE:
-		return yaml_emitter_emit_flow_mapping_key(emitter, event, false)
-
-	case yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE:
-		return yaml_emitter_emit_flow_mapping_value(emitter, event, true)
-
-	case yaml_EMIT_FLOW_MAPPING_VALUE_STATE:
-		return yaml_emitter_emit_flow_mapping_value(emitter, event, false)
-
-	case yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE:
-		return yaml_emitter_emit_block_sequence_item(emitter, event, true)
-
-	case yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE:
-		return yaml_emitter_emit_block_sequence_item(emitter, event, false)
-
-	case yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE:
-		return yaml_emitter_emit_block_mapping_key(emitter, event, true)
-
-	case yaml_EMIT_BLOCK_MAPPING_KEY_STATE:
-		return yaml_emitter_emit_block_mapping_key(emitter, event, false)
-
-	case yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE:
-		return yaml_emitter_emit_block_mapping_value(emitter, event, true)
-
-	case yaml_EMIT_BLOCK_MAPPING_VALUE_STATE:
-		return yaml_emitter_emit_block_mapping_value(emitter, event, false)
-
-	case yaml_EMIT_END_STATE:
-		return yaml_emitter_set_emitter_error(emitter, "expected nothing after STREAM-END")
-	}
-	panic("invalid emitter state")
-}
-
-// Expect STREAM-START.
-func yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-	if event.typ != yaml_STREAM_START_EVENT {
-		return yaml_emitter_set_emitter_error(emitter, "expected STREAM-START")
-	}
-	if emitter.encoding == yaml_ANY_ENCODING {
-		emitter.encoding = event.encoding
-		if emitter.encoding == yaml_ANY_ENCODING {
-			emitter.encoding = yaml_UTF8_ENCODING
-		}
-	}
-	if emitter.best_indent < 2 || emitter.best_indent > 9 {
-		emitter.best_indent = 2
-	}
-	if emitter.best_width >= 0 && emitter.best_width <= emitter.best_indent*2 {
-		emitter.best_width = 80
-	}
-	if emitter.best_width < 0 {
-		emitter.best_width = 1<<31 - 1
-	}
-	if emitter.line_break == yaml_ANY_BREAK {
-		emitter.line_break = yaml_LN_BREAK
-	}
-
-	emitter.indent = -1
-	emitter.line = 0
-	emitter.column = 0
-	emitter.whitespace = true
-	emitter.indention = true
-
-	if emitter.encoding != yaml_UTF8_ENCODING {
-		if !yaml_emitter_write_bom(emitter) {
-			return false
-		}
-	}
-	emitter.state = yaml_EMIT_FIRST_DOCUMENT_START_STATE
-	return true
-}
-
-// Expect DOCUMENT-START or STREAM-END.
-func yaml_emitter_emit_document_start(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
-
-	if event.typ == yaml_DOCUMENT_START_EVENT {
-
-		if event.version_directive != nil {
-			if !yaml_emitter_analyze_version_directive(emitter, event.version_directive) {
-				return false
-			}
-		}
-
-		for i := 0; i < len(event.tag_directives); i++ {
-			tag_directive := &event.tag_directives[i]
-			if !yaml_emitter_analyze_tag_directive(emitter, tag_directive) {
-				return false
-			}
-			if !yaml_emitter_append_tag_directive(emitter, tag_directive, false) {
-				return false
-			}
-		}
-
-		for i := 0; i < len(default_tag_directives); i++ {
-			tag_directive := &default_tag_directives[i]
-			if !yaml_emitter_append_tag_directive(emitter, tag_directive, true) {
-				return false
-			}
-		}
-
-		implicit := event.implicit
-		if !first || emitter.canonical {
-			implicit = false
-		}
-
-		if emitter.open_ended && (event.version_directive != nil || len(event.tag_directives) > 0) {
-			if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) {
-				return false
-			}
-			if !yaml_emitter_write_indent(emitter) {
-				return false
-			}
-		}
-
-		if event.version_directive != nil {
-			implicit = false
-			if !yaml_emitter_write_indicator(emitter, []byte("%YAML"), true, false, false) {
-				return false
-			}
-			if !yaml_emitter_write_indicator(emitter, []byte("1.1"), true, false, false) {
-				return false
-			}
-			if !yaml_emitter_write_indent(emitter) {
-				return false
-			}
-		}
-
-		if len(event.tag_directives) > 0 {
-			implicit = false
-			for i := 0; i < len(event.tag_directives); i++ {
-				tag_directive := &event.tag_directives[i]
-				if !yaml_emitter_write_indicator(emitter, []byte("%TAG"), true, false, false) {
-					return false
-				}
-				if !yaml_emitter_write_tag_handle(emitter, tag_directive.handle) {
-					return false
-				}
-				if !yaml_emitter_write_tag_content(emitter, tag_directive.prefix, true) {
-					return false
-				}
-				if !yaml_emitter_write_indent(emitter) {
-					return false
-				}
-			}
-		}
-
-		if yaml_emitter_check_empty_document(emitter) {
-			implicit = false
-		}
-		if !implicit {
-			if !yaml_emitter_write_indent(emitter) {
-				return false
-			}
-			if !yaml_emitter_write_indicator(emitter, []byte("---"), true, false, false) {
-				return false
-			}
-			if emitter.canonical {
-				if !yaml_emitter_write_indent(emitter) {
-					return false
-				}
-			}
-		}
-
-		emitter.state = yaml_EMIT_DOCUMENT_CONTENT_STATE
-		return true
-	}
-
-	if event.typ == yaml_STREAM_END_EVENT {
-		if emitter.open_ended {
-			if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) {
-				return false
-			}
-			if !yaml_emitter_write_indent(emitter) {
-				return false
-			}
-		}
-		if !yaml_emitter_flush(emitter) {
-			return false
-		}
-		emitter.state = yaml_EMIT_END_STATE
-		return true
-	}
-
-	return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-START or STREAM-END")
-}
-
-// Expect the root node.
-func yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-	emitter.states = append(emitter.states, yaml_EMIT_DOCUMENT_END_STATE)
-	return yaml_emitter_emit_node(emitter, event, true, false, false, false)
-}
-
-// Expect DOCUMENT-END.
-func yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-	if event.typ != yaml_DOCUMENT_END_EVENT {
-		return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-END")
-	}
-	if !yaml_emitter_write_indent(emitter) {
-		return false
-	}
-	if !event.implicit {
-		// [Go] Allocate the slice elsewhere.
-		if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) {
-			return false
-		}
-		if !yaml_emitter_write_indent(emitter) {
-			return false
-		}
-	}
-	if !yaml_emitter_flush(emitter) {
-		return false
-	}
-	emitter.state = yaml_EMIT_DOCUMENT_START_STATE
-	emitter.tag_directives = emitter.tag_directives[:0]
-	return true
-}
-
-// Expect a flow item node.
-func yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
-	if first {
-		if !yaml_emitter_write_indicator(emitter, []byte{'['}, true, true, false) {
-			return false
-		}
-		if !yaml_emitter_increase_indent(emitter, true, false) {
-			return false
-		}
-		emitter.flow_level++
-	}
-
-	if event.typ == yaml_SEQUENCE_END_EVENT {
-		emitter.flow_level--
-		emitter.indent = emitter.indents[len(emitter.indents)-1]
-		emitter.indents = emitter.indents[:len(emitter.indents)-1]
-		if emitter.canonical && !first {
-			if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {
-				return false
-			}
-			if !yaml_emitter_write_indent(emitter) {
-				return false
-			}
-		}
-		if !yaml_emitter_write_indicator(emitter, []byte{']'}, false, false, false) {
-			return false
-		}
-		emitter.state = emitter.states[len(emitter.states)-1]
-		emitter.states = emitter.states[:len(emitter.states)-1]
-
-		return true
-	}
-
-	if !first {
-		if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {
-			return false
-		}
-	}
-
-	if emitter.canonical || emitter.column > emitter.best_width {
-		if !yaml_emitter_write_indent(emitter) {
-			return false
-		}
-	}
-	emitter.states = append(emitter.states, yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE)
-	return yaml_emitter_emit_node(emitter, event, false, true, false, false)
-}
-
-// Expect a flow key node.
-func yaml_emitter_emit_flow_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
-	if first {
-		if !yaml_emitter_write_indicator(emitter, []byte{'{'}, true, true, false) {
-			return false
-		}
-		if !yaml_emitter_increase_indent(emitter, true, false) {
-			return false
-		}
-		emitter.flow_level++
-	}
-
-	if event.typ == yaml_MAPPING_END_EVENT {
-		emitter.flow_level--
-		emitter.indent = emitter.indents[len(emitter.indents)-1]
-		emitter.indents = emitter.indents[:len(emitter.indents)-1]
-		if emitter.canonical && !first {
-			if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {
-				return false
-			}
-			if !yaml_emitter_write_indent(emitter) {
-				return false
-			}
-		}
-		if !yaml_emitter_write_indicator(emitter, []byte{'}'}, false, false, false) {
-			return false
-		}
-		emitter.state = emitter.states[len(emitter.states)-1]
-		emitter.states = emitter.states[:len(emitter.states)-1]
-		return true
-	}
-
-	if !first {
-		if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {
-			return false
-		}
-	}
-	if emitter.canonical || emitter.column > emitter.best_width {
-		if !yaml_emitter_write_indent(emitter) {
-			return false
-		}
-	}
-
-	if !emitter.canonical && yaml_emitter_check_simple_key(emitter) {
-		emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE)
-		return yaml_emitter_emit_node(emitter, event, false, false, true, true)
-	}
-	if !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, false) {
-		return false
-	}
-	emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_VALUE_STATE)
-	return yaml_emitter_emit_node(emitter, event, false, false, true, false)
-}
-
-// Expect a flow value node.
-func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool {
-	if simple {
-		if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) {
-			return false
-		}
-	} else {
-		if emitter.canonical || emitter.column > emitter.best_width {
-			if !yaml_emitter_write_indent(emitter) {
-				return false
-			}
-		}
-		if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, false) {
-			return false
-		}
-	}
-	emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_KEY_STATE)
-	return yaml_emitter_emit_node(emitter, event, false, false, true, false)
-}
-
-// Expect a block item node.
-func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
-	if first {
-		if !yaml_emitter_increase_indent(emitter, false, emitter.mapping_context && !emitter.indention) {
-			return false
-		}
-	}
-	if event.typ == yaml_SEQUENCE_END_EVENT {
-		emitter.indent = emitter.indents[len(emitter.indents)-1]
-		emitter.indents = emitter.indents[:len(emitter.indents)-1]
-		emitter.state = emitter.states[len(emitter.states)-1]
-		emitter.states = emitter.states[:len(emitter.states)-1]
-		return true
-	}
-	if !yaml_emitter_write_indent(emitter) {
-		return false
-	}
-	if !yaml_emitter_write_indicator(emitter, []byte{'-'}, true, false, true) {
-		return false
-	}
-	emitter.states = append(emitter.states, yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE)
-	return yaml_emitter_emit_node(emitter, event, false, true, false, false)
-}
-
-// Expect a block key node.
-func yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
-	if first {
-		if !yaml_emitter_increase_indent(emitter, false, false) {
-			return false
-		}
-	}
-	if event.typ == yaml_MAPPING_END_EVENT {
-		emitter.indent = emitter.indents[len(emitter.indents)-1]
-		emitter.indents = emitter.indents[:len(emitter.indents)-1]
-		emitter.state = emitter.states[len(emitter.states)-1]
-		emitter.states = emitter.states[:len(emitter.states)-1]
-		return true
-	}
-	if !yaml_emitter_write_indent(emitter) {
-		return false
-	}
-	if yaml_emitter_check_simple_key(emitter) {
-		emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE)
-		return yaml_emitter_emit_node(emitter, event, false, false, true, true)
-	}
-	if !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, true) {
-		return false
-	}
-	emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_VALUE_STATE)
-	return yaml_emitter_emit_node(emitter, event, false, false, true, false)
-}
-
-// Expect a block value node.
-func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool {
-	if simple {
-		if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) {
-			return false
-		}
-	} else {
-		if !yaml_emitter_write_indent(emitter) {
-			return false
-		}
-		if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, true) {
-			return false
-		}
-	}
-	emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE)
-	return yaml_emitter_emit_node(emitter, event, false, false, true, false)
-}
-
-// Expect a node.
-func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t,
-	root bool, sequence bool, mapping bool, simple_key bool) bool {
-
-	emitter.root_context = root
-	emitter.sequence_context = sequence
-	emitter.mapping_context = mapping
-	emitter.simple_key_context = simple_key
-
-	switch event.typ {
-	case yaml_ALIAS_EVENT:
-		return yaml_emitter_emit_alias(emitter, event)
-	case yaml_SCALAR_EVENT:
-		return yaml_emitter_emit_scalar(emitter, event)
-	case yaml_SEQUENCE_START_EVENT:
-		return yaml_emitter_emit_sequence_start(emitter, event)
-	case yaml_MAPPING_START_EVENT:
-		return yaml_emitter_emit_mapping_start(emitter, event)
-	default:
-		return yaml_emitter_set_emitter_error(emitter,
-			"expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS")
-	}
-	return false
-}
-
-// Expect ALIAS.
-func yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-	if !yaml_emitter_process_anchor(emitter) {
-		return false
-	}
-	emitter.state = emitter.states[len(emitter.states)-1]
-	emitter.states = emitter.states[:len(emitter.states)-1]
-	return true
-}
-
-// Expect SCALAR.
-func yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-	if !yaml_emitter_select_scalar_style(emitter, event) {
-		return false
-	}
-	if !yaml_emitter_process_anchor(emitter) {
-		return false
-	}
-	if !yaml_emitter_process_tag(emitter) {
-		return false
-	}
-	if !yaml_emitter_increase_indent(emitter, true, false) {
-		return false
-	}
-	if !yaml_emitter_process_scalar(emitter) {
-		return false
-	}
-	emitter.indent = emitter.indents[len(emitter.indents)-1]
-	emitter.indents = emitter.indents[:len(emitter.indents)-1]
-	emitter.state = emitter.states[len(emitter.states)-1]
-	emitter.states = emitter.states[:len(emitter.states)-1]
-	return true
-}
-
-// Expect SEQUENCE-START.
-func yaml_emitter_emit_sequence_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-	if !yaml_emitter_process_anchor(emitter) {
-		return false
-	}
-	if !yaml_emitter_process_tag(emitter) {
-		return false
-	}
-	if emitter.flow_level > 0 || emitter.canonical || event.sequence_style() == yaml_FLOW_SEQUENCE_STYLE ||
-		yaml_emitter_check_empty_sequence(emitter) {
-		emitter.state = yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE
-	} else {
-		emitter.state = yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE
-	}
-	return true
-}
-
-// Expect MAPPING-START.
-func yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-	if !yaml_emitter_process_anchor(emitter) {
-		return false
-	}
-	if !yaml_emitter_process_tag(emitter) {
-		return false
-	}
-	if emitter.flow_level > 0 || emitter.canonical || event.mapping_style() == yaml_FLOW_MAPPING_STYLE ||
-		yaml_emitter_check_empty_mapping(emitter) {
-		emitter.state = yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE
-	} else {
-		emitter.state = yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE
-	}
-	return true
-}
-
-// Check if the document content is an empty scalar.
-func yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool {
-	return false // [Go] Huh?
-}
-
-// Check if the next events represent an empty sequence.
-func yaml_emitter_check_empty_sequence(emitter *yaml_emitter_t) bool {
-	if len(emitter.events)-emitter.events_head < 2 {
-		return false
-	}
-	return emitter.events[emitter.events_head].typ == yaml_SEQUENCE_START_EVENT &&
-		emitter.events[emitter.events_head+1].typ == yaml_SEQUENCE_END_EVENT
-}
-
-// Check if the next events represent an empty mapping.
-func yaml_emitter_check_empty_mapping(emitter *yaml_emitter_t) bool {
-	if len(emitter.events)-emitter.events_head < 2 {
-		return false
-	}
-	return emitter.events[emitter.events_head].typ == yaml_MAPPING_START_EVENT &&
-		emitter.events[emitter.events_head+1].typ == yaml_MAPPING_END_EVENT
-}
-
-// Check if the next node can be expressed as a simple key.
-func yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool {
-	length := 0
-	switch emitter.events[emitter.events_head].typ {
-	case yaml_ALIAS_EVENT:
-		length += len(emitter.anchor_data.anchor)
-	case yaml_SCALAR_EVENT:
-		if emitter.scalar_data.multiline {
-			return false
-		}
-		length += len(emitter.anchor_data.anchor) +
-			len(emitter.tag_data.handle) +
-			len(emitter.tag_data.suffix) +
-			len(emitter.scalar_data.value)
-	case yaml_SEQUENCE_START_EVENT:
-		if !yaml_emitter_check_empty_sequence(emitter) {
-			return false
-		}
-		length += len(emitter.anchor_data.anchor) +
-			len(emitter.tag_data.handle) +
-			len(emitter.tag_data.suffix)
-	case yaml_MAPPING_START_EVENT:
-		if !yaml_emitter_check_empty_mapping(emitter) {
-			return false
-		}
-		length += len(emitter.anchor_data.anchor) +
-			len(emitter.tag_data.handle) +
-			len(emitter.tag_data.suffix)
-	default:
-		return false
-	}
-	return length <= 128
-}
-
-// Determine an acceptable scalar style.
-func yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-
-	no_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0
-	if no_tag && !event.implicit && !event.quoted_implicit {
-		return yaml_emitter_set_emitter_error(emitter, "neither tag nor implicit flags are specified")
-	}
-
-	style := event.scalar_style()
-	if style == yaml_ANY_SCALAR_STYLE {
-		style = yaml_PLAIN_SCALAR_STYLE
-	}
-	if emitter.canonical {
-		style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
-	}
-	if emitter.simple_key_context && emitter.scalar_data.multiline {
-		style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
-	}
-
-	if style == yaml_PLAIN_SCALAR_STYLE {
-		if emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed ||
-			emitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed {
-			style = yaml_SINGLE_QUOTED_SCALAR_STYLE
-		}
-		if len(emitter.scalar_data.value) == 0 && (emitter.flow_level > 0 || emitter.simple_key_context) {
-			style = yaml_SINGLE_QUOTED_SCALAR_STYLE
-		}
-		if no_tag && !event.implicit {
-			style = yaml_SINGLE_QUOTED_SCALAR_STYLE
-		}
-	}
-	if style == yaml_SINGLE_QUOTED_SCALAR_STYLE {
-		if !emitter.scalar_data.single_quoted_allowed {
-			style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
-		}
-	}
-	if style == yaml_LITERAL_SCALAR_STYLE || style == yaml_FOLDED_SCALAR_STYLE {
-		if !emitter.scalar_data.block_allowed || emitter.flow_level > 0 || emitter.simple_key_context {
-			style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
-		}
-	}
-
-	if no_tag && !event.quoted_implicit && style != yaml_PLAIN_SCALAR_STYLE {
-		emitter.tag_data.handle = []byte{'!'}
-	}
-	emitter.scalar_data.style = style
-	return true
-}
-
-// Write an achor.
-func yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool {
-	if emitter.anchor_data.anchor == nil {
-		return true
-	}
-	c := []byte{'&'}
-	if emitter.anchor_data.alias {
-		c[0] = '*'
-	}
-	if !yaml_emitter_write_indicator(emitter, c, true, false, false) {
-		return false
-	}
-	return yaml_emitter_write_anchor(emitter, emitter.anchor_data.anchor)
-}
-
-// Write a tag.
-func yaml_emitter_process_tag(emitter *yaml_emitter_t) bool {
-	if len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 {
-		return true
-	}
-	if len(emitter.tag_data.handle) > 0 {
-		if !yaml_emitter_write_tag_handle(emitter, emitter.tag_data.handle) {
-			return false
-		}
-		if len(emitter.tag_data.suffix) > 0 {
-			if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) {
-				return false
-			}
-		}
-	} else {
-		// [Go] Allocate these slices elsewhere.
-		if !yaml_emitter_write_indicator(emitter, []byte("!<"), true, false, false) {
-			return false
-		}
-		if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) {
-			return false
-		}
-		if !yaml_emitter_write_indicator(emitter, []byte{'>'}, false, false, false) {
-			return false
-		}
-	}
-	return true
-}
-
-// Write a scalar.
-func yaml_emitter_process_scalar(emitter *yaml_emitter_t) bool {
-	switch emitter.scalar_data.style {
-	case yaml_PLAIN_SCALAR_STYLE:
-		return yaml_emitter_write_plain_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)
-
-	case yaml_SINGLE_QUOTED_SCALAR_STYLE:
-		return yaml_emitter_write_single_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)
-
-	case yaml_DOUBLE_QUOTED_SCALAR_STYLE:
-		return yaml_emitter_write_double_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)
-
-	case yaml_LITERAL_SCALAR_STYLE:
-		return yaml_emitter_write_literal_scalar(emitter, emitter.scalar_data.value)
-
-	case yaml_FOLDED_SCALAR_STYLE:
-		return yaml_emitter_write_folded_scalar(emitter, emitter.scalar_data.value)
-	}
-	panic("unknown scalar style")
-}
-
-// Check if a %YAML directive is valid.
-func yaml_emitter_analyze_version_directive(emitter *yaml_emitter_t, version_directive *yaml_version_directive_t) bool {
-	if version_directive.major != 1 || version_directive.minor != 1 {
-		return yaml_emitter_set_emitter_error(emitter, "incompatible %YAML directive")
-	}
-	return true
-}
-
-// Check if a %TAG directive is valid.
-func yaml_emitter_analyze_tag_directive(emitter *yaml_emitter_t, tag_directive *yaml_tag_directive_t) bool {
-	handle := tag_directive.handle
-	prefix := tag_directive.prefix
-	if len(handle) == 0 {
-		return yaml_emitter_set_emitter_error(emitter, "tag handle must not be empty")
-	}
-	if handle[0] != '!' {
-		return yaml_emitter_set_emitter_error(emitter, "tag handle must start with '!'")
-	}
-	if handle[len(handle)-1] != '!' {
-		return yaml_emitter_set_emitter_error(emitter, "tag handle must end with '!'")
-	}
-	for i := 1; i < len(handle)-1; i += width(handle[i]) {
-		if !is_alpha(handle, i) {
-			return yaml_emitter_set_emitter_error(emitter, "tag handle must contain alphanumerical characters only")
-		}
-	}
-	if len(prefix) == 0 {
-		return yaml_emitter_set_emitter_error(emitter, "tag prefix must not be empty")
-	}
-	return true
-}
-
-// Check if an anchor is valid.
-func yaml_emitter_analyze_anchor(emitter *yaml_emitter_t, anchor []byte, alias bool) bool {
-	if len(anchor) == 0 {
-		problem := "anchor value must not be empty"
-		if alias {
-			problem = "alias value must not be empty"
-		}
-		return yaml_emitter_set_emitter_error(emitter, problem)
-	}
-	for i := 0; i < len(anchor); i += width(anchor[i]) {
-		if !is_alpha(anchor, i) {
-			problem := "anchor value must contain alphanumerical characters only"
-			if alias {
-				problem = "alias value must contain alphanumerical characters only"
-			}
-			return yaml_emitter_set_emitter_error(emitter, problem)
-		}
-	}
-	emitter.anchor_data.anchor = anchor
-	emitter.anchor_data.alias = alias
-	return true
-}
-
-// Check if a tag is valid.
-func yaml_emitter_analyze_tag(emitter *yaml_emitter_t, tag []byte) bool {
-	if len(tag) == 0 {
-		return yaml_emitter_set_emitter_error(emitter, "tag value must not be empty")
-	}
-	for i := 0; i < len(emitter.tag_directives); i++ {
-		tag_directive := &emitter.tag_directives[i]
-		if bytes.HasPrefix(tag, tag_directive.prefix) {
-			emitter.tag_data.handle = tag_directive.handle
-			emitter.tag_data.suffix = tag[len(tag_directive.prefix):]
-			return true
-		}
-	}
-	emitter.tag_data.suffix = tag
-	return true
-}
-
-// Check if a scalar is valid.
-func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool {
-	var (
-		block_indicators   = false
-		flow_indicators    = false
-		line_breaks        = false
-		special_characters = false
-
-		leading_space  = false
-		leading_break  = false
-		trailing_space = false
-		trailing_break = false
-		break_space    = false
-		space_break    = false
-
-		preceeded_by_whitespace = false
-		followed_by_whitespace  = false
-		previous_space          = false
-		previous_break          = false
-	)
-
-	emitter.scalar_data.value = value
-
-	if len(value) == 0 {
-		emitter.scalar_data.multiline = false
-		emitter.scalar_data.flow_plain_allowed = false
-		emitter.scalar_data.block_plain_allowed = true
-		emitter.scalar_data.single_quoted_allowed = true
-		emitter.scalar_data.block_allowed = false
-		return true
-	}
-
-	if len(value) >= 3 && ((value[0] == '-' && value[1] == '-' && value[2] == '-') || (value[0] == '.' && value[1] == '.' && value[2] == '.')) {
-		block_indicators = true
-		flow_indicators = true
-	}
-
-	preceeded_by_whitespace = true
-	for i, w := 0, 0; i < len(value); i += w {
-		w = width(value[i])
-		followed_by_whitespace = i+w >= len(value) || is_blank(value, i+w)
-
-		if i == 0 {
-			switch value[i] {
-			case '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\'', '"', '%', '@', '`':
-				flow_indicators = true
-				block_indicators = true
-			case '?', ':':
-				flow_indicators = true
-				if followed_by_whitespace {
-					block_indicators = true
-				}
-			case '-':
-				if followed_by_whitespace {
-					flow_indicators = true
-					block_indicators = true
-				}
-			}
-		} else {
-			switch value[i] {
-			case ',', '?', '[', ']', '{', '}':
-				flow_indicators = true
-			case ':':
-				flow_indicators = true
-				if followed_by_whitespace {
-					block_indicators = true
-				}
-			case '#':
-				if preceeded_by_whitespace {
-					flow_indicators = true
-					block_indicators = true
-				}
-			}
-		}
-
-		if !is_printable(value, i) || !is_ascii(value, i) && !emitter.unicode {
-			special_characters = true
-		}
-		if is_space(value, i) {
-			if i == 0 {
-				leading_space = true
-			}
-			if i+width(value[i]) == len(value) {
-				trailing_space = true
-			}
-			if previous_break {
-				break_space = true
-			}
-			previous_space = true
-			previous_break = false
-		} else if is_break(value, i) {
-			line_breaks = true
-			if i == 0 {
-				leading_break = true
-			}
-			if i+width(value[i]) == len(value) {
-				trailing_break = true
-			}
-			if previous_space {
-				space_break = true
-			}
-			previous_space = false
-			previous_break = true
-		} else {
-			previous_space = false
-			previous_break = false
-		}
-
-		// [Go]: Why 'z'? Couldn't be the end of the string as that's the loop condition.
-		preceeded_by_whitespace = is_blankz(value, i)
-	}
-
-	emitter.scalar_data.multiline = line_breaks
-	emitter.scalar_data.flow_plain_allowed = true
-	emitter.scalar_data.block_plain_allowed = true
-	emitter.scalar_data.single_quoted_allowed = true
-	emitter.scalar_data.block_allowed = true
-
-	if leading_space || leading_break || trailing_space || trailing_break {
-		emitter.scalar_data.flow_plain_allowed = false
-		emitter.scalar_data.block_plain_allowed = false
-	}
-	if trailing_space {
-		emitter.scalar_data.block_allowed = false
-	}
-	if break_space {
-		emitter.scalar_data.flow_plain_allowed = false
-		emitter.scalar_data.block_plain_allowed = false
-		emitter.scalar_data.single_quoted_allowed = false
-	}
-	if space_break || special_characters {
-		emitter.scalar_data.flow_plain_allowed = false
-		emitter.scalar_data.block_plain_allowed = false
-		emitter.scalar_data.single_quoted_allowed = false
-		emitter.scalar_data.block_allowed = false
-	}
-	if line_breaks {
-		emitter.scalar_data.flow_plain_allowed = false
-		emitter.scalar_data.block_plain_allowed = false
-	}
-	if flow_indicators {
-		emitter.scalar_data.flow_plain_allowed = false
-	}
-	if block_indicators {
-		emitter.scalar_data.block_plain_allowed = false
-	}
-	return true
-}
-
-// Check if the event data is valid.
-func yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_event_t) bool {
-
-	emitter.anchor_data.anchor = nil
-	emitter.tag_data.handle = nil
-	emitter.tag_data.suffix = nil
-	emitter.scalar_data.value = nil
-
-	switch event.typ {
-	case yaml_ALIAS_EVENT:
-		if !yaml_emitter_analyze_anchor(emitter, event.anchor, true) {
-			return false
-		}
-
-	case yaml_SCALAR_EVENT:
-		if len(event.anchor) > 0 {
-			if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {
-				return false
-			}
-		}
-		if len(event.tag) > 0 && (emitter.canonical || (!event.implicit && !event.quoted_implicit)) {
-			if !yaml_emitter_analyze_tag(emitter, event.tag) {
-				return false
-			}
-		}
-		if !yaml_emitter_analyze_scalar(emitter, event.value) {
-			return false
-		}
-
-	case yaml_SEQUENCE_START_EVENT:
-		if len(event.anchor) > 0 {
-			if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {
-				return false
-			}
-		}
-		if len(event.tag) > 0 && (emitter.canonical || !event.implicit) {
-			if !yaml_emitter_analyze_tag(emitter, event.tag) {
-				return false
-			}
-		}
-
-	case yaml_MAPPING_START_EVENT:
-		if len(event.anchor) > 0 {
-			if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {
-				return false
-			}
-		}
-		if len(event.tag) > 0 && (emitter.canonical || !event.implicit) {
-			if !yaml_emitter_analyze_tag(emitter, event.tag) {
-				return false
-			}
-		}
-	}
-	return true
-}
-
-// Write the BOM character.
-func yaml_emitter_write_bom(emitter *yaml_emitter_t) bool {
-	if !flush(emitter) {
-		return false
-	}
-	pos := emitter.buffer_pos
-	emitter.buffer[pos+0] = '\xEF'
-	emitter.buffer[pos+1] = '\xBB'
-	emitter.buffer[pos+2] = '\xBF'
-	emitter.buffer_pos += 3
-	return true
-}
-
-func yaml_emitter_write_indent(emitter *yaml_emitter_t) bool {
-	indent := emitter.indent
-	if indent < 0 {
-		indent = 0
-	}
-	if !emitter.indention || emitter.column > indent || (emitter.column == indent && !emitter.whitespace) {
-		if !put_break(emitter) {
-			return false
-		}
-	}
-	for emitter.column < indent {
-		if !put(emitter, ' ') {
-			return false
-		}
-	}
-	emitter.whitespace = true
-	emitter.indention = true
-	return true
-}
-
-func yaml_emitter_write_indicator(emitter *yaml_emitter_t, indicator []byte, need_whitespace, is_whitespace, is_indention bool) bool {
-	if need_whitespace && !emitter.whitespace {
-		if !put(emitter, ' ') {
-			return false
-		}
-	}
-	if !write_all(emitter, indicator) {
-		return false
-	}
-	emitter.whitespace = is_whitespace
-	emitter.indention = (emitter.indention && is_indention)
-	emitter.open_ended = false
-	return true
-}
-
-func yaml_emitter_write_anchor(emitter *yaml_emitter_t, value []byte) bool {
-	if !write_all(emitter, value) {
-		return false
-	}
-	emitter.whitespace = false
-	emitter.indention = false
-	return true
-}
-
-func yaml_emitter_write_tag_handle(emitter *yaml_emitter_t, value []byte) bool {
-	if !emitter.whitespace {
-		if !put(emitter, ' ') {
-			return false
-		}
-	}
-	if !write_all(emitter, value) {
-		return false
-	}
-	emitter.whitespace = false
-	emitter.indention = false
-	return true
-}
-
-func yaml_emitter_write_tag_content(emitter *yaml_emitter_t, value []byte, need_whitespace bool) bool {
-	if need_whitespace && !emitter.whitespace {
-		if !put(emitter, ' ') {
-			return false
-		}
-	}
-	for i := 0; i < len(value); {
-		var must_write bool
-		switch value[i] {
-		case ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '_', '.', '~', '*', '\'', '(', ')', '[', ']':
-			must_write = true
-		default:
-			must_write = is_alpha(value, i)
-		}
-		if must_write {
-			if !write(emitter, value, &i) {
-				return false
-			}
-		} else {
-			w := width(value[i])
-			for k := 0; k < w; k++ {
-				octet := value[i]
-				i++
-				if !put(emitter, '%') {
-					return false
-				}
-
-				c := octet >> 4
-				if c < 10 {
-					c += '0'
-				} else {
-					c += 'A' - 10
-				}
-				if !put(emitter, c) {
-					return false
-				}
-
-				c = octet & 0x0f
-				if c < 10 {
-					c += '0'
-				} else {
-					c += 'A' - 10
-				}
-				if !put(emitter, c) {
-					return false
-				}
-			}
-		}
-	}
-	emitter.whitespace = false
-	emitter.indention = false
-	return true
-}
-
-func yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {
-	if !emitter.whitespace {
-		if !put(emitter, ' ') {
-			return false
-		}
-	}
-
-	spaces := false
-	breaks := false
-	for i := 0; i < len(value); {
-		if is_space(value, i) {
-			if allow_breaks && !spaces && emitter.column > emitter.best_width && !is_space(value, i+1) {
-				if !yaml_emitter_write_indent(emitter) {
-					return false
-				}
-				i += width(value[i])
-			} else {
-				if !write(emitter, value, &i) {
-					return false
-				}
-			}
-			spaces = true
-		} else if is_break(value, i) {
-			if !breaks && value[i] == '\n' {
-				if !put_break(emitter) {
-					return false
-				}
-			}
-			if !write_break(emitter, value, &i) {
-				return false
-			}
-			emitter.indention = true
-			breaks = true
-		} else {
-			if breaks {
-				if !yaml_emitter_write_indent(emitter) {
-					return false
-				}
-			}
-			if !write(emitter, value, &i) {
-				return false
-			}
-			emitter.indention = false
-			spaces = false
-			breaks = false
-		}
-	}
-
-	emitter.whitespace = false
-	emitter.indention = false
-	if emitter.root_context {
-		emitter.open_ended = true
-	}
-
-	return true
-}
-
-func yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {
-
-	if !yaml_emitter_write_indicator(emitter, []byte{'\''}, true, false, false) {
-		return false
-	}
-
-	spaces := false
-	breaks := false
-	for i := 0; i < len(value); {
-		if is_space(value, i) {
-			if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 && !is_space(value, i+1) {
-				if !yaml_emitter_write_indent(emitter) {
-					return false
-				}
-				i += width(value[i])
-			} else {
-				if !write(emitter, value, &i) {
-					return false
-				}
-			}
-			spaces = true
-		} else if is_break(value, i) {
-			if !breaks && value[i] == '\n' {
-				if !put_break(emitter) {
-					return false
-				}
-			}
-			if !write_break(emitter, value, &i) {
-				return false
-			}
-			emitter.indention = true
-			breaks = true
-		} else {
-			if breaks {
-				if !yaml_emitter_write_indent(emitter) {
-					return false
-				}
-			}
-			if value[i] == '\'' {
-				if !put(emitter, '\'') {
-					return false
-				}
-			}
-			if !write(emitter, value, &i) {
-				return false
-			}
-			emitter.indention = false
-			spaces = false
-			breaks = false
-		}
-	}
-	if !yaml_emitter_write_indicator(emitter, []byte{'\''}, false, false, false) {
-		return false
-	}
-	emitter.whitespace = false
-	emitter.indention = false
-	return true
-}
-
-func yaml_emitter_write_double_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {
-	spaces := false
-	if !yaml_emitter_write_indicator(emitter, []byte{'"'}, true, false, false) {
-		return false
-	}
-
-	for i := 0; i < len(value); {
-		if !is_printable(value, i) || (!emitter.unicode && !is_ascii(value, i)) ||
-			is_bom(value, i) || is_break(value, i) ||
-			value[i] == '"' || value[i] == '\\' {
-
-			octet := value[i]
-
-			var w int
-			var v rune
-			switch {
-			case octet&0x80 == 0x00:
-				w, v = 1, rune(octet&0x7F)
-			case octet&0xE0 == 0xC0:
-				w, v = 2, rune(octet&0x1F)
-			case octet&0xF0 == 0xE0:
-				w, v = 3, rune(octet&0x0F)
-			case octet&0xF8 == 0xF0:
-				w, v = 4, rune(octet&0x07)
-			}
-			for k := 1; k < w; k++ {
-				octet = value[i+k]
-				v = (v << 6) + (rune(octet) & 0x3F)
-			}
-			i += w
-
-			if !put(emitter, '\\') {
-				return false
-			}
-
-			var ok bool
-			switch v {
-			case 0x00:
-				ok = put(emitter, '0')
-			case 0x07:
-				ok = put(emitter, 'a')
-			case 0x08:
-				ok = put(emitter, 'b')
-			case 0x09:
-				ok = put(emitter, 't')
-			case 0x0A:
-				ok = put(emitter, 'n')
-			case 0x0b:
-				ok = put(emitter, 'v')
-			case 0x0c:
-				ok = put(emitter, 'f')
-			case 0x0d:
-				ok = put(emitter, 'r')
-			case 0x1b:
-				ok = put(emitter, 'e')
-			case 0x22:
-				ok = put(emitter, '"')
-			case 0x5c:
-				ok = put(emitter, '\\')
-			case 0x85:
-				ok = put(emitter, 'N')
-			case 0xA0:
-				ok = put(emitter, '_')
-			case 0x2028:
-				ok = put(emitter, 'L')
-			case 0x2029:
-				ok = put(emitter, 'P')
-			default:
-				if v <= 0xFF {
-					ok = put(emitter, 'x')
-					w = 2
-				} else if v <= 0xFFFF {
-					ok = put(emitter, 'u')
-					w = 4
-				} else {
-					ok = put(emitter, 'U')
-					w = 8
-				}
-				for k := (w - 1) * 4; ok && k >= 0; k -= 4 {
-					digit := byte((v >> uint(k)) & 0x0F)
-					if digit < 10 {
-						ok = put(emitter, digit+'0')
-					} else {
-						ok = put(emitter, digit+'A'-10)
-					}
-				}
-			}
-			if !ok {
-				return false
-			}
-			spaces = false
-		} else if is_space(value, i) {
-			if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 {
-				if !yaml_emitter_write_indent(emitter) {
-					return false
-				}
-				if is_space(value, i+1) {
-					if !put(emitter, '\\') {
-						return false
-					}
-				}
-				i += width(value[i])
-			} else if !write(emitter, value, &i) {
-				return false
-			}
-			spaces = true
-		} else {
-			if !write(emitter, value, &i) {
-				return false
-			}
-			spaces = false
-		}
-	}
-	if !yaml_emitter_write_indicator(emitter, []byte{'"'}, false, false, false) {
-		return false
-	}
-	emitter.whitespace = false
-	emitter.indention = false
-	return true
-}
-
-func yaml_emitter_write_block_scalar_hints(emitter *yaml_emitter_t, value []byte) bool {
-	if is_space(value, 0) || is_break(value, 0) {
-		indent_hint := []byte{'0' + byte(emitter.best_indent)}
-		if !yaml_emitter_write_indicator(emitter, indent_hint, false, false, false) {
-			return false
-		}
-	}
-
-	emitter.open_ended = false
-
-	var chomp_hint [1]byte
-	if len(value) == 0 {
-		chomp_hint[0] = '-'
-	} else {
-		i := len(value) - 1
-		for value[i]&0xC0 == 0x80 {
-			i--
-		}
-		if !is_break(value, i) {
-			chomp_hint[0] = '-'
-		} else if i == 0 {
-			chomp_hint[0] = '+'
-			emitter.open_ended = true
-		} else {
-			i--
-			for value[i]&0xC0 == 0x80 {
-				i--
-			}
-			if is_break(value, i) {
-				chomp_hint[0] = '+'
-				emitter.open_ended = true
-			}
-		}
-	}
-	if chomp_hint[0] != 0 {
-		if !yaml_emitter_write_indicator(emitter, chomp_hint[:], false, false, false) {
-			return false
-		}
-	}
-	return true
-}
-
-func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bool {
-	if !yaml_emitter_write_indicator(emitter, []byte{'|'}, true, false, false) {
-		return false
-	}
-	if !yaml_emitter_write_block_scalar_hints(emitter, value) {
-		return false
-	}
-	if !put_break(emitter) {
-		return false
-	}
-	emitter.indention = true
-	emitter.whitespace = true
-	breaks := true
-	for i := 0; i < len(value); {
-		if is_break(value, i) {
-			if !write_break(emitter, value, &i) {
-				return false
-			}
-			emitter.indention = true
-			breaks = true
-		} else {
-			if breaks {
-				if !yaml_emitter_write_indent(emitter) {
-					return false
-				}
-			}
-			if !write(emitter, value, &i) {
-				return false
-			}
-			emitter.indention = false
-			breaks = false
-		}
-	}
-
-	return true
-}
-
-func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) bool {
-	if !yaml_emitter_write_indicator(emitter, []byte{'>'}, true, false, false) {
-		return false
-	}
-	if !yaml_emitter_write_block_scalar_hints(emitter, value) {
-		return false
-	}
-
-	if !put_break(emitter) {
-		return false
-	}
-	emitter.indention = true
-	emitter.whitespace = true
-
-	breaks := true
-	leading_spaces := true
-	for i := 0; i < len(value); {
-		if is_break(value, i) {
-			if !breaks && !leading_spaces && value[i] == '\n' {
-				k := 0
-				for is_break(value, k) {
-					k += width(value[k])
-				}
-				if !is_blankz(value, k) {
-					if !put_break(emitter) {
-						return false
-					}
-				}
-			}
-			if !write_break(emitter, value, &i) {
-				return false
-			}
-			emitter.indention = true
-			breaks = true
-		} else {
-			if breaks {
-				if !yaml_emitter_write_indent(emitter) {
-					return false
-				}
-				leading_spaces = is_blank(value, i)
-			}
-			if !breaks && is_space(value, i) && !is_space(value, i+1) && emitter.column > emitter.best_width {
-				if !yaml_emitter_write_indent(emitter) {
-					return false
-				}
-				i += width(value[i])
-			} else {
-				if !write(emitter, value, &i) {
-					return false
-				}
-			}
-			emitter.indention = false
-			breaks = false
-		}
-	}
-	return true
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/encode.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/encode.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/encode.go
deleted file mode 100644
index 84f8499..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/encode.go
+++ /dev/null
@@ -1,306 +0,0 @@
-package yaml
-
-import (
-	"encoding"
-	"fmt"
-	"reflect"
-	"regexp"
-	"sort"
-	"strconv"
-	"strings"
-	"time"
-)
-
-type encoder struct {
-	emitter yaml_emitter_t
-	event   yaml_event_t
-	out     []byte
-	flow    bool
-}
-
-func newEncoder() (e *encoder) {
-	e = &encoder{}
-	e.must(yaml_emitter_initialize(&e.emitter))
-	yaml_emitter_set_output_string(&e.emitter, &e.out)
-	yaml_emitter_set_unicode(&e.emitter, true)
-	e.must(yaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING))
-	e.emit()
-	e.must(yaml_document_start_event_initialize(&e.event, nil, nil, true))
-	e.emit()
-	return e
-}
-
-func (e *encoder) finish() {
-	e.must(yaml_document_end_event_initialize(&e.event, true))
-	e.emit()
-	e.emitter.open_ended = false
-	e.must(yaml_stream_end_event_initialize(&e.event))
-	e.emit()
-}
-
-func (e *encoder) destroy() {
-	yaml_emitter_delete(&e.emitter)
-}
-
-func (e *encoder) emit() {
-	// This will internally delete the e.event value.
-	if !yaml_emitter_emit(&e.emitter, &e.event) && e.event.typ != yaml_DOCUMENT_END_EVENT && e.event.typ != yaml_STREAM_END_EVENT {
-		e.must(false)
-	}
-}
-
-func (e *encoder) must(ok bool) {
-	if !ok {
-		msg := e.emitter.problem
-		if msg == "" {
-			msg = "unknown problem generating YAML content"
-		}
-		failf("%s", msg)
-	}
-}
-
-func (e *encoder) marshal(tag string, in reflect.Value) {
-	if !in.IsValid() {
-		e.nilv()
-		return
-	}
-	iface := in.Interface()
-	if m, ok := iface.(Marshaler); ok {
-		v, err := m.MarshalYAML()
-		if err != nil {
-			fail(err)
-		}
-		if v == nil {
-			e.nilv()
-			return
-		}
-		in = reflect.ValueOf(v)
-	} else if m, ok := iface.(encoding.TextMarshaler); ok {
-		text, err := m.MarshalText()
-		if err != nil {
-			fail(err)
-		}
-		in = reflect.ValueOf(string(text))
-	}
-	switch in.Kind() {
-	case reflect.Interface:
-		if in.IsNil() {
-			e.nilv()
-		} else {
-			e.marshal(tag, in.Elem())
-		}
-	case reflect.Map:
-		e.mapv(tag, in)
-	case reflect.Ptr:
-		if in.IsNil() {
-			e.nilv()
-		} else {
-			e.marshal(tag, in.Elem())
-		}
-	case reflect.Struct:
-		e.structv(tag, in)
-	case reflect.Slice:
-		if in.Type().Elem() == mapItemType {
-			e.itemsv(tag, in)
-		} else {
-			e.slicev(tag, in)
-		}
-	case reflect.String:
-		e.stringv(tag, in)
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		if in.Type() == durationType {
-			e.stringv(tag, reflect.ValueOf(iface.(time.Duration).String()))
-		} else {
-			e.intv(tag, in)
-		}
-	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
-		e.uintv(tag, in)
-	case reflect.Float32, reflect.Float64:
-		e.floatv(tag, in)
-	case reflect.Bool:
-		e.boolv(tag, in)
-	default:
-		panic("cannot marshal type: " + in.Type().String())
-	}
-}
-
-func (e *encoder) mapv(tag string, in reflect.Value) {
-	e.mappingv(tag, func() {
-		keys := keyList(in.MapKeys())
-		sort.Sort(keys)
-		for _, k := range keys {
-			e.marshal("", k)
-			e.marshal("", in.MapIndex(k))
-		}
-	})
-}
-
-func (e *encoder) itemsv(tag string, in reflect.Value) {
-	e.mappingv(tag, func() {
-		slice := in.Convert(reflect.TypeOf([]MapItem{})).Interface().([]MapItem)
-		for _, item := range slice {
-			e.marshal("", reflect.ValueOf(item.Key))
-			e.marshal("", reflect.ValueOf(item.Value))
-		}
-	})
-}
-
-func (e *encoder) structv(tag string, in reflect.Value) {
-	sinfo, err := getStructInfo(in.Type())
-	if err != nil {
-		panic(err)
-	}
-	e.mappingv(tag, func() {
-		for _, info := range sinfo.FieldsList {
-			var value reflect.Value
-			if info.Inline == nil {
-				value = in.Field(info.Num)
-			} else {
-				value = in.FieldByIndex(info.Inline)
-			}
-			if info.OmitEmpty && isZero(value) {
-				continue
-			}
-			e.marshal("", reflect.ValueOf(info.Key))
-			e.flow = info.Flow
-			e.marshal("", value)
-		}
-		if sinfo.InlineMap >= 0 {
-			m := in.Field(sinfo.InlineMap)
-			if m.Len() > 0 {
-				e.flow = false
-				keys := keyList(m.MapKeys())
-				sort.Sort(keys)
-				for _, k := range keys {
-					if _, found := sinfo.FieldsMap[k.String()]; found {
-						panic(fmt.Sprintf("Can't have key %q in inlined map; conflicts with struct field", k.String()))
-					}
-					e.marshal("", k)
-					e.flow = false
-					e.marshal("", m.MapIndex(k))
-				}
-			}
-		}
-	})
-}
-
-func (e *encoder) mappingv(tag string, f func()) {
-	implicit := tag == ""
-	style := yaml_BLOCK_MAPPING_STYLE
-	if e.flow {
-		e.flow = false
-		style = yaml_FLOW_MAPPING_STYLE
-	}
-	e.must(yaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style))
-	e.emit()
-	f()
-	e.must(yaml_mapping_end_event_initialize(&e.event))
-	e.emit()
-}
-
-func (e *encoder) slicev(tag string, in reflect.Value) {
-	implicit := tag == ""
-	style := yaml_BLOCK_SEQUENCE_STYLE
-	if e.flow {
-		e.flow = false
-		style = yaml_FLOW_SEQUENCE_STYLE
-	}
-	e.must(yaml_sequence_start_event_initialize(&e.event, nil, []byte(tag), implicit, style))
-	e.emit()
-	n := in.Len()
-	for i := 0; i < n; i++ {
-		e.marshal("", in.Index(i))
-	}
-	e.must(yaml_sequence_end_event_initialize(&e.event))
-	e.emit()
-}
-
-// isBase60 returns whether s is in base 60 notation as defined in YAML 1.1.
-//
-// The base 60 float notation in YAML 1.1 is a terrible idea and is unsupported
-// in YAML 1.2 and by this package, but these should be marshalled quoted for
-// the time being for compatibility with other parsers.
-func isBase60Float(s string) (result bool) {
-	// Fast path.
-	if s == "" {
-		return false
-	}
-	c := s[0]
-	if !(c == '+' || c == '-' || c >= '0' && c <= '9') || strings.IndexByte(s, ':') < 0 {
-		return false
-	}
-	// Do the full match.
-	return base60float.MatchString(s)
-}
-
-// From http://yaml.org/type/float.html, except the regular expression there
-// is bogus. In practice parsers do not enforce the "\.[0-9_]*" suffix.
-var base60float = regexp.MustCompile(`^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\.[0-9_]*)?$`)
-
-func (e *encoder) stringv(tag string, in reflect.Value) {
-	var style yaml_scalar_style_t
-	s := in.String()
-	rtag, rs := resolve("", s)
-	if rtag == yaml_BINARY_TAG {
-		if tag == "" || tag == yaml_STR_TAG {
-			tag = rtag
-			s = rs.(string)
-		} else if tag == yaml_BINARY_TAG {
-			failf("explicitly tagged !!binary data must be base64-encoded")
-		} else {
-			failf("cannot marshal invalid UTF-8 data as %s", shortTag(tag))
-		}
-	}
-	if tag == "" && (rtag != yaml_STR_TAG || isBase60Float(s)) {
-		style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
-	} else if strings.Contains(s, "\n") {
-		style = yaml_LITERAL_SCALAR_STYLE
-	} else {
-		style = yaml_PLAIN_SCALAR_STYLE
-	}
-	e.emitScalar(s, "", tag, style)
-}
-
-func (e *encoder) boolv(tag string, in reflect.Value) {
-	var s string
-	if in.Bool() {
-		s = "true"
-	} else {
-		s = "false"
-	}
-	e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE)
-}
-
-func (e *encoder) intv(tag string, in reflect.Value) {
-	s := strconv.FormatInt(in.Int(), 10)
-	e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE)
-}
-
-func (e *encoder) uintv(tag string, in reflect.Value) {
-	s := strconv.FormatUint(in.Uint(), 10)
-	e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE)
-}
-
-func (e *encoder) floatv(tag string, in reflect.Value) {
-	// FIXME: Handle 64 bits here.
-	s := strconv.FormatFloat(float64(in.Float()), 'g', -1, 32)
-	switch s {
-	case "+Inf":
-		s = ".inf"
-	case "-Inf":
-		s = "-.inf"
-	case "NaN":
-		s = ".nan"
-	}
-	e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE)
-}
-
-func (e *encoder) nilv() {
-	e.emitScalar("null", "", "", yaml_PLAIN_SCALAR_STYLE)
-}
-
-func (e *encoder) emitScalar(value, anchor, tag string, style yaml_scalar_style_t) {
-	implicit := tag == ""
-	e.must(yaml_scalar_event_initialize(&e.event, []byte(anchor), []byte(tag), []byte(value), implicit, implicit, style))
-	e.emit()
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/encode_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/encode_test.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/encode_test.go
deleted file mode 100644
index 1b35452..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/encode_test.go
+++ /dev/null
@@ -1,495 +0,0 @@
-package yaml_test
-
-import (
-	"fmt"
-	"math"
-	"strconv"
-	"strings"
-	"time"
-
-	. "gopkg.in/check.v1"
-	"gopkg.in/yaml.v2"
-	"net"
-	"os"
-)
-
-var marshalIntTest = 123
-
-var marshalTests = []struct {
-	value interface{}
-	data  string
-}{
-	{
-		nil,
-		"null\n",
-	}, {
-		&struct{}{},
-		"{}\n",
-	}, {
-		map[string]string{"v": "hi"},
-		"v: hi\n",
-	}, {
-		map[string]interface{}{"v": "hi"},
-		"v: hi\n",
-	}, {
-		map[string]string{"v": "true"},
-		"v: \"true\"\n",
-	}, {
-		map[string]string{"v": "false"},
-		"v: \"false\"\n",
-	}, {
-		map[string]interface{}{"v": true},
-		"v: true\n",
-	}, {
-		map[string]interface{}{"v": false},
-		"v: false\n",
-	}, {
-		map[string]interface{}{"v": 10},
-		"v: 10\n",
-	}, {
-		map[string]interface{}{"v": -10},
-		"v: -10\n",
-	}, {
-		map[string]uint{"v": 42},
-		"v: 42\n",
-	}, {
-		map[string]interface{}{"v": int64(4294967296)},
-		"v: 4294967296\n",
-	}, {
-		map[string]int64{"v": int64(4294967296)},
-		"v: 4294967296\n",
-	}, {
-		map[string]uint64{"v": 4294967296},
-		"v: 4294967296\n",
-	}, {
-		map[string]interface{}{"v": "10"},
-		"v: \"10\"\n",
-	}, {
-		map[string]interface{}{"v": 0.1},
-		"v: 0.1\n",
-	}, {
-		map[string]interface{}{"v": float64(0.1)},
-		"v: 0.1\n",
-	}, {
-		map[string]interface{}{"v": -0.1},
-		"v: -0.1\n",
-	}, {
-		map[string]interface{}{"v": math.Inf(+1)},
-		"v: .inf\n",
-	}, {
-		map[string]interface{}{"v": math.Inf(-1)},
-		"v: -.inf\n",
-	}, {
-		map[string]interface{}{"v": math.NaN()},
-		"v: .nan\n",
-	}, {
-		map[string]interface{}{"v": nil},
-		"v: null\n",
-	}, {
-		map[string]interface{}{"v": ""},
-		"v: \"\"\n",
-	}, {
-		map[string][]string{"v": []string{"A", "B"}},
-		"v:\n- A\n- B\n",
-	}, {
-		map[string][]string{"v": []string{"A", "B\nC"}},
-		"v:\n- A\n- |-\n  B\n  C\n",
-	}, {
-		map[string][]interface{}{"v": []interface{}{"A", 1, map[string][]int{"B": []int{2, 3}}}},
-		"v:\n- A\n- 1\n- B:\n  - 2\n  - 3\n",
-	}, {
-		map[string]interface{}{"a": map[interface{}]interface{}{"b": "c"}},
-		"a:\n  b: c\n",
-	}, {
-		map[string]interface{}{"a": "-"},
-		"a: '-'\n",
-	},
-
-	// Simple values.
-	{
-		&marshalIntTest,
-		"123\n",
-	},
-
-	// Structures
-	{
-		&struct{ Hello string }{"world"},
-		"hello: world\n",
-	}, {
-		&struct {
-			A struct {
-				B string
-			}
-		}{struct{ B string }{"c"}},
-		"a:\n  b: c\n",
-	}, {
-		&struct {
-			A *struct {
-				B string
-			}
-		}{&struct{ B string }{"c"}},
-		"a:\n  b: c\n",
-	}, {
-		&struct {
-			A *struct {
-				B string
-			}
-		}{},
-		"a: null\n",
-	}, {
-		&struct{ A int }{1},
-		"a: 1\n",
-	}, {
-		&struct{ A []int }{[]int{1, 2}},
-		"a:\n- 1\n- 2\n",
-	}, {
-		&struct {
-			B int "a"
-		}{1},
-		"a: 1\n",
-	}, {
-		&struct{ A bool }{true},
-		"a: true\n",
-	},
-
-	// Conditional flag
-	{
-		&struct {
-			A int "a,omitempty"
-			B int "b,omitempty"
-		}{1, 0},
-		"a: 1\n",
-	}, {
-		&struct {
-			A int "a,omitempty"
-			B int "b,omitempty"
-		}{0, 0},
-		"{}\n",
-	}, {
-		&struct {
-			A *struct{ X, y int } "a,omitempty,flow"
-		}{&struct{ X, y int }{1, 2}},
-		"a: {x: 1}\n",
-	}, {
-		&struct {
-			A *struct{ X, y int } "a,omitempty,flow"
-		}{nil},
-		"{}\n",
-	}, {
-		&struct {
-			A *struct{ X, y int } "a,omitempty,flow"
-		}{&struct{ X, y int }{}},
-		"a: {x: 0}\n",
-	}, {
-		&struct {
-			A struct{ X, y int } "a,omitempty,flow"
-		}{struct{ X, y int }{1, 2}},
-		"a: {x: 1}\n",
-	}, {
-		&struct {
-			A struct{ X, y int } "a,omitempty,flow"
-		}{struct{ X, y int }{0, 1}},
-		"{}\n",
-	},
-
-	// Flow flag
-	{
-		&struct {
-			A []int "a,flow"
-		}{[]int{1, 2}},
-		"a: [1, 2]\n",
-	}, {
-		&struct {
-			A map[string]string "a,flow"
-		}{map[string]string{"b": "c", "d": "e"}},
-		"a: {b: c, d: e}\n",
-	}, {
-		&struct {
-			A struct {
-				B, D string
-			} "a,flow"
-		}{struct{ B, D string }{"c", "e"}},
-		"a: {b: c, d: e}\n",
-	},
-
-	// Unexported field
-	{
-		&struct {
-			u int
-			A int
-		}{0, 1},
-		"a: 1\n",
-	},
-
-	// Ignored field
-	{
-		&struct {
-			A int
-			B int "-"
-		}{1, 2},
-		"a: 1\n",
-	},
-
-	// Struct inlining
-	{
-		&struct {
-			A int
-			C inlineB `yaml:",inline"`
-		}{1, inlineB{2, inlineC{3}}},
-		"a: 1\nb: 2\nc: 3\n",
-	},
-
-	// Map inlining
-	{
-		&struct {
-			A int
-			C map[string]int `yaml:",inline"`
-		}{1, map[string]int{"b": 2, "c": 3}},
-		"a: 1\nb: 2\nc: 3\n",
-	},
-
-	// Duration
-	{
-		map[string]time.Duration{"a": 3 * time.Second},
-		"a: 3s\n",
-	},
-
-	// Issue #24: bug in map merging logic.
-	{
-		map[string]string{"a": "<foo>"},
-		"a: <foo>\n",
-	},
-
-	// Issue #34: marshal unsupported base 60 floats quoted for compatibility
-	// with old YAML 1.1 parsers.
-	{
-		map[string]string{"a": "1:1"},
-		"a: \"1:1\"\n",
-	},
-
-	// Binary data.
-	{
-		map[string]string{"a": "\x00"},
-		"a: \"\\0\"\n",
-	}, {
-		map[string]string{"a": "\x80\x81\x82"},
-		"a: !!binary gIGC\n",
-	}, {
-		map[string]string{"a": strings.Repeat("\x90", 54)},
-		"a: !!binary |\n  " + strings.Repeat("kJCQ", 17) + "kJ\n  CQ\n",
-	},
-
-	// Ordered maps.
-	{
-		&yaml.MapSlice{{"b", 2}, {"a", 1}, {"d", 4}, {"c", 3}, {"sub", yaml.MapSlice{{"e", 5}}}},
-		"b: 2\na: 1\nd: 4\nc: 3\nsub:\n  e: 5\n",
-	},
-
-	// Encode unicode as utf-8 rather than in escaped form.
-	{
-		map[string]string{"a": "你好"},
-		"a: 你好\n",
-	},
-
-	// Support encoding.TextMarshaler.
-	{
-		map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)},
-		"a: 1.2.3.4\n",
-	},
-	{
-		map[string]time.Time{"a": time.Unix(1424801979, 0)},
-		"a: 2015-02-24T18:19:39Z\n",
-	},
-
-	// Ensure strings containing ": " are quoted (reported as PR #43, but not reproducible).
-	{
-		map[string]string{"a": "b: c"},
-		"a: 'b: c'\n",
-	},
-
-	// Containing hash mark ('#') in string should be quoted
-	{
-		map[string]string{"a": "Hello #comment"},
-		"a: 'Hello #comment'\n",
-	},
-	{
-		map[string]string{"a": "你好 #comment"},
-		"a: '你好 #comment'\n",
-	},
-}
-
-func (s *S) TestMarshal(c *C) {
-	defer os.Setenv("TZ", os.Getenv("TZ"))
-	os.Setenv("TZ", "UTC")
-	for _, item := range marshalTests {
-		data, err := yaml.Marshal(item.value)
-		c.Assert(err, IsNil)
-		c.Assert(string(data), Equals, item.data)
-	}
-}
-
-var marshalErrorTests = []struct {
-	value interface{}
-	error string
-	panic string
-}{{
-	value: &struct {
-		B       int
-		inlineB ",inline"
-	}{1, inlineB{2, inlineC{3}}},
-	panic: `Duplicated key 'b' in struct struct \{ B int; .*`,
-}, {
-	value: &struct {
-		A       int
-		B map[string]int ",inline"
-	}{1, map[string]int{"a": 2}},
-	panic: `Can't have key "a" in inlined map; conflicts with struct field`,
-}}
-
-func (s *S) TestMarshalErrors(c *C) {
-	for _, item := range marshalErrorTests {
-		if item.panic != "" {
-			c.Assert(func() { yaml.Marshal(item.value) }, PanicMatches, item.panic)
-		} else {
-			_, err := yaml.Marshal(item.value)
-			c.Assert(err, ErrorMatches, item.error)
-		}
-	}
-}
-
-func (s *S) TestMarshalTypeCache(c *C) {
-	var data []byte
-	var err error
-	func() {
-		type T struct{ A int }
-		data, err = yaml.Marshal(&T{})
-		c.Assert(err, IsNil)
-	}()
-	func() {
-		type T struct{ B int }
-		data, err = yaml.Marshal(&T{})
-		c.Assert(err, IsNil)
-	}()
-	c.Assert(string(data), Equals, "b: 0\n")
-}
-
-var marshalerTests = []struct {
-	data  string
-	value interface{}
-}{
-	{"_:\n  hi: there\n", map[interface{}]interface{}{"hi": "there"}},
-	{"_:\n- 1\n- A\n", []interface{}{1, "A"}},
-	{"_: 10\n", 10},
-	{"_: null\n", nil},
-	{"_: BAR!\n", "BAR!"},
-}
-
-type marshalerType struct {
-	value interface{}
-}
-
-func (o marshalerType) MarshalText() ([]byte, error) {
-	panic("MarshalText called on type with MarshalYAML")
-}
-
-func (o marshalerType) MarshalYAML() (interface{}, error) {
-	return o.value, nil
-}
-
-type marshalerValue struct {
-	Field marshalerType "_"
-}
-
-func (s *S) TestMarshaler(c *C) {
-	for _, item := range marshalerTests {
-		obj := &marshalerValue{}
-		obj.Field.value = item.value
-		data, err := yaml.Marshal(obj)
-		c.Assert(err, IsNil)
-		c.Assert(string(data), Equals, string(item.data))
-	}
-}
-
-func (s *S) TestMarshalerWholeDocument(c *C) {
-	obj := &marshalerType{}
-	obj.value = map[string]string{"hello": "world!"}
-	data, err := yaml.Marshal(obj)
-	c.Assert(err, IsNil)
-	c.Assert(string(data), Equals, "hello: world!\n")
-}
-
-type failingMarshaler struct{}
-
-func (ft *failingMarshaler) MarshalYAML() (interface{}, error) {
-	return nil, failingErr
-}
-
-func (s *S) TestMarshalerError(c *C) {
-	_, err := yaml.Marshal(&failingMarshaler{})
-	c.Assert(err, Equals, failingErr)
-}
-
-func (s *S) TestSortedOutput(c *C) {
-	order := []interface{}{
-		false,
-		true,
-		1,
-		uint(1),
-		1.0,
-		1.1,
-		1.2,
-		2,
-		uint(2),
-		2.0,
-		2.1,
-		"",
-		".1",
-		".2",
-		".a",
-		"1",
-		"2",
-		"a!10",
-		"a/2",
-		"a/10",
-		"a~10",
-		"ab/1",
-		"b/1",
-		"b/01",
-		"b/2",
-		"b/02",
-		"b/3",
-		"b/03",
-		"b1",
-		"b01",
-		"b3",
-		"c2.10",
-		"c10.2",
-		"d1",
-		"d12",
-		"d12a",
-	}
-	m := make(map[interface{}]int)
-	for _, k := range order {
-		m[k] = 1
-	}
-	data, err := yaml.Marshal(m)
-	c.Assert(err, IsNil)
-	out := "\n" + string(data)
-	last := 0
-	for i, k := range order {
-		repr := fmt.Sprint(k)
-		if s, ok := k.(string); ok {
-			if _, err = strconv.ParseFloat(repr, 32); s == "" || err == nil {
-				repr = `"` + repr + `"`
-			}
-		}
-		index := strings.Index(out, "\n"+repr+":")
-		if index == -1 {
-			c.Fatalf("%#v is not in the output: %#v", k, out)
-		}
-		if index < last {
-			c.Fatalf("%#v was generated before %#v: %q", k, order[i-1], out)
-		}
-		last = index
-	}
-}


[40/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/parse.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/parse.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/parse.go
deleted file mode 100644
index c6069be..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/parse.go
+++ /dev/null
@@ -1,498 +0,0 @@
-package toml
-
-import (
-	"fmt"
-	"log"
-	"strconv"
-	"strings"
-	"time"
-	"unicode"
-	"unicode/utf8"
-)
-
-type parser struct {
-	mapping map[string]interface{}
-	types   map[string]tomlType
-	lx      *lexer
-
-	// A list of keys in the order that they appear in the TOML data.
-	ordered []Key
-
-	// the full key for the current hash in scope
-	context Key
-
-	// the base key name for everything except hashes
-	currentKey string
-
-	// rough approximation of line number
-	approxLine int
-
-	// A map of 'key.group.names' to whether they were created implicitly.
-	implicits map[string]bool
-}
-
-type parseError string
-
-func (pe parseError) Error() string {
-	return string(pe)
-}
-
-func parse(data string) (p *parser, err error) {
-	defer func() {
-		if r := recover(); r != nil {
-			var ok bool
-			if err, ok = r.(parseError); ok {
-				return
-			}
-			panic(r)
-		}
-	}()
-
-	p = &parser{
-		mapping:   make(map[string]interface{}),
-		types:     make(map[string]tomlType),
-		lx:        lex(data),
-		ordered:   make([]Key, 0),
-		implicits: make(map[string]bool),
-	}
-	for {
-		item := p.next()
-		if item.typ == itemEOF {
-			break
-		}
-		p.topLevel(item)
-	}
-
-	return p, nil
-}
-
-func (p *parser) panicf(format string, v ...interface{}) {
-	msg := fmt.Sprintf("Near line %d (last key parsed '%s'): %s",
-		p.approxLine, p.current(), fmt.Sprintf(format, v...))
-	panic(parseError(msg))
-}
-
-func (p *parser) next() item {
-	it := p.lx.nextItem()
-	if it.typ == itemError {
-		p.panicf("%s", it.val)
-	}
-	return it
-}
-
-func (p *parser) bug(format string, v ...interface{}) {
-	log.Fatalf("BUG: %s\n\n", fmt.Sprintf(format, v...))
-}
-
-func (p *parser) expect(typ itemType) item {
-	it := p.next()
-	p.assertEqual(typ, it.typ)
-	return it
-}
-
-func (p *parser) assertEqual(expected, got itemType) {
-	if expected != got {
-		p.bug("Expected '%s' but got '%s'.", expected, got)
-	}
-}
-
-func (p *parser) topLevel(item item) {
-	switch item.typ {
-	case itemCommentStart:
-		p.approxLine = item.line
-		p.expect(itemText)
-	case itemTableStart:
-		kg := p.next()
-		p.approxLine = kg.line
-
-		var key Key
-		for ; kg.typ != itemTableEnd && kg.typ != itemEOF; kg = p.next() {
-			key = append(key, p.keyString(kg))
-		}
-		p.assertEqual(itemTableEnd, kg.typ)
-
-		p.establishContext(key, false)
-		p.setType("", tomlHash)
-		p.ordered = append(p.ordered, key)
-	case itemArrayTableStart:
-		kg := p.next()
-		p.approxLine = kg.line
-
-		var key Key
-		for ; kg.typ != itemArrayTableEnd && kg.typ != itemEOF; kg = p.next() {
-			key = append(key, p.keyString(kg))
-		}
-		p.assertEqual(itemArrayTableEnd, kg.typ)
-
-		p.establishContext(key, true)
-		p.setType("", tomlArrayHash)
-		p.ordered = append(p.ordered, key)
-	case itemKeyStart:
-		kname := p.next()
-		p.approxLine = kname.line
-		p.currentKey = p.keyString(kname)
-
-		val, typ := p.value(p.next())
-		p.setValue(p.currentKey, val)
-		p.setType(p.currentKey, typ)
-		p.ordered = append(p.ordered, p.context.add(p.currentKey))
-		p.currentKey = ""
-	default:
-		p.bug("Unexpected type at top level: %s", item.typ)
-	}
-}
-
-// Gets a string for a key (or part of a key in a table name).
-func (p *parser) keyString(it item) string {
-	switch it.typ {
-	case itemText:
-		return it.val
-	case itemString, itemMultilineString,
-		itemRawString, itemRawMultilineString:
-		s, _ := p.value(it)
-		return s.(string)
-	default:
-		p.bug("Unexpected key type: %s", it.typ)
-		panic("unreachable")
-	}
-}
-
-// value translates an expected value from the lexer into a Go value wrapped
-// as an empty interface.
-func (p *parser) value(it item) (interface{}, tomlType) {
-	switch it.typ {
-	case itemString:
-		return p.replaceEscapes(it.val), p.typeOfPrimitive(it)
-	case itemMultilineString:
-		trimmed := stripFirstNewline(stripEscapedWhitespace(it.val))
-		return p.replaceEscapes(trimmed), p.typeOfPrimitive(it)
-	case itemRawString:
-		return it.val, p.typeOfPrimitive(it)
-	case itemRawMultilineString:
-		return stripFirstNewline(it.val), p.typeOfPrimitive(it)
-	case itemBool:
-		switch it.val {
-		case "true":
-			return true, p.typeOfPrimitive(it)
-		case "false":
-			return false, p.typeOfPrimitive(it)
-		}
-		p.bug("Expected boolean value, but got '%s'.", it.val)
-	case itemInteger:
-		num, err := strconv.ParseInt(it.val, 10, 64)
-		if err != nil {
-			// See comment below for floats describing why we make a
-			// distinction between a bug and a user error.
-			if e, ok := err.(*strconv.NumError); ok &&
-				e.Err == strconv.ErrRange {
-
-				p.panicf("Integer '%s' is out of the range of 64-bit "+
-					"signed integers.", it.val)
-			} else {
-				p.bug("Expected integer value, but got '%s'.", it.val)
-			}
-		}
-		return num, p.typeOfPrimitive(it)
-	case itemFloat:
-		num, err := strconv.ParseFloat(it.val, 64)
-		if err != nil {
-			// Distinguish float values. Normally, it'd be a bug if the lexer
-			// provides an invalid float, but it's possible that the float is
-			// out of range of valid values (which the lexer cannot determine).
-			// So mark the former as a bug but the latter as a legitimate user
-			// error.
-			//
-			// This is also true for integers.
-			if e, ok := err.(*strconv.NumError); ok &&
-				e.Err == strconv.ErrRange {
-
-				p.panicf("Float '%s' is out of the range of 64-bit "+
-					"IEEE-754 floating-point numbers.", it.val)
-			} else {
-				p.bug("Expected float value, but got '%s'.", it.val)
-			}
-		}
-		return num, p.typeOfPrimitive(it)
-	case itemDatetime:
-		t, err := time.Parse("2006-01-02T15:04:05Z", it.val)
-		if err != nil {
-			p.bug("Expected Zulu formatted DateTime, but got '%s'.", it.val)
-		}
-		return t, p.typeOfPrimitive(it)
-	case itemArray:
-		array := make([]interface{}, 0)
-		types := make([]tomlType, 0)
-
-		for it = p.next(); it.typ != itemArrayEnd; it = p.next() {
-			if it.typ == itemCommentStart {
-				p.expect(itemText)
-				continue
-			}
-
-			val, typ := p.value(it)
-			array = append(array, val)
-			types = append(types, typ)
-		}
-		return array, p.typeOfArray(types)
-	}
-	p.bug("Unexpected value type: %s", it.typ)
-	panic("unreachable")
-}
-
-// establishContext sets the current context of the parser,
-// where the context is either a hash or an array of hashes. Which one is
-// set depends on the value of the `array` parameter.
-//
-// Establishing the context also makes sure that the key isn't a duplicate, and
-// will create implicit hashes automatically.
-func (p *parser) establishContext(key Key, array bool) {
-	var ok bool
-
-	// Always start at the top level and drill down for our context.
-	hashContext := p.mapping
-	keyContext := make(Key, 0)
-
-	// We only need implicit hashes for key[0:-1]
-	for _, k := range key[0 : len(key)-1] {
-		_, ok = hashContext[k]
-		keyContext = append(keyContext, k)
-
-		// No key? Make an implicit hash and move on.
-		if !ok {
-			p.addImplicit(keyContext)
-			hashContext[k] = make(map[string]interface{})
-		}
-
-		// If the hash context is actually an array of tables, then set
-		// the hash context to the last element in that array.
-		//
-		// Otherwise, it better be a table, since this MUST be a key group (by
-		// virtue of it not being the last element in a key).
-		switch t := hashContext[k].(type) {
-		case []map[string]interface{}:
-			hashContext = t[len(t)-1]
-		case map[string]interface{}:
-			hashContext = t
-		default:
-			p.panicf("Key '%s' was already created as a hash.", keyContext)
-		}
-	}
-
-	p.context = keyContext
-	if array {
-		// If this is the first element for this array, then allocate a new
-		// list of tables for it.
-		k := key[len(key)-1]
-		if _, ok := hashContext[k]; !ok {
-			hashContext[k] = make([]map[string]interface{}, 0, 5)
-		}
-
-		// Add a new table. But make sure the key hasn't already been used
-		// for something else.
-		if hash, ok := hashContext[k].([]map[string]interface{}); ok {
-			hashContext[k] = append(hash, make(map[string]interface{}))
-		} else {
-			p.panicf("Key '%s' was already created and cannot be used as "+
-				"an array.", keyContext)
-		}
-	} else {
-		p.setValue(key[len(key)-1], make(map[string]interface{}))
-	}
-	p.context = append(p.context, key[len(key)-1])
-}
-
-// setValue sets the given key to the given value in the current context.
-// It will make sure that the key hasn't already been defined, account for
-// implicit key groups.
-func (p *parser) setValue(key string, value interface{}) {
-	var tmpHash interface{}
-	var ok bool
-
-	hash := p.mapping
-	keyContext := make(Key, 0)
-	for _, k := range p.context {
-		keyContext = append(keyContext, k)
-		if tmpHash, ok = hash[k]; !ok {
-			p.bug("Context for key '%s' has not been established.", keyContext)
-		}
-		switch t := tmpHash.(type) {
-		case []map[string]interface{}:
-			// The context is a table of hashes. Pick the most recent table
-			// defined as the current hash.
-			hash = t[len(t)-1]
-		case map[string]interface{}:
-			hash = t
-		default:
-			p.bug("Expected hash to have type 'map[string]interface{}', but "+
-				"it has '%T' instead.", tmpHash)
-		}
-	}
-	keyContext = append(keyContext, key)
-
-	if _, ok := hash[key]; ok {
-		// Typically, if the given key has already been set, then we have
-		// to raise an error since duplicate keys are disallowed. However,
-		// it's possible that a key was previously defined implicitly. In this
-		// case, it is allowed to be redefined concretely. (See the
-		// `tests/valid/implicit-and-explicit-after.toml` test in `toml-test`.)
-		//
-		// But we have to make sure to stop marking it as an implicit. (So that
-		// another redefinition provokes an error.)
-		//
-		// Note that since it has already been defined (as a hash), we don't
-		// want to overwrite it. So our business is done.
-		if p.isImplicit(keyContext) {
-			p.removeImplicit(keyContext)
-			return
-		}
-
-		// Otherwise, we have a concrete key trying to override a previous
-		// key, which is *always* wrong.
-		p.panicf("Key '%s' has already been defined.", keyContext)
-	}
-	hash[key] = value
-}
-
-// setType sets the type of a particular value at a given key.
-// It should be called immediately AFTER setValue.
-//
-// Note that if `key` is empty, then the type given will be applied to the
-// current context (which is either a table or an array of tables).
-func (p *parser) setType(key string, typ tomlType) {
-	keyContext := make(Key, 0, len(p.context)+1)
-	for _, k := range p.context {
-		keyContext = append(keyContext, k)
-	}
-	if len(key) > 0 { // allow type setting for hashes
-		keyContext = append(keyContext, key)
-	}
-	p.types[keyContext.String()] = typ
-}
-
-// addImplicit sets the given Key as having been created implicitly.
-func (p *parser) addImplicit(key Key) {
-	p.implicits[key.String()] = true
-}
-
-// removeImplicit stops tagging the given key as having been implicitly
-// created.
-func (p *parser) removeImplicit(key Key) {
-	p.implicits[key.String()] = false
-}
-
-// isImplicit returns true if the key group pointed to by the key was created
-// implicitly.
-func (p *parser) isImplicit(key Key) bool {
-	return p.implicits[key.String()]
-}
-
-// current returns the full key name of the current context.
-func (p *parser) current() string {
-	if len(p.currentKey) == 0 {
-		return p.context.String()
-	}
-	if len(p.context) == 0 {
-		return p.currentKey
-	}
-	return fmt.Sprintf("%s.%s", p.context, p.currentKey)
-}
-
-func stripFirstNewline(s string) string {
-	if len(s) == 0 || s[0] != '\n' {
-		return s
-	}
-	return s[1:len(s)]
-}
-
-func stripEscapedWhitespace(s string) string {
-	esc := strings.Split(s, "\\\n")
-	if len(esc) > 1 {
-		for i := 1; i < len(esc); i++ {
-			esc[i] = strings.TrimLeftFunc(esc[i], unicode.IsSpace)
-		}
-	}
-	return strings.Join(esc, "")
-}
-
-func (p *parser) replaceEscapes(str string) string {
-	var replaced []rune
-	s := []byte(str)
-	r := 0
-	for r < len(s) {
-		if s[r] != '\\' {
-			c, size := utf8.DecodeRune(s[r:])
-			r += size
-			replaced = append(replaced, c)
-			continue
-		}
-		r += 1
-		if r >= len(s) {
-			p.bug("Escape sequence at end of string.")
-			return ""
-		}
-		switch s[r] {
-		default:
-			p.bug("Expected valid escape code after \\, but got %q.", s[r])
-			return ""
-		case 'b':
-			replaced = append(replaced, rune(0x0008))
-			r += 1
-		case 't':
-			replaced = append(replaced, rune(0x0009))
-			r += 1
-		case 'n':
-			replaced = append(replaced, rune(0x000A))
-			r += 1
-		case 'f':
-			replaced = append(replaced, rune(0x000C))
-			r += 1
-		case 'r':
-			replaced = append(replaced, rune(0x000D))
-			r += 1
-		case '"':
-			replaced = append(replaced, rune(0x0022))
-			r += 1
-		case '\\':
-			replaced = append(replaced, rune(0x005C))
-			r += 1
-		case 'u':
-			// At this point, we know we have a Unicode escape of the form
-			// `uXXXX` at [r, r+5). (Because the lexer guarantees this
-			// for us.)
-			escaped := p.asciiEscapeToUnicode(s[r+1 : r+5])
-			replaced = append(replaced, escaped)
-			r += 5
-		case 'U':
-			// At this point, we know we have a Unicode escape of the form
-			// `uXXXX` at [r, r+9). (Because the lexer guarantees this
-			// for us.)
-			escaped := p.asciiEscapeToUnicode(s[r+1 : r+9])
-			replaced = append(replaced, escaped)
-			r += 9
-		}
-	}
-	return string(replaced)
-}
-
-func (p *parser) asciiEscapeToUnicode(bs []byte) rune {
-	s := string(bs)
-	hex, err := strconv.ParseUint(strings.ToLower(s), 16, 32)
-	if err != nil {
-		p.bug("Could not parse '%s' as a hexadecimal number, but the "+
-			"lexer claims it's OK: %s", s, err)
-	}
-
-	// BUG(burntsushi)
-	// I honestly don't understand how this works. I can't seem
-	// to find a way to make this fail. I figured this would fail on invalid
-	// UTF-8 characters like U+DCFF, but it doesn't.
-	if !utf8.ValidString(string(rune(hex))) {
-		p.panicf("Escaped character '\\u%s' is not valid UTF-8.", s)
-	}
-	return rune(hex)
-}
-
-func isStringType(ty itemType) bool {
-	return ty == itemString || ty == itemMultilineString ||
-		ty == itemRawString || ty == itemRawMultilineString
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/session.vim
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/session.vim b/Godeps/_workspace/src/github.com/BurntSushi/toml/session.vim
deleted file mode 100644
index 562164b..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/session.vim
+++ /dev/null
@@ -1 +0,0 @@
-au BufWritePost *.go silent!make tags > /dev/null 2>&1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/type_check.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/type_check.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/type_check.go
deleted file mode 100644
index c73f8af..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/type_check.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package toml
-
-// tomlType represents any Go type that corresponds to a TOML type.
-// While the first draft of the TOML spec has a simplistic type system that
-// probably doesn't need this level of sophistication, we seem to be militating
-// toward adding real composite types.
-type tomlType interface {
-	typeString() string
-}
-
-// typeEqual accepts any two types and returns true if they are equal.
-func typeEqual(t1, t2 tomlType) bool {
-	if t1 == nil || t2 == nil {
-		return false
-	}
-	return t1.typeString() == t2.typeString()
-}
-
-func typeIsHash(t tomlType) bool {
-	return typeEqual(t, tomlHash) || typeEqual(t, tomlArrayHash)
-}
-
-type tomlBaseType string
-
-func (btype tomlBaseType) typeString() string {
-	return string(btype)
-}
-
-func (btype tomlBaseType) String() string {
-	return btype.typeString()
-}
-
-var (
-	tomlInteger   tomlBaseType = "Integer"
-	tomlFloat     tomlBaseType = "Float"
-	tomlDatetime  tomlBaseType = "Datetime"
-	tomlString    tomlBaseType = "String"
-	tomlBool      tomlBaseType = "Bool"
-	tomlArray     tomlBaseType = "Array"
-	tomlHash      tomlBaseType = "Hash"
-	tomlArrayHash tomlBaseType = "ArrayHash"
-)
-
-// typeOfPrimitive returns a tomlType of any primitive value in TOML.
-// Primitive values are: Integer, Float, Datetime, String and Bool.
-//
-// Passing a lexer item other than the following will cause a BUG message
-// to occur: itemString, itemBool, itemInteger, itemFloat, itemDatetime.
-func (p *parser) typeOfPrimitive(lexItem item) tomlType {
-	switch lexItem.typ {
-	case itemInteger:
-		return tomlInteger
-	case itemFloat:
-		return tomlFloat
-	case itemDatetime:
-		return tomlDatetime
-	case itemString:
-		return tomlString
-	case itemMultilineString:
-		return tomlString
-	case itemRawString:
-		return tomlString
-	case itemRawMultilineString:
-		return tomlString
-	case itemBool:
-		return tomlBool
-	}
-	p.bug("Cannot infer primitive type of lex item '%s'.", lexItem)
-	panic("unreachable")
-}
-
-// typeOfArray returns a tomlType for an array given a list of types of its
-// values.
-//
-// In the current spec, if an array is homogeneous, then its type is always
-// "Array". If the array is not homogeneous, an error is generated.
-func (p *parser) typeOfArray(types []tomlType) tomlType {
-	// Empty arrays are cool.
-	if len(types) == 0 {
-		return tomlArray
-	}
-
-	theType := types[0]
-	for _, t := range types[1:] {
-		if !typeEqual(theType, t) {
-			p.panicf("Array contains values of type '%s' and '%s', but "+
-				"arrays must be homogeneous.", theType, t)
-		}
-	}
-	return tomlArray
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/type_fields.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/type_fields.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/type_fields.go
deleted file mode 100644
index 7592f87..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/type_fields.go
+++ /dev/null
@@ -1,241 +0,0 @@
-package toml
-
-// Struct field handling is adapted from code in encoding/json:
-//
-// Copyright 2010 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the Go distribution.
-
-import (
-	"reflect"
-	"sort"
-	"sync"
-)
-
-// A field represents a single field found in a struct.
-type field struct {
-	name  string       // the name of the field (`toml` tag included)
-	tag   bool         // whether field has a `toml` tag
-	index []int        // represents the depth of an anonymous field
-	typ   reflect.Type // the type of the field
-}
-
-// byName sorts field by name, breaking ties with depth,
-// then breaking ties with "name came from toml tag", then
-// breaking ties with index sequence.
-type byName []field
-
-func (x byName) Len() int { return len(x) }
-
-func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
-
-func (x byName) Less(i, j int) bool {
-	if x[i].name != x[j].name {
-		return x[i].name < x[j].name
-	}
-	if len(x[i].index) != len(x[j].index) {
-		return len(x[i].index) < len(x[j].index)
-	}
-	if x[i].tag != x[j].tag {
-		return x[i].tag
-	}
-	return byIndex(x).Less(i, j)
-}
-
-// byIndex sorts field by index sequence.
-type byIndex []field
-
-func (x byIndex) Len() int { return len(x) }
-
-func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
-
-func (x byIndex) Less(i, j int) bool {
-	for k, xik := range x[i].index {
-		if k >= len(x[j].index) {
-			return false
-		}
-		if xik != x[j].index[k] {
-			return xik < x[j].index[k]
-		}
-	}
-	return len(x[i].index) < len(x[j].index)
-}
-
-// typeFields returns a list of fields that TOML should recognize for the given
-// type. The algorithm is breadth-first search over the set of structs to
-// include - the top struct and then any reachable anonymous structs.
-func typeFields(t reflect.Type) []field {
-	// Anonymous fields to explore at the current level and the next.
-	current := []field{}
-	next := []field{{typ: t}}
-
-	// Count of queued names for current level and the next.
-	count := map[reflect.Type]int{}
-	nextCount := map[reflect.Type]int{}
-
-	// Types already visited at an earlier level.
-	visited := map[reflect.Type]bool{}
-
-	// Fields found.
-	var fields []field
-
-	for len(next) > 0 {
-		current, next = next, current[:0]
-		count, nextCount = nextCount, map[reflect.Type]int{}
-
-		for _, f := range current {
-			if visited[f.typ] {
-				continue
-			}
-			visited[f.typ] = true
-
-			// Scan f.typ for fields to include.
-			for i := 0; i < f.typ.NumField(); i++ {
-				sf := f.typ.Field(i)
-				if sf.PkgPath != "" { // unexported
-					continue
-				}
-				name := sf.Tag.Get("toml")
-				if name == "-" {
-					continue
-				}
-				index := make([]int, len(f.index)+1)
-				copy(index, f.index)
-				index[len(f.index)] = i
-
-				ft := sf.Type
-				if ft.Name() == "" && ft.Kind() == reflect.Ptr {
-					// Follow pointer.
-					ft = ft.Elem()
-				}
-
-				// Record found field and index sequence.
-				if name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct {
-					tagged := name != ""
-					if name == "" {
-						name = sf.Name
-					}
-					fields = append(fields, field{name, tagged, index, ft})
-					if count[f.typ] > 1 {
-						// If there were multiple instances, add a second,
-						// so that the annihilation code will see a duplicate.
-						// It only cares about the distinction between 1 or 2,
-						// so don't bother generating any more copies.
-						fields = append(fields, fields[len(fields)-1])
-					}
-					continue
-				}
-
-				// Record new anonymous struct to explore in next round.
-				nextCount[ft]++
-				if nextCount[ft] == 1 {
-					f := field{name: ft.Name(), index: index, typ: ft}
-					next = append(next, f)
-				}
-			}
-		}
-	}
-
-	sort.Sort(byName(fields))
-
-	// Delete all fields that are hidden by the Go rules for embedded fields,
-	// except that fields with TOML tags are promoted.
-
-	// The fields are sorted in primary order of name, secondary order
-	// of field index length. Loop over names; for each name, delete
-	// hidden fields by choosing the one dominant field that survives.
-	out := fields[:0]
-	for advance, i := 0, 0; i < len(fields); i += advance {
-		// One iteration per name.
-		// Find the sequence of fields with the name of this first field.
-		fi := fields[i]
-		name := fi.name
-		for advance = 1; i+advance < len(fields); advance++ {
-			fj := fields[i+advance]
-			if fj.name != name {
-				break
-			}
-		}
-		if advance == 1 { // Only one field with this name
-			out = append(out, fi)
-			continue
-		}
-		dominant, ok := dominantField(fields[i : i+advance])
-		if ok {
-			out = append(out, dominant)
-		}
-	}
-
-	fields = out
-	sort.Sort(byIndex(fields))
-
-	return fields
-}
-
-// dominantField looks through the fields, all of which are known to
-// have the same name, to find the single field that dominates the
-// others using Go's embedding rules, modified by the presence of
-// TOML tags. If there are multiple top-level fields, the boolean
-// will be false: This condition is an error in Go and we skip all
-// the fields.
-func dominantField(fields []field) (field, bool) {
-	// The fields are sorted in increasing index-length order. The winner
-	// must therefore be one with the shortest index length. Drop all
-	// longer entries, which is easy: just truncate the slice.
-	length := len(fields[0].index)
-	tagged := -1 // Index of first tagged field.
-	for i, f := range fields {
-		if len(f.index) > length {
-			fields = fields[:i]
-			break
-		}
-		if f.tag {
-			if tagged >= 0 {
-				// Multiple tagged fields at the same level: conflict.
-				// Return no field.
-				return field{}, false
-			}
-			tagged = i
-		}
-	}
-	if tagged >= 0 {
-		return fields[tagged], true
-	}
-	// All remaining fields have the same length. If there's more than one,
-	// we have a conflict (two fields named "X" at the same level) and we
-	// return no field.
-	if len(fields) > 1 {
-		return field{}, false
-	}
-	return fields[0], true
-}
-
-var fieldCache struct {
-	sync.RWMutex
-	m map[reflect.Type][]field
-}
-
-// cachedTypeFields is like typeFields but uses a cache to avoid repeated work.
-func cachedTypeFields(t reflect.Type) []field {
-	fieldCache.RLock()
-	f := fieldCache.m[t]
-	fieldCache.RUnlock()
-	if f != nil {
-		return f
-	}
-
-	// Compute fields without lock.
-	// Might duplicate effort but won't hold other computations back.
-	f = typeFields(t)
-	if f == nil {
-		f = []field{}
-	}
-
-	fieldCache.Lock()
-	if fieldCache.m == nil {
-		fieldCache.m = map[reflect.Type][]field{}
-	}
-	fieldCache.m[t] = f
-	fieldCache.Unlock()
-	return f
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/.gitignore b/Godeps/_workspace/src/github.com/andelf/go-curl/.gitignore
deleted file mode 100644
index a4a1e00..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.6
-*.o
-src/_cgo_*
-src/_obj/

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/.travis.yml
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/.travis.yml b/Godeps/_workspace/src/github.com/andelf/go-curl/.travis.yml
deleted file mode 100644
index e35e709..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/.travis.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-language: go
-go:
-  - 1.1.2
-  - 1.2
-  - tip
-before_install:
-  - sudo apt-get update -qq > apt-get.out 2>&1  || (cat apt-get.out && exit 1)
-install: go build -x -v
-script: go test -v
-notifications:
-  email:
-    recipients:
-      - fledna@foxmail.com
-    on_success: change
-    on_failure: always

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/LICENSE b/Godeps/_workspace/src/github.com/andelf/go-curl/LICENSE
deleted file mode 100644
index 07a5cea..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/LICENSE
+++ /dev/null
@@ -1,13 +0,0 @@
-Copyright 2014 Shuyu Wang <an...@gmail.com>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this project except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/README.md b/Godeps/_workspace/src/github.com/andelf/go-curl/README.md
deleted file mode 100644
index f1870f7..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-go-curl
-=======
-
-[![Build Status](https://secure.travis-ci.org/andelf/go-curl.png?branch=master)](http://travis-ci.org/andelf/go-curl)
-
-my golang libcurl(curl) binding.
-
-See more examples in ./examples/ directory~!
-
-LICENSE
--------
-
-go-curl is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).
-
-Current Development Statue
---------------------------
-
- * currently stable
- * READ, WRITE, HEADER, PROGRESS function callback
- * a Multipart Form supports file uploading
- * Most curl_easy_setopt option
- * partly implement share & multi interface
- * new callback function prototype
-
-How to Install
---------------
-
-Make Sure You Have libcurl (and its develop headers, static/dynamic libs) installed!
-
-
-    $ go get -u github.com/andelf/go-curl
-
-Current Status
---------------
-
- * Linux x64
-   * passed go1 (ArchLinux)
- * Windows x86
-   * passed go1 (win7, mingw-gcc 4.5.2, curl 7.22.0)
- * Mac OS
-   * passed go1 (Mac OS X 10.7.3, curl 7.21.4)
-
-Sample Program
---------------
-
-```go
-package main
-
-import (
-    "fmt"
-    curl "github.com/andelf/go-curl"
-)
-
-func main() {
-    easy := curl.EasyInit()
-    defer easy.Cleanup()
-
-    easy.Setopt(curl.OPT_URL, "http://www.baidu.com/")
-
-    // make a callback function
-    fooTest := func (buf []byte, userdata interface{}) bool {
-        println("DEBUG: size=>", len(buf))
-        println("DEBUG: content=>", string(buf))
-        return true
-    }
-
-    easy.Setopt(curl.OPT_WRITEFUNCTION, fooTest)
-
-    if err := easy.Perform(); err != nil {
-        fmt.Printf("ERROR: %v\n", err)
-    }
-}
-```

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/c-callback.c
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/c-callback.c b/Godeps/_workspace/src/github.com/andelf/go-curl/c-callback.c
deleted file mode 100644
index 74c5503..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/c-callback.c
+++ /dev/null
@@ -1,68 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include "callback.h"
-#include "_cgo_export.h"
-
-/* for OPT_HEADERFUNCTION */
-size_t header_function( char *ptr, size_t size, size_t nmemb, void *ctx) {
-    void *go_header_func = (void *)goGetCurlField((GoUintptr)ctx, "headerFunction");
-    GoInterface *userdata = (GoInterface *)goGetCurlField((GoUintptr)ctx, "headerData");
-
-    if (userdata == NULL) {
-	return goCallWriteFunctionCallback(go_header_func, ptr, size*nmemb, goNilInterface());
-    }
-    return goCallWriteFunctionCallback(go_header_func, ptr, size*nmemb, *userdata);
-}
-
-void *return_header_function() {
-    return (void *)&header_function;
-}
-
-
-/* for OPT_WRITEFUNCTION */
-size_t write_function( char *ptr, size_t size, size_t nmemb, void *ctx) {
-    void *go_write_func = (void *)goGetCurlField((GoUintptr)ctx, "writeFunction");
-    GoInterface *userdata = (GoInterface *)goGetCurlField((GoUintptr)ctx, "writeData");
-
-    if (userdata == NULL) {
-	return goCallWriteFunctionCallback(go_write_func, ptr, size*nmemb, goNilInterface());
-    }
-    return goCallWriteFunctionCallback(go_write_func, ptr, size*nmemb, *userdata);
-}
-
-void *return_write_function() {
-    return (void *)&write_function;
-}
-
-/* for OPT_READFUNCTION */
-size_t read_function( char *ptr, size_t size, size_t nmemb, void *ctx) {
-    void *go_read_func = (void *)goGetCurlField((GoUintptr)ctx, "readFunction");
-    GoInterface *userdata = (GoInterface *)goGetCurlField((GoUintptr)ctx, "readData");
-
-    if (userdata == NULL) {
-	return goCallReadFunctionCallback(go_read_func, ptr, size*nmemb, goNilInterface());
-    }
-    return goCallReadFunctionCallback(go_read_func, ptr, size*nmemb, *userdata);
-}
-
-void *return_read_function() {
-    return (void *)&read_function;
-}
-
-
-/* for OPT_PROGRESSFUNCTION */
-int progress_function(void *ctx, double dltotal, double dlnow, double ultotal, double ulnow) {
-    void *go_progress_func = (void *)goGetCurlField((GoUintptr)ctx, "progressFunction");
-    GoInterface *clientp = (GoInterface *)goGetCurlField((GoUintptr)ctx, "progressData");
-
-    if (clientp == NULL) {
-	return goCallProgressCallback(go_progress_func, goNilInterface(),
-				    dltotal, dlnow, ultotal, ulnow);
-    }
-    return goCallProgressCallback(go_progress_func, *clientp,
-				dltotal, dlnow, ultotal, ulnow);
-}
-
-void *return_progress_function() {
-    return (void *)progress_function;
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/callback.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/callback.go b/Godeps/_workspace/src/github.com/andelf/go-curl/callback.go
deleted file mode 100644
index fbb2a7f..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/callback.go
+++ /dev/null
@@ -1,90 +0,0 @@
-package curl
-
-/*
-#include <stdlib.h>
-#include <string.h>
-#include <curl/curl.h>
-
-*/
-import "C"
-
-import (
-	"reflect"
-	"unsafe"
-)
-
-//export goGetCurlField
-func goGetCurlField(p uintptr, cname *C.char) uintptr {
-	name := C.GoString(cname)
-	curl := (*CURL)(unsafe.Pointer(p))
-	switch name {
-	case "readFunction":
-		return reflect.ValueOf(curl.readFunction).Pointer()
-	case "headerFunction":
-		return reflect.ValueOf(curl.headerFunction).Pointer()
-	case "writeFunction":
-		return reflect.ValueOf(curl.writeFunction).Pointer()
-	case "progressFunction":
-		return reflect.ValueOf(curl.progressFunction).Pointer()
-	case "headerData":
-		return uintptr(unsafe.Pointer(curl.headerData))
-	case "writeData":
-		return uintptr(unsafe.Pointer(curl.writeData))
-	case "readData":
-		return uintptr(unsafe.Pointer(curl.readData))
-	case "progressData":
-		return uintptr(unsafe.Pointer(curl.progressData))
-	}
-
-	warnf("Field not found: %s", name)
-	return 0
-}
-
-//export goNilInterface
-func goNilInterface() interface{} {
-	return nil
-}
-
-// callback functions
-//export goCallWriteFunctionCallback
-func goCallWriteFunctionCallback(f *func([]byte, interface{}) bool,
-	ptr *C.char,
-	size C.size_t,
-	userdata interface{}) uintptr {
-	buf := C.GoBytes(unsafe.Pointer(ptr), C.int(size))
-	ok := (*f)(buf, userdata)
-	if ok {
-		return uintptr(size)
-	}
-	//return uintptr(C.CURL_MAX_WRITE_SIZE + 1)
-	return C.CURL_WRITEFUNC_PAUSE
-}
-
-//export goCallProgressCallback
-func goCallProgressCallback(f *func(float64, float64, float64, float64, interface{}) bool,
-	userdata interface{},
-	dltotal, dlnow, ultotal, ulnow C.double) int {
-	// fdltotal, fdlnow, fultotal, fulnow
-	ok := (*f)(float64(dltotal), float64(dlnow), float64(ultotal), float64(ulnow), userdata)
-	// non-zero va lue will cause libcurl to abort the transfer and return Error
-	if ok {
-		return 0
-	}
-	return 1
-}
-
-//export goCallReadFunctionCallback
-func goCallReadFunctionCallback(f *func([]byte, interface{}) int,
-	ptr *C.char,
-	size C.size_t,
-	userdata interface{}) uintptr {
-	// TODO code cleanup
-	buf := C.GoBytes(unsafe.Pointer(ptr), C.int(size))
-	ret := (*f)(buf, userdata)
-	str := C.CString(string(buf))
-	defer C.free(unsafe.Pointer(str))
-	if C.memcpy(unsafe.Pointer(ptr), unsafe.Pointer(str), C.size_t(ret)) == nil {
-		panic("read_callback memcpy error!")
-	}
-	return uintptr(ret)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/callback.h
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/callback.h b/Godeps/_workspace/src/github.com/andelf/go-curl/callback.h
deleted file mode 100644
index 498678a..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/callback.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-void *return_header_function();
-void *return_write_function();
-void *return_read_function();
-
-void *return_progress_function();

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/compat.h
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/compat.h b/Godeps/_workspace/src/github.com/andelf/go-curl/compat.h
deleted file mode 100644
index 5550970..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/compat.h
+++ /dev/null
@@ -1,380 +0,0 @@
-
-/* generated by compatgen.py */
-#include<curl/curl.h>
-
-
-
-#if (LIBCURL_VERSION_MINOR == 36 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 36 
-#define CURLOPT_SSL_ENABLE_NPN 0
-#define CURLOPT_SSL_ENABLE_ALPN 0
-#define CURLOPT_EXPECT_100_TIMEOUT_MS 0
-#if (LIBCURL_VERSION_MINOR == 35 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 35 
-#if (LIBCURL_VERSION_MINOR == 34 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 34 
-#define CURLOPT_LOGIN_OPTIONS 0
-#define CURLINFO_TLS_SESSION 0
-#if (LIBCURL_VERSION_MINOR == 33 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 33 
-#define CURLOPT_XOAUTH2_BEARER 0
-#define CURLOPT_DNS_INTERFACE 0
-#define CURLOPT_DNS_LOCAL_IP4 0
-#define CURLOPT_DNS_LOCAL_IP6 0
-#define CURL_VERSION_HTTP2 0
-#if (LIBCURL_VERSION_MINOR == 32 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 32 
-#define CURLOPT_XFERINFODATA 0
-#define CURLOPT_XFERINFOFUNCTION 0
-#if (LIBCURL_VERSION_MINOR == 31 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 31 
-#define CURLOPT_SASL_IR 0
-#if (LIBCURL_VERSION_MINOR == 30 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 30 
-#define CURLE_NO_CONNECTION_AVAILABLE -1
-#if (LIBCURL_VERSION_MINOR == 29 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 29 
-#if (LIBCURL_VERSION_MINOR == 28 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 28 
-#if (LIBCURL_VERSION_MINOR == 28 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 28 
-#if (LIBCURL_VERSION_MINOR == 27 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 27 
-#if (LIBCURL_VERSION_MINOR == 26 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 26 
-#if (LIBCURL_VERSION_MINOR == 25 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 25 
-#define CURLOPT_TCP_KEEPALIVE 0
-#define CURLOPT_TCP_KEEPIDLE 0
-#define CURLOPT_TCP_KEEPINTVL 0
-#define CURLOPT_SSL_OPTIONS 0
-#define CURLOPT_MAIL_AUTH 0
-#if (LIBCURL_VERSION_MINOR == 24 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 24 
-#define CURLOPT_DNS_SERVERS 0
-#define CURLOPT_ACCEPTTIMEOUT_MS 0
-#define CURLE_FTP_ACCEPT_FAILED -1
-#define CURLE_FTP_ACCEPT_TIMEOUT -1
-#if (LIBCURL_VERSION_MINOR == 23 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 23 
-#if (LIBCURL_VERSION_MINOR == 23 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 23 
-#if (LIBCURL_VERSION_MINOR == 22 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 22 
-#define CURLOPT_GSSAPI_DELEGATION 0
-#define CURL_VERSION_NTLM_WB 0
-#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 7) || LIBCURL_VERSION_MINOR < 21 
-#define CURLOPT_CLOSESOCKETFUNCTION 0
-#define CURLOPT_CLOSESOCKETDATA 0
-#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 6) || LIBCURL_VERSION_MINOR < 21 
-#define CURLOPT_ACCEPT_ENCODING 0
-#define CURLOPT_TRANSFER_ENCODING 0
-#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 5) || LIBCURL_VERSION_MINOR < 21 
-#define CURLE_NOT_BUILT_IN -1
-#define CURLE_UNKNOWN_OPTION -1
-#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 4) || LIBCURL_VERSION_MINOR < 21 
-#define CURLOPT_TLSAUTH_USERNAME 0
-#define CURLOPT_TLSAUTH_PASSWORD 0
-#define CURLOPT_TLSAUTH_TYPE 0
-#define CURL_VERSION_TLSAUTH_SRP 0
-#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 21 
-#define CURLOPT_RESOLVE 0
-#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 21 
-#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 21 
-#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 21 
-#define CURLOPT_WILDCARDMATCH 0
-#define CURLOPT_CHUNK_BGN_FUNCTION 0
-#define CURLOPT_CHUNK_END_FUNCTION 0
-#define CURLOPT_FNMATCH_FUNCTION 0
-#define CURLOPT_CHUNK_DATA 0
-#define CURLOPT_FNMATCH_DATA 0
-#define CURLE_FTP_BAD_FILE_LIST -1
-#define CURLE_CHUNK_FAILED -1
-#define CURLINFO_PRIMARY_PORT 0
-#define CURLINFO_LOCAL_IP 0
-#define CURLINFO_LOCAL_PORT 0
-#if (LIBCURL_VERSION_MINOR == 20 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 20 
-#if (LIBCURL_VERSION_MINOR == 20 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 20 
-#define CURLOPT_SERVER_RESPONSE_TIMEOUT 0
-#define CURLOPT_MAIL_FROM 0
-#define CURLOPT_MAIL_RCPT 0
-#define CURLOPT_FTP_USE_PRET 0
-#define CURLOPT_RTSP_REQUEST 0
-#define CURLOPT_RTSP_SESSION_ID 0
-#define CURLOPT_RTSP_STREAM_URI 0
-#define CURLOPT_RTSP_TRANSPORT 0
-#define CURLOPT_RTSP_CLIENT_CSEQ 0
-#define CURLOPT_RTSP_SERVER_CSEQ 0
-#define CURLOPT_INTERLEAVEDATA 0
-#define CURLOPT_INTERLEAVEFUNCTION 0
-#define CURLOPT_RTSPHEADER 0
-#define CURLE_FTP_PRET_FAILED -1
-#define CURLE_RTSP_CSEQ_ERROR -1
-#define CURLE_RTSP_SESSION_ERROR -1
-#define CURLINFO_RTSP_SESSION_ID 0
-#define CURLINFO_RTSP_CLIENT_CSEQ 0
-#define CURLINFO_RTSP_SERVER_CSEQ 0
-#define CURLINFO_RTSP_CSEQ_RECV 0
-#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 7) || LIBCURL_VERSION_MINOR < 19 
-#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 6) || LIBCURL_VERSION_MINOR < 19 
-#define CURLOPT_SSH_KNOWNHOSTS 0
-#define CURLOPT_SSH_KEYFUNCTION 0
-#define CURLOPT_SSH_KEYDATA 0
-#define CURL_VERSION_CURLDEBUG 0
-#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 5) || LIBCURL_VERSION_MINOR < 19 
-#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 4) || LIBCURL_VERSION_MINOR < 19 
-#define CURLOPT_NOPROXY 0
-#define CURLOPT_TFTP_BLKSIZE 0
-#define CURLOPT_SOCKS5_GSSAPI_SERVICE 0
-#define CURLOPT_SOCKS5_GSSAPI_NEC 0
-#define CURLOPT_PROTOCOLS 0
-#define CURLOPT_REDIR_PROTOCOLS 0
-#define CURLINFO_CONDITION_UNMET 0
-#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 19 
-#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 19 
-#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 19 
-#define CURLOPT_POSTREDIR 0
-#define CURLOPT_CERTINFO 0
-#define CURLOPT_USERNAME 0
-#define CURLOPT_PASSWORD 0
-#define CURLOPT_PROXYUSERNAME 0
-#define CURLOPT_PROXYPASSWORD 0
-#define CURLINFO_CERTINFO 0
-#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 19 
-#define CURLOPT_CRLFILE 0
-#define CURLOPT_ISSUERCERT 0
-#define CURLOPT_ADDRESS_SCOPE 0
-#define CURLE_SSL_CRL_BADFILE -1
-#define CURLE_SSL_ISSUER_ERROR -1
-#define CURLINFO_PRIMARY_IP 0
-#define CURLINFO_APPCONNECT_TIME 0
-#if (LIBCURL_VERSION_MINOR == 18 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 18 
-#define CURLE_AGAIN -1
-#define CURLINFO_REDIRECT_URL 0
-#if (LIBCURL_VERSION_MINOR == 18 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 18 
-#if (LIBCURL_VERSION_MINOR == 18 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 18 
-#define CURLOPT_PROXY_TRANSFER_MODE 0
-#define CURLOPT_SEEKFUNCTION 0
-#define CURLOPT_SEEKDATA 0
-#if (LIBCURL_VERSION_MINOR == 17 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 17 
-#define CURLOPT_POST301 0
-#define CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 0
-#define CURLOPT_OPENSOCKETFUNCTION 0
-#define CURLOPT_OPENSOCKETDATA 0
-#define CURLOPT_COPYPOSTFIELDS 0
-#define CURLE_PEER_FAILED_VERIFICATION -1
-#if (LIBCURL_VERSION_MINOR == 17 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 17 
-#define CURLOPT_LOW_SPEED_LIMIT 0
-#define CURLOPT_KEYPASSWD 0
-#define CURLOPT_DIRLISTONLY 0
-#define CURLOPT_APPEND 0
-#define CURLOPT_FTP_RESPONSE_TIMEOUT 0
-#define CURLOPT_USE_SSL 0
-#define CURLE_OBSOLETE4 -1
-#define CURLE_REMOTE_ACCESS_DENIED -1
-#define CURLE_OBSOLETE10 -1
-#define CURLE_OBSOLETE12 -1
-#define CURLE_OBSOLETE16 -1
-#define CURLE_FTP_COULDNT_SET_TYPE -1
-#define CURLE_OBSOLETE20 -1
-#define CURLE_QUOTE_ERROR -1
-#define CURLE_OBSOLETE24 -1
-#define CURLE_OBSOLETE29 -1
-#define CURLE_OBSOLETE32 -1
-#define CURLE_RANGE_ERROR -1
-#define CURLE_OBSOLETE40 -1
-#define CURLE_OBSOLETE44 -1
-#define CURLE_OBSOLETE46 -1
-#define CURLE_OBSOLETE50 -1
-#define CURLE_OBSOLETE57 -1
-#define CURLE_USE_SSL_FAILED -1
-#define CURLE_REMOTE_DISK_FULL -1
-#define CURLE_REMOTE_FILE_EXISTS -1
-#if (LIBCURL_VERSION_MINOR == 16 && LIBCURL_VERSION_PATCH < 4) || LIBCURL_VERSION_MINOR < 16 
-#define CURLOPT_KRBLEVEL 0
-#define CURLOPT_NEW_FILE_PERMS 0
-#define CURLOPT_NEW_DIRECTORY_PERMS 0
-#if (LIBCURL_VERSION_MINOR == 16 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 16 
-#define CURLE_UPLOAD_FAILED -1
-#if (LIBCURL_VERSION_MINOR == 16 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 16 
-#define CURLOPT_TIMEOUT_MS 0
-#define CURLOPT_CONNECTTIMEOUT_MS 0
-#define CURLOPT_HTTP_TRANSFER_DECODING 0
-#define CURLOPT_HTTP_CONTENT_DECODING 0
-#if (LIBCURL_VERSION_MINOR == 16 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 16 
-#define CURLOPT_SSH_AUTH_TYPES 0
-#define CURLOPT_SSH_PUBLIC_KEYFILE 0
-#define CURLOPT_SSH_PRIVATE_KEYFILE 0
-#define CURLOPT_FTP_SSL_CCC 0
-#define CURLE_REMOTE_FILE_NOT_FOUND -1
-#define CURLE_SSH -1
-#define CURLE_SSL_SHUTDOWN_FAILED -1
-#if (LIBCURL_VERSION_MINOR == 16 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 16 
-#define CURLOPT_SOCKOPTFUNCTION 0
-#define CURLOPT_SOCKOPTDATA 0
-#define CURLOPT_SSL_SESSIONID_CACHE 0
-#define CURLE_SSL_CACERT_BADFILE -1
-#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 5) || LIBCURL_VERSION_MINOR < 15 
-#define CURLOPT_MAX_SEND_SPEED_LARGE 0
-#define CURLOPT_MAX_RECV_SPEED_LARGE 0
-#define CURLOPT_FTP_ALTERNATIVE_TO_USER 0
-#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 4) || LIBCURL_VERSION_MINOR < 15 
-#define CURLOPT_CONV_FROM_NETWORK_FUNCTION 0
-#define CURLOPT_CONV_TO_NETWORK_FUNCTION 0
-#define CURLOPT_CONV_FROM_UTF8_FUNCTION 0
-#define CURLE_CONV_FAILED -1
-#define CURLE_CONV_REQD -1
-#define CURLINFO_FTP_ENTRY_PATH 0
-#define CURL_VERSION_CONV 0
-#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 15 
-#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 15 
-#define CURLOPT_LOCALPORT 0
-#define CURLOPT_LOCALPORTRANGE 0
-#define CURLOPT_CONNECT_ONLY 0
-#define CURLINFO_LASTSOCKET 0
-#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 15 
-#define CURLOPT_FTP_FILEMETHOD 0
-#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 15 
-#define CURLOPT_FTP_SKIP_PASV_IP 0
-#define CURLE_TFTP_NOTFOUND -1
-#define CURLE_TFTP_PERM -1
-#define CURLE_TFTP_DISKFULL -1
-#define CURLE_TFTP_ILLEGAL -1
-#define CURLE_TFTP_UNKNOWNID -1
-#define CURLE_TFTP_EXISTS -1
-#define CURLE_TFTP_NOSUCHUSER -1
-#if (LIBCURL_VERSION_MINOR == 14 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 14 
-#define CURLOPT_COOKIELIST 0
-#define CURLOPT_IGNORE_CONTENT_LENGTH 0
-#define CURLINFO_COOKIELIST 0
-#if (LIBCURL_VERSION_MINOR == 14 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 14 
-#if (LIBCURL_VERSION_MINOR == 13 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 13 
-#define CURL_VERSION_SSPI 0
-#if (LIBCURL_VERSION_MINOR == 13 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 13 
-#define CURLE_LOGIN_DENIED -1
-#if (LIBCURL_VERSION_MINOR == 13 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 13 
-#define CURLOPT_SOURCE_URL 0
-#define CURLOPT_SOURCE_QUOTE 0
-#define CURLOPT_FTP_ACCOUNT 0
-#if (LIBCURL_VERSION_MINOR == 12 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 12 
-#define CURLOPT_IOCTLFUNCTION 0
-#define CURLOPT_IOCTLDATA 0
-#define CURLE_SEND_FAIL_REWIND -1
-#define CURLE_SSL_ENGINE_INITFAILED -1
-#define CURLINFO_NUM_CONNECTS 0
-#define CURLINFO_SSL_ENGINES 0
-#if (LIBCURL_VERSION_MINOR == 12 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 12 
-#define CURLOPT_FTPSSLAUTH 0
-#define CURLINFO_OS_ERRNO 0
-#if (LIBCURL_VERSION_MINOR == 12 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 12 
-#define CURLOPT_SOURCE_HOST 0
-#define CURLOPT_SOURCE_USERPWD 0
-#define CURLOPT_SOURCE_PATH 0
-#define CURLOPT_SOURCE_PORT 0
-#define CURLOPT_PASV_HOST 0
-#define CURLOPT_SOURCE_PREQUOTE 0
-#define CURLOPT_SOURCE_POSTQUOTE 0
-#if (LIBCURL_VERSION_MINOR == 12 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 12 
-#define CURLE_INTERFACE_FAILED -1
-#define CURL_VERSION_IDN 0
-#if (LIBCURL_VERSION_MINOR == 11 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 11 
-#define CURLOPT_TCP_NODELAY 0
-#if (LIBCURL_VERSION_MINOR == 11 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 11 
-#define CURLOPT_POSTFIELDSIZE_LARGE 0
-#define CURL_VERSION_LARGEFILE 0
-#if (LIBCURL_VERSION_MINOR == 11 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 11 
-#define CURLOPT_INFILESIZE_LARGE 0
-#define CURLOPT_RESUME_FROM_LARGE 0
-#define CURLOPT_MAXFILESIZE_LARGE 0
-#define CURLOPT_NETRC_FILE 0
-#define CURLOPT_FTP_SSL 0
-#define CURLE_FTP_SSL_FAILED -1
-#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 8) || LIBCURL_VERSION_MINOR < 10 
-#define CURLOPT_IPRESOLVE 0
-#define CURLOPT_MAXFILESIZE 0
-#define CURLE_LDAP_INVALID_URL -1
-#define CURLE_FILESIZE_EXCEEDED -1
-#define CURLINFO_RESPONSE_CODE 0
-#define CURLINFO_HTTPAUTH_AVAIL 0
-#define CURLINFO_PROXYAUTH_AVAIL 0
-#define CURL_VERSION_SPNEGO 0
-#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 7) || LIBCURL_VERSION_MINOR < 10 
-#define CURLOPT_FTP_CREATE_MISSING_DIRS 0
-#define CURLOPT_PROXYAUTH 0
-#define CURLINFO_HTTP_CONNECTCODE 0
-#define CURL_VERSION_ASYNCHDNS 0
-#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 6) || LIBCURL_VERSION_MINOR < 10 
-#define CURLOPT_HTTPAUTH 0
-#define CURLOPT_SSL_CTX_FUNCTION 0
-#define CURLOPT_SSL_CTX_DATA 0
-#define CURL_VERSION_NTLM 0
-#define CURL_VERSION_GSSNEGOTIATE 0
-#define CURL_VERSION_DEBUG 0
-#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 5) || LIBCURL_VERSION_MINOR < 10 
-#define CURLOPT_FTP_USE_EPRT 0
-#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 4) || LIBCURL_VERSION_MINOR < 10 
-#define CURLOPT_UNRESTRICTED_AUTH 0
-#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 10 
-#define CURLOPT_PRIVATE 0
-#define CURLOPT_HTTP200ALIASES 0
-#define CURLE_HTTP_RETURNED_ERROR -1
-#define CURLINFO_PRIVATE 0
-#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 10 
-#define CURLE_OPERATION_TIMEDOUT -1
-#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 10 
-#error your version is TOOOOOOOO low
-#endif /* 7.10.1 */
-#endif /* 7.10.2 */
-#endif /* 7.10.3 */
-#endif /* 7.10.4 */
-#endif /* 7.10.5 */
-#endif /* 7.10.6 */
-#endif /* 7.10.7 */
-#endif /* 7.10.8 */
-#endif /* 7.11.0 */
-#endif /* 7.11.1 */
-#endif /* 7.11.2 */
-#endif /* 7.12.0 */
-#endif /* 7.12.1 */
-#endif /* 7.12.2 */
-#endif /* 7.12.3 */
-#endif /* 7.13.0 */
-#endif /* 7.13.1 */
-#endif /* 7.13.2 */
-#endif /* 7.14.0 */
-#endif /* 7.14.1 */
-#endif /* 7.15.0 */
-#endif /* 7.15.1 */
-#endif /* 7.15.2 */
-#endif /* 7.15.3 */
-#endif /* 7.15.4 */
-#endif /* 7.15.5 */
-#endif /* 7.16.0 */
-#endif /* 7.16.1 */
-#endif /* 7.16.2 */
-#endif /* 7.16.3 */
-#endif /* 7.16.4 */
-#endif /* 7.17.0 */
-#endif /* 7.17.1 */
-#endif /* 7.18.0 */
-#endif /* 7.18.1 */
-#endif /* 7.18.2 */
-#endif /* 7.19.0 */
-#endif /* 7.19.1 */
-#endif /* 7.19.2 */
-#endif /* 7.19.3 */
-#endif /* 7.19.4 */
-#endif /* 7.19.5 */
-#endif /* 7.19.6 */
-#endif /* 7.19.7 */
-#endif /* 7.20.0 */
-#endif /* 7.20.1 */
-#endif /* 7.21.0 */
-#endif /* 7.21.1 */
-#endif /* 7.21.2 */
-#endif /* 7.21.3 */
-#endif /* 7.21.4 */
-#endif /* 7.21.5 */
-#endif /* 7.21.6 */
-#endif /* 7.21.7 */
-#endif /* 7.22.0 */
-#endif /* 7.23.0 */
-#endif /* 7.23.1 */
-#endif /* 7.24.0 */
-#endif /* 7.25.0 */
-#endif /* 7.26.0 */
-#endif /* 7.27.0 */
-#endif /* 7.28.0 */
-#endif /* 7.28.1 */
-#endif /* 7.29.0 */
-#endif /* 7.30.0 */
-#endif /* 7.31.0 */
-#endif /* 7.32.0 */
-#endif /* 7.33.0 */
-#endif /* 7.34.0 */
-#endif /* 7.35.0 */
-#endif /* 7.36.0 */
-/* generated ends */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/const.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/const.go b/Godeps/_workspace/src/github.com/andelf/go-curl/const.go
deleted file mode 100644
index 8635486..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/const.go
+++ /dev/null
@@ -1,179 +0,0 @@
-package curl
-
-/*
-#include <curl/curl.h>
-#include "compat.h"
-
-*/
-import "C"
-
-// for GlobalInit(flag)
-const (
-	GLOBAL_SSL     = C.CURL_GLOBAL_SSL
-	GLOBAL_WIN32   = C.CURL_GLOBAL_WIN32
-	GLOBAL_ALL     = C.CURL_GLOBAL_ALL
-	GLOBAL_NOTHING = C.CURL_GLOBAL_NOTHING
-	GLOBAL_DEFAULT = C.CURL_GLOBAL_DEFAULT
-)
-
-// CURLMcode
-const (
-	M_CALL_MULTI_PERFORM = C.CURLM_CALL_MULTI_PERFORM
-	//        M_OK                 = C.CURLM_OK
-	M_BAD_HANDLE      = C.CURLM_BAD_HANDLE
-	M_BAD_EASY_HANDLE = C.CURLM_BAD_EASY_HANDLE
-	M_OUT_OF_MEMORY   = C.CURLM_OUT_OF_MEMORY
-	M_INTERNAL_ERROR  = C.CURLM_INTERNAL_ERROR
-	M_BAD_SOCKET      = C.CURLM_BAD_SOCKET
-	M_UNKNOWN_OPTION  = C.CURLM_UNKNOWN_OPTION
-)
-
-// for multi.Setopt(flag, ...)
-const (
-	MOPT_SOCKETFUNCTION = C.CURLMOPT_SOCKETFUNCTION
-	MOPT_SOCKETDATA     = C.CURLMOPT_SOCKETDATA
-	MOPT_PIPELINING     = C.CURLMOPT_PIPELINING
-	MOPT_TIMERFUNCTION  = C.CURLMOPT_TIMERFUNCTION
-	MOPT_TIMERDATA      = C.CURLMOPT_TIMERDATA
-	MOPT_MAXCONNECTS    = C.CURLMOPT_MAXCONNECTS
-)
-
-// CURLSHcode
-const (
-	//        SHE_OK         = C.CURLSHE_OK
-	SHE_BAD_OPTION = C.CURLSHE_BAD_OPTION
-	SHE_IN_USE     = C.CURLSHE_IN_USE
-	SHE_INVALID    = C.CURLSHE_INVALID
-	SHE_NOMEM      = C.CURLSHE_NOMEM
-)
-
-// for share.Setopt(flat, ...)
-const (
-	SHOPT_SHARE      = C.CURLSHOPT_SHARE
-	SHOPT_UNSHARE    = C.CURLSHOPT_UNSHARE
-	SHOPT_LOCKFUNC   = C.CURLSHOPT_LOCKFUNC
-	SHOPT_UNLOCKFUNC = C.CURLSHOPT_UNLOCKFUNC
-	SHOPT_USERDATA   = C.CURLSHOPT_USERDATA
-)
-
-// for share.Setopt(SHOPT_SHARE/SHOPT_UNSHARE, flag)
-const (
-	LOCK_DATA_SHARE       = C.CURL_LOCK_DATA_SHARE
-	LOCK_DATA_COOKIE      = C.CURL_LOCK_DATA_COOKIE
-	LOCK_DATA_DNS         = C.CURL_LOCK_DATA_DNS
-	LOCK_DATA_SSL_SESSION = C.CURL_LOCK_DATA_SSL_SESSION
-	LOCK_DATA_CONNECT     = C.CURL_LOCK_DATA_CONNECT
-)
-
-// for VersionInfo(flag)
-const (
-	VERSION_FIRST  = C.CURLVERSION_FIRST
-	VERSION_SECOND = C.CURLVERSION_SECOND
-	VERSION_THIRD  = C.CURLVERSION_THIRD
-	// VERSION_FOURTH = C.CURLVERSION_FOURTH
-	VERSION_LAST = C.CURLVERSION_LAST
-	VERSION_NOW  = C.CURLVERSION_NOW
-)
-
-// for VersionInfo(...).Features mask flag
-const (
-	VERSION_IPV6         = C.CURL_VERSION_IPV6
-	VERSION_KERBEROS4    = C.CURL_VERSION_KERBEROS4
-	VERSION_SSL          = C.CURL_VERSION_SSL
-	VERSION_LIBZ         = C.CURL_VERSION_LIBZ
-	VERSION_NTLM         = C.CURL_VERSION_NTLM
-	VERSION_GSSNEGOTIATE = C.CURL_VERSION_GSSNEGOTIATE
-	VERSION_DEBUG        = C.CURL_VERSION_DEBUG
-	VERSION_ASYNCHDNS    = C.CURL_VERSION_ASYNCHDNS
-	VERSION_SPNEGO       = C.CURL_VERSION_SPNEGO
-	VERSION_LARGEFILE    = C.CURL_VERSION_LARGEFILE
-	VERSION_IDN          = C.CURL_VERSION_IDN
-	VERSION_SSPI         = C.CURL_VERSION_SSPI
-	VERSION_CONV         = C.CURL_VERSION_CONV
-	VERSION_CURLDEBUG    = C.CURL_VERSION_CURLDEBUG
-	VERSION_TLSAUTH_SRP  = C.CURL_VERSION_TLSAUTH_SRP
-	VERSION_NTLM_WB      = C.CURL_VERSION_NTLM_WB
-)
-
-// for OPT_READFUNCTION, return a int flag
-const (
-	READFUNC_ABORT = C.CURL_READFUNC_ABORT
-	READFUNC_PAUSE = C.CURL_READFUNC_PAUSE
-)
-
-// for easy.Setopt(OPT_HTTP_VERSION, flag)
-const (
-	HTTP_VERSION_NONE = C.CURL_HTTP_VERSION_NONE
-	HTTP_VERSION_1_0  = C.CURL_HTTP_VERSION_1_0
-	HTTP_VERSION_1_1  = C.CURL_HTTP_VERSION_1_1
-)
-
-// for easy.Setopt(OPT_PROXYTYPE, flag)
-const (
-	PROXY_HTTP     = C.CURLPROXY_HTTP     /* added in 7.10, new in 7.19.4 default is to use CONNECT HTTP/1.1 */
-	PROXY_HTTP_1_0 = C.CURLPROXY_HTTP_1_0 /* added in 7.19.4, force to use CONNECT HTTP/1.0  */
-	PROXY_SOCKS4   = C.CURLPROXY_SOCKS4   /* support added in 7.15.2, enum existed already in 7.10 */
-	PROXY_SOCKS5   = C.CURLPROXY_SOCKS5   /* added in 7.10 */
-	PROXY_SOCKS4A  = C.CURLPROXY_SOCKS4A  /* added in 7.18.0 */
-	// Use the SOCKS5 protocol but pass along the host name rather than the IP address.
-	PROXY_SOCKS5_HOSTNAME = C.CURLPROXY_SOCKS5_HOSTNAME
-)
-
-// for easy.Setopt(OPT_SSLVERSION, flag)
-const (
-	SSLVERSION_DEFAULT = C.CURL_SSLVERSION_DEFAULT
-	SSLVERSION_TLSv1   = C.CURL_SSLVERSION_TLSv1
-	SSLVERSION_SSLv2   = C.CURL_SSLVERSION_SSLv2
-	SSLVERSION_SSLv3   = C.CURL_SSLVERSION_SSLv3
-)
-
-// for easy.Setopt(OPT_TIMECONDITION, flag)
-const (
-	TIMECOND_NONE         = C.CURL_TIMECOND_NONE
-	TIMECOND_IFMODSINCE   = C.CURL_TIMECOND_IFMODSINCE
-	TIMECOND_IFUNMODSINCE = C.CURL_TIMECOND_IFUNMODSINCE
-	TIMECOND_LASTMOD      = C.CURL_TIMECOND_LASTMOD
-)
-
-// for easy.Setopt(OPT_NETRC, flag)
-const (
-	NETRC_IGNORED  = C.CURL_NETRC_IGNORED
-	NETRC_OPTIONAL = C.CURL_NETRC_OPTIONAL
-	NETRC_REQUIRED = C.CURL_NETRC_REQUIRED
-)
-
-// for easy.Setopt(OPT_FTP_CREATE_MISSING_DIRS, flag)
-const (
-	FTP_CREATE_DIR_NONE  = C.CURLFTP_CREATE_DIR_NONE
-	FTP_CREATE_DIR       = C.CURLFTP_CREATE_DIR
-	FTP_CREATE_DIR_RETRY = C.CURLFTP_CREATE_DIR_RETRY
-)
-
-// for easy.Setopt(OPT_IPRESOLVE, flag)
-const (
-	IPRESOLVE_WHATEVER = C.CURL_IPRESOLVE_WHATEVER
-	IPRESOLVE_V4       = C.CURL_IPRESOLVE_V4
-	IPRESOLVE_V6       = C.CURL_IPRESOLVE_V6
-)
-
-// for easy.Setopt(OPT_SSL_OPTIONS, flag)
-const (
-	SSLOPT_ALLOW_BEAST = 1
-)
-
-// for easy.Pause(flat)
-const (
-	PAUSE_RECV      = C.CURLPAUSE_RECV
-	PAUSE_RECV_CONT = C.CURLPAUSE_RECV_CONT
-	PAUSE_SEND      = C.CURLPAUSE_SEND
-	PAUSE_SEND_CONT = C.CURLPAUSE_SEND_CONT
-	PAUSE_ALL       = C.CURLPAUSE_ALL
-	PAUSE_CONT      = C.CURLPAUSE_CONT
-)
-
-// for multi.Info_read()
-const (
-	CURLMSG_NONE	= C.CURLMSG_NONE
-	CURLMSG_DONE	= C.CURLMSG_DONE
-	CURLMSG_LAST	= C.CURLMSG_LAST
-)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/const_gen.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/const_gen.go b/Godeps/_workspace/src/github.com/andelf/go-curl/const_gen.go
deleted file mode 100644
index 872138f..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/const_gen.go
+++ /dev/null
@@ -1,410 +0,0 @@
-
-// generated by codegen.py
-
-package curl
-/*
-#include <curl/curl.h>
-#include "compat.h"
-*/
-import "C"
-
-// CURLcode
-const (
-	E_UNSUPPORTED_PROTOCOL    = C.CURLE_UNSUPPORTED_PROTOCOL
-	E_FAILED_INIT             = C.CURLE_FAILED_INIT
-	E_URL_MALFORMAT           = C.CURLE_URL_MALFORMAT
-	E_NOT_BUILT_IN            = C.CURLE_NOT_BUILT_IN
-	E_COULDNT_RESOLVE_PROXY   = C.CURLE_COULDNT_RESOLVE_PROXY
-	E_COULDNT_RESOLVE_HOST    = C.CURLE_COULDNT_RESOLVE_HOST
-	E_COULDNT_CONNECT         = C.CURLE_COULDNT_CONNECT
-	E_FTP_WEIRD_SERVER_REPLY  = C.CURLE_FTP_WEIRD_SERVER_REPLY
-	E_REMOTE_ACCESS_DENIED    = C.CURLE_REMOTE_ACCESS_DENIED
-	E_FTP_ACCEPT_FAILED       = C.CURLE_FTP_ACCEPT_FAILED
-	E_FTP_WEIRD_PASS_REPLY    = C.CURLE_FTP_WEIRD_PASS_REPLY
-	E_FTP_ACCEPT_TIMEOUT      = C.CURLE_FTP_ACCEPT_TIMEOUT
-	E_FTP_WEIRD_PASV_REPLY    = C.CURLE_FTP_WEIRD_PASV_REPLY
-	E_FTP_WEIRD_227_FORMAT    = C.CURLE_FTP_WEIRD_227_FORMAT
-	E_FTP_CANT_GET_HOST       = C.CURLE_FTP_CANT_GET_HOST
-	E_OBSOLETE16              = C.CURLE_OBSOLETE16
-	E_FTP_COULDNT_SET_TYPE    = C.CURLE_FTP_COULDNT_SET_TYPE
-	E_PARTIAL_FILE            = C.CURLE_PARTIAL_FILE
-	E_FTP_COULDNT_RETR_FILE   = C.CURLE_FTP_COULDNT_RETR_FILE
-	E_OBSOLETE20              = C.CURLE_OBSOLETE20
-	E_QUOTE_ERROR             = C.CURLE_QUOTE_ERROR
-	E_HTTP_RETURNED_ERROR     = C.CURLE_HTTP_RETURNED_ERROR
-	E_WRITE_ERROR             = C.CURLE_WRITE_ERROR
-	E_OBSOLETE24              = C.CURLE_OBSOLETE24
-	E_UPLOAD_FAILED           = C.CURLE_UPLOAD_FAILED
-	E_READ_ERROR              = C.CURLE_READ_ERROR
-	E_OUT_OF_MEMORY           = C.CURLE_OUT_OF_MEMORY
-	E_OPERATION_TIMEDOUT      = C.CURLE_OPERATION_TIMEDOUT
-	E_OBSOLETE29              = C.CURLE_OBSOLETE29
-	E_FTP_PORT_FAILED         = C.CURLE_FTP_PORT_FAILED
-	E_FTP_COULDNT_USE_REST    = C.CURLE_FTP_COULDNT_USE_REST
-	E_OBSOLETE32              = C.CURLE_OBSOLETE32
-	E_RANGE_ERROR             = C.CURLE_RANGE_ERROR
-	E_HTTP_POST_ERROR         = C.CURLE_HTTP_POST_ERROR
-	E_SSL_CONNECT_ERROR       = C.CURLE_SSL_CONNECT_ERROR
-	E_BAD_DOWNLOAD_RESUME     = C.CURLE_BAD_DOWNLOAD_RESUME
-	E_FILE_COULDNT_READ_FILE  = C.CURLE_FILE_COULDNT_READ_FILE
-	E_LDAP_CANNOT_BIND        = C.CURLE_LDAP_CANNOT_BIND
-	E_LDAP_SEARCH_FAILED      = C.CURLE_LDAP_SEARCH_FAILED
-	E_OBSOLETE40              = C.CURLE_OBSOLETE40
-	E_FUNCTION_NOT_FOUND      = C.CURLE_FUNCTION_NOT_FOUND
-	E_ABORTED_BY_CALLBACK     = C.CURLE_ABORTED_BY_CALLBACK
-	E_BAD_FUNCTION_ARGUMENT   = C.CURLE_BAD_FUNCTION_ARGUMENT
-	E_OBSOLETE44              = C.CURLE_OBSOLETE44
-	E_INTERFACE_FAILED        = C.CURLE_INTERFACE_FAILED
-	E_OBSOLETE46              = C.CURLE_OBSOLETE46
-	E_UNKNOWN_OPTION          = C.CURLE_UNKNOWN_OPTION
-	E_OBSOLETE50              = C.CURLE_OBSOLETE50
-	E_PEER_FAILED_VERIFICATION = C.CURLE_PEER_FAILED_VERIFICATION
-	E_GOT_NOTHING             = C.CURLE_GOT_NOTHING
-	E_SSL_ENGINE_NOTFOUND     = C.CURLE_SSL_ENGINE_NOTFOUND
-	E_SSL_ENGINE_SETFAILED    = C.CURLE_SSL_ENGINE_SETFAILED
-	E_SEND_ERROR              = C.CURLE_SEND_ERROR
-	E_RECV_ERROR              = C.CURLE_RECV_ERROR
-	E_OBSOLETE57              = C.CURLE_OBSOLETE57
-	E_SSL_CERTPROBLEM         = C.CURLE_SSL_CERTPROBLEM
-	E_SSL_CIPHER              = C.CURLE_SSL_CIPHER
-	E_SSL_CACERT              = C.CURLE_SSL_CACERT
-	E_BAD_CONTENT_ENCODING    = C.CURLE_BAD_CONTENT_ENCODING
-	E_LDAP_INVALID_URL        = C.CURLE_LDAP_INVALID_URL
-	E_FILESIZE_EXCEEDED       = C.CURLE_FILESIZE_EXCEEDED
-	E_USE_SSL_FAILED          = C.CURLE_USE_SSL_FAILED
-	E_SEND_FAIL_REWIND        = C.CURLE_SEND_FAIL_REWIND
-	E_SSL_ENGINE_INITFAILED   = C.CURLE_SSL_ENGINE_INITFAILED
-	E_LOGIN_DENIED            = C.CURLE_LOGIN_DENIED
-	E_TFTP_NOTFOUND           = C.CURLE_TFTP_NOTFOUND
-	E_TFTP_PERM               = C.CURLE_TFTP_PERM
-	E_REMOTE_DISK_FULL        = C.CURLE_REMOTE_DISK_FULL
-	E_TFTP_ILLEGAL            = C.CURLE_TFTP_ILLEGAL
-	E_TFTP_UNKNOWNID          = C.CURLE_TFTP_UNKNOWNID
-	E_REMOTE_FILE_EXISTS      = C.CURLE_REMOTE_FILE_EXISTS
-	E_TFTP_NOSUCHUSER         = C.CURLE_TFTP_NOSUCHUSER
-	E_CONV_FAILED             = C.CURLE_CONV_FAILED
-	E_CONV_REQD               = C.CURLE_CONV_REQD
-	E_SSL_CACERT_BADFILE      = C.CURLE_SSL_CACERT_BADFILE
-	E_REMOTE_FILE_NOT_FOUND   = C.CURLE_REMOTE_FILE_NOT_FOUND
-	E_SSH                     = C.CURLE_SSH
-	E_SSL_SHUTDOWN_FAILED     = C.CURLE_SSL_SHUTDOWN_FAILED
-	E_AGAIN                   = C.CURLE_AGAIN
-	E_SSL_CRL_BADFILE         = C.CURLE_SSL_CRL_BADFILE
-	E_SSL_ISSUER_ERROR        = C.CURLE_SSL_ISSUER_ERROR
-	E_FTP_PRET_FAILED         = C.CURLE_FTP_PRET_FAILED
-	E_RTSP_CSEQ_ERROR         = C.CURLE_RTSP_CSEQ_ERROR
-	E_RTSP_SESSION_ERROR      = C.CURLE_RTSP_SESSION_ERROR
-	E_FTP_BAD_FILE_LIST       = C.CURLE_FTP_BAD_FILE_LIST
-	E_CHUNK_FAILED            = C.CURLE_CHUNK_FAILED
-	E_NO_CONNECTION_AVAILABLE = C.CURLE_NO_CONNECTION_AVAILABLE
-	E_OBSOLETE10              = C.CURLE_OBSOLETE10
-	E_OBSOLETE12              = C.CURLE_OBSOLETE12
-	E_UNKNOWN_TELNET_OPTION   = C.CURLE_UNKNOWN_TELNET_OPTION
-	E_SSL_PEER_CERTIFICATE    = C.CURLE_SSL_PEER_CERTIFICATE
-	E_OBSOLETE                = C.CURLE_OBSOLETE
-	E_BAD_PASSWORD_ENTERED    = C.CURLE_BAD_PASSWORD_ENTERED
-	E_BAD_CALLING_ORDER       = C.CURLE_BAD_CALLING_ORDER
-	E_FTP_USER_PASSWORD_INCORRECT = C.CURLE_FTP_USER_PASSWORD_INCORRECT
-	E_FTP_CANT_RECONNECT      = C.CURLE_FTP_CANT_RECONNECT
-	E_FTP_COULDNT_GET_SIZE    = C.CURLE_FTP_COULDNT_GET_SIZE
-	E_FTP_COULDNT_SET_ASCII   = C.CURLE_FTP_COULDNT_SET_ASCII
-	E_FTP_WEIRD_USER_REPLY    = C.CURLE_FTP_WEIRD_USER_REPLY
-	E_FTP_WRITE_ERROR         = C.CURLE_FTP_WRITE_ERROR
-	E_LIBRARY_NOT_FOUND       = C.CURLE_LIBRARY_NOT_FOUND
-	E_MALFORMAT_USER          = C.CURLE_MALFORMAT_USER
-	E_SHARE_IN_USE            = C.CURLE_SHARE_IN_USE
-	E_URL_MALFORMAT_USER      = C.CURLE_URL_MALFORMAT_USER
-	E_FTP_ACCESS_DENIED       = C.CURLE_FTP_ACCESS_DENIED
-	E_FTP_COULDNT_SET_BINARY  = C.CURLE_FTP_COULDNT_SET_BINARY
-	E_FTP_QUOTE_ERROR         = C.CURLE_FTP_QUOTE_ERROR
-	E_TFTP_DISKFULL           = C.CURLE_TFTP_DISKFULL
-	E_TFTP_EXISTS             = C.CURLE_TFTP_EXISTS
-	E_HTTP_RANGE_ERROR        = C.CURLE_HTTP_RANGE_ERROR
-	E_FTP_SSL_FAILED          = C.CURLE_FTP_SSL_FAILED
-	E_OPERATION_TIMEOUTED     = C.CURLE_OPERATION_TIMEOUTED
-	E_HTTP_NOT_FOUND          = C.CURLE_HTTP_NOT_FOUND
-	E_HTTP_PORT_FAILED        = C.CURLE_HTTP_PORT_FAILED
-	E_FTP_COULDNT_STOR_FILE   = C.CURLE_FTP_COULDNT_STOR_FILE
-	E_FTP_PARTIAL_FILE        = C.CURLE_FTP_PARTIAL_FILE
-	E_FTP_BAD_DOWNLOAD_RESUME = C.CURLE_FTP_BAD_DOWNLOAD_RESUME
-	E_ALREADY_COMPLETE        = C.CURLE_ALREADY_COMPLETE
-)
-
-// easy.Setopt(flag, ...)
-const (
-	OPT_ENCODING                  = C.CURLOPT_ENCODING
-	OPT_FILE                      = C.CURLOPT_FILE
-	OPT_URL                       = C.CURLOPT_URL
-	OPT_PORT                      = C.CURLOPT_PORT
-	OPT_PROXY                     = C.CURLOPT_PROXY
-	OPT_USERPWD                   = C.CURLOPT_USERPWD
-	OPT_PROXYUSERPWD              = C.CURLOPT_PROXYUSERPWD
-	OPT_RANGE                     = C.CURLOPT_RANGE
-	OPT_INFILE                    = C.CURLOPT_INFILE
-	OPT_ERRORBUFFER               = C.CURLOPT_ERRORBUFFER
-	OPT_WRITEFUNCTION             = C.CURLOPT_WRITEFUNCTION
-	OPT_READFUNCTION              = C.CURLOPT_READFUNCTION
-	OPT_TIMEOUT                   = C.CURLOPT_TIMEOUT
-	OPT_INFILESIZE                = C.CURLOPT_INFILESIZE
-	OPT_POSTFIELDS                = C.CURLOPT_POSTFIELDS
-	OPT_REFERER                   = C.CURLOPT_REFERER
-	OPT_FTPPORT                   = C.CURLOPT_FTPPORT
-	OPT_USERAGENT                 = C.CURLOPT_USERAGENT
-	OPT_LOW_SPEED_LIMIT           = C.CURLOPT_LOW_SPEED_LIMIT
-	OPT_LOW_SPEED_TIME            = C.CURLOPT_LOW_SPEED_TIME
-	OPT_RESUME_FROM               = C.CURLOPT_RESUME_FROM
-	OPT_COOKIE                    = C.CURLOPT_COOKIE
-	OPT_HTTPHEADER                = C.CURLOPT_HTTPHEADER
-	OPT_HTTPPOST                  = C.CURLOPT_HTTPPOST
-	OPT_SSLCERT                   = C.CURLOPT_SSLCERT
-	OPT_KEYPASSWD                 = C.CURLOPT_KEYPASSWD
-	OPT_CRLF                      = C.CURLOPT_CRLF
-	OPT_QUOTE                     = C.CURLOPT_QUOTE
-	OPT_WRITEHEADER               = C.CURLOPT_WRITEHEADER
-	OPT_COOKIEFILE                = C.CURLOPT_COOKIEFILE
-	OPT_SSLVERSION                = C.CURLOPT_SSLVERSION
-	OPT_TIMECONDITION             = C.CURLOPT_TIMECONDITION
-	OPT_TIMEVALUE                 = C.CURLOPT_TIMEVALUE
-	OPT_CUSTOMREQUEST             = C.CURLOPT_CUSTOMREQUEST
-	OPT_STDERR                    = C.CURLOPT_STDERR
-	OPT_POSTQUOTE                 = C.CURLOPT_POSTQUOTE
-	OPT_WRITEINFO                 = C.CURLOPT_WRITEINFO
-	OPT_VERBOSE                   = C.CURLOPT_VERBOSE
-	OPT_HEADER                    = C.CURLOPT_HEADER
-	OPT_NOPROGRESS                = C.CURLOPT_NOPROGRESS
-	OPT_NOBODY                    = C.CURLOPT_NOBODY
-	OPT_FAILONERROR               = C.CURLOPT_FAILONERROR
-	OPT_UPLOAD                    = C.CURLOPT_UPLOAD
-	OPT_POST                      = C.CURLOPT_POST
-	OPT_DIRLISTONLY               = C.CURLOPT_DIRLISTONLY
-	OPT_APPEND                    = C.CURLOPT_APPEND
-	OPT_NETRC                     = C.CURLOPT_NETRC
-	OPT_FOLLOWLOCATION            = C.CURLOPT_FOLLOWLOCATION
-	OPT_TRANSFERTEXT              = C.CURLOPT_TRANSFERTEXT
-	OPT_PUT                       = C.CURLOPT_PUT
-	OPT_PROGRESSFUNCTION          = C.CURLOPT_PROGRESSFUNCTION
-	OPT_PROGRESSDATA              = C.CURLOPT_PROGRESSDATA
-	OPT_XFERINFODATA              = C.CURLOPT_XFERINFODATA
-	OPT_AUTOREFERER               = C.CURLOPT_AUTOREFERER
-	OPT_PROXYPORT                 = C.CURLOPT_PROXYPORT
-	OPT_POSTFIELDSIZE             = C.CURLOPT_POSTFIELDSIZE
-	OPT_HTTPPROXYTUNNEL           = C.CURLOPT_HTTPPROXYTUNNEL
-	OPT_INTERFACE                 = C.CURLOPT_INTERFACE
-	OPT_KRBLEVEL                  = C.CURLOPT_KRBLEVEL
-	OPT_SSL_VERIFYPEER            = C.CURLOPT_SSL_VERIFYPEER
-	OPT_CAINFO                    = C.CURLOPT_CAINFO
-	OPT_MAXREDIRS                 = C.CURLOPT_MAXREDIRS
-	OPT_FILETIME                  = C.CURLOPT_FILETIME
-	OPT_TELNETOPTIONS             = C.CURLOPT_TELNETOPTIONS
-	OPT_MAXCONNECTS               = C.CURLOPT_MAXCONNECTS
-	OPT_CLOSEPOLICY               = C.CURLOPT_CLOSEPOLICY
-	OPT_FRESH_CONNECT             = C.CURLOPT_FRESH_CONNECT
-	OPT_FORBID_REUSE              = C.CURLOPT_FORBID_REUSE
-	OPT_RANDOM_FILE               = C.CURLOPT_RANDOM_FILE
-	OPT_EGDSOCKET                 = C.CURLOPT_EGDSOCKET
-	OPT_CONNECTTIMEOUT            = C.CURLOPT_CONNECTTIMEOUT
-	OPT_HEADERFUNCTION            = C.CURLOPT_HEADERFUNCTION
-	OPT_HTTPGET                   = C.CURLOPT_HTTPGET
-	OPT_SSL_VERIFYHOST            = C.CURLOPT_SSL_VERIFYHOST
-	OPT_COOKIEJAR                 = C.CURLOPT_COOKIEJAR
-	OPT_SSL_CIPHER_LIST           = C.CURLOPT_SSL_CIPHER_LIST
-	OPT_HTTP_VERSION              = C.CURLOPT_HTTP_VERSION
-	OPT_FTP_USE_EPSV              = C.CURLOPT_FTP_USE_EPSV
-	OPT_SSLCERTTYPE               = C.CURLOPT_SSLCERTTYPE
-	OPT_SSLKEY                    = C.CURLOPT_SSLKEY
-	OPT_SSLKEYTYPE                = C.CURLOPT_SSLKEYTYPE
-	OPT_SSLENGINE                 = C.CURLOPT_SSLENGINE
-	OPT_SSLENGINE_DEFAULT         = C.CURLOPT_SSLENGINE_DEFAULT
-	OPT_DNS_USE_GLOBAL_CACHE      = C.CURLOPT_DNS_USE_GLOBAL_CACHE
-	OPT_DNS_CACHE_TIMEOUT         = C.CURLOPT_DNS_CACHE_TIMEOUT
-	OPT_PREQUOTE                  = C.CURLOPT_PREQUOTE
-	OPT_DEBUGFUNCTION             = C.CURLOPT_DEBUGFUNCTION
-	OPT_DEBUGDATA                 = C.CURLOPT_DEBUGDATA
-	OPT_COOKIESESSION             = C.CURLOPT_COOKIESESSION
-	OPT_CAPATH                    = C.CURLOPT_CAPATH
-	OPT_BUFFERSIZE                = C.CURLOPT_BUFFERSIZE
-	OPT_NOSIGNAL                  = C.CURLOPT_NOSIGNAL
-	OPT_SHARE                     = C.CURLOPT_SHARE
-	OPT_PROXYTYPE                 = C.CURLOPT_PROXYTYPE
-	OPT_ACCEPT_ENCODING           = C.CURLOPT_ACCEPT_ENCODING
-	OPT_PRIVATE                   = C.CURLOPT_PRIVATE
-	OPT_HTTP200ALIASES            = C.CURLOPT_HTTP200ALIASES
-	OPT_UNRESTRICTED_AUTH         = C.CURLOPT_UNRESTRICTED_AUTH
-	OPT_FTP_USE_EPRT              = C.CURLOPT_FTP_USE_EPRT
-	OPT_HTTPAUTH                  = C.CURLOPT_HTTPAUTH
-	OPT_SSL_CTX_FUNCTION          = C.CURLOPT_SSL_CTX_FUNCTION
-	OPT_SSL_CTX_DATA              = C.CURLOPT_SSL_CTX_DATA
-	OPT_FTP_CREATE_MISSING_DIRS   = C.CURLOPT_FTP_CREATE_MISSING_DIRS
-	OPT_PROXYAUTH                 = C.CURLOPT_PROXYAUTH
-	OPT_FTP_RESPONSE_TIMEOUT      = C.CURLOPT_FTP_RESPONSE_TIMEOUT
-	OPT_SERVER_RESPONSE_TIMEOUT   = C.CURLOPT_SERVER_RESPONSE_TIMEOUT
-	OPT_IPRESOLVE                 = C.CURLOPT_IPRESOLVE
-	OPT_MAXFILESIZE               = C.CURLOPT_MAXFILESIZE
-	OPT_INFILESIZE_LARGE          = C.CURLOPT_INFILESIZE_LARGE
-	OPT_RESUME_FROM_LARGE         = C.CURLOPT_RESUME_FROM_LARGE
-	OPT_MAXFILESIZE_LARGE         = C.CURLOPT_MAXFILESIZE_LARGE
-	OPT_NETRC_FILE                = C.CURLOPT_NETRC_FILE
-	OPT_USE_SSL                   = C.CURLOPT_USE_SSL
-	OPT_POSTFIELDSIZE_LARGE       = C.CURLOPT_POSTFIELDSIZE_LARGE
-	OPT_TCP_NODELAY               = C.CURLOPT_TCP_NODELAY
-	OPT_FTPSSLAUTH                = C.CURLOPT_FTPSSLAUTH
-	OPT_IOCTLFUNCTION             = C.CURLOPT_IOCTLFUNCTION
-	OPT_IOCTLDATA                 = C.CURLOPT_IOCTLDATA
-	OPT_FTP_ACCOUNT               = C.CURLOPT_FTP_ACCOUNT
-	OPT_COOKIELIST                = C.CURLOPT_COOKIELIST
-	OPT_IGNORE_CONTENT_LENGTH     = C.CURLOPT_IGNORE_CONTENT_LENGTH
-	OPT_FTP_SKIP_PASV_IP          = C.CURLOPT_FTP_SKIP_PASV_IP
-	OPT_FTP_FILEMETHOD            = C.CURLOPT_FTP_FILEMETHOD
-	OPT_LOCALPORT                 = C.CURLOPT_LOCALPORT
-	OPT_LOCALPORTRANGE            = C.CURLOPT_LOCALPORTRANGE
-	OPT_CONNECT_ONLY              = C.CURLOPT_CONNECT_ONLY
-	OPT_CONV_FROM_NETWORK_FUNCTION = C.CURLOPT_CONV_FROM_NETWORK_FUNCTION
-	OPT_CONV_TO_NETWORK_FUNCTION  = C.CURLOPT_CONV_TO_NETWORK_FUNCTION
-	OPT_CONV_FROM_UTF8_FUNCTION   = C.CURLOPT_CONV_FROM_UTF8_FUNCTION
-	OPT_MAX_SEND_SPEED_LARGE      = C.CURLOPT_MAX_SEND_SPEED_LARGE
-	OPT_MAX_RECV_SPEED_LARGE      = C.CURLOPT_MAX_RECV_SPEED_LARGE
-	OPT_FTP_ALTERNATIVE_TO_USER   = C.CURLOPT_FTP_ALTERNATIVE_TO_USER
-	OPT_SOCKOPTFUNCTION           = C.CURLOPT_SOCKOPTFUNCTION
-	OPT_SOCKOPTDATA               = C.CURLOPT_SOCKOPTDATA
-	OPT_SSL_SESSIONID_CACHE       = C.CURLOPT_SSL_SESSIONID_CACHE
-	OPT_SSH_AUTH_TYPES            = C.CURLOPT_SSH_AUTH_TYPES
-	OPT_SSH_PUBLIC_KEYFILE        = C.CURLOPT_SSH_PUBLIC_KEYFILE
-	OPT_SSH_PRIVATE_KEYFILE       = C.CURLOPT_SSH_PRIVATE_KEYFILE
-	OPT_FTP_SSL_CCC               = C.CURLOPT_FTP_SSL_CCC
-	OPT_TIMEOUT_MS                = C.CURLOPT_TIMEOUT_MS
-	OPT_CONNECTTIMEOUT_MS         = C.CURLOPT_CONNECTTIMEOUT_MS
-	OPT_HTTP_TRANSFER_DECODING    = C.CURLOPT_HTTP_TRANSFER_DECODING
-	OPT_HTTP_CONTENT_DECODING     = C.CURLOPT_HTTP_CONTENT_DECODING
-	OPT_NEW_FILE_PERMS            = C.CURLOPT_NEW_FILE_PERMS
-	OPT_NEW_DIRECTORY_PERMS       = C.CURLOPT_NEW_DIRECTORY_PERMS
-	OPT_POSTREDIR                 = C.CURLOPT_POSTREDIR
-	OPT_SSH_HOST_PUBLIC_KEY_MD5   = C.CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
-	OPT_OPENSOCKETFUNCTION        = C.CURLOPT_OPENSOCKETFUNCTION
-	OPT_OPENSOCKETDATA            = C.CURLOPT_OPENSOCKETDATA
-	OPT_COPYPOSTFIELDS            = C.CURLOPT_COPYPOSTFIELDS
-	OPT_PROXY_TRANSFER_MODE       = C.CURLOPT_PROXY_TRANSFER_MODE
-	OPT_SEEKFUNCTION              = C.CURLOPT_SEEKFUNCTION
-	OPT_SEEKDATA                  = C.CURLOPT_SEEKDATA
-	OPT_CRLFILE                   = C.CURLOPT_CRLFILE
-	OPT_ISSUERCERT                = C.CURLOPT_ISSUERCERT
-	OPT_ADDRESS_SCOPE             = C.CURLOPT_ADDRESS_SCOPE
-	OPT_CERTINFO                  = C.CURLOPT_CERTINFO
-	OPT_USERNAME                  = C.CURLOPT_USERNAME
-	OPT_PASSWORD                  = C.CURLOPT_PASSWORD
-	OPT_PROXYUSERNAME             = C.CURLOPT_PROXYUSERNAME
-	OPT_PROXYPASSWORD             = C.CURLOPT_PROXYPASSWORD
-	OPT_NOPROXY                   = C.CURLOPT_NOPROXY
-	OPT_TFTP_BLKSIZE              = C.CURLOPT_TFTP_BLKSIZE
-	OPT_SOCKS5_GSSAPI_SERVICE     = C.CURLOPT_SOCKS5_GSSAPI_SERVICE
-	OPT_SOCKS5_GSSAPI_NEC         = C.CURLOPT_SOCKS5_GSSAPI_NEC
-	OPT_PROTOCOLS                 = C.CURLOPT_PROTOCOLS
-	OPT_REDIR_PROTOCOLS           = C.CURLOPT_REDIR_PROTOCOLS
-	OPT_SSH_KNOWNHOSTS            = C.CURLOPT_SSH_KNOWNHOSTS
-	OPT_SSH_KEYFUNCTION           = C.CURLOPT_SSH_KEYFUNCTION
-	OPT_SSH_KEYDATA               = C.CURLOPT_SSH_KEYDATA
-	OPT_MAIL_FROM                 = C.CURLOPT_MAIL_FROM
-	OPT_MAIL_RCPT                 = C.CURLOPT_MAIL_RCPT
-	OPT_FTP_USE_PRET              = C.CURLOPT_FTP_USE_PRET
-	OPT_RTSP_REQUEST              = C.CURLOPT_RTSP_REQUEST
-	OPT_RTSP_SESSION_ID           = C.CURLOPT_RTSP_SESSION_ID
-	OPT_RTSP_STREAM_URI           = C.CURLOPT_RTSP_STREAM_URI
-	OPT_RTSP_TRANSPORT            = C.CURLOPT_RTSP_TRANSPORT
-	OPT_RTSP_CLIENT_CSEQ          = C.CURLOPT_RTSP_CLIENT_CSEQ
-	OPT_RTSP_SERVER_CSEQ          = C.CURLOPT_RTSP_SERVER_CSEQ
-	OPT_INTERLEAVEDATA            = C.CURLOPT_INTERLEAVEDATA
-	OPT_INTERLEAVEFUNCTION        = C.CURLOPT_INTERLEAVEFUNCTION
-	OPT_WILDCARDMATCH             = C.CURLOPT_WILDCARDMATCH
-	OPT_CHUNK_BGN_FUNCTION        = C.CURLOPT_CHUNK_BGN_FUNCTION
-	OPT_CHUNK_END_FUNCTION        = C.CURLOPT_CHUNK_END_FUNCTION
-	OPT_FNMATCH_FUNCTION          = C.CURLOPT_FNMATCH_FUNCTION
-	OPT_CHUNK_DATA                = C.CURLOPT_CHUNK_DATA
-	OPT_FNMATCH_DATA              = C.CURLOPT_FNMATCH_DATA
-	OPT_RESOLVE                   = C.CURLOPT_RESOLVE
-	OPT_TLSAUTH_USERNAME          = C.CURLOPT_TLSAUTH_USERNAME
-	OPT_TLSAUTH_PASSWORD          = C.CURLOPT_TLSAUTH_PASSWORD
-	OPT_TLSAUTH_TYPE              = C.CURLOPT_TLSAUTH_TYPE
-	OPT_TRANSFER_ENCODING         = C.CURLOPT_TRANSFER_ENCODING
-	OPT_CLOSESOCKETFUNCTION       = C.CURLOPT_CLOSESOCKETFUNCTION
-	OPT_CLOSESOCKETDATA           = C.CURLOPT_CLOSESOCKETDATA
-	OPT_GSSAPI_DELEGATION         = C.CURLOPT_GSSAPI_DELEGATION
-	OPT_DNS_SERVERS               = C.CURLOPT_DNS_SERVERS
-	OPT_ACCEPTTIMEOUT_MS          = C.CURLOPT_ACCEPTTIMEOUT_MS
-	OPT_TCP_KEEPALIVE             = C.CURLOPT_TCP_KEEPALIVE
-	OPT_TCP_KEEPIDLE              = C.CURLOPT_TCP_KEEPIDLE
-	OPT_TCP_KEEPINTVL             = C.CURLOPT_TCP_KEEPINTVL
-	OPT_SSL_OPTIONS               = C.CURLOPT_SSL_OPTIONS
-	OPT_MAIL_AUTH                 = C.CURLOPT_MAIL_AUTH
-	OPT_SASL_IR                   = C.CURLOPT_SASL_IR
-	OPT_XFERINFOFUNCTION          = C.CURLOPT_XFERINFOFUNCTION
-	OPT_XOAUTH2_BEARER            = C.CURLOPT_XOAUTH2_BEARER
-	OPT_DNS_INTERFACE             = C.CURLOPT_DNS_INTERFACE
-	OPT_DNS_LOCAL_IP4             = C.CURLOPT_DNS_LOCAL_IP4
-	OPT_DNS_LOCAL_IP6             = C.CURLOPT_DNS_LOCAL_IP6
-	OPT_LOGIN_OPTIONS             = C.CURLOPT_LOGIN_OPTIONS
-	OPT_SSL_ENABLE_NPN            = C.CURLOPT_SSL_ENABLE_NPN
-	OPT_SSL_ENABLE_ALPN           = C.CURLOPT_SSL_ENABLE_ALPN
-	OPT_EXPECT_100_TIMEOUT_MS     = C.CURLOPT_EXPECT_100_TIMEOUT_MS
-	OPT_POST301                   = C.CURLOPT_POST301
-	OPT_SSLKEYPASSWD              = C.CURLOPT_SSLKEYPASSWD
-	OPT_FTPAPPEND                 = C.CURLOPT_FTPAPPEND
-	OPT_FTPLISTONLY               = C.CURLOPT_FTPLISTONLY
-	OPT_FTP_SSL                   = C.CURLOPT_FTP_SSL
-	OPT_SSLCERTPASSWD             = C.CURLOPT_SSLCERTPASSWD
-	OPT_KRB4LEVEL                 = C.CURLOPT_KRB4LEVEL
-	OPT_WRITEDATA                 = C.CURLOPT_WRITEDATA
-	OPT_READDATA                  = C.CURLOPT_READDATA
-	OPT_HEADERDATA                = C.CURLOPT_HEADERDATA
-	OPT_RTSPHEADER                = C.CURLOPT_RTSPHEADER
-)
-
-// easy.Getinfo(flag)
-const (
-	INFO_TEXT                 = C.CURLINFO_TEXT
-	INFO_EFFECTIVE_URL        = C.CURLINFO_EFFECTIVE_URL
-	INFO_RESPONSE_CODE        = C.CURLINFO_RESPONSE_CODE
-	INFO_TOTAL_TIME           = C.CURLINFO_TOTAL_TIME
-	INFO_NAMELOOKUP_TIME      = C.CURLINFO_NAMELOOKUP_TIME
-	INFO_CONNECT_TIME         = C.CURLINFO_CONNECT_TIME
-	INFO_PRETRANSFER_TIME     = C.CURLINFO_PRETRANSFER_TIME
-	INFO_SIZE_UPLOAD          = C.CURLINFO_SIZE_UPLOAD
-	INFO_SIZE_DOWNLOAD        = C.CURLINFO_SIZE_DOWNLOAD
-	INFO_SPEED_DOWNLOAD       = C.CURLINFO_SPEED_DOWNLOAD
-	INFO_SPEED_UPLOAD         = C.CURLINFO_SPEED_UPLOAD
-	INFO_HEADER_SIZE          = C.CURLINFO_HEADER_SIZE
-	INFO_REQUEST_SIZE         = C.CURLINFO_REQUEST_SIZE
-	INFO_SSL_VERIFYRESULT     = C.CURLINFO_SSL_VERIFYRESULT
-	INFO_FILETIME             = C.CURLINFO_FILETIME
-	INFO_CONTENT_LENGTH_DOWNLOAD = C.CURLINFO_CONTENT_LENGTH_DOWNLOAD
-	INFO_CONTENT_LENGTH_UPLOAD = C.CURLINFO_CONTENT_LENGTH_UPLOAD
-	INFO_STARTTRANSFER_TIME   = C.CURLINFO_STARTTRANSFER_TIME
-	INFO_CONTENT_TYPE         = C.CURLINFO_CONTENT_TYPE
-	INFO_REDIRECT_TIME        = C.CURLINFO_REDIRECT_TIME
-	INFO_REDIRECT_COUNT       = C.CURLINFO_REDIRECT_COUNT
-	INFO_PRIVATE              = C.CURLINFO_PRIVATE
-	INFO_HTTP_CONNECTCODE     = C.CURLINFO_HTTP_CONNECTCODE
-	INFO_HTTPAUTH_AVAIL       = C.CURLINFO_HTTPAUTH_AVAIL
-	INFO_PROXYAUTH_AVAIL      = C.CURLINFO_PROXYAUTH_AVAIL
-	INFO_OS_ERRNO             = C.CURLINFO_OS_ERRNO
-	INFO_NUM_CONNECTS         = C.CURLINFO_NUM_CONNECTS
-	INFO_SSL_ENGINES          = C.CURLINFO_SSL_ENGINES
-	INFO_COOKIELIST           = C.CURLINFO_COOKIELIST
-	INFO_LASTSOCKET           = C.CURLINFO_LASTSOCKET
-	INFO_FTP_ENTRY_PATH       = C.CURLINFO_FTP_ENTRY_PATH
-	INFO_REDIRECT_URL         = C.CURLINFO_REDIRECT_URL
-	INFO_PRIMARY_IP           = C.CURLINFO_PRIMARY_IP
-	INFO_APPCONNECT_TIME      = C.CURLINFO_APPCONNECT_TIME
-	INFO_CERTINFO             = C.CURLINFO_CERTINFO
-	INFO_CONDITION_UNMET      = C.CURLINFO_CONDITION_UNMET
-	INFO_RTSP_SESSION_ID      = C.CURLINFO_RTSP_SESSION_ID
-	INFO_RTSP_CLIENT_CSEQ     = C.CURLINFO_RTSP_CLIENT_CSEQ
-	INFO_RTSP_SERVER_CSEQ     = C.CURLINFO_RTSP_SERVER_CSEQ
-	INFO_RTSP_CSEQ_RECV       = C.CURLINFO_RTSP_CSEQ_RECV
-	INFO_PRIMARY_PORT         = C.CURLINFO_PRIMARY_PORT
-	INFO_LOCAL_IP             = C.CURLINFO_LOCAL_IP
-	INFO_LOCAL_PORT           = C.CURLINFO_LOCAL_PORT
-	INFO_TLS_SESSION          = C.CURLINFO_TLS_SESSION
-	INFO_LASTONE              = C.CURLINFO_LASTONE
-	INFO_HTTP_CODE            = C.CURLINFO_HTTP_CODE
-)
-
-// generated ends

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/core.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/core.go b/Godeps/_workspace/src/github.com/andelf/go-curl/core.go
deleted file mode 100644
index a4e0fc5..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/core.go
+++ /dev/null
@@ -1,118 +0,0 @@
-// libcurl go bingding
-package curl
-
-/*
-#cgo linux pkg-config: libcurl
-#cgo darwin LDFLAGS: -lcurl
-#cgo windows LDFLAGS: -lcurl
-#include <stdlib.h>
-#include <curl/curl.h>
-
-static char *string_array_index(char **p, int i) {
-  return p[i];
-}
-*/
-import "C"
-
-import (
-	"time"
-	"unsafe"
-)
-
-// curl_global_init - Global libcurl initialisation
-func GlobalInit(flags int) error {
-	return newCurlError(C.curl_global_init(C.long(flags)))
-}
-
-// curl_global_cleanup - global libcurl cleanup
-func GlobalCleanup() {
-	C.curl_global_cleanup()
-}
-
-type VersionInfoData struct {
-	Age C.CURLversion
-	// age >= 0
-	Version       string
-	VersionNum    uint
-	Host          string
-	Features      int
-	SslVersion    string
-	SslVersionNum int
-	LibzVersion   string
-	Protocols     []string
-	// age >= 1
-	Ares    string
-	AresNum int
-	// age >= 2
-	Libidn string
-	// age >= 3
-	IconvVerNum   int
-	LibsshVersion string
-}
-
-// curl_version - returns the libcurl version string
-func Version() string {
-	return C.GoString(C.curl_version())
-}
-
-// curl_version_info - returns run-time libcurl version info
-func VersionInfo(ver C.CURLversion) *VersionInfoData {
-	data := C.curl_version_info(ver)
-	ret := new(VersionInfoData)
-	ret.Age = data.age
-	switch age := ret.Age; {
-	case age >= 0:
-		ret.Version = string(C.GoString(data.version))
-		ret.VersionNum = uint(data.version_num)
-		ret.Host = C.GoString(data.host)
-		ret.Features = int(data.features)
-		ret.SslVersion = C.GoString(data.ssl_version)
-		ret.SslVersionNum = int(data.ssl_version_num)
-		ret.LibzVersion = C.GoString(data.libz_version)
-		// ugly but works
-		ret.Protocols = []string{}
-		for i := C.int(0); C.string_array_index(data.protocols, i) != nil; i++ {
-			p := C.string_array_index(data.protocols, i)
-			ret.Protocols = append(ret.Protocols, C.GoString(p))
-		}
-		fallthrough
-	case age >= 1:
-		ret.Ares = C.GoString(data.ares)
-		ret.AresNum = int(data.ares_num)
-		fallthrough
-	case age >= 2:
-		ret.Libidn = C.GoString(data.libidn)
-		fallthrough
-	case age >= 3:
-		ret.IconvVerNum = int(data.iconv_ver_num)
-		ret.LibsshVersion = C.GoString(data.libssh_version)
-	}
-	return ret
-}
-
-// curl_getdate - Convert a date string to number of seconds since January 1, 1970
-// In golang, we convert it to a *time.Time
-func Getdate(date string) *time.Time {
-	datestr := C.CString(date)
-	defer C.free(unsafe.Pointer(datestr))
-	t := C.curl_getdate(datestr, nil)
-	if t == -1 {
-		return nil
-	}
-	unix := time.Unix(int64(t), 0).UTC()
-	return &unix
-
-	/*
-	   // curl_getenv - return value for environment name
-	   func Getenv(name string) string {
-	           namestr := C.CString(name)
-	           defer C.free(unsafe.Pointer(namestr))
-	           ret := C.curl_getenv(unsafe.Pointer(namestr))
-	           defer C.free(unsafe.Pointer(ret))
-
-	           return C.GoString(ret)
-	   }
-	*/
-}
-
-// TODO: curl_global_init_mem

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/core_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/core_test.go b/Godeps/_workspace/src/github.com/andelf/go-curl/core_test.go
deleted file mode 100644
index a10425a..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/core_test.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package curl
-
-import (
-	"testing"
-)
-
-func TestVersionInfo(t *testing.T) {
-	info := VersionInfo(VERSION_FIRST)
-	expectedProtocols := []string{"dict", "file", "ftp", "ftps", "gopher", "http", "https", "imap", "imaps", "ldap", "ldaps", "pop3", "pop3s", "rtmp", "rtsp", "smtp", "smtps", "telnet", "tftp", "scp", "sftp"}
-	protocols := info.Protocols
-	for _, protocol := range protocols {
-		found := false
-		for _, expectedProtocol := range expectedProtocols {
-			if expectedProtocol == protocol {
-				found = true
-				break
-			}
-		}
-		if !found {
-			t.Errorf("protocol should be in %v and is %v.", expectedProtocols, protocol)
-		}
-	}
-}


[25/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/scannerc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/scannerc.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/scannerc.go
deleted file mode 100644
index fe93b19..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/scannerc.go
+++ /dev/null
@@ -1,2710 +0,0 @@
-package yaml
-
-import (
-	"bytes"
-	"fmt"
-)
-
-// Introduction
-// ************
-//
-// The following notes assume that you are familiar with the YAML specification
-// (http://yaml.org/spec/cvs/current.html).  We mostly follow it, although in
-// some cases we are less restrictive that it requires.
-//
-// The process of transforming a YAML stream into a sequence of events is
-// divided on two steps: Scanning and Parsing.
-//
-// The Scanner transforms the input stream into a sequence of tokens, while the
-// parser transform the sequence of tokens produced by the Scanner into a
-// sequence of parsing events.
-//
-// The Scanner is rather clever and complicated. The Parser, on the contrary,
-// is a straightforward implementation of a recursive-descendant parser (or,
-// LL(1) parser, as it is usually called).
-//
-// Actually there are two issues of Scanning that might be called "clever", the
-// rest is quite straightforward.  The issues are "block collection start" and
-// "simple keys".  Both issues are explained below in details.
-//
-// Here the Scanning step is explained and implemented.  We start with the list
-// of all the tokens produced by the Scanner together with short descriptions.
-//
-// Now, tokens:
-//
-//      STREAM-START(encoding)          # The stream start.
-//      STREAM-END                      # The stream end.
-//      VERSION-DIRECTIVE(major,minor)  # The '%YAML' directive.
-//      TAG-DIRECTIVE(handle,prefix)    # The '%TAG' directive.
-//      DOCUMENT-START                  # '---'
-//      DOCUMENT-END                    # '...'
-//      BLOCK-SEQUENCE-START            # Indentation increase denoting a block
-//      BLOCK-MAPPING-START             # sequence or a block mapping.
-//      BLOCK-END                       # Indentation decrease.
-//      FLOW-SEQUENCE-START             # '['
-//      FLOW-SEQUENCE-END               # ']'
-//      BLOCK-SEQUENCE-START            # '{'
-//      BLOCK-SEQUENCE-END              # '}'
-//      BLOCK-ENTRY                     # '-'
-//      FLOW-ENTRY                      # ','
-//      KEY                             # '?' or nothing (simple keys).
-//      VALUE                           # ':'
-//      ALIAS(anchor)                   # '*anchor'
-//      ANCHOR(anchor)                  # '&anchor'
-//      TAG(handle,suffix)              # '!handle!suffix'
-//      SCALAR(value,style)             # A scalar.
-//
-// The following two tokens are "virtual" tokens denoting the beginning and the
-// end of the stream:
-//
-//      STREAM-START(encoding)
-//      STREAM-END
-//
-// We pass the information about the input stream encoding with the
-// STREAM-START token.
-//
-// The next two tokens are responsible for tags:
-//
-//      VERSION-DIRECTIVE(major,minor)
-//      TAG-DIRECTIVE(handle,prefix)
-//
-// Example:
-//
-//      %YAML   1.1
-//      %TAG    !   !foo
-//      %TAG    !yaml!  tag:yaml.org,2002:
-//      ---
-//
-// The correspoding sequence of tokens:
-//
-//      STREAM-START(utf-8)
-//      VERSION-DIRECTIVE(1,1)
-//      TAG-DIRECTIVE("!","!foo")
-//      TAG-DIRECTIVE("!yaml","tag:yaml.org,2002:")
-//      DOCUMENT-START
-//      STREAM-END
-//
-// Note that the VERSION-DIRECTIVE and TAG-DIRECTIVE tokens occupy a whole
-// line.
-//
-// The document start and end indicators are represented by:
-//
-//      DOCUMENT-START
-//      DOCUMENT-END
-//
-// Note that if a YAML stream contains an implicit document (without '---'
-// and '...' indicators), no DOCUMENT-START and DOCUMENT-END tokens will be
-// produced.
-//
-// In the following examples, we present whole documents together with the
-// produced tokens.
-//
-//      1. An implicit document:
-//
-//          'a scalar'
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          SCALAR("a scalar",single-quoted)
-//          STREAM-END
-//
-//      2. An explicit document:
-//
-//          ---
-//          'a scalar'
-//          ...
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          DOCUMENT-START
-//          SCALAR("a scalar",single-quoted)
-//          DOCUMENT-END
-//          STREAM-END
-//
-//      3. Several documents in a stream:
-//
-//          'a scalar'
-//          ---
-//          'another scalar'
-//          ---
-//          'yet another scalar'
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          SCALAR("a scalar",single-quoted)
-//          DOCUMENT-START
-//          SCALAR("another scalar",single-quoted)
-//          DOCUMENT-START
-//          SCALAR("yet another scalar",single-quoted)
-//          STREAM-END
-//
-// We have already introduced the SCALAR token above.  The following tokens are
-// used to describe aliases, anchors, tag, and scalars:
-//
-//      ALIAS(anchor)
-//      ANCHOR(anchor)
-//      TAG(handle,suffix)
-//      SCALAR(value,style)
-//
-// The following series of examples illustrate the usage of these tokens:
-//
-//      1. A recursive sequence:
-//
-//          &A [ *A ]
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          ANCHOR("A")
-//          FLOW-SEQUENCE-START
-//          ALIAS("A")
-//          FLOW-SEQUENCE-END
-//          STREAM-END
-//
-//      2. A tagged scalar:
-//
-//          !!float "3.14"  # A good approximation.
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          TAG("!!","float")
-//          SCALAR("3.14",double-quoted)
-//          STREAM-END
-//
-//      3. Various scalar styles:
-//
-//          --- # Implicit empty plain scalars do not produce tokens.
-//          --- a plain scalar
-//          --- 'a single-quoted scalar'
-//          --- "a double-quoted scalar"
-//          --- |-
-//            a literal scalar
-//          --- >-
-//            a folded
-//            scalar
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          DOCUMENT-START
-//          DOCUMENT-START
-//          SCALAR("a plain scalar",plain)
-//          DOCUMENT-START
-//          SCALAR("a single-quoted scalar",single-quoted)
-//          DOCUMENT-START
-//          SCALAR("a double-quoted scalar",double-quoted)
-//          DOCUMENT-START
-//          SCALAR("a literal scalar",literal)
-//          DOCUMENT-START
-//          SCALAR("a folded scalar",folded)
-//          STREAM-END
-//
-// Now it's time to review collection-related tokens. We will start with
-// flow collections:
-//
-//      FLOW-SEQUENCE-START
-//      FLOW-SEQUENCE-END
-//      FLOW-MAPPING-START
-//      FLOW-MAPPING-END
-//      FLOW-ENTRY
-//      KEY
-//      VALUE
-//
-// The tokens FLOW-SEQUENCE-START, FLOW-SEQUENCE-END, FLOW-MAPPING-START, and
-// FLOW-MAPPING-END represent the indicators '[', ']', '{', and '}'
-// correspondingly.  FLOW-ENTRY represent the ',' indicator.  Finally the
-// indicators '?' and ':', which are used for denoting mapping keys and values,
-// are represented by the KEY and VALUE tokens.
-//
-// The following examples show flow collections:
-//
-//      1. A flow sequence:
-//
-//          [item 1, item 2, item 3]
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          FLOW-SEQUENCE-START
-//          SCALAR("item 1",plain)
-//          FLOW-ENTRY
-//          SCALAR("item 2",plain)
-//          FLOW-ENTRY
-//          SCALAR("item 3",plain)
-//          FLOW-SEQUENCE-END
-//          STREAM-END
-//
-//      2. A flow mapping:
-//
-//          {
-//              a simple key: a value,  # Note that the KEY token is produced.
-//              ? a complex key: another value,
-//          }
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          FLOW-MAPPING-START
-//          KEY
-//          SCALAR("a simple key",plain)
-//          VALUE
-//          SCALAR("a value",plain)
-//          FLOW-ENTRY
-//          KEY
-//          SCALAR("a complex key",plain)
-//          VALUE
-//          SCALAR("another value",plain)
-//          FLOW-ENTRY
-//          FLOW-MAPPING-END
-//          STREAM-END
-//
-// A simple key is a key which is not denoted by the '?' indicator.  Note that
-// the Scanner still produce the KEY token whenever it encounters a simple key.
-//
-// For scanning block collections, the following tokens are used (note that we
-// repeat KEY and VALUE here):
-//
-//      BLOCK-SEQUENCE-START
-//      BLOCK-MAPPING-START
-//      BLOCK-END
-//      BLOCK-ENTRY
-//      KEY
-//      VALUE
-//
-// The tokens BLOCK-SEQUENCE-START and BLOCK-MAPPING-START denote indentation
-// increase that precedes a block collection (cf. the INDENT token in Python).
-// The token BLOCK-END denote indentation decrease that ends a block collection
-// (cf. the DEDENT token in Python).  However YAML has some syntax pecularities
-// that makes detections of these tokens more complex.
-//
-// The tokens BLOCK-ENTRY, KEY, and VALUE are used to represent the indicators
-// '-', '?', and ':' correspondingly.
-//
-// The following examples show how the tokens BLOCK-SEQUENCE-START,
-// BLOCK-MAPPING-START, and BLOCK-END are emitted by the Scanner:
-//
-//      1. Block sequences:
-//
-//          - item 1
-//          - item 2
-//          -
-//            - item 3.1
-//            - item 3.2
-//          -
-//            key 1: value 1
-//            key 2: value 2
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          BLOCK-SEQUENCE-START
-//          BLOCK-ENTRY
-//          SCALAR("item 1",plain)
-//          BLOCK-ENTRY
-//          SCALAR("item 2",plain)
-//          BLOCK-ENTRY
-//          BLOCK-SEQUENCE-START
-//          BLOCK-ENTRY
-//          SCALAR("item 3.1",plain)
-//          BLOCK-ENTRY
-//          SCALAR("item 3.2",plain)
-//          BLOCK-END
-//          BLOCK-ENTRY
-//          BLOCK-MAPPING-START
-//          KEY
-//          SCALAR("key 1",plain)
-//          VALUE
-//          SCALAR("value 1",plain)
-//          KEY
-//          SCALAR("key 2",plain)
-//          VALUE
-//          SCALAR("value 2",plain)
-//          BLOCK-END
-//          BLOCK-END
-//          STREAM-END
-//
-//      2. Block mappings:
-//
-//          a simple key: a value   # The KEY token is produced here.
-//          ? a complex key
-//          : another value
-//          a mapping:
-//            key 1: value 1
-//            key 2: value 2
-//          a sequence:
-//            - item 1
-//            - item 2
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          BLOCK-MAPPING-START
-//          KEY
-//          SCALAR("a simple key",plain)
-//          VALUE
-//          SCALAR("a value",plain)
-//          KEY
-//          SCALAR("a complex key",plain)
-//          VALUE
-//          SCALAR("another value",plain)
-//          KEY
-//          SCALAR("a mapping",plain)
-//          BLOCK-MAPPING-START
-//          KEY
-//          SCALAR("key 1",plain)
-//          VALUE
-//          SCALAR("value 1",plain)
-//          KEY
-//          SCALAR("key 2",plain)
-//          VALUE
-//          SCALAR("value 2",plain)
-//          BLOCK-END
-//          KEY
-//          SCALAR("a sequence",plain)
-//          VALUE
-//          BLOCK-SEQUENCE-START
-//          BLOCK-ENTRY
-//          SCALAR("item 1",plain)
-//          BLOCK-ENTRY
-//          SCALAR("item 2",plain)
-//          BLOCK-END
-//          BLOCK-END
-//          STREAM-END
-//
-// YAML does not always require to start a new block collection from a new
-// line.  If the current line contains only '-', '?', and ':' indicators, a new
-// block collection may start at the current line.  The following examples
-// illustrate this case:
-//
-//      1. Collections in a sequence:
-//
-//          - - item 1
-//            - item 2
-//          - key 1: value 1
-//            key 2: value 2
-//          - ? complex key
-//            : complex value
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          BLOCK-SEQUENCE-START
-//          BLOCK-ENTRY
-//          BLOCK-SEQUENCE-START
-//          BLOCK-ENTRY
-//          SCALAR("item 1",plain)
-//          BLOCK-ENTRY
-//          SCALAR("item 2",plain)
-//          BLOCK-END
-//          BLOCK-ENTRY
-//          BLOCK-MAPPING-START
-//          KEY
-//          SCALAR("key 1",plain)
-//          VALUE
-//          SCALAR("value 1",plain)
-//          KEY
-//          SCALAR("key 2",plain)
-//          VALUE
-//          SCALAR("value 2",plain)
-//          BLOCK-END
-//          BLOCK-ENTRY
-//          BLOCK-MAPPING-START
-//          KEY
-//          SCALAR("complex key")
-//          VALUE
-//          SCALAR("complex value")
-//          BLOCK-END
-//          BLOCK-END
-//          STREAM-END
-//
-//      2. Collections in a mapping:
-//
-//          ? a sequence
-//          : - item 1
-//            - item 2
-//          ? a mapping
-//          : key 1: value 1
-//            key 2: value 2
-//
-//      Tokens:
-//
-//          STREAM-START(utf-8)
-//          BLOCK-MAPPING-START
-//          KEY
-//          SCALAR("a sequence",plain)
-//          VALUE
-//          BLOCK-SEQUENCE-START
-//          BLOCK-ENTRY
-//          SCALAR("item 1",plain)
-//          BLOCK-ENTRY
-//          SCALAR("item 2",plain)
-//          BLOCK-END
-//          KEY
-//          SCALAR("a mapping",plain)
-//          VALUE
-//          BLOCK-MAPPING-START
-//          KEY
-//          SCALAR("key 1",plain)
-//          VALUE
-//          SCALAR("value 1",plain)
-//          KEY
-//          SCALAR("key 2",plain)
-//          VALUE
-//          SCALAR("value 2",plain)
-//          BLOCK-END
-//          BLOCK-END
-//          STREAM-END
-//
-// YAML also permits non-indented sequences if they are included into a block
-// mapping.  In this case, the token BLOCK-SEQUENCE-START is not produced:
-//
-//      key:
-//      - item 1    # BLOCK-SEQUENCE-START is NOT produced here.
-//      - item 2
-//
-// Tokens:
-//
-//      STREAM-START(utf-8)
-//      BLOCK-MAPPING-START
-//      KEY
-//      SCALAR("key",plain)
-//      VALUE
-//      BLOCK-ENTRY
-//      SCALAR("item 1",plain)
-//      BLOCK-ENTRY
-//      SCALAR("item 2",plain)
-//      BLOCK-END
-//
-
-// Ensure that the buffer contains the required number of characters.
-// Return true on success, false on failure (reader error or memory error).
-func cache(parser *yaml_parser_t, length int) bool {
-	// [Go] This was inlined: !cache(A, B) -> unread < B && !update(A, B)
-	return parser.unread >= length || yaml_parser_update_buffer(parser, length)
-}
-
-// Advance the buffer pointer.
-func skip(parser *yaml_parser_t) {
-	parser.mark.index++
-	parser.mark.column++
-	parser.unread--
-	parser.buffer_pos += width(parser.buffer[parser.buffer_pos])
-}
-
-func skip_line(parser *yaml_parser_t) {
-	if is_crlf(parser.buffer, parser.buffer_pos) {
-		parser.mark.index += 2
-		parser.mark.column = 0
-		parser.mark.line++
-		parser.unread -= 2
-		parser.buffer_pos += 2
-	} else if is_break(parser.buffer, parser.buffer_pos) {
-		parser.mark.index++
-		parser.mark.column = 0
-		parser.mark.line++
-		parser.unread--
-		parser.buffer_pos += width(parser.buffer[parser.buffer_pos])
-	}
-}
-
-// Copy a character to a string buffer and advance pointers.
-func read(parser *yaml_parser_t, s []byte) []byte {
-	w := width(parser.buffer[parser.buffer_pos])
-	if w == 0 {
-		panic("invalid character sequence")
-	}
-	if len(s) == 0 {
-		s = make([]byte, 0, 32)
-	}
-	if w == 1 && len(s)+w <= cap(s) {
-		s = s[:len(s)+1]
-		s[len(s)-1] = parser.buffer[parser.buffer_pos]
-		parser.buffer_pos++
-	} else {
-		s = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...)
-		parser.buffer_pos += w
-	}
-	parser.mark.index++
-	parser.mark.column++
-	parser.unread--
-	return s
-}
-
-// Copy a line break character to a string buffer and advance pointers.
-func read_line(parser *yaml_parser_t, s []byte) []byte {
-	buf := parser.buffer
-	pos := parser.buffer_pos
-	switch {
-	case buf[pos] == '\r' && buf[pos+1] == '\n':
-		// CR LF . LF
-		s = append(s, '\n')
-		parser.buffer_pos += 2
-		parser.mark.index++
-		parser.unread--
-	case buf[pos] == '\r' || buf[pos] == '\n':
-		// CR|LF . LF
-		s = append(s, '\n')
-		parser.buffer_pos += 1
-	case buf[pos] == '\xC2' && buf[pos+1] == '\x85':
-		// NEL . LF
-		s = append(s, '\n')
-		parser.buffer_pos += 2
-	case buf[pos] == '\xE2' && buf[pos+1] == '\x80' && (buf[pos+2] == '\xA8' || buf[pos+2] == '\xA9'):
-		// LS|PS . LS|PS
-		s = append(s, buf[parser.buffer_pos:pos+3]...)
-		parser.buffer_pos += 3
-	default:
-		return s
-	}
-	parser.mark.index++
-	parser.mark.column = 0
-	parser.mark.line++
-	parser.unread--
-	return s
-}
-
-// Get the next token.
-func yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool {
-	// Erase the token object.
-	*token = yaml_token_t{} // [Go] Is this necessary?
-
-	// No tokens after STREAM-END or error.
-	if parser.stream_end_produced || parser.error != yaml_NO_ERROR {
-		return true
-	}
-
-	// Ensure that the tokens queue contains enough tokens.
-	if !parser.token_available {
-		if !yaml_parser_fetch_more_tokens(parser) {
-			return false
-		}
-	}
-
-	// Fetch the next token from the queue.
-	*token = parser.tokens[parser.tokens_head]
-	parser.tokens_head++
-	parser.tokens_parsed++
-	parser.token_available = false
-
-	if token.typ == yaml_STREAM_END_TOKEN {
-		parser.stream_end_produced = true
-	}
-	return true
-}
-
-// Set the scanner error and return false.
-func yaml_parser_set_scanner_error(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string) bool {
-	parser.error = yaml_SCANNER_ERROR
-	parser.context = context
-	parser.context_mark = context_mark
-	parser.problem = problem
-	parser.problem_mark = parser.mark
-	return false
-}
-
-func yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive bool, context_mark yaml_mark_t, problem string) bool {
-	context := "while parsing a tag"
-	if directive {
-		context = "while parsing a %TAG directive"
-	}
-	return yaml_parser_set_scanner_error(parser, context, context_mark, "did not find URI escaped octet")
-}
-
-func trace(args ...interface{}) func() {
-	pargs := append([]interface{}{"+++"}, args...)
-	fmt.Println(pargs...)
-	pargs = append([]interface{}{"---"}, args...)
-	return func() { fmt.Println(pargs...) }
-}
-
-// Ensure that the tokens queue contains at least one token which can be
-// returned to the Parser.
-func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool {
-	// While we need more tokens to fetch, do it.
-	for {
-		// Check if we really need to fetch more tokens.
-		need_more_tokens := false
-
-		if parser.tokens_head == len(parser.tokens) {
-			// Queue is empty.
-			need_more_tokens = true
-		} else {
-			// Check if any potential simple key may occupy the head position.
-			if !yaml_parser_stale_simple_keys(parser) {
-				return false
-			}
-
-			for i := range parser.simple_keys {
-				simple_key := &parser.simple_keys[i]
-				if simple_key.possible && simple_key.token_number == parser.tokens_parsed {
-					need_more_tokens = true
-					break
-				}
-			}
-		}
-
-		// We are finished.
-		if !need_more_tokens {
-			break
-		}
-		// Fetch the next token.
-		if !yaml_parser_fetch_next_token(parser) {
-			return false
-		}
-	}
-
-	parser.token_available = true
-	return true
-}
-
-// The dispatcher for token fetchers.
-func yaml_parser_fetch_next_token(parser *yaml_parser_t) bool {
-	// Ensure that the buffer is initialized.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-
-	// Check if we just started scanning.  Fetch STREAM-START then.
-	if !parser.stream_start_produced {
-		return yaml_parser_fetch_stream_start(parser)
-	}
-
-	// Eat whitespaces and comments until we reach the next token.
-	if !yaml_parser_scan_to_next_token(parser) {
-		return false
-	}
-
-	// Remove obsolete potential simple keys.
-	if !yaml_parser_stale_simple_keys(parser) {
-		return false
-	}
-
-	// Check the indentation level against the current column.
-	if !yaml_parser_unroll_indent(parser, parser.mark.column) {
-		return false
-	}
-
-	// Ensure that the buffer contains at least 4 characters.  4 is the length
-	// of the longest indicators ('--- ' and '... ').
-	if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {
-		return false
-	}
-
-	// Is it the end of the stream?
-	if is_z(parser.buffer, parser.buffer_pos) {
-		return yaml_parser_fetch_stream_end(parser)
-	}
-
-	// Is it a directive?
-	if parser.mark.column == 0 && parser.buffer[parser.buffer_pos] == '%' {
-		return yaml_parser_fetch_directive(parser)
-	}
-
-	buf := parser.buffer
-	pos := parser.buffer_pos
-
-	// Is it the document start indicator?
-	if parser.mark.column == 0 && buf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' && is_blankz(buf, pos+3) {
-		return yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_START_TOKEN)
-	}
-
-	// Is it the document end indicator?
-	if parser.mark.column == 0 && buf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' && is_blankz(buf, pos+3) {
-		return yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_END_TOKEN)
-	}
-
-	// Is it the flow sequence start indicator?
-	if buf[pos] == '[' {
-		return yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_SEQUENCE_START_TOKEN)
-	}
-
-	// Is it the flow mapping start indicator?
-	if parser.buffer[parser.buffer_pos] == '{' {
-		return yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_MAPPING_START_TOKEN)
-	}
-
-	// Is it the flow sequence end indicator?
-	if parser.buffer[parser.buffer_pos] == ']' {
-		return yaml_parser_fetch_flow_collection_end(parser,
-			yaml_FLOW_SEQUENCE_END_TOKEN)
-	}
-
-	// Is it the flow mapping end indicator?
-	if parser.buffer[parser.buffer_pos] == '}' {
-		return yaml_parser_fetch_flow_collection_end(parser,
-			yaml_FLOW_MAPPING_END_TOKEN)
-	}
-
-	// Is it the flow entry indicator?
-	if parser.buffer[parser.buffer_pos] == ',' {
-		return yaml_parser_fetch_flow_entry(parser)
-	}
-
-	// Is it the block entry indicator?
-	if parser.buffer[parser.buffer_pos] == '-' && is_blankz(parser.buffer, parser.buffer_pos+1) {
-		return yaml_parser_fetch_block_entry(parser)
-	}
-
-	// Is it the key indicator?
-	if parser.buffer[parser.buffer_pos] == '?' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) {
-		return yaml_parser_fetch_key(parser)
-	}
-
-	// Is it the value indicator?
-	if parser.buffer[parser.buffer_pos] == ':' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) {
-		return yaml_parser_fetch_value(parser)
-	}
-
-	// Is it an alias?
-	if parser.buffer[parser.buffer_pos] == '*' {
-		return yaml_parser_fetch_anchor(parser, yaml_ALIAS_TOKEN)
-	}
-
-	// Is it an anchor?
-	if parser.buffer[parser.buffer_pos] == '&' {
-		return yaml_parser_fetch_anchor(parser, yaml_ANCHOR_TOKEN)
-	}
-
-	// Is it a tag?
-	if parser.buffer[parser.buffer_pos] == '!' {
-		return yaml_parser_fetch_tag(parser)
-	}
-
-	// Is it a literal scalar?
-	if parser.buffer[parser.buffer_pos] == '|' && parser.flow_level == 0 {
-		return yaml_parser_fetch_block_scalar(parser, true)
-	}
-
-	// Is it a folded scalar?
-	if parser.buffer[parser.buffer_pos] == '>' && parser.flow_level == 0 {
-		return yaml_parser_fetch_block_scalar(parser, false)
-	}
-
-	// Is it a single-quoted scalar?
-	if parser.buffer[parser.buffer_pos] == '\'' {
-		return yaml_parser_fetch_flow_scalar(parser, true)
-	}
-
-	// Is it a double-quoted scalar?
-	if parser.buffer[parser.buffer_pos] == '"' {
-		return yaml_parser_fetch_flow_scalar(parser, false)
-	}
-
-	// Is it a plain scalar?
-	//
-	// A plain scalar may start with any non-blank characters except
-	//
-	//      '-', '?', ':', ',', '[', ']', '{', '}',
-	//      '#', '&', '*', '!', '|', '>', '\'', '\"',
-	//      '%', '@', '`'.
-	//
-	// In the block context (and, for the '-' indicator, in the flow context
-	// too), it may also start with the characters
-	//
-	//      '-', '?', ':'
-	//
-	// if it is followed by a non-space character.
-	//
-	// The last rule is more restrictive than the specification requires.
-	// [Go] Make this logic more reasonable.
-	//switch parser.buffer[parser.buffer_pos] {
-	//case '-', '?', ':', ',', '?', '-', ',', ':', ']', '[', '}', '{', '&', '#', '!', '*', '>', '|', '"', '\'', '@', '%', '-', '`':
-	//}
-	if !(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '-' ||
-		parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':' ||
-		parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '[' ||
-		parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' ||
-		parser.buffer[parser.buffer_pos] == '}' || parser.buffer[parser.buffer_pos] == '#' ||
-		parser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '*' ||
-		parser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '|' ||
-		parser.buffer[parser.buffer_pos] == '>' || parser.buffer[parser.buffer_pos] == '\'' ||
-		parser.buffer[parser.buffer_pos] == '"' || parser.buffer[parser.buffer_pos] == '%' ||
-		parser.buffer[parser.buffer_pos] == '@' || parser.buffer[parser.buffer_pos] == '`') ||
-		(parser.buffer[parser.buffer_pos] == '-' && !is_blank(parser.buffer, parser.buffer_pos+1)) ||
-		(parser.flow_level == 0 &&
-			(parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':') &&
-			!is_blankz(parser.buffer, parser.buffer_pos+1)) {
-		return yaml_parser_fetch_plain_scalar(parser)
-	}
-
-	// If we don't determine the token type so far, it is an error.
-	return yaml_parser_set_scanner_error(parser,
-		"while scanning for the next token", parser.mark,
-		"found character that cannot start any token")
-}
-
-// Check the list of potential simple keys and remove the positions that
-// cannot contain simple keys anymore.
-func yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool {
-	// Check for a potential simple key for each flow level.
-	for i := range parser.simple_keys {
-		simple_key := &parser.simple_keys[i]
-
-		// The specification requires that a simple key
-		//
-		//  - is limited to a single line,
-		//  - is shorter than 1024 characters.
-		if simple_key.possible && (simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index) {
-
-			// Check if the potential simple key to be removed is required.
-			if simple_key.required {
-				return yaml_parser_set_scanner_error(parser,
-					"while scanning a simple key", simple_key.mark,
-					"could not find expected ':'")
-			}
-			simple_key.possible = false
-		}
-	}
-	return true
-}
-
-// Check if a simple key may start at the current position and add it if
-// needed.
-func yaml_parser_save_simple_key(parser *yaml_parser_t) bool {
-	// A simple key is required at the current position if the scanner is in
-	// the block context and the current column coincides with the indentation
-	// level.
-
-	required := parser.flow_level == 0 && parser.indent == parser.mark.column
-
-	// A simple key is required only when it is the first token in the current
-	// line.  Therefore it is always allowed.  But we add a check anyway.
-	if required && !parser.simple_key_allowed {
-		panic("should not happen")
-	}
-
-	//
-	// If the current position may start a simple key, save it.
-	//
-	if parser.simple_key_allowed {
-		simple_key := yaml_simple_key_t{
-			possible:     true,
-			required:     required,
-			token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),
-		}
-		simple_key.mark = parser.mark
-
-		if !yaml_parser_remove_simple_key(parser) {
-			return false
-		}
-		parser.simple_keys[len(parser.simple_keys)-1] = simple_key
-	}
-	return true
-}
-
-// Remove a potential simple key at the current flow level.
-func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool {
-	i := len(parser.simple_keys) - 1
-	if parser.simple_keys[i].possible {
-		// If the key is required, it is an error.
-		if parser.simple_keys[i].required {
-			return yaml_parser_set_scanner_error(parser,
-				"while scanning a simple key", parser.simple_keys[i].mark,
-				"could not find expected ':'")
-		}
-	}
-	// Remove the key from the stack.
-	parser.simple_keys[i].possible = false
-	return true
-}
-
-// Increase the flow level and resize the simple key list if needed.
-func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
-	// Reset the simple key on the next level.
-	parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})
-
-	// Increase the flow level.
-	parser.flow_level++
-	return true
-}
-
-// Decrease the flow level.
-func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {
-	if parser.flow_level > 0 {
-		parser.flow_level--
-		parser.simple_keys = parser.simple_keys[:len(parser.simple_keys)-1]
-	}
-	return true
-}
-
-// Push the current indentation level to the stack and set the new level
-// the current column is greater than the indentation level.  In this case,
-// append or insert the specified token into the token queue.
-func yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml_token_type_t, mark yaml_mark_t) bool {
-	// In the flow context, do nothing.
-	if parser.flow_level > 0 {
-		return true
-	}
-
-	if parser.indent < column {
-		// Push the current indentation level to the stack and set the new
-		// indentation level.
-		parser.indents = append(parser.indents, parser.indent)
-		parser.indent = column
-
-		// Create a token and insert it into the queue.
-		token := yaml_token_t{
-			typ:        typ,
-			start_mark: mark,
-			end_mark:   mark,
-		}
-		if number > -1 {
-			number -= parser.tokens_parsed
-		}
-		yaml_insert_token(parser, number, &token)
-	}
-	return true
-}
-
-// Pop indentation levels from the indents stack until the current level
-// becomes less or equal to the column.  For each intendation level, append
-// the BLOCK-END token.
-func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool {
-	// In the flow context, do nothing.
-	if parser.flow_level > 0 {
-		return true
-	}
-
-	// Loop through the intendation levels in the stack.
-	for parser.indent > column {
-		// Create a token and append it to the queue.
-		token := yaml_token_t{
-			typ:        yaml_BLOCK_END_TOKEN,
-			start_mark: parser.mark,
-			end_mark:   parser.mark,
-		}
-		yaml_insert_token(parser, -1, &token)
-
-		// Pop the indentation level.
-		parser.indent = parser.indents[len(parser.indents)-1]
-		parser.indents = parser.indents[:len(parser.indents)-1]
-	}
-	return true
-}
-
-// Initialize the scanner and produce the STREAM-START token.
-func yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool {
-
-	// Set the initial indentation.
-	parser.indent = -1
-
-	// Initialize the simple key stack.
-	parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})
-
-	// A simple key is allowed at the beginning of the stream.
-	parser.simple_key_allowed = true
-
-	// We have started.
-	parser.stream_start_produced = true
-
-	// Create the STREAM-START token and append it to the queue.
-	token := yaml_token_t{
-		typ:        yaml_STREAM_START_TOKEN,
-		start_mark: parser.mark,
-		end_mark:   parser.mark,
-		encoding:   parser.encoding,
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the STREAM-END token and shut down the scanner.
-func yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool {
-
-	// Force new line.
-	if parser.mark.column != 0 {
-		parser.mark.column = 0
-		parser.mark.line++
-	}
-
-	// Reset the indentation level.
-	if !yaml_parser_unroll_indent(parser, -1) {
-		return false
-	}
-
-	// Reset simple keys.
-	if !yaml_parser_remove_simple_key(parser) {
-		return false
-	}
-
-	parser.simple_key_allowed = false
-
-	// Create the STREAM-END token and append it to the queue.
-	token := yaml_token_t{
-		typ:        yaml_STREAM_END_TOKEN,
-		start_mark: parser.mark,
-		end_mark:   parser.mark,
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token.
-func yaml_parser_fetch_directive(parser *yaml_parser_t) bool {
-	// Reset the indentation level.
-	if !yaml_parser_unroll_indent(parser, -1) {
-		return false
-	}
-
-	// Reset simple keys.
-	if !yaml_parser_remove_simple_key(parser) {
-		return false
-	}
-
-	parser.simple_key_allowed = false
-
-	// Create the YAML-DIRECTIVE or TAG-DIRECTIVE token.
-	token := yaml_token_t{}
-	if !yaml_parser_scan_directive(parser, &token) {
-		return false
-	}
-	// Append the token to the queue.
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the DOCUMENT-START or DOCUMENT-END token.
-func yaml_parser_fetch_document_indicator(parser *yaml_parser_t, typ yaml_token_type_t) bool {
-	// Reset the indentation level.
-	if !yaml_parser_unroll_indent(parser, -1) {
-		return false
-	}
-
-	// Reset simple keys.
-	if !yaml_parser_remove_simple_key(parser) {
-		return false
-	}
-
-	parser.simple_key_allowed = false
-
-	// Consume the token.
-	start_mark := parser.mark
-
-	skip(parser)
-	skip(parser)
-	skip(parser)
-
-	end_mark := parser.mark
-
-	// Create the DOCUMENT-START or DOCUMENT-END token.
-	token := yaml_token_t{
-		typ:        typ,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-	}
-	// Append the token to the queue.
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token.
-func yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t, typ yaml_token_type_t) bool {
-	// The indicators '[' and '{' may start a simple key.
-	if !yaml_parser_save_simple_key(parser) {
-		return false
-	}
-
-	// Increase the flow level.
-	if !yaml_parser_increase_flow_level(parser) {
-		return false
-	}
-
-	// A simple key may follow the indicators '[' and '{'.
-	parser.simple_key_allowed = true
-
-	// Consume the token.
-	start_mark := parser.mark
-	skip(parser)
-	end_mark := parser.mark
-
-	// Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token.
-	token := yaml_token_t{
-		typ:        typ,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-	}
-	// Append the token to the queue.
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token.
-func yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t, typ yaml_token_type_t) bool {
-	// Reset any potential simple key on the current flow level.
-	if !yaml_parser_remove_simple_key(parser) {
-		return false
-	}
-
-	// Decrease the flow level.
-	if !yaml_parser_decrease_flow_level(parser) {
-		return false
-	}
-
-	// No simple keys after the indicators ']' and '}'.
-	parser.simple_key_allowed = false
-
-	// Consume the token.
-
-	start_mark := parser.mark
-	skip(parser)
-	end_mark := parser.mark
-
-	// Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token.
-	token := yaml_token_t{
-		typ:        typ,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-	}
-	// Append the token to the queue.
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the FLOW-ENTRY token.
-func yaml_parser_fetch_flow_entry(parser *yaml_parser_t) bool {
-	// Reset any potential simple keys on the current flow level.
-	if !yaml_parser_remove_simple_key(parser) {
-		return false
-	}
-
-	// Simple keys are allowed after ','.
-	parser.simple_key_allowed = true
-
-	// Consume the token.
-	start_mark := parser.mark
-	skip(parser)
-	end_mark := parser.mark
-
-	// Create the FLOW-ENTRY token and append it to the queue.
-	token := yaml_token_t{
-		typ:        yaml_FLOW_ENTRY_TOKEN,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the BLOCK-ENTRY token.
-func yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool {
-	// Check if the scanner is in the block context.
-	if parser.flow_level == 0 {
-		// Check if we are allowed to start a new entry.
-		if !parser.simple_key_allowed {
-			return yaml_parser_set_scanner_error(parser, "", parser.mark,
-				"block sequence entries are not allowed in this context")
-		}
-		// Add the BLOCK-SEQUENCE-START token if needed.
-		if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_SEQUENCE_START_TOKEN, parser.mark) {
-			return false
-		}
-	} else {
-		// It is an error for the '-' indicator to occur in the flow context,
-		// but we let the Parser detect and report about it because the Parser
-		// is able to point to the context.
-	}
-
-	// Reset any potential simple keys on the current flow level.
-	if !yaml_parser_remove_simple_key(parser) {
-		return false
-	}
-
-	// Simple keys are allowed after '-'.
-	parser.simple_key_allowed = true
-
-	// Consume the token.
-	start_mark := parser.mark
-	skip(parser)
-	end_mark := parser.mark
-
-	// Create the BLOCK-ENTRY token and append it to the queue.
-	token := yaml_token_t{
-		typ:        yaml_BLOCK_ENTRY_TOKEN,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the KEY token.
-func yaml_parser_fetch_key(parser *yaml_parser_t) bool {
-
-	// In the block context, additional checks are required.
-	if parser.flow_level == 0 {
-		// Check if we are allowed to start a new key (not nessesary simple).
-		if !parser.simple_key_allowed {
-			return yaml_parser_set_scanner_error(parser, "", parser.mark,
-				"mapping keys are not allowed in this context")
-		}
-		// Add the BLOCK-MAPPING-START token if needed.
-		if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) {
-			return false
-		}
-	}
-
-	// Reset any potential simple keys on the current flow level.
-	if !yaml_parser_remove_simple_key(parser) {
-		return false
-	}
-
-	// Simple keys are allowed after '?' in the block context.
-	parser.simple_key_allowed = parser.flow_level == 0
-
-	// Consume the token.
-	start_mark := parser.mark
-	skip(parser)
-	end_mark := parser.mark
-
-	// Create the KEY token and append it to the queue.
-	token := yaml_token_t{
-		typ:        yaml_KEY_TOKEN,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the VALUE token.
-func yaml_parser_fetch_value(parser *yaml_parser_t) bool {
-
-	simple_key := &parser.simple_keys[len(parser.simple_keys)-1]
-
-	// Have we found a simple key?
-	if simple_key.possible {
-		// Create the KEY token and insert it into the queue.
-		token := yaml_token_t{
-			typ:        yaml_KEY_TOKEN,
-			start_mark: simple_key.mark,
-			end_mark:   simple_key.mark,
-		}
-		yaml_insert_token(parser, simple_key.token_number-parser.tokens_parsed, &token)
-
-		// In the block context, we may need to add the BLOCK-MAPPING-START token.
-		if !yaml_parser_roll_indent(parser, simple_key.mark.column,
-			simple_key.token_number,
-			yaml_BLOCK_MAPPING_START_TOKEN, simple_key.mark) {
-			return false
-		}
-
-		// Remove the simple key.
-		simple_key.possible = false
-
-		// A simple key cannot follow another simple key.
-		parser.simple_key_allowed = false
-
-	} else {
-		// The ':' indicator follows a complex key.
-
-		// In the block context, extra checks are required.
-		if parser.flow_level == 0 {
-
-			// Check if we are allowed to start a complex value.
-			if !parser.simple_key_allowed {
-				return yaml_parser_set_scanner_error(parser, "", parser.mark,
-					"mapping values are not allowed in this context")
-			}
-
-			// Add the BLOCK-MAPPING-START token if needed.
-			if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) {
-				return false
-			}
-		}
-
-		// Simple keys after ':' are allowed in the block context.
-		parser.simple_key_allowed = parser.flow_level == 0
-	}
-
-	// Consume the token.
-	start_mark := parser.mark
-	skip(parser)
-	end_mark := parser.mark
-
-	// Create the VALUE token and append it to the queue.
-	token := yaml_token_t{
-		typ:        yaml_VALUE_TOKEN,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the ALIAS or ANCHOR token.
-func yaml_parser_fetch_anchor(parser *yaml_parser_t, typ yaml_token_type_t) bool {
-	// An anchor or an alias could be a simple key.
-	if !yaml_parser_save_simple_key(parser) {
-		return false
-	}
-
-	// A simple key cannot follow an anchor or an alias.
-	parser.simple_key_allowed = false
-
-	// Create the ALIAS or ANCHOR token and append it to the queue.
-	var token yaml_token_t
-	if !yaml_parser_scan_anchor(parser, &token, typ) {
-		return false
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the TAG token.
-func yaml_parser_fetch_tag(parser *yaml_parser_t) bool {
-	// A tag could be a simple key.
-	if !yaml_parser_save_simple_key(parser) {
-		return false
-	}
-
-	// A simple key cannot follow a tag.
-	parser.simple_key_allowed = false
-
-	// Create the TAG token and append it to the queue.
-	var token yaml_token_t
-	if !yaml_parser_scan_tag(parser, &token) {
-		return false
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens.
-func yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool) bool {
-	// Remove any potential simple keys.
-	if !yaml_parser_remove_simple_key(parser) {
-		return false
-	}
-
-	// A simple key may follow a block scalar.
-	parser.simple_key_allowed = true
-
-	// Create the SCALAR token and append it to the queue.
-	var token yaml_token_t
-	if !yaml_parser_scan_block_scalar(parser, &token, literal) {
-		return false
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens.
-func yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) bool {
-	// A plain scalar could be a simple key.
-	if !yaml_parser_save_simple_key(parser) {
-		return false
-	}
-
-	// A simple key cannot follow a flow scalar.
-	parser.simple_key_allowed = false
-
-	// Create the SCALAR token and append it to the queue.
-	var token yaml_token_t
-	if !yaml_parser_scan_flow_scalar(parser, &token, single) {
-		return false
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Produce the SCALAR(...,plain) token.
-func yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool {
-	// A plain scalar could be a simple key.
-	if !yaml_parser_save_simple_key(parser) {
-		return false
-	}
-
-	// A simple key cannot follow a flow scalar.
-	parser.simple_key_allowed = false
-
-	// Create the SCALAR token and append it to the queue.
-	var token yaml_token_t
-	if !yaml_parser_scan_plain_scalar(parser, &token) {
-		return false
-	}
-	yaml_insert_token(parser, -1, &token)
-	return true
-}
-
-// Eat whitespaces and comments until the next token is found.
-func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool {
-
-	// Until the next token is not found.
-	for {
-		// Allow the BOM mark to start a line.
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-		if parser.mark.column == 0 && is_bom(parser.buffer, parser.buffer_pos) {
-			skip(parser)
-		}
-
-		// Eat whitespaces.
-		// Tabs are allowed:
-		//  - in the flow context
-		//  - in the block context, but not at the beginning of the line or
-		//  after '-', '?', or ':' (complex value).
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-
-		for parser.buffer[parser.buffer_pos] == ' ' || ((parser.flow_level > 0 || !parser.simple_key_allowed) && parser.buffer[parser.buffer_pos] == '\t') {
-			skip(parser)
-			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-				return false
-			}
-		}
-
-		// Eat a comment until a line break.
-		if parser.buffer[parser.buffer_pos] == '#' {
-			for !is_breakz(parser.buffer, parser.buffer_pos) {
-				skip(parser)
-				if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-					return false
-				}
-			}
-		}
-
-		// If it is a line break, eat it.
-		if is_break(parser.buffer, parser.buffer_pos) {
-			if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
-				return false
-			}
-			skip_line(parser)
-
-			// In the block context, a new line may start a simple key.
-			if parser.flow_level == 0 {
-				parser.simple_key_allowed = true
-			}
-		} else {
-			break // We have found a token.
-		}
-	}
-
-	return true
-}
-
-// Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token.
-//
-// Scope:
-//      %YAML    1.1    # a comment \n
-//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-//      %TAG    !yaml!  tag:yaml.org,2002:  \n
-//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-//
-func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool {
-	// Eat '%'.
-	start_mark := parser.mark
-	skip(parser)
-
-	// Scan the directive name.
-	var name []byte
-	if !yaml_parser_scan_directive_name(parser, start_mark, &name) {
-		return false
-	}
-
-	// Is it a YAML directive?
-	if bytes.Equal(name, []byte("YAML")) {
-		// Scan the VERSION directive value.
-		var major, minor int8
-		if !yaml_parser_scan_version_directive_value(parser, start_mark, &major, &minor) {
-			return false
-		}
-		end_mark := parser.mark
-
-		// Create a VERSION-DIRECTIVE token.
-		*token = yaml_token_t{
-			typ:        yaml_VERSION_DIRECTIVE_TOKEN,
-			start_mark: start_mark,
-			end_mark:   end_mark,
-			major:      major,
-			minor:      minor,
-		}
-
-		// Is it a TAG directive?
-	} else if bytes.Equal(name, []byte("TAG")) {
-		// Scan the TAG directive value.
-		var handle, prefix []byte
-		if !yaml_parser_scan_tag_directive_value(parser, start_mark, &handle, &prefix) {
-			return false
-		}
-		end_mark := parser.mark
-
-		// Create a TAG-DIRECTIVE token.
-		*token = yaml_token_t{
-			typ:        yaml_TAG_DIRECTIVE_TOKEN,
-			start_mark: start_mark,
-			end_mark:   end_mark,
-			value:      handle,
-			prefix:     prefix,
-		}
-
-		// Unknown directive.
-	} else {
-		yaml_parser_set_scanner_error(parser, "while scanning a directive",
-			start_mark, "found uknown directive name")
-		return false
-	}
-
-	// Eat the rest of the line including any comments.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-
-	for is_blank(parser.buffer, parser.buffer_pos) {
-		skip(parser)
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-	}
-
-	if parser.buffer[parser.buffer_pos] == '#' {
-		for !is_breakz(parser.buffer, parser.buffer_pos) {
-			skip(parser)
-			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-				return false
-			}
-		}
-	}
-
-	// Check if we are at the end of the line.
-	if !is_breakz(parser.buffer, parser.buffer_pos) {
-		yaml_parser_set_scanner_error(parser, "while scanning a directive",
-			start_mark, "did not find expected comment or line break")
-		return false
-	}
-
-	// Eat a line break.
-	if is_break(parser.buffer, parser.buffer_pos) {
-		if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
-			return false
-		}
-		skip_line(parser)
-	}
-
-	return true
-}
-
-// Scan the directive name.
-//
-// Scope:
-//      %YAML   1.1     # a comment \n
-//       ^^^^
-//      %TAG    !yaml!  tag:yaml.org,2002:  \n
-//       ^^^
-//
-func yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark_t, name *[]byte) bool {
-	// Consume the directive name.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-
-	var s []byte
-	for is_alpha(parser.buffer, parser.buffer_pos) {
-		s = read(parser, s)
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-	}
-
-	// Check if the name is empty.
-	if len(s) == 0 {
-		yaml_parser_set_scanner_error(parser, "while scanning a directive",
-			start_mark, "could not find expected directive name")
-		return false
-	}
-
-	// Check for an blank character after the name.
-	if !is_blankz(parser.buffer, parser.buffer_pos) {
-		yaml_parser_set_scanner_error(parser, "while scanning a directive",
-			start_mark, "found unexpected non-alphabetical character")
-		return false
-	}
-	*name = s
-	return true
-}
-
-// Scan the value of VERSION-DIRECTIVE.
-//
-// Scope:
-//      %YAML   1.1     # a comment \n
-//           ^^^^^^
-func yaml_parser_scan_version_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, major, minor *int8) bool {
-	// Eat whitespaces.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-	for is_blank(parser.buffer, parser.buffer_pos) {
-		skip(parser)
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-	}
-
-	// Consume the major version number.
-	if !yaml_parser_scan_version_directive_number(parser, start_mark, major) {
-		return false
-	}
-
-	// Eat '.'.
-	if parser.buffer[parser.buffer_pos] != '.' {
-		return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive",
-			start_mark, "did not find expected digit or '.' character")
-	}
-
-	skip(parser)
-
-	// Consume the minor version number.
-	if !yaml_parser_scan_version_directive_number(parser, start_mark, minor) {
-		return false
-	}
-	return true
-}
-
-const max_number_length = 2
-
-// Scan the version number of VERSION-DIRECTIVE.
-//
-// Scope:
-//      %YAML   1.1     # a comment \n
-//              ^
-//      %YAML   1.1     # a comment \n
-//                ^
-func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark yaml_mark_t, number *int8) bool {
-
-	// Repeat while the next character is digit.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-	var value, length int8
-	for is_digit(parser.buffer, parser.buffer_pos) {
-		// Check if the number is too long.
-		length++
-		if length > max_number_length {
-			return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive",
-				start_mark, "found extremely long version number")
-		}
-		value = value*10 + int8(as_digit(parser.buffer, parser.buffer_pos))
-		skip(parser)
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-	}
-
-	// Check if the number was present.
-	if length == 0 {
-		return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive",
-			start_mark, "did not find expected version number")
-	}
-	*number = value
-	return true
-}
-
-// Scan the value of a TAG-DIRECTIVE token.
-//
-// Scope:
-//      %TAG    !yaml!  tag:yaml.org,2002:  \n
-//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-//
-func yaml_parser_scan_tag_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, handle, prefix *[]byte) bool {
-	var handle_value, prefix_value []byte
-
-	// Eat whitespaces.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-
-	for is_blank(parser.buffer, parser.buffer_pos) {
-		skip(parser)
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-	}
-
-	// Scan a handle.
-	if !yaml_parser_scan_tag_handle(parser, true, start_mark, &handle_value) {
-		return false
-	}
-
-	// Expect a whitespace.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-	if !is_blank(parser.buffer, parser.buffer_pos) {
-		yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive",
-			start_mark, "did not find expected whitespace")
-		return false
-	}
-
-	// Eat whitespaces.
-	for is_blank(parser.buffer, parser.buffer_pos) {
-		skip(parser)
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-	}
-
-	// Scan a prefix.
-	if !yaml_parser_scan_tag_uri(parser, true, nil, start_mark, &prefix_value) {
-		return false
-	}
-
-	// Expect a whitespace or line break.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-	if !is_blankz(parser.buffer, parser.buffer_pos) {
-		yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive",
-			start_mark, "did not find expected whitespace or line break")
-		return false
-	}
-
-	*handle = handle_value
-	*prefix = prefix_value
-	return true
-}
-
-func yaml_parser_scan_anchor(parser *yaml_parser_t, token *yaml_token_t, typ yaml_token_type_t) bool {
-	var s []byte
-
-	// Eat the indicator character.
-	start_mark := parser.mark
-	skip(parser)
-
-	// Consume the value.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-
-	for is_alpha(parser.buffer, parser.buffer_pos) {
-		s = read(parser, s)
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-	}
-
-	end_mark := parser.mark
-
-	/*
-	 * Check if length of the anchor is greater than 0 and it is followed by
-	 * a whitespace character or one of the indicators:
-	 *
-	 *      '?', ':', ',', ']', '}', '%', '@', '`'.
-	 */
-
-	if len(s) == 0 ||
-		!(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '?' ||
-			parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == ',' ||
-			parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '}' ||
-			parser.buffer[parser.buffer_pos] == '%' || parser.buffer[parser.buffer_pos] == '@' ||
-			parser.buffer[parser.buffer_pos] == '`') {
-		context := "while scanning an alias"
-		if typ == yaml_ANCHOR_TOKEN {
-			context = "while scanning an anchor"
-		}
-		yaml_parser_set_scanner_error(parser, context, start_mark,
-			"did not find expected alphabetic or numeric character")
-		return false
-	}
-
-	// Create a token.
-	*token = yaml_token_t{
-		typ:        typ,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-		value:      s,
-	}
-
-	return true
-}
-
-/*
- * Scan a TAG token.
- */
-
-func yaml_parser_scan_tag(parser *yaml_parser_t, token *yaml_token_t) bool {
-	var handle, suffix []byte
-
-	start_mark := parser.mark
-
-	// Check if the tag is in the canonical form.
-	if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
-		return false
-	}
-
-	if parser.buffer[parser.buffer_pos+1] == '<' {
-		// Keep the handle as ''
-
-		// Eat '!<'
-		skip(parser)
-		skip(parser)
-
-		// Consume the tag value.
-		if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) {
-			return false
-		}
-
-		// Check for '>' and eat it.
-		if parser.buffer[parser.buffer_pos] != '>' {
-			yaml_parser_set_scanner_error(parser, "while scanning a tag",
-				start_mark, "did not find the expected '>'")
-			return false
-		}
-
-		skip(parser)
-	} else {
-		// The tag has either the '!suffix' or the '!handle!suffix' form.
-
-		// First, try to scan a handle.
-		if !yaml_parser_scan_tag_handle(parser, false, start_mark, &handle) {
-			return false
-		}
-
-		// Check if it is, indeed, handle.
-		if handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' {
-			// Scan the suffix now.
-			if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) {
-				return false
-			}
-		} else {
-			// It wasn't a handle after all.  Scan the rest of the tag.
-			if !yaml_parser_scan_tag_uri(parser, false, handle, start_mark, &suffix) {
-				return false
-			}
-
-			// Set the handle to '!'.
-			handle = []byte{'!'}
-
-			// A special case: the '!' tag.  Set the handle to '' and the
-			// suffix to '!'.
-			if len(suffix) == 0 {
-				handle, suffix = suffix, handle
-			}
-		}
-	}
-
-	// Check the character which ends the tag.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-	if !is_blankz(parser.buffer, parser.buffer_pos) {
-		yaml_parser_set_scanner_error(parser, "while scanning a tag",
-			start_mark, "did not find expected whitespace or line break")
-		return false
-	}
-
-	end_mark := parser.mark
-
-	// Create a token.
-	*token = yaml_token_t{
-		typ:        yaml_TAG_TOKEN,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-		value:      handle,
-		suffix:     suffix,
-	}
-	return true
-}
-
-// Scan a tag handle.
-func yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, handle *[]byte) bool {
-	// Check the initial '!' character.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-	if parser.buffer[parser.buffer_pos] != '!' {
-		yaml_parser_set_scanner_tag_error(parser, directive,
-			start_mark, "did not find expected '!'")
-		return false
-	}
-
-	var s []byte
-
-	// Copy the '!' character.
-	s = read(parser, s)
-
-	// Copy all subsequent alphabetical and numerical characters.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-	for is_alpha(parser.buffer, parser.buffer_pos) {
-		s = read(parser, s)
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-	}
-
-	// Check if the trailing character is '!' and copy it.
-	if parser.buffer[parser.buffer_pos] == '!' {
-		s = read(parser, s)
-	} else {
-		// It's either the '!' tag or not really a tag handle.  If it's a %TAG
-		// directive, it's an error.  If it's a tag token, it must be a part of URI.
-		if directive && !(s[0] == '!' && s[1] == 0) {
-			yaml_parser_set_scanner_tag_error(parser, directive,
-				start_mark, "did not find expected '!'")
-			return false
-		}
-	}
-
-	*handle = s
-	return true
-}
-
-// Scan a tag.
-func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte, start_mark yaml_mark_t, uri *[]byte) bool {
-	//size_t length = head ? strlen((char *)head) : 0
-	var s []byte
-
-	// Copy the head if needed.
-	//
-	// Note that we don't copy the leading '!' character.
-	if len(head) > 1 {
-		s = append(s, head[1:]...)
-	}
-
-	// Scan the tag.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-
-	// The set of characters that may appear in URI is as follows:
-	//
-	//      '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&',
-	//      '=', '+', '$', ',', '.', '!', '~', '*', '\'', '(', ')', '[', ']',
-	//      '%'.
-	// [Go] Convert this into more reasonable logic.
-	for is_alpha(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == ';' ||
-		parser.buffer[parser.buffer_pos] == '/' || parser.buffer[parser.buffer_pos] == '?' ||
-		parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == '@' ||
-		parser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '=' ||
-		parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '$' ||
-		parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '.' ||
-		parser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '~' ||
-		parser.buffer[parser.buffer_pos] == '*' || parser.buffer[parser.buffer_pos] == '\'' ||
-		parser.buffer[parser.buffer_pos] == '(' || parser.buffer[parser.buffer_pos] == ')' ||
-		parser.buffer[parser.buffer_pos] == '[' || parser.buffer[parser.buffer_pos] == ']' ||
-		parser.buffer[parser.buffer_pos] == '%' {
-		// Check if it is a URI-escape sequence.
-		if parser.buffer[parser.buffer_pos] == '%' {
-			if !yaml_parser_scan_uri_escapes(parser, directive, start_mark, &s) {
-				return false
-			}
-		} else {
-			s = read(parser, s)
-		}
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-	}
-
-	// Check if the tag is non-empty.
-	if len(s) == 0 {
-		yaml_parser_set_scanner_tag_error(parser, directive,
-			start_mark, "did not find expected tag URI")
-		return false
-	}
-	*uri = s
-	return true
-}
-
-// Decode an URI-escape sequence corresponding to a single UTF-8 character.
-func yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, s *[]byte) bool {
-
-	// Decode the required number of characters.
-	w := 1024
-	for w > 0 {
-		// Check for a URI-escaped octet.
-		if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) {
-			return false
-		}
-
-		if !(parser.buffer[parser.buffer_pos] == '%' &&
-			is_hex(parser.buffer, parser.buffer_pos+1) &&
-			is_hex(parser.buffer, parser.buffer_pos+2)) {
-			return yaml_parser_set_scanner_tag_error(parser, directive,
-				start_mark, "did not find URI escaped octet")
-		}
-
-		// Get the octet.
-		octet := byte((as_hex(parser.buffer, parser.buffer_pos+1) << 4) + as_hex(parser.buffer, parser.buffer_pos+2))
-
-		// If it is the leading octet, determine the length of the UTF-8 sequence.
-		if w == 1024 {
-			w = width(octet)
-			if w == 0 {
-				return yaml_parser_set_scanner_tag_error(parser, directive,
-					start_mark, "found an incorrect leading UTF-8 octet")
-			}
-		} else {
-			// Check if the trailing octet is correct.
-			if octet&0xC0 != 0x80 {
-				return yaml_parser_set_scanner_tag_error(parser, directive,
-					start_mark, "found an incorrect trailing UTF-8 octet")
-			}
-		}
-
-		// Copy the octet and move the pointers.
-		*s = append(*s, octet)
-		skip(parser)
-		skip(parser)
-		skip(parser)
-		w--
-	}
-	return true
-}
-
-// Scan a block scalar.
-func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, literal bool) bool {
-	// Eat the indicator '|' or '>'.
-	start_mark := parser.mark
-	skip(parser)
-
-	// Scan the additional block scalar indicators.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-
-	// Check for a chomping indicator.
-	var chomping, increment int
-	if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' {
-		// Set the chomping method and eat the indicator.
-		if parser.buffer[parser.buffer_pos] == '+' {
-			chomping = +1
-		} else {
-			chomping = -1
-		}
-		skip(parser)
-
-		// Check for an indentation indicator.
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-		if is_digit(parser.buffer, parser.buffer_pos) {
-			// Check that the intendation is greater than 0.
-			if parser.buffer[parser.buffer_pos] == '0' {
-				yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
-					start_mark, "found an intendation indicator equal to 0")
-				return false
-			}
-
-			// Get the intendation level and eat the indicator.
-			increment = as_digit(parser.buffer, parser.buffer_pos)
-			skip(parser)
-		}
-
-	} else if is_digit(parser.buffer, parser.buffer_pos) {
-		// Do the same as above, but in the opposite order.
-
-		if parser.buffer[parser.buffer_pos] == '0' {
-			yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
-				start_mark, "found an intendation indicator equal to 0")
-			return false
-		}
-		increment = as_digit(parser.buffer, parser.buffer_pos)
-		skip(parser)
-
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-		if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' {
-			if parser.buffer[parser.buffer_pos] == '+' {
-				chomping = +1
-			} else {
-				chomping = -1
-			}
-			skip(parser)
-		}
-	}
-
-	// Eat whitespaces and comments to the end of the line.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-	for is_blank(parser.buffer, parser.buffer_pos) {
-		skip(parser)
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-	}
-	if parser.buffer[parser.buffer_pos] == '#' {
-		for !is_breakz(parser.buffer, parser.buffer_pos) {
-			skip(parser)
-			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-				return false
-			}
-		}
-	}
-
-	// Check if we are at the end of the line.
-	if !is_breakz(parser.buffer, parser.buffer_pos) {
-		yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
-			start_mark, "did not find expected comment or line break")
-		return false
-	}
-
-	// Eat a line break.
-	if is_break(parser.buffer, parser.buffer_pos) {
-		if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
-			return false
-		}
-		skip_line(parser)
-	}
-
-	end_mark := parser.mark
-
-	// Set the intendation level if it was specified.
-	var indent int
-	if increment > 0 {
-		if parser.indent >= 0 {
-			indent = parser.indent + increment
-		} else {
-			indent = increment
-		}
-	}
-
-	// Scan the leading line breaks and determine the indentation level if needed.
-	var s, leading_break, trailing_breaks []byte
-	if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) {
-		return false
-	}
-
-	// Scan the block scalar content.
-	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-		return false
-	}
-	var leading_blank, trailing_blank bool
-	for parser.mark.column == indent && !is_z(parser.buffer, parser.buffer_pos) {
-		// We are at the beginning of a non-empty line.
-
-		// Is it a trailing whitespace?
-		trailing_blank = is_blank(parser.buffer, parser.buffer_pos)
-
-		// Check if we need to fold the leading line break.
-		if !literal && !leading_blank && !trailing_blank && len(leading_break) > 0 && leading_break[0] == '\n' {
-			// Do we need to join the lines by space?
-			if len(trailing_breaks) == 0 {
-				s = append(s, ' ')
-			}
-		} else {
-			s = append(s, leading_break...)
-		}
-		leading_break = leading_break[:0]
-
-		// Append the remaining line breaks.
-		s = append(s, trailing_breaks...)
-		trailing_breaks = trailing_breaks[:0]
-
-		// Is it a leading whitespace?
-		leading_blank = is_blank(parser.buffer, parser.buffer_pos)
-
-		// Consume the current line.
-		for !is_breakz(parser.buffer, parser.buffer_pos) {
-			s = read(parser, s)
-			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-				return false
-			}
-		}
-
-		// Consume the line break.
-		if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
-			return false
-		}
-
-		leading_break = read_line(parser, leading_break)
-
-		// Eat the following intendation spaces and line breaks.
-		if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) {
-			return false
-		}
-	}
-
-	// Chomp the tail.
-	if chomping != -1 {
-		s = append(s, leading_break...)
-	}
-	if chomping == 1 {
-		s = append(s, trailing_breaks...)
-	}
-
-	// Create a token.
-	*token = yaml_token_t{
-		typ:        yaml_SCALAR_TOKEN,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-		value:      s,
-		style:      yaml_LITERAL_SCALAR_STYLE,
-	}
-	if !literal {
-		token.style = yaml_FOLDED_SCALAR_STYLE
-	}
-	return true
-}
-
-// Scan intendation spaces and line breaks for a block scalar.  Determine the
-// intendation level if needed.
-func yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, indent *int, breaks *[]byte, start_mark yaml_mark_t, end_mark *yaml_mark_t) bool {
-	*end_mark = parser.mark
-
-	// Eat the intendation spaces and line breaks.
-	max_indent := 0
-	for {
-		// Eat the intendation spaces.
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-		for (*indent == 0 || parser.mark.column < *indent) && is_space(parser.buffer, parser.buffer_pos) {
-			skip(parser)
-			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-				return false
-			}
-		}
-		if parser.mark.column > max_indent {
-			max_indent = parser.mark.column
-		}
-
-		// Check for a tab character messing the intendation.
-		if (*indent == 0 || parser.mark.column < *indent) && is_tab(parser.buffer, parser.buffer_pos) {
-			return yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
-				start_mark, "found a tab character where an intendation space is expected")
-		}
-
-		// Have we found a non-empty line?
-		if !is_break(parser.buffer, parser.buffer_pos) {
-			break
-		}
-
-		// Consume the line break.
-		if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
-			return false
-		}
-		// [Go] Should really be returning breaks instead.
-		*breaks = read_line(parser, *breaks)
-		*end_mark = parser.mark
-	}
-
-	// Determine the indentation level if needed.
-	if *indent == 0 {
-		*indent = max_indent
-		if *indent < parser.indent+1 {
-			*indent = parser.indent + 1
-		}
-		if *indent < 1 {
-			*indent = 1
-		}
-	}
-	return true
-}
-
-// Scan a quoted scalar.
-func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, single bool) bool {
-	// Eat the left quote.
-	start_mark := parser.mark
-	skip(parser)
-
-	// Consume the content of the quoted scalar.
-	var s, leading_break, trailing_breaks, whitespaces []byte
-	for {
-		// Check that there are no document indicators at the beginning of the line.
-		if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {
-			return false
-		}
-
-		if parser.mark.column == 0 &&
-			((parser.buffer[parser.buffer_pos+0] == '-' &&
-				parser.buffer[parser.buffer_pos+1] == '-' &&
-				parser.buffer[parser.buffer_pos+2] == '-') ||
-				(parser.buffer[parser.buffer_pos+0] == '.' &&
-					parser.buffer[parser.buffer_pos+1] == '.' &&
-					parser.buffer[parser.buffer_pos+2] == '.')) &&
-			is_blankz(parser.buffer, parser.buffer_pos+3) {
-			yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar",
-				start_mark, "found unexpected document indicator")
-			return false
-		}
-
-		// Check for EOF.
-		if is_z(parser.buffer, parser.buffer_pos) {
-			yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar",
-				start_mark, "found unexpected end of stream")
-			return false
-		}
-
-		// Consume non-blank characters.
-		leading_blanks := false
-		for !is_blankz(parser.buffer, parser.buffer_pos) {
-			if single && parser.buffer[parser.buffer_pos] == '\'' && parser.buffer[parser.buffer_pos+1] == '\'' {
-				// Is is an escaped single quote.
-				s = append(s, '\'')
-				skip(parser)
-				skip(parser)
-
-			} else if single && parser.buffer[parser.buffer_pos] == '\'' {
-				// It is a right single quote.
-				break
-			} else if !single && parser.buffer[parser.buffer_pos] == '"' {
-				// It is a right double quote.
-				break
-
-			} else if !single && parser.buffer[parser.buffer_pos] == '\\' && is_break(parser.buffer, parser.buffer_pos+1) {
-				// It is an escaped line break.
-				if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) {
-					return false
-				}
-				skip(parser)
-				skip_line(parser)
-				leading_blanks = true
-				break
-
-			} else if !single && parser.buffer[parser.buffer_pos] == '\\' {
-				// It is an escape sequence.
-				code_length := 0
-
-				// Check the escape character.
-				switch parser.buffer[parser.buffer_pos+1] {
-				case '0':
-					s = append(s, 0)
-				case 'a':
-					s = append(s, '\x07')
-				case 'b':
-					s = append(s, '\x08')
-				case 't', '\t':
-					s = append(s, '\x09')
-				case 'n':
-					s = append(s, '\x0A')
-				case 'v':
-					s = append(s, '\x0B')
-				case 'f':
-					s = append(s, '\x0C')
-				case 'r':
-					s = append(s, '\x0D')
-				case 'e':
-					s = append(s, '\x1B')
-				case ' ':
-					s = append(s, '\x20')
-				case '"':
-					s = append(s, '"')
-				case '\'':
-					s = append(s, '\'')
-				case '\\':
-					s = append(s, '\\')
-				case 'N': // NEL (#x85)
-					s = append(s, '\xC2')
-					s = append(s, '\x85')
-				case '_': // #xA0
-					s = append(s, '\xC2')
-					s = append(s, '\xA0')
-				case 'L': // LS (#x2028)
-					s = append(s, '\xE2')
-					s = append(s, '\x80')
-					s = append(s, '\xA8')
-				case 'P': // PS (#x2029)
-					s = append(s, '\xE2')
-					s = append(s, '\x80')
-					s = append(s, '\xA9')
-				case 'x':
-					code_length = 2
-				case 'u':
-					code_length = 4
-				case 'U':
-					code_length = 8
-				default:
-					yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar",
-						start_mark, "found unknown escape character")
-					return false
-				}
-
-				skip(parser)
-				skip(parser)
-
-				// Consume an arbitrary escape code.
-				if code_length > 0 {
-					var value int
-
-					// Scan the character value.
-					if parser.unread < code_length && !yaml_parser_update_buffer(parser, code_length) {
-						return false
-					}
-					for k := 0; k < code_length; k++ {
-						if !is_hex(parser.buffer, parser.buffer_pos+k) {
-							yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar",
-								start_mark, "did not find expected hexdecimal number")
-							return false
-						}
-						value = (value << 4) + as_hex(parser.buffer, parser.buffer_pos+k)
-					}
-
-					// Check the value and write the character.
-					if (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF {
-						yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar",
-							start_mark, "found invalid Unicode character escape code")
-						return false
-					}
-					if value <= 0x7F {
-						s = append(s, byte(value))
-					} else if value <= 0x7FF {
-						s = append(s, byte(0xC0+(value>>6)))
-						s = append(s, byte(0x80+(value&0x3F)))
-					} else if value <= 0xFFFF {
-						s = append(s, byte(0xE0+(value>>12)))
-						s = append(s, byte(0x80+((value>>6)&0x3F)))
-						s = append(s, byte(0x80+(value&0x3F)))
-					} else {
-						s = append(s, byte(0xF0+(value>>18)))
-						s = append(s, byte(0x80+((value>>12)&0x3F)))
-						s = append(s, byte(0x80+((value>>6)&0x3F)))
-						s = append(s, byte(0x80+(value&0x3F)))
-					}
-
-					// Advance the pointer.
-					for k := 0; k < code_length; k++ {
-						skip(parser)
-					}
-				}
-			} else {
-				// It is a non-escaped non-blank character.
-				s = read(parser, s)
-			}
-			if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
-				return false
-			}
-		}
-
-		// Check if we are at the end of the scalar.
-		if single {
-			if parser.buffer[parser.buffer_pos] == '\'' {
-				break
-			}
-		} else {
-			if parser.buffer[parser.buffer_pos] == '"' {
-				break
-			}
-		}
-
-		// Consume blank characters.
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-
-		for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) {
-			if is_blank(parser.buffer, parser.buffer_pos) {
-				// Consume a space or a tab character.
-				if !leading_blanks {
-					whitespaces = read(parser, whitespaces)
-				} else {
-					skip(parser)
-				}
-			} else {
-				if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
-					return false
-				}
-
-				// Check if it is a first line break.
-				if !leading_blanks {
-					whitespaces = whitespaces[:0]
-					leading_break = read_line(parser, leading_break)
-					leading_blanks = true
-				} else {
-					trailing_breaks = read_line(parser, trailing_breaks)
-				}
-			}
-			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-				return false
-			}
-		}
-
-		// Join the whitespaces or fold line breaks.
-		if leading_blanks {
-			// Do we need to fold line breaks?
-			if len(leading_break) > 0 && leading_break[0] == '\n' {
-				if len(trailing_breaks) == 0 {
-					s = append(s, ' ')
-				} else {
-					s = append(s, trailing_breaks...)
-				}
-			} else {
-				s = append(s, leading_break...)
-				s = append(s, trailing_breaks...)
-			}
-			trailing_breaks = trailing_breaks[:0]
-			leading_break = leading_break[:0]
-		} else {
-			s = append(s, whitespaces...)
-			whitespaces = whitespaces[:0]
-		}
-	}
-
-	// Eat the right quote.
-	skip(parser)
-	end_mark := parser.mark
-
-	// Create a token.
-	*token = yaml_token_t{
-		typ:        yaml_SCALAR_TOKEN,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-		value:      s,
-		style:      yaml_SINGLE_QUOTED_SCALAR_STYLE,
-	}
-	if !single {
-		token.style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
-	}
-	return true
-}
-
-// Scan a plain scalar.
-func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) bool {
-
-	var s, leading_break, trailing_breaks, whitespaces []byte
-	var leading_blanks bool
-	var indent = parser.indent + 1
-
-	start_mark := parser.mark
-	end_mark := parser.mark
-
-	// Consume the content of the plain scalar.
-	for {
-		// Check for a document indicator.
-		if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {
-			return false
-		}
-		if parser.mark.column == 0 &&
-			((parser.buffer[parser.buffer_pos+0] == '-' &&
-				parser.buffer[parser.buffer_pos+1] == '-' &&
-				parser.buffer[parser.buffer_pos+2] == '-') ||
-				(parser.buffer[parser.buffer_pos+0] == '.' &&
-					parser.buffer[parser.buffer_pos+1] == '.' &&
-					parser.buffer[parser.buffer_pos+2] == '.')) &&
-			is_blankz(parser.buffer, parser.buffer_pos+3) {
-			break
-		}
-
-		// Check for a comment.
-		if parser.buffer[parser.buffer_pos] == '#' {
-			break
-		}
-
-		// Consume non-blank characters.
-		for !is_blankz(parser.buffer, parser.buffer_pos) {
-
-			// Check for 'x:x' in the flow context. TODO: Fix the test "spec-08-13".
-			if parser.flow_level > 0 &&
-				parser.buffer[parser.buffer_pos] == ':' &&
-				!is_blankz(parser.buffer, parser.buffer_pos+1) {
-				yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
-					start_mark, "found unexpected ':'")
-				return false
-			}
-
-			// Check for indicators that may end a plain scalar.
-			if (parser.buffer[parser.buffer_pos] == ':' && is_blankz(parser.buffer, parser.buffer_pos+1)) ||
-				(parser.flow_level > 0 &&
-					(parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == ':' ||
-						parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == '[' ||
-						parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' ||
-						parser.buffer[parser.buffer_pos] == '}')) {
-				break
-			}
-
-			// Check if we need to join whitespaces and breaks.
-			if leading_blanks || len(whitespaces) > 0 {
-				if leading_blanks {
-					// Do we need to fold line breaks?
-					if leading_break[0] == '\n' {
-						if len(trailing_breaks) == 0 {
-							s = append(s, ' ')
-						} else {
-							s = append(s, trailing_breaks...)
-						}
-					} else {
-						s = append(s, leading_break...)
-						s = append(s, trailing_breaks...)
-					}
-					trailing_breaks = trailing_breaks[:0]
-					leading_break = leading_break[:0]
-					leading_blanks = false
-				} else {
-					s = append(s, whitespaces...)
-					whitespaces = whitespaces[:0]
-				}
-			}
-
-			// Copy the character.
-			s = read(parser, s)
-
-			end_mark = parser.mark
-			if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
-				return false
-			}
-		}
-
-		// Is it the end?
-		if !(is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos)) {
-			break
-		}
-
-		// Consume blank characters.
-		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-			return false
-		}
-
-		for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) {
-			if is_blank(parser.buffer, parser.buffer_pos) {
-
-				// Check for tab character that abuse intendation.
-				if leading_blanks && parser.mark.column < indent && is_tab(parser.buffer, parser.buffer_pos) {
-					yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
-						start_mark, "found a tab character that violate intendation")
-					return false
-				}
-
-				// Consume a space or a tab character.
-				if !leading_blanks {
-					whitespaces = read(parser, whitespaces)
-				} else {
-					skip(parser)
-				}
-			} else {
-				if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
-					return false
-				}
-
-				// Check if it is a first line break.
-				if !leading_blanks {
-					whitespaces = whitespaces[:0]
-					leading_break = read_line(parser, leading_break)
-					leading_blanks = true
-				} else {
-					trailing_breaks = read_line(parser, trailing_breaks)
-				}
-			}
-			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
-				return false
-			}
-		}
-
-		// Check intendation level.
-		if parser.flow_level == 0 && parser.mark.column < indent {
-			break
-		}
-	}
-
-	// Create a token.
-	*token = yaml_token_t{
-		typ:        yaml_SCALAR_TOKEN,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-		value:      s,
-		style:      yaml_PLAIN_SCALAR_STYLE,
-	}
-
-	// Note that we change the 'simple_key_allowed' flag.
-	if leading_blanks {
-		parser.simple_key_allowed = true
-	}
-	return true
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/sorter.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/sorter.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/sorter.go
deleted file mode 100644
index 5958822..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/sorter.go
+++ /dev/null
@@ -1,104 +0,0 @@
-package yaml
-
-import (
-	"reflect"
-	"unicode"
-)
-
-type keyList []reflect.Value
-
-func (l keyList) Len() int      { return len(l) }
-func (l keyList) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
-func (l keyList) Less(i, j int) bool {
-	a := l[i]
-	b := l[j]
-	ak := a.Kind()
-	bk := b.Kind()
-	for (ak == reflect.Interface || ak == reflect.Ptr) && !a.IsNil() {
-		a = a.Elem()
-		ak = a.Kind()
-	}
-	for (bk == reflect.Interface || bk == reflect.Ptr) && !b.IsNil() {
-		b = b.Elem()
-		bk = b.Kind()
-	}
-	af, aok := keyFloat(a)
-	bf, bok := keyFloat(b)
-	if aok && bok {
-		if af != bf {
-			return af < bf
-		}
-		if ak != bk {
-			return ak < bk
-		}
-		return numLess(a, b)
-	}
-	if ak != reflect.String || bk != reflect.String {
-		return ak < bk
-	}
-	ar, br := []rune(a.String()), []rune(b.String())
-	for i := 0; i < len(ar) && i < len(br); i++ {
-		if ar[i] == br[i] {
-			continue
-		}
-		al := unicode.IsLetter(ar[i])
-		bl := unicode.IsLetter(br[i])
-		if al && bl {
-			return ar[i] < br[i]
-		}
-		if al || bl {
-			return bl
-		}
-		var ai, bi int
-		var an, bn int64
-		for ai = i; ai < len(ar) && unicode.IsDigit(ar[ai]); ai++ {
-			an = an*10 + int64(ar[ai]-'0')
-		}
-		for bi = i; bi < len(br) && unicode.IsDigit(br[bi]); bi++ {
-			bn = bn*10 + int64(br[bi]-'0')
-		}
-		if an != bn {
-			return an < bn
-		}
-		if ai != bi {
-			return ai < bi
-		}
-		return ar[i] < br[i]
-	}
-	return len(ar) < len(br)
-}
-
-// keyFloat returns a float value for v if it is a number/bool
-// and whether it is a number/bool or not.
-func keyFloat(v reflect.Value) (f float64, ok bool) {
-	switch v.Kind() {
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		return float64(v.Int()), true
-	case reflect.Float32, reflect.Float64:
-		return v.Float(), true
-	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
-		return float64(v.Uint()), true
-	case reflect.Bool:
-		if v.Bool() {
-			return 1, true
-		}
-		return 0, true
-	}
-	return 0, false
-}
-
-// numLess returns whether a < b.
-// a and b must necessarily have the same kind.
-func numLess(a, b reflect.Value) bool {
-	switch a.Kind() {
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		return a.Int() < b.Int()
-	case reflect.Float32, reflect.Float64:
-		return a.Float() < b.Float()
-	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
-		return a.Uint() < b.Uint()
-	case reflect.Bool:
-		return !a.Bool() && b.Bool()
-	}
-	panic("not a number")
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/suite_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/suite_test.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/suite_test.go
deleted file mode 100644
index c5cf1ed..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/suite_test.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package yaml_test
-
-import (
-	. "gopkg.in/check.v1"
-	"testing"
-)
-
-func Test(t *testing.T) { TestingT(t) }
-
-type S struct{}
-
-var _ = Suite(&S{})

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/writerc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/writerc.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/writerc.go
deleted file mode 100644
index 190362f..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/writerc.go
+++ /dev/null
@@ -1,89 +0,0 @@
-package yaml
-
-// Set the writer error and return false.
-func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool {
-	emitter.error = yaml_WRITER_ERROR
-	emitter.problem = problem
-	return false
-}
-
-// Flush the output buffer.
-func yaml_emitter_flush(emitter *yaml_emitter_t) bool {
-	if emitter.write_handler == nil {
-		panic("write handler not set")
-	}
-
-	// Check if the buffer is empty.
-	if emitter.buffer_pos == 0 {
-		return true
-	}
-
-	// If the output encoding is UTF-8, we don't need to recode the buffer.
-	if emitter.encoding == yaml_UTF8_ENCODING {
-		if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil {
-			return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error())
-		}
-		emitter.buffer_pos = 0
-		return true
-	}
-
-	// Recode the buffer into the raw buffer.
-	var low, high int
-	if emitter.encoding == yaml_UTF16LE_ENCODING {
-		low, high = 0, 1
-	} else {
-		high, low = 1, 0
-	}
-
-	pos := 0
-	for pos < emitter.buffer_pos {
-		// See the "reader.c" code for more details on UTF-8 encoding.  Note
-		// that we assume that the buffer contains a valid UTF-8 sequence.
-
-		// Read the next UTF-8 character.
-		octet := emitter.buffer[pos]
-
-		var w int
-		var value rune
-		switch {
-		case octet&0x80 == 0x00:
-			w, value = 1, rune(octet&0x7F)
-		case octet&0xE0 == 0xC0:
-			w, value = 2, rune(octet&0x1F)
-		case octet&0xF0 == 0xE0:
-			w, value = 3, rune(octet&0x0F)
-		case octet&0xF8 == 0xF0:
-			w, value = 4, rune(octet&0x07)
-		}
-		for k := 1; k < w; k++ {
-			octet = emitter.buffer[pos+k]
-			value = (value << 6) + (rune(octet) & 0x3F)
-		}
-		pos += w
-
-		// Write the character.
-		if value < 0x10000 {
-			var b [2]byte
-			b[high] = byte(value >> 8)
-			b[low] = byte(value & 0xFF)
-			emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1])
-		} else {
-			// Write the character using a surrogate pair (check "reader.c").
-			var b [4]byte
-			value -= 0x10000
-			b[high] = byte(0xD8 + (value >> 18))
-			b[low] = byte((value >> 10) & 0xFF)
-			b[high+2] = byte(0xDC + ((value >> 8) & 0xFF))
-			b[low+2] = byte(value & 0xFF)
-			emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3])
-		}
-	}
-
-	// Write the raw buffer.
-	if err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil {
-		return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error())
-	}
-	emitter.buffer_pos = 0
-	emitter.raw_buffer = emitter.raw_buffer[:0]
-	return true
-}


[31/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/command.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/command.go b/Godeps/_workspace/src/github.com/spf13/cobra/command.go
deleted file mode 100644
index 141cfab..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/command.go
+++ /dev/null
@@ -1,1032 +0,0 @@
-// Copyright © 2013 Steve Francia <sp...@spf13.com>.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
-//In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code.
-package cobra
-
-import (
-	"bytes"
-	"fmt"
-	"io"
-	"os"
-	"runtime"
-	"strings"
-	"time"
-
-	"github.com/inconshreveable/mousetrap"
-	flag "github.com/spf13/pflag"
-)
-
-// Command is just that, a command for your application.
-// eg.  'go run' ... 'run' is the command. Cobra requires
-// you to define the usage and description as part of your command
-// definition to ensure usability.
-type Command struct {
-	// Name is the command name, usually the executable's name.
-	name string
-	// The one-line usage message.
-	Use string
-	// An array of aliases that can be used instead of the first word in Use.
-	Aliases []string
-	// The short description shown in the 'help' output.
-	Short string
-	// The long message shown in the 'help <this-command>' output.
-	Long string
-	// Examples of how to use the command
-	Example string
-	// List of all valid non-flag arguments, used for bash completions *TODO* actually validate these
-	ValidArgs []string
-	// Custom functions used by the bash autocompletion generator
-	BashCompletionFunction string
-	// Is this command deprecated and should print this string when used?
-	Deprecated string
-	// Full set of flags
-	flags *flag.FlagSet
-	// Set of flags childrens of this command will inherit
-	pflags *flag.FlagSet
-	// Flags that are declared specifically by this command (not inherited).
-	lflags *flag.FlagSet
-	// The *Run functions are executed in the following order:
-	//   * PersistentPreRun()
-	//   * PreRun()
-	//   * Run()
-	//   * PostRun()
-	//   * PersistentPostRun()
-	// All functions get the same args, the arguments after the command name
-	// PersistentPreRun: children of this command will inherit and execute
-	PersistentPreRun func(cmd *Command, args []string)
-	// PreRun: children of this command will not inherit.
-	PreRun func(cmd *Command, args []string)
-	// Run: Typically the actual work function. Most commands will only implement this
-	Run func(cmd *Command, args []string)
-	// PostRun: run after the Run command.
-	PostRun func(cmd *Command, args []string)
-	// PersistentPostRun: children of this command will inherit and execute after PostRun
-	PersistentPostRun func(cmd *Command, args []string)
-	// Commands is the list of commands supported by this program.
-	commands []*Command
-	// Parent Command for this command
-	parent *Command
-	// max lengths of commands' string lengths for use in padding
-	commandsMaxUseLen         int
-	commandsMaxCommandPathLen int
-	commandsMaxNameLen        int
-
-	flagErrorBuf *bytes.Buffer
-	cmdErrorBuf  *bytes.Buffer
-
-	args          []string                 // actual args parsed from flags
-	output        *io.Writer               // nil means stderr; use Out() method instead
-	usageFunc     func(*Command) error     // Usage can be defined by application
-	usageTemplate string                   // Can be defined by Application
-	helpTemplate  string                   // Can be defined by Application
-	helpFunc      func(*Command, []string) // Help can be defined by application
-	helpCommand   *Command                 // The help command
-	helpFlagVal   bool
-	// The global normalization function that we can use on every pFlag set and children commands
-	globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName
-}
-
-// os.Args[1:] by default, if desired, can be overridden
-// particularly useful when testing.
-func (c *Command) SetArgs(a []string) {
-	c.args = a
-}
-
-func (c *Command) getOut(def io.Writer) io.Writer {
-	if c.output != nil {
-		return *c.output
-	}
-
-	if c.HasParent() {
-		return c.parent.Out()
-	} else {
-		return def
-	}
-}
-
-func (c *Command) Out() io.Writer {
-	return c.getOut(os.Stderr)
-}
-
-func (c *Command) getOutOrStdout() io.Writer {
-	return c.getOut(os.Stdout)
-}
-
-// SetOutput sets the destination for usage and error messages.
-// If output is nil, os.Stderr is used.
-func (c *Command) SetOutput(output io.Writer) {
-	c.output = &output
-}
-
-// Usage can be defined by application
-func (c *Command) SetUsageFunc(f func(*Command) error) {
-	c.usageFunc = f
-}
-
-// Can be defined by Application
-func (c *Command) SetUsageTemplate(s string) {
-	c.usageTemplate = s
-}
-
-// Can be defined by Application
-func (c *Command) SetHelpFunc(f func(*Command, []string)) {
-	c.helpFunc = f
-}
-
-func (c *Command) SetHelpCommand(cmd *Command) {
-	c.helpCommand = cmd
-}
-
-// Can be defined by Application
-func (c *Command) SetHelpTemplate(s string) {
-	c.helpTemplate = s
-}
-
-// SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands.
-// The user should not have a cyclic dependency on commands.
-func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) {
-	c.Flags().SetNormalizeFunc(n)
-	c.PersistentFlags().SetNormalizeFunc(n)
-	c.LocalFlags().SetNormalizeFunc(n)
-	c.globNormFunc = n
-
-	for _, command := range c.commands {
-		command.SetGlobalNormalizationFunc(n)
-	}
-}
-
-func (c *Command) UsageFunc() (f func(*Command) error) {
-	if c.usageFunc != nil {
-		return c.usageFunc
-	}
-
-	if c.HasParent() {
-		return c.parent.UsageFunc()
-	} else {
-		return func(c *Command) error {
-			err := tmpl(c.Out(), c.UsageTemplate(), c)
-			return err
-		}
-	}
-}
-func (c *Command) HelpFunc() func(*Command, []string) {
-	if c.helpFunc != nil {
-		return c.helpFunc
-	}
-
-	if c.HasParent() {
-		return c.parent.HelpFunc()
-	} else {
-		return func(c *Command, args []string) {
-			if len(args) == 0 {
-				// Help called without any topic, calling on root
-				c.Root().Help()
-				return
-			}
-
-			cmd, _, e := c.Root().Find(args)
-			if cmd == nil || e != nil {
-				c.Printf("Unknown help topic %#q.", args)
-
-				c.Root().Usage()
-			} else {
-				err := cmd.Help()
-				if err != nil {
-					c.Println(err)
-				}
-			}
-		}
-	}
-}
-
-var minUsagePadding int = 25
-
-func (c *Command) UsagePadding() int {
-	if c.parent == nil || minUsagePadding > c.parent.commandsMaxUseLen {
-		return minUsagePadding
-	} else {
-		return c.parent.commandsMaxUseLen
-	}
-}
-
-var minCommandPathPadding int = 11
-
-//
-func (c *Command) CommandPathPadding() int {
-	if c.parent == nil || minCommandPathPadding > c.parent.commandsMaxCommandPathLen {
-		return minCommandPathPadding
-	} else {
-		return c.parent.commandsMaxCommandPathLen
-	}
-}
-
-var minNamePadding int = 11
-
-func (c *Command) NamePadding() int {
-	if c.parent == nil || minNamePadding > c.parent.commandsMaxNameLen {
-		return minNamePadding
-	} else {
-		return c.parent.commandsMaxNameLen
-	}
-}
-
-func (c *Command) UsageTemplate() string {
-	if c.usageTemplate != "" {
-		return c.usageTemplate
-	}
-
-	if c.HasParent() {
-		return c.parent.UsageTemplate()
-	} else {
-		return `{{ $cmd := . }}
-Usage: {{if .Runnable}}
-  {{.UseLine}}{{if .HasFlags}} [flags]{{end}}{{end}}{{if .HasSubCommands}}
-  {{ .CommandPath}} [command]{{end}}{{if gt .Aliases 0}}
-
-Aliases:
-  {{.NameAndAliases}}
-{{end}}{{if .HasExample}}
-
-Examples:
-{{ .Example }}
-{{end}}{{ if .HasRunnableSubCommands}}
-
-Available Commands: {{range .Commands}}{{if and (.Runnable) (not .Deprecated)}}
-  {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}
-{{end}}
-{{ if .HasLocalFlags}}Flags:
-{{.LocalFlags.FlagUsages}}{{end}}
-{{ if .HasInheritedFlags}}Global Flags:
-{{.InheritedFlags.FlagUsages}}{{end}}{{if or (.HasHelpSubCommands) (.HasRunnableSiblings)}}
-Additional help topics:
-{{if .HasHelpSubCommands}}{{range .Commands}}{{if and (not .Runnable) (not .Deprecated)}} {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasRunnableSiblings }}{{range .Parent.Commands}}{{if and (not .Runnable) (not .Deprecated)}}{{if not (eq .Name $cmd.Name) }}
-  {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{end}}
-{{end}}{{ if .HasSubCommands }}
-Use "{{.Root.Name}} help [command]" for more information about a command.
-{{end}}`
-	}
-}
-
-func (c *Command) HelpTemplate() string {
-	if c.helpTemplate != "" {
-		return c.helpTemplate
-	}
-
-	if c.HasParent() {
-		return c.parent.HelpTemplate()
-	} else {
-		return `{{with or .Long .Short }}{{. | trim}}{{end}}
-{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}
-`
-	}
-}
-
-// Really only used when casting a command to a commander
-func (c *Command) resetChildrensParents() {
-	for _, x := range c.commands {
-		x.parent = c
-	}
-}
-
-// Test if the named flag is a boolean flag.
-func isBooleanFlag(name string, f *flag.FlagSet) bool {
-	flag := f.Lookup(name)
-	if flag == nil {
-		return false
-	}
-	return flag.Value.Type() == "bool"
-}
-
-// Test if the named flag is a boolean flag.
-func isBooleanShortFlag(name string, f *flag.FlagSet) bool {
-	result := false
-	f.VisitAll(func(f *flag.Flag) {
-		if f.Shorthand == name && f.Value.Type() == "bool" {
-			result = true
-		}
-	})
-	return result
-}
-
-func stripFlags(args []string, c *Command) []string {
-	if len(args) < 1 {
-		return args
-	}
-	c.mergePersistentFlags()
-
-	commands := []string{}
-
-	inQuote := false
-	inFlag := false
-	for _, y := range args {
-		if !inQuote {
-			switch {
-			case strings.HasPrefix(y, "\""):
-				inQuote = true
-			case strings.Contains(y, "=\""):
-				inQuote = true
-			case strings.HasPrefix(y, "--") && !strings.Contains(y, "="):
-				// TODO: this isn't quite right, we should really check ahead for 'true' or 'false'
-				inFlag = !isBooleanFlag(y[2:], c.Flags())
-			case strings.HasPrefix(y, "-") && !strings.Contains(y, "=") && len(y) == 2 && !isBooleanShortFlag(y[1:], c.Flags()):
-				inFlag = true
-			case inFlag:
-				inFlag = false
-			case y == "":
-				// strip empty commands, as the go tests expect this to be ok....
-			case !strings.HasPrefix(y, "-"):
-				commands = append(commands, y)
-				inFlag = false
-			}
-		}
-
-		if strings.HasSuffix(y, "\"") && !strings.HasSuffix(y, "\\\"") {
-			inQuote = false
-		}
-	}
-
-	return commands
-}
-
-// argsMinusFirstX removes only the first x from args.  Otherwise, commands that look like
-// openshift admin policy add-role-to-user admin my-user, lose the admin argument (arg[4]).
-func argsMinusFirstX(args []string, x string) []string {
-	for i, y := range args {
-		if x == y {
-			ret := []string{}
-			ret = append(ret, args[:i]...)
-			ret = append(ret, args[i+1:]...)
-			return ret
-		}
-	}
-	return args
-}
-
-// find the target command given the args and command tree
-// Meant to be run on the highest node. Only searches down.
-func (c *Command) Find(args []string) (*Command, []string, error) {
-	if c == nil {
-		return nil, nil, fmt.Errorf("Called find() on a nil Command")
-	}
-
-	// If there are no arguments, return the root command. If the root has no
-	// subcommands, args reflects arguments that should actually be passed to
-	// the root command, so also return the root command.
-	if len(args) == 0 || !c.Root().HasSubCommands() {
-		return c.Root(), args, nil
-	}
-
-	var innerfind func(*Command, []string) (*Command, []string)
-
-	innerfind = func(c *Command, innerArgs []string) (*Command, []string) {
-		if len(innerArgs) > 0 && c.HasSubCommands() {
-			argsWOflags := stripFlags(innerArgs, c)
-			if len(argsWOflags) > 0 {
-				matches := make([]*Command, 0)
-				for _, cmd := range c.commands {
-					if cmd.Name() == argsWOflags[0] || cmd.HasAlias(argsWOflags[0]) { // exact name or alias match
-						return innerfind(cmd, argsMinusFirstX(innerArgs, argsWOflags[0]))
-					} else if EnablePrefixMatching {
-						if strings.HasPrefix(cmd.Name(), argsWOflags[0]) { // prefix match
-							matches = append(matches, cmd)
-						}
-						for _, x := range cmd.Aliases {
-							if strings.HasPrefix(x, argsWOflags[0]) {
-								matches = append(matches, cmd)
-							}
-						}
-					}
-				}
-
-				// only accept a single prefix match - multiple matches would be ambiguous
-				if len(matches) == 1 {
-					return innerfind(matches[0], argsMinusFirstX(innerArgs, argsWOflags[0]))
-				}
-			}
-		}
-
-		return c, innerArgs
-	}
-
-	commandFound, a := innerfind(c, args)
-
-	// If we matched on the root, but we asked for a subcommand, return an error
-	argsWOflags := stripFlags(a, commandFound)
-	if commandFound == c && len(argsWOflags) > 0 {
-		return nil, a, fmt.Errorf("unknown command %q", argsWOflags[0])
-	}
-
-	return commandFound, a, nil
-}
-
-func (c *Command) Root() *Command {
-	var findRoot func(*Command) *Command
-
-	findRoot = func(x *Command) *Command {
-		if x.HasParent() {
-			return findRoot(x.parent)
-		} else {
-			return x
-		}
-	}
-
-	return findRoot(c)
-}
-
-func (c *Command) execute(a []string) (err error) {
-	if c == nil {
-		return fmt.Errorf("Called Execute() on a nil Command")
-	}
-
-	if len(c.Deprecated) > 0 {
-		c.Printf("Command %q is deprecated, %s\n", c.Name(), c.Deprecated)
-	}
-
-	err = c.ParseFlags(a)
-	if err == flag.ErrHelp {
-		c.Help()
-		return nil
-	}
-	if err != nil {
-		// We're writing subcommand usage to root command's error buffer to have it displayed to the user
-		r := c.Root()
-		if r.cmdErrorBuf == nil {
-			r.cmdErrorBuf = new(bytes.Buffer)
-		}
-		// for writing the usage to the buffer we need to switch the output temporarily
-		// since Out() returns root output, you also need to revert that on root
-		out := r.Out()
-		r.SetOutput(r.cmdErrorBuf)
-		c.Usage()
-		r.SetOutput(out)
-		return err
-	}
-	// If help is called, regardless of other flags, we print that.
-	// Print help also if c.Run is nil.
-	if c.helpFlagVal || !c.Runnable() {
-		c.Help()
-		return nil
-	}
-
-	c.preRun()
-	argWoFlags := c.Flags().Args()
-
-	for p := c; p != nil; p = p.Parent() {
-		if p.PersistentPreRun != nil {
-			p.PersistentPreRun(c, argWoFlags)
-			break
-		}
-	}
-	if c.PreRun != nil {
-		c.PreRun(c, argWoFlags)
-	}
-
-	c.Run(c, argWoFlags)
-
-	if c.PostRun != nil {
-		c.PostRun(c, argWoFlags)
-	}
-	for p := c; p != nil; p = p.Parent() {
-		if p.PersistentPostRun != nil {
-			p.PersistentPostRun(c, argWoFlags)
-			break
-		}
-	}
-
-	return nil
-}
-
-func (c *Command) preRun() {
-	for _, x := range initializers {
-		x()
-	}
-}
-
-func (c *Command) errorMsgFromParse() string {
-	s := c.flagErrorBuf.String()
-
-	x := strings.Split(s, "\n")
-
-	if len(x) > 0 {
-		return x[0]
-	} else {
-		return ""
-	}
-}
-
-// Call execute to use the args (os.Args[1:] by default)
-// and run through the command tree finding appropriate matches
-// for commands and then corresponding flags.
-func (c *Command) Execute() (err error) {
-
-	// Regardless of what command execute is called on, run on Root only
-	if c.HasParent() {
-		return c.Root().Execute()
-	}
-
-	if EnableWindowsMouseTrap && runtime.GOOS == "windows" {
-		if mousetrap.StartedByExplorer() {
-			c.Print(MousetrapHelpText)
-			time.Sleep(5 * time.Second)
-			os.Exit(1)
-		}
-	}
-
-	// initialize help as the last point possible to allow for user
-	// overriding
-	c.initHelp()
-
-	var args []string
-
-	if len(c.args) == 0 {
-		args = os.Args[1:]
-	} else {
-		args = c.args
-	}
-
-	cmd, flags, err := c.Find(args)
-	if err == nil {
-		err = cmd.execute(flags)
-	}
-
-	if err != nil {
-		if err == flag.ErrHelp {
-			c.Help()
-
-		} else {
-			c.Println("Error:", err.Error())
-			c.Printf("Run '%v help' for usage.\n", c.Root().Name())
-		}
-	}
-
-	return
-}
-
-func (c *Command) initHelp() {
-	if c.helpCommand == nil {
-		if !c.HasSubCommands() {
-			return
-		}
-
-		c.helpCommand = &Command{
-			Use:   "help [command]",
-			Short: "Help about any command",
-			Long: `Help provides help for any command in the application.
-    Simply type ` + c.Name() + ` help [path to command] for full details.`,
-			Run:               c.HelpFunc(),
-			PersistentPreRun:  func(cmd *Command, args []string) {},
-			PersistentPostRun: func(cmd *Command, args []string) {},
-		}
-	}
-	c.AddCommand(c.helpCommand)
-}
-
-// Used for testing
-func (c *Command) ResetCommands() {
-	c.commands = nil
-	c.helpCommand = nil
-	c.cmdErrorBuf = new(bytes.Buffer)
-	c.cmdErrorBuf.Reset()
-}
-
-//Commands returns a slice of child commands.
-func (c *Command) Commands() []*Command {
-	return c.commands
-}
-
-// AddCommand adds one or more commands to this parent command.
-func (c *Command) AddCommand(cmds ...*Command) {
-	for i, x := range cmds {
-		if cmds[i] == c {
-			panic("Command can't be a child of itself")
-		}
-		cmds[i].parent = c
-		// update max lengths
-		usageLen := len(x.Use)
-		if usageLen > c.commandsMaxUseLen {
-			c.commandsMaxUseLen = usageLen
-		}
-		commandPathLen := len(x.CommandPath())
-		if commandPathLen > c.commandsMaxCommandPathLen {
-			c.commandsMaxCommandPathLen = commandPathLen
-		}
-		nameLen := len(x.Name())
-		if nameLen > c.commandsMaxNameLen {
-			c.commandsMaxNameLen = nameLen
-		}
-		// If glabal normalization function exists, update all children
-		if c.globNormFunc != nil {
-			x.SetGlobalNormalizationFunc(c.globNormFunc)
-		}
-		c.commands = append(c.commands, x)
-	}
-}
-
-// AddCommand removes one or more commands from a parent command.
-func (c *Command) RemoveCommand(cmds ...*Command) {
-	commands := []*Command{}
-main:
-	for _, command := range c.commands {
-		for _, cmd := range cmds {
-			if command == cmd {
-				command.parent = nil
-				continue main
-			}
-		}
-		commands = append(commands, command)
-	}
-	c.commands = commands
-	// recompute all lengths
-	c.commandsMaxUseLen = 0
-	c.commandsMaxCommandPathLen = 0
-	c.commandsMaxNameLen = 0
-	for _, command := range c.commands {
-		usageLen := len(command.Use)
-		if usageLen > c.commandsMaxUseLen {
-			c.commandsMaxUseLen = usageLen
-		}
-		commandPathLen := len(command.CommandPath())
-		if commandPathLen > c.commandsMaxCommandPathLen {
-			c.commandsMaxCommandPathLen = commandPathLen
-		}
-		nameLen := len(command.Name())
-		if nameLen > c.commandsMaxNameLen {
-			c.commandsMaxNameLen = nameLen
-		}
-	}
-}
-
-// Convenience method to Print to the defined output
-func (c *Command) Print(i ...interface{}) {
-	fmt.Fprint(c.Out(), i...)
-}
-
-// Convenience method to Println to the defined output
-func (c *Command) Println(i ...interface{}) {
-	str := fmt.Sprintln(i...)
-	c.Print(str)
-}
-
-// Convenience method to Printf to the defined output
-func (c *Command) Printf(format string, i ...interface{}) {
-	str := fmt.Sprintf(format, i...)
-	c.Print(str)
-}
-
-// Output the usage for the command
-// Used when a user provides invalid input
-// Can be defined by user by overriding UsageFunc
-func (c *Command) Usage() error {
-	c.mergePersistentFlags()
-	err := c.UsageFunc()(c)
-	return err
-}
-
-// Output the help for the command
-// Used when a user calls help [command]
-// by the default HelpFunc in the commander
-func (c *Command) Help() error {
-	c.mergePersistentFlags()
-	err := tmpl(c.getOutOrStdout(), c.HelpTemplate(), c)
-	return err
-}
-
-func (c *Command) UsageString() string {
-	tmpOutput := c.output
-	bb := new(bytes.Buffer)
-	c.SetOutput(bb)
-	c.Usage()
-	c.output = tmpOutput
-	return bb.String()
-}
-
-// CommandPath returns the full path to this command.
-func (c *Command) CommandPath() string {
-	str := c.Name()
-	x := c
-	for x.HasParent() {
-		str = x.parent.Name() + " " + str
-		x = x.parent
-	}
-	return str
-}
-
-//The full usage for a given command (including parents)
-func (c *Command) UseLine() string {
-	str := ""
-	if c.HasParent() {
-		str = c.parent.CommandPath() + " "
-	}
-	return str + c.Use
-}
-
-// For use in determining which flags have been assigned to which commands
-// and which persist
-func (c *Command) DebugFlags() {
-	c.Println("DebugFlags called on", c.Name())
-	var debugflags func(*Command)
-
-	debugflags = func(x *Command) {
-		if x.HasFlags() || x.HasPersistentFlags() {
-			c.Println(x.Name())
-		}
-		if x.HasFlags() {
-			x.flags.VisitAll(func(f *flag.Flag) {
-				if x.HasPersistentFlags() {
-					if x.persistentFlag(f.Name) == nil {
-						c.Println("  -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, "  [L]")
-					} else {
-						c.Println("  -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, "  [LP]")
-					}
-				} else {
-					c.Println("  -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, "  [L]")
-				}
-			})
-		}
-		if x.HasPersistentFlags() {
-			x.pflags.VisitAll(func(f *flag.Flag) {
-				if x.HasFlags() {
-					if x.flags.Lookup(f.Name) == nil {
-						c.Println("  -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, "  [P]")
-					}
-				} else {
-					c.Println("  -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, "  [P]")
-				}
-			})
-		}
-		c.Println(x.flagErrorBuf)
-		if x.HasSubCommands() {
-			for _, y := range x.commands {
-				debugflags(y)
-			}
-		}
-	}
-
-	debugflags(c)
-}
-
-// Name returns the command's name: the first word in the use line.
-func (c *Command) Name() string {
-	if c.name != "" {
-		return c.name
-	}
-	name := c.Use
-	i := strings.Index(name, " ")
-	if i >= 0 {
-		name = name[:i]
-	}
-	return name
-}
-
-// Determine if a given string is an alias of the command.
-func (c *Command) HasAlias(s string) bool {
-	for _, a := range c.Aliases {
-		if a == s {
-			return true
-		}
-	}
-	return false
-}
-
-func (c *Command) NameAndAliases() string {
-	return strings.Join(append([]string{c.Name()}, c.Aliases...), ", ")
-}
-
-func (c *Command) HasExample() bool {
-	return len(c.Example) > 0
-}
-
-// Determine if the command is itself runnable
-func (c *Command) Runnable() bool {
-	return c.Run != nil
-}
-
-// Determine if the command has children commands
-func (c *Command) HasSubCommands() bool {
-	return len(c.commands) > 0
-}
-
-func (c *Command) HasRunnableSiblings() bool {
-	if !c.HasParent() {
-		return false
-	}
-	for _, sub := range c.parent.commands {
-		if sub.Runnable() {
-			return true
-		}
-	}
-	return false
-}
-
-func (c *Command) HasHelpSubCommands() bool {
-	for _, sub := range c.commands {
-		if !sub.Runnable() {
-			return true
-		}
-	}
-	return false
-}
-
-// Determine if the command has runnable children commands
-func (c *Command) HasRunnableSubCommands() bool {
-	for _, sub := range c.commands {
-		if sub.Runnable() {
-			return true
-		}
-	}
-	return false
-}
-
-// Determine if the command is a child command
-func (c *Command) HasParent() bool {
-	return c.parent != nil
-}
-
-// GlobalNormalizationFunc returns the global normalization function or nil if doesn't exists
-func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName {
-	return c.globNormFunc
-}
-
-// Get the complete FlagSet that applies to this command (local and persistent declared here and by all parents)
-func (c *Command) Flags() *flag.FlagSet {
-	if c.flags == nil {
-		c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
-		if c.flagErrorBuf == nil {
-			c.flagErrorBuf = new(bytes.Buffer)
-		}
-		c.flags.SetOutput(c.flagErrorBuf)
-		c.PersistentFlags().BoolVarP(&c.helpFlagVal, "help", "h", false, "help for "+c.Name())
-	}
-	return c.flags
-}
-
-// Get the local FlagSet specifically set in the current command
-func (c *Command) LocalFlags() *flag.FlagSet {
-	c.mergePersistentFlags()
-
-	local := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
-	c.lflags.VisitAll(func(f *flag.Flag) {
-		local.AddFlag(f)
-	})
-	return local
-}
-
-// All Flags which were inherited from parents commands
-func (c *Command) InheritedFlags() *flag.FlagSet {
-	c.mergePersistentFlags()
-
-	inherited := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
-	local := c.LocalFlags()
-
-	var rmerge func(x *Command)
-
-	rmerge = func(x *Command) {
-		if x.HasPersistentFlags() {
-			x.PersistentFlags().VisitAll(func(f *flag.Flag) {
-				if inherited.Lookup(f.Name) == nil && local.Lookup(f.Name) == nil {
-					inherited.AddFlag(f)
-				}
-			})
-		}
-		if x.HasParent() {
-			rmerge(x.parent)
-		}
-	}
-
-	if c.HasParent() {
-		rmerge(c.parent)
-	}
-
-	return inherited
-}
-
-// All Flags which were not inherited from parent commands
-func (c *Command) NonInheritedFlags() *flag.FlagSet {
-	return c.LocalFlags()
-}
-
-// Get the Persistent FlagSet specifically set in the current command
-func (c *Command) PersistentFlags() *flag.FlagSet {
-	if c.pflags == nil {
-		c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
-		if c.flagErrorBuf == nil {
-			c.flagErrorBuf = new(bytes.Buffer)
-		}
-		c.pflags.SetOutput(c.flagErrorBuf)
-	}
-	return c.pflags
-}
-
-// For use in testing
-func (c *Command) ResetFlags() {
-	c.flagErrorBuf = new(bytes.Buffer)
-	c.flagErrorBuf.Reset()
-	c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
-	c.flags.SetOutput(c.flagErrorBuf)
-	c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
-	c.pflags.SetOutput(c.flagErrorBuf)
-}
-
-// Does the command contain any flags (local plus persistent from the entire structure)
-func (c *Command) HasFlags() bool {
-	return c.Flags().HasFlags()
-}
-
-// Does the command contain persistent flags
-func (c *Command) HasPersistentFlags() bool {
-	return c.PersistentFlags().HasFlags()
-}
-
-// Does the command has flags specifically declared locally
-func (c *Command) HasLocalFlags() bool {
-	return c.LocalFlags().HasFlags()
-}
-
-func (c *Command) HasInheritedFlags() bool {
-	return c.InheritedFlags().HasFlags()
-}
-
-// Climbs up the command tree looking for matching flag
-func (c *Command) Flag(name string) (flag *flag.Flag) {
-	flag = c.Flags().Lookup(name)
-
-	if flag == nil {
-		flag = c.persistentFlag(name)
-	}
-
-	return
-}
-
-// recursively find matching persistent flag
-func (c *Command) persistentFlag(name string) (flag *flag.Flag) {
-	if c.HasPersistentFlags() {
-		flag = c.PersistentFlags().Lookup(name)
-	}
-
-	if flag == nil && c.HasParent() {
-		flag = c.parent.persistentFlag(name)
-	}
-	return
-}
-
-// Parses persistent flag tree & local flags
-func (c *Command) ParseFlags(args []string) (err error) {
-	c.mergePersistentFlags()
-	err = c.Flags().Parse(args)
-	return
-}
-
-func (c *Command) Parent() *Command {
-	return c.parent
-}
-
-func (c *Command) mergePersistentFlags() {
-	var rmerge func(x *Command)
-
-	// Save the set of local flags
-	if c.lflags == nil {
-		c.lflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
-		if c.flagErrorBuf == nil {
-			c.flagErrorBuf = new(bytes.Buffer)
-		}
-		c.lflags.SetOutput(c.flagErrorBuf)
-		addtolocal := func(f *flag.Flag) {
-			c.lflags.AddFlag(f)
-		}
-		c.Flags().VisitAll(addtolocal)
-		c.PersistentFlags().VisitAll(addtolocal)
-	}
-	rmerge = func(x *Command) {
-		if !x.HasParent() {
-			flag.CommandLine.VisitAll(func(f *flag.Flag) {
-				if x.PersistentFlags().Lookup(f.Name) == nil {
-					x.PersistentFlags().AddFlag(f)
-				}
-			})
-		}
-		if x.HasPersistentFlags() {
-			x.PersistentFlags().VisitAll(func(f *flag.Flag) {
-				if c.Flags().Lookup(f.Name) == nil {
-					c.Flags().AddFlag(f)
-				}
-			})
-		}
-		if x.HasParent() {
-			rmerge(x.parent)
-		}
-	}
-
-	rmerge(c)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/command_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/command_test.go b/Godeps/_workspace/src/github.com/spf13/cobra/command_test.go
deleted file mode 100644
index 477d84e..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/command_test.go
+++ /dev/null
@@ -1,90 +0,0 @@
-package cobra
-
-import (
-	"reflect"
-	"testing"
-)
-
-func TestStripFlags(t *testing.T) {
-	tests := []struct {
-		input  []string
-		output []string
-	}{
-		{
-			[]string{"foo", "bar"},
-			[]string{"foo", "bar"},
-		},
-		{
-			[]string{"foo", "--bar", "-b"},
-			[]string{"foo"},
-		},
-		{
-			[]string{"-b", "foo", "--bar", "bar"},
-			[]string{},
-		},
-		{
-			[]string{"-i10", "echo"},
-			[]string{"echo"},
-		},
-		{
-			[]string{"-i=10", "echo"},
-			[]string{"echo"},
-		},
-		{
-			[]string{"--int=100", "echo"},
-			[]string{"echo"},
-		},
-		{
-			[]string{"-ib", "echo", "-bfoo", "baz"},
-			[]string{"echo", "baz"},
-		},
-		{
-			[]string{"-i=baz", "bar", "-i", "foo", "blah"},
-			[]string{"bar", "blah"},
-		},
-		{
-			[]string{"--int=baz", "-bbar", "-i", "foo", "blah"},
-			[]string{"blah"},
-		},
-		{
-			[]string{"--cat", "bar", "-i", "foo", "blah"},
-			[]string{"bar", "blah"},
-		},
-		{
-			[]string{"-c", "bar", "-i", "foo", "blah"},
-			[]string{"bar", "blah"},
-		},
-		{
-			[]string{"--persist", "bar"},
-			[]string{"bar"},
-		},
-		{
-			[]string{"-p", "bar"},
-			[]string{"bar"},
-		},
-	}
-
-	cmdPrint := &Command{
-		Use:   "print [string to print]",
-		Short: "Print anything to the screen",
-		Long:  `an utterly useless command for testing.`,
-		Run: func(cmd *Command, args []string) {
-			tp = args
-		},
-	}
-
-	var flagi int
-	var flagstr string
-	var flagbool bool
-	cmdPrint.PersistentFlags().BoolVarP(&flagbool, "persist", "p", false, "help for persistent one")
-	cmdPrint.Flags().IntVarP(&flagi, "int", "i", 345, "help message for flag int")
-	cmdPrint.Flags().StringVarP(&flagstr, "bar", "b", "bar", "help message for flag string")
-	cmdPrint.Flags().BoolVarP(&flagbool, "cat", "c", false, "help message for flag bool")
-
-	for _, test := range tests {
-		output := stripFlags(test.input, cmdPrint)
-		if !reflect.DeepEqual(test.output, output) {
-			t.Errorf("expected: %v, got: %v", test.output, output)
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.go b/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.go
deleted file mode 100644
index 6092c85..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.go
+++ /dev/null
@@ -1,138 +0,0 @@
-//Copyright 2015 Red Hat Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package cobra
-
-import (
-	"bytes"
-	"fmt"
-	"os"
-	"sort"
-	"strings"
-	"time"
-)
-
-func printOptions(out *bytes.Buffer, cmd *Command, name string) {
-	flags := cmd.NonInheritedFlags()
-	flags.SetOutput(out)
-	if flags.HasFlags() {
-		fmt.Fprintf(out, "### Options\n\n```\n")
-		flags.PrintDefaults()
-		fmt.Fprintf(out, "```\n\n")
-	}
-
-	parentFlags := cmd.InheritedFlags()
-	parentFlags.SetOutput(out)
-	if parentFlags.HasFlags() {
-		fmt.Fprintf(out, "### Options inherited from parent commands\n\n```\n")
-		parentFlags.PrintDefaults()
-		fmt.Fprintf(out, "```\n\n")
-	}
-}
-
-type byName []*Command
-
-func (s byName) Len() int           { return len(s) }
-func (s byName) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
-func (s byName) Less(i, j int) bool { return s[i].Name() < s[j].Name() }
-
-func GenMarkdown(cmd *Command, out *bytes.Buffer) {
-	GenMarkdownCustom(cmd, out, func(s string) string { return s })
-}
-
-func GenMarkdownCustom(cmd *Command, out *bytes.Buffer, linkHandler func(string) string) {
-	name := cmd.CommandPath()
-
-	short := cmd.Short
-	long := cmd.Long
-	if len(long) == 0 {
-		long = short
-	}
-
-	fmt.Fprintf(out, "## %s\n\n", name)
-	fmt.Fprintf(out, "%s\n\n", short)
-	fmt.Fprintf(out, "### Synopsis\n\n")
-	fmt.Fprintf(out, "\n%s\n\n", long)
-
-	if cmd.Runnable() {
-		fmt.Fprintf(out, "```\n%s\n```\n\n", cmd.UseLine())
-	}
-
-	if len(cmd.Example) > 0 {
-		fmt.Fprintf(out, "### Examples\n\n")
-		fmt.Fprintf(out, "```\n%s\n```\n\n", cmd.Example)
-	}
-
-	printOptions(out, cmd, name)
-
-	if len(cmd.Commands()) > 0 || cmd.HasParent() {
-		fmt.Fprintf(out, "### SEE ALSO\n")
-		if cmd.HasParent() {
-			parent := cmd.Parent()
-			pname := parent.CommandPath()
-			link := pname + ".md"
-			link = strings.Replace(link, " ", "_", -1)
-			fmt.Fprintf(out, "* [%s](%s)\t - %s\n", pname, linkHandler(link), parent.Short)
-		}
-
-		children := cmd.Commands()
-		sort.Sort(byName(children))
-
-		for _, child := range children {
-			if len(child.Deprecated) > 0 {
-				continue
-			}
-			cname := name + " " + child.Name()
-			link := cname + ".md"
-			link = strings.Replace(link, " ", "_", -1)
-			fmt.Fprintf(out, "* [%s](%s)\t - %s\n", cname, linkHandler(link), child.Short)
-		}
-		fmt.Fprintf(out, "\n")
-	}
-
-	fmt.Fprintf(out, "###### Auto generated by spf13/cobra at %s\n", time.Now().UTC())
-}
-
-func GenMarkdownTree(cmd *Command, dir string) {
-	identity := func(s string) string { return s }
-	emptyStr := func(s string) string { return "" }
-	GenMarkdownTreeCustom(cmd, dir, emptyStr, identity)
-}
-
-func GenMarkdownTreeCustom(cmd *Command, dir string, filePrepender func(string) string, linkHandler func(string) string) {
-	for _, c := range cmd.Commands() {
-		GenMarkdownTreeCustom(c, dir, filePrepender, linkHandler)
-	}
-	out := new(bytes.Buffer)
-
-	GenMarkdownCustom(cmd, out, linkHandler)
-
-	filename := cmd.CommandPath()
-	filename = dir + strings.Replace(filename, " ", "_", -1) + ".md"
-	outFile, err := os.Create(filename)
-	if err != nil {
-		fmt.Println(err)
-		os.Exit(1)
-	}
-	defer outFile.Close()
-	_, err = outFile.WriteString(filePrepender(filename))
-	if err != nil {
-		fmt.Println(err)
-		os.Exit(1)
-	}
-	_, err = outFile.Write(out.Bytes())
-	if err != nil {
-		fmt.Println(err)
-		os.Exit(1)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.md b/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.md
deleted file mode 100644
index 3a0d55a..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.md
+++ /dev/null
@@ -1,81 +0,0 @@
-# Generating Markdown Docs For Your Own cobra.Command
-
-## Generate markdown docs for the entire command tree
-
-This program can actually generate docs for the kubectl command in the kubernetes project
-
-```go
-package main
-
-import (
-	"io/ioutil"
-	"os"
-
-	"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd"
-	"github.com/spf13/cobra"
-)
-
-func main() {
-	kubectl := cmd.NewFactory(nil).NewKubectlCommand(os.Stdin, ioutil.Discard, ioutil.Discard)
-	cobra.GenMarkdownTree(kubectl, "./")
-}
-```
-
-This will generate a whole series of files, one for each command in the tree, in the directory specified (in this case "./")
-
-## Generate markdown docs for a single command
-
-You may wish to have more control over the output, or only generate for a single command, instead of the entire command tree. If this is the case you may prefer to `GenMarkdown` instead of `GenMarkdownTree`
-
-```go
-	out := new(bytes.Buffer)
-	cobra.GenMarkdown(cmd, out)
-```
-
-This will write the markdown doc for ONLY "cmd" into the out, buffer.
-
-## Customize the output
-
-Both `GenMarkdown` and `GenMarkdownTree` have alternate versions with callbacks to get some control of the output:
-
-```go
-func GenMarkdownTreeCustom(cmd *Command, dir string, filePrepender func(string) string, linkHandler func(string) string) {
-    //...
-}
-```
-
-```go
-func GenMarkdownCustom(cmd *Command, out *bytes.Buffer, linkHandler func(string) string) {
-    //...
-}
-```
-
-The `filePrepender` will prepend the return value given the full filepath to the rendered Markdown file. A common use case is to add front matter to use the generated documentation with [Hugo](http://gohugo.io/):
-
-```go
-const fmTemplate = `---
-date: %s
-title: "%s"
-slug: %s
-url: %s
----
-`
-
-filePrepender := func(filename string) string {
-	now := time.Now().Format(time.RFC3339)
-	name := filepath.Base(filename)
-	base := strings.TrimSuffix(name, path.Ext(name))
-	url := "/commands/" + strings.ToLower(base) + "/"
-	return fmt.Sprintf(fmTemplate, now, strings.Replace(base, "_", " ", -1), base, url)
-}
-```
-
-The `linkHandler` can be used to customize the rendered internal links to the commands, given a filename:
-
-```go
-linkHandler := func(name string) string {
-	base := strings.TrimSuffix(name, path.Ext(name))
-	return "/commands/" + strings.ToLower(base) + "/"
-}
-```
- 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/md_docs_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/md_docs_test.go b/Godeps/_workspace/src/github.com/spf13/cobra/md_docs_test.go
deleted file mode 100644
index defc941..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/md_docs_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-package cobra
-
-import (
-	"bytes"
-	"fmt"
-	"os"
-	"strings"
-	"testing"
-)
-
-var _ = fmt.Println
-var _ = os.Stderr
-
-func TestGenMdDoc(t *testing.T) {
-	c := initializeWithRootCmd()
-	// Need two commands to run the command alphabetical sort
-	cmdEcho.AddCommand(cmdTimes, cmdEchoSub, cmdDeprecated)
-	c.AddCommand(cmdPrint, cmdEcho)
-	cmdRootWithRun.PersistentFlags().StringVarP(&flags2a, "rootflag", "r", "two", strtwoParentHelp)
-
-	out := new(bytes.Buffer)
-
-	// We generate on s subcommand so we have both subcommands and parents
-	GenMarkdown(cmdEcho, out)
-	found := out.String()
-
-	// Our description
-	expected := cmdEcho.Long
-	if !strings.Contains(found, expected) {
-		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
-	}
-
-	// Better have our example
-	expected = cmdEcho.Example
-	if !strings.Contains(found, expected) {
-		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
-	}
-
-	// A local flag
-	expected = "boolone"
-	if !strings.Contains(found, expected) {
-		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
-	}
-
-	// persistent flag on parent
-	expected = "rootflag"
-	if !strings.Contains(found, expected) {
-		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
-	}
-
-	// We better output info about our parent
-	expected = cmdRootWithRun.Short
-	if !strings.Contains(found, expected) {
-		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
-	}
-
-	// And about subcommands
-	expected = cmdEchoSub.Short
-	if !strings.Contains(found, expected) {
-		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
-	}
-
-	unexpected := cmdDeprecated.Short
-	if strings.Contains(found, unexpected) {
-		t.Errorf("Unexpected response.\nFound: %v\nBut should not have!!\n", unexpected)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/.gitignore b/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/.gitignore
deleted file mode 100644
index 0026861..0000000
--- a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/LICENSE b/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/LICENSE
deleted file mode 100644
index 4527efb..0000000
--- a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Steve Francia
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/README.md b/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/README.md
deleted file mode 100644
index 2f6c9c8..0000000
--- a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/README.md
+++ /dev/null
@@ -1,158 +0,0 @@
-jWalterWeatherman
-=================
-
-Seamless printing to the terminal (stdout) and logging to a io.Writer
-(file) that’s as easy to use as fmt.Println.
-
-![Always Leave A Note](http://spf13.github.com/jwalterweatherman/and_that__s_why_you_always_leave_a_note_by_jonnyetc-d57q7um.jpg)
-Graphic by [JonnyEtc](http://jonnyetc.deviantart.com/art/And-That-s-Why-You-Always-Leave-a-Note-315311422)
-
-JWW is primarily a wrapper around the excellent standard log library. It
-provides a few advantages over using the standard log library alone.
-
-1. Ready to go out of the box. 
-2. One library for both printing to the terminal and logging (to files).
-3. Really easy to log to either a temp file or a file you specify.
-
-
-I really wanted a very straightforward library that could seamlessly do
-the following things.
-
-1. Replace all the println, printf, etc statements thought my code with
-   something more useful
-2. Allow the user to easily control what levels are printed to stdout
-3. Allow the user to easily control what levels are logged
-4. Provide an easy mechanism (like fmt.Println) to print info to the user
-   which can be easily logged as well 
-5. Due to 2 & 3 provide easy verbose mode for output and logs
-6. Not have any unnecessary initialization cruft. Just use it.
-
-# Usage
-
-## Step 1. Use it
-Put calls throughout your source based on type of feedback.
-No initialization or setup needs to happen. Just start calling things.
-
-Available Loggers are:
-
- * TRACE
- * DEBUG
- * INFO
- * WARN
- * ERROR
- * CRITICAL
- * FATAL
-
-These each are loggers based on the log standard library and follow the
-standard usage. Eg..
-
-```go
-    import (
-        jww "github.com/spf13/jwalterweatherman"
-    )
-
-    ...
-
-    if err != nil {
-
-        // This is a pretty serious error and the user should know about
-        // it. It will be printed to the terminal as well as logged under the
-        // default thresholds.
-
-        jww.ERROR.Println(err)
-    }
-
-    if err2 != nil {
-        // This error isn’t going to materially change the behavior of the
-        // application, but it’s something that may not be what the user
-        // expects. Under the default thresholds, Warn will be logged, but
-        // not printed to the terminal. 
-
-        jww.WARN.Println(err2)
-    }
-
-    // Information that’s relevant to what’s happening, but not very
-    // important for the user. Under the default thresholds this will be
-    // discarded.
-
-    jww.INFO.Printf("information %q", response)
-
-```
-
-_Why 7 levels?_
-
-Maybe you think that 7 levels are too much for any application... and you
-are probably correct. Just because there are seven levels doesn’t mean
-that you should be using all 7 levels. Pick the right set for your needs.
-Remember they only have to mean something to your project.
-
-## Step 2. Optionally configure JWW
-
-Under the default thresholds :
-
- * Debug, Trace & Info goto /dev/null
- * Warn and above is logged (when a log file/io.Writer is provided)
- * Error and above is printed to the terminal (stdout)
-
-### Changing the thresholds
-
-The threshold can be changed at any time, but will only affect calls that
-execute after the change was made.
-
-This is very useful if your application has a verbose mode. Of course you
-can decide what verbose means to you or even have multiple levels of
-verbosity.
-
-
-```go
-    import (
-        jww "github.com/spf13/jwalterweatherman"
-    )
-
-    if Verbose {
-        jww.SetLogThreshold(jww.LevelTrace)
-        jww.SetStdoutThreshold(jww.LevelInfo)
-    }
-```
-
-### Using a temp log file
-
-JWW conveniently creates a temporary file and sets the log Handle to
-a io.Writer created for it. You should call this early in your application
-initialization routine as it will only log calls made after it is executed. 
-When this option is used, the library will fmt.Println where to find the
-log file.
-
-```go
-    import (
-        jww "github.com/spf13/jwalterweatherman"
-    )
-
-    jww.UseTempLogFile("YourAppName") 
-
-```
-
-### Setting a log file
-
-JWW can log to any file you provide a path to (provided it’s writable).
-Will only append to this file.
-
-
-```go
-    import (
-        jww "github.com/spf13/jwalterweatherman"
-    )
-
-    jww.SetLogFile("/path/to/logfile") 
-
-```
-
-
-# More information
-
-This is an early release. I’ve been using it for a while and this is the
-third interface I’ve tried. I like this one pretty well, but no guarantees
-that it won’t change a bit.
-
-I wrote this for use in [hugo](http://hugo.spf13.com). If you are looking
-for a static website engine that’s super fast please checkout Hugo.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/jww_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/jww_test.go b/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/jww_test.go
deleted file mode 100644
index b6d118a..0000000
--- a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/jww_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright © 2014 Steve Francia <sp...@spf13.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package jwalterweatherman
-
-import (
-    "bytes"
-    "github.com/stretchr/testify/assert"
-    "testing"
-)
-
-func TestLevels(t *testing.T) {
-    SetStdoutThreshold(LevelError)
-    assert.Equal(t, StdoutThreshold(), LevelError)
-    SetLogThreshold(LevelCritical)
-    assert.Equal(t, LogThreshold(), LevelCritical)
-    assert.NotEqual(t, StdoutThreshold(), LevelCritical)
-    SetStdoutThreshold(LevelWarn)
-    assert.Equal(t, StdoutThreshold(), LevelWarn)
-}
-
-func TestDefaultLogging(t *testing.T) {
-    outputBuf := new(bytes.Buffer)
-    logBuf := new(bytes.Buffer)
-    LogHandle = logBuf
-    OutHandle = outputBuf
-
-    SetLogThreshold(LevelWarn)
-    SetStdoutThreshold(LevelError)
-
-    FATAL.Println("fatal err")
-    CRITICAL.Println("critical err")
-    ERROR.Println("an error")
-    WARN.Println("a warning")
-    INFO.Println("information")
-    DEBUG.Println("debugging info")
-    TRACE.Println("trace")
-
-    assert.Contains(t, logBuf.String(), "fatal err")
-    assert.Contains(t, logBuf.String(), "critical err")
-    assert.Contains(t, logBuf.String(), "an error")
-    assert.Contains(t, logBuf.String(), "a warning")
-    assert.NotContains(t, logBuf.String(), "information")
-    assert.NotContains(t, logBuf.String(), "debugging info")
-    assert.NotContains(t, logBuf.String(), "trace")
-
-    assert.Contains(t, outputBuf.String(), "fatal err")
-    assert.Contains(t, outputBuf.String(), "critical err")
-    assert.Contains(t, outputBuf.String(), "an error")
-    assert.NotContains(t, outputBuf.String(), "a warning")
-    assert.NotContains(t, outputBuf.String(), "information")
-    assert.NotContains(t, outputBuf.String(), "debugging info")
-    assert.NotContains(t, outputBuf.String(), "trace")
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go b/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go
deleted file mode 100644
index 2f3d721..0000000
--- a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go
+++ /dev/null
@@ -1,183 +0,0 @@
-// Copyright © 2014 Steve Francia <sp...@spf13.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package jwalterweatherman
-
-import (
-	"fmt"
-	"io"
-	"io/ioutil"
-	"log"
-	"os"
-)
-
-// Level describes the chosen log level between
-// debug and critical.
-type Level int
-
-type NotePad struct {
-	Handle io.Writer
-	Level  Level
-	Prefix string
-	Logger **log.Logger
-}
-
-// Feedback is special. It writes plainly to the output while
-// logging with the standard extra information (date, file, etc)
-// Only Println and Printf are currently provided for this
-type Feedback struct{}
-
-const (
-	LevelTrace Level = iota
-	LevelDebug
-	LevelInfo
-	LevelWarn
-	LevelError
-	LevelCritical
-	LevelFatal
-	DefaultLogThreshold    = LevelWarn
-	DefaultStdoutThreshold = LevelError
-)
-
-var (
-	TRACE      *log.Logger
-	DEBUG      *log.Logger
-	INFO       *log.Logger
-	WARN       *log.Logger
-	ERROR      *log.Logger
-	CRITICAL   *log.Logger
-	FATAL      *log.Logger
-	LOG        *log.Logger
-	FEEDBACK   Feedback
-	LogHandle  io.Writer  = ioutil.Discard
-	OutHandle  io.Writer  = os.Stdout
-	BothHandle io.Writer  = io.MultiWriter(LogHandle, OutHandle)
-	NotePads   []*NotePad = []*NotePad{trace, debug, info, warn, err, critical, fatal}
-
-	trace           *NotePad = &NotePad{Level: LevelTrace, Handle: os.Stdout, Logger: &TRACE, Prefix: "TRACE: "}
-	debug           *NotePad = &NotePad{Level: LevelDebug, Handle: os.Stdout, Logger: &DEBUG, Prefix: "DEBUG: "}
-	info            *NotePad = &NotePad{Level: LevelInfo, Handle: os.Stdout, Logger: &INFO, Prefix: "INFO: "}
-	warn            *NotePad = &NotePad{Level: LevelWarn, Handle: os.Stdout, Logger: &WARN, Prefix: "WARN: "}
-	err             *NotePad = &NotePad{Level: LevelError, Handle: os.Stdout, Logger: &ERROR, Prefix: "ERROR: "}
-	critical        *NotePad = &NotePad{Level: LevelCritical, Handle: os.Stdout, Logger: &CRITICAL, Prefix: "CRITICAL: "}
-	fatal           *NotePad = &NotePad{Level: LevelFatal, Handle: os.Stdout, Logger: &FATAL, Prefix: "FATAL: "}
-	logThreshold    Level    = DefaultLogThreshold
-	outputThreshold Level    = DefaultStdoutThreshold
-)
-
-func init() {
-	SetStdoutThreshold(DefaultStdoutThreshold)
-}
-
-// initialize will setup the jWalterWeatherman standard approach of providing the user
-// some feedback and logging a potentially different amount based on independent log and output thresholds.
-// By default the output has a lower threshold than logged
-// Don't use if you have manually set the Handles of the different levels as it will overwrite them.
-func initialize() {
-	BothHandle = io.MultiWriter(LogHandle, OutHandle)
-
-	for _, n := range NotePads {
-		if n.Level < outputThreshold && n.Level < logThreshold {
-			n.Handle = ioutil.Discard
-		} else if n.Level >= outputThreshold && n.Level >= logThreshold {
-			n.Handle = BothHandle
-		} else if n.Level >= outputThreshold && n.Level < logThreshold {
-			n.Handle = OutHandle
-		} else {
-			n.Handle = LogHandle
-		}
-	}
-
-	for _, n := range NotePads {
-		*n.Logger = log.New(n.Handle, n.Prefix, log.Ldate)
-	}
-
-	LOG = log.New(LogHandle,
-		"LOG:   ",
-		log.Ldate|log.Ltime|log.Lshortfile)
-}
-
-// Level returns the current global log threshold.
-func LogThreshold() Level {
-	return logThreshold
-}
-
-// Level returns the current global output threshold.
-func StdoutThreshold() Level {
-	return outputThreshold
-}
-
-// Ensures that the level provided is within the bounds of available levels
-func levelCheck(level Level) Level {
-	switch {
-	case level <= LevelTrace:
-		return LevelTrace
-	case level >= LevelFatal:
-		return LevelFatal
-	default:
-		return level
-	}
-}
-
-// Establishes a threshold where anything matching or above will be logged
-func SetLogThreshold(level Level) {
-	logThreshold = levelCheck(level)
-	initialize()
-}
-
-// Establishes a threshold where anything matching or above will be output
-func SetStdoutThreshold(level Level) {
-	outputThreshold = levelCheck(level)
-	initialize()
-}
-
-// Conveniently Sets the Log Handle to a io.writer created for the file behind the given filepath
-// Will only append to this file
-func SetLogFile(path string) {
-	file, err := os.OpenFile(path, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666)
-	if err != nil {
-		CRITICAL.Println("Failed to open log file:", path, err)
-		os.Exit(-1)
-	}
-        fmt.Println("Logging to", file.Name())
-
-	LogHandle = file
-	initialize()
-}
-
-// Conveniently Creates a temporary file and sets the Log Handle to a io.writer created for it
-func UseTempLogFile(prefix string) {
-	file, err := ioutil.TempFile(os.TempDir(), prefix)
-	if err != nil {
-		CRITICAL.Println(err)
-	}
-
-	fmt.Println("Logging to", file.Name())
-
-	LogHandle = file
-	initialize()
-}
-
-// Disables logging for the entire JWW system
-func DiscardLogging() {
-	LogHandle = ioutil.Discard
-	initialize()
-}
-
-// Feedback is special. It writes plainly to the output while
-// logging with the standard extra information (date, file, etc)
-// Only Println and Printf are currently provided for this
-func (fb *Feedback) Println(v ...interface{}) {
-	fmt.Println(v...)
-	LOG.Println(v...)
-}
-
-// Feedback is special. It writes plainly to the output while
-// logging with the standard extra information (date, file, etc)
-// Only Println and Printf are currently provided for this
-func (fb *Feedback) Printf(format string, v ...interface{}) {
-	fmt.Printf(format, v...)
-	LOG.Printf(format, v...)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml b/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml
deleted file mode 100644
index c4d88e3..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-sudo: false
-
-language: go
-
-go:
-        - 1.3
-        - 1.4
-        - tip

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE b/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE
deleted file mode 100644
index 63ed1cf..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2012 Alex Ogier. All rights reserved.
-Copyright (c) 2012 The Go Authors. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-   * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-   * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
-   * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/README.md b/Godeps/_workspace/src/github.com/spf13/pflag/README.md
deleted file mode 100644
index deee931..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/README.md
+++ /dev/null
@@ -1,228 +0,0 @@
-[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag)
-
-## Description
-
-pflag is a drop-in replacement for Go's flag package, implementing
-POSIX/GNU-style --flags.
-
-pflag is compatible with the [GNU extensions to the POSIX recommendations
-for command-line options][1]. For a more precise description, see the
-"Command-line flag syntax" section below.
-
-[1]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
-
-pflag is available under the same style of BSD license as the Go language,
-which can be found in the LICENSE file.
-
-## Installation
-
-pflag is available using the standard `go get` command.
-
-Install by running:
-
-    go get github.com/spf13/pflag
-
-Run tests by running:
-
-    go test github.com/spf13/pflag
-
-## Usage
-
-pflag is a drop-in replacement of Go's native flag package. If you import
-pflag under the name "flag" then all code should continue to function
-with no changes.
-
-``` go
-import flag "github.com/spf13/pflag"
-```
-
-There is one exception to this: if you directly instantiate the Flag struct
-there is one more field "Shorthand" that you will need to set.
-Most code never instantiates this struct directly, and instead uses
-functions such as String(), BoolVar(), and Var(), and is therefore
-unaffected.
-
-Define flags using flag.String(), Bool(), Int(), etc.
-
-This declares an integer flag, -flagname, stored in the pointer ip, with type *int.
-
-``` go
-var ip *int = flag.Int("flagname", 1234, "help message for flagname")
-```
-
-If you like, you can bind the flag to a variable using the Var() functions.
-
-``` go
-var flagvar int
-func init() {
-    flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname")
-}
-```
-
-Or you can create custom flags that satisfy the Value interface (with
-pointer receivers) and couple them to flag parsing by
-
-``` go
-flag.Var(&flagVal, "name", "help message for flagname")
-```
-
-For such flags, the default value is just the initial value of the variable.
-
-After all flags are defined, call
-
-``` go
-flag.Parse()
-```
-
-to parse the command line into the defined flags.
-
-Flags may then be used directly. If you're using the flags themselves,
-they are all pointers; if you bind to variables, they're values.
-
-``` go
-fmt.Println("ip has value ", *ip)
-fmt.Println("flagvar has value ", flagvar)
-```
-
-There are helpers function to get values later if you have the FlagSet but
-it was difficult to keep up with all of the the flag pointers in your code.
-If you have a pflag.FlagSet with a flag called 'flagname' of type int you
-can use GetInt() to get the int value. But notice that 'flagname' must exist
-and it must be an int. GetString("flagname") will fail.
-
-``` go
-i, err := flagset.GetInt("flagname")
-```
-
-After parsing, the arguments after the flag are available as the
-slice flag.Args() or individually as flag.Arg(i).
-The arguments are indexed from 0 through flag.NArg()-1.
-
-The pflag package also defines some new functions that are not in flag,
-that give one-letter shorthands for flags. You can use these by appending
-'P' to the name of any function that defines a flag.
-
-``` go
-var ip = flag.IntP("flagname", "f", 1234, "help message")
-var flagvar bool
-func init() {
-    flag.BoolVarP("boolname", "b", true, "help message")
-}
-flag.VarP(&flagVar, "varname", "v", 1234, "help message")
-```
-
-Shorthand letters can be used with single dashes on the command line.
-Boolean shorthand flags can be combined with other shorthand flags.
-
-The default set of command-line flags is controlled by
-top-level functions.  The FlagSet type allows one to define
-independent sets of flags, such as to implement subcommands
-in a command-line interface. The methods of FlagSet are
-analogous to the top-level functions for the command-line
-flag set.
-
-## Setting no option default values for flags
-
-After you create a flag it is possible to set the pflag.NoOptDefVal for
-the given flag. Doing this changes the meaning of the flag slightly. If
-a flag has a NoOptDefVal and the flag is set on the command line without
-an option the flag will be set to the NoOptDefVal. For example given:
-
-``` go
-var ip = flag.IntP("flagname", "f", 1234, "help message")
-flag.Lookup("flagname").NoOptDefVal = "4321"
-```
-
-Would result in something like
-
-| Parsed Arguments | Resulting Value |
-| -------------    | -------------   |
-| --flagname=1357  | ip=1357         |
-| --flagname       | ip=4321         |
-| [nothing]        | ip=1234         |
-
-## Command line flag syntax
-
-```
---flag    // boolean flags, or flags with no option default values
---flag x  // only on flags without a default value
---flag=x
-```
-
-Unlike the flag package, a single dash before an option means something
-different than a double dash. Single dashes signify a series of shorthand
-letters for flags. All but the last shorthand letter must be boolean flags
-or a flag with a default value
-
-```
-// boolean or flags where the 'no option default value' is set
--f
--f=true
--abc
-but
--b true is INVALID
-
-// non-boolean and flags without a 'no option default value'
--n 1234
--n=1234
--n1234
-
-// mixed
--abcs "hello"
--absd="hello"
--abcs1234
-```
-
-Flag parsing stops after the terminator "--". Unlike the flag package,
-flags can be interspersed with arguments anywhere on the command line
-before this terminator.
-
-Integer flags accept 1234, 0664, 0x1234 and may be negative.
-Boolean flags (in their long form) accept 1, 0, t, f, true, false,
-TRUE, FALSE, True, False.
-Duration flags accept any input valid for time.ParseDuration.
-
-## Mutating or "Normalizing" Flag names
-
-It is possible to set a custom flag name 'normalization function.' It allows flag names to be mutated both when created in the code and when used on the command line to some 'normalized' form. The 'normalized' form is used for comparison. Two examples of using the custom normalization func follow.
-
-**Example #1**: You want -, _, and . in flags to compare the same. aka --my-flag == --my_flag == --my.flag
-
-``` go
-func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
-	from := []string{"-", "_"}
-	to := "."
-	for _, sep := range from {
-		name = strings.Replace(name, sep, to, -1)
-	}
-	return pflag.NormalizedName(name)
-}
-
-myFlagSet.SetNormalizeFunc(wordSepNormalizeFunc)
-```
-
-**Example #2**: You want to alias two flags. aka --old-flag-name == --new-flag-name
-
-``` go
-func aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
-	switch name {
-	case "old-flag-name":
-		name = "new-flag-name"
-		break
-	}
-	return pflag.NormalizedName(name)
-}
-
-myFlagSet.SetNormalizeFunc(aliasNormalizeFunc)
-```
-
-## More info
-
-You can see the full reference documentation of the pflag package
-[at godoc.org][3], or through go's standard documentation system by
-running `godoc -http=:6060` and browsing to
-[http://localhost:6060/pkg/github.com/ogier/pflag][2] after
-installation.
-
-[2]: http://localhost:6060/pkg/github.com/ogier/pflag
-[3]: http://godoc.org/github.com/ogier/pflag

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/bool.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/bool.go b/Godeps/_workspace/src/github.com/spf13/pflag/bool.go
deleted file mode 100644
index 04c9b5a..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/bool.go
+++ /dev/null
@@ -1,97 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// optional interface to indicate boolean flags that can be
-// supplied without "=value" text
-type boolFlag interface {
-	Value
-	IsBoolFlag() bool
-}
-
-// -- bool Value
-type boolValue bool
-
-func newBoolValue(val bool, p *bool) *boolValue {
-	*p = val
-	return (*boolValue)(p)
-}
-
-func (b *boolValue) Set(s string) error {
-	v, err := strconv.ParseBool(s)
-	*b = boolValue(v)
-	return err
-}
-
-func (b *boolValue) Type() string {
-	return "bool"
-}
-
-func (b *boolValue) String() string { return fmt.Sprintf("%v", *b) }
-
-func (b *boolValue) IsBoolFlag() bool { return true }
-
-func boolConv(sval string) (interface{}, error) {
-	return strconv.ParseBool(sval)
-}
-
-// GetBool return the bool value of a flag with the given name
-func (f *FlagSet) GetBool(name string) (bool, error) {
-	val, err := f.getFlagType(name, "bool", boolConv)
-	if err != nil {
-		return false, err
-	}
-	return val.(bool), nil
-}
-
-// BoolVar defines a bool flag with specified name, default value, and usage string.
-// The argument p points to a bool variable in which to store the value of the flag.
-func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) {
-	f.BoolVarP(p, name, "", value, usage)
-}
-
-// Like BoolVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
-	flag := f.VarPF(newBoolValue(value, p), name, shorthand, usage)
-	flag.NoOptDefVal = "true"
-}
-
-// BoolVar defines a bool flag with specified name, default value, and usage string.
-// The argument p points to a bool variable in which to store the value of the flag.
-func BoolVar(p *bool, name string, value bool, usage string) {
-	BoolVarP(p, name, "", value, usage)
-}
-
-// Like BoolVar, but accepts a shorthand letter that can be used after a single dash.
-func BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
-	flag := CommandLine.VarPF(newBoolValue(value, p), name, shorthand, usage)
-	flag.NoOptDefVal = "true"
-}
-
-// Bool defines a bool flag with specified name, default value, and usage string.
-// The return value is the address of a bool variable that stores the value of the flag.
-func (f *FlagSet) Bool(name string, value bool, usage string) *bool {
-	return f.BoolP(name, "", value, usage)
-}
-
-// Like Bool, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool {
-	p := new(bool)
-	f.BoolVarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Bool defines a bool flag with specified name, default value, and usage string.
-// The return value is the address of a bool variable that stores the value of the flag.
-func Bool(name string, value bool, usage string) *bool {
-	return BoolP(name, "", value, usage)
-}
-
-// Like Bool, but accepts a shorthand letter that can be used after a single dash.
-func BoolP(name, shorthand string, value bool, usage string) *bool {
-	b := CommandLine.BoolP(name, shorthand, value, usage)
-	return b
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/bool_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/bool_test.go b/Godeps/_workspace/src/github.com/spf13/pflag/bool_test.go
deleted file mode 100644
index febf667..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/bool_test.go
+++ /dev/null
@@ -1,180 +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.
-
-package pflag
-
-import (
-	"bytes"
-	"fmt"
-	"strconv"
-	"testing"
-)
-
-// This value can be a boolean ("true", "false") or "maybe"
-type triStateValue int
-
-const (
-	triStateFalse triStateValue = 0
-	triStateTrue  triStateValue = 1
-	triStateMaybe triStateValue = 2
-)
-
-const strTriStateMaybe = "maybe"
-
-func (v *triStateValue) IsBoolFlag() bool {
-	return true
-}
-
-func (v *triStateValue) Get() interface{} {
-	return triStateValue(*v)
-}
-
-func (v *triStateValue) Set(s string) error {
-	if s == strTriStateMaybe {
-		*v = triStateMaybe
-		return nil
-	}
-	boolVal, err := strconv.ParseBool(s)
-	if boolVal {
-		*v = triStateTrue
-	} else {
-		*v = triStateFalse
-	}
-	return err
-}
-
-func (v *triStateValue) String() string {
-	if *v == triStateMaybe {
-		return strTriStateMaybe
-	}
-	return fmt.Sprintf("%v", bool(*v == triStateTrue))
-}
-
-// The type of the flag as requred by the pflag.Value interface
-func (v *triStateValue) Type() string {
-	return "version"
-}
-
-func setUpFlagSet(tristate *triStateValue) *FlagSet {
-	f := NewFlagSet("test", ContinueOnError)
-	*tristate = triStateFalse
-	flag := f.VarPF(tristate, "tristate", "t", "tristate value (true, maybe or false)")
-	flag.NoOptDefVal = "true"
-	return f
-}
-
-func TestExplicitTrue(t *testing.T) {
-	var tristate triStateValue
-	f := setUpFlagSet(&tristate)
-	err := f.Parse([]string{"--tristate=true"})
-	if err != nil {
-		t.Fatal("expected no error; got", err)
-	}
-	if tristate != triStateTrue {
-		t.Fatal("expected", triStateTrue, "(triStateTrue) but got", tristate, "instead")
-	}
-}
-
-func TestImplicitTrue(t *testing.T) {
-	var tristate triStateValue
-	f := setUpFlagSet(&tristate)
-	err := f.Parse([]string{"--tristate"})
-	if err != nil {
-		t.Fatal("expected no error; got", err)
-	}
-	if tristate != triStateTrue {
-		t.Fatal("expected", triStateTrue, "(triStateTrue) but got", tristate, "instead")
-	}
-}
-
-func TestShortFlag(t *testing.T) {
-	var tristate triStateValue
-	f := setUpFlagSet(&tristate)
-	err := f.Parse([]string{"-t"})
-	if err != nil {
-		t.Fatal("expected no error; got", err)
-	}
-	if tristate != triStateTrue {
-		t.Fatal("expected", triStateTrue, "(triStateTrue) but got", tristate, "instead")
-	}
-}
-
-func TestShortFlagExtraArgument(t *testing.T) {
-	var tristate triStateValue
-	f := setUpFlagSet(&tristate)
-	// The"maybe"turns into an arg, since short boolean options will only do true/false
-	err := f.Parse([]string{"-t", "maybe"})
-	if err != nil {
-		t.Fatal("expected no error; got", err)
-	}
-	if tristate != triStateTrue {
-		t.Fatal("expected", triStateTrue, "(triStateTrue) but got", tristate, "instead")
-	}
-	args := f.Args()
-	if len(args) != 1 || args[0] != "maybe" {
-		t.Fatal("expected an extra 'maybe' argument to stick around")
-	}
-}
-
-func TestExplicitMaybe(t *testing.T) {
-	var tristate triStateValue
-	f := setUpFlagSet(&tristate)
-	err := f.Parse([]string{"--tristate=maybe"})
-	if err != nil {
-		t.Fatal("expected no error; got", err)
-	}
-	if tristate != triStateMaybe {
-		t.Fatal("expected", triStateMaybe, "(triStateMaybe) but got", tristate, "instead")
-	}
-}
-
-func TestExplicitFalse(t *testing.T) {
-	var tristate triStateValue
-	f := setUpFlagSet(&tristate)
-	err := f.Parse([]string{"--tristate=false"})
-	if err != nil {
-		t.Fatal("expected no error; got", err)
-	}
-	if tristate != triStateFalse {
-		t.Fatal("expected", triStateFalse, "(triStateFalse) but got", tristate, "instead")
-	}
-}
-
-func TestImplicitFalse(t *testing.T) {
-	var tristate triStateValue
-	f := setUpFlagSet(&tristate)
-	err := f.Parse([]string{})
-	if err != nil {
-		t.Fatal("expected no error; got", err)
-	}
-	if tristate != triStateFalse {
-		t.Fatal("expected", triStateFalse, "(triStateFalse) but got", tristate, "instead")
-	}
-}
-
-func TestInvalidValue(t *testing.T) {
-	var tristate triStateValue
-	f := setUpFlagSet(&tristate)
-	var buf bytes.Buffer
-	f.SetOutput(&buf)
-	err := f.Parse([]string{"--tristate=invalid"})
-	if err == nil {
-		t.Fatal("expected an error but did not get any, tristate has value", tristate)
-	}
-}
-
-func TestBoolP(t *testing.T) {
-	b := BoolP("bool", "b", false, "bool value in CommandLine")
-	c := BoolP("c", "c", false, "other bool value")
-	args := []string{"--bool"}
-	if err := CommandLine.Parse(args); err != nil {
-		t.Error("expected no error, got ", err)
-	}
-	if *b != true {
-		t.Errorf("expected b=true got b=%s", b)
-	}
-	if *c != false {
-		t.Errorf("expect c=false got c=%s", c)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/duration.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/duration.go b/Godeps/_workspace/src/github.com/spf13/pflag/duration.go
deleted file mode 100644
index 382ffd3..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/duration.go
+++ /dev/null
@@ -1,86 +0,0 @@
-package pflag
-
-import (
-	"time"
-)
-
-// -- time.Duration Value
-type durationValue time.Duration
-
-func newDurationValue(val time.Duration, p *time.Duration) *durationValue {
-	*p = val
-	return (*durationValue)(p)
-}
-
-func (d *durationValue) Set(s string) error {
-	v, err := time.ParseDuration(s)
-	*d = durationValue(v)
-	return err
-}
-
-func (d *durationValue) Type() string {
-	return "duration"
-}
-
-func (d *durationValue) String() string { return (*time.Duration)(d).String() }
-
-func durationConv(sval string) (interface{}, error) {
-	return time.ParseDuration(sval)
-}
-
-// GetDuration return the duration value of a flag with the given name
-func (f *FlagSet) GetDuration(name string) (time.Duration, error) {
-	val, err := f.getFlagType(name, "duration", durationConv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(time.Duration), nil
-}
-
-// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
-// The argument p points to a time.Duration variable in which to store the value of the flag.
-func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
-	f.VarP(newDurationValue(value, p), name, "", usage)
-}
-
-// Like DurationVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {
-	f.VarP(newDurationValue(value, p), name, shorthand, usage)
-}
-
-// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
-// The argument p points to a time.Duration variable in which to store the value of the flag.
-func DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
-	CommandLine.VarP(newDurationValue(value, p), name, "", usage)
-}
-
-// Like DurationVar, but accepts a shorthand letter that can be used after a single dash.
-func DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {
-	CommandLine.VarP(newDurationValue(value, p), name, shorthand, usage)
-}
-
-// Duration defines a time.Duration flag with specified name, default value, and usage string.
-// The return value is the address of a time.Duration variable that stores the value of the flag.
-func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration {
-	p := new(time.Duration)
-	f.DurationVarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Duration, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {
-	p := new(time.Duration)
-	f.DurationVarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Duration defines a time.Duration flag with specified name, default value, and usage string.
-// The return value is the address of a time.Duration variable that stores the value of the flag.
-func Duration(name string, value time.Duration, usage string) *time.Duration {
-	return CommandLine.DurationP(name, "", value, usage)
-}
-
-// Like Duration, but accepts a shorthand letter that can be used after a single dash.
-func DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {
-	return CommandLine.DurationP(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/example_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/example_test.go b/Godeps/_workspace/src/github.com/spf13/pflag/example_test.go
deleted file mode 100644
index 9be7a49..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/example_test.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2012 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.
-
-// These examples demonstrate more intricate uses of the flag package.
-package pflag_test
-
-import (
-	"errors"
-	"fmt"
-	"strings"
-	"time"
-
-	flag "github.com/spf13/pflag"
-)
-
-// Example 1: A single string flag called "species" with default value "gopher".
-var species = flag.String("species", "gopher", "the species we are studying")
-
-// Example 2: A flag with a shorthand letter.
-var gopherType = flag.StringP("gopher_type", "g", "pocket", "the variety of gopher")
-
-// Example 3: A user-defined flag type, a slice of durations.
-type interval []time.Duration
-
-// String is the method to format the flag's value, part of the flag.Value interface.
-// The String method's output will be used in diagnostics.
-func (i *interval) String() string {
-	return fmt.Sprint(*i)
-}
-
-func (i *interval) Type() string {
-	return "interval"
-}
-
-// Set is the method to set the flag value, part of the flag.Value interface.
-// Set's argument is a string to be parsed to set the flag.
-// It's a comma-separated list, so we split it.
-func (i *interval) Set(value string) error {
-	// If we wanted to allow the flag to be set multiple times,
-	// accumulating values, we would delete this if statement.
-	// That would permit usages such as
-	//	-deltaT 10s -deltaT 15s
-	// and other combinations.
-	if len(*i) > 0 {
-		return errors.New("interval flag already set")
-	}
-	for _, dt := range strings.Split(value, ",") {
-		duration, err := time.ParseDuration(dt)
-		if err != nil {
-			return err
-		}
-		*i = append(*i, duration)
-	}
-	return nil
-}
-
-// Define a flag to accumulate durations. Because it has a special type,
-// we need to use the Var function and therefore create the flag during
-// init.
-
-var intervalFlag interval
-
-func init() {
-	// Tie the command-line flag to the intervalFlag variable and
-	// set a usage message.
-	flag.Var(&intervalFlag, "deltaT", "comma-separated list of intervals to use between events")
-}
-
-func Example() {
-	// All the interesting pieces are with the variables declared above, but
-	// to enable the flag package to see the flags defined there, one must
-	// execute, typically at the start of main (not init!):
-	//	flag.Parse()
-	// We don't run it here because this is not a main function and
-	// the testing suite has already parsed the flags.
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/export_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/export_test.go b/Godeps/_workspace/src/github.com/spf13/pflag/export_test.go
deleted file mode 100644
index 9318fee..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/export_test.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2010 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.
-
-package pflag
-
-import (
-	"io/ioutil"
-	"os"
-)
-
-// Additional routines compiled into the package only during testing.
-
-// ResetForTesting clears all flag state and sets the usage function as directed.
-// After calling ResetForTesting, parse errors in flag handling will not
-// exit the program.
-func ResetForTesting(usage func()) {
-	CommandLine = &FlagSet{
-		name:          os.Args[0],
-		errorHandling: ContinueOnError,
-		output:        ioutil.Discard,
-	}
-	Usage = usage
-}
-
-// GetCommandLine returns the default FlagSet.
-func GetCommandLine() *FlagSet {
-	return CommandLine
-}


[34/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3.go b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3.go
deleted file mode 100644
index 233e7e9..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3.go
+++ /dev/null
@@ -1,675 +0,0 @@
-// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package sqlite3
-
-/*
-#cgo CFLAGS: -std=gnu99
-#cgo CFLAGS: -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE
-#cgo CFLAGS: -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
-#include <sqlite3-binding.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef __CYGWIN__
-# include <errno.h>
-#endif
-
-#ifndef SQLITE_OPEN_READWRITE
-# define SQLITE_OPEN_READWRITE 0
-#endif
-
-#ifndef SQLITE_OPEN_FULLMUTEX
-# define SQLITE_OPEN_FULLMUTEX 0
-#endif
-
-static int
-_sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs) {
-#ifdef SQLITE_OPEN_URI
-  return sqlite3_open_v2(filename, ppDb, flags | SQLITE_OPEN_URI, zVfs);
-#else
-  return sqlite3_open_v2(filename, ppDb, flags, zVfs);
-#endif
-}
-
-static int
-_sqlite3_bind_text(sqlite3_stmt *stmt, int n, char *p, int np) {
-  return sqlite3_bind_text(stmt, n, p, np, SQLITE_TRANSIENT);
-}
-
-static int
-_sqlite3_bind_blob(sqlite3_stmt *stmt, int n, void *p, int np) {
-  return sqlite3_bind_blob(stmt, n, p, np, SQLITE_TRANSIENT);
-}
-
-#include <stdio.h>
-#include <stdint.h>
-
-static int
-_sqlite3_exec(sqlite3* db, const char* pcmd, long* rowid, long* changes)
-{
-  int rv = sqlite3_exec(db, pcmd, 0, 0, 0);
-  *rowid = (long) sqlite3_last_insert_rowid(db);
-  *changes = (long) sqlite3_changes(db);
-  return rv;
-}
-
-static int
-_sqlite3_step(sqlite3_stmt* stmt, long* rowid, long* changes)
-{
-  int rv = sqlite3_step(stmt);
-  sqlite3* db = sqlite3_db_handle(stmt);
-  *rowid = (long) sqlite3_last_insert_rowid(db);
-  *changes = (long) sqlite3_changes(db);
-  return rv;
-}
-
-*/
-import "C"
-import (
-	"database/sql"
-	"database/sql/driver"
-	"errors"
-	"fmt"
-	"io"
-	"net/url"
-	"runtime"
-	"strconv"
-	"strings"
-	"time"
-	"unsafe"
-)
-
-// Timestamp formats understood by both this module and SQLite.
-// The first format in the slice will be used when saving time values
-// into the database. When parsing a string from a timestamp or
-// datetime column, the formats are tried in order.
-var SQLiteTimestampFormats = []string{
-	"2006-01-02 15:04:05.999999999",
-	"2006-01-02T15:04:05.999999999",
-	"2006-01-02 15:04:05",
-	"2006-01-02T15:04:05",
-	"2006-01-02 15:04",
-	"2006-01-02T15:04",
-	"2006-01-02",
-	"2006-01-02 15:04:05-07:00",
-}
-
-func init() {
-	sql.Register("sqlite3", &SQLiteDriver{})
-}
-
-// Return SQLite library Version information.
-func Version() (libVersion string, libVersionNumber int, sourceId string) {
-	libVersion = C.GoString(C.sqlite3_libversion())
-	libVersionNumber = int(C.sqlite3_libversion_number())
-	sourceId = C.GoString(C.sqlite3_sourceid())
-	return libVersion, libVersionNumber, sourceId
-}
-
-// Driver struct.
-type SQLiteDriver struct {
-	Extensions  []string
-	ConnectHook func(*SQLiteConn) error
-}
-
-// Conn struct.
-type SQLiteConn struct {
-	db     *C.sqlite3
-	loc    *time.Location
-	txlock string
-}
-
-// Tx struct.
-type SQLiteTx struct {
-	c *SQLiteConn
-}
-
-// Stmt struct.
-type SQLiteStmt struct {
-	c      *SQLiteConn
-	s      *C.sqlite3_stmt
-	nv     int
-	nn     []string
-	t      string
-	closed bool
-	cls    bool
-}
-
-// Result struct.
-type SQLiteResult struct {
-	id      int64
-	changes int64
-}
-
-// Rows struct.
-type SQLiteRows struct {
-	s        *SQLiteStmt
-	nc       int
-	cols     []string
-	decltype []string
-	cls      bool
-}
-
-// Commit transaction.
-func (tx *SQLiteTx) Commit() error {
-	_, err := tx.c.exec("COMMIT")
-	return err
-}
-
-// Rollback transaction.
-func (tx *SQLiteTx) Rollback() error {
-	_, err := tx.c.exec("ROLLBACK")
-	return err
-}
-
-// AutoCommit return which currently auto commit or not.
-func (c *SQLiteConn) AutoCommit() bool {
-	return int(C.sqlite3_get_autocommit(c.db)) != 0
-}
-
-func (c *SQLiteConn) lastError() Error {
-	return Error{
-		Code:         ErrNo(C.sqlite3_errcode(c.db)),
-		ExtendedCode: ErrNoExtended(C.sqlite3_extended_errcode(c.db)),
-		err:          C.GoString(C.sqlite3_errmsg(c.db)),
-	}
-}
-
-// Implements Execer
-func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, error) {
-	if len(args) == 0 {
-		return c.exec(query)
-	}
-
-	for {
-		s, err := c.Prepare(query)
-		if err != nil {
-			return nil, err
-		}
-		var res driver.Result
-		if s.(*SQLiteStmt).s != nil {
-			na := s.NumInput()
-			if len(args) < na {
-				return nil, fmt.Errorf("Not enough args to execute query. Expected %d, got %d.", na, len(args))
-			}
-			res, err = s.Exec(args[:na])
-			if err != nil && err != driver.ErrSkip {
-				s.Close()
-				return nil, err
-			}
-			args = args[na:]
-		}
-		tail := s.(*SQLiteStmt).t
-		s.Close()
-		if tail == "" {
-			return res, nil
-		}
-		query = tail
-	}
-}
-
-// Implements Queryer
-func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, error) {
-	for {
-		s, err := c.Prepare(query)
-		if err != nil {
-			return nil, err
-		}
-		s.(*SQLiteStmt).cls = true
-		na := s.NumInput()
-		if len(args) < na {
-			return nil, fmt.Errorf("Not enough args to execute query. Expected %d, got %d.", na, len(args))
-		}
-		rows, err := s.Query(args[:na])
-		if err != nil && err != driver.ErrSkip {
-			s.Close()
-			return nil, err
-		}
-		args = args[na:]
-		tail := s.(*SQLiteStmt).t
-		if tail == "" {
-			return rows, nil
-		}
-		rows.Close()
-		s.Close()
-		query = tail
-	}
-}
-
-func (c *SQLiteConn) exec(cmd string) (driver.Result, error) {
-	pcmd := C.CString(cmd)
-	defer C.free(unsafe.Pointer(pcmd))
-
-	var rowid, changes C.long
-	rv := C._sqlite3_exec(c.db, pcmd, &rowid, &changes)
-	if rv != C.SQLITE_OK {
-		return nil, c.lastError()
-	}
-	return &SQLiteResult{int64(rowid), int64(changes)}, nil
-}
-
-// Begin transaction.
-func (c *SQLiteConn) Begin() (driver.Tx, error) {
-	if _, err := c.exec(c.txlock); err != nil {
-		return nil, err
-	}
-	return &SQLiteTx{c}, nil
-}
-
-func errorString(err Error) string {
-	return C.GoString(C.sqlite3_errstr(C.int(err.Code)))
-}
-
-// Open database and return a new connection.
-// You can specify DSN string with URI filename.
-//   test.db
-//   file:test.db?cache=shared&mode=memory
-//   :memory:
-//   file::memory:
-// go-sqlite handle especially query parameters.
-//   _loc=XXX
-//     Specify location of time format. It's possible to specify "auto".
-//   _busy_timeout=XXX
-//     Specify value for sqlite3_busy_timeout.
-//   _txlock=XXX
-//     Specify locking behavior for transactions.  XXX can be "immediate",
-//     "deferred", "exclusive".
-func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
-	if C.sqlite3_threadsafe() == 0 {
-		return nil, errors.New("sqlite library was not compiled for thread-safe operation")
-	}
-
-	var loc *time.Location
-	txlock := "BEGIN"
-	busy_timeout := 5000
-	pos := strings.IndexRune(dsn, '?')
-	if pos >= 1 {
-		params, err := url.ParseQuery(dsn[pos+1:])
-		if err != nil {
-			return nil, err
-		}
-
-		// _loc
-		if val := params.Get("_loc"); val != "" {
-			if val == "auto" {
-				loc = time.Local
-			} else {
-				loc, err = time.LoadLocation(val)
-				if err != nil {
-					return nil, fmt.Errorf("Invalid _loc: %v: %v", val, err)
-				}
-			}
-		}
-
-		// _busy_timeout
-		if val := params.Get("_busy_timeout"); val != "" {
-			iv, err := strconv.ParseInt(val, 10, 64)
-			if err != nil {
-				return nil, fmt.Errorf("Invalid _busy_timeout: %v: %v", val, err)
-			}
-			busy_timeout = int(iv)
-		}
-
-		// _txlock
-		if val := params.Get("_txlock"); val != "" {
-			switch val {
-			case "immediate":
-				txlock = "BEGIN IMMEDIATE"
-			case "exclusive":
-				txlock = "BEGIN EXCLUSIVE"
-			case "deferred":
-				txlock = "BEGIN"
-			default:
-				return nil, fmt.Errorf("Invalid _txlock: %v", val)
-			}
-		}
-
-		if !strings.HasPrefix(dsn, "file:") {
-			dsn = dsn[:pos]
-		}
-	}
-
-	var db *C.sqlite3
-	name := C.CString(dsn)
-	defer C.free(unsafe.Pointer(name))
-	rv := C._sqlite3_open_v2(name, &db,
-		C.SQLITE_OPEN_FULLMUTEX|
-			C.SQLITE_OPEN_READWRITE|
-			C.SQLITE_OPEN_CREATE,
-		nil)
-	if rv != 0 {
-		return nil, Error{Code: ErrNo(rv)}
-	}
-	if db == nil {
-		return nil, errors.New("sqlite succeeded without returning a database")
-	}
-
-	rv = C.sqlite3_busy_timeout(db, C.int(busy_timeout))
-	if rv != C.SQLITE_OK {
-		return nil, Error{Code: ErrNo(rv)}
-	}
-
-	conn := &SQLiteConn{db: db, loc: loc, txlock: txlock}
-
-	if len(d.Extensions) > 0 {
-		rv = C.sqlite3_enable_load_extension(db, 1)
-		if rv != C.SQLITE_OK {
-			return nil, errors.New(C.GoString(C.sqlite3_errmsg(db)))
-		}
-
-		for _, extension := range d.Extensions {
-			cext := C.CString(extension)
-			defer C.free(unsafe.Pointer(cext))
-			rv = C.sqlite3_load_extension(db, cext, nil, nil)
-			if rv != C.SQLITE_OK {
-				return nil, errors.New(C.GoString(C.sqlite3_errmsg(db)))
-			}
-		}
-
-		rv = C.sqlite3_enable_load_extension(db, 0)
-		if rv != C.SQLITE_OK {
-			return nil, errors.New(C.GoString(C.sqlite3_errmsg(db)))
-		}
-	}
-
-	if d.ConnectHook != nil {
-		if err := d.ConnectHook(conn); err != nil {
-			return nil, err
-		}
-	}
-	runtime.SetFinalizer(conn, (*SQLiteConn).Close)
-	return conn, nil
-}
-
-// Close the connection.
-func (c *SQLiteConn) Close() error {
-	rv := C.sqlite3_close_v2(c.db)
-	if rv != C.SQLITE_OK {
-		return c.lastError()
-	}
-	c.db = nil
-	runtime.SetFinalizer(c, nil)
-	return nil
-}
-
-// Prepare query string. Return a new statement.
-func (c *SQLiteConn) Prepare(query string) (driver.Stmt, error) {
-	pquery := C.CString(query)
-	defer C.free(unsafe.Pointer(pquery))
-	var s *C.sqlite3_stmt
-	var tail *C.char
-	rv := C.sqlite3_prepare_v2(c.db, pquery, -1, &s, &tail)
-	if rv != C.SQLITE_OK {
-		return nil, c.lastError()
-	}
-	var t string
-	if tail != nil && *tail != '\000' {
-		t = strings.TrimSpace(C.GoString(tail))
-	}
-	nv := int(C.sqlite3_bind_parameter_count(s))
-	var nn []string
-	for i := 0; i < nv; i++ {
-		pn := C.GoString(C.sqlite3_bind_parameter_name(s, C.int(i+1)))
-		if len(pn) > 1 && pn[0] == '$' && 48 <= pn[1] && pn[1] <= 57 {
-			nn = append(nn, C.GoString(C.sqlite3_bind_parameter_name(s, C.int(i+1))))
-		}
-	}
-	ss := &SQLiteStmt{c: c, s: s, nv: nv, nn: nn, t: t}
-	runtime.SetFinalizer(ss, (*SQLiteStmt).Close)
-	return ss, nil
-}
-
-// Close the statement.
-func (s *SQLiteStmt) Close() error {
-	if s.closed {
-		return nil
-	}
-	s.closed = true
-	if s.c == nil || s.c.db == nil {
-		return errors.New("sqlite statement with already closed database connection")
-	}
-	rv := C.sqlite3_finalize(s.s)
-	if rv != C.SQLITE_OK {
-		return s.c.lastError()
-	}
-	runtime.SetFinalizer(s, nil)
-	return nil
-}
-
-// Return a number of parameters.
-func (s *SQLiteStmt) NumInput() int {
-	return s.nv
-}
-
-type bindArg struct {
-	n int
-	v driver.Value
-}
-
-func (s *SQLiteStmt) bind(args []driver.Value) error {
-	rv := C.sqlite3_reset(s.s)
-	if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE {
-		return s.c.lastError()
-	}
-
-	var vargs []bindArg
-	narg := len(args)
-	vargs = make([]bindArg, narg)
-	if len(s.nn) > 0 {
-		for i, v := range s.nn {
-			if pi, err := strconv.Atoi(v[1:]); err == nil {
-				vargs[i] = bindArg{pi, args[i]}
-			}
-		}
-	} else {
-		for i, v := range args {
-			vargs[i] = bindArg{i + 1, v}
-		}
-	}
-
-	for _, varg := range vargs {
-		n := C.int(varg.n)
-		v := varg.v
-		switch v := v.(type) {
-		case nil:
-			rv = C.sqlite3_bind_null(s.s, n)
-		case string:
-			if len(v) == 0 {
-				b := []byte{0}
-				rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(0))
-			} else {
-				b := []byte(v)
-				rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b)))
-			}
-		case int64:
-			rv = C.sqlite3_bind_int64(s.s, n, C.sqlite3_int64(v))
-		case bool:
-			if bool(v) {
-				rv = C.sqlite3_bind_int(s.s, n, 1)
-			} else {
-				rv = C.sqlite3_bind_int(s.s, n, 0)
-			}
-		case float64:
-			rv = C.sqlite3_bind_double(s.s, n, C.double(v))
-		case []byte:
-			var p *byte
-			if len(v) > 0 {
-				p = &v[0]
-			}
-			rv = C._sqlite3_bind_blob(s.s, n, unsafe.Pointer(p), C.int(len(v)))
-		case time.Time:
-			b := []byte(v.UTC().Format(SQLiteTimestampFormats[0]))
-			rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b)))
-		}
-		if rv != C.SQLITE_OK {
-			return s.c.lastError()
-		}
-	}
-	return nil
-}
-
-// Query the statement with arguments. Return records.
-func (s *SQLiteStmt) Query(args []driver.Value) (driver.Rows, error) {
-	if err := s.bind(args); err != nil {
-		return nil, err
-	}
-	return &SQLiteRows{s, int(C.sqlite3_column_count(s.s)), nil, nil, s.cls}, nil
-}
-
-// Return last inserted ID.
-func (r *SQLiteResult) LastInsertId() (int64, error) {
-	return r.id, nil
-}
-
-// Return how many rows affected.
-func (r *SQLiteResult) RowsAffected() (int64, error) {
-	return r.changes, nil
-}
-
-// Execute the statement with arguments. Return result object.
-func (s *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error) {
-	if err := s.bind(args); err != nil {
-		C.sqlite3_reset(s.s)
-		C.sqlite3_clear_bindings(s.s)
-		return nil, err
-	}
-	var rowid, changes C.long
-	rv := C._sqlite3_step(s.s, &rowid, &changes)
-	if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE {
-		err := s.c.lastError()
-		C.sqlite3_reset(s.s)
-		C.sqlite3_clear_bindings(s.s)
-		return nil, err
-	}
-	return &SQLiteResult{int64(rowid), int64(changes)}, nil
-}
-
-// Close the rows.
-func (rc *SQLiteRows) Close() error {
-	if rc.s.closed {
-		return nil
-	}
-	if rc.cls {
-		return rc.s.Close()
-	}
-	rv := C.sqlite3_reset(rc.s.s)
-	if rv != C.SQLITE_OK {
-		return rc.s.c.lastError()
-	}
-	return nil
-}
-
-// Return column names.
-func (rc *SQLiteRows) Columns() []string {
-	if rc.nc != len(rc.cols) {
-		rc.cols = make([]string, rc.nc)
-		for i := 0; i < rc.nc; i++ {
-			rc.cols[i] = C.GoString(C.sqlite3_column_name(rc.s.s, C.int(i)))
-		}
-	}
-	return rc.cols
-}
-
-// Move cursor to next.
-func (rc *SQLiteRows) Next(dest []driver.Value) error {
-	rv := C.sqlite3_step(rc.s.s)
-	if rv == C.SQLITE_DONE {
-		return io.EOF
-	}
-	if rv != C.SQLITE_ROW {
-		rv = C.sqlite3_reset(rc.s.s)
-		if rv != C.SQLITE_OK {
-			return rc.s.c.lastError()
-		}
-		return nil
-	}
-
-	if rc.decltype == nil {
-		rc.decltype = make([]string, rc.nc)
-		for i := 0; i < rc.nc; i++ {
-			rc.decltype[i] = strings.ToLower(C.GoString(C.sqlite3_column_decltype(rc.s.s, C.int(i))))
-		}
-	}
-
-	for i := range dest {
-		switch C.sqlite3_column_type(rc.s.s, C.int(i)) {
-		case C.SQLITE_INTEGER:
-			val := int64(C.sqlite3_column_int64(rc.s.s, C.int(i)))
-			switch rc.decltype[i] {
-			case "timestamp", "datetime", "date":
-				unixTimestamp := strconv.FormatInt(val, 10)
-				var t time.Time
-				if len(unixTimestamp) == 13 {
-					duration, err := time.ParseDuration(unixTimestamp + "ms")
-					if err != nil {
-						return fmt.Errorf("error parsing %s value %d, %s", rc.decltype[i], val, err)
-					}
-					epoch := time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC)
-					t = epoch.Add(duration)
-				} else {
-					t = time.Unix(val, 0)
-				}
-				if rc.s.c.loc != nil {
-					t = t.In(rc.s.c.loc)
-				}
-				dest[i] = t
-			case "boolean":
-				dest[i] = val > 0
-			default:
-				dest[i] = val
-			}
-		case C.SQLITE_FLOAT:
-			dest[i] = float64(C.sqlite3_column_double(rc.s.s, C.int(i)))
-		case C.SQLITE_BLOB:
-			p := C.sqlite3_column_blob(rc.s.s, C.int(i))
-			if p == nil {
-				dest[i] = nil
-				continue
-			}
-			n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
-			switch dest[i].(type) {
-			case sql.RawBytes:
-				dest[i] = (*[1 << 30]byte)(unsafe.Pointer(p))[0:n]
-			default:
-				slice := make([]byte, n)
-				copy(slice[:], (*[1 << 30]byte)(unsafe.Pointer(p))[0:n])
-				dest[i] = slice
-			}
-		case C.SQLITE_NULL:
-			dest[i] = nil
-		case C.SQLITE_TEXT:
-			var err error
-			var timeVal time.Time
-
-			n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
-			s := C.GoStringN((*C.char)(unsafe.Pointer(C.sqlite3_column_text(rc.s.s, C.int(i)))), C.int(n))
-
-			switch rc.decltype[i] {
-			case "timestamp", "datetime", "date":
-				var t time.Time
-				s = strings.TrimSuffix(s, "Z")
-				for _, format := range SQLiteTimestampFormats {
-					if timeVal, err = time.ParseInLocation(format, s, time.UTC); err == nil {
-						t = timeVal
-						break
-					}
-				}
-				if err != nil {
-					// The column is a time value, so return the zero time on parse failure.
-					t = time.Time{}
-				}
-				if rc.s.c.loc != nil {
-					t = t.In(rc.s.c.loc)
-				}
-				dest[i] = t
-			default:
-				dest[i] = []byte(s)
-			}
-
-		}
-	}
-	return nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_fts3_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_fts3_test.go b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_fts3_test.go
deleted file mode 100644
index a1cd217..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_fts3_test.go
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (C) 2015 Yasuhiro Matsumoto <ma...@gmail.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package sqlite3
-
-import (
-	"database/sql"
-	"os"
-	"testing"
-)
-
-func TestFTS3(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec("DROP TABLE foo")
-	_, err = db.Exec("CREATE VIRTUAL TABLE foo USING fts3(id INTEGER PRIMARY KEY, value TEXT)")
-	if err != nil {
-		t.Fatal("Failed to create table:", err)
-	}
-
-	_, err = db.Exec("INSERT INTO foo(id, value) VALUES(?, ?)", 1, `今日の 晩御飯は 天麩羅よ`)
-	if err != nil {
-		t.Fatal("Failed to insert value:", err)
-	}
-
-	_, err = db.Exec("INSERT INTO foo(id, value) VALUES(?, ?)", 2, `今日は いい 天気だ`)
-	if err != nil {
-		t.Fatal("Failed to insert value:", err)
-	}
-
-	rows, err := db.Query("SELECT id, value FROM foo WHERE value MATCH '今日* 天*'")
-	if err != nil {
-		t.Fatal("Unable to query foo table:", err)
-	}
-	defer rows.Close()
-
-	for rows.Next() {
-		var id int
-		var value string
-
-		if err := rows.Scan(&id, &value); err != nil {
-			t.Error("Unable to scan results:", err)
-			continue
-		}
-
-		if id == 1 && value != `今日の 晩御飯は 天麩羅よ` {
-			t.Error("Value for id 1 should be `今日の 晩御飯は 天麩羅よ`, but:", value)
-		} else if id == 2 && value != `今日は いい 天気だ` {
-			t.Error("Value for id 2 should be `今日は いい 天気だ`, but:", value)
-		}
-	}
-
-	rows, err = db.Query("SELECT value FROM foo WHERE value MATCH '今日* 天麩羅*'")
-	if err != nil {
-		t.Fatal("Unable to query foo table:", err)
-	}
-	defer rows.Close()
-
-	var value string
-	if !rows.Next() {
-		t.Fatal("Result should be only one")
-	}
-
-	if err := rows.Scan(&value); err != nil {
-		t.Fatal("Unable to scan results:", err)
-	}
-
-	if value != `今日の 晩御飯は 天麩羅よ` {
-		t.Fatal("Value should be `今日の 晩御飯は 天麩羅よ`, but:", value)
-	}
-
-	if rows.Next() {
-		t.Fatal("Result should be only one")
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_other.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_other.go b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_other.go
deleted file mode 100644
index a20d02c..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_other.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-// +build !windows
-
-package sqlite3
-
-/*
-#cgo CFLAGS: -I.
-#cgo linux LDFLAGS: -ldl
-*/
-import "C"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test.go b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test.go
deleted file mode 100644
index 423f30e..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test.go
+++ /dev/null
@@ -1,1058 +0,0 @@
-// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package sqlite3
-
-import (
-	"crypto/rand"
-	"database/sql"
-	"database/sql/driver"
-	"encoding/hex"
-	"errors"
-	"fmt"
-	"net/url"
-	"os"
-	"path/filepath"
-	"strings"
-	"testing"
-	"time"
-
-	"github.com/mattn/go-sqlite3/sqlite3_test"
-)
-
-func TempFilename() string {
-	randBytes := make([]byte, 16)
-	rand.Read(randBytes)
-	return filepath.Join(os.TempDir(), "foo"+hex.EncodeToString(randBytes)+".db")
-}
-
-func doTestOpen(t *testing.T, option string) (string, error) {
-	var url string
-	tempFilename := TempFilename()
-	if option != "" {
-		url = tempFilename + option
-	} else {
-		url = tempFilename
-	}
-	db, err := sql.Open("sqlite3", url)
-	if err != nil {
-		return "Failed to open database:", err
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec("drop table foo")
-	_, err = db.Exec("create table foo (id integer)")
-	if err != nil {
-		return "Failed to create table:", err
-	}
-
-	if stat, err := os.Stat(tempFilename); err != nil || stat.IsDir() {
-		return "Failed to create ./foo.db", nil
-	}
-
-	return "", nil
-}
-
-func TestOpen(t *testing.T) {
-	cases := map[string]bool{
-		"":                   true,
-		"?_txlock=immediate": true,
-		"?_txlock=deferred":  true,
-		"?_txlock=exclusive": true,
-		"?_txlock=bogus":     false,
-	}
-	for option, expectedPass := range cases {
-		result, err := doTestOpen(t, option)
-		if result == "" {
-			if !expectedPass {
-				errmsg := fmt.Sprintf("_txlock error not caught at dbOpen with option: %s", option)
-				t.Fatal(errmsg)
-			}
-		} else if expectedPass {
-			if err == nil {
-				t.Fatal(result)
-			} else {
-				t.Fatal(result, err)
-			}
-		}
-	}
-}
-
-func TestClose(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-
-	_, err = db.Exec("drop table foo")
-	_, err = db.Exec("create table foo (id integer)")
-	if err != nil {
-		t.Fatal("Failed to create table:", err)
-	}
-
-	stmt, err := db.Prepare("select id from foo where id = ?")
-	if err != nil {
-		t.Fatal("Failed to select records:", err)
-	}
-
-	db.Close()
-	_, err = stmt.Exec(1)
-	if err == nil {
-		t.Fatal("Failed to operate closed statement")
-	}
-}
-
-func TestInsert(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec("drop table foo")
-	_, err = db.Exec("create table foo (id integer)")
-	if err != nil {
-		t.Fatal("Failed to create table:", err)
-	}
-
-	res, err := db.Exec("insert into foo(id) values(123)")
-	if err != nil {
-		t.Fatal("Failed to insert record:", err)
-	}
-	affected, _ := res.RowsAffected()
-	if affected != 1 {
-		t.Fatalf("Expected %d for affected rows, but %d:", 1, affected)
-	}
-
-	rows, err := db.Query("select id from foo")
-	if err != nil {
-		t.Fatal("Failed to select records:", err)
-	}
-	defer rows.Close()
-
-	rows.Next()
-
-	var result int
-	rows.Scan(&result)
-	if result != 123 {
-		t.Errorf("Fetched %q; expected %q", 123, result)
-	}
-}
-
-func TestUpdate(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec("drop table foo")
-	_, err = db.Exec("create table foo (id integer)")
-	if err != nil {
-		t.Fatal("Failed to create table:", err)
-	}
-
-	res, err := db.Exec("insert into foo(id) values(123)")
-	if err != nil {
-		t.Fatal("Failed to insert record:", err)
-	}
-	expected, err := res.LastInsertId()
-	if err != nil {
-		t.Fatal("Failed to get LastInsertId:", err)
-	}
-	affected, _ := res.RowsAffected()
-	if err != nil {
-		t.Fatal("Failed to get RowsAffected:", err)
-	}
-	if affected != 1 {
-		t.Fatalf("Expected %d for affected rows, but %d:", 1, affected)
-	}
-
-	res, err = db.Exec("update foo set id = 234")
-	if err != nil {
-		t.Fatal("Failed to update record:", err)
-	}
-	lastId, err := res.LastInsertId()
-	if err != nil {
-		t.Fatal("Failed to get LastInsertId:", err)
-	}
-	if expected != lastId {
-		t.Errorf("Expected %q for last Id, but %q:", expected, lastId)
-	}
-	affected, _ = res.RowsAffected()
-	if err != nil {
-		t.Fatal("Failed to get RowsAffected:", err)
-	}
-	if affected != 1 {
-		t.Fatalf("Expected %d for affected rows, but %d:", 1, affected)
-	}
-
-	rows, err := db.Query("select id from foo")
-	if err != nil {
-		t.Fatal("Failed to select records:", err)
-	}
-	defer rows.Close()
-
-	rows.Next()
-
-	var result int
-	rows.Scan(&result)
-	if result != 234 {
-		t.Errorf("Fetched %q; expected %q", 234, result)
-	}
-}
-
-func TestDelete(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec("drop table foo")
-	_, err = db.Exec("create table foo (id integer)")
-	if err != nil {
-		t.Fatal("Failed to create table:", err)
-	}
-
-	res, err := db.Exec("insert into foo(id) values(123)")
-	if err != nil {
-		t.Fatal("Failed to insert record:", err)
-	}
-	expected, err := res.LastInsertId()
-	if err != nil {
-		t.Fatal("Failed to get LastInsertId:", err)
-	}
-	affected, err := res.RowsAffected()
-	if err != nil {
-		t.Fatal("Failed to get RowsAffected:", err)
-	}
-	if affected != 1 {
-		t.Errorf("Expected %d for cout of affected rows, but %q:", 1, affected)
-	}
-
-	res, err = db.Exec("delete from foo where id = 123")
-	if err != nil {
-		t.Fatal("Failed to delete record:", err)
-	}
-	lastId, err := res.LastInsertId()
-	if err != nil {
-		t.Fatal("Failed to get LastInsertId:", err)
-	}
-	if expected != lastId {
-		t.Errorf("Expected %q for last Id, but %q:", expected, lastId)
-	}
-	affected, err = res.RowsAffected()
-	if err != nil {
-		t.Fatal("Failed to get RowsAffected:", err)
-	}
-	if affected != 1 {
-		t.Errorf("Expected %d for cout of affected rows, but %q:", 1, affected)
-	}
-
-	rows, err := db.Query("select id from foo")
-	if err != nil {
-		t.Fatal("Failed to select records:", err)
-	}
-	defer rows.Close()
-
-	if rows.Next() {
-		t.Error("Fetched row but expected not rows")
-	}
-}
-
-func TestBooleanRoundtrip(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec("DROP TABLE foo")
-	_, err = db.Exec("CREATE TABLE foo(id INTEGER, value BOOL)")
-	if err != nil {
-		t.Fatal("Failed to create table:", err)
-	}
-
-	_, err = db.Exec("INSERT INTO foo(id, value) VALUES(1, ?)", true)
-	if err != nil {
-		t.Fatal("Failed to insert true value:", err)
-	}
-
-	_, err = db.Exec("INSERT INTO foo(id, value) VALUES(2, ?)", false)
-	if err != nil {
-		t.Fatal("Failed to insert false value:", err)
-	}
-
-	rows, err := db.Query("SELECT id, value FROM foo")
-	if err != nil {
-		t.Fatal("Unable to query foo table:", err)
-	}
-	defer rows.Close()
-
-	for rows.Next() {
-		var id int
-		var value bool
-
-		if err := rows.Scan(&id, &value); err != nil {
-			t.Error("Unable to scan results:", err)
-			continue
-		}
-
-		if id == 1 && !value {
-			t.Error("Value for id 1 should be true, not false")
-
-		} else if id == 2 && value {
-			t.Error("Value for id 2 should be false, not true")
-		}
-	}
-}
-
-func TestTimestamp(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec("DROP TABLE foo")
-	_, err = db.Exec("CREATE TABLE foo(id INTEGER, ts timeSTAMP, dt DATETIME)")
-	if err != nil {
-		t.Fatal("Failed to create table:", err)
-	}
-
-	timestamp1 := time.Date(2012, time.April, 6, 22, 50, 0, 0, time.UTC)
-	timestamp2 := time.Date(2006, time.January, 2, 15, 4, 5, 123456789, time.UTC)
-	timestamp3 := time.Date(2012, time.November, 4, 0, 0, 0, 0, time.UTC)
-	tests := []struct {
-		value    interface{}
-		expected time.Time
-	}{
-		{"nonsense", time.Time{}},
-		{"0000-00-00 00:00:00", time.Time{}},
-		{timestamp1, timestamp1},
-		{timestamp1.Unix(), timestamp1},
-		{timestamp1.UnixNano() / int64(time.Millisecond), timestamp1},
-		{timestamp1.In(time.FixedZone("TEST", -7*3600)), timestamp1},
-		{timestamp1.Format("2006-01-02 15:04:05.000"), timestamp1},
-		{timestamp1.Format("2006-01-02T15:04:05.000"), timestamp1},
-		{timestamp1.Format("2006-01-02 15:04:05"), timestamp1},
-		{timestamp1.Format("2006-01-02T15:04:05"), timestamp1},
-		{timestamp2, timestamp2},
-		{"2006-01-02 15:04:05.123456789", timestamp2},
-		{"2006-01-02T15:04:05.123456789", timestamp2},
-		{"2012-11-04", timestamp3},
-		{"2012-11-04 00:00", timestamp3},
-		{"2012-11-04 00:00:00", timestamp3},
-		{"2012-11-04 00:00:00.000", timestamp3},
-		{"2012-11-04T00:00", timestamp3},
-		{"2012-11-04T00:00:00", timestamp3},
-		{"2012-11-04T00:00:00.000", timestamp3},
-	}
-	for i := range tests {
-		_, err = db.Exec("INSERT INTO foo(id, ts, dt) VALUES(?, ?, ?)", i, tests[i].value, tests[i].value)
-		if err != nil {
-			t.Fatal("Failed to insert timestamp:", err)
-		}
-	}
-
-	rows, err := db.Query("SELECT id, ts, dt FROM foo ORDER BY id ASC")
-	if err != nil {
-		t.Fatal("Unable to query foo table:", err)
-	}
-	defer rows.Close()
-
-	seen := 0
-	for rows.Next() {
-		var id int
-		var ts, dt time.Time
-
-		if err := rows.Scan(&id, &ts, &dt); err != nil {
-			t.Error("Unable to scan results:", err)
-			continue
-		}
-		if id < 0 || id >= len(tests) {
-			t.Error("Bad row id: ", id)
-			continue
-		}
-		seen++
-		if !tests[id].expected.Equal(ts) {
-			t.Errorf("Timestamp value for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected, dt)
-		}
-		if !tests[id].expected.Equal(dt) {
-			t.Errorf("Datetime value for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected, dt)
-		}
-	}
-
-	if seen != len(tests) {
-		t.Errorf("Expected to see %d rows", len(tests))
-	}
-}
-
-func TestBoolean(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec("CREATE TABLE foo(id INTEGER, fbool BOOLEAN)")
-	if err != nil {
-		t.Fatal("Failed to create table:", err)
-	}
-
-	bool1 := true
-	_, err = db.Exec("INSERT INTO foo(id, fbool) VALUES(1, ?)", bool1)
-	if err != nil {
-		t.Fatal("Failed to insert boolean:", err)
-	}
-
-	bool2 := false
-	_, err = db.Exec("INSERT INTO foo(id, fbool) VALUES(2, ?)", bool2)
-	if err != nil {
-		t.Fatal("Failed to insert boolean:", err)
-	}
-
-	bool3 := "nonsense"
-	_, err = db.Exec("INSERT INTO foo(id, fbool) VALUES(3, ?)", bool3)
-	if err != nil {
-		t.Fatal("Failed to insert nonsense:", err)
-	}
-
-	rows, err := db.Query("SELECT id, fbool FROM foo where fbool = ?", bool1)
-	if err != nil {
-		t.Fatal("Unable to query foo table:", err)
-	}
-	counter := 0
-
-	var id int
-	var fbool bool
-
-	for rows.Next() {
-		if err := rows.Scan(&id, &fbool); err != nil {
-			t.Fatal("Unable to scan results:", err)
-		}
-		counter++
-	}
-
-	if counter != 1 {
-		t.Fatalf("Expected 1 row but %v", counter)
-	}
-
-	if id != 1 && fbool != true {
-		t.Fatalf("Value for id 1 should be %v, not %v", bool1, fbool)
-	}
-
-	rows, err = db.Query("SELECT id, fbool FROM foo where fbool = ?", bool2)
-	if err != nil {
-		t.Fatal("Unable to query foo table:", err)
-	}
-
-	counter = 0
-
-	for rows.Next() {
-		if err := rows.Scan(&id, &fbool); err != nil {
-			t.Fatal("Unable to scan results:", err)
-		}
-		counter++
-	}
-
-	if counter != 1 {
-		t.Fatalf("Expected 1 row but %v", counter)
-	}
-
-	if id != 2 && fbool != false {
-		t.Fatalf("Value for id 2 should be %v, not %v", bool2, fbool)
-	}
-
-	// make sure "nonsense" triggered an error
-	rows, err = db.Query("SELECT id, fbool FROM foo where id=?;", 3)
-	if err != nil {
-		t.Fatal("Unable to query foo table:", err)
-	}
-
-	rows.Next()
-	err = rows.Scan(&id, &fbool)
-	if err == nil {
-		t.Error("Expected error from \"nonsense\" bool")
-	}
-}
-
-func TestFloat32(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec("CREATE TABLE foo(id INTEGER)")
-	if err != nil {
-		t.Fatal("Failed to create table:", err)
-	}
-
-	_, err = db.Exec("INSERT INTO foo(id) VALUES(null)")
-	if err != nil {
-		t.Fatal("Failed to insert null:", err)
-	}
-
-	rows, err := db.Query("SELECT id FROM foo")
-	if err != nil {
-		t.Fatal("Unable to query foo table:", err)
-	}
-
-	if !rows.Next() {
-		t.Fatal("Unable to query results:", err)
-	}
-
-	var id interface{}
-	if err := rows.Scan(&id); err != nil {
-		t.Fatal("Unable to scan results:", err)
-	}
-	if id != nil {
-		t.Error("Expected nil but not")
-	}
-}
-
-func TestNull(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	rows, err := db.Query("SELECT 3.141592")
-	if err != nil {
-		t.Fatal("Unable to query foo table:", err)
-	}
-
-	if !rows.Next() {
-		t.Fatal("Unable to query results:", err)
-	}
-
-	var v interface{}
-	if err := rows.Scan(&v); err != nil {
-		t.Fatal("Unable to scan results:", err)
-	}
-	f, ok := v.(float64)
-	if !ok {
-		t.Error("Expected float but not")
-	}
-	if f != 3.141592 {
-		t.Error("Expected 3.141592 but not")
-	}
-}
-
-func TestTransaction(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec("CREATE TABLE foo(id INTEGER)")
-	if err != nil {
-		t.Fatal("Failed to create table:", err)
-	}
-
-	tx, err := db.Begin()
-	if err != nil {
-		t.Fatal("Failed to begin transaction:", err)
-	}
-
-	_, err = tx.Exec("INSERT INTO foo(id) VALUES(1)")
-	if err != nil {
-		t.Fatal("Failed to insert null:", err)
-	}
-
-	rows, err := tx.Query("SELECT id from foo")
-	if err != nil {
-		t.Fatal("Unable to query foo table:", err)
-	}
-
-	err = tx.Rollback()
-	if err != nil {
-		t.Fatal("Failed to rollback transaction:", err)
-	}
-
-	if rows.Next() {
-		t.Fatal("Unable to query results:", err)
-	}
-
-	tx, err = db.Begin()
-	if err != nil {
-		t.Fatal("Failed to begin transaction:", err)
-	}
-
-	_, err = tx.Exec("INSERT INTO foo(id) VALUES(1)")
-	if err != nil {
-		t.Fatal("Failed to insert null:", err)
-	}
-
-	err = tx.Commit()
-	if err != nil {
-		t.Fatal("Failed to commit transaction:", err)
-	}
-
-	rows, err = tx.Query("SELECT id from foo")
-	if err == nil {
-		t.Fatal("Expected failure to query")
-	}
-}
-
-func TestWAL(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-
-	defer os.Remove(tempFilename)
-	defer db.Close()
-	if _, err = db.Exec("PRAGMA journal_mode=WAL;"); err != nil {
-		t.Fatal("Failed to Exec PRAGMA journal_mode:", err)
-	}
-	if _, err = db.Exec("PRAGMA locking_mode=EXCLUSIVE;"); err != nil {
-		t.Fatal("Failed to Exec PRAGMA locking_mode:", err)
-	}
-	if _, err = db.Exec("CREATE TABLE test (id SERIAL, user TEXT NOT NULL, name TEXT NOT NULL);"); err != nil {
-		t.Fatal("Failed to Exec CREATE TABLE:", err)
-	}
-	if _, err = db.Exec("INSERT INTO test (user, name) VALUES ('user','name');"); err != nil {
-		t.Fatal("Failed to Exec INSERT:", err)
-	}
-
-	trans, err := db.Begin()
-	if err != nil {
-		t.Fatal("Failed to Begin:", err)
-	}
-	s, err := trans.Prepare("INSERT INTO test (user, name) VALUES (?, ?);")
-	if err != nil {
-		t.Fatal("Failed to Prepare:", err)
-	}
-
-	var count int
-	if err = trans.QueryRow("SELECT count(user) FROM test;").Scan(&count); err != nil {
-		t.Fatal("Failed to QueryRow:", err)
-	}
-	if _, err = s.Exec("bbbb", "aaaa"); err != nil {
-		t.Fatal("Failed to Exec prepared statement:", err)
-	}
-	if err = s.Close(); err != nil {
-		t.Fatal("Failed to Close prepared statement:", err)
-	}
-	if err = trans.Commit(); err != nil {
-		t.Fatal("Failed to Commit:", err)
-	}
-}
-
-func TestTimezoneConversion(t *testing.T) {
-	zones := []string{"UTC", "US/Central", "US/Pacific", "Local"}
-	for _, tz := range zones {
-		tempFilename := TempFilename()
-		db, err := sql.Open("sqlite3", tempFilename+"?_loc="+url.QueryEscape(tz))
-		if err != nil {
-			t.Fatal("Failed to open database:", err)
-		}
-		defer os.Remove(tempFilename)
-		defer db.Close()
-
-		_, err = db.Exec("DROP TABLE foo")
-		_, err = db.Exec("CREATE TABLE foo(id INTEGER, ts TIMESTAMP, dt DATETIME)")
-		if err != nil {
-			t.Fatal("Failed to create table:", err)
-		}
-
-		loc, err := time.LoadLocation(tz)
-		if err != nil {
-			t.Fatal("Failed to load location:", err)
-		}
-
-		timestamp1 := time.Date(2012, time.April, 6, 22, 50, 0, 0, time.UTC)
-		timestamp2 := time.Date(2006, time.January, 2, 15, 4, 5, 123456789, time.UTC)
-		timestamp3 := time.Date(2012, time.November, 4, 0, 0, 0, 0, time.UTC)
-		tests := []struct {
-			value    interface{}
-			expected time.Time
-		}{
-			{"nonsense", time.Time{}.In(loc)},
-			{"0000-00-00 00:00:00", time.Time{}.In(loc)},
-			{timestamp1, timestamp1.In(loc)},
-			{timestamp1.Unix(), timestamp1.In(loc)},
-			{timestamp1.In(time.FixedZone("TEST", -7*3600)), timestamp1.In(loc)},
-			{timestamp1.Format("2006-01-02 15:04:05.000"), timestamp1.In(loc)},
-			{timestamp1.Format("2006-01-02T15:04:05.000"), timestamp1.In(loc)},
-			{timestamp1.Format("2006-01-02 15:04:05"), timestamp1.In(loc)},
-			{timestamp1.Format("2006-01-02T15:04:05"), timestamp1.In(loc)},
-			{timestamp2, timestamp2.In(loc)},
-			{"2006-01-02 15:04:05.123456789", timestamp2.In(loc)},
-			{"2006-01-02T15:04:05.123456789", timestamp2.In(loc)},
-			{"2012-11-04", timestamp3.In(loc)},
-			{"2012-11-04 00:00", timestamp3.In(loc)},
-			{"2012-11-04 00:00:00", timestamp3.In(loc)},
-			{"2012-11-04 00:00:00.000", timestamp3.In(loc)},
-			{"2012-11-04T00:00", timestamp3.In(loc)},
-			{"2012-11-04T00:00:00", timestamp3.In(loc)},
-			{"2012-11-04T00:00:00.000", timestamp3.In(loc)},
-		}
-		for i := range tests {
-			_, err = db.Exec("INSERT INTO foo(id, ts, dt) VALUES(?, ?, ?)", i, tests[i].value, tests[i].value)
-			if err != nil {
-				t.Fatal("Failed to insert timestamp:", err)
-			}
-		}
-
-		rows, err := db.Query("SELECT id, ts, dt FROM foo ORDER BY id ASC")
-		if err != nil {
-			t.Fatal("Unable to query foo table:", err)
-		}
-		defer rows.Close()
-
-		seen := 0
-		for rows.Next() {
-			var id int
-			var ts, dt time.Time
-
-			if err := rows.Scan(&id, &ts, &dt); err != nil {
-				t.Error("Unable to scan results:", err)
-				continue
-			}
-			if id < 0 || id >= len(tests) {
-				t.Error("Bad row id: ", id)
-				continue
-			}
-			seen++
-			if !tests[id].expected.Equal(ts) {
-				t.Errorf("Timestamp value for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected, ts)
-			}
-			if !tests[id].expected.Equal(dt) {
-				t.Errorf("Datetime value for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected, dt)
-			}
-			if tests[id].expected.Location().String() != ts.Location().String() {
-				t.Errorf("Location for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected.Location().String(), ts.Location().String())
-			}
-			if tests[id].expected.Location().String() != dt.Location().String() {
-				t.Errorf("Location for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected.Location().String(), dt.Location().String())
-			}
-		}
-
-		if seen != len(tests) {
-			t.Errorf("Expected to see %d rows", len(tests))
-		}
-	}
-}
-
-func TestSuite(t *testing.T) {
-	db, err := sql.Open("sqlite3", ":memory:")
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer db.Close()
-
-	sqlite3_test.RunTests(t, db, sqlite3_test.SQLITE)
-}
-
-// TODO: Execer & Queryer currently disabled
-// https://github.com/mattn/go-sqlite3/issues/82
-func TestExecer(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec(`
-       create table foo (id integer); -- one comment
-       insert into foo(id) values(?);
-       insert into foo(id) values(?);
-       insert into foo(id) values(?); -- another comment
-       `, 1, 2, 3)
-	if err != nil {
-		t.Error("Failed to call db.Exec:", err)
-	}
-}
-
-func TestQueryer(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec(`
-	create table foo (id integer);
-	`)
-	if err != nil {
-		t.Error("Failed to call db.Query:", err)
-	}
-
-	rows, err := db.Query(`
-	insert into foo(id) values(?);
-	insert into foo(id) values(?);
-	insert into foo(id) values(?);
-	select id from foo order by id;
-	`, 3, 2, 1)
-	if err != nil {
-		t.Error("Failed to call db.Query:", err)
-	}
-	defer rows.Close()
-	n := 1
-	if rows != nil {
-		for rows.Next() {
-			var id int
-			err = rows.Scan(&id)
-			if err != nil {
-				t.Error("Failed to db.Query:", err)
-			}
-			if id != n {
-				t.Error("Failed to db.Query: not matched results")
-			}
-		}
-	}
-}
-
-func TestStress(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	db.Exec("CREATE TABLE foo (id int);")
-	db.Exec("INSERT INTO foo VALUES(1);")
-	db.Exec("INSERT INTO foo VALUES(2);")
-	db.Close()
-
-	for i := 0; i < 10000; i++ {
-		db, err := sql.Open("sqlite3", tempFilename)
-		if err != nil {
-			t.Fatal("Failed to open database:", err)
-		}
-
-		for j := 0; j < 3; j++ {
-			rows, err := db.Query("select * from foo where id=1;")
-			if err != nil {
-				t.Error("Failed to call db.Query:", err)
-			}
-			for rows.Next() {
-				var i int
-				if err := rows.Scan(&i); err != nil {
-					t.Errorf("Scan failed: %v\n", err)
-				}
-			}
-			if err := rows.Err(); err != nil {
-				t.Errorf("Post-scan failed: %v\n", err)
-			}
-			rows.Close()
-		}
-		db.Close()
-	}
-}
-
-func TestDateTimeLocal(t *testing.T) {
-	zone := "Asia/Tokyo"
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename+"?_loc="+zone)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	db.Exec("CREATE TABLE foo (dt datetime);")
-	db.Exec("INSERT INTO foo VALUES('2015-03-05 15:16:17');")
-
-	row := db.QueryRow("select * from foo")
-	var d time.Time
-	err = row.Scan(&d)
-	if err != nil {
-		t.Fatal("Failed to scan datetime:", err)
-	}
-	if d.Hour() == 15 || !strings.Contains(d.String(), "JST") {
-		t.Fatal("Result should have timezone", d)
-	}
-	db.Close()
-
-	db, err = sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-
-	row = db.QueryRow("select * from foo")
-	err = row.Scan(&d)
-	if err != nil {
-		t.Fatal("Failed to scan datetime:", err)
-	}
-	if d.UTC().Hour() != 15 || !strings.Contains(d.String(), "UTC") {
-		t.Fatalf("Result should not have timezone %v %v", zone, d.String())
-	}
-
-	_, err = db.Exec("DELETE FROM foo")
-	if err != nil {
-		t.Fatal("Failed to delete table:", err)
-	}
-	dt, err := time.Parse("2006/1/2 15/4/5 -0700 MST", "2015/3/5 15/16/17 +0900 JST")
-	if err != nil {
-		t.Fatal("Failed to parse datetime:", err)
-	}
-	db.Exec("INSERT INTO foo VALUES(?);", dt)
-
-	db.Close()
-	db, err = sql.Open("sqlite3", tempFilename+"?_loc="+zone)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-
-	row = db.QueryRow("select * from foo")
-	err = row.Scan(&d)
-	if err != nil {
-		t.Fatal("Failed to scan datetime:", err)
-	}
-	if d.Hour() != 15 || !strings.Contains(d.String(), "JST") {
-		t.Fatalf("Result should have timezone %v %v", zone, d.String())
-	}
-}
-
-func TestVersion(t *testing.T) {
-	s, n, id := Version()
-	if s == "" || n == 0 || id == "" {
-		t.Errorf("Version failed %q, %d, %q\n", s, n, id)
-	}
-}
-
-func TestNumberNamedParams(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec(`
-	create table foo (id integer, name text, extra text);
-	`)
-	if err != nil {
-		t.Error("Failed to call db.Query:", err)
-	}
-
-	_, err = db.Exec(`insert into foo(id, name, extra) values($1, $2, $2)`, 1, "foo")
-	if err != nil {
-		t.Error("Failed to call db.Exec:", err)
-	}
-
-	row := db.QueryRow(`select id, extra from foo where id = $1 and extra = $2`, 1, "foo")
-	if row == nil {
-		t.Error("Failed to call db.QueryRow")
-	}
-	var id int
-	var extra string
-	err = row.Scan(&id, &extra)
-	if err != nil {
-		t.Error("Failed to db.Scan:", err)
-	}
-	if id != 1 || extra != "foo" {
-		t.Error("Failed to db.QueryRow: not matched results")
-	}
-}
-
-func TestStringContainingZero(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer os.Remove(tempFilename)
-	defer db.Close()
-
-	_, err = db.Exec(`
-	create table foo (id integer, name, extra text);
-	`)
-	if err != nil {
-		t.Error("Failed to call db.Query:", err)
-	}
-
-	const text = "foo\x00bar"
-
-	_, err = db.Exec(`insert into foo(id, name, extra) values($1, $2, $2)`, 1, text)
-	if err != nil {
-		t.Error("Failed to call db.Exec:", err)
-	}
-
-	row := db.QueryRow(`select id, extra from foo where id = $1 and extra = $2`, 1, text)
-	if row == nil {
-		t.Error("Failed to call db.QueryRow")
-	}
-
-	var id int
-	var extra string
-	err = row.Scan(&id, &extra)
-	if err != nil {
-		t.Error("Failed to db.Scan:", err)
-	}
-	if id != 1 || extra != text {
-		t.Error("Failed to db.QueryRow: not matched results")
-	}
-}
-
-const CurrentTimeStamp = "2006-01-02 15:04:05"
-
-type TimeStamp struct{ *time.Time }
-
-func (t TimeStamp) Scan(value interface{}) error {
-	var err error
-	switch v := value.(type) {
-	case string:
-		*t.Time, err = time.Parse(CurrentTimeStamp, v)
-	case []byte:
-		*t.Time, err = time.Parse(CurrentTimeStamp, string(v))
-	default:
-		err = errors.New("invalid type for current_timestamp")
-	}
-	return err
-}
-
-func (t TimeStamp) Value() (driver.Value, error) {
-	return t.Time.Format(CurrentTimeStamp), nil
-}
-
-func TestDateTimeNow(t *testing.T) {
-	tempFilename := TempFilename()
-	db, err := sql.Open("sqlite3", tempFilename)
-	if err != nil {
-		t.Fatal("Failed to open database:", err)
-	}
-	defer db.Close()
-
-	var d time.Time
-	err = db.QueryRow("SELECT datetime('now')").Scan(TimeStamp{&d})
-	if err != nil {
-		t.Fatal("Failed to scan datetime:", err)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test/sqltest.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test/sqltest.go b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test/sqltest.go
deleted file mode 100644
index fc82782..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test/sqltest.go
+++ /dev/null
@@ -1,412 +0,0 @@
-package sqlite3_test
-
-import (
-	"database/sql"
-	"fmt"
-	"math/rand"
-	"regexp"
-	"strconv"
-	"sync"
-	"testing"
-	"time"
-)
-
-type Dialect int
-
-const (
-	SQLITE Dialect = iota
-	POSTGRESQL
-	MYSQL
-)
-
-type DB struct {
-	*testing.T
-	*sql.DB
-	dialect Dialect
-	once    sync.Once
-}
-
-var db *DB
-
-// the following tables will be created and dropped during the test
-var testTables = []string{"foo", "bar", "t", "bench"}
-
-var tests = []testing.InternalTest{
-	{"TestBlobs", TestBlobs},
-	{"TestManyQueryRow", TestManyQueryRow},
-	{"TestTxQuery", TestTxQuery},
-	{"TestPreparedStmt", TestPreparedStmt},
-}
-
-var benchmarks = []testing.InternalBenchmark{
-	{"BenchmarkExec", BenchmarkExec},
-	{"BenchmarkQuery", BenchmarkQuery},
-	{"BenchmarkParams", BenchmarkParams},
-	{"BenchmarkStmt", BenchmarkStmt},
-	{"BenchmarkRows", BenchmarkRows},
-	{"BenchmarkStmtRows", BenchmarkStmtRows},
-}
-
-// RunTests runs the SQL test suite
-func RunTests(t *testing.T, d *sql.DB, dialect Dialect) {
-	db = &DB{t, d, dialect, sync.Once{}}
-	testing.RunTests(func(string, string) (bool, error) { return true, nil }, tests)
-
-	if !testing.Short() {
-		for _, b := range benchmarks {
-			fmt.Printf("%-20s", b.Name)
-			r := testing.Benchmark(b.F)
-			fmt.Printf("%10d %10.0f req/s\n", r.N, float64(r.N)/r.T.Seconds())
-		}
-	}
-	db.tearDown()
-}
-
-func (db *DB) mustExec(sql string, args ...interface{}) sql.Result {
-	res, err := db.Exec(sql, args...)
-	if err != nil {
-		db.Fatalf("Error running %q: %v", sql, err)
-	}
-	return res
-}
-
-func (db *DB) tearDown() {
-	for _, tbl := range testTables {
-		switch db.dialect {
-		case SQLITE:
-			db.mustExec("drop table if exists " + tbl)
-		case MYSQL, POSTGRESQL:
-			db.mustExec("drop table if exists " + tbl)
-		default:
-			db.Fatal("unkown dialect")
-		}
-	}
-}
-
-// q replaces ? parameters if needed
-func (db *DB) q(sql string) string {
-	switch db.dialect {
-	case POSTGRESQL: // repace with $1, $2, ..
-		qrx := regexp.MustCompile(`\?`)
-		n := 0
-		return qrx.ReplaceAllStringFunc(sql, func(string) string {
-			n++
-			return "$" + strconv.Itoa(n)
-		})
-	}
-	return sql
-}
-
-func (db *DB) blobType(size int) string {
-	switch db.dialect {
-	case SQLITE:
-		return fmt.Sprintf("blob[%d]", size)
-	case POSTGRESQL:
-		return "bytea"
-	case MYSQL:
-		return fmt.Sprintf("VARBINARY(%d)", size)
-	}
-	panic("unkown dialect")
-}
-
-func (db *DB) serialPK() string {
-	switch db.dialect {
-	case SQLITE:
-		return "integer primary key autoincrement"
-	case POSTGRESQL:
-		return "serial primary key"
-	case MYSQL:
-		return "integer primary key auto_increment"
-	}
-	panic("unkown dialect")
-}
-
-func (db *DB) now() string {
-	switch db.dialect {
-	case SQLITE:
-		return "datetime('now')"
-	case POSTGRESQL:
-		return "now()"
-	case MYSQL:
-		return "now()"
-	}
-	panic("unkown dialect")
-}
-
-func makeBench() {
-	if _, err := db.Exec("create table bench (n varchar(32), i integer, d double, s varchar(32), t datetime)"); err != nil {
-		panic(err)
-	}
-	st, err := db.Prepare("insert into bench values (?, ?, ?, ?, ?)")
-	if err != nil {
-		panic(err)
-	}
-	defer st.Close()
-	for i := 0; i < 100; i++ {
-		if _, err = st.Exec(nil, i, float64(i), fmt.Sprintf("%d", i), time.Now()); err != nil {
-			panic(err)
-		}
-	}
-}
-
-func TestResult(t *testing.T) {
-	db.tearDown()
-	db.mustExec("create temporary table test (id " + db.serialPK() + ", name varchar(10))")
-
-	for i := 1; i < 3; i++ {
-		r := db.mustExec(db.q("insert into test (name) values (?)"), fmt.Sprintf("row %d", i))
-		n, err := r.RowsAffected()
-		if err != nil {
-			t.Fatal(err)
-		}
-		if n != 1 {
-			t.Errorf("got %v, want %v", n, 1)
-		}
-		n, err = r.LastInsertId()
-		if err != nil {
-			t.Fatal(err)
-		}
-		if n != int64(i) {
-			t.Errorf("got %v, want %v", n, i)
-		}
-	}
-	if _, err := db.Exec("error!"); err == nil {
-		t.Fatalf("expected error")
-	}
-}
-
-func TestBlobs(t *testing.T) {
-	db.tearDown()
-	var blob = []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
-	db.mustExec("create table foo (id integer primary key, bar " + db.blobType(16) + ")")
-	db.mustExec(db.q("insert into foo (id, bar) values(?,?)"), 0, blob)
-
-	want := fmt.Sprintf("%x", blob)
-
-	b := make([]byte, 16)
-	err := db.QueryRow(db.q("select bar from foo where id = ?"), 0).Scan(&b)
-	got := fmt.Sprintf("%x", b)
-	if err != nil {
-		t.Errorf("[]byte scan: %v", err)
-	} else if got != want {
-		t.Errorf("for []byte, got %q; want %q", got, want)
-	}
-
-	err = db.QueryRow(db.q("select bar from foo where id = ?"), 0).Scan(&got)
-	want = string(blob)
-	if err != nil {
-		t.Errorf("string scan: %v", err)
-	} else if got != want {
-		t.Errorf("for string, got %q; want %q", got, want)
-	}
-}
-
-func TestManyQueryRow(t *testing.T) {
-	if testing.Short() {
-		t.Log("skipping in short mode")
-		return
-	}
-	db.tearDown()
-	db.mustExec("create table foo (id integer primary key, name varchar(50))")
-	db.mustExec(db.q("insert into foo (id, name) values(?,?)"), 1, "bob")
-	var name string
-	for i := 0; i < 10000; i++ {
-		err := db.QueryRow(db.q("select name from foo where id = ?"), 1).Scan(&name)
-		if err != nil || name != "bob" {
-			t.Fatalf("on query %d: err=%v, name=%q", i, err, name)
-		}
-	}
-}
-
-func TestTxQuery(t *testing.T) {
-	db.tearDown()
-	tx, err := db.Begin()
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer tx.Rollback()
-
-	_, err = tx.Exec("create table foo (id integer primary key, name varchar(50))")
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	_, err = tx.Exec(db.q("insert into foo (id, name) values(?,?)"), 1, "bob")
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	r, err := tx.Query(db.q("select name from foo where id = ?"), 1)
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer r.Close()
-
-	if !r.Next() {
-		if r.Err() != nil {
-			t.Fatal(err)
-		}
-		t.Fatal("expected one rows")
-	}
-
-	var name string
-	err = r.Scan(&name)
-	if err != nil {
-		t.Fatal(err)
-	}
-}
-
-func TestPreparedStmt(t *testing.T) {
-	db.tearDown()
-	db.mustExec("CREATE TABLE t (count INT)")
-	sel, err := db.Prepare("SELECT count FROM t ORDER BY count DESC")
-	if err != nil {
-		t.Fatalf("prepare 1: %v", err)
-	}
-	ins, err := db.Prepare(db.q("INSERT INTO t (count) VALUES (?)"))
-	if err != nil {
-		t.Fatalf("prepare 2: %v", err)
-	}
-
-	for n := 1; n <= 3; n++ {
-		if _, err := ins.Exec(n); err != nil {
-			t.Fatalf("insert(%d) = %v", n, err)
-		}
-	}
-
-	const nRuns = 10
-	ch := make(chan bool)
-	for i := 0; i < nRuns; i++ {
-		go func() {
-			defer func() {
-				ch <- true
-			}()
-			for j := 0; j < 10; j++ {
-				count := 0
-				if err := sel.QueryRow().Scan(&count); err != nil && err != sql.ErrNoRows {
-					t.Errorf("Query: %v", err)
-					return
-				}
-				if _, err := ins.Exec(rand.Intn(100)); err != nil {
-					t.Errorf("Insert: %v", err)
-					return
-				}
-			}
-		}()
-	}
-	for i := 0; i < nRuns; i++ {
-		<-ch
-	}
-}
-
-// Benchmarks need to use panic() since b.Error errors are lost when
-// running via testing.Benchmark() I would like to run these via go
-// test -bench but calling Benchmark() from a benchmark test
-// currently hangs go.
-
-func BenchmarkExec(b *testing.B) {
-	for i := 0; i < b.N; i++ {
-		if _, err := db.Exec("select 1"); err != nil {
-			panic(err)
-		}
-	}
-}
-
-func BenchmarkQuery(b *testing.B) {
-	for i := 0; i < b.N; i++ {
-		var n sql.NullString
-		var i int
-		var f float64
-		var s string
-//		var t time.Time
-		if err := db.QueryRow("select null, 1, 1.1, 'foo'").Scan(&n, &i, &f, &s); err != nil {
-			panic(err)
-		}
-	}
-}
-
-func BenchmarkParams(b *testing.B) {
-	for i := 0; i < b.N; i++ {
-		var n sql.NullString
-		var i int
-		var f float64
-		var s string
-//		var t time.Time
-		if err := db.QueryRow("select ?, ?, ?, ?", nil, 1, 1.1, "foo").Scan(&n, &i, &f, &s); err != nil {
-			panic(err)
-		}
-	}
-}
-
-func BenchmarkStmt(b *testing.B) {
-	st, err := db.Prepare("select ?, ?, ?, ?")
-	if err != nil {
-		panic(err)
-	}
-	defer st.Close()
-
-	for n := 0; n < b.N; n++ {
-		var n sql.NullString
-		var i int
-		var f float64
-		var s string
-//		var t time.Time
-		if err := st.QueryRow(nil, 1, 1.1, "foo").Scan(&n, &i, &f, &s); err != nil {
-			panic(err)
-		}
-	}
-}
-
-func BenchmarkRows(b *testing.B) {
-	db.once.Do(makeBench)
-
-	for n := 0; n < b.N; n++ {
-		var n sql.NullString
-		var i int
-		var f float64
-		var s string
-		var t time.Time
-		r, err := db.Query("select * from bench")
-		if err != nil {
-			panic(err)
-		}
-		for r.Next() {
-			if err = r.Scan(&n, &i, &f, &s, &t); err != nil {
-				panic(err)
-			}
-		}
-		if err = r.Err(); err != nil {
-			panic(err)
-		}
-	}
-}
-
-func BenchmarkStmtRows(b *testing.B) {
-	db.once.Do(makeBench)
-
-	st, err := db.Prepare("select * from bench")
-	if err != nil {
-		panic(err)
-	}
-	defer st.Close()
-
-	for n := 0; n < b.N; n++ {
-		var n sql.NullString
-		var i int
-		var f float64
-		var s string
-		var t time.Time
-		r, err := st.Query()
-		if err != nil {
-			panic(err)
-		}
-		for r.Next() {
-			if err = r.Scan(&n, &i, &f, &s, &t); err != nil {
-				panic(err)
-			}
-		}
-		if err = r.Err(); err != nil {
-			panic(err)
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_windows.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_windows.go b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_windows.go
deleted file mode 100644
index abc8384..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_windows.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-// +build windows
-
-package sqlite3
-
-/*
-#cgo CFLAGS: -I. -fno-stack-check -fno-stack-protector -mno-stack-arg-probe
-#cgo windows,386 CFLAGS: -D_localtime32=localtime
-#cgo LDFLAGS: -lmingwex -lmingw32
-*/
-import "C"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3ext.h
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3ext.h b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3ext.h
deleted file mode 100644
index 7cc58b6..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3ext.h
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
-** 2006 June 7
-**
-** The author disclaims copyright to this source code.  In place of
-** a legal notice, here is a blessing:
-**
-**    May you do good and not evil.
-**    May you find forgiveness for yourself and forgive others.
-**    May you share freely, never taking more than you give.
-**
-*************************************************************************
-** This header file defines the SQLite interface for use by
-** shared libraries that want to be imported as extensions into
-** an SQLite instance.  Shared libraries that intend to be loaded
-** as extensions by SQLite should #include this file instead of 
-** sqlite3.h.
-*/
-#ifndef _SQLITE3EXT_H_
-#define _SQLITE3EXT_H_
-#include "sqlite3-binding.h"
-
-typedef struct sqlite3_api_routines sqlite3_api_routines;
-
-/*
-** The following structure holds pointers to all of the SQLite API
-** routines.
-**
-** WARNING:  In order to maintain backwards compatibility, add new
-** interfaces to the end of this structure only.  If you insert new
-** interfaces in the middle of this structure, then older different
-** versions of SQLite will not be able to load each others' shared
-** libraries!
-*/
-struct sqlite3_api_routines {
-  void * (*aggregate_context)(sqlite3_context*,int nBytes);
-  int  (*aggregate_count)(sqlite3_context*);
-  int  (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));
-  int  (*bind_double)(sqlite3_stmt*,int,double);
-  int  (*bind_int)(sqlite3_stmt*,int,int);
-  int  (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);
-  int  (*bind_null)(sqlite3_stmt*,int);
-  int  (*bind_parameter_count)(sqlite3_stmt*);
-  int  (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
-  const char * (*bind_parameter_name)(sqlite3_stmt*,int);
-  int  (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
-  int  (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));
-  int  (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);
-  int  (*busy_handler)(sqlite3*,int(*)(void*,int),void*);
-  int  (*busy_timeout)(sqlite3*,int ms);
-  int  (*changes)(sqlite3*);
-  int  (*close)(sqlite3*);
-  int  (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,
-                           int eTextRep,const char*));
-  int  (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,
-                             int eTextRep,const void*));
-  const void * (*column_blob)(sqlite3_stmt*,int iCol);
-  int  (*column_bytes)(sqlite3_stmt*,int iCol);
-  int  (*column_bytes16)(sqlite3_stmt*,int iCol);
-  int  (*column_count)(sqlite3_stmt*pStmt);
-  const char * (*column_database_name)(sqlite3_stmt*,int);
-  const void * (*column_database_name16)(sqlite3_stmt*,int);
-  const char * (*column_decltype)(sqlite3_stmt*,int i);
-  const void * (*column_decltype16)(sqlite3_stmt*,int);
-  double  (*column_double)(sqlite3_stmt*,int iCol);
-  int  (*column_int)(sqlite3_stmt*,int iCol);
-  sqlite_int64  (*column_int64)(sqlite3_stmt*,int iCol);
-  const char * (*column_name)(sqlite3_stmt*,int);
-  const void * (*column_name16)(sqlite3_stmt*,int);
-  const char * (*column_origin_name)(sqlite3_stmt*,int);
-  const void * (*column_origin_name16)(sqlite3_stmt*,int);
-  const char * (*column_table_name)(sqlite3_stmt*,int);
-  const void * (*column_table_name16)(sqlite3_stmt*,int);
-  const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
-  const void * (*column_text16)(sqlite3_stmt*,int iCol);
-  int  (*column_type)(sqlite3_stmt*,int iCol);
-  sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
-  void * (*commit_hook)(sqlite3*,int(*)(void*),void*);
-  int  (*complete)(const char*sql);
-  int  (*complete16)(const void*sql);
-  int  (*create_collation)(sqlite3*,const char*,int,void*,
-                           int(*)(void*,int,const void*,int,const void*));
-  int  (*create_collation16)(sqlite3*,const void*,int,void*,
-                             int(*)(void*,int,const void*,int,const void*));
-  int  (*create_function)(sqlite3*,const char*,int,int,void*,
-                          void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
-                          void (*xStep)(sqlite3_context*,int,sqlite3_value**),
-                          void (*xFinal)(sqlite3_context*));
-  int  (*create_function16)(sqlite3*,const void*,int,int,void*,
-                            void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
-                            void (*xStep)(sqlite3_context*,int,sqlite3_value**),
-                            void (*xFinal)(sqlite3_context*));
-  int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
-  int  (*data_count)(sqlite3_stmt*pStmt);
-  sqlite3 * (*db_handle)(sqlite3_stmt*);
-  int (*declare_vtab)(sqlite3*,const char*);
-  int  (*enable_shared_cache)(int);
-  int  (*errcode)(sqlite3*db);
-  const char * (*errmsg)(sqlite3*);
-  const void * (*errmsg16)(sqlite3*);
-  int  (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
-  int  (*expired)(sqlite3_stmt*);
-  int  (*finalize)(sqlite3_stmt*pStmt);
-  void  (*free)(void*);
-  void  (*free_table)(char**result);
-  int  (*get_autocommit)(sqlite3*);
-  void * (*get_auxdata)(sqlite3_context*,int);
-  int  (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
-  int  (*global_recover)(void);
-  void  (*interruptx)(sqlite3*);
-  sqlite_int64  (*last_insert_rowid)(sqlite3*);
-  const char * (*libversion)(void);
-  int  (*libversion_number)(void);
-  void *(*malloc)(int);
-  char * (*mprintf)(const char*,...);
-  int  (*open)(const char*,sqlite3**);
-  int  (*open16)(const void*,sqlite3**);
-  int  (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
-  int  (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
-  void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
-  void  (*progress_handler)(sqlite3*,int,int(*)(void*),void*);
-  void *(*realloc)(void*,int);
-  int  (*reset)(sqlite3_stmt*pStmt);
-  void  (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));
-  void  (*result_double)(sqlite3_context*,double);
-  void  (*result_error)(sqlite3_context*,const char*,int);
-  void  (*result_error16)(sqlite3_context*,const void*,int);
-  void  (*result_int)(sqlite3_context*,int);
-  void  (*result_int64)(sqlite3_context*,sqlite_int64);
-  void  (*result_null)(sqlite3_context*);
-  void  (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
-  void  (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));
-  void  (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));
-  void  (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));
-  void  (*result_value)(sqlite3_context*,sqlite3_value*);
-  void * (*rollback_hook)(sqlite3*,void(*)(void*),void*);
-  int  (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,
-                         const char*,const char*),void*);
-  void  (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));
-  char * (*snprintf)(int,char*,const char*,...);
-  int  (*step)(sqlite3_stmt*);
-  int  (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,
-                                char const**,char const**,int*,int*,int*);
-  void  (*thread_cleanup)(void);
-  int  (*total_changes)(sqlite3*);
-  void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
-  int  (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
-  void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,
-                                         sqlite_int64),void*);
-  void * (*user_data)(sqlite3_context*);
-  const void * (*value_blob)(sqlite3_value*);
-  int  (*value_bytes)(sqlite3_value*);
-  int  (*value_bytes16)(sqlite3_value*);
-  double  (*value_double)(sqlite3_value*);
-  int  (*value_int)(sqlite3_value*);
-  sqlite_int64  (*value_int64)(sqlite3_value*);
-  int  (*value_numeric_type)(sqlite3_value*);
-  const unsigned char * (*value_text)(sqlite3_value*);
-  const void * (*value_text16)(sqlite3_value*);
-  const void * (*value_text16be)(sqlite3_value*);
-  const void * (*value_text16le)(sqlite3_value*);
-  int  (*value_type)(sqlite3_value*);
-  char *(*vmprintf)(const char*,va_list);
-  /* Added ??? */
-  int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
-  /* Added by 3.3.13 */
-  int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
-  int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
-  int (*clear_bindings)(sqlite3_stmt*);
-  /* Added by 3.4.1 */
-  int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,
-                          void (*xDestroy)(void *));
-  /* Added by 3.5.0 */
-  int (*bind_zeroblob)(sqlite3_stmt*,int,int);
-  int (*blob_bytes)(sqlite3_blob*);
-  int (*blob_close)(sqlite3_blob*);
-  int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,
-                   int,sqlite3_blob**);
-  int (*blob_read)(sqlite3_blob*,void*,int,int);
-  int (*blob_write)(sqlite3_blob*,const void*,int,int);
-  int (*create_collation_v2)(sqlite3*,const char*,int,void*,
-                             int(*)(void*,int,const void*,int,const void*),
-                             void(*)(void*));
-  int (*file_control)(sqlite3*,const char*,int,void*);
-  sqlite3_int64 (*memory_highwater)(int);
-  sqlite3_int64 (*memory_used)(void);
-  sqlite3_mutex *(*mutex_alloc)(int);
-  void (*mutex_enter)(sqlite3_mutex*);
-  void (*mutex_free)(sqlite3_mutex*);
-  void (*mutex_leave)(sqlite3_mutex*);
-  int (*mutex_try)(sqlite3_mutex*);
-  int (*open_v2)(const char*,sqlite3**,int,const char*);
-  int (*release_memory)(int);
-  void (*result_error_nomem)(sqlite3_context*);
-  void (*result_error_toobig)(sqlite3_context*);
-  int (*sleep)(int);
-  void (*soft_heap_limit)(int);
-  sqlite3_vfs *(*vfs_find)(const char*);
-  int (*vfs_register)(sqlite3_vfs*,int);
-  int (*vfs_unregister)(sqlite3_vfs*);
-  int (*xthreadsafe)(void);
-  void (*result_zeroblob)(sqlite3_context*,int);
-  void (*result_error_code)(sqlite3_context*,int);
-  int (*test_control)(int, ...);
-  void (*randomness)(int,void*);
-  sqlite3 *(*context_db_handle)(sqlite3_context*);
-  int (*extended_result_codes)(sqlite3*,int);
-  int (*limit)(sqlite3*,int,int);
-  sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
-  const char *(*sql)(sqlite3_stmt*);
-  int (*status)(int,int*,int*,int);
-  int (*backup_finish)(sqlite3_backup*);
-  sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*);
-  int (*backup_pagecount)(sqlite3_backup*);
-  int (*backup_remaining)(sqlite3_backup*);
-  int (*backup_step)(sqlite3_backup*,int);
-  const char *(*compileoption_get)(int);
-  int (*compileoption_used)(const char*);
-  int (*create_function_v2)(sqlite3*,const char*,int,int,void*,
-                            void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
-                            void (*xStep)(sqlite3_context*,int,sqlite3_value**),
-                            void (*xFinal)(sqlite3_context*),
-                            void(*xDestroy)(void*));
-  int (*db_config)(sqlite3*,int,...);
-  sqlite3_mutex *(*db_mutex)(sqlite3*);
-  int (*db_status)(sqlite3*,int,int*,int*,int);
-  int (*extended_errcode)(sqlite3*);
-  void (*log)(int,const char*,...);
-  sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64);
-  const char *(*sourceid)(void);
-  int (*stmt_status)(sqlite3_stmt*,int,int);
-  int (*strnicmp)(const char*,const char*,int);
-  int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*);
-  int (*wal_autocheckpoint)(sqlite3*,int);
-  int (*wal_checkpoint)(sqlite3*,const char*);
-  void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*);
-  int (*blob_reopen)(sqlite3_blob*,sqlite3_int64);
-  int (*vtab_config)(sqlite3*,int op,...);
-  int (*vtab_on_conflict)(sqlite3*);
-  /* Version 3.7.16 and later */
-  int (*close_v2)(sqlite3*);
-  const char *(*db_filename)(sqlite3*,const char*);
-  int (*db_readonly)(sqlite3*,const char*);
-  int (*db_release_memory)(sqlite3*);
-  const char *(*errstr)(int);
-  int (*stmt_busy)(sqlite3_stmt*);
-  int (*stmt_readonly)(sqlite3_stmt*);
-  int (*stricmp)(const char*,const char*);
-  int (*uri_boolean)(const char*,const char*,int);
-  sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
-  const char *(*uri_parameter)(const char*,const char*);
-  char *(*vsnprintf)(int,char*,const char*,va_list);
-  int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
-};
-
-/*
-** The following macros redefine the API routines so that they are
-** redirected throught the global sqlite3_api structure.
-**
-** This header file is also used by the loadext.c source file
-** (part of the main SQLite library - not an extension) so that
-** it can get access to the sqlite3_api_routines structure
-** definition.  But the main library does not want to redefine
-** the API.  So the redefinition macros are only valid if the
-** SQLITE_CORE macros is undefined.
-*/
-#ifndef SQLITE_CORE
-#define sqlite3_aggregate_context      sqlite3_api->aggregate_context
-#ifndef SQLITE_OMIT_DEPRECATED
-#define sqlite3_aggregate_count        sqlite3_api->aggregate_count
-#endif
-#define sqlite3_bind_blob              sqlite3_api->bind_blob
-#define sqlite3_bind_double            sqlite3_api->bind_double
-#define sqlite3_bind_int               sqlite3_api->bind_int
-#define sqlite3_bind_int64             sqlite3_api->bind_int64
-#define sqlite3_bind_null              sqlite3_api->bind_null
-#define sqlite3_bind_parameter_count   sqlite3_api->bind_parameter_count
-#define sqlite3_bind_parameter_index   sqlite3_api->bind_parameter_index
-#define sqlite3_bind_parameter_name    sqlite3_api->bind_parameter_name
-#define sqlite3_bind_text              sqlite3_api->bind_text
-#define sqlite3_bind_text16            sqlite3_api->bind_text16
-#define sqlite3_bind_value             sqlite3_api->bind_value
-#define sqlite3_busy_handler           sqlite3_api->busy_handler
-#define sqlite3_busy_timeout           sqlite3_api->busy_timeout
-#define sqlite3_changes                sqlite3_api->changes
-#define sqlite3_close                  sqlite3_api->close
-#define sqlite3_collation_needed       sqlite3_api->collation_needed
-#define sqlite3_collation_needed16     sqlite3_api->collation_needed16
-#define sqlite3_column_blob            sqlite3_api->column_blob
-#define sqlite3_column_bytes           sqlite3_api->column_bytes
-#define sqlite3_column_bytes16         sqlite3_api->column_bytes16
-#define sqlite3_column_count           sqlite3_api->column_count
-#define sqlite3_column_database_name   sqlite3_api->column_database_name
-#define sqlite3_column_database_name16 sqlite3_api->column_database_name16
-#define sqlite3_column_decltype        sqlite3_api->column_decltype
-#define sqlite3_column_decltype16      sqlite3_api->column_decltype16
-#define sqlite3_column_double          sqlite3_api->column_double
-#define sqlite3_column_int             sqlite3_api->column_int
-#define sqlite3_column_int64           sqlite3_api->column_int64
-#define sqlite3_column_name            sqlite3_api->column_name
-#define sqlite3_column_name16          sqlite3_api->column_name16
-#define sqlite3_column_origin_name     sqlite3_api->column_origin_name
-#define sqlite3_column_origin_name16   sqlite3_api->column_origin_name16
-#define sqlite3_column_table_name      sqlite3_api->column_table_name
-#define sqlite3_column_table_name16    sqlite3_api->column_table_name16
-#define sqlite3_column_text            sqlite3_api->column_text
-#define sqlite3_column_text16          sqlite3_api->column_text16
-#define sqlite3_column_type            sqlite3_api->column_type
-#define sqlite3_column_value           sqlite3_api->column_value
-#define sqlite3_commit_hook            sqlite3_api->commit_hook
-#define sqlite3_complete               sqlite3_api->complete
-#define sqlite3_complete16             sqlite3_api->complete16
-#define sqlite3_create_collation       sqlite3_api->create_collation
-#define sqlite3_create_collation16     sqlite3_api->create_collation16
-#define sqlite3_create_function        sqlite3_api->create_function
-#define sqlite3_create_function16      sqlite3_api->create_function16
-#define sqlite3_create_module          sqlite3_api->create_module
-#define sqlite3_create_module_v2       sqlite3_api->create_module_v2
-#define sqlite3_data_count             sqlite3_api->data_count
-#define sqlite3_db_handle              sqlite3_api->db_handle
-#define sqlite3_declare_vtab           sqlite3_api->declare_vtab
-#define sqlite3_enable_shared_cache    sqlite3_api->enable_shared_cache
-#define sqlite3_errcode                sqlite3_api->errcode
-#define sqlite3_errmsg                 sqlite3_api->errmsg
-#define sqlite3_errmsg16               sqlite3_api->errmsg16
-#define sqlite3_exec                   sqlite3_api->exec
-#ifndef SQLITE_OMIT_DEPRECATED
-#define sqlite3_expired                sqlite3_api->expired
-#endif
-#define sqlite3_finalize               sqlite3_api->finalize
-#define sqlite3_free                   sqlite3_api->free
-#define sqlite3_free_table             sqlite3_api->free_table
-#define sqlite3_get_autocommit         sqlite3_api->get_autocommit
-#define sqlite3_get_auxdata            sqlite3_api->get_auxdata
-#define sqlite3_get_table              sqlite3_api->get_table
-#ifndef SQLITE_OMIT_DEPRECATED
-#define sqlite3_global_recover         sqlite3_api->global_recover
-#endif
-#define sqlite3_interrupt              sqlite3_api->interruptx
-#define sqlite3_last_insert_rowid      sqlite3_api->last_insert_rowid
-#define sqlite3_libversion             sqlite3_api->libversion
-#define sqlite3_libversion_number      sqlite3_api->libversion_number
-#define sqlite3_malloc                 sqlite3_api->malloc
-#define sqlite3_mprintf                sqlite3_api->mprintf
-#define sqlite3_open                   sqlite3_api->open
-#define sqlite3_open16                 sqlite3_api->open16
-#define sqlite3_prepare                sqlite3_api->prepare
-#define sqlite3_prepare16              sqlite3_api->prepare16
-#define sqlite3_prepare_v2             sqlite3_api->prepare_v2
-#define sqlite3_prepare16_v2           sqlite3_api->prepare16_v2
-#define sqlite3_profile                sqlite3_api->profile
-#define sqlite3_progress_handler       sqlite3_api->progress_handler
-#define sqlite3_realloc                sqlite3_api->realloc
-#define sqlite3_reset                  sqlite3_api->reset
-#define sqlite3_result_blob            sqlite3_api->result_blob
-#define sqlite3_result_double          sqlite3_api->result_double
-#define sqlite3_result_error           sqlite3_api->result_error
-#define sqlite3_result_error16         sqlite3_api->result_error16
-#define sqlite3_result_int             sqlite3_api->result_int
-#define sqlite3_result_int64           sqlite3_api->result_int64
-#define sqlite3_result_null            sqlite3_api->result_null
-#define sqlite3_result_text            sqlite3_api->result_text
-#define sqlite3_result_text16          sqlite3_api->result_text16
-#define sqlite3_result_text16be        sqlite3_api->result_text16be
-#define sqlite3_result_text16le        sqlite3_api->result_text16le
-#define sqlite3_result_value           sqlite3_api->result_value
-#define sqlite3_rollback_hook          sqlite3_api->rollback_hook
-#define sqlite3_set_authorizer         sqlite3_api->set_authorizer
-#define sqlite3_set_auxdata            sqlite3_api->set_auxdata
-#define sqlite3_snprintf               sqlite3_api->snprintf
-#define sqlite3_step                   sqlite3_api->step
-#define sqlite3_table_column_metadata  sqlite3_api->table_column_metadata
-#define sqlite3_thread_cleanup         sqlite3_api->thread_cleanup
-#define sqlite3_total_changes          sqlite3_api->total_changes
-#define sqlite3_trace                  sqlite3_api->trace
-#ifndef SQLITE_OMIT_DEPRECATED
-#define sqlite3_transfer_bindings      sqlite3_api->transfer_bindings
-#endif
-#define sqlite3_update_hook            sqlite3_api->update_hook
-#define sqlite3_user_data              sqlite3_api->user_data
-#define sqlite3_value_blob             sqlite3_api->value_blob
-#define sqlite3_value_bytes            sqlite3_api->value_bytes
-#define sqlite3_value_bytes16          sqlite3_api->value_bytes16
-#define sqlite3_value_double           sqlite3_api->value_double
-#define sqlite3_value_int              sqlite3_api->value_int
-#define sqlite3_value_int64            sqlite3_api->value_int64
-#define sqlite3_value_numeric_type     sqlite3_api->value_numeric_type
-#define sqlite3_value_text             sqlite3_api->value_text
-#define sqlite3_value_text16           sqlite3_api->value_text16
-#define sqlite3_value_text16be         sqlite3_api->value_text16be
-#define sqlite3_value_text16le         sqlite3_api->value_text16le
-#define sqlite3_value_type             sqlite3_api->value_type
-#define sqlite3_vmprintf               sqlite3_api->vmprintf
-#define sqlite3_overload_function      sqlite3_api->overload_function
-#define sqlite3_prepare_v2             sqlite3_api->prepare_v2
-#define sqlite3_prepare16_v2           sqlite3_api->prepare16_v2
-#define sqlite3_clear_bindings         sqlite3_api->clear_bindings
-#define sqlite3_bind_zeroblob          sqlite3_api->bind_zeroblob
-#define sqlite3_blob_bytes             sqlite3_api->blob_bytes
-#define sqlite3_blob_close             sqlite3_api->blob_close
-#define sqlite3_blob_open              sqlite3_api->blob_open
-#define sqlite3_blob_read              sqlite3_api->blob_read
-#define sqlite3_blob_write             sqlite3_api->blob_write
-#define sqlite3_create_collation_v2    sqlite3_api->create_collation_v2
-#define sqlite3_file_control           sqlite3_api->file_control
-#define sqlite3_memory_highwater       sqlite3_api->memory_highwater
-#define sqlite3_memory_used            sqlite3_api->memory_used
-#define sqlite3_mutex_alloc            sqlite3_api->mutex_alloc
-#define sqlite3_mutex_enter            sqlite3_api->mutex_enter
-#define sqlite3_mutex_free             sqlite3_api->mutex_free
-#define sqlite3_mutex_leave            sqlite3_api->mutex_leave
-#define sqlite3_mutex_try              sqlite3_api->mutex_try
-#define sqlite3_open_v2                sqlite3_api->open_v2
-#define sqlite3_release_memory         sqlite3_api->release_memory
-#define sqlite3_result_error_nomem     sqlite3_api->result_error_nomem
-#define sqlite3_result_error_toobig    sqlite3_api->result_error_toobig
-#define sqlite3_sleep                  sqlite3_api->sleep
-#define sqlite3_soft_heap_limit        sqlite3_api->soft_heap_limit
-#define sqlite3_vfs_find               sqlite3_api->vfs_find
-#define sqlite3_vfs_register           sqlite3_api->vfs_register
-#define sqlite3_vfs_unregister         sqlite3_api->vfs_unregister
-#define sqlite3_threadsafe             sqlite3_api->xthreadsafe
-#define sqlite3_result_zeroblob        sqlite3_api->result_zeroblob
-#define sqlite3_result_error_code      sqlite3_api->result_error_code
-#define sqlite3_test_control           sqlite3_api->test_control
-#define sqlite3_randomness             sqlite3_api->randomness
-#define sqlite3_context_db_handle      sqlite3_api->context_db_handle
-#define sqlite3_extended_result_codes  sqlite3_api->extended_result_codes
-#define sqlite3_limit                  sqlite3_api->limit
-#define sqlite3_next_stmt              sqlite3_api->next_stmt
-#define sqlite3_sql                    sqlite3_api->sql
-#define sqlite3_status                 sqlite3_api->status
-#define sqlite3_backup_finish          sqlite3_api->backup_finish
-#define sqlite3_backup_init            sqlite3_api->backup_init
-#define sqlite3_backup_pagecount       sqlite3_api->backup_pagecount
-#define sqlite3_backup_remaining       sqlite3_api->backup_remaining
-#define sqlite3_backup_step            sqlite3_api->backup_step
-#define sqlite3_compileoption_get      sqlite3_api->compileoption_get
-#define sqlite3_compileoption_used     sqlite3_api->compileoption_used
-#define sqlite3_create_function_v2     sqlite3_api->create_function_v2
-#define sqlite3_db_config              sqlite3_api->db_config
-#define sqlite3_db_mutex               sqlite3_api->db_mutex
-#define sqlite3_db_status              sqlite3_api->db_status
-#define sqlite3_extended_errcode       sqlite3_api->extended_errcode
-#define sqlite3_log                    sqlite3_api->log
-#define sqlite3_soft_heap_limit64      sqlite3_api->soft_heap_limit64
-#define sqlite3_sourceid               sqlite3_api->sourceid
-#define sqlite3_stmt_status            sqlite3_api->stmt_status
-#define sqlite3_strnicmp               sqlite3_api->strnicmp
-#define sqlite3_unlock_notify          sqlite3_api->unlock_notify
-#define sqlite3_wal_autocheckpoint     sqlite3_api->wal_autocheckpoint
-#define sqlite3_wal_checkpoint         sqlite3_api->wal_checkpoint
-#define sqlite3_wal_hook               sqlite3_api->wal_hook
-#define sqlite3_blob_reopen            sqlite3_api->blob_reopen
-#define sqlite3_vtab_config            sqlite3_api->vtab_config
-#define sqlite3_vtab_on_conflict       sqlite3_api->vtab_on_conflict
-/* Version 3.7.16 and later */
-#define sqlite3_close_v2               sqlite3_api->close_v2
-#define sqlite3_db_filename            sqlite3_api->db_filename
-#define sqlite3_db_readonly            sqlite3_api->db_readonly
-#define sqlite3_db_release_memory      sqlite3_api->db_release_memory
-#define sqlite3_errstr                 sqlite3_api->errstr
-#define sqlite3_stmt_busy              sqlite3_api->stmt_busy
-#define sqlite3_stmt_readonly          sqlite3_api->stmt_readonly
-#define sqlite3_stricmp                sqlite3_api->stricmp
-#define sqlite3_uri_boolean            sqlite3_api->uri_boolean
-#define sqlite3_uri_int64              sqlite3_api->uri_int64
-#define sqlite3_uri_parameter          sqlite3_api->uri_parameter
-#define sqlite3_uri_vsnprintf          sqlite3_api->vsnprintf
-#define sqlite3_wal_checkpoint_v2      sqlite3_api->wal_checkpoint_v2
-#endif /* SQLITE_CORE */
-
-#ifndef SQLITE_CORE
-  /* This case when the file really is being compiled as a loadable 
-  ** extension */
-# define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api=0;
-# define SQLITE_EXTENSION_INIT2(v)  sqlite3_api=v;
-# define SQLITE_EXTENSION_INIT3     \
-    extern const sqlite3_api_routines *sqlite3_api;
-#else
-  /* This case when the file is being statically linked into the 
-  ** application */
-# define SQLITE_EXTENSION_INIT1     /*no-op*/
-# define SQLITE_EXTENSION_INIT2(v)  (void)v; /* unused parameter */
-# define SQLITE_EXTENSION_INIT3     /*no-op*/
-#endif
-
-#endif /* _SQLITE3EXT_H_ */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/.travis.yml
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/.travis.yml b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/.travis.yml
deleted file mode 100644
index 7f3fe9a..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: go 
-
-go: 
-  - 1.4
-  
-script:
-  - go test 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE
deleted file mode 100644
index f9c841a..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2013 Mitchell Hashimoto
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.



[17/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/indent.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/indent.go b/newt/Godeps/_workspace/src/github.com/kr/text/indent.go
new file mode 100644
index 0000000..4ebac45
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/indent.go
@@ -0,0 +1,74 @@
+package text
+
+import (
+	"io"
+)
+
+// Indent inserts prefix at the beginning of each non-empty line of s. The
+// end-of-line marker is NL.
+func Indent(s, prefix string) string {
+	return string(IndentBytes([]byte(s), []byte(prefix)))
+}
+
+// IndentBytes inserts prefix at the beginning of each non-empty line of b.
+// The end-of-line marker is NL.
+func IndentBytes(b, prefix []byte) []byte {
+	var res []byte
+	bol := true
+	for _, c := range b {
+		if bol && c != '\n' {
+			res = append(res, prefix...)
+		}
+		res = append(res, c)
+		bol = c == '\n'
+	}
+	return res
+}
+
+// Writer indents each line of its input.
+type indentWriter struct {
+	w   io.Writer
+	bol bool
+	pre [][]byte
+	sel int
+	off int
+}
+
+// NewIndentWriter makes a new write filter that indents the input
+// lines. Each line is prefixed in order with the corresponding
+// element of pre. If there are more lines than elements, the last
+// element of pre is repeated for each subsequent line.
+func NewIndentWriter(w io.Writer, pre ...[]byte) io.Writer {
+	return &indentWriter{
+		w:   w,
+		pre: pre,
+		bol: true,
+	}
+}
+
+// The only errors returned are from the underlying indentWriter.
+func (w *indentWriter) Write(p []byte) (n int, err error) {
+	for _, c := range p {
+		if w.bol {
+			var i int
+			i, err = w.w.Write(w.pre[w.sel][w.off:])
+			w.off += i
+			if err != nil {
+				return n, err
+			}
+		}
+		_, err = w.w.Write([]byte{c})
+		if err != nil {
+			return n, err
+		}
+		n++
+		w.bol = c == '\n'
+		if w.bol {
+			w.off = 0
+			if w.sel < len(w.pre)-1 {
+				w.sel++
+			}
+		}
+	}
+	return n, nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/indent_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/indent_test.go b/newt/Godeps/_workspace/src/github.com/kr/text/indent_test.go
new file mode 100644
index 0000000..5c723ee
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/indent_test.go
@@ -0,0 +1,119 @@
+package text
+
+import (
+	"bytes"
+	"testing"
+)
+
+type T struct {
+	inp, exp, pre string
+}
+
+var tests = []T{
+	{
+		"The quick brown fox\njumps over the lazy\ndog.\nBut not quickly.\n",
+		"xxxThe quick brown fox\nxxxjumps over the lazy\nxxxdog.\nxxxBut not quickly.\n",
+		"xxx",
+	},
+	{
+		"The quick brown fox\njumps over the lazy\ndog.\n\nBut not quickly.",
+		"xxxThe quick brown fox\nxxxjumps over the lazy\nxxxdog.\n\nxxxBut not quickly.",
+		"xxx",
+	},
+}
+
+func TestIndent(t *testing.T) {
+	for _, test := range tests {
+		got := Indent(test.inp, test.pre)
+		if got != test.exp {
+			t.Errorf("mismatch %q != %q", got, test.exp)
+		}
+	}
+}
+
+type IndentWriterTest struct {
+	inp, exp string
+	pre      []string
+}
+
+var ts = []IndentWriterTest{
+	{
+		`
+The quick brown fox
+jumps over the lazy
+dog.
+But not quickly.
+`[1:],
+		`
+xxxThe quick brown fox
+xxxjumps over the lazy
+xxxdog.
+xxxBut not quickly.
+`[1:],
+		[]string{"xxx"},
+	},
+	{
+		`
+The quick brown fox
+jumps over the lazy
+dog.
+But not quickly.
+`[1:],
+		`
+xxaThe quick brown fox
+xxxjumps over the lazy
+xxxdog.
+xxxBut not quickly.
+`[1:],
+		[]string{"xxa", "xxx"},
+	},
+	{
+		`
+The quick brown fox
+jumps over the lazy
+dog.
+But not quickly.
+`[1:],
+		`
+xxaThe quick brown fox
+xxbjumps over the lazy
+xxcdog.
+xxxBut not quickly.
+`[1:],
+		[]string{"xxa", "xxb", "xxc", "xxx"},
+	},
+	{
+		`
+The quick brown fox
+jumps over the lazy
+dog.
+
+But not quickly.`[1:],
+		`
+xxaThe quick brown fox
+xxxjumps over the lazy
+xxxdog.
+xxx
+xxxBut not quickly.`[1:],
+		[]string{"xxa", "xxx"},
+	},
+}
+
+func TestIndentWriter(t *testing.T) {
+	for _, test := range ts {
+		b := new(bytes.Buffer)
+		pre := make([][]byte, len(test.pre))
+		for i := range test.pre {
+			pre[i] = []byte(test.pre[i])
+		}
+		w := NewIndentWriter(b, pre...)
+		if _, err := w.Write([]byte(test.inp)); err != nil {
+			t.Error(err)
+		}
+		if got := b.String(); got != test.exp {
+			t.Errorf("mismatch %q != %q", got, test.exp)
+			t.Log(got)
+			t.Log(test.exp)
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/mc/Readme
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/mc/Readme b/newt/Godeps/_workspace/src/github.com/kr/text/mc/Readme
new file mode 100644
index 0000000..519ddc0
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/mc/Readme
@@ -0,0 +1,9 @@
+Command mc prints in multiple columns.
+
+  Usage: mc [-] [-N] [file...]
+
+Mc splits the input into as many columns as will fit in N
+print positions. If the output is a tty, the default N is
+the number of characters in a terminal line; otherwise the
+default N is 80. Under option - each input line ending in
+a colon ':' is printed separately.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/mc/mc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/mc/mc.go b/newt/Godeps/_workspace/src/github.com/kr/text/mc/mc.go
new file mode 100644
index 0000000..00169a3
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/mc/mc.go
@@ -0,0 +1,62 @@
+// Command mc prints in multiple columns.
+//
+//   Usage: mc [-] [-N] [file...]
+//
+// Mc splits the input into as many columns as will fit in N
+// print positions. If the output is a tty, the default N is
+// the number of characters in a terminal line; otherwise the
+// default N is 80. Under option - each input line ending in
+// a colon ':' is printed separately.
+package main
+
+import (
+	"github.com/kr/pty"
+	"github.com/kr/text/colwriter"
+	"io"
+	"log"
+	"os"
+	"strconv"
+)
+
+func main() {
+	var width int
+	var flag uint
+	args := os.Args[1:]
+	for len(args) > 0 && len(args[0]) > 0 && args[0][0] == '-' {
+		if len(args[0]) > 1 {
+			width, _ = strconv.Atoi(args[0][1:])
+		} else {
+			flag |= colwriter.BreakOnColon
+		}
+		args = args[1:]
+	}
+	if width < 1 {
+		_, width, _ = pty.Getsize(os.Stdout)
+	}
+	if width < 1 {
+		width = 80
+	}
+
+	w := colwriter.NewWriter(os.Stdout, width, flag)
+	if len(args) > 0 {
+		for _, s := range args {
+			if f, err := os.Open(s); err == nil {
+				copyin(w, f)
+				f.Close()
+			} else {
+				log.Println(err)
+			}
+		}
+	} else {
+		copyin(w, os.Stdin)
+	}
+}
+
+func copyin(w *colwriter.Writer, r io.Reader) {
+	if _, err := io.Copy(w, r); err != nil {
+		log.Println(err)
+	}
+	if err := w.Flush(); err != nil {
+		log.Println(err)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/wrap.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/wrap.go b/newt/Godeps/_workspace/src/github.com/kr/text/wrap.go
new file mode 100644
index 0000000..1c85cd2
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/wrap.go
@@ -0,0 +1,86 @@
+package text
+
+import (
+	"bytes"
+	"math"
+)
+
+var (
+	nl = []byte{'\n'}
+	sp = []byte{' '}
+)
+
+const defaultPenalty = 1e5
+
+// Wrap wraps s into a paragraph of lines of length lim, with minimal
+// raggedness.
+func Wrap(s string, lim int) string {
+	return string(WrapBytes([]byte(s), lim))
+}
+
+// WrapBytes wraps b into a paragraph of lines of length lim, with minimal
+// raggedness.
+func WrapBytes(b []byte, lim int) []byte {
+	words := bytes.Split(bytes.Replace(bytes.TrimSpace(b), nl, sp, -1), sp)
+	var lines [][]byte
+	for _, line := range WrapWords(words, 1, lim, defaultPenalty) {
+		lines = append(lines, bytes.Join(line, sp))
+	}
+	return bytes.Join(lines, nl)
+}
+
+// WrapWords is the low-level line-breaking algorithm, useful if you need more
+// control over the details of the text wrapping process. For most uses, either
+// Wrap or WrapBytes will be sufficient and more convenient.
+//
+// WrapWords splits a list of words into lines with minimal "raggedness",
+// treating each byte as one unit, accounting for spc units between adjacent
+// words on each line, and attempting to limit lines to lim units. Raggedness
+// is the total error over all lines, where error is the square of the
+// difference of the length of the line and lim. Too-long lines (which only
+// happen when a single word is longer than lim units) have pen penalty units
+// added to the error.
+func WrapWords(words [][]byte, spc, lim, pen int) [][][]byte {
+	n := len(words)
+
+	length := make([][]int, n)
+	for i := 0; i < n; i++ {
+		length[i] = make([]int, n)
+		length[i][i] = len(words[i])
+		for j := i + 1; j < n; j++ {
+			length[i][j] = length[i][j-1] + spc + len(words[j])
+		}
+	}
+
+	nbrk := make([]int, n)
+	cost := make([]int, n)
+	for i := range cost {
+		cost[i] = math.MaxInt32
+	}
+	for i := n - 1; i >= 0; i-- {
+		if length[i][n-1] <= lim {
+			cost[i] = 0
+			nbrk[i] = n
+		} else {
+			for j := i + 1; j < n; j++ {
+				d := lim - length[i][j-1]
+				c := d*d + cost[j]
+				if length[i][j-1] > lim {
+					c += pen // too-long lines get a worse penalty
+				}
+				if c < cost[i] {
+					cost[i] = c
+					nbrk[i] = j
+				}
+			}
+		}
+	}
+
+	var lines [][][]byte
+	i := 0
+	for i < n {
+		lines = append(lines, words[i:nbrk[i]])
+		i = nbrk[i]
+	}
+	return lines
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/wrap_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/wrap_test.go b/newt/Godeps/_workspace/src/github.com/kr/text/wrap_test.go
new file mode 100644
index 0000000..90f065c
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/wrap_test.go
@@ -0,0 +1,44 @@
+package text
+
+import (
+	"bytes"
+	"testing"
+)
+
+var text = "The quick brown fox jumps over the lazy dog."
+
+func TestWrap(t *testing.T) {
+	exp := [][]string{
+		{"The", "quick", "brown", "fox"},
+		{"jumps", "over", "the", "lazy", "dog."},
+	}
+	words := bytes.Split([]byte(text), sp)
+	got := WrapWords(words, 1, 24, defaultPenalty)
+	if len(exp) != len(got) {
+		t.Fail()
+	}
+	for i := range exp {
+		if len(exp[i]) != len(got[i]) {
+			t.Fail()
+		}
+		for j := range exp[i] {
+			if exp[i][j] != string(got[i][j]) {
+				t.Fatal(i, exp[i][j], got[i][j])
+			}
+		}
+	}
+}
+
+func TestWrapNarrow(t *testing.T) {
+	exp := "The\nquick\nbrown\nfox\njumps\nover\nthe\nlazy\ndog."
+	if Wrap(text, 5) != exp {
+		t.Fail()
+	}
+}
+
+func TestWrapOneLine(t *testing.T) {
+	exp := "The quick brown fox jumps over the lazy dog."
+	if Wrap(text, 500) != exp {
+		t.Fail()
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore b/newt/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore
new file mode 100644
index 0000000..0e379c5
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore
@@ -0,0 +1,2 @@
+*.sublime-project
+*.sublime-workspace

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml b/newt/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml
new file mode 100644
index 0000000..407127c
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml
@@ -0,0 +1,5 @@
+language: go
+go:
+    - release
+install: go get gopkg.in/check.v1
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE b/newt/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE
new file mode 100644
index 0000000..7eab43b
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE
@@ -0,0 +1,25 @@
+goproperties - properties file decoder for Go
+
+Copyright (c) 2013-2014 - Frank Schroeder
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/README.md b/newt/Godeps/_workspace/src/github.com/magiconair/properties/README.md
new file mode 100644
index 0000000..d05d86b
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/README.md
@@ -0,0 +1,121 @@
+Overview [![Build Status](https://travis-ci.org/magiconair/properties.png?branch=master)](https://travis-ci.org/magiconair/properties)
+========
+
+properties is a Go library for reading and writing properties files.
+
+It supports reading from multiple files and Spring style recursive property
+expansion of expressions like `${key}` to their corresponding value.
+Value expressions can refer to other keys like in `${key}` or to
+environment variables like in `${USER}`.
+Filenames can also contain environment variables like in
+`/home/${USER}/myapp.properties`.
+
+Comments and the order of keys are preserved. Comments can be modified
+and can be written to the output.
+
+The properties library supports both ISO-8859-1 and UTF-8 encoded data.
+
+Starting from version 1.3.0 the behavior of the MustXXX() functions is
+configurable by providing a custom `ErrorHandler` function. The default has
+changed from `panic` to `log.Fatal` but this is configurable and custom
+error handling functions can be provided. See the package documentation for
+details.
+
+Getting Started
+---------------
+
+```go
+import "github.com/magiconair/properties"
+
+func main() {
+	p := properties.MustLoadFile("${HOME}/config.properties", properties.UTF8)
+	host := p.MustGetString("host")
+	port := p.GetInt("port", 8080)
+}
+
+```
+
+Read the full documentation on [GoDoc](https://godoc.org/github.com/magiconair/properties)   [![GoDoc](https://godoc.org/github.com/magiconair/properties?status.png)](https://godoc.org/github.com/magiconair/properties)
+
+Installation and Upgrade
+------------------------
+
+```
+$ go get -u github.com/magiconair/properties
+```
+
+For testing and debugging you need the [go-check](https://github.com/go-check/check) library
+
+```
+$ go get -u gopkg.in/check.v1
+```
+
+History
+-------
+
+v1.5.3, 02 Jun 2015
+-------------------
+ * [Issue #4](https://github.com/magiconair/properties/issues/4): Maintain key order in [Filter()](http://godoc.org/github.com/magiconair/properties#Properties.Filter), [FilterPrefix()](http://godoc.org/github.com/magiconair/properties#Properties.FilterPrefix) and [FilterRegexp()](http://godoc.org/github.com/magiconair/properties#Properties.FilterRegexp)
+
+v1.5.2, 10 Apr 2015
+-------------------
+ * [Issue #3](https://github.com/magiconair/properties/issues/3): Don't print comments in [WriteComment()](http://godoc.org/github.com/magiconair/properties#Properties.WriteComment) if they are all empty
+ * Add clickable links to README
+
+v1.5.1, 08 Dec 2014
+-------------------
+ * Added [GetParsedDuration()](http://godoc.org/github.com/magiconair/properties#Properties.GetParsedDuration) and [MustGetParsedDuration()](http://godoc.org/github.com/magiconair/properties#Properties.MustGetParsedDuration) for values specified compatible with
+   [time.ParseDuration()](http://golang.org/pkg/time/#ParseDuration).
+
+v1.5.0, 18 Nov 2014
+-------------------
+ * Added support for single and multi-line comments (reading, writing and updating)
+ * The order of keys is now preserved
+ * Calling [Set()](http://godoc.org/github.com/magiconair/properties#Properties.Set) with an empty key now silently ignores the call and does not create a new entry
+ * Added a [MustSet()](http://godoc.org/github.com/magiconair/properties#Properties.MustSet) method
+ * Migrated test library from launchpad.net/gocheck to [gopkg.in/check.v1](http://gopkg.in/check.v1)
+
+v1.4.2, 15 Nov 2014
+-------------------
+ * [Issue #2](https://github.com/magiconair/properties/issues/2): Fixed goroutine leak in parser which created two lexers but cleaned up only one
+
+v1.4.1, 13 Nov 2014
+-------------------
+ * [Issue #1](https://github.com/magiconair/properties/issues/1): Fixed bug in Keys() method which returned an empty string
+
+v1.4.0, 23 Sep 2014
+-------------------
+ * Added [Keys()](http://godoc.org/github.com/magiconair/properties#Properties.Keys) to get the keys
+ * Added [Filter()](http://godoc.org/github.com/magiconair/properties#Properties.Filter), [FilterRegexp()](http://godoc.org/github.com/magiconair/properties#Properties.FilterRegexp) and [FilterPrefix()](http://godoc.org/github.com/magiconair/properties#Properties.FilterPrefix) to get a subset of the properties
+
+v1.3.0, 18 Mar 2014
+-------------------
+* Added support for time.Duration
+* Made MustXXX() failure behavior configurable (log.Fatal, panic, custom)
+* Changed default of MustXXX() failure from panic to log.Fatal
+
+v1.2.0, 05 Mar 2014
+-------------------
+* Added MustGet... functions
+* Added support for int and uint with range checks on 32 bit platforms
+
+v1.1.0, 20 Jan 2014
+-------------------
+* Renamed from goproperties to properties
+* Added support for expansion of environment vars in
+  filenames and value expressions
+* Fixed bug where value expressions were not at the
+  start of the string
+
+v1.0.0, 7 Jan 2014
+------------------
+* Initial release
+
+License
+-------
+
+2 clause BSD license. See [LICENSE](https://github.com/magiconair/properties/blob/master/LICENSE) file for details.
+
+ToDo
+----
+* Dump contents with passwords and secrets obscured

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go
new file mode 100644
index 0000000..b2019e1
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go
@@ -0,0 +1,22 @@
+// Copyright 2013-2014 Frank Schroeder. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package properties
+
+import (
+	"fmt"
+	"testing"
+)
+
+// Benchmarks the decoder by creating a property file with 1000 key/value pairs.
+func BenchmarkLoad(b *testing.B) {
+	input := ""
+	for i := 0; i < 1000; i++ {
+		input += fmt.Sprintf("key%d=value%d\n", i, i)
+	}
+	b.ResetTimer()
+	for i := 0; i < b.N; i++ {
+		Load([]byte(input), ISO_8859_1)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/doc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/doc.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/doc.go
new file mode 100644
index 0000000..69cf2e8
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/doc.go
@@ -0,0 +1,135 @@
+// Copyright 2013-2014 Frank Schroeder. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package properties provides functions for reading and writing
+// ISO-8859-1 and UTF-8 encoded .properties files and has
+// support for recursive property expansion.
+//
+// Java properties files are ISO-8859-1 encoded and use Unicode
+// literals for characters outside the ISO character set. Unicode
+// literals can be used in UTF-8 encoded properties files but
+// aren't necessary.
+//
+// To load a single properties file use MustLoadFile():
+//
+//   p := properties.MustLoadFile(filename, properties.UTF8)
+//
+// To load multiple properties files use MustLoadFiles()
+// which loads the files in the given order and merges the
+// result. Missing properties files can be ignored if the
+// 'ignoreMissing' flag is set to true.
+//
+// Filenames can contain environment variables which are expanded
+// before loading.
+//
+//   f1 := "/etc/myapp/myapp.conf"
+//   f2 := "/home/${USER}/myapp.conf"
+//   p := MustLoadFiles([]string{f1, f2}, properties.UTF8, true)
+//
+// All of the different key/value delimiters ' ', ':' and '=' are
+// supported as well as the comment characters '!' and '#' and
+// multi-line values.
+//
+//   ! this is a comment
+//   # and so is this
+//
+//   # the following expressions are equal
+//   key value
+//   key=value
+//   key:value
+//   key = value
+//   key : value
+//   key = val\
+//         ue
+//
+// Properties stores all comments preceding a key and provides
+// GetComments() and SetComments() methods to retrieve and
+// update them. The convenience functions GetComment() and
+// SetComment() allow access to the last comment. The
+// WriteComment() method writes properties files including
+// the comments and with the keys in the original order.
+// This can be used for sanitizing properties files.
+//
+// Property expansion is recursive and circular references
+// and malformed expressions are not allowed and cause an
+// error. Expansion of environment variables is supported.
+//
+//   # standard property
+//   key = value
+//
+//   # property expansion: key2 = value
+//   key2 = ${key}
+//
+//   # recursive expansion: key3 = value
+//   key3 = ${key2}
+//
+//   # circular reference (error)
+//   key = ${key}
+//
+//   # malformed expression (error)
+//   key = ${ke
+//
+//   # refers to the users' home dir
+//   home = ${HOME}
+//
+//   # local key takes precendence over env var: u = foo
+//   USER = foo
+//   u = ${USER}
+//
+// The default property expansion format is ${key} but can be
+// changed by setting different pre- and postfix values on the
+// Properties object.
+//
+//   p := properties.NewProperties()
+//   p.Prefix = "#["
+//   p.Postfix = "]#"
+//
+// Properties provides convenience functions for getting typed
+// values with default values if the key does not exist or the
+// type conversion failed.
+//
+//   # Returns true if the value is either "1", "on", "yes" or "true"
+//   # Returns false for every other value and the default value if
+//   # the key does not exist.
+//   v = p.GetBool("key", false)
+//
+//   # Returns the value if the key exists and the format conversion
+//   # was successful. Otherwise, the default value is returned.
+//   v = p.GetInt64("key", 999)
+//   v = p.GetUint64("key", 999)
+//   v = p.GetFloat64("key", 123.0)
+//   v = p.GetString("key", "def")
+//   v = p.GetDuration("key", 999)
+//
+// Properties provides several MustXXX() convenience functions
+// which will terminate the app if an error occurs. The behavior
+// of the failure is configurable and the default is to call
+// log.Fatal(err). To have the MustXXX() functions panic instead
+// of logging the error set a different ErrorHandler before
+// you use the Properties package.
+//
+//   properties.ErrorHandler = properties.PanicHandler
+//
+//   # Will panic instead of logging an error
+//   p := properties.MustLoadFile("config.properties")
+//
+// You can also provide your own ErrorHandler function. The only requirement
+// is that the error handler function must exit after handling the error.
+//
+//   properties.ErrorHandler = func(err error) {
+//	     fmt.Println(err)
+//       os.Exit(1)
+//   }
+//
+//   # Will write to stdout and then exit
+//   p := properties.MustLoadFile("config.properties")
+//
+// The following documents provide a description of the properties
+// file format.
+//
+// http://en.wikipedia.org/wiki/.properties
+//
+// http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#load%28java.io.Reader%29
+//
+package properties

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/example_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/example_test.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/example_test.go
new file mode 100644
index 0000000..38bf04f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/example_test.go
@@ -0,0 +1,93 @@
+// Copyright 2013-2014 Frank Schroeder. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package properties
+
+import (
+	"fmt"
+	"log"
+)
+
+func ExampleLoad_iso88591() {
+	buf := []byte("key = ISO-8859-1 value with unicode literal \\u2318 and umlaut \xE4") // 0xE4 == ä
+	p, _ := Load(buf, ISO_8859_1)
+	v, ok := p.Get("key")
+	fmt.Println(ok)
+	fmt.Println(v)
+	// Output:
+	// true
+	// ISO-8859-1 value with unicode literal ⌘ and umlaut ä
+}
+
+func ExampleLoad_utf8() {
+	p, _ := Load([]byte("key = UTF-8 value with unicode character ⌘ and umlaut ä"), UTF8)
+	v, ok := p.Get("key")
+	fmt.Println(ok)
+	fmt.Println(v)
+	// Output:
+	// true
+	// UTF-8 value with unicode character ⌘ and umlaut ä
+}
+
+func ExampleProperties_GetBool() {
+	var input = `
+	key=1
+	key2=On
+	key3=YES
+	key4=true`
+	p, _ := Load([]byte(input), ISO_8859_1)
+	fmt.Println(p.GetBool("key", false))
+	fmt.Println(p.GetBool("key2", false))
+	fmt.Println(p.GetBool("key3", false))
+	fmt.Println(p.GetBool("key4", false))
+	fmt.Println(p.GetBool("keyX", false))
+	// Output:
+	// true
+	// true
+	// true
+	// true
+	// false
+}
+
+func ExampleProperties_GetString() {
+	p, _ := Load([]byte("key=value"), ISO_8859_1)
+	v := p.GetString("another key", "default value")
+	fmt.Println(v)
+	// Output:
+	// default value
+}
+
+func Example() {
+	// Decode some key/value pairs with expressions
+	p, err := Load([]byte("key=value\nkey2=${key}"), ISO_8859_1)
+	if err != nil {
+		log.Fatal(err)
+	}
+
+	// Get a valid key
+	if v, ok := p.Get("key"); ok {
+		fmt.Println(v)
+	}
+
+	// Get an invalid key
+	if _, ok := p.Get("does not exist"); !ok {
+		fmt.Println("invalid key")
+	}
+
+	// Get a key with a default value
+	v := p.GetString("does not exist", "some value")
+	fmt.Println(v)
+
+	// Dump the expanded key/value pairs of the Properties
+	fmt.Println("Expanded key/value pairs")
+	fmt.Println(p)
+
+	// Output:
+	// value
+	// invalid key
+	// some value
+	// Expanded key/value pairs
+	// key = value
+	// key2 = value
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/lex.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/lex.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/lex.go
new file mode 100644
index 0000000..1ae7a45
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/lex.go
@@ -0,0 +1,409 @@
+// Copyright 2013-2014 Frank Schroeder. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+//
+// Parts of the lexer are from the template/text/parser package
+// For these parts the following applies:
+//
+// Copyright 2011 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 of the go 1.2
+// distribution.
+
+package properties
+
+import (
+	"fmt"
+	"strconv"
+	"strings"
+	"unicode/utf8"
+)
+
+// item represents a token or text string returned from the scanner.
+type item struct {
+	typ itemType // The type of this item.
+	pos int      // The starting position, in bytes, of this item in the input string.
+	val string   // The value of this item.
+}
+
+func (i item) String() string {
+	switch {
+	case i.typ == itemEOF:
+		return "EOF"
+	case i.typ == itemError:
+		return i.val
+	case len(i.val) > 10:
+		return fmt.Sprintf("%.10q...", i.val)
+	}
+	return fmt.Sprintf("%q", i.val)
+}
+
+// itemType identifies the type of lex items.
+type itemType int
+
+const (
+	itemError itemType = iota // error occurred; value is text of error
+	itemEOF
+	itemKey     // a key
+	itemValue   // a value
+	itemComment // a comment
+)
+
+// defines a constant for EOF
+const eof = -1
+
+// permitted whitespace characters space, FF and TAB
+const whitespace = " \f\t"
+
+// stateFn represents the state of the scanner as a function that returns the next state.
+type stateFn func(*lexer) stateFn
+
+// lexer holds the state of the scanner.
+type lexer struct {
+	input   string    // the string being scanned
+	state   stateFn   // the next lexing function to enter
+	pos     int       // current position in the input
+	start   int       // start position of this item
+	width   int       // width of last rune read from input
+	lastPos int       // position of most recent item returned by nextItem
+	runes   []rune    // scanned runes for this item
+	items   chan item // channel of scanned items
+}
+
+// next returns the next rune in the input.
+func (l *lexer) next() rune {
+	if int(l.pos) >= len(l.input) {
+		l.width = 0
+		return eof
+	}
+	r, w := utf8.DecodeRuneInString(l.input[l.pos:])
+	l.width = w
+	l.pos += l.width
+	return r
+}
+
+// peek returns but does not consume the next rune in the input.
+func (l *lexer) peek() rune {
+	r := l.next()
+	l.backup()
+	return r
+}
+
+// backup steps back one rune. Can only be called once per call of next.
+func (l *lexer) backup() {
+	l.pos -= l.width
+}
+
+// emit passes an item back to the client.
+func (l *lexer) emit(t itemType) {
+	item := item{t, l.start, string(l.runes)}
+	l.items <- item
+	l.start = l.pos
+	l.runes = l.runes[:0]
+}
+
+// ignore skips over the pending input before this point.
+func (l *lexer) ignore() {
+	l.start = l.pos
+}
+
+// appends the rune to the current value
+func (l *lexer) appendRune(r rune) {
+	l.runes = append(l.runes, r)
+}
+
+// accept consumes the next rune if it's from the valid set.
+func (l *lexer) accept(valid string) bool {
+	if strings.IndexRune(valid, l.next()) >= 0 {
+		return true
+	}
+	l.backup()
+	return false
+}
+
+// acceptRun consumes a run of runes from the valid set.
+func (l *lexer) acceptRun(valid string) {
+	for strings.IndexRune(valid, l.next()) >= 0 {
+	}
+	l.backup()
+}
+
+// acceptRunUntil consumes a run of runes up to a terminator.
+func (l *lexer) acceptRunUntil(term rune) {
+	for term != l.next() {
+	}
+	l.backup()
+}
+
+// hasText returns true if the current parsed text is not empty.
+func (l *lexer) isNotEmpty() bool {
+	return l.pos > l.start
+}
+
+// lineNumber reports which line we're on, based on the position of
+// the previous item returned by nextItem. Doing it this way
+// means we don't have to worry about peek double counting.
+func (l *lexer) lineNumber() int {
+	return 1 + strings.Count(l.input[:l.lastPos], "\n")
+}
+
+// errorf returns an error token and terminates the scan by passing
+// back a nil pointer that will be the next state, terminating l.nextItem.
+func (l *lexer) errorf(format string, args ...interface{}) stateFn {
+	l.items <- item{itemError, l.start, fmt.Sprintf(format, args...)}
+	return nil
+}
+
+// nextItem returns the next item from the input.
+func (l *lexer) nextItem() item {
+	item := <-l.items
+	l.lastPos = item.pos
+	return item
+}
+
+// lex creates a new scanner for the input string.
+func lex(input string) *lexer {
+	l := &lexer{
+		input: input,
+		items: make(chan item),
+		runes: make([]rune, 0, 32),
+	}
+	go l.run()
+	return l
+}
+
+// run runs the state machine for the lexer.
+func (l *lexer) run() {
+	for l.state = lexBeforeKey(l); l.state != nil; {
+		l.state = l.state(l)
+	}
+}
+
+// state functions
+
+// lexBeforeKey scans until a key begins.
+func lexBeforeKey(l *lexer) stateFn {
+	switch r := l.next(); {
+	case isEOF(r):
+		l.emit(itemEOF)
+		return nil
+
+	case isEOL(r):
+		l.ignore()
+		return lexBeforeKey
+
+	case isComment(r):
+		return lexComment
+
+	case isWhitespace(r):
+		l.acceptRun(whitespace)
+		l.ignore()
+		return lexKey
+
+	default:
+		l.backup()
+		return lexKey
+	}
+}
+
+// lexComment scans a comment line. The comment character has already been scanned.
+func lexComment(l *lexer) stateFn {
+	l.acceptRun(whitespace)
+	l.ignore()
+	for {
+		switch r := l.next(); {
+		case isEOF(r):
+			l.ignore()
+			l.emit(itemEOF)
+			return nil
+		case isEOL(r):
+			l.emit(itemComment)
+			return lexBeforeKey
+		default:
+			l.appendRune(r)
+		}
+	}
+}
+
+// lexKey scans the key up to a delimiter
+func lexKey(l *lexer) stateFn {
+	var r rune
+
+Loop:
+	for {
+		switch r = l.next(); {
+
+		case isEscape(r):
+			err := l.scanEscapeSequence()
+			if err != nil {
+				return l.errorf(err.Error())
+			}
+
+		case isEndOfKey(r):
+			l.backup()
+			break Loop
+
+		case isEOF(r):
+			break Loop
+
+		default:
+			l.appendRune(r)
+		}
+	}
+
+	if len(l.runes) > 0 {
+		l.emit(itemKey)
+	}
+
+	if isEOF(r) {
+		l.emit(itemEOF)
+		return nil
+	}
+
+	return lexBeforeValue
+}
+
+// lexBeforeValue scans the delimiter between key and value.
+// Leading and trailing whitespace is ignored.
+// We expect to be just after the key.
+func lexBeforeValue(l *lexer) stateFn {
+	l.acceptRun(whitespace)
+	l.accept(":=")
+	l.acceptRun(whitespace)
+	l.ignore()
+	return lexValue
+}
+
+// lexValue scans text until the end of the line. We expect to be just after the delimiter.
+func lexValue(l *lexer) stateFn {
+	for {
+		switch r := l.next(); {
+		case isEscape(r):
+			r := l.peek()
+			if isEOL(r) {
+				l.next()
+				l.acceptRun(whitespace)
+			} else {
+				err := l.scanEscapeSequence()
+				if err != nil {
+					return l.errorf(err.Error())
+				}
+			}
+
+		case isEOL(r):
+			l.emit(itemValue)
+			l.ignore()
+			return lexBeforeKey
+
+		case isEOF(r):
+			l.emit(itemValue)
+			l.emit(itemEOF)
+			return nil
+
+		default:
+			l.appendRune(r)
+		}
+	}
+}
+
+// scanEscapeSequence scans either one of the escaped characters
+// or a unicode literal. We expect to be after the escape character.
+func (l *lexer) scanEscapeSequence() error {
+	switch r := l.next(); {
+
+	case isEscapedCharacter(r):
+		l.appendRune(decodeEscapedCharacter(r))
+		return nil
+
+	case atUnicodeLiteral(r):
+		return l.scanUnicodeLiteral()
+
+	case isEOF(r):
+		return fmt.Errorf("premature EOF")
+
+	// silently drop the escape character and append the rune as is
+	default:
+		l.appendRune(r)
+		return nil
+	}
+}
+
+// scans a unicode literal in the form \uXXXX. We expect to be after the \u.
+func (l *lexer) scanUnicodeLiteral() error {
+	// scan the digits
+	d := make([]rune, 4)
+	for i := 0; i < 4; i++ {
+		d[i] = l.next()
+		if d[i] == eof || !strings.ContainsRune("0123456789abcdefABCDEF", d[i]) {
+			return fmt.Errorf("invalid unicode literal")
+		}
+	}
+
+	// decode the digits into a rune
+	r, err := strconv.ParseInt(string(d), 16, 0)
+	if err != nil {
+		return err
+	}
+
+	l.appendRune(rune(r))
+	return nil
+}
+
+// decodeEscapedCharacter returns the unescaped rune. We expect to be after the escape character.
+func decodeEscapedCharacter(r rune) rune {
+	switch r {
+	case 'f':
+		return '\f'
+	case 'n':
+		return '\n'
+	case 'r':
+		return '\r'
+	case 't':
+		return '\t'
+	default:
+		return r
+	}
+}
+
+// atUnicodeLiteral reports whether we are at a unicode literal.
+// The escape character has already been consumed.
+func atUnicodeLiteral(r rune) bool {
+	return r == 'u'
+}
+
+// isComment reports whether we are at the start of a comment.
+func isComment(r rune) bool {
+	return r == '#' || r == '!'
+}
+
+// isEndOfKey reports whether the rune terminates the current key.
+func isEndOfKey(r rune) bool {
+	return strings.ContainsRune(" \f\t\r\n:=", r)
+}
+
+// isEOF reports whether we are at EOF.
+func isEOF(r rune) bool {
+	return r == eof
+}
+
+// isEOL reports whether we are at a new line character.
+func isEOL(r rune) bool {
+	return r == '\n' || r == '\r'
+}
+
+// isEscape reports whether the rune is the escape character which
+// prefixes unicode literals and other escaped characters.
+func isEscape(r rune) bool {
+	return r == '\\'
+}
+
+// isEscapedCharacter reports whether we are at one of the characters that need escaping.
+// The escape character has already been consumed.
+func isEscapedCharacter(r rune) bool {
+	return strings.ContainsRune(" :=fnrt", r)
+}
+
+// isWhitespace reports whether the rune is a whitespace character.
+func isWhitespace(r rune) bool {
+	return strings.ContainsRune(whitespace, r)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/load.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/load.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/load.go
new file mode 100644
index 0000000..431d462
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/load.go
@@ -0,0 +1,124 @@
+// Copyright 2013-2014 Frank Schroeder. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package properties
+
+import (
+	"fmt"
+	"io/ioutil"
+	"os"
+)
+
+// Encoding specifies encoding of the input data.
+type Encoding uint
+
+const (
+	// UTF8 interprets the input data as UTF-8.
+	UTF8 Encoding = 1 << iota
+
+	// ISO_8859_1 interprets the input data as ISO-8859-1.
+	ISO_8859_1
+)
+
+// Load reads a buffer into a Properties struct.
+func Load(buf []byte, enc Encoding) (*Properties, error) {
+	return loadBuf(buf, enc)
+}
+
+// LoadFile reads a file into a Properties struct.
+func LoadFile(filename string, enc Encoding) (*Properties, error) {
+	return loadFiles([]string{filename}, enc, false)
+}
+
+// LoadFiles reads multiple files in the given order into
+// a Properties struct. If 'ignoreMissing' is true then
+// non-existent files will not be reported as error.
+func LoadFiles(filenames []string, enc Encoding, ignoreMissing bool) (*Properties, error) {
+	return loadFiles(filenames, enc, ignoreMissing)
+}
+
+// MustLoadFile reads a file into a Properties struct and
+// panics on error.
+func MustLoadFile(filename string, enc Encoding) *Properties {
+	return mustLoadFiles([]string{filename}, enc, false)
+}
+
+// MustLoadFiles reads multiple files in the given order into
+// a Properties struct and panics on error. If 'ignoreMissing'
+// is true then non-existent files will not be reported as error.
+func MustLoadFiles(filenames []string, enc Encoding, ignoreMissing bool) *Properties {
+	return mustLoadFiles(filenames, enc, ignoreMissing)
+}
+
+// ----------------------------------------------------------------------------
+
+func loadBuf(buf []byte, enc Encoding) (*Properties, error) {
+	p, err := parse(convert(buf, enc))
+	if err != nil {
+		return nil, err
+	}
+
+	return p, p.check()
+}
+
+func loadFiles(filenames []string, enc Encoding, ignoreMissing bool) (*Properties, error) {
+	buff := make([]byte, 0, 4096)
+
+	for _, filename := range filenames {
+		f, err := expandFilename(filename)
+		if err != nil {
+			return nil, err
+		}
+
+		buf, err := ioutil.ReadFile(f)
+		if err != nil {
+			if ignoreMissing && os.IsNotExist(err) {
+				// TODO(frank): should we log that we are skipping the file?
+				continue
+			}
+			return nil, err
+		}
+
+		// concatenate the buffers and add a new line in case
+		// the previous file didn't end with a new line
+		buff = append(append(buff, buf...), '\n')
+	}
+
+	return loadBuf(buff, enc)
+}
+
+func mustLoadFiles(filenames []string, enc Encoding, ignoreMissing bool) *Properties {
+	p, err := loadFiles(filenames, enc, ignoreMissing)
+	if err != nil {
+		ErrorHandler(err)
+	}
+	return p
+}
+
+// expandFilename expands ${ENV_VAR} expressions in a filename.
+// If the environment variable does not exist then it will be replaced
+// with an empty string. Malformed expressions like "${ENV_VAR" will
+// be reported as error.
+func expandFilename(filename string) (string, error) {
+	return expand(filename, make(map[string]bool), "${", "}", make(map[string]string))
+}
+
+// Interprets a byte buffer either as an ISO-8859-1 or UTF-8 encoded string.
+// For ISO-8859-1 we can convert each byte straight into a rune since the
+// first 256 unicode code points cover ISO-8859-1.
+func convert(buf []byte, enc Encoding) string {
+	switch enc {
+	case UTF8:
+		return string(buf)
+	case ISO_8859_1:
+		runes := make([]rune, len(buf))
+		for i, b := range buf {
+			runes[i] = rune(b)
+		}
+		return string(runes)
+	default:
+		ErrorHandler(fmt.Errorf("unsupported encoding %v", enc))
+	}
+	panic("ErrorHandler should exit")
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/load_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/load_test.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/load_test.go
new file mode 100644
index 0000000..9d1e3b6
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/load_test.go
@@ -0,0 +1,137 @@
+// Copyright 2013-2014 Frank Schroeder. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package properties
+
+import (
+	"fmt"
+	"io/ioutil"
+	"os"
+	"strings"
+
+	. "gopkg.in/check.v1"
+)
+
+type LoadSuite struct {
+	tempFiles []string
+}
+
+var (
+	_ = Suite(&LoadSuite{})
+)
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) TestLoadFailsWithNotExistingFile(c *C) {
+	_, err := LoadFile("doesnotexist.properties", ISO_8859_1)
+	c.Assert(err, NotNil)
+	c.Assert(err, ErrorMatches, "open.*no such file or directory")
+}
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) TestLoadFilesFailsOnNotExistingFile(c *C) {
+	_, err := LoadFiles([]string{"doesnotexist.properties"}, ISO_8859_1, false)
+	c.Assert(err, NotNil)
+	c.Assert(err, ErrorMatches, "open.*no such file or directory")
+}
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) TestLoadFilesDoesNotFailOnNotExistingFileAndIgnoreMissing(c *C) {
+	p, err := LoadFiles([]string{"doesnotexist.properties"}, ISO_8859_1, true)
+	c.Assert(err, IsNil)
+	c.Assert(p.Len(), Equals, 0)
+}
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) TestLoad(c *C) {
+	filename := s.makeFile(c, "key=value")
+	p := MustLoadFile(filename, ISO_8859_1)
+
+	c.Assert(p.Len(), Equals, 1)
+	assertKeyValues(c, "", p, "key", "value")
+}
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) TestLoadFiles(c *C) {
+	filename := s.makeFile(c, "key=value")
+	filename2 := s.makeFile(c, "key2=value2")
+	p := MustLoadFiles([]string{filename, filename2}, ISO_8859_1, false)
+	assertKeyValues(c, "", p, "key", "value", "key2", "value2")
+}
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) TestLoadExpandedFile(c *C) {
+	filename := s.makeFilePrefix(c, os.Getenv("USER"), "key=value")
+	filename = strings.Replace(filename, os.Getenv("USER"), "${USER}", -1)
+	p := MustLoadFile(filename, ISO_8859_1)
+	assertKeyValues(c, "", p, "key", "value")
+}
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) TestLoadFilesAndIgnoreMissing(c *C) {
+	filename := s.makeFile(c, "key=value")
+	filename2 := s.makeFile(c, "key2=value2")
+	p := MustLoadFiles([]string{filename, filename + "foo", filename2, filename2 + "foo"}, ISO_8859_1, true)
+	assertKeyValues(c, "", p, "key", "value", "key2", "value2")
+}
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) SetUpSuite(c *C) {
+	s.tempFiles = make([]string, 0)
+}
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) TearDownSuite(c *C) {
+	for _, path := range s.tempFiles {
+		err := os.Remove(path)
+		if err != nil {
+			fmt.Printf("os.Remove: %v", err)
+		}
+	}
+}
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) makeFile(c *C, data string) string {
+	return s.makeFilePrefix(c, "properties", data)
+}
+
+// ----------------------------------------------------------------------------
+
+func (s *LoadSuite) makeFilePrefix(c *C, prefix, data string) string {
+	f, err := ioutil.TempFile("", prefix)
+	if err != nil {
+		fmt.Printf("ioutil.TempFile: %v", err)
+		c.FailNow()
+	}
+
+	// remember the temp file so that we can remove it later
+	s.tempFiles = append(s.tempFiles, f.Name())
+
+	n, err := fmt.Fprint(f, data)
+	if err != nil {
+		fmt.Printf("fmt.Fprintln: %v", err)
+		c.FailNow()
+	}
+	if n != len(data) {
+		fmt.Printf("Data size mismatch. expected=%d wrote=%d\n", len(data), n)
+		c.FailNow()
+	}
+
+	err = f.Close()
+	if err != nil {
+		fmt.Printf("f.Close: %v", err)
+		c.FailNow()
+	}
+
+	return f.Name()
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/parser.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/parser.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/parser.go
new file mode 100644
index 0000000..bb71fb9
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/parser.go
@@ -0,0 +1,95 @@
+// Copyright 2013-2014 Frank Schroeder. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package properties
+
+import (
+	"fmt"
+	"runtime"
+)
+
+type parser struct {
+	lex *lexer
+}
+
+func parse(input string) (properties *Properties, err error) {
+	p := &parser{lex: lex(input)}
+	defer p.recover(&err)
+
+	properties = NewProperties()
+	key := ""
+	comments := []string{}
+
+	for {
+		token := p.expectOneOf(itemComment, itemKey, itemEOF)
+		switch token.typ {
+		case itemEOF:
+			goto done
+		case itemComment:
+			comments = append(comments, token.val)
+			continue
+		case itemKey:
+			key = token.val
+			if _, ok := properties.m[key]; !ok {
+				properties.k = append(properties.k, key)
+			}
+		}
+
+		token = p.expectOneOf(itemValue, itemEOF)
+		if len(comments) > 0 {
+			properties.c[key] = comments
+			comments = []string{}
+		}
+		switch token.typ {
+		case itemEOF:
+			properties.m[key] = ""
+			goto done
+		case itemValue:
+			properties.m[key] = token.val
+		}
+	}
+
+done:
+	return properties, nil
+}
+
+func (p *parser) errorf(format string, args ...interface{}) {
+	format = fmt.Sprintf("properties: Line %d: %s", p.lex.lineNumber(), format)
+	panic(fmt.Errorf(format, args...))
+}
+
+func (p *parser) expect(expected itemType) (token item) {
+	token = p.lex.nextItem()
+	if token.typ != expected {
+		p.unexpected(token)
+	}
+	return token
+}
+
+func (p *parser) expectOneOf(expected ...itemType) (token item) {
+	token = p.lex.nextItem()
+	for _, v := range expected {
+		if token.typ == v {
+			return token
+		}
+	}
+	p.unexpected(token)
+	panic("unexpected token")
+}
+
+func (p *parser) unexpected(token item) {
+	p.errorf(token.String())
+}
+
+// recover is the handler that turns panics into returns from the top level of Parse.
+func (p *parser) recover(errp *error) {
+	e := recover()
+	if e != nil {
+		if _, ok := e.(runtime.Error); ok {
+			panic(e)
+		}
+		*errp = e.(error)
+	}
+	return
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/properties.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/properties.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/properties.go
new file mode 100644
index 0000000..edcaccc
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/properties.go
@@ -0,0 +1,698 @@
+// Copyright 2013-2014 Frank Schroeder. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package properties
+
+// BUG(frank): Set() does not check for invalid unicode literals since this is currently handled by the lexer.
+// BUG(frank): Write() does not allow to configure the newline character. Therefore, on Windows LF is used.
+
+import (
+	"fmt"
+	"io"
+	"log"
+	"os"
+	"regexp"
+	"strconv"
+	"strings"
+	"time"
+	"unicode/utf8"
+)
+
+// ErrorHandlerFunc defines the type of function which handles failures
+// of the MustXXX() functions. An error handler function must exit
+// the application after handling the error.
+type ErrorHandlerFunc func(error)
+
+// ErrorHandler is the function which handles failures of the MustXXX()
+// functions. The default is LogFatalHandler.
+var ErrorHandler = LogFatalHandler
+
+// LogFatalHandler handles the error by logging a fatal error and exiting.
+func LogFatalHandler(err error) {
+	log.Fatal(err)
+}
+
+// PanicHandler handles the error by panicking.
+func PanicHandler(err error) {
+	panic(err)
+}
+
+// -----------------------------------------------------------------------------
+
+// A Properties contains the key/value pairs from the properties input.
+// All values are stored in unexpanded form and are expanded at runtime
+type Properties struct {
+	// Pre-/Postfix for property expansion.
+	Prefix  string
+	Postfix string
+
+	// Stores the key/value pairs
+	m map[string]string
+
+	// Stores the comments per key.
+	c map[string][]string
+
+	// Stores the keys in order of appearance.
+	k []string
+}
+
+// NewProperties creates a new Properties struct with the default
+// configuration for "${key}" expressions.
+func NewProperties() *Properties {
+	return &Properties{
+		Prefix:  "${",
+		Postfix: "}",
+		m:       map[string]string{},
+		c:       map[string][]string{},
+		k:       []string{},
+	}
+}
+
+// Get returns the expanded value for the given key if exists.
+// Otherwise, ok is false.
+func (p *Properties) Get(key string) (value string, ok bool) {
+	v, ok := p.m[key]
+	if !ok {
+		return "", false
+	}
+
+	expanded, err := p.expand(v)
+
+	// we guarantee that the expanded value is free of
+	// circular references and malformed expressions
+	// so we panic if we still get an error here.
+	if err != nil {
+		ErrorHandler(fmt.Errorf("%s in %q", err, key+" = "+v))
+	}
+
+	return expanded, true
+}
+
+// MustGet returns the expanded value for the given key if exists.
+// Otherwise, it panics.
+func (p *Properties) MustGet(key string) string {
+	if v, ok := p.Get(key); ok {
+		return v
+	}
+	ErrorHandler(invalidKeyError(key))
+	panic("ErrorHandler should exit")
+}
+
+// ----------------------------------------------------------------------------
+
+// ClearComments removes the comments for all keys.
+func (p *Properties) ClearComments() {
+	p.c = map[string][]string{}
+}
+
+// ----------------------------------------------------------------------------
+
+// GetComment returns the last comment before the given key or an empty string.
+func (p *Properties) GetComment(key string) string {
+	comments, ok := p.c[key]
+	if !ok || len(comments) == 0 {
+		return ""
+	}
+	return comments[len(comments)-1]
+}
+
+// ----------------------------------------------------------------------------
+
+// GetComments returns all comments that appeared before the given key or nil.
+func (p *Properties) GetComments(key string) []string {
+	if comments, ok := p.c[key]; ok {
+		return comments
+	}
+	return nil
+}
+
+// ----------------------------------------------------------------------------
+
+// SetComment sets the comment for the key.
+func (p *Properties) SetComment(key, comment string) {
+	p.c[key] = []string{comment}
+}
+
+// ----------------------------------------------------------------------------
+
+// SetComments sets the comments for the key. If the comments are nil then
+// all comments for this key are deleted.
+func (p *Properties) SetComments(key string, comments []string) {
+	if comments == nil {
+		delete(p.c, key)
+		return
+	}
+	p.c[key] = comments
+}
+
+// ----------------------------------------------------------------------------
+
+// GetBool checks if the expanded value is one of '1', 'yes',
+// 'true' or 'on' if the key exists. The comparison is case-insensitive.
+// If the key does not exist the default value is returned.
+func (p *Properties) GetBool(key string, def bool) bool {
+	v, err := p.getBool(key)
+	if err != nil {
+		return def
+	}
+	return v
+}
+
+// MustGetBool checks if the expanded value is one of '1', 'yes',
+// 'true' or 'on' if the key exists. The comparison is case-insensitive.
+// If the key does not exist the function panics.
+func (p *Properties) MustGetBool(key string) bool {
+	v, err := p.getBool(key)
+	if err != nil {
+		ErrorHandler(err)
+	}
+	return v
+}
+
+func (p *Properties) getBool(key string) (value bool, err error) {
+	if v, ok := p.Get(key); ok {
+		v = strings.ToLower(v)
+		return v == "1" || v == "true" || v == "yes" || v == "on", nil
+	}
+	return false, invalidKeyError(key)
+}
+
+// ----------------------------------------------------------------------------
+
+// GetDuration parses the expanded value as an time.Duration (in ns) if the
+// key exists. If key does not exist or the value cannot be parsed the default
+// value is returned. In almost all cases you want to use GetParsedDuration().
+func (p *Properties) GetDuration(key string, def time.Duration) time.Duration {
+	v, err := p.getInt64(key)
+	if err != nil {
+		return def
+	}
+	return time.Duration(v)
+}
+
+// MustGetDuration parses the expanded value as an time.Duration (in ns) if
+// the key exists. If key does not exist or the value cannot be parsed the
+// function panics. In almost all cases you want to use MustGetParsedDuration().
+func (p *Properties) MustGetDuration(key string) time.Duration {
+	v, err := p.getInt64(key)
+	if err != nil {
+		ErrorHandler(err)
+	}
+	return time.Duration(v)
+}
+
+// ----------------------------------------------------------------------------
+
+// GetParsedDuration parses the expanded value with time.ParseDuration() if the key exists.
+// If key does not exist or the value cannot be parsed the default
+// value is returned.
+func (p *Properties) GetParsedDuration(key string, def time.Duration) time.Duration {
+	s, ok := p.Get(key)
+	if !ok {
+		return def
+	}
+	v, err := time.ParseDuration(s)
+	if err != nil {
+		return def
+	}
+	return v
+}
+
+// MustGetParsedDuration parses the expanded value with time.ParseDuration() if the key exists.
+// If key does not exist or the value cannot be parsed the function panics.
+func (p *Properties) MustGetParsedDuration(key string) time.Duration {
+	s, ok := p.Get(key)
+	if !ok {
+		ErrorHandler(invalidKeyError(key))
+	}
+	v, err := time.ParseDuration(s)
+	if err != nil {
+		ErrorHandler(err)
+	}
+	return v
+}
+
+// ----------------------------------------------------------------------------
+
+// GetFloat64 parses the expanded value as a float64 if the key exists.
+// If key does not exist or the value cannot be parsed the default
+// value is returned.
+func (p *Properties) GetFloat64(key string, def float64) float64 {
+	v, err := p.getFloat64(key)
+	if err != nil {
+		return def
+	}
+	return v
+}
+
+// MustGetFloat64 parses the expanded value as a float64 if the key exists.
+// If key does not exist or the value cannot be parsed the function panics.
+func (p *Properties) MustGetFloat64(key string) float64 {
+	v, err := p.getFloat64(key)
+	if err != nil {
+		ErrorHandler(err)
+	}
+	return v
+}
+
+func (p *Properties) getFloat64(key string) (value float64, err error) {
+	if v, ok := p.Get(key); ok {
+		value, err = strconv.ParseFloat(v, 64)
+		if err != nil {
+			return 0, err
+		}
+		return value, nil
+	}
+	return 0, invalidKeyError(key)
+}
+
+// ----------------------------------------------------------------------------
+
+// GetInt parses the expanded value as an int if the key exists.
+// If key does not exist or the value cannot be parsed the default
+// value is returned. If the value does not fit into an int the
+// function panics with an out of range error.
+func (p *Properties) GetInt(key string, def int) int {
+	v, err := p.getInt64(key)
+	if err != nil {
+		return def
+	}
+	return intRangeCheck(key, v)
+}
+
+// MustGetInt parses the expanded value as an int if the key exists.
+// If key does not exist or the value cannot be parsed the function panics.
+// If the value does not fit into an int the function panics with
+// an out of range error.
+func (p *Properties) MustGetInt(key string) int {
+	v, err := p.getInt64(key)
+	if err != nil {
+		ErrorHandler(err)
+	}
+	return intRangeCheck(key, v)
+}
+
+// ----------------------------------------------------------------------------
+
+// GetInt64 parses the expanded value as an int64 if the key exists.
+// If key does not exist or the value cannot be parsed the default
+// value is returned.
+func (p *Properties) GetInt64(key string, def int64) int64 {
+	v, err := p.getInt64(key)
+	if err != nil {
+		return def
+	}
+	return v
+}
+
+// MustGetInt64 parses the expanded value as an int if the key exists.
+// If key does not exist or the value cannot be parsed the function panics.
+func (p *Properties) MustGetInt64(key string) int64 {
+	v, err := p.getInt64(key)
+	if err != nil {
+		ErrorHandler(err)
+	}
+	return v
+}
+
+func (p *Properties) getInt64(key string) (value int64, err error) {
+	if v, ok := p.Get(key); ok {
+		value, err = strconv.ParseInt(v, 10, 64)
+		if err != nil {
+			return 0, err
+		}
+		return value, nil
+	}
+	return 0, invalidKeyError(key)
+}
+
+// ----------------------------------------------------------------------------
+
+// GetUint parses the expanded value as an uint if the key exists.
+// If key does not exist or the value cannot be parsed the default
+// value is returned. If the value does not fit into an int the
+// function panics with an out of range error.
+func (p *Properties) GetUint(key string, def uint) uint {
+	v, err := p.getUint64(key)
+	if err != nil {
+		return def
+	}
+	return uintRangeCheck(key, v)
+}
+
+// MustGetUint parses the expanded value as an int if the key exists.
+// If key does not exist or the value cannot be parsed the function panics.
+// If the value does not fit into an int the function panics with
+// an out of range error.
+func (p *Properties) MustGetUint(key string) uint {
+	v, err := p.getUint64(key)
+	if err != nil {
+		ErrorHandler(err)
+	}
+	return uintRangeCheck(key, v)
+}
+
+// ----------------------------------------------------------------------------
+
+// GetUint64 parses the expanded value as an uint64 if the key exists.
+// If key does not exist or the value cannot be parsed the default
+// value is returned.
+func (p *Properties) GetUint64(key string, def uint64) uint64 {
+	v, err := p.getUint64(key)
+	if err != nil {
+		return def
+	}
+	return v
+}
+
+// MustGetUint64 parses the expanded value as an int if the key exists.
+// If key does not exist or the value cannot be parsed the function panics.
+func (p *Properties) MustGetUint64(key string) uint64 {
+	v, err := p.getUint64(key)
+	if err != nil {
+		ErrorHandler(err)
+	}
+	return v
+}
+
+func (p *Properties) getUint64(key string) (value uint64, err error) {
+	if v, ok := p.Get(key); ok {
+		value, err = strconv.ParseUint(v, 10, 64)
+		if err != nil {
+			return 0, err
+		}
+		return value, nil
+	}
+	return 0, invalidKeyError(key)
+}
+
+// ----------------------------------------------------------------------------
+
+// GetString returns the expanded value for the given key if exists or
+// the default value otherwise.
+func (p *Properties) GetString(key, def string) string {
+	if v, ok := p.Get(key); ok {
+		return v
+	}
+	return def
+}
+
+// MustGetString returns the expanded value for the given key if exists or
+// panics otherwise.
+func (p *Properties) MustGetString(key string) string {
+	if v, ok := p.Get(key); ok {
+		return v
+	}
+	ErrorHandler(invalidKeyError(key))
+	panic("ErrorHandler should exit")
+}
+
+// ----------------------------------------------------------------------------
+
+// Filter returns a new properties object which contains all properties
+// for which the key matches the pattern.
+func (p *Properties) Filter(pattern string) (*Properties, error) {
+	re, err := regexp.Compile(pattern)
+	if err != nil {
+		return nil, err
+	}
+
+	return p.FilterRegexp(re), nil
+}
+
+// FilterRegexp returns a new properties object which contains all properties
+// for which the key matches the regular expression.
+func (p *Properties) FilterRegexp(re *regexp.Regexp) *Properties {
+	pp := NewProperties()
+	for _, k := range p.k {
+		if re.MatchString(k) {
+			pp.Set(k, p.m[k])
+		}
+	}
+	return pp
+}
+
+// FilterPrefix returns a new properties object which contains all properties
+// for which the key starts with the prefix.
+func (p *Properties) FilterPrefix(prefix string) *Properties {
+	pp := NewProperties()
+	for _, k := range p.k {
+		if strings.HasPrefix(k, prefix) {
+			pp.Set(k, p.m[k])
+		}
+	}
+	return pp
+}
+
+// Len returns the number of keys.
+func (p *Properties) Len() int {
+	return len(p.m)
+}
+
+// Keys returns all keys in the same order as in the input.
+func (p *Properties) Keys() []string {
+	keys := make([]string, len(p.k))
+	for i, k := range p.k {
+		keys[i] = k
+	}
+	return keys
+}
+
+// Set sets the property key to the corresponding value.
+// If a value for key existed before then ok is true and prev
+// contains the previous value. If the value contains a
+// circular reference or a malformed expression then
+// an error is returned.
+// An empty key is silently ignored.
+func (p *Properties) Set(key, value string) (prev string, ok bool, err error) {
+	if key == "" {
+		return "", false, nil
+	}
+
+	// to check for a circular reference we temporarily need
+	// to set the new value. If there is an error then revert
+	// to the previous state. Only if all tests are successful
+	// then we add the key to the p.k list.
+	prev, ok = p.Get(key)
+	p.m[key] = value
+
+	// now check for a circular reference
+	_, err = p.expand(value)
+	if err != nil {
+
+		// revert to the previous state
+		if ok {
+			p.m[key] = prev
+		} else {
+			delete(p.m, key)
+		}
+
+		return "", false, err
+	}
+
+	if !ok {
+		p.k = append(p.k, key)
+	}
+
+	return prev, ok, nil
+}
+
+// MustSet sets the property key to the corresponding value.
+// If a value for key existed before then ok is true and prev
+// contains the previous value. An empty key is silently ignored.
+func (p *Properties) MustSet(key, value string) (prev string, ok bool) {
+	prev, ok, err := p.Set(key, value)
+	if err != nil {
+		ErrorHandler(err)
+	}
+	return prev, ok
+}
+
+// String returns a string of all expanded 'key = value' pairs.
+func (p *Properties) String() string {
+	var s string
+	for _, key := range p.k {
+		value, _ := p.Get(key)
+		s = fmt.Sprintf("%s%s = %s\n", s, key, value)
+	}
+	return s
+}
+
+// Write writes all unexpanded 'key = value' pairs to the given writer.
+// Write returns the number of bytes written and any write error encountered.
+func (p *Properties) Write(w io.Writer, enc Encoding) (n int, err error) {
+	return p.WriteComment(w, "", enc)
+}
+
+// WriteComment writes all unexpanced 'key = value' pairs to the given writer.
+// If prefix is not empty then comments are written with a blank line and the
+// given prefix. The prefix should be either "# " or "! " to be compatible with
+// the properties file format. Otherwise, the properties parser will not be
+// able to read the file back in. It returns the number of bytes written and
+// any write error encountered.
+func (p *Properties) WriteComment(w io.Writer, prefix string, enc Encoding) (n int, err error) {
+	var x int
+
+	for _, key := range p.k {
+		value := p.m[key]
+
+		if prefix != "" {
+			if comments, ok := p.c[key]; ok {
+				// don't print comments if they are all empty
+				allEmpty := true
+				for _, c := range comments {
+					if c != "" {
+						allEmpty = false
+						break
+					}
+				}
+
+				if !allEmpty {
+					// add a blank line between entries but not at the top
+					if len(comments) > 0 && n > 0 {
+						x, err = fmt.Fprintln(w)
+						if err != nil {
+							return
+						}
+						n += x
+					}
+
+					for _, c := range comments {
+						x, err = fmt.Fprintf(w, "%s%s\n", prefix, encode(c, "", enc))
+						if err != nil {
+							return
+						}
+						n += x
+					}
+				}
+			}
+		}
+
+		x, err = fmt.Fprintf(w, "%s = %s\n", encode(key, " :", enc), encode(value, "", enc))
+		if err != nil {
+			return
+		}
+		n += x
+	}
+	return
+}
+
+// ----------------------------------------------------------------------------
+
+// check expands all values and returns an error if a circular reference or
+// a malformed expression was found.
+func (p *Properties) check() error {
+	for _, value := range p.m {
+		if _, err := p.expand(value); err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+func (p *Properties) expand(input string) (string, error) {
+	// no pre/postfix -> nothing to expand
+	if p.Prefix == "" && p.Postfix == "" {
+		return input, nil
+	}
+
+	return expand(input, make(map[string]bool), p.Prefix, p.Postfix, p.m)
+}
+
+// expand recursively expands expressions of '(prefix)key(postfix)' to their corresponding values.
+// The function keeps track of the keys that were already expanded and stops if it
+// detects a circular reference or a malformed expression of the form '(prefix)key'.
+func expand(s string, keys map[string]bool, prefix, postfix string, values map[string]string) (string, error) {
+	start := strings.Index(s, prefix)
+	if start == -1 {
+		return s, nil
+	}
+
+	keyStart := start + len(prefix)
+	keyLen := strings.Index(s[keyStart:], postfix)
+	if keyLen == -1 {
+		return "", fmt.Errorf("malformed expression")
+	}
+
+	end := keyStart + keyLen + len(postfix) - 1
+	key := s[keyStart : keyStart+keyLen]
+
+	// fmt.Printf("s:%q pp:%q start:%d end:%d keyStart:%d keyLen:%d key:%q\n", s, prefix + "..." + postfix, start, end, keyStart, keyLen, key)
+
+	if _, ok := keys[key]; ok {
+		return "", fmt.Errorf("circular reference")
+	}
+
+	val, ok := values[key]
+	if !ok {
+		val = os.Getenv(key)
+	}
+
+	// remember that we've seen the key
+	keys[key] = true
+
+	return expand(s[:start]+val+s[end+1:], keys, prefix, postfix, values)
+}
+
+// encode encodes a UTF-8 string to ISO-8859-1 and escapes some characters.
+func encode(s string, special string, enc Encoding) string {
+	switch enc {
+	case UTF8:
+		return encodeUtf8(s, special)
+	case ISO_8859_1:
+		return encodeIso(s, special)
+	default:
+		panic(fmt.Sprintf("unsupported encoding %v", enc))
+	}
+}
+
+func encodeUtf8(s string, special string) string {
+	v := ""
+	for pos := 0; pos < len(s); {
+		r, w := utf8.DecodeRuneInString(s[pos:])
+		pos += w
+		v += escape(r, special)
+	}
+	return v
+}
+
+func encodeIso(s string, special string) string {
+	var r rune
+	var w int
+	var v string
+	for pos := 0; pos < len(s); {
+		switch r, w = utf8.DecodeRuneInString(s[pos:]); {
+		case r < 1<<8: // single byte rune -> escape special chars only
+			v += escape(r, special)
+		case r < 1<<16: // two byte rune -> unicode literal
+			v += fmt.Sprintf("\\u%04x", r)
+		default: // more than two bytes per rune -> can't encode
+			v += "?"
+		}
+		pos += w
+	}
+	return v
+}
+
+func escape(r rune, special string) string {
+	switch r {
+	case '\f':
+		return "\\f"
+	case '\n':
+		return "\\n"
+	case '\r':
+		return "\\r"
+	case '\t':
+		return "\\t"
+	default:
+		if strings.ContainsRune(special, r) {
+			return "\\" + string(r)
+		}
+		return string(r)
+	}
+}
+
+func invalidKeyError(key string) error {
+	return fmt.Errorf("unknown property: %s", key)
+}


[30/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/flag.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/flag.go b/Godeps/_workspace/src/github.com/spf13/pflag/flag.go
deleted file mode 100644
index 865259b..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/flag.go
+++ /dev/null
@@ -1,749 +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.
-
-/*
-	pflag is a drop-in replacement for Go's flag package, implementing
-	POSIX/GNU-style --flags.
-
-	pflag is compatible with the GNU extensions to the POSIX recommendations
-	for command-line options. See
-	http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
-
-	Usage:
-
-	pflag is a drop-in replacement of Go's native flag package. If you import
-	pflag under the name "flag" then all code should continue to function
-	with no changes.
-
-		import flag "github.com/ogier/pflag"
-
-	There is one exception to this: if you directly instantiate the Flag struct
-	there is one more field "Shorthand" that you will need to set.
-	Most code never instantiates this struct directly, and instead uses
-	functions such as String(), BoolVar(), and Var(), and is therefore
-	unaffected.
-
-	Define flags using flag.String(), Bool(), Int(), etc.
-
-	This declares an integer flag, -flagname, stored in the pointer ip, with type *int.
-		var ip = flag.Int("flagname", 1234, "help message for flagname")
-	If you like, you can bind the flag to a variable using the Var() functions.
-		var flagvar int
-		func init() {
-			flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname")
-		}
-	Or you can create custom flags that satisfy the Value interface (with
-	pointer receivers) and couple them to flag parsing by
-		flag.Var(&flagVal, "name", "help message for flagname")
-	For such flags, the default value is just the initial value of the variable.
-
-	After all flags are defined, call
-		flag.Parse()
-	to parse the command line into the defined flags.
-
-	Flags may then be used directly. If you're using the flags themselves,
-	they are all pointers; if you bind to variables, they're values.
-		fmt.Println("ip has value ", *ip)
-		fmt.Println("flagvar has value ", flagvar)
-
-	After parsing, the arguments after the flag are available as the
-	slice flag.Args() or individually as flag.Arg(i).
-	The arguments are indexed from 0 through flag.NArg()-1.
-
-	The pflag package also defines some new functions that are not in flag,
-	that give one-letter shorthands for flags. You can use these by appending
-	'P' to the name of any function that defines a flag.
-		var ip = flag.IntP("flagname", "f", 1234, "help message")
-		var flagvar bool
-		func init() {
-			flag.BoolVarP("boolname", "b", true, "help message")
-		}
-		flag.VarP(&flagVar, "varname", "v", 1234, "help message")
-	Shorthand letters can be used with single dashes on the command line.
-	Boolean shorthand flags can be combined with other shorthand flags.
-
-	Command line flag syntax:
-		--flag    // boolean flags only
-		--flag=x
-
-	Unlike the flag package, a single dash before an option means something
-	different than a double dash. Single dashes signify a series of shorthand
-	letters for flags. All but the last shorthand letter must be boolean flags.
-		// boolean flags
-		-f
-		-abc
-		// non-boolean flags
-		-n 1234
-		-Ifile
-		// mixed
-		-abcs "hello"
-		-abcn1234
-
-	Flag parsing stops after the terminator "--". Unlike the flag package,
-	flags can be interspersed with arguments anywhere on the command line
-	before this terminator.
-
-	Integer flags accept 1234, 0664, 0x1234 and may be negative.
-	Boolean flags (in their long form) accept 1, 0, t, f, true, false,
-	TRUE, FALSE, True, False.
-	Duration flags accept any input valid for time.ParseDuration.
-
-	The default set of command-line flags is controlled by
-	top-level functions.  The FlagSet type allows one to define
-	independent sets of flags, such as to implement subcommands
-	in a command-line interface. The methods of FlagSet are
-	analogous to the top-level functions for the command-line
-	flag set.
-*/
-package pflag
-
-import (
-	"bytes"
-	"errors"
-	"fmt"
-	"io"
-	"os"
-	"sort"
-	"strings"
-)
-
-// ErrHelp is the error returned if the flag -help is invoked but no such flag is defined.
-var ErrHelp = errors.New("pflag: help requested")
-
-// ErrorHandling defines how to handle flag parsing errors.
-type ErrorHandling int
-
-const (
-	ContinueOnError ErrorHandling = iota
-	ExitOnError
-	PanicOnError
-)
-
-// NormalizedName is a flag name that has been normalized according to rules
-// for the FlagSet (e.g. making '-' and '_' equivalent).
-type NormalizedName string
-
-// A FlagSet represents a set of defined flags.
-type FlagSet struct {
-	// Usage is the function called when an error occurs while parsing flags.
-	// The field is a function (not a method) that may be changed to point to
-	// a custom error handler.
-	Usage func()
-
-	name              string
-	parsed            bool
-	actual            map[NormalizedName]*Flag
-	formal            map[NormalizedName]*Flag
-	shorthands        map[byte]*Flag
-	args              []string // arguments after flags
-	exitOnError       bool     // does the program exit if there's an error?
-	errorHandling     ErrorHandling
-	output            io.Writer // nil means stderr; use out() accessor
-	interspersed      bool      // allow interspersed option/non-option args
-	normalizeNameFunc func(f *FlagSet, name string) NormalizedName
-}
-
-// A Flag represents the state of a flag.
-type Flag struct {
-	Name        string              // name as it appears on command line
-	Shorthand   string              // one-letter abbreviated flag
-	Usage       string              // help message
-	Value       Value               // value as set
-	DefValue    string              // default value (as text); for usage message
-	Changed     bool                // If the user set the value (or if left to default)
-	NoOptDefVal string              //default value (as text); if the flag is on the command line without any options
-	Deprecated  string              // If this flag is deprecated, this string is the new or now thing to use
-	Annotations map[string][]string // used by cobra.Command  bash autocomple code
-}
-
-// Value is the interface to the dynamic value stored in a flag.
-// (The default value is represented as a string.)
-type Value interface {
-	String() string
-	Set(string) error
-	Type() string
-}
-
-// sortFlags returns the flags as a slice in lexicographical sorted order.
-func sortFlags(flags map[NormalizedName]*Flag) []*Flag {
-	list := make(sort.StringSlice, len(flags))
-	i := 0
-	for k := range flags {
-		list[i] = string(k)
-		i++
-	}
-	list.Sort()
-	result := make([]*Flag, len(list))
-	for i, name := range list {
-		result[i] = flags[NormalizedName(name)]
-	}
-	return result
-}
-
-func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) {
-	f.normalizeNameFunc = n
-	for k, v := range f.formal {
-		delete(f.formal, k)
-		nname := f.normalizeFlagName(string(k))
-		f.formal[nname] = v
-		v.Name = string(nname)
-	}
-}
-
-func (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) NormalizedName {
-	if f.normalizeNameFunc != nil {
-		return f.normalizeNameFunc
-	}
-	return func(f *FlagSet, name string) NormalizedName { return NormalizedName(name) }
-}
-
-func (f *FlagSet) normalizeFlagName(name string) NormalizedName {
-	n := f.GetNormalizeFunc()
-	return n(f, name)
-}
-
-func (f *FlagSet) out() io.Writer {
-	if f.output == nil {
-		return os.Stderr
-	}
-	return f.output
-}
-
-// SetOutput sets the destination for usage and error messages.
-// If output is nil, os.Stderr is used.
-func (f *FlagSet) SetOutput(output io.Writer) {
-	f.output = output
-}
-
-// VisitAll visits the flags in lexicographical order, calling fn for each.
-// It visits all flags, even those not set.
-func (f *FlagSet) VisitAll(fn func(*Flag)) {
-	for _, flag := range sortFlags(f.formal) {
-		fn(flag)
-	}
-}
-
-func (f *FlagSet) HasFlags() bool {
-	return len(f.formal) > 0
-}
-
-// VisitAll visits the command-line flags in lexicographical order, calling
-// fn for each.  It visits all flags, even those not set.
-func VisitAll(fn func(*Flag)) {
-	CommandLine.VisitAll(fn)
-}
-
-// Visit visits the flags in lexicographical order, calling fn for each.
-// It visits only those flags that have been set.
-func (f *FlagSet) Visit(fn func(*Flag)) {
-	for _, flag := range sortFlags(f.actual) {
-		fn(flag)
-	}
-}
-
-// Visit visits the command-line flags in lexicographical order, calling fn
-// for each.  It visits only those flags that have been set.
-func Visit(fn func(*Flag)) {
-	CommandLine.Visit(fn)
-}
-
-// Lookup returns the Flag structure of the named flag, returning nil if none exists.
-func (f *FlagSet) Lookup(name string) *Flag {
-	return f.lookup(f.normalizeFlagName(name))
-}
-
-// lookup returns the Flag structure of the named flag, returning nil if none exists.
-func (f *FlagSet) lookup(name NormalizedName) *Flag {
-	return f.formal[name]
-}
-
-// func to return a given type for a given flag name
-func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) {
-	flag := f.Lookup(name)
-	if flag == nil {
-		err := fmt.Errorf("flag accessed but not defined: %s\n", name)
-		return nil, err
-	}
-
-	if flag.Value.Type() != ftype {
-		err := fmt.Errorf("trying to get %s value of flag of type %s\n", ftype, flag.Value.Type())
-		return nil, err
-	}
-
-	sval := flag.Value.String()
-	result, err := convFunc(sval)
-	if err != nil {
-		return nil, err
-	}
-	return result, nil
-}
-
-// Mark a flag deprecated in your program
-func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error {
-	flag := f.Lookup(name)
-	if flag == nil {
-		return fmt.Errorf("flag %q does not exist", name)
-	}
-	flag.Deprecated = usageMessage
-	return nil
-}
-
-// Lookup returns the Flag structure of the named command-line flag,
-// returning nil if none exists.
-func Lookup(name string) *Flag {
-	return CommandLine.Lookup(name)
-}
-
-// Set sets the value of the named flag.
-func (f *FlagSet) Set(name, value string) error {
-	normalName := f.normalizeFlagName(name)
-	flag, ok := f.formal[normalName]
-	if !ok {
-		return fmt.Errorf("no such flag -%v", name)
-	}
-	err := flag.Value.Set(value)
-	if err != nil {
-		return err
-	}
-	if f.actual == nil {
-		f.actual = make(map[NormalizedName]*Flag)
-	}
-	f.actual[normalName] = flag
-	flag.Changed = true
-	if len(flag.Deprecated) > 0 {
-		fmt.Fprintf(os.Stderr, "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
-	}
-	return nil
-}
-
-func (f *FlagSet) SetAnnotation(name, key string, values []string) error {
-	normalName := f.normalizeFlagName(name)
-	flag, ok := f.formal[normalName]
-	if !ok {
-		return fmt.Errorf("no such flag -%v", name)
-	}
-	if flag.Annotations == nil {
-		flag.Annotations = map[string][]string{}
-	}
-	flag.Annotations[key] = values
-	return nil
-}
-
-// Set sets the value of the named command-line flag.
-func Set(name, value string) error {
-	return CommandLine.Set(name, value)
-}
-
-// PrintDefaults prints, to standard error unless configured
-// otherwise, the default values of all defined flags in the set.
-func (f *FlagSet) PrintDefaults() {
-	f.VisitAll(func(flag *Flag) {
-		if len(flag.Deprecated) > 0 {
-			return
-		}
-		format := ""
-		// ex: w/ option string argument '-%s, --%s[=%q]: %s\n'
-		if len(flag.Shorthand) > 0 {
-			format = "  -%s, --%s"
-		} else {
-			format = "   %s   --%s"
-		}
-		if len(flag.NoOptDefVal) > 0 {
-			format = format + "["
-		}
-		if _, ok := flag.Value.(*stringValue); ok {
-			format = format + "=%q"
-		} else {
-			format = format + "=%s"
-		}
-		if len(flag.NoOptDefVal) > 0 {
-			format = format + "]"
-		}
-		format = format + ": %s\n"
-		fmt.Fprintf(f.out(), format, flag.Shorthand, flag.Name, flag.DefValue, flag.Usage)
-	})
-}
-
-func (f *FlagSet) FlagUsages() string {
-	x := new(bytes.Buffer)
-
-	f.VisitAll(func(flag *Flag) {
-		if len(flag.Deprecated) > 0 {
-			return
-		}
-		format := "--%s=%s: %s\n"
-		if _, ok := flag.Value.(*stringValue); ok {
-			// put quotes on the value
-			format = "--%s=%q: %s\n"
-		}
-		if len(flag.Shorthand) > 0 {
-			format = "  -%s, " + format
-		} else {
-			format = "   %s   " + format
-		}
-		fmt.Fprintf(x, format, flag.Shorthand, flag.Name, flag.DefValue, flag.Usage)
-	})
-
-	return x.String()
-}
-
-// PrintDefaults prints to standard error the default values of all defined command-line flags.
-func PrintDefaults() {
-	CommandLine.PrintDefaults()
-}
-
-// defaultUsage is the default function to print a usage message.
-func defaultUsage(f *FlagSet) {
-	fmt.Fprintf(f.out(), "Usage of %s:\n", f.name)
-	f.PrintDefaults()
-}
-
-// NOTE: Usage is not just defaultUsage(CommandLine)
-// because it serves (via godoc flag Usage) as the example
-// for how to write your own usage function.
-
-// Usage prints to standard error a usage message documenting all defined command-line flags.
-// The function is a variable that may be changed to point to a custom function.
-var Usage = func() {
-	fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
-	PrintDefaults()
-}
-
-// NFlag returns the number of flags that have been set.
-func (f *FlagSet) NFlag() int { return len(f.actual) }
-
-// NFlag returns the number of command-line flags that have been set.
-func NFlag() int { return len(CommandLine.actual) }
-
-// Arg returns the i'th argument.  Arg(0) is the first remaining argument
-// after flags have been processed.
-func (f *FlagSet) Arg(i int) string {
-	if i < 0 || i >= len(f.args) {
-		return ""
-	}
-	return f.args[i]
-}
-
-// Arg returns the i'th command-line argument.  Arg(0) is the first remaining argument
-// after flags have been processed.
-func Arg(i int) string {
-	return CommandLine.Arg(i)
-}
-
-// NArg is the number of arguments remaining after flags have been processed.
-func (f *FlagSet) NArg() int { return len(f.args) }
-
-// NArg is the number of arguments remaining after flags have been processed.
-func NArg() int { return len(CommandLine.args) }
-
-// Args returns the non-flag arguments.
-func (f *FlagSet) Args() []string { return f.args }
-
-// Args returns the non-flag command-line arguments.
-func Args() []string { return CommandLine.args }
-
-// Var defines a flag with the specified name and usage string. The type and
-// value of the flag are represented by the first argument, of type Value, which
-// typically holds a user-defined implementation of Value. For instance, the
-// caller could create a flag that turns a comma-separated string into a slice
-// of strings by giving the slice the methods of Value; in particular, Set would
-// decompose the comma-separated string into the slice.
-func (f *FlagSet) Var(value Value, name string, usage string) {
-	f.VarP(value, name, "", usage)
-}
-
-// Like VarP, but returns the flag created
-func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag {
-	// Remember the default value as a string; it won't change.
-	flag := &Flag{
-		Name:      name,
-		Shorthand: shorthand,
-		Usage:     usage,
-		Value:     value,
-		DefValue:  value.String(),
-	}
-	f.AddFlag(flag)
-	return flag
-}
-
-// Like Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) VarP(value Value, name, shorthand, usage string) {
-	_ = f.VarPF(value, name, shorthand, usage)
-}
-
-func (f *FlagSet) AddFlag(flag *Flag) {
-	// Call normalizeFlagName function only once
-	var normalizedFlagName NormalizedName = f.normalizeFlagName(flag.Name)
-
-	_, alreadythere := f.formal[normalizedFlagName]
-	if alreadythere {
-		msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name)
-		fmt.Fprintln(f.out(), msg)
-		panic(msg) // Happens only if flags are declared with identical names
-	}
-	if f.formal == nil {
-		f.formal = make(map[NormalizedName]*Flag)
-	}
-
-	flag.Name = string(normalizedFlagName)
-	f.formal[normalizedFlagName] = flag
-
-	if len(flag.Shorthand) == 0 {
-		return
-	}
-	if len(flag.Shorthand) > 1 {
-		fmt.Fprintf(f.out(), "%s shorthand more than ASCII character: %s\n", f.name, flag.Shorthand)
-		panic("shorthand is more than one character")
-	}
-	if f.shorthands == nil {
-		f.shorthands = make(map[byte]*Flag)
-	}
-	c := flag.Shorthand[0]
-	old, alreadythere := f.shorthands[c]
-	if alreadythere {
-		fmt.Fprintf(f.out(), "%s shorthand reused: %q for %s already used for %s\n", f.name, c, flag.Name, old.Name)
-		panic("shorthand redefinition")
-	}
-	f.shorthands[c] = flag
-}
-
-// Var defines a flag with the specified name and usage string. The type and
-// value of the flag are represented by the first argument, of type Value, which
-// typically holds a user-defined implementation of Value. For instance, the
-// caller could create a flag that turns a comma-separated string into a slice
-// of strings by giving the slice the methods of Value; in particular, Set would
-// decompose the comma-separated string into the slice.
-func Var(value Value, name string, usage string) {
-	CommandLine.VarP(value, name, "", usage)
-}
-
-// Like Var, but accepts a shorthand letter that can be used after a single dash.
-func VarP(value Value, name, shorthand, usage string) {
-	CommandLine.VarP(value, name, shorthand, usage)
-}
-
-// failf prints to standard error a formatted error and usage message and
-// returns the error.
-func (f *FlagSet) failf(format string, a ...interface{}) error {
-	err := fmt.Errorf(format, a...)
-	fmt.Fprintln(f.out(), err)
-	f.usage()
-	return err
-}
-
-// usage calls the Usage method for the flag set, or the usage function if
-// the flag set is CommandLine.
-func (f *FlagSet) usage() {
-	if f == CommandLine {
-		Usage()
-	} else if f.Usage == nil {
-		defaultUsage(f)
-	} else {
-		f.Usage()
-	}
-}
-
-func (f *FlagSet) setFlag(flag *Flag, value string, origArg string) error {
-	if err := flag.Value.Set(value); err != nil {
-		return f.failf("invalid argument %q for %s: %v", value, origArg, err)
-	}
-	// mark as visited for Visit()
-	if f.actual == nil {
-		f.actual = make(map[NormalizedName]*Flag)
-	}
-	f.actual[f.normalizeFlagName(flag.Name)] = flag
-	flag.Changed = true
-	if len(flag.Deprecated) > 0 {
-		fmt.Fprintf(os.Stderr, "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
-	}
-	return nil
-}
-
-func (f *FlagSet) parseLongArg(s string, args []string) (a []string, err error) {
-	a = args
-	name := s[2:]
-	if len(name) == 0 || name[0] == '-' || name[0] == '=' {
-		err = f.failf("bad flag syntax: %s", s)
-		return
-	}
-	split := strings.SplitN(name, "=", 2)
-	name = split[0]
-	flag, alreadythere := f.formal[f.normalizeFlagName(name)]
-	if !alreadythere {
-		if name == "help" { // special case for nice help message.
-			f.usage()
-			return a, ErrHelp
-		}
-		err = f.failf("unknown flag: --%s", name)
-		return
-	}
-	var value string
-	if len(split) == 2 {
-		// '--flag=arg'
-		value = split[1]
-	} else if len(flag.NoOptDefVal) > 0 {
-		// '--flag' (arg was optional)
-		value = flag.NoOptDefVal
-	} else if len(a) > 0 {
-		// '--flag arg'
-		value = a[0]
-		a = a[1:]
-	} else {
-		// '--flag' (arg was required)
-		err = f.failf("flag needs an argument: %s", s)
-		return
-	}
-	err = f.setFlag(flag, value, s)
-	return
-}
-
-func (f *FlagSet) parseSingleShortArg(shorthands string, args []string) (outShorts string, outArgs []string, err error) {
-	outArgs = args
-	outShorts = shorthands[1:]
-	c := shorthands[0]
-
-	flag, alreadythere := f.shorthands[c]
-	if !alreadythere {
-		if c == 'h' { // special case for nice help message.
-			f.usage()
-			err = ErrHelp
-			return
-		}
-		//TODO continue on error
-		err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands)
-		return
-	}
-	var value string
-	if len(shorthands) > 2 && shorthands[1] == '=' {
-		value = shorthands[2:]
-		outShorts = ""
-	} else if len(flag.NoOptDefVal) > 0 {
-		value = flag.NoOptDefVal
-	} else if len(shorthands) > 1 {
-		value = shorthands[1:]
-		outShorts = ""
-	} else if len(args) > 0 {
-		value = args[0]
-		outArgs = args[1:]
-	} else {
-		err = f.failf("flag needs an argument: %q in -%s", c, shorthands)
-		return
-	}
-	err = f.setFlag(flag, value, shorthands)
-	return
-}
-
-func (f *FlagSet) parseShortArg(s string, args []string) (a []string, err error) {
-	a = args
-	shorthands := s[1:]
-
-	for len(shorthands) > 0 {
-		shorthands, a, err = f.parseSingleShortArg(shorthands, args)
-		if err != nil {
-			return
-		}
-	}
-
-	return
-}
-
-func (f *FlagSet) parseArgs(args []string) (err error) {
-	for len(args) > 0 {
-		s := args[0]
-		args = args[1:]
-		if len(s) == 0 || s[0] != '-' || len(s) == 1 {
-			if !f.interspersed {
-				f.args = append(f.args, s)
-				f.args = append(f.args, args...)
-				return nil
-			}
-			f.args = append(f.args, s)
-			continue
-		}
-
-		if s[1] == '-' {
-			if len(s) == 2 { // "--" terminates the flags
-				f.args = append(f.args, args...)
-				break
-			}
-			args, err = f.parseLongArg(s, args)
-		} else {
-			args, err = f.parseShortArg(s, args)
-		}
-		if err != nil {
-			return
-		}
-	}
-	return
-}
-
-// Parse parses flag definitions from the argument list, which should not
-// include the command name.  Must be called after all flags in the FlagSet
-// are defined and before flags are accessed by the program.
-// The return value will be ErrHelp if -help was set but not defined.
-func (f *FlagSet) Parse(arguments []string) error {
-	f.parsed = true
-	f.args = make([]string, 0, len(arguments))
-	err := f.parseArgs(arguments)
-	if err != nil {
-		switch f.errorHandling {
-		case ContinueOnError:
-			return err
-		case ExitOnError:
-			os.Exit(2)
-		case PanicOnError:
-			panic(err)
-		}
-	}
-	return nil
-}
-
-// Parsed reports whether f.Parse has been called.
-func (f *FlagSet) Parsed() bool {
-	return f.parsed
-}
-
-// Parse parses the command-line flags from os.Args[1:].  Must be called
-// after all flags are defined and before flags are accessed by the program.
-func Parse() {
-	// Ignore errors; CommandLine is set for ExitOnError.
-	CommandLine.Parse(os.Args[1:])
-}
-
-// Whether to support interspersed option/non-option arguments.
-func SetInterspersed(interspersed bool) {
-	CommandLine.SetInterspersed(interspersed)
-}
-
-// Parsed returns true if the command-line flags have been parsed.
-func Parsed() bool {
-	return CommandLine.Parsed()
-}
-
-// The default set of command-line flags, parsed from os.Args.
-var CommandLine = NewFlagSet(os.Args[0], ExitOnError)
-
-// NewFlagSet returns a new, empty flag set with the specified name and
-// error handling property.
-func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {
-	f := &FlagSet{
-		name:          name,
-		errorHandling: errorHandling,
-		interspersed:  true,
-	}
-	return f
-}
-
-// Whether to support interspersed option/non-option arguments.
-func (f *FlagSet) SetInterspersed(interspersed bool) {
-	f.interspersed = interspersed
-}
-
-// Init sets the name and error handling property for a flag set.
-// By default, the zero FlagSet uses an empty name and the
-// ContinueOnError error handling policy.
-func (f *FlagSet) Init(name string, errorHandling ErrorHandling) {
-	f.name = name
-	f.errorHandling = errorHandling
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go b/Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go
deleted file mode 100644
index a5928e5..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go
+++ /dev/null
@@ -1,755 +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.
-
-package pflag
-
-import (
-	"bytes"
-	"fmt"
-	"io"
-	"io/ioutil"
-	"net"
-	"os"
-	"reflect"
-	"sort"
-	"strings"
-	"testing"
-	"time"
-)
-
-var (
-	test_bool                    = Bool("test_bool", false, "bool value")
-	test_int                     = Int("test_int", 0, "int value")
-	test_int64                   = Int64("test_int64", 0, "int64 value")
-	test_uint                    = Uint("test_uint", 0, "uint value")
-	test_uint64                  = Uint64("test_uint64", 0, "uint64 value")
-	test_string                  = String("test_string", "0", "string value")
-	test_float64                 = Float64("test_float64", 0, "float64 value")
-	test_duration                = Duration("test_duration", 0, "time.Duration value")
-	test_optional_int            = Int("test_optional_int", 0, "optional int value")
-	normalizeFlagNameInvocations = 0
-)
-
-func boolString(s string) string {
-	if s == "0" {
-		return "false"
-	}
-	return "true"
-}
-
-func TestEverything(t *testing.T) {
-	m := make(map[string]*Flag)
-	desired := "0"
-	visitor := func(f *Flag) {
-		if len(f.Name) > 5 && f.Name[0:5] == "test_" {
-			m[f.Name] = f
-			ok := false
-			switch {
-			case f.Value.String() == desired:
-				ok = true
-			case f.Name == "test_bool" && f.Value.String() == boolString(desired):
-				ok = true
-			case f.Name == "test_duration" && f.Value.String() == desired+"s":
-				ok = true
-			}
-			if !ok {
-				t.Error("Visit: bad value", f.Value.String(), "for", f.Name)
-			}
-		}
-	}
-	VisitAll(visitor)
-	if len(m) != 9 {
-		t.Error("VisitAll misses some flags")
-		for k, v := range m {
-			t.Log(k, *v)
-		}
-	}
-	m = make(map[string]*Flag)
-	Visit(visitor)
-	if len(m) != 0 {
-		t.Errorf("Visit sees unset flags")
-		for k, v := range m {
-			t.Log(k, *v)
-		}
-	}
-	// Now set all flags
-	Set("test_bool", "true")
-	Set("test_int", "1")
-	Set("test_int64", "1")
-	Set("test_uint", "1")
-	Set("test_uint64", "1")
-	Set("test_string", "1")
-	Set("test_float64", "1")
-	Set("test_duration", "1s")
-	Set("test_optional_int", "1")
-	desired = "1"
-	Visit(visitor)
-	if len(m) != 9 {
-		t.Error("Visit fails after set")
-		for k, v := range m {
-			t.Log(k, *v)
-		}
-	}
-	// Now test they're visited in sort order.
-	var flagNames []string
-	Visit(func(f *Flag) { flagNames = append(flagNames, f.Name) })
-	if !sort.StringsAreSorted(flagNames) {
-		t.Errorf("flag names not sorted: %v", flagNames)
-	}
-}
-
-func TestUsage(t *testing.T) {
-	called := false
-	ResetForTesting(func() { called = true })
-	if GetCommandLine().Parse([]string{"--x"}) == nil {
-		t.Error("parse did not fail for unknown flag")
-	}
-	if !called {
-		t.Error("did not call Usage for unknown flag")
-	}
-}
-
-func TestAnnotation(t *testing.T) {
-	f := NewFlagSet("shorthand", ContinueOnError)
-
-	if err := f.SetAnnotation("missing-flag", "key", nil); err == nil {
-		t.Errorf("Expected error setting annotation on non-existent flag")
-	}
-
-	f.StringP("stringa", "a", "", "string value")
-	if err := f.SetAnnotation("stringa", "key", nil); err != nil {
-		t.Errorf("Unexpected error setting new nil annotation: %v", err)
-	}
-	if annotation := f.Lookup("stringa").Annotations["key"]; annotation != nil {
-		t.Errorf("Unexpected annotation: %v", annotation)
-	}
-
-	f.StringP("stringb", "b", "", "string2 value")
-	if err := f.SetAnnotation("stringb", "key", []string{"value1"}); err != nil {
-		t.Errorf("Unexpected error setting new annotation: %v", err)
-	}
-	if annotation := f.Lookup("stringb").Annotations["key"]; !reflect.DeepEqual(annotation, []string{"value1"}) {
-		t.Errorf("Unexpected annotation: %v", annotation)
-	}
-
-	if err := f.SetAnnotation("stringb", "key", []string{"value2"}); err != nil {
-		t.Errorf("Unexpected error updating annotation: %v", err)
-	}
-	if annotation := f.Lookup("stringb").Annotations["key"]; !reflect.DeepEqual(annotation, []string{"value2"}) {
-		t.Errorf("Unexpected annotation: %v", annotation)
-	}
-}
-
-func testParse(f *FlagSet, t *testing.T) {
-	if f.Parsed() {
-		t.Error("f.Parse() = true before Parse")
-	}
-	boolFlag := f.Bool("bool", false, "bool value")
-	bool2Flag := f.Bool("bool2", false, "bool2 value")
-	bool3Flag := f.Bool("bool3", false, "bool3 value")
-	intFlag := f.Int("int", 0, "int value")
-	int8Flag := f.Int8("int8", 0, "int value")
-	int32Flag := f.Int32("int32", 0, "int value")
-	int64Flag := f.Int64("int64", 0, "int64 value")
-	uintFlag := f.Uint("uint", 0, "uint value")
-	uint8Flag := f.Uint8("uint8", 0, "uint value")
-	uint16Flag := f.Uint16("uint16", 0, "uint value")
-	uint32Flag := f.Uint32("uint32", 0, "uint value")
-	uint64Flag := f.Uint64("uint64", 0, "uint64 value")
-	stringFlag := f.String("string", "0", "string value")
-	float32Flag := f.Float32("float32", 0, "float32 value")
-	float64Flag := f.Float64("float64", 0, "float64 value")
-	ipFlag := f.IP("ip", net.ParseIP("127.0.0.1"), "ip value")
-	maskFlag := f.IPMask("mask", ParseIPv4Mask("0.0.0.0"), "mask value")
-	durationFlag := f.Duration("duration", 5*time.Second, "time.Duration value")
-	optionalIntNoValueFlag := f.Int("optional-int-no-value", 0, "int value")
-	f.Lookup("optional-int-no-value").NoOptDefVal = "9"
-	optionalIntWithValueFlag := f.Int("optional-int-with-value", 0, "int value")
-	f.Lookup("optional-int-no-value").NoOptDefVal = "9"
-	extra := "one-extra-argument"
-	args := []string{
-		"--bool",
-		"--bool2=true",
-		"--bool3=false",
-		"--int=22",
-		"--int8=-8",
-		"--int32=-32",
-		"--int64=0x23",
-		"--uint", "24",
-		"--uint8=8",
-		"--uint16=16",
-		"--uint32=32",
-		"--uint64=25",
-		"--string=hello",
-		"--float32=-172e12",
-		"--float64=2718e28",
-		"--ip=10.11.12.13",
-		"--mask=255.255.255.0",
-		"--duration=2m",
-		"--optional-int-no-value",
-		"--optional-int-with-value=42",
-		extra,
-	}
-	if err := f.Parse(args); err != nil {
-		t.Fatal(err)
-	}
-	if !f.Parsed() {
-		t.Error("f.Parse() = false after Parse")
-	}
-	if *boolFlag != true {
-		t.Error("bool flag should be true, is ", *boolFlag)
-	}
-	if v, err := f.GetBool("bool"); err != nil || v != *boolFlag {
-		t.Error("GetBool does not work.")
-	}
-	if *bool2Flag != true {
-		t.Error("bool2 flag should be true, is ", *bool2Flag)
-	}
-	if *bool3Flag != false {
-		t.Error("bool3 flag should be false, is ", *bool2Flag)
-	}
-	if *intFlag != 22 {
-		t.Error("int flag should be 22, is ", *intFlag)
-	}
-	if v, err := f.GetInt("int"); err != nil || v != *intFlag {
-		t.Error("GetInt does not work.")
-	}
-	if *int8Flag != -8 {
-		t.Error("int8 flag should be 0x23, is ", *int8Flag)
-	}
-	if v, err := f.GetInt8("int8"); err != nil || v != *int8Flag {
-		t.Error("GetInt8 does not work.")
-	}
-	if *int32Flag != -32 {
-		t.Error("int32 flag should be 0x23, is ", *int32Flag)
-	}
-	if v, err := f.GetInt32("int32"); err != nil || v != *int32Flag {
-		t.Error("GetInt32 does not work.")
-	}
-	if *int64Flag != 0x23 {
-		t.Error("int64 flag should be 0x23, is ", *int64Flag)
-	}
-	if v, err := f.GetInt64("int64"); err != nil || v != *int64Flag {
-		t.Error("GetInt64 does not work.")
-	}
-	if *uintFlag != 24 {
-		t.Error("uint flag should be 24, is ", *uintFlag)
-	}
-	if v, err := f.GetUint("uint"); err != nil || v != *uintFlag {
-		t.Error("GetUint does not work.")
-	}
-	if *uint8Flag != 8 {
-		t.Error("uint8 flag should be 8, is ", *uint8Flag)
-	}
-	if v, err := f.GetUint8("uint8"); err != nil || v != *uint8Flag {
-		t.Error("GetUint8 does not work.")
-	}
-	if *uint16Flag != 16 {
-		t.Error("uint16 flag should be 16, is ", *uint16Flag)
-	}
-	if v, err := f.GetUint16("uint16"); err != nil || v != *uint16Flag {
-		t.Error("GetUint16 does not work.")
-	}
-	if *uint32Flag != 32 {
-		t.Error("uint32 flag should be 32, is ", *uint32Flag)
-	}
-	if v, err := f.GetUint32("uint32"); err != nil || v != *uint32Flag {
-		t.Error("GetUint32 does not work.")
-	}
-	if *uint64Flag != 25 {
-		t.Error("uint64 flag should be 25, is ", *uint64Flag)
-	}
-	if v, err := f.GetUint64("uint64"); err != nil || v != *uint64Flag {
-		t.Error("GetUint64 does not work.")
-	}
-	if *stringFlag != "hello" {
-		t.Error("string flag should be `hello`, is ", *stringFlag)
-	}
-	if v, err := f.GetString("string"); err != nil || v != *stringFlag {
-		t.Error("GetString does not work.")
-	}
-	if *float32Flag != -172e12 {
-		t.Error("float32 flag should be -172e12, is ", *float32Flag)
-	}
-	if v, err := f.GetFloat32("float32"); err != nil || v != *float32Flag {
-		t.Errorf("GetFloat32 returned %v but float32Flag was %v", v, *float32Flag)
-	}
-	if *float64Flag != 2718e28 {
-		t.Error("float64 flag should be 2718e28, is ", *float64Flag)
-	}
-	if v, err := f.GetFloat64("float64"); err != nil || v != *float64Flag {
-		t.Errorf("GetFloat64 returned %v but float64Flag was %v", v, *float64Flag)
-	}
-	if !(*ipFlag).Equal(net.ParseIP("10.11.12.13")) {
-		t.Error("ip flag should be 10.11.12.13, is ", *ipFlag)
-	}
-	if v, err := f.GetIP("ip"); err != nil || !v.Equal(*ipFlag) {
-		t.Errorf("GetIP returned %v but ipFlag was %v", v, *ipFlag)
-	}
-	if (*maskFlag).String() != ParseIPv4Mask("255.255.255.0").String() {
-		t.Error("mask flag should be 255.255.255.0, is ", (*maskFlag).String())
-	}
-	if v, err := f.GetIPv4Mask("mask"); err != nil || v.String() != (*maskFlag).String() {
-		t.Errorf("GetIP returned %v but maskFlag was %v", v, *maskFlag, err)
-	}
-	if *durationFlag != 2*time.Minute {
-		t.Error("duration flag should be 2m, is ", *durationFlag)
-	}
-	if v, err := f.GetDuration("duration"); err != nil || v != *durationFlag {
-		t.Error("GetDuration does not work.")
-	}
-	if _, err := f.GetInt("duration"); err == nil {
-		t.Error("GetInt parsed a time.Duration?!?!")
-	}
-	if *optionalIntNoValueFlag != 9 {
-		t.Error("optional int flag should be the default value, is ", *optionalIntNoValueFlag)
-	}
-	if *optionalIntWithValueFlag != 42 {
-		t.Error("optional int flag should be 42, is ", *optionalIntWithValueFlag)
-	}
-	if len(f.Args()) != 1 {
-		t.Error("expected one argument, got", len(f.Args()))
-	} else if f.Args()[0] != extra {
-		t.Errorf("expected argument %q got %q", extra, f.Args()[0])
-	}
-}
-
-func TestShorthand(t *testing.T) {
-	f := NewFlagSet("shorthand", ContinueOnError)
-	if f.Parsed() {
-		t.Error("f.Parse() = true before Parse")
-	}
-	boolaFlag := f.BoolP("boola", "a", false, "bool value")
-	boolbFlag := f.BoolP("boolb", "b", false, "bool2 value")
-	boolcFlag := f.BoolP("boolc", "c", false, "bool3 value")
-	booldFlag := f.BoolP("boold", "d", false, "bool4 value")
-	stringaFlag := f.StringP("stringa", "s", "0", "string value")
-	stringzFlag := f.StringP("stringz", "z", "0", "string value")
-	extra := "interspersed-argument"
-	notaflag := "--i-look-like-a-flag"
-	args := []string{
-		"-ab",
-		extra,
-		"-cs",
-		"hello",
-		"-z=something",
-		"-d=true",
-		"--",
-		notaflag,
-	}
-	f.SetOutput(ioutil.Discard)
-	if err := f.Parse(args); err != nil {
-		t.Error("expected no error, got ", err)
-	}
-	if !f.Parsed() {
-		t.Error("f.Parse() = false after Parse")
-	}
-	if *boolaFlag != true {
-		t.Error("boola flag should be true, is ", *boolaFlag)
-	}
-	if *boolbFlag != true {
-		t.Error("boolb flag should be true, is ", *boolbFlag)
-	}
-	if *boolcFlag != true {
-		t.Error("boolc flag should be true, is ", *boolcFlag)
-	}
-	if *booldFlag != true {
-		t.Error("boold flag should be true, is ", *booldFlag)
-	}
-	if *stringaFlag != "hello" {
-		t.Error("stringa flag should be `hello`, is ", *stringaFlag)
-	}
-	if *stringzFlag != "something" {
-		t.Error("stringz flag should be `something`, is ", *stringzFlag)
-	}
-	if len(f.Args()) != 2 {
-		t.Error("expected one argument, got", len(f.Args()))
-	} else if f.Args()[0] != extra {
-		t.Errorf("expected argument %q got %q", extra, f.Args()[0])
-	} else if f.Args()[1] != notaflag {
-		t.Errorf("expected argument %q got %q", notaflag, f.Args()[1])
-	}
-}
-
-func TestParse(t *testing.T) {
-	ResetForTesting(func() { t.Error("bad parse") })
-	testParse(GetCommandLine(), t)
-}
-
-func TestFlagSetParse(t *testing.T) {
-	testParse(NewFlagSet("test", ContinueOnError), t)
-}
-
-func replaceSeparators(name string, from []string, to string) string {
-	result := name
-	for _, sep := range from {
-		result = strings.Replace(result, sep, to, -1)
-	}
-	// Type convert to indicate normalization has been done.
-	return result
-}
-
-func wordSepNormalizeFunc(f *FlagSet, name string) NormalizedName {
-	seps := []string{"-", "_"}
-	name = replaceSeparators(name, seps, ".")
-	normalizeFlagNameInvocations++
-
-	return NormalizedName(name)
-}
-
-func testWordSepNormalizedNames(args []string, t *testing.T) {
-	f := NewFlagSet("normalized", ContinueOnError)
-	if f.Parsed() {
-		t.Error("f.Parse() = true before Parse")
-	}
-	withDashFlag := f.Bool("with-dash-flag", false, "bool value")
-	// Set this after some flags have been added and before others.
-	f.SetNormalizeFunc(wordSepNormalizeFunc)
-	withUnderFlag := f.Bool("with_under_flag", false, "bool value")
-	withBothFlag := f.Bool("with-both_flag", false, "bool value")
-	if err := f.Parse(args); err != nil {
-		t.Fatal(err)
-	}
-	if !f.Parsed() {
-		t.Error("f.Parse() = false after Parse")
-	}
-	if *withDashFlag != true {
-		t.Error("withDashFlag flag should be true, is ", *withDashFlag)
-	}
-	if *withUnderFlag != true {
-		t.Error("withUnderFlag flag should be true, is ", *withUnderFlag)
-	}
-	if *withBothFlag != true {
-		t.Error("withBothFlag flag should be true, is ", *withBothFlag)
-	}
-}
-
-func TestWordSepNormalizedNames(t *testing.T) {
-	args := []string{
-		"--with-dash-flag",
-		"--with-under-flag",
-		"--with-both-flag",
-	}
-	testWordSepNormalizedNames(args, t)
-
-	args = []string{
-		"--with_dash_flag",
-		"--with_under_flag",
-		"--with_both_flag",
-	}
-	testWordSepNormalizedNames(args, t)
-
-	args = []string{
-		"--with-dash_flag",
-		"--with-under_flag",
-		"--with-both_flag",
-	}
-	testWordSepNormalizedNames(args, t)
-}
-
-func aliasAndWordSepFlagNames(f *FlagSet, name string) NormalizedName {
-	seps := []string{"-", "_"}
-
-	oldName := replaceSeparators("old-valid_flag", seps, ".")
-	newName := replaceSeparators("valid-flag", seps, ".")
-
-	name = replaceSeparators(name, seps, ".")
-	switch name {
-	case oldName:
-		name = newName
-		break
-	}
-
-	return NormalizedName(name)
-}
-
-func TestCustomNormalizedNames(t *testing.T) {
-	f := NewFlagSet("normalized", ContinueOnError)
-	if f.Parsed() {
-		t.Error("f.Parse() = true before Parse")
-	}
-
-	validFlag := f.Bool("valid-flag", false, "bool value")
-	f.SetNormalizeFunc(aliasAndWordSepFlagNames)
-	someOtherFlag := f.Bool("some-other-flag", false, "bool value")
-
-	args := []string{"--old_valid_flag", "--some-other_flag"}
-	if err := f.Parse(args); err != nil {
-		t.Fatal(err)
-	}
-
-	if *validFlag != true {
-		t.Errorf("validFlag is %v even though we set the alias --old_valid_falg", *validFlag)
-	}
-	if *someOtherFlag != true {
-		t.Error("someOtherFlag should be true, is ", *someOtherFlag)
-	}
-}
-
-// Every flag we add, the name (displayed also in usage) should normalized
-func TestNormalizationFuncShouldChangeFlagName(t *testing.T) {
-	// Test normalization after addition
-	f := NewFlagSet("normalized", ContinueOnError)
-
-	f.Bool("valid_flag", false, "bool value")
-	if f.Lookup("valid_flag").Name != "valid_flag" {
-		t.Error("The new flag should have the name 'valid_flag' instead of ", f.Lookup("valid_flag").Name)
-	}
-
-	f.SetNormalizeFunc(wordSepNormalizeFunc)
-	if f.Lookup("valid_flag").Name != "valid.flag" {
-		t.Error("The new flag should have the name 'valid.flag' instead of ", f.Lookup("valid_flag").Name)
-	}
-
-	// Test normalization before addition
-	f = NewFlagSet("normalized", ContinueOnError)
-	f.SetNormalizeFunc(wordSepNormalizeFunc)
-
-	f.Bool("valid_flag", false, "bool value")
-	if f.Lookup("valid_flag").Name != "valid.flag" {
-		t.Error("The new flag should have the name 'valid.flag' instead of ", f.Lookup("valid_flag").Name)
-	}
-}
-
-// Declare a user-defined flag type.
-type flagVar []string
-
-func (f *flagVar) String() string {
-	return fmt.Sprint([]string(*f))
-}
-
-func (f *flagVar) Set(value string) error {
-	*f = append(*f, value)
-	return nil
-}
-
-func (f *flagVar) Type() string {
-	return "flagVar"
-}
-
-func TestUserDefined(t *testing.T) {
-	var flags FlagSet
-	flags.Init("test", ContinueOnError)
-	var v flagVar
-	flags.VarP(&v, "v", "v", "usage")
-	if err := flags.Parse([]string{"--v=1", "-v2", "-v", "3"}); err != nil {
-		t.Error(err)
-	}
-	if len(v) != 3 {
-		t.Fatal("expected 3 args; got ", len(v))
-	}
-	expect := "[1 2 3]"
-	if v.String() != expect {
-		t.Errorf("expected value %q got %q", expect, v.String())
-	}
-}
-
-func TestSetOutput(t *testing.T) {
-	var flags FlagSet
-	var buf bytes.Buffer
-	flags.SetOutput(&buf)
-	flags.Init("test", ContinueOnError)
-	flags.Parse([]string{"--unknown"})
-	if out := buf.String(); !strings.Contains(out, "--unknown") {
-		t.Logf("expected output mentioning unknown; got %q", out)
-	}
-}
-
-// This tests that one can reset the flags. This still works but not well, and is
-// superseded by FlagSet.
-func TestChangingArgs(t *testing.T) {
-	ResetForTesting(func() { t.Fatal("bad parse") })
-	oldArgs := os.Args
-	defer func() { os.Args = oldArgs }()
-	os.Args = []string{"cmd", "--before", "subcmd"}
-	before := Bool("before", false, "")
-	if err := GetCommandLine().Parse(os.Args[1:]); err != nil {
-		t.Fatal(err)
-	}
-	cmd := Arg(0)
-	os.Args = []string{"subcmd", "--after", "args"}
-	after := Bool("after", false, "")
-	Parse()
-	args := Args()
-
-	if !*before || cmd != "subcmd" || !*after || len(args) != 1 || args[0] != "args" {
-		t.Fatalf("expected true subcmd true [args] got %v %v %v %v", *before, cmd, *after, args)
-	}
-}
-
-// Test that -help invokes the usage message and returns ErrHelp.
-func TestHelp(t *testing.T) {
-	var helpCalled = false
-	fs := NewFlagSet("help test", ContinueOnError)
-	fs.Usage = func() { helpCalled = true }
-	var flag bool
-	fs.BoolVar(&flag, "flag", false, "regular flag")
-	// Regular flag invocation should work
-	err := fs.Parse([]string{"--flag=true"})
-	if err != nil {
-		t.Fatal("expected no error; got ", err)
-	}
-	if !flag {
-		t.Error("flag was not set by --flag")
-	}
-	if helpCalled {
-		t.Error("help called for regular flag")
-		helpCalled = false // reset for next test
-	}
-	// Help flag should work as expected.
-	err = fs.Parse([]string{"--help"})
-	if err == nil {
-		t.Fatal("error expected")
-	}
-	if err != ErrHelp {
-		t.Fatal("expected ErrHelp; got ", err)
-	}
-	if !helpCalled {
-		t.Fatal("help was not called")
-	}
-	// If we define a help flag, that should override.
-	var help bool
-	fs.BoolVar(&help, "help", false, "help flag")
-	helpCalled = false
-	err = fs.Parse([]string{"--help"})
-	if err != nil {
-		t.Fatal("expected no error for defined --help; got ", err)
-	}
-	if helpCalled {
-		t.Fatal("help was called; should not have been for defined help flag")
-	}
-}
-
-func TestNoInterspersed(t *testing.T) {
-	f := NewFlagSet("test", ContinueOnError)
-	f.SetInterspersed(false)
-	f.Bool("true", true, "always true")
-	f.Bool("false", false, "always false")
-	err := f.Parse([]string{"--true", "break", "--false"})
-	if err != nil {
-		t.Fatal("expected no error; got ", err)
-	}
-	args := f.Args()
-	if len(args) != 2 || args[0] != "break" || args[1] != "--false" {
-		t.Fatal("expected interspersed options/non-options to fail")
-	}
-}
-
-func TestTermination(t *testing.T) {
-	f := NewFlagSet("termination", ContinueOnError)
-	boolFlag := f.BoolP("bool", "l", false, "bool value")
-	if f.Parsed() {
-		t.Error("f.Parse() = true before Parse")
-	}
-	arg1 := "ls"
-	arg2 := "-l"
-	args := []string{
-		"--",
-		arg1,
-		arg2,
-	}
-	f.SetOutput(ioutil.Discard)
-	if err := f.Parse(args); err != nil {
-		t.Fatal("expected no error; got ", err)
-	}
-	if !f.Parsed() {
-		t.Error("f.Parse() = false after Parse")
-	}
-	if *boolFlag {
-		t.Error("expected boolFlag=false, got true")
-	}
-	if len(f.Args()) != 2 {
-		t.Errorf("expected 2 arguments, got %d: %v", len(f.Args()), f.Args())
-	}
-	if f.Args()[0] != arg1 {
-		t.Errorf("expected argument %q got %q", arg1, f.Args()[0])
-	}
-	if f.Args()[1] != arg2 {
-		t.Errorf("expected argument %q got %q", arg2, f.Args()[1])
-	}
-}
-
-func TestDeprecatedFlagInDocs(t *testing.T) {
-	f := NewFlagSet("bob", ContinueOnError)
-	f.Bool("badflag", true, "always true")
-	f.MarkDeprecated("badflag", "use --good-flag instead")
-
-	out := new(bytes.Buffer)
-	f.SetOutput(out)
-	f.PrintDefaults()
-
-	if strings.Contains(out.String(), "badflag") {
-		t.Errorf("found deprecated flag in usage!")
-	}
-}
-
-func parseReturnStderr(t *testing.T, f *FlagSet, args []string) (string, error) {
-	oldStderr := os.Stderr
-	r, w, _ := os.Pipe()
-	os.Stderr = w
-
-	err := f.Parse(args)
-
-	outC := make(chan string)
-	// copy the output in a separate goroutine so printing can't block indefinitely
-	go func() {
-		var buf bytes.Buffer
-		io.Copy(&buf, r)
-		outC <- buf.String()
-	}()
-
-	w.Close()
-	os.Stderr = oldStderr
-	out := <-outC
-
-	return out, err
-}
-
-func TestDeprecatedFlagUsage(t *testing.T) {
-	f := NewFlagSet("bob", ContinueOnError)
-	f.Bool("badflag", true, "always true")
-	usageMsg := "use --good-flag instead"
-	f.MarkDeprecated("badflag", usageMsg)
-
-	args := []string{"--badflag"}
-	out, err := parseReturnStderr(t, f, args)
-	if err != nil {
-		t.Fatal("expected no error; got ", err)
-	}
-
-	if !strings.Contains(out, usageMsg) {
-		t.Errorf("usageMsg not printed when using a deprecated flag!")
-	}
-}
-
-func TestDeprecatedFlagUsageNormalized(t *testing.T) {
-	f := NewFlagSet("bob", ContinueOnError)
-	f.Bool("bad-double_flag", true, "always true")
-	f.SetNormalizeFunc(wordSepNormalizeFunc)
-	usageMsg := "use --good-flag instead"
-	f.MarkDeprecated("bad_double-flag", usageMsg)
-
-	args := []string{"--bad_double_flag"}
-	out, err := parseReturnStderr(t, f, args)
-	if err != nil {
-		t.Fatal("expected no error; got ", err)
-	}
-
-	if !strings.Contains(out, usageMsg) {
-		t.Errorf("usageMsg not printed when using a deprecated flag!")
-	}
-}
-
-// Name normalization function should be called only once on flag addition
-func TestMultipleNormalizeFlagNameInvocations(t *testing.T) {
-	normalizeFlagNameInvocations = 0
-
-	f := NewFlagSet("normalized", ContinueOnError)
-	f.SetNormalizeFunc(wordSepNormalizeFunc)
-	f.Bool("with_under_flag", false, "bool value")
-
-	if normalizeFlagNameInvocations != 1 {
-		t.Fatal("Expected normalizeFlagNameInvocations to be 1; got ", normalizeFlagNameInvocations)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/float32.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/float32.go b/Godeps/_workspace/src/github.com/spf13/pflag/float32.go
deleted file mode 100644
index 30174cb..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/float32.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- float32 Value
-type float32Value float32
-
-func newFloat32Value(val float32, p *float32) *float32Value {
-	*p = val
-	return (*float32Value)(p)
-}
-
-func (f *float32Value) Set(s string) error {
-	v, err := strconv.ParseFloat(s, 32)
-	*f = float32Value(v)
-	return err
-}
-
-func (f *float32Value) Type() string {
-	return "float32"
-}
-
-func (f *float32Value) String() string { return fmt.Sprintf("%v", *f) }
-
-func float32Conv(sval string) (interface{}, error) {
-	v, err := strconv.ParseFloat(sval, 32)
-	if err != nil {
-		return 0, err
-	}
-	return float32(v), nil
-}
-
-// GetFloat32 return the float32 value of a flag with the given name
-func (f *FlagSet) GetFloat32(name string) (float32, error) {
-	val, err := f.getFlagType(name, "float32", float32Conv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(float32), nil
-}
-
-// Float32Var defines a float32 flag with specified name, default value, and usage string.
-// The argument p points to a float32 variable in which to store the value of the flag.
-func (f *FlagSet) Float32Var(p *float32, name string, value float32, usage string) {
-	f.VarP(newFloat32Value(value, p), name, "", usage)
-}
-
-// Like Float32Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value float32, usage string) {
-	f.VarP(newFloat32Value(value, p), name, shorthand, usage)
-}
-
-// Float32Var defines a float32 flag with specified name, default value, and usage string.
-// The argument p points to a float32 variable in which to store the value of the flag.
-func Float32Var(p *float32, name string, value float32, usage string) {
-	CommandLine.VarP(newFloat32Value(value, p), name, "", usage)
-}
-
-// Like Float32Var, but accepts a shorthand letter that can be used after a single dash.
-func Float32VarP(p *float32, name, shorthand string, value float32, usage string) {
-	CommandLine.VarP(newFloat32Value(value, p), name, shorthand, usage)
-}
-
-// Float32 defines a float32 flag with specified name, default value, and usage string.
-// The return value is the address of a float32 variable that stores the value of the flag.
-func (f *FlagSet) Float32(name string, value float32, usage string) *float32 {
-	p := new(float32)
-	f.Float32VarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Float32, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float32P(name, shorthand string, value float32, usage string) *float32 {
-	p := new(float32)
-	f.Float32VarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Float32 defines a float32 flag with specified name, default value, and usage string.
-// The return value is the address of a float32 variable that stores the value of the flag.
-func Float32(name string, value float32, usage string) *float32 {
-	return CommandLine.Float32P(name, "", value, usage)
-}
-
-// Like Float32, but accepts a shorthand letter that can be used after a single dash.
-func Float32P(name, shorthand string, value float32, usage string) *float32 {
-	return CommandLine.Float32P(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/float64.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/float64.go b/Godeps/_workspace/src/github.com/spf13/pflag/float64.go
deleted file mode 100644
index 10e17e4..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/float64.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- float64 Value
-type float64Value float64
-
-func newFloat64Value(val float64, p *float64) *float64Value {
-	*p = val
-	return (*float64Value)(p)
-}
-
-func (f *float64Value) Set(s string) error {
-	v, err := strconv.ParseFloat(s, 64)
-	*f = float64Value(v)
-	return err
-}
-
-func (f *float64Value) Type() string {
-	return "float64"
-}
-
-func (f *float64Value) String() string { return fmt.Sprintf("%v", *f) }
-
-func float64Conv(sval string) (interface{}, error) {
-	return strconv.ParseFloat(sval, 64)
-}
-
-// GetFloat64 return the float64 value of a flag with the given name
-func (f *FlagSet) GetFloat64(name string) (float64, error) {
-	val, err := f.getFlagType(name, "float64", float64Conv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(float64), nil
-}
-
-// Float64Var defines a float64 flag with specified name, default value, and usage string.
-// The argument p points to a float64 variable in which to store the value of the flag.
-func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage string) {
-	f.VarP(newFloat64Value(value, p), name, "", usage)
-}
-
-// Like Float64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float64VarP(p *float64, name, shorthand string, value float64, usage string) {
-	f.VarP(newFloat64Value(value, p), name, shorthand, usage)
-}
-
-// Float64Var defines a float64 flag with specified name, default value, and usage string.
-// The argument p points to a float64 variable in which to store the value of the flag.
-func Float64Var(p *float64, name string, value float64, usage string) {
-	CommandLine.VarP(newFloat64Value(value, p), name, "", usage)
-}
-
-// Like Float64Var, but accepts a shorthand letter that can be used after a single dash.
-func Float64VarP(p *float64, name, shorthand string, value float64, usage string) {
-	CommandLine.VarP(newFloat64Value(value, p), name, shorthand, usage)
-}
-
-// Float64 defines a float64 flag with specified name, default value, and usage string.
-// The return value is the address of a float64 variable that stores the value of the flag.
-func (f *FlagSet) Float64(name string, value float64, usage string) *float64 {
-	p := new(float64)
-	f.Float64VarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Float64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float64P(name, shorthand string, value float64, usage string) *float64 {
-	p := new(float64)
-	f.Float64VarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Float64 defines a float64 flag with specified name, default value, and usage string.
-// The return value is the address of a float64 variable that stores the value of the flag.
-func Float64(name string, value float64, usage string) *float64 {
-	return CommandLine.Float64P(name, "", value, usage)
-}
-
-// Like Float64, but accepts a shorthand letter that can be used after a single dash.
-func Float64P(name, shorthand string, value float64, usage string) *float64 {
-	return CommandLine.Float64P(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/int.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/int.go b/Godeps/_workspace/src/github.com/spf13/pflag/int.go
deleted file mode 100644
index 23f70dd..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/int.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- int Value
-type intValue int
-
-func newIntValue(val int, p *int) *intValue {
-	*p = val
-	return (*intValue)(p)
-}
-
-func (i *intValue) Set(s string) error {
-	v, err := strconv.ParseInt(s, 0, 64)
-	*i = intValue(v)
-	return err
-}
-
-func (i *intValue) Type() string {
-	return "int"
-}
-
-func (i *intValue) String() string { return fmt.Sprintf("%v", *i) }
-
-func intConv(sval string) (interface{}, error) {
-	return strconv.Atoi(sval)
-}
-
-// GetInt return the int value of a flag with the given name
-func (f *FlagSet) GetInt(name string) (int, error) {
-	val, err := f.getFlagType(name, "int", intConv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(int), nil
-}
-
-// IntVar defines an int flag with specified name, default value, and usage string.
-// The argument p points to an int variable in which to store the value of the flag.
-func (f *FlagSet) IntVar(p *int, name string, value int, usage string) {
-	f.VarP(newIntValue(value, p), name, "", usage)
-}
-
-// Like IntVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usage string) {
-	f.VarP(newIntValue(value, p), name, shorthand, usage)
-}
-
-// IntVar defines an int flag with specified name, default value, and usage string.
-// The argument p points to an int variable in which to store the value of the flag.
-func IntVar(p *int, name string, value int, usage string) {
-	CommandLine.VarP(newIntValue(value, p), name, "", usage)
-}
-
-// Like IntVar, but accepts a shorthand letter that can be used after a single dash.
-func IntVarP(p *int, name, shorthand string, value int, usage string) {
-	CommandLine.VarP(newIntValue(value, p), name, shorthand, usage)
-}
-
-// Int defines an int flag with specified name, default value, and usage string.
-// The return value is the address of an int variable that stores the value of the flag.
-func (f *FlagSet) Int(name string, value int, usage string) *int {
-	p := new(int)
-	f.IntVarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Int, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntP(name, shorthand string, value int, usage string) *int {
-	p := new(int)
-	f.IntVarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Int defines an int flag with specified name, default value, and usage string.
-// The return value is the address of an int variable that stores the value of the flag.
-func Int(name string, value int, usage string) *int {
-	return CommandLine.IntP(name, "", value, usage)
-}
-
-// Like Int, but accepts a shorthand letter that can be used after a single dash.
-func IntP(name, shorthand string, value int, usage string) *int {
-	return CommandLine.IntP(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/int32.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/int32.go b/Godeps/_workspace/src/github.com/spf13/pflag/int32.go
deleted file mode 100644
index 515f90b..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/int32.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- int32 Value
-type int32Value int32
-
-func newInt32Value(val int32, p *int32) *int32Value {
-	*p = val
-	return (*int32Value)(p)
-}
-
-func (i *int32Value) Set(s string) error {
-	v, err := strconv.ParseInt(s, 0, 32)
-	*i = int32Value(v)
-	return err
-}
-
-func (i *int32Value) Type() string {
-	return "int32"
-}
-
-func (i *int32Value) String() string { return fmt.Sprintf("%v", *i) }
-
-func int32Conv(sval string) (interface{}, error) {
-	v, err := strconv.ParseInt(sval, 0, 32)
-	if err != nil {
-		return 0, err
-	}
-	return int32(v), nil
-}
-
-// GetInt32 return the int32 value of a flag with the given name
-func (f *FlagSet) GetInt32(name string) (int32, error) {
-	val, err := f.getFlagType(name, "int32", int32Conv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(int32), nil
-}
-
-// Int32Var defines an int32 flag with specified name, default value, and usage string.
-// The argument p points to an int32 variable in which to store the value of the flag.
-func (f *FlagSet) Int32Var(p *int32, name string, value int32, usage string) {
-	f.VarP(newInt32Value(value, p), name, "", usage)
-}
-
-// Like Int32Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int32VarP(p *int32, name, shorthand string, value int32, usage string) {
-	f.VarP(newInt32Value(value, p), name, shorthand, usage)
-}
-
-// Int32Var defines an int32 flag with specified name, default value, and usage string.
-// The argument p points to an int32 variable in which to store the value of the flag.
-func Int32Var(p *int32, name string, value int32, usage string) {
-	CommandLine.VarP(newInt32Value(value, p), name, "", usage)
-}
-
-// Like Int32Var, but accepts a shorthand letter that can be used after a single dash.
-func Int32VarP(p *int32, name, shorthand string, value int32, usage string) {
-	CommandLine.VarP(newInt32Value(value, p), name, shorthand, usage)
-}
-
-// Int32 defines an int32 flag with specified name, default value, and usage string.
-// The return value is the address of an int32 variable that stores the value of the flag.
-func (f *FlagSet) Int32(name string, value int32, usage string) *int32 {
-	p := new(int32)
-	f.Int32VarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Int32, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int32P(name, shorthand string, value int32, usage string) *int32 {
-	p := new(int32)
-	f.Int32VarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Int32 defines an int32 flag with specified name, default value, and usage string.
-// The return value is the address of an int32 variable that stores the value of the flag.
-func Int32(name string, value int32, usage string) *int32 {
-	return CommandLine.Int32P(name, "", value, usage)
-}
-
-// Like Int32, but accepts a shorthand letter that can be used after a single dash.
-func Int32P(name, shorthand string, value int32, usage string) *int32 {
-	return CommandLine.Int32P(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/int64.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/int64.go b/Godeps/_workspace/src/github.com/spf13/pflag/int64.go
deleted file mode 100644
index b77ade4..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/int64.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- int64 Value
-type int64Value int64
-
-func newInt64Value(val int64, p *int64) *int64Value {
-	*p = val
-	return (*int64Value)(p)
-}
-
-func (i *int64Value) Set(s string) error {
-	v, err := strconv.ParseInt(s, 0, 64)
-	*i = int64Value(v)
-	return err
-}
-
-func (i *int64Value) Type() string {
-	return "int64"
-}
-
-func (i *int64Value) String() string { return fmt.Sprintf("%v", *i) }
-
-func int64Conv(sval string) (interface{}, error) {
-	return strconv.ParseInt(sval, 0, 64)
-}
-
-// GetInt64 return the int64 value of a flag with the given name
-func (f *FlagSet) GetInt64(name string) (int64, error) {
-	val, err := f.getFlagType(name, "int64", int64Conv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(int64), nil
-}
-
-// Int64Var defines an int64 flag with specified name, default value, and usage string.
-// The argument p points to an int64 variable in which to store the value of the flag.
-func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string) {
-	f.VarP(newInt64Value(value, p), name, "", usage)
-}
-
-// Like Int64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int64VarP(p *int64, name, shorthand string, value int64, usage string) {
-	f.VarP(newInt64Value(value, p), name, shorthand, usage)
-}
-
-// Int64Var defines an int64 flag with specified name, default value, and usage string.
-// The argument p points to an int64 variable in which to store the value of the flag.
-func Int64Var(p *int64, name string, value int64, usage string) {
-	CommandLine.VarP(newInt64Value(value, p), name, "", usage)
-}
-
-// Like Int64Var, but accepts a shorthand letter that can be used after a single dash.
-func Int64VarP(p *int64, name, shorthand string, value int64, usage string) {
-	CommandLine.VarP(newInt64Value(value, p), name, shorthand, usage)
-}
-
-// Int64 defines an int64 flag with specified name, default value, and usage string.
-// The return value is the address of an int64 variable that stores the value of the flag.
-func (f *FlagSet) Int64(name string, value int64, usage string) *int64 {
-	p := new(int64)
-	f.Int64VarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Int64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int64P(name, shorthand string, value int64, usage string) *int64 {
-	p := new(int64)
-	f.Int64VarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Int64 defines an int64 flag with specified name, default value, and usage string.
-// The return value is the address of an int64 variable that stores the value of the flag.
-func Int64(name string, value int64, usage string) *int64 {
-	return CommandLine.Int64P(name, "", value, usage)
-}
-
-// Like Int64, but accepts a shorthand letter that can be used after a single dash.
-func Int64P(name, shorthand string, value int64, usage string) *int64 {
-	return CommandLine.Int64P(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/int8.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/int8.go b/Godeps/_workspace/src/github.com/spf13/pflag/int8.go
deleted file mode 100644
index c51cb4f..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/int8.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- int8 Value
-type int8Value int8
-
-func newInt8Value(val int8, p *int8) *int8Value {
-	*p = val
-	return (*int8Value)(p)
-}
-
-func (i *int8Value) Set(s string) error {
-	v, err := strconv.ParseInt(s, 0, 8)
-	*i = int8Value(v)
-	return err
-}
-
-func (i *int8Value) Type() string {
-	return "int8"
-}
-
-func (i *int8Value) String() string { return fmt.Sprintf("%v", *i) }
-
-func int8Conv(sval string) (interface{}, error) {
-	v, err := strconv.ParseInt(sval, 0, 8)
-	if err != nil {
-		return 0, err
-	}
-	return int8(v), nil
-}
-
-// GetInt8 return the int8 value of a flag with the given name
-func (f *FlagSet) GetInt8(name string) (int8, error) {
-	val, err := f.getFlagType(name, "int8", int8Conv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(int8), nil
-}
-
-// Int8Var defines an int8 flag with specified name, default value, and usage string.
-// The argument p points to an int8 variable in which to store the value of the flag.
-func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) {
-	f.VarP(newInt8Value(value, p), name, "", usage)
-}
-
-// Like Int8Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, usage string) {
-	f.VarP(newInt8Value(value, p), name, shorthand, usage)
-}
-
-// Int8Var defines an int8 flag with specified name, default value, and usage string.
-// The argument p points to an int8 variable in which to store the value of the flag.
-func Int8Var(p *int8, name string, value int8, usage string) {
-	CommandLine.VarP(newInt8Value(value, p), name, "", usage)
-}
-
-// Like Int8Var, but accepts a shorthand letter that can be used after a single dash.
-func Int8VarP(p *int8, name, shorthand string, value int8, usage string) {
-	CommandLine.VarP(newInt8Value(value, p), name, shorthand, usage)
-}
-
-// Int8 defines an int8 flag with specified name, default value, and usage string.
-// The return value is the address of an int8 variable that stores the value of the flag.
-func (f *FlagSet) Int8(name string, value int8, usage string) *int8 {
-	p := new(int8)
-	f.Int8VarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Int8, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int8P(name, shorthand string, value int8, usage string) *int8 {
-	p := new(int8)
-	f.Int8VarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Int8 defines an int8 flag with specified name, default value, and usage string.
-// The return value is the address of an int8 variable that stores the value of the flag.
-func Int8(name string, value int8, usage string) *int8 {
-	return CommandLine.Int8P(name, "", value, usage)
-}
-
-// Like Int8, but accepts a shorthand letter that can be used after a single dash.
-func Int8P(name, shorthand string, value int8, usage string) *int8 {
-	return CommandLine.Int8P(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/int_slice.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/int_slice.go b/Godeps/_workspace/src/github.com/spf13/pflag/int_slice.go
deleted file mode 100644
index fb3e67b..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/int_slice.go
+++ /dev/null
@@ -1,113 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-	"strings"
-)
-
-// -- intSlice Value
-type intSliceValue []int
-
-func newIntSliceValue(val []int, p *[]int) *intSliceValue {
-	*p = val
-	return (*intSliceValue)(p)
-}
-
-func (s *intSliceValue) Set(val string) error {
-	ss := strings.Split(val, ",")
-	out := make([]int, len(ss))
-	for i, d := range ss {
-		var err error
-		out[i], err = strconv.Atoi(d)
-		if err != nil {
-			return err
-		}
-
-	}
-	*s = intSliceValue(out)
-	return nil
-}
-
-func (s *intSliceValue) Type() string {
-	return "intSlice"
-}
-
-func (s *intSliceValue) String() string {
-	out := make([]string, len(*s))
-	for i, d := range *s {
-		out[i] = fmt.Sprintf("%d", d)
-	}
-	return strings.Join(out, ",")
-}
-
-func intSliceConv(val string) (interface{}, error) {
-	ss := strings.Split(val, ",")
-	out := make([]int, len(ss))
-	for i, d := range ss {
-		var err error
-		out[i], err = strconv.Atoi(d)
-		if err != nil {
-			return nil, err
-		}
-
-	}
-	return out, nil
-}
-
-// GetIntSlice return the []int value of a flag with the given name
-func (f *FlagSet) GetIntSlice(name string) ([]int, error) {
-	val, err := f.getFlagType(name, "intSlice", intSliceConv)
-	if err != nil {
-		return []int{}, err
-	}
-	return val.([]int), nil
-}
-
-// IntSliceVar defines a intSlice flag with specified name, default value, and usage string.
-// The argument p points to a []int variable in which to store the value of the flag.
-func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string) {
-	f.VarP(newIntSliceValue(value, p), name, "", usage)
-}
-
-// Like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
-	f.VarP(newIntSliceValue(value, p), name, shorthand, usage)
-}
-
-// IntSliceVar defines a int[] flag with specified name, default value, and usage string.
-// The argument p points to a int[] variable in which to store the value of the flag.
-func IntSliceVar(p *[]int, name string, value []int, usage string) {
-	CommandLine.VarP(newIntSliceValue(value, p), name, "", usage)
-}
-
-// Like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
-	CommandLine.VarP(newIntSliceValue(value, p), name, shorthand, usage)
-}
-
-// IntSlice defines a []int flag with specified name, default value, and usage string.
-// The return value is the address of a []int variable that stores the value of the flag.
-func (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int {
-	p := make([]int, 0)
-	f.IntSliceVarP(&p, name, "", value, usage)
-	return &p
-}
-
-// Like IntSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage string) *[]int {
-	p := make([]int, 0)
-	f.IntSliceVarP(&p, name, shorthand, value, usage)
-	return &p
-}
-
-// IntSlice defines a []int flag with specified name, default value, and usage string.
-// The return value is the address of a []int variable that stores the value of the flag.
-func IntSlice(name string, value []int, usage string) *[]int {
-	return CommandLine.IntSliceP(name, "", value, usage)
-}
-
-// Like IntSlice, but accepts a shorthand letter that can be used after a single dash.
-func IntSliceP(name, shorthand string, value []int, usage string) *[]int {
-	return CommandLine.IntSliceP(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/int_slice_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/int_slice_test.go b/Godeps/_workspace/src/github.com/spf13/pflag/int_slice_test.go
deleted file mode 100644
index d162e86..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/int_slice_test.go
+++ /dev/null
@@ -1,49 +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.
-
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-	"strings"
-	"testing"
-)
-
-func setUpISFlagSet(isp *[]int) *FlagSet {
-	f := NewFlagSet("test", ContinueOnError)
-	f.IntSliceVar(isp, "is", []int{}, "Command seperated list!")
-	return f
-}
-
-func TestIS(t *testing.T) {
-	var is []int
-	f := setUpISFlagSet(&is)
-
-	vals := []string{"1", "2", "4", "3"}
-	arg := fmt.Sprintf("--is=%s", strings.Join(vals, ","))
-	err := f.Parse([]string{arg})
-	if err != nil {
-		t.Fatal("expected no error; got", err)
-	}
-	for i, v := range is {
-		d, err := strconv.Atoi(vals[i])
-		if err != nil {
-			t.Fatalf("got error: %v", err)
-		}
-		if d != v {
-			t.Fatalf("expected is[%d] to be %s but got: %d", i, vals[i], v)
-		}
-	}
-	getIS, err := f.GetIntSlice("is")
-	for i, v := range getIS {
-		d, err := strconv.Atoi(vals[i])
-		if err != nil {
-			t.Fatalf("got error: %v", err)
-		}
-		if d != v {
-			t.Fatalf("expected is[%d] to be %s but got: %d from GetIntSlice", i, vals[i], v)
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/ip.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/ip.go b/Godeps/_workspace/src/github.com/spf13/pflag/ip.go
deleted file mode 100644
index 746eefd..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/ip.go
+++ /dev/null
@@ -1,93 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"net"
-)
-
-// -- net.IP value
-type ipValue net.IP
-
-func newIPValue(val net.IP, p *net.IP) *ipValue {
-	*p = val
-	return (*ipValue)(p)
-}
-
-func (i *ipValue) String() string { return net.IP(*i).String() }
-func (i *ipValue) Set(s string) error {
-	ip := net.ParseIP(s)
-	if ip == nil {
-		return fmt.Errorf("failed to parse IP: %q", s)
-	}
-	*i = ipValue(ip)
-	return nil
-}
-
-func (i *ipValue) Type() string {
-	return "ip"
-}
-
-func ipConv(sval string) (interface{}, error) {
-	ip := net.ParseIP(sval)
-	if ip != nil {
-		return ip, nil
-	}
-	return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval)
-}
-
-// GetIP return the net.IP value of a flag with the given name
-func (f *FlagSet) GetIP(name string) (net.IP, error) {
-	val, err := f.getFlagType(name, "ip", ipConv)
-	if err != nil {
-		return nil, err
-	}
-	return val.(net.IP), nil
-}
-
-// IPVar defines an net.IP flag with specified name, default value, and usage string.
-// The argument p points to an net.IP variable in which to store the value of the flag.
-func (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage string) {
-	f.VarP(newIPValue(value, p), name, "", usage)
-}
-
-// Like IPVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {
-	f.VarP(newIPValue(value, p), name, shorthand, usage)
-}
-
-// IPVar defines an net.IP flag with specified name, default value, and usage string.
-// The argument p points to an net.IP variable in which to store the value of the flag.
-func IPVar(p *net.IP, name string, value net.IP, usage string) {
-	CommandLine.VarP(newIPValue(value, p), name, "", usage)
-}
-
-// Like IPVar, but accepts a shorthand letter that can be used after a single dash.
-func IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {
-	CommandLine.VarP(newIPValue(value, p), name, shorthand, usage)
-}
-
-// IP defines an net.IP flag with specified name, default value, and usage string.
-// The return value is the address of an net.IP variable that stores the value of the flag.
-func (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP {
-	p := new(net.IP)
-	f.IPVarP(p, name, "", value, usage)
-	return p
-}
-
-// Like IP, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPP(name, shorthand string, value net.IP, usage string) *net.IP {
-	p := new(net.IP)
-	f.IPVarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// IP defines an net.IP flag with specified name, default value, and usage string.
-// The return value is the address of an net.IP variable that stores the value of the flag.
-func IP(name string, value net.IP, usage string) *net.IP {
-	return CommandLine.IPP(name, "", value, usage)
-}
-
-// Like IP, but accepts a shorthand letter that can be used after a single dash.
-func IPP(name, shorthand string, value net.IP, usage string) *net.IP {
-	return CommandLine.IPP(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go b/Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go
deleted file mode 100644
index 1b10efb..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go
+++ /dev/null
@@ -1,122 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"net"
-	"strconv"
-)
-
-// -- net.IPMask value
-type ipMaskValue net.IPMask
-
-func newIPMaskValue(val net.IPMask, p *net.IPMask) *ipMaskValue {
-	*p = val
-	return (*ipMaskValue)(p)
-}
-
-func (i *ipMaskValue) String() string { return net.IPMask(*i).String() }
-func (i *ipMaskValue) Set(s string) error {
-	ip := ParseIPv4Mask(s)
-	if ip == nil {
-		return fmt.Errorf("failed to parse IP mask: %q", s)
-	}
-	*i = ipMaskValue(ip)
-	return nil
-}
-
-func (i *ipMaskValue) Type() string {
-	return "ipMask"
-}
-
-// Parse IPv4 netmask written in IP form (e.g. 255.255.255.0).
-// This function should really belong to the net package.
-func ParseIPv4Mask(s string) net.IPMask {
-	mask := net.ParseIP(s)
-	if mask == nil {
-		if len(s) != 8 {
-			return nil
-		}
-		// net.IPMask.String() actually outputs things like ffffff00
-		// so write a horrible parser for that as well  :-(
-		m := []int{}
-		for i := 0; i < 4; i++ {
-			b := "0x" + s[2*i:2*i+2]
-			d, err := strconv.ParseInt(b, 0, 0)
-			if err != nil {
-				return nil
-			}
-			m = append(m, int(d))
-		}
-		s := fmt.Sprintf("%d.%d.%d.%d", m[0], m[1], m[2], m[3])
-		mask = net.ParseIP(s)
-		if mask == nil {
-			return nil
-		}
-	}
-	return net.IPv4Mask(mask[12], mask[13], mask[14], mask[15])
-}
-
-func parseIPv4Mask(sval string) (interface{}, error) {
-	mask := ParseIPv4Mask(sval)
-	if mask == nil {
-		return nil, fmt.Errorf("unable to parse %s as net.IPMask", sval)
-	}
-	return mask, nil
-}
-
-// GetIPv4Mask return the net.IPv4Mask value of a flag with the given name
-func (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) {
-	val, err := f.getFlagType(name, "ipMask", parseIPv4Mask)
-	if err != nil {
-		return nil, err
-	}
-	return val.(net.IPMask), nil
-}
-
-// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.
-// The argument p points to an net.IPMask variable in which to store the value of the flag.
-func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
-	f.VarP(newIPMaskValue(value, p), name, "", usage)
-}
-
-// Like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {
-	f.VarP(newIPMaskValue(value, p), name, shorthand, usage)
-}
-
-// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.
-// The argument p points to an net.IPMask variable in which to store the value of the flag.
-func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
-	CommandLine.VarP(newIPMaskValue(value, p), name, "", usage)
-}
-
-// Like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
-func IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {
-	CommandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage)
-}
-
-// IPMask defines an net.IPMask flag with specified name, default value, and usage string.
-// The return value is the address of an net.IPMask variable that stores the value of the flag.
-func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMask {
-	p := new(net.IPMask)
-	f.IPMaskVarP(p, name, "", value, usage)
-	return p
-}
-
-// Like IPMask, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {
-	p := new(net.IPMask)
-	f.IPMaskVarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// IPMask defines an net.IPMask flag with specified name, default value, and usage string.
-// The return value is the address of an net.IPMask variable that stores the value of the flag.
-func IPMask(name string, value net.IPMask, usage string) *net.IPMask {
-	return CommandLine.IPMaskP(name, "", value, usage)
-}
-
-// Like IP, but accepts a shorthand letter that can be used after a single dash.
-func IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {
-	return CommandLine.IPMaskP(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/string.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/string.go b/Godeps/_workspace/src/github.com/spf13/pflag/string.go
deleted file mode 100644
index f89ea8b..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/string.go
+++ /dev/null
@@ -1,82 +0,0 @@
-package pflag
-
-import "fmt"
-
-// -- string Value
-type stringValue string
-
-func newStringValue(val string, p *string) *stringValue {
-	*p = val
-	return (*stringValue)(p)
-}
-
-func (s *stringValue) Set(val string) error {
-	*s = stringValue(val)
-	return nil
-}
-func (s *stringValue) Type() string {
-	return "string"
-}
-
-func (s *stringValue) String() string { return fmt.Sprintf("%s", *s) }
-
-func stringConv(sval string) (interface{}, error) {
-	return sval, nil
-}
-
-// GetString return the string value of a flag with the given name
-func (f *FlagSet) GetString(name string) (string, error) {
-	val, err := f.getFlagType(name, "string", stringConv)
-	if err != nil {
-		return "", err
-	}
-	return val.(string), nil
-}
-
-// StringVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a string variable in which to store the value of the flag.
-func (f *FlagSet) StringVar(p *string, name string, value string, usage string) {
-	f.VarP(newStringValue(value, p), name, "", usage)
-}
-
-// Like StringVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringVarP(p *string, name, shorthand string, value string, usage string) {
-	f.VarP(newStringValue(value, p), name, shorthand, usage)
-}
-
-// StringVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a string variable in which to store the value of the flag.
-func StringVar(p *string, name string, value string, usage string) {
-	CommandLine.VarP(newStringValue(value, p), name, "", usage)
-}
-
-// Like StringVar, but accepts a shorthand letter that can be used after a single dash.
-func StringVarP(p *string, name, shorthand string, value string, usage string) {
-	CommandLine.VarP(newStringValue(value, p), name, shorthand, usage)
-}
-
-// String defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a string variable that stores the value of the flag.
-func (f *FlagSet) String(name string, value string, usage string) *string {
-	p := new(string)
-	f.StringVarP(p, name, "", value, usage)
-	return p
-}
-
-// Like String, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string {
-	p := new(string)
-	f.StringVarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// String defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a string variable that stores the value of the flag.
-func String(name string, value string, usage string) *string {
-	return CommandLine.StringP(name, "", value, usage)
-}
-
-// Like String, but accepts a shorthand letter that can be used after a single dash.
-func StringP(name, shorthand string, value string, usage string) *string {
-	return CommandLine.StringP(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/string_slice.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/string_slice.go b/Godeps/_workspace/src/github.com/spf13/pflag/string_slice.go
deleted file mode 100644
index bbe6e00..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/string_slice.go
+++ /dev/null
@@ -1,86 +0,0 @@
-package pflag
-
-import (
-	"strings"
-)
-
-// -- stringSlice Value
-type stringSliceValue []string
-
-func newStringSliceValue(val []string, p *[]string) *stringSliceValue {
-	*p = val
-	return (*stringSliceValue)(p)
-}
-
-func (s *stringSliceValue) Set(val string) error {
-	v := strings.Split(val, ",")
-	*s = stringSliceValue(v)
-	return nil
-}
-func (s *stringSliceValue) Type() string {
-	return "stringSlice"
-}
-
-func (s *stringSliceValue) String() string { return strings.Join(*s, ",") }
-
-func stringSliceConv(sval string) (interface{}, error) {
-	v := strings.Split(sval, ",")
-	return v, nil
-}
-
-// GetStringSlice return the []string value of a flag with the given name
-func (f *FlagSet) GetStringSlice(name string) ([]string, error) {
-	val, err := f.getFlagType(name, "stringSlice", stringSliceConv)
-	if err != nil {
-		return []string{}, err
-	}
-	return val.([]string), nil
-}
-
-// StringSliceVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a []string variable in which to store the value of the flag.
-func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) {
-	f.VarP(newStringSliceValue(value, p), name, "", usage)
-}
-
-// Like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {
-	f.VarP(newStringSliceValue(value, p), name, shorthand, usage)
-}
-
-// StringSliceVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a []string variable in which to store the value of the flag.
-func StringSliceVar(p *[]string, name string, value []string, usage string) {
-	CommandLine.VarP(newStringSliceValue(value, p), name, "", usage)
-}
-
-// Like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {
-	CommandLine.VarP(newStringSliceValue(value, p), name, shorthand, usage)
-}
-
-// StringSlice defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a []string variable that stores the value of the flag.
-func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string {
-	p := make([]string, 0)
-	f.StringSliceVarP(&p, name, "", value, usage)
-	return &p
-}
-
-// Like StringSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage string) *[]string {
-	p := make([]string, 0)
-	f.StringSliceVarP(&p, name, shorthand, value, usage)
-	return &p
-}
-
-// StringSlice defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a []string variable that stores the value of the flag.
-func StringSlice(name string, value []string, usage string) *[]string {
-	return CommandLine.StringSliceP(name, "", value, usage)
-}
-
-// Like StringSlice, but accepts a shorthand letter that can be used after a single dash.
-func StringSliceP(name, shorthand string, value []string, usage string) *[]string {
-	return CommandLine.StringSliceP(name, shorthand, value, usage)
-}



[37/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/properties.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/properties.go b/Godeps/_workspace/src/github.com/magiconair/properties/properties.go
deleted file mode 100644
index edcaccc..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/properties.go
+++ /dev/null
@@ -1,698 +0,0 @@
-// Copyright 2013-2014 Frank Schroeder. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package properties
-
-// BUG(frank): Set() does not check for invalid unicode literals since this is currently handled by the lexer.
-// BUG(frank): Write() does not allow to configure the newline character. Therefore, on Windows LF is used.
-
-import (
-	"fmt"
-	"io"
-	"log"
-	"os"
-	"regexp"
-	"strconv"
-	"strings"
-	"time"
-	"unicode/utf8"
-)
-
-// ErrorHandlerFunc defines the type of function which handles failures
-// of the MustXXX() functions. An error handler function must exit
-// the application after handling the error.
-type ErrorHandlerFunc func(error)
-
-// ErrorHandler is the function which handles failures of the MustXXX()
-// functions. The default is LogFatalHandler.
-var ErrorHandler = LogFatalHandler
-
-// LogFatalHandler handles the error by logging a fatal error and exiting.
-func LogFatalHandler(err error) {
-	log.Fatal(err)
-}
-
-// PanicHandler handles the error by panicking.
-func PanicHandler(err error) {
-	panic(err)
-}
-
-// -----------------------------------------------------------------------------
-
-// A Properties contains the key/value pairs from the properties input.
-// All values are stored in unexpanded form and are expanded at runtime
-type Properties struct {
-	// Pre-/Postfix for property expansion.
-	Prefix  string
-	Postfix string
-
-	// Stores the key/value pairs
-	m map[string]string
-
-	// Stores the comments per key.
-	c map[string][]string
-
-	// Stores the keys in order of appearance.
-	k []string
-}
-
-// NewProperties creates a new Properties struct with the default
-// configuration for "${key}" expressions.
-func NewProperties() *Properties {
-	return &Properties{
-		Prefix:  "${",
-		Postfix: "}",
-		m:       map[string]string{},
-		c:       map[string][]string{},
-		k:       []string{},
-	}
-}
-
-// Get returns the expanded value for the given key if exists.
-// Otherwise, ok is false.
-func (p *Properties) Get(key string) (value string, ok bool) {
-	v, ok := p.m[key]
-	if !ok {
-		return "", false
-	}
-
-	expanded, err := p.expand(v)
-
-	// we guarantee that the expanded value is free of
-	// circular references and malformed expressions
-	// so we panic if we still get an error here.
-	if err != nil {
-		ErrorHandler(fmt.Errorf("%s in %q", err, key+" = "+v))
-	}
-
-	return expanded, true
-}
-
-// MustGet returns the expanded value for the given key if exists.
-// Otherwise, it panics.
-func (p *Properties) MustGet(key string) string {
-	if v, ok := p.Get(key); ok {
-		return v
-	}
-	ErrorHandler(invalidKeyError(key))
-	panic("ErrorHandler should exit")
-}
-
-// ----------------------------------------------------------------------------
-
-// ClearComments removes the comments for all keys.
-func (p *Properties) ClearComments() {
-	p.c = map[string][]string{}
-}
-
-// ----------------------------------------------------------------------------
-
-// GetComment returns the last comment before the given key or an empty string.
-func (p *Properties) GetComment(key string) string {
-	comments, ok := p.c[key]
-	if !ok || len(comments) == 0 {
-		return ""
-	}
-	return comments[len(comments)-1]
-}
-
-// ----------------------------------------------------------------------------
-
-// GetComments returns all comments that appeared before the given key or nil.
-func (p *Properties) GetComments(key string) []string {
-	if comments, ok := p.c[key]; ok {
-		return comments
-	}
-	return nil
-}
-
-// ----------------------------------------------------------------------------
-
-// SetComment sets the comment for the key.
-func (p *Properties) SetComment(key, comment string) {
-	p.c[key] = []string{comment}
-}
-
-// ----------------------------------------------------------------------------
-
-// SetComments sets the comments for the key. If the comments are nil then
-// all comments for this key are deleted.
-func (p *Properties) SetComments(key string, comments []string) {
-	if comments == nil {
-		delete(p.c, key)
-		return
-	}
-	p.c[key] = comments
-}
-
-// ----------------------------------------------------------------------------
-
-// GetBool checks if the expanded value is one of '1', 'yes',
-// 'true' or 'on' if the key exists. The comparison is case-insensitive.
-// If the key does not exist the default value is returned.
-func (p *Properties) GetBool(key string, def bool) bool {
-	v, err := p.getBool(key)
-	if err != nil {
-		return def
-	}
-	return v
-}
-
-// MustGetBool checks if the expanded value is one of '1', 'yes',
-// 'true' or 'on' if the key exists. The comparison is case-insensitive.
-// If the key does not exist the function panics.
-func (p *Properties) MustGetBool(key string) bool {
-	v, err := p.getBool(key)
-	if err != nil {
-		ErrorHandler(err)
-	}
-	return v
-}
-
-func (p *Properties) getBool(key string) (value bool, err error) {
-	if v, ok := p.Get(key); ok {
-		v = strings.ToLower(v)
-		return v == "1" || v == "true" || v == "yes" || v == "on", nil
-	}
-	return false, invalidKeyError(key)
-}
-
-// ----------------------------------------------------------------------------
-
-// GetDuration parses the expanded value as an time.Duration (in ns) if the
-// key exists. If key does not exist or the value cannot be parsed the default
-// value is returned. In almost all cases you want to use GetParsedDuration().
-func (p *Properties) GetDuration(key string, def time.Duration) time.Duration {
-	v, err := p.getInt64(key)
-	if err != nil {
-		return def
-	}
-	return time.Duration(v)
-}
-
-// MustGetDuration parses the expanded value as an time.Duration (in ns) if
-// the key exists. If key does not exist or the value cannot be parsed the
-// function panics. In almost all cases you want to use MustGetParsedDuration().
-func (p *Properties) MustGetDuration(key string) time.Duration {
-	v, err := p.getInt64(key)
-	if err != nil {
-		ErrorHandler(err)
-	}
-	return time.Duration(v)
-}
-
-// ----------------------------------------------------------------------------
-
-// GetParsedDuration parses the expanded value with time.ParseDuration() if the key exists.
-// If key does not exist or the value cannot be parsed the default
-// value is returned.
-func (p *Properties) GetParsedDuration(key string, def time.Duration) time.Duration {
-	s, ok := p.Get(key)
-	if !ok {
-		return def
-	}
-	v, err := time.ParseDuration(s)
-	if err != nil {
-		return def
-	}
-	return v
-}
-
-// MustGetParsedDuration parses the expanded value with time.ParseDuration() if the key exists.
-// If key does not exist or the value cannot be parsed the function panics.
-func (p *Properties) MustGetParsedDuration(key string) time.Duration {
-	s, ok := p.Get(key)
-	if !ok {
-		ErrorHandler(invalidKeyError(key))
-	}
-	v, err := time.ParseDuration(s)
-	if err != nil {
-		ErrorHandler(err)
-	}
-	return v
-}
-
-// ----------------------------------------------------------------------------
-
-// GetFloat64 parses the expanded value as a float64 if the key exists.
-// If key does not exist or the value cannot be parsed the default
-// value is returned.
-func (p *Properties) GetFloat64(key string, def float64) float64 {
-	v, err := p.getFloat64(key)
-	if err != nil {
-		return def
-	}
-	return v
-}
-
-// MustGetFloat64 parses the expanded value as a float64 if the key exists.
-// If key does not exist or the value cannot be parsed the function panics.
-func (p *Properties) MustGetFloat64(key string) float64 {
-	v, err := p.getFloat64(key)
-	if err != nil {
-		ErrorHandler(err)
-	}
-	return v
-}
-
-func (p *Properties) getFloat64(key string) (value float64, err error) {
-	if v, ok := p.Get(key); ok {
-		value, err = strconv.ParseFloat(v, 64)
-		if err != nil {
-			return 0, err
-		}
-		return value, nil
-	}
-	return 0, invalidKeyError(key)
-}
-
-// ----------------------------------------------------------------------------
-
-// GetInt parses the expanded value as an int if the key exists.
-// If key does not exist or the value cannot be parsed the default
-// value is returned. If the value does not fit into an int the
-// function panics with an out of range error.
-func (p *Properties) GetInt(key string, def int) int {
-	v, err := p.getInt64(key)
-	if err != nil {
-		return def
-	}
-	return intRangeCheck(key, v)
-}
-
-// MustGetInt parses the expanded value as an int if the key exists.
-// If key does not exist or the value cannot be parsed the function panics.
-// If the value does not fit into an int the function panics with
-// an out of range error.
-func (p *Properties) MustGetInt(key string) int {
-	v, err := p.getInt64(key)
-	if err != nil {
-		ErrorHandler(err)
-	}
-	return intRangeCheck(key, v)
-}
-
-// ----------------------------------------------------------------------------
-
-// GetInt64 parses the expanded value as an int64 if the key exists.
-// If key does not exist or the value cannot be parsed the default
-// value is returned.
-func (p *Properties) GetInt64(key string, def int64) int64 {
-	v, err := p.getInt64(key)
-	if err != nil {
-		return def
-	}
-	return v
-}
-
-// MustGetInt64 parses the expanded value as an int if the key exists.
-// If key does not exist or the value cannot be parsed the function panics.
-func (p *Properties) MustGetInt64(key string) int64 {
-	v, err := p.getInt64(key)
-	if err != nil {
-		ErrorHandler(err)
-	}
-	return v
-}
-
-func (p *Properties) getInt64(key string) (value int64, err error) {
-	if v, ok := p.Get(key); ok {
-		value, err = strconv.ParseInt(v, 10, 64)
-		if err != nil {
-			return 0, err
-		}
-		return value, nil
-	}
-	return 0, invalidKeyError(key)
-}
-
-// ----------------------------------------------------------------------------
-
-// GetUint parses the expanded value as an uint if the key exists.
-// If key does not exist or the value cannot be parsed the default
-// value is returned. If the value does not fit into an int the
-// function panics with an out of range error.
-func (p *Properties) GetUint(key string, def uint) uint {
-	v, err := p.getUint64(key)
-	if err != nil {
-		return def
-	}
-	return uintRangeCheck(key, v)
-}
-
-// MustGetUint parses the expanded value as an int if the key exists.
-// If key does not exist or the value cannot be parsed the function panics.
-// If the value does not fit into an int the function panics with
-// an out of range error.
-func (p *Properties) MustGetUint(key string) uint {
-	v, err := p.getUint64(key)
-	if err != nil {
-		ErrorHandler(err)
-	}
-	return uintRangeCheck(key, v)
-}
-
-// ----------------------------------------------------------------------------
-
-// GetUint64 parses the expanded value as an uint64 if the key exists.
-// If key does not exist or the value cannot be parsed the default
-// value is returned.
-func (p *Properties) GetUint64(key string, def uint64) uint64 {
-	v, err := p.getUint64(key)
-	if err != nil {
-		return def
-	}
-	return v
-}
-
-// MustGetUint64 parses the expanded value as an int if the key exists.
-// If key does not exist or the value cannot be parsed the function panics.
-func (p *Properties) MustGetUint64(key string) uint64 {
-	v, err := p.getUint64(key)
-	if err != nil {
-		ErrorHandler(err)
-	}
-	return v
-}
-
-func (p *Properties) getUint64(key string) (value uint64, err error) {
-	if v, ok := p.Get(key); ok {
-		value, err = strconv.ParseUint(v, 10, 64)
-		if err != nil {
-			return 0, err
-		}
-		return value, nil
-	}
-	return 0, invalidKeyError(key)
-}
-
-// ----------------------------------------------------------------------------
-
-// GetString returns the expanded value for the given key if exists or
-// the default value otherwise.
-func (p *Properties) GetString(key, def string) string {
-	if v, ok := p.Get(key); ok {
-		return v
-	}
-	return def
-}
-
-// MustGetString returns the expanded value for the given key if exists or
-// panics otherwise.
-func (p *Properties) MustGetString(key string) string {
-	if v, ok := p.Get(key); ok {
-		return v
-	}
-	ErrorHandler(invalidKeyError(key))
-	panic("ErrorHandler should exit")
-}
-
-// ----------------------------------------------------------------------------
-
-// Filter returns a new properties object which contains all properties
-// for which the key matches the pattern.
-func (p *Properties) Filter(pattern string) (*Properties, error) {
-	re, err := regexp.Compile(pattern)
-	if err != nil {
-		return nil, err
-	}
-
-	return p.FilterRegexp(re), nil
-}
-
-// FilterRegexp returns a new properties object which contains all properties
-// for which the key matches the regular expression.
-func (p *Properties) FilterRegexp(re *regexp.Regexp) *Properties {
-	pp := NewProperties()
-	for _, k := range p.k {
-		if re.MatchString(k) {
-			pp.Set(k, p.m[k])
-		}
-	}
-	return pp
-}
-
-// FilterPrefix returns a new properties object which contains all properties
-// for which the key starts with the prefix.
-func (p *Properties) FilterPrefix(prefix string) *Properties {
-	pp := NewProperties()
-	for _, k := range p.k {
-		if strings.HasPrefix(k, prefix) {
-			pp.Set(k, p.m[k])
-		}
-	}
-	return pp
-}
-
-// Len returns the number of keys.
-func (p *Properties) Len() int {
-	return len(p.m)
-}
-
-// Keys returns all keys in the same order as in the input.
-func (p *Properties) Keys() []string {
-	keys := make([]string, len(p.k))
-	for i, k := range p.k {
-		keys[i] = k
-	}
-	return keys
-}
-
-// Set sets the property key to the corresponding value.
-// If a value for key existed before then ok is true and prev
-// contains the previous value. If the value contains a
-// circular reference or a malformed expression then
-// an error is returned.
-// An empty key is silently ignored.
-func (p *Properties) Set(key, value string) (prev string, ok bool, err error) {
-	if key == "" {
-		return "", false, nil
-	}
-
-	// to check for a circular reference we temporarily need
-	// to set the new value. If there is an error then revert
-	// to the previous state. Only if all tests are successful
-	// then we add the key to the p.k list.
-	prev, ok = p.Get(key)
-	p.m[key] = value
-
-	// now check for a circular reference
-	_, err = p.expand(value)
-	if err != nil {
-
-		// revert to the previous state
-		if ok {
-			p.m[key] = prev
-		} else {
-			delete(p.m, key)
-		}
-
-		return "", false, err
-	}
-
-	if !ok {
-		p.k = append(p.k, key)
-	}
-
-	return prev, ok, nil
-}
-
-// MustSet sets the property key to the corresponding value.
-// If a value for key existed before then ok is true and prev
-// contains the previous value. An empty key is silently ignored.
-func (p *Properties) MustSet(key, value string) (prev string, ok bool) {
-	prev, ok, err := p.Set(key, value)
-	if err != nil {
-		ErrorHandler(err)
-	}
-	return prev, ok
-}
-
-// String returns a string of all expanded 'key = value' pairs.
-func (p *Properties) String() string {
-	var s string
-	for _, key := range p.k {
-		value, _ := p.Get(key)
-		s = fmt.Sprintf("%s%s = %s\n", s, key, value)
-	}
-	return s
-}
-
-// Write writes all unexpanded 'key = value' pairs to the given writer.
-// Write returns the number of bytes written and any write error encountered.
-func (p *Properties) Write(w io.Writer, enc Encoding) (n int, err error) {
-	return p.WriteComment(w, "", enc)
-}
-
-// WriteComment writes all unexpanced 'key = value' pairs to the given writer.
-// If prefix is not empty then comments are written with a blank line and the
-// given prefix. The prefix should be either "# " or "! " to be compatible with
-// the properties file format. Otherwise, the properties parser will not be
-// able to read the file back in. It returns the number of bytes written and
-// any write error encountered.
-func (p *Properties) WriteComment(w io.Writer, prefix string, enc Encoding) (n int, err error) {
-	var x int
-
-	for _, key := range p.k {
-		value := p.m[key]
-
-		if prefix != "" {
-			if comments, ok := p.c[key]; ok {
-				// don't print comments if they are all empty
-				allEmpty := true
-				for _, c := range comments {
-					if c != "" {
-						allEmpty = false
-						break
-					}
-				}
-
-				if !allEmpty {
-					// add a blank line between entries but not at the top
-					if len(comments) > 0 && n > 0 {
-						x, err = fmt.Fprintln(w)
-						if err != nil {
-							return
-						}
-						n += x
-					}
-
-					for _, c := range comments {
-						x, err = fmt.Fprintf(w, "%s%s\n", prefix, encode(c, "", enc))
-						if err != nil {
-							return
-						}
-						n += x
-					}
-				}
-			}
-		}
-
-		x, err = fmt.Fprintf(w, "%s = %s\n", encode(key, " :", enc), encode(value, "", enc))
-		if err != nil {
-			return
-		}
-		n += x
-	}
-	return
-}
-
-// ----------------------------------------------------------------------------
-
-// check expands all values and returns an error if a circular reference or
-// a malformed expression was found.
-func (p *Properties) check() error {
-	for _, value := range p.m {
-		if _, err := p.expand(value); err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-func (p *Properties) expand(input string) (string, error) {
-	// no pre/postfix -> nothing to expand
-	if p.Prefix == "" && p.Postfix == "" {
-		return input, nil
-	}
-
-	return expand(input, make(map[string]bool), p.Prefix, p.Postfix, p.m)
-}
-
-// expand recursively expands expressions of '(prefix)key(postfix)' to their corresponding values.
-// The function keeps track of the keys that were already expanded and stops if it
-// detects a circular reference or a malformed expression of the form '(prefix)key'.
-func expand(s string, keys map[string]bool, prefix, postfix string, values map[string]string) (string, error) {
-	start := strings.Index(s, prefix)
-	if start == -1 {
-		return s, nil
-	}
-
-	keyStart := start + len(prefix)
-	keyLen := strings.Index(s[keyStart:], postfix)
-	if keyLen == -1 {
-		return "", fmt.Errorf("malformed expression")
-	}
-
-	end := keyStart + keyLen + len(postfix) - 1
-	key := s[keyStart : keyStart+keyLen]
-
-	// fmt.Printf("s:%q pp:%q start:%d end:%d keyStart:%d keyLen:%d key:%q\n", s, prefix + "..." + postfix, start, end, keyStart, keyLen, key)
-
-	if _, ok := keys[key]; ok {
-		return "", fmt.Errorf("circular reference")
-	}
-
-	val, ok := values[key]
-	if !ok {
-		val = os.Getenv(key)
-	}
-
-	// remember that we've seen the key
-	keys[key] = true
-
-	return expand(s[:start]+val+s[end+1:], keys, prefix, postfix, values)
-}
-
-// encode encodes a UTF-8 string to ISO-8859-1 and escapes some characters.
-func encode(s string, special string, enc Encoding) string {
-	switch enc {
-	case UTF8:
-		return encodeUtf8(s, special)
-	case ISO_8859_1:
-		return encodeIso(s, special)
-	default:
-		panic(fmt.Sprintf("unsupported encoding %v", enc))
-	}
-}
-
-func encodeUtf8(s string, special string) string {
-	v := ""
-	for pos := 0; pos < len(s); {
-		r, w := utf8.DecodeRuneInString(s[pos:])
-		pos += w
-		v += escape(r, special)
-	}
-	return v
-}
-
-func encodeIso(s string, special string) string {
-	var r rune
-	var w int
-	var v string
-	for pos := 0; pos < len(s); {
-		switch r, w = utf8.DecodeRuneInString(s[pos:]); {
-		case r < 1<<8: // single byte rune -> escape special chars only
-			v += escape(r, special)
-		case r < 1<<16: // two byte rune -> unicode literal
-			v += fmt.Sprintf("\\u%04x", r)
-		default: // more than two bytes per rune -> can't encode
-			v += "?"
-		}
-		pos += w
-	}
-	return v
-}
-
-func escape(r rune, special string) string {
-	switch r {
-	case '\f':
-		return "\\f"
-	case '\n':
-		return "\\n"
-	case '\r':
-		return "\\r"
-	case '\t':
-		return "\\t"
-	default:
-		if strings.ContainsRune(special, r) {
-			return "\\" + string(r)
-		}
-		return string(r)
-	}
-}
-
-func invalidKeyError(key string) error {
-	return fmt.Errorf("unknown property: %s", key)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/properties_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/properties_test.go b/Godeps/_workspace/src/github.com/magiconair/properties/properties_test.go
deleted file mode 100644
index 36ff293..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/properties_test.go
+++ /dev/null
@@ -1,846 +0,0 @@
-// Copyright 2013-2014 Frank Schroeder. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package properties
-
-import (
-	"bytes"
-	"flag"
-	"fmt"
-	"math"
-	"os"
-	"strings"
-	"testing"
-	"time"
-
-	. "gopkg.in/check.v1"
-)
-
-func Test(t *testing.T) { TestingT(t) }
-
-type TestSuite struct {
-	prevHandler ErrorHandlerFunc
-}
-
-var (
-	_       = Suite(&TestSuite{})
-	verbose = flag.Bool("verbose", false, "Verbose output")
-)
-
-// --------------------------------------------------------------------
-
-func (s *TestSuite) SetUpSuite(c *C) {
-	s.prevHandler = ErrorHandler
-	ErrorHandler = PanicHandler
-}
-
-// --------------------------------------------------------------------
-
-func (s *TestSuite) TearDownSuite(c *C) {
-	ErrorHandler = s.prevHandler
-}
-
-// ----------------------------------------------------------------------------
-
-// define test cases in the form of
-// {"input", "key1", "value1", "key2", "value2", ...}
-var complexTests = [][]string{
-	// whitespace prefix
-	{" key=value", "key", "value"},     // SPACE prefix
-	{"\fkey=value", "key", "value"},    // FF prefix
-	{"\tkey=value", "key", "value"},    // TAB prefix
-	{" \f\tkey=value", "key", "value"}, // mix prefix
-
-	// multiple keys
-	{"key1=value1\nkey2=value2\n", "key1", "value1", "key2", "value2"},
-	{"key1=value1\rkey2=value2\r", "key1", "value1", "key2", "value2"},
-	{"key1=value1\r\nkey2=value2\r\n", "key1", "value1", "key2", "value2"},
-
-	// blank lines
-	{"\nkey=value\n", "key", "value"},
-	{"\rkey=value\r", "key", "value"},
-	{"\r\nkey=value\r\n", "key", "value"},
-
-	// escaped chars in key
-	{"k\\ ey = value", "k ey", "value"},
-	{"k\\:ey = value", "k:ey", "value"},
-	{"k\\=ey = value", "k=ey", "value"},
-	{"k\\fey = value", "k\fey", "value"},
-	{"k\\ney = value", "k\ney", "value"},
-	{"k\\rey = value", "k\rey", "value"},
-	{"k\\tey = value", "k\tey", "value"},
-
-	// escaped chars in value
-	{"key = v\\ alue", "key", "v alue"},
-	{"key = v\\:alue", "key", "v:alue"},
-	{"key = v\\=alue", "key", "v=alue"},
-	{"key = v\\falue", "key", "v\falue"},
-	{"key = v\\nalue", "key", "v\nalue"},
-	{"key = v\\ralue", "key", "v\ralue"},
-	{"key = v\\talue", "key", "v\talue"},
-
-	// silently dropped escape character
-	{"k\\zey = value", "kzey", "value"},
-	{"key = v\\zalue", "key", "vzalue"},
-
-	// unicode literals
-	{"key\\u2318 = value", "key⌘", "value"},
-	{"k\\u2318ey = value", "k⌘ey", "value"},
-	{"key = value\\u2318", "key", "value⌘"},
-	{"key = valu\\u2318e", "key", "valu⌘e"},
-
-	// multiline values
-	{"key = valueA,\\\n    valueB", "key", "valueA,valueB"},   // SPACE indent
-	{"key = valueA,\\\n\f\f\fvalueB", "key", "valueA,valueB"}, // FF indent
-	{"key = valueA,\\\n\t\t\tvalueB", "key", "valueA,valueB"}, // TAB indent
-	{"key = valueA,\\\n \f\tvalueB", "key", "valueA,valueB"},  // mix indent
-
-	// comments
-	{"# this is a comment\n! and so is this\nkey1=value1\nkey#2=value#2\n\nkey!3=value!3\n# and another one\n! and the final one", "key1", "value1", "key#2", "value#2", "key!3", "value!3"},
-
-	// expansion tests
-	{"key=value\nkey2=${key}", "key", "value", "key2", "value"},
-	{"key=value\nkey2=aa${key}", "key", "value", "key2", "aavalue"},
-	{"key=value\nkey2=${key}bb", "key", "value", "key2", "valuebb"},
-	{"key=value\nkey2=aa${key}bb", "key", "value", "key2", "aavaluebb"},
-	{"key=value\nkey2=${key}\nkey3=${key2}", "key", "value", "key2", "value", "key3", "value"},
-	{"key=${USER}", "key", os.Getenv("USER")},
-	{"key=${USER}\nUSER=value", "key", "value", "USER", "value"},
-}
-
-// ----------------------------------------------------------------------------
-
-var commentTests = []struct {
-	input, key, value string
-	comments          []string
-}{
-	{"key=value", "key", "value", nil},
-	{"#\nkey=value", "key", "value", []string{""}},
-	{"#comment\nkey=value", "key", "value", []string{"comment"}},
-	{"# comment\nkey=value", "key", "value", []string{"comment"}},
-	{"#  comment\nkey=value", "key", "value", []string{"comment"}},
-	{"# comment\n\nkey=value", "key", "value", []string{"comment"}},
-	{"# comment1\n# comment2\nkey=value", "key", "value", []string{"comment1", "comment2"}},
-	{"# comment1\n\n# comment2\n\nkey=value", "key", "value", []string{"comment1", "comment2"}},
-	{"!comment\nkey=value", "key", "value", []string{"comment"}},
-	{"! comment\nkey=value", "key", "value", []string{"comment"}},
-	{"!  comment\nkey=value", "key", "value", []string{"comment"}},
-	{"! comment\n\nkey=value", "key", "value", []string{"comment"}},
-	{"! comment1\n! comment2\nkey=value", "key", "value", []string{"comment1", "comment2"}},
-	{"! comment1\n\n! comment2\n\nkey=value", "key", "value", []string{"comment1", "comment2"}},
-}
-
-// ----------------------------------------------------------------------------
-
-var errorTests = []struct {
-	input, msg string
-}{
-	// unicode literals
-	{"key\\u1 = value", "invalid unicode literal"},
-	{"key\\u12 = value", "invalid unicode literal"},
-	{"key\\u123 = value", "invalid unicode literal"},
-	{"key\\u123g = value", "invalid unicode literal"},
-	{"key\\u123", "invalid unicode literal"},
-
-	// circular references
-	{"key=${key}", "circular reference"},
-	{"key1=${key2}\nkey2=${key1}", "circular reference"},
-
-	// malformed expressions
-	{"key=${ke", "malformed expression"},
-	{"key=valu${ke", "malformed expression"},
-}
-
-// ----------------------------------------------------------------------------
-
-var writeTests = []struct {
-	input, output, encoding string
-}{
-	// ISO-8859-1 tests
-	{"key = value", "key = value\n", "ISO-8859-1"},
-	{"key = value \\\n   continued", "key = value continued\n", "ISO-8859-1"},
-	{"key⌘ = value", "key\\u2318 = value\n", "ISO-8859-1"},
-	{"ke\\ \\:y = value", "ke\\ \\:y = value\n", "ISO-8859-1"},
-
-	// UTF-8 tests
-	{"key = value", "key = value\n", "UTF-8"},
-	{"key = value \\\n   continued", "key = value continued\n", "UTF-8"},
-	{"key⌘ = value⌘", "key⌘ = value⌘\n", "UTF-8"},
-	{"ke\\ \\:y = value", "ke\\ \\:y = value\n", "UTF-8"},
-}
-
-// ----------------------------------------------------------------------------
-
-var writeCommentTests = []struct {
-	input, output, encoding string
-}{
-	// ISO-8859-1 tests
-	{"key = value", "key = value\n", "ISO-8859-1"},
-	{"#\nkey = value", "key = value\n", "ISO-8859-1"},
-	{"#\n#\n#\nkey = value", "key = value\n", "ISO-8859-1"},
-	{"# comment\nkey = value", "# comment\nkey = value\n", "ISO-8859-1"},
-	{"\n# comment\nkey = value", "# comment\nkey = value\n", "ISO-8859-1"},
-	{"# comment\n\nkey = value", "# comment\nkey = value\n", "ISO-8859-1"},
-	{"# comment1\n# comment2\nkey = value", "# comment1\n# comment2\nkey = value\n", "ISO-8859-1"},
-	{"#comment1\nkey1 = value1\n#comment2\nkey2 = value2", "# comment1\nkey1 = value1\n\n# comment2\nkey2 = value2\n", "ISO-8859-1"},
-
-	// UTF-8 tests
-	{"key = value", "key = value\n", "UTF-8"},
-	{"# comment⌘\nkey = value⌘", "# comment⌘\nkey = value⌘\n", "UTF-8"},
-	{"\n# comment⌘\nkey = value⌘", "# comment⌘\nkey = value⌘\n", "UTF-8"},
-	{"# comment⌘\n\nkey = value⌘", "# comment⌘\nkey = value⌘\n", "UTF-8"},
-	{"# comment1⌘\n# comment2⌘\nkey = value⌘", "# comment1⌘\n# comment2⌘\nkey = value⌘\n", "UTF-8"},
-	{"#comment1⌘\nkey1 = value1⌘\n#comment2⌘\nkey2 = value2⌘", "# comment1⌘\nkey1 = value1⌘\n\n# comment2⌘\nkey2 = value2⌘\n", "UTF-8"},
-}
-
-// ----------------------------------------------------------------------------
-
-var boolTests = []struct {
-	input, key string
-	def, value bool
-}{
-	// valid values for TRUE
-	{"key = 1", "key", false, true},
-	{"key = on", "key", false, true},
-	{"key = On", "key", false, true},
-	{"key = ON", "key", false, true},
-	{"key = true", "key", false, true},
-	{"key = True", "key", false, true},
-	{"key = TRUE", "key", false, true},
-	{"key = yes", "key", false, true},
-	{"key = Yes", "key", false, true},
-	{"key = YES", "key", false, true},
-
-	// valid values for FALSE (all other)
-	{"key = 0", "key", true, false},
-	{"key = off", "key", true, false},
-	{"key = false", "key", true, false},
-	{"key = no", "key", true, false},
-
-	// non existent key
-	{"key = true", "key2", false, false},
-}
-
-// ----------------------------------------------------------------------------
-
-var durationTests = []struct {
-	input, key string
-	def, value time.Duration
-}{
-	// valid values
-	{"key = 1", "key", 999, 1},
-	{"key = 0", "key", 999, 0},
-	{"key = -1", "key", 999, -1},
-	{"key = 0123", "key", 999, 123},
-
-	// invalid values
-	{"key = 0xff", "key", 999, 999},
-	{"key = 1.0", "key", 999, 999},
-	{"key = a", "key", 999, 999},
-
-	// non existent key
-	{"key = 1", "key2", 999, 999},
-}
-
-// ----------------------------------------------------------------------------
-
-var parsedDurationTests = []struct {
-	input, key string
-	def, value time.Duration
-}{
-	// valid values
-	{"key = -1ns", "key", 999, -1 * time.Nanosecond},
-	{"key = 300ms", "key", 999, 300 * time.Millisecond},
-	{"key = 5s", "key", 999, 5 * time.Second},
-	{"key = 3h", "key", 999, 3 * time.Hour},
-	{"key = 2h45m", "key", 999, 2*time.Hour + 45*time.Minute},
-
-	// invalid values
-	{"key = 0xff", "key", 999, 999},
-	{"key = 1.0", "key", 999, 999},
-	{"key = a", "key", 999, 999},
-	{"key = 1", "key", 999, 999},
-	{"key = 0", "key", 999, 0},
-
-	// non existent key
-	{"key = 1", "key2", 999, 999},
-}
-
-// ----------------------------------------------------------------------------
-
-var floatTests = []struct {
-	input, key string
-	def, value float64
-}{
-	// valid values
-	{"key = 1.0", "key", 999, 1.0},
-	{"key = 0.0", "key", 999, 0.0},
-	{"key = -1.0", "key", 999, -1.0},
-	{"key = 1", "key", 999, 1},
-	{"key = 0", "key", 999, 0},
-	{"key = -1", "key", 999, -1},
-	{"key = 0123", "key", 999, 123},
-
-	// invalid values
-	{"key = 0xff", "key", 999, 999},
-	{"key = a", "key", 999, 999},
-
-	// non existent key
-	{"key = 1", "key2", 999, 999},
-}
-
-// ----------------------------------------------------------------------------
-
-var int64Tests = []struct {
-	input, key string
-	def, value int64
-}{
-	// valid values
-	{"key = 1", "key", 999, 1},
-	{"key = 0", "key", 999, 0},
-	{"key = -1", "key", 999, -1},
-	{"key = 0123", "key", 999, 123},
-
-	// invalid values
-	{"key = 0xff", "key", 999, 999},
-	{"key = 1.0", "key", 999, 999},
-	{"key = a", "key", 999, 999},
-
-	// non existent key
-	{"key = 1", "key2", 999, 999},
-}
-
-// ----------------------------------------------------------------------------
-
-var uint64Tests = []struct {
-	input, key string
-	def, value uint64
-}{
-	// valid values
-	{"key = 1", "key", 999, 1},
-	{"key = 0", "key", 999, 0},
-	{"key = 0123", "key", 999, 123},
-
-	// invalid values
-	{"key = -1", "key", 999, 999},
-	{"key = 0xff", "key", 999, 999},
-	{"key = 1.0", "key", 999, 999},
-	{"key = a", "key", 999, 999},
-
-	// non existent key
-	{"key = 1", "key2", 999, 999},
-}
-
-// ----------------------------------------------------------------------------
-
-var stringTests = []struct {
-	input, key string
-	def, value string
-}{
-	// valid values
-	{"key = abc", "key", "def", "abc"},
-
-	// non existent key
-	{"key = abc", "key2", "def", "def"},
-}
-
-// ----------------------------------------------------------------------------
-
-var keysTests = []struct {
-	input string
-	keys  []string
-}{
-	{"", []string{}},
-	{"key = abc", []string{"key"}},
-	{"key = abc\nkey2=def", []string{"key", "key2"}},
-	{"key2 = abc\nkey=def", []string{"key2", "key"}},
-	{"key = abc\nkey=def", []string{"key"}},
-}
-
-// ----------------------------------------------------------------------------
-
-var filterTests = []struct {
-	input   string
-	pattern string
-	keys    []string
-	err     string
-}{
-	{"", "", []string{}, ""},
-	{"", "abc", []string{}, ""},
-	{"key=value", "", []string{"key"}, ""},
-	{"key=value", "key=", []string{}, ""},
-	{"key=value\nfoo=bar", "", []string{"foo", "key"}, ""},
-	{"key=value\nfoo=bar", "f", []string{"foo"}, ""},
-	{"key=value\nfoo=bar", "fo", []string{"foo"}, ""},
-	{"key=value\nfoo=bar", "foo", []string{"foo"}, ""},
-	{"key=value\nfoo=bar", "fooo", []string{}, ""},
-	{"key=value\nkey2=value2\nfoo=bar", "ey", []string{"key", "key2"}, ""},
-	{"key=value\nkey2=value2\nfoo=bar", "key", []string{"key", "key2"}, ""},
-	{"key=value\nkey2=value2\nfoo=bar", "^key", []string{"key", "key2"}, ""},
-	{"key=value\nkey2=value2\nfoo=bar", "^(key|foo)", []string{"foo", "key", "key2"}, ""},
-	{"key=value\nkey2=value2\nfoo=bar", "[ abc", nil, "error parsing regexp.*"},
-}
-
-// ----------------------------------------------------------------------------
-
-var filterPrefixTests = []struct {
-	input  string
-	prefix string
-	keys   []string
-}{
-	{"", "", []string{}},
-	{"", "abc", []string{}},
-	{"key=value", "", []string{"key"}},
-	{"key=value", "key=", []string{}},
-	{"key=value\nfoo=bar", "", []string{"foo", "key"}},
-	{"key=value\nfoo=bar", "f", []string{"foo"}},
-	{"key=value\nfoo=bar", "fo", []string{"foo"}},
-	{"key=value\nfoo=bar", "foo", []string{"foo"}},
-	{"key=value\nfoo=bar", "fooo", []string{}},
-	{"key=value\nkey2=value2\nfoo=bar", "key", []string{"key", "key2"}},
-}
-
-// ----------------------------------------------------------------------------
-
-var setTests = []struct {
-	input      string
-	key, value string
-	prev       string
-	ok         bool
-	err        string
-	keys       []string
-}{
-	{"", "", "", "", false, "", []string{}},
-	{"", "key", "value", "", false, "", []string{"key"}},
-	{"key=value", "key2", "value2", "", false, "", []string{"key", "key2"}},
-	{"key=value", "abc", "value3", "", false, "", []string{"key", "abc"}},
-	{"key=value", "key", "value3", "value", true, "", []string{"key"}},
-}
-
-// ----------------------------------------------------------------------------
-
-// TestBasic tests basic single key/value combinations with all possible
-// whitespace, delimiter and newline permutations.
-func (s *TestSuite) TestBasic(c *C) {
-	testWhitespaceAndDelimiterCombinations(c, "key", "")
-	testWhitespaceAndDelimiterCombinations(c, "key", "value")
-	testWhitespaceAndDelimiterCombinations(c, "key", "value   ")
-}
-
-func (s *TestSuite) TestComplex(c *C) {
-	for _, test := range complexTests {
-		testKeyValue(c, test[0], test[1:]...)
-	}
-}
-
-func (s *TestSuite) TestErrors(c *C) {
-	for _, test := range errorTests {
-		_, err := Load([]byte(test.input), ISO_8859_1)
-		c.Assert(err, NotNil)
-		c.Assert(strings.Contains(err.Error(), test.msg), Equals, true, Commentf("Expected %q got %q", test.msg, err.Error()))
-	}
-}
-
-func (s *TestSuite) TestMustGet(c *C) {
-	input := "key = value\nkey2 = ghi"
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGet("key"), Equals, "value")
-	c.Assert(func() { p.MustGet("invalid") }, PanicMatches, "unknown property: invalid")
-}
-
-func (s *TestSuite) TestGetBool(c *C) {
-	for _, test := range boolTests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.Len(), Equals, 1)
-		c.Assert(p.GetBool(test.key, test.def), Equals, test.value)
-	}
-}
-
-func (s *TestSuite) TestMustGetBool(c *C) {
-	input := "key = true\nkey2 = ghi"
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetBool("key"), Equals, true)
-	c.Assert(func() { p.MustGetBool("invalid") }, PanicMatches, "unknown property: invalid")
-}
-
-func (s *TestSuite) TestGetDuration(c *C) {
-	for _, test := range durationTests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.Len(), Equals, 1)
-		c.Assert(p.GetDuration(test.key, test.def), Equals, test.value)
-	}
-}
-
-func (s *TestSuite) TestMustGetDuration(c *C) {
-	input := "key = 123\nkey2 = ghi"
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetDuration("key"), Equals, time.Duration(123))
-	c.Assert(func() { p.MustGetDuration("key2") }, PanicMatches, "strconv.ParseInt: parsing.*")
-	c.Assert(func() { p.MustGetDuration("invalid") }, PanicMatches, "unknown property: invalid")
-}
-
-func (s *TestSuite) TestGetParsedDuration(c *C) {
-	for _, test := range parsedDurationTests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.Len(), Equals, 1)
-		c.Assert(p.GetParsedDuration(test.key, test.def), Equals, test.value)
-	}
-}
-
-func (s *TestSuite) TestMustGetParsedDuration(c *C) {
-	input := "key = 123ms\nkey2 = ghi"
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetParsedDuration("key"), Equals, 123*time.Millisecond)
-	c.Assert(func() { p.MustGetParsedDuration("key2") }, PanicMatches, "time: invalid duration ghi")
-	c.Assert(func() { p.MustGetParsedDuration("invalid") }, PanicMatches, "unknown property: invalid")
-}
-
-func (s *TestSuite) TestGetFloat64(c *C) {
-	for _, test := range floatTests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.Len(), Equals, 1)
-		c.Assert(p.GetFloat64(test.key, test.def), Equals, test.value)
-	}
-}
-
-func (s *TestSuite) TestMustGetFloat64(c *C) {
-	input := "key = 123\nkey2 = ghi"
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetFloat64("key"), Equals, float64(123))
-	c.Assert(func() { p.MustGetFloat64("key2") }, PanicMatches, "strconv.ParseFloat: parsing.*")
-	c.Assert(func() { p.MustGetFloat64("invalid") }, PanicMatches, "unknown property: invalid")
-}
-
-func (s *TestSuite) TestGetInt(c *C) {
-	for _, test := range int64Tests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.Len(), Equals, 1)
-		c.Assert(p.GetInt(test.key, int(test.def)), Equals, int(test.value))
-	}
-}
-
-func (s *TestSuite) TestMustGetInt(c *C) {
-	input := "key = 123\nkey2 = ghi"
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetInt("key"), Equals, int(123))
-	c.Assert(func() { p.MustGetInt("key2") }, PanicMatches, "strconv.ParseInt: parsing.*")
-	c.Assert(func() { p.MustGetInt("invalid") }, PanicMatches, "unknown property: invalid")
-}
-
-func (s *TestSuite) TestGetInt64(c *C) {
-	for _, test := range int64Tests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.Len(), Equals, 1)
-		c.Assert(p.GetInt64(test.key, test.def), Equals, test.value)
-	}
-}
-
-func (s *TestSuite) TestMustGetInt64(c *C) {
-	input := "key = 123\nkey2 = ghi"
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetInt64("key"), Equals, int64(123))
-	c.Assert(func() { p.MustGetInt64("key2") }, PanicMatches, "strconv.ParseInt: parsing.*")
-	c.Assert(func() { p.MustGetInt64("invalid") }, PanicMatches, "unknown property: invalid")
-}
-
-func (s *TestSuite) TestGetUint(c *C) {
-	for _, test := range uint64Tests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.Len(), Equals, 1)
-		c.Assert(p.GetUint(test.key, uint(test.def)), Equals, uint(test.value))
-	}
-}
-
-func (s *TestSuite) TestMustGetUint(c *C) {
-	input := "key = 123\nkey2 = ghi"
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetUint("key"), Equals, uint(123))
-	c.Assert(func() { p.MustGetUint64("key2") }, PanicMatches, "strconv.ParseUint: parsing.*")
-	c.Assert(func() { p.MustGetUint64("invalid") }, PanicMatches, "unknown property: invalid")
-}
-
-func (s *TestSuite) TestGetUint64(c *C) {
-	for _, test := range uint64Tests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.Len(), Equals, 1)
-		c.Assert(p.GetUint64(test.key, test.def), Equals, test.value)
-	}
-}
-
-func (s *TestSuite) TestMustGetUint64(c *C) {
-	input := "key = 123\nkey2 = ghi"
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetUint64("key"), Equals, uint64(123))
-	c.Assert(func() { p.MustGetUint64("key2") }, PanicMatches, "strconv.ParseUint: parsing.*")
-	c.Assert(func() { p.MustGetUint64("invalid") }, PanicMatches, "unknown property: invalid")
-}
-
-func (s *TestSuite) TestGetString(c *C) {
-	for _, test := range stringTests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.Len(), Equals, 1)
-		c.Assert(p.GetString(test.key, test.def), Equals, test.value)
-	}
-}
-
-func (s *TestSuite) TestMustGetString(c *C) {
-	input := `key = value`
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetString("key"), Equals, "value")
-	c.Assert(func() { p.MustGetString("invalid") }, PanicMatches, "unknown property: invalid")
-}
-
-func (s *TestSuite) TestComment(c *C) {
-	for _, test := range commentTests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.MustGetString(test.key), Equals, test.value)
-		c.Assert(p.GetComments(test.key), DeepEquals, test.comments)
-		if test.comments != nil {
-			c.Assert(p.GetComment(test.key), Equals, test.comments[len(test.comments)-1])
-		} else {
-			c.Assert(p.GetComment(test.key), Equals, "")
-		}
-
-		// test setting comments
-		if len(test.comments) > 0 {
-			// set single comment
-			p.ClearComments()
-			c.Assert(len(p.c), Equals, 0)
-			p.SetComment(test.key, test.comments[0])
-			c.Assert(p.GetComment(test.key), Equals, test.comments[0])
-
-			// set multiple comments
-			p.ClearComments()
-			c.Assert(len(p.c), Equals, 0)
-			p.SetComments(test.key, test.comments)
-			c.Assert(p.GetComments(test.key), DeepEquals, test.comments)
-
-			// clear comments for a key
-			p.SetComments(test.key, nil)
-			c.Assert(p.GetComment(test.key), Equals, "")
-			c.Assert(p.GetComments(test.key), IsNil)
-		}
-	}
-}
-
-func (s *TestSuite) TestFilter(c *C) {
-	for _, test := range filterTests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		pp, err := p.Filter(test.pattern)
-		if err != nil {
-			c.Assert(err, ErrorMatches, test.err)
-			continue
-		}
-		c.Assert(pp, NotNil)
-		c.Assert(pp.Len(), Equals, len(test.keys))
-		for _, key := range test.keys {
-			v1, ok1 := p.Get(key)
-			v2, ok2 := pp.Get(key)
-			c.Assert(ok1, Equals, true)
-			c.Assert(ok2, Equals, true)
-			c.Assert(v1, Equals, v2)
-		}
-	}
-}
-
-func (s *TestSuite) TestFilterPrefix(c *C) {
-	for _, test := range filterPrefixTests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		pp := p.FilterPrefix(test.prefix)
-		c.Assert(pp, NotNil)
-		c.Assert(pp.Len(), Equals, len(test.keys))
-		for _, key := range test.keys {
-			v1, ok1 := p.Get(key)
-			v2, ok2 := pp.Get(key)
-			c.Assert(ok1, Equals, true)
-			c.Assert(ok2, Equals, true)
-			c.Assert(v1, Equals, v2)
-		}
-	}
-}
-
-func (s *TestSuite) TestKeys(c *C) {
-	for _, test := range keysTests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		c.Assert(p.Len(), Equals, len(test.keys))
-		c.Assert(len(p.Keys()), Equals, len(test.keys))
-		c.Assert(p.Keys(), DeepEquals, test.keys)
-	}
-}
-
-func (s *TestSuite) TestSet(c *C) {
-	for _, test := range setTests {
-		p, err := parse(test.input)
-		c.Assert(err, IsNil)
-		prev, ok, err := p.Set(test.key, test.value)
-		if test.err != "" {
-			c.Assert(err, ErrorMatches, test.err)
-			continue
-		}
-
-		c.Assert(err, IsNil)
-		c.Assert(ok, Equals, test.ok)
-		if ok {
-			c.Assert(prev, Equals, test.prev)
-		}
-		c.Assert(p.Keys(), DeepEquals, test.keys)
-	}
-}
-
-func (s *TestSuite) TestMustSet(c *C) {
-	input := "key=${key}"
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(func() { p.MustSet("key", "${key}") }, PanicMatches, "circular reference .*")
-}
-
-func (s *TestSuite) TestWrite(c *C) {
-	for _, test := range writeTests {
-		p, err := parse(test.input)
-
-		buf := new(bytes.Buffer)
-		var n int
-		switch test.encoding {
-		case "UTF-8":
-			n, err = p.Write(buf, UTF8)
-		case "ISO-8859-1":
-			n, err = p.Write(buf, ISO_8859_1)
-		}
-		c.Assert(err, IsNil)
-		s := string(buf.Bytes())
-		c.Assert(n, Equals, len(test.output), Commentf("input=%q expected=%q obtained=%q", test.input, test.output, s))
-		c.Assert(s, Equals, test.output, Commentf("input=%q expected=%q obtained=%q", test.input, test.output, s))
-	}
-}
-
-func (s *TestSuite) TestWriteComment(c *C) {
-	for _, test := range writeCommentTests {
-		p, err := parse(test.input)
-
-		buf := new(bytes.Buffer)
-		var n int
-		switch test.encoding {
-		case "UTF-8":
-			n, err = p.WriteComment(buf, "# ", UTF8)
-		case "ISO-8859-1":
-			n, err = p.WriteComment(buf, "# ", ISO_8859_1)
-		}
-		c.Assert(err, IsNil)
-		s := string(buf.Bytes())
-		c.Assert(n, Equals, len(test.output), Commentf("input=%q expected=%q obtained=%q", test.input, test.output, s))
-		c.Assert(s, Equals, test.output, Commentf("input=%q expected=%q obtained=%q", test.input, test.output, s))
-	}
-}
-
-func (s *TestSuite) TestCustomExpansionExpression(c *C) {
-	testKeyValuePrePostfix(c, "*[", "]*", "key=value\nkey2=*[key]*", "key", "value", "key2", "value")
-}
-
-func (s *TestSuite) TestPanicOn32BitIntOverflow(c *C) {
-	is32Bit = true
-	var min, max int64 = math.MinInt32 - 1, math.MaxInt32 + 1
-	input := fmt.Sprintf("min=%d\nmax=%d", min, max)
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetInt64("min"), Equals, min)
-	c.Assert(p.MustGetInt64("max"), Equals, max)
-	c.Assert(func() { p.MustGetInt("min") }, PanicMatches, ".* out of range")
-	c.Assert(func() { p.MustGetInt("max") }, PanicMatches, ".* out of range")
-}
-
-func (s *TestSuite) TestPanicOn32BitUintOverflow(c *C) {
-	is32Bit = true
-	var max = math.MaxUint32 + 1
-	input := fmt.Sprintf("max=%d", max)
-	p, err := parse(input)
-	c.Assert(err, IsNil)
-	c.Assert(p.MustGetUint64("max"), Equals, uint64(max))
-	c.Assert(func() { p.MustGetUint("max") }, PanicMatches, ".* out of range")
-}
-
-// ----------------------------------------------------------------------------
-
-// tests all combinations of delimiters, leading and/or trailing whitespace and newlines.
-func testWhitespaceAndDelimiterCombinations(c *C, key, value string) {
-	whitespace := []string{"", " ", "\f", "\t"}
-	delimiters := []string{"", " ", "=", ":"}
-	newlines := []string{"", "\r", "\n", "\r\n"}
-	for _, dl := range delimiters {
-		for _, ws1 := range whitespace {
-			for _, ws2 := range whitespace {
-				for _, nl := range newlines {
-					// skip the one case where there is nothing between a key and a value
-					if ws1 == "" && dl == "" && ws2 == "" && value != "" {
-						continue
-					}
-
-					input := fmt.Sprintf("%s%s%s%s%s%s", key, ws1, dl, ws2, value, nl)
-					testKeyValue(c, input, key, value)
-				}
-			}
-		}
-	}
-}
-
-// tests whether key/value pairs exist for a given input.
-// keyvalues is expected to be an even number of strings of "key", "value", ...
-func testKeyValue(c *C, input string, keyvalues ...string) {
-	testKeyValuePrePostfix(c, "${", "}", input, keyvalues...)
-}
-
-// tests whether key/value pairs exist for a given input.
-// keyvalues is expected to be an even number of strings of "key", "value", ...
-func testKeyValuePrePostfix(c *C, prefix, postfix, input string, keyvalues ...string) {
-	printf("%q\n", input)
-
-	p, err := Load([]byte(input), ISO_8859_1)
-	c.Assert(err, IsNil)
-	p.Prefix = prefix
-	p.Postfix = postfix
-	assertKeyValues(c, input, p, keyvalues...)
-}
-
-// tests whether key/value pairs exist for a given input.
-// keyvalues is expected to be an even number of strings of "key", "value", ...
-func assertKeyValues(c *C, input string, p *Properties, keyvalues ...string) {
-	c.Assert(p, NotNil)
-	c.Assert(2*p.Len(), Equals, len(keyvalues), Commentf("Odd number of key/value pairs."))
-
-	for i := 0; i < len(keyvalues); i += 2 {
-		key, value := keyvalues[i], keyvalues[i+1]
-		v, ok := p.Get(key)
-		c.Assert(ok, Equals, true, Commentf("No key %q found (input=%q)", key, input))
-		c.Assert(v, Equals, value, Commentf("Value %q does not match %q (input=%q)", v, value, input))
-	}
-}
-
-// prints to stderr if the -verbose flag was given.
-func printf(format string, args ...interface{}) {
-	if *verbose {
-		fmt.Fprintf(os.Stderr, format, args...)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/rangecheck.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/rangecheck.go b/Godeps/_workspace/src/github.com/magiconair/properties/rangecheck.go
deleted file mode 100644
index 6df4e6c..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/rangecheck.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2013-2014 Frank Schroeder. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package properties
-
-import (
-	"fmt"
-	"math"
-)
-
-// make this a var to overwrite it in a test
-var is32Bit = ^uint(0) == math.MaxUint32
-
-// intRangeCheck checks if the value fits into the int type and
-// panics if it does not.
-func intRangeCheck(key string, v int64) int {
-	if is32Bit && (v < math.MinInt32 || v > math.MaxInt32) {
-		panic(fmt.Sprintf("Value %d for key %s out of range", v, key))
-	}
-	return int(v)
-}
-
-// uintRangeCheck checks if the value fits into the uint type and
-// panics if it does not.
-func uintRangeCheck(key string, v uint64) uint {
-	if is32Bit && v > math.MaxUint32 {
-		panic(fmt.Sprintf("Value %d for key %s out of range", v, key))
-	}
-	return uint(v)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.gitignore b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.gitignore
deleted file mode 100644
index bf90dfd..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.db
-*.exe
-*.dll

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.travis.yml
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.travis.yml b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.travis.yml
deleted file mode 100644
index ac7bfea..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.travis.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-language: go
-go:
-  - tip
-before_install:
-  - go get github.com/axw/gocov/gocov
-  - go get github.com/mattn/goveralls
-  - go get golang.org/x/tools/cmd/cover
-script:
-    - $HOME/gopath/bin/goveralls -repotoken 3qJVUE0iQwqnCbmNcDsjYu1nh4J4KIFXx

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/LICENSE b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/LICENSE
deleted file mode 100644
index ca458bb..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Yasuhiro Matsumoto
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/README.md b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/README.md
deleted file mode 100644
index 4383f0c..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/README.md
+++ /dev/null
@@ -1,62 +0,0 @@
-go-sqlite3
-==========
-
-[![Build Status](https://travis-ci.org/mattn/go-sqlite3.png?branch=master)](https://travis-ci.org/mattn/go-sqlite3)
-[![Coverage Status](https://coveralls.io/repos/mattn/go-sqlite3/badge.png?branch=master)](https://coveralls.io/r/mattn/go-sqlite3?branch=master)
-
-Description
------------
-
-sqlite3 driver conforming to the built-in database/sql interface
-
-Installation
-------------
-
-This package can be installed with the go get command:
-
-    go get github.com/mattn/go-sqlite3
-    
-Documentation
--------------
-
-API documentation can be found here: http://godoc.org/github.com/mattn/go-sqlite3
-
-Examples can be found under the `./_example` directory
-
-FAQ
----
-
-* Can't build go-sqlite3 on windows 64bit.
-
-    > Probably, you are using go 1.0, go1.0 has a problem when it comes to compiling/linking on windows 64bit. 
-    > See: https://github.com/mattn/go-sqlite3/issues/27
-
-* Getting insert error while query is opened.
-
-    > You can pass some arguments into the connection string, for example, a URI.
-    > See: https://github.com/mattn/go-sqlite3/issues/39
-
-* Do you want cross compiling? mingw on Linux or Mac?
-
-    > See: https://github.com/mattn/go-sqlite3/issues/106
-    > See also: http://www.limitlessfx.com/cross-compile-golang-app-for-windows-from-linux.html
-
-* Want to get time.Time with current locale
-
-    Use `loc=auto` in SQLite3 filename schema like `file:foo.db?loc=auto`.
-
-License
--------
-
-MIT: http://mattn.mit-license.org/2012
-
-sqlite3-binding.c, sqlite3-binding.h, sqlite3ext.h
-
-The -binding suffix was added to avoid build failures under gccgo.
-
-In this repository, those files are amalgamation code that copied from SQLite3. The license of those codes are depend on the license of SQLite3.
-
-Author
-------
-
-Yasuhiro Matsumoto (a.k.a mattn)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/backup.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/backup.go b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/backup.go
deleted file mode 100644
index 3807c60..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/backup.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package sqlite3
-
-/*
-#include <sqlite3-binding.h>
-#include <stdlib.h>
-*/
-import "C"
-import (
-	"runtime"
-	"unsafe"
-)
-
-type SQLiteBackup struct {
-	b *C.sqlite3_backup
-}
-
-func (c *SQLiteConn) Backup(dest string, conn *SQLiteConn, src string) (*SQLiteBackup, error) {
-	destptr := C.CString(dest)
-	defer C.free(unsafe.Pointer(destptr))
-	srcptr := C.CString(src)
-	defer C.free(unsafe.Pointer(srcptr))
-
-	if b := C.sqlite3_backup_init(c.db, destptr, conn.db, srcptr); b != nil {
-		bb := &SQLiteBackup{b: b}
-		runtime.SetFinalizer(bb, (*SQLiteBackup).Finish)
-		return bb, nil
-	}
-	return nil, c.lastError()
-}
-
-// Backs up for one step. Calls the underlying `sqlite3_backup_step` function.
-// This function returns a boolean indicating if the backup is done and
-// an error signalling any other error. Done is returned if the underlying C
-// function returns SQLITE_DONE (Code 101)
-func (b *SQLiteBackup) Step(p int) (bool, error) {
-	ret := C.sqlite3_backup_step(b.b, C.int(p))
-	if ret == C.SQLITE_DONE {
-		return true, nil
-	} else if ret != 0 && ret != C.SQLITE_LOCKED && ret != C.SQLITE_BUSY {
-		return false, Error{Code: ErrNo(ret)}
-	}
-	return false, nil
-}
-
-func (b *SQLiteBackup) Remaining() int {
-	return int(C.sqlite3_backup_remaining(b.b))
-}
-
-func (b *SQLiteBackup) PageCount() int {
-	return int(C.sqlite3_backup_pagecount(b.b))
-}
-
-func (b *SQLiteBackup) Finish() error {
-	return b.Close()
-}
-
-func (b *SQLiteBackup) Close() error {
-	ret := C.sqlite3_backup_finish(b.b)
-	if ret != 0 {
-		return Error{Code: ErrNo(ret)}
-	}
-	b.b = nil
-	runtime.SetFinalizer(b, nil)
-	return nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/doc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/doc.go b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/doc.go
deleted file mode 100644
index 51364c3..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/doc.go
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-Package sqlite3 provides interface to SQLite3 databases.
-
-This works as driver for database/sql.
-
-Installation
-
-    go get github.com/mattn/go-sqlite3
-
-Supported Types
-
-Currently, go-sqlite3 support following data types.
-
-    +------------------------------+
-    |go        | sqlite3           |
-    |----------|-------------------|
-    |nil       | null              |
-    |int       | integer           |
-    |int64     | integer           |
-    |float64   | float             |
-    |bool      | integer           |
-    |[]byte    | blob              |
-    |string    | text              |
-    |time.Time | timestamp/datetime|
-    +------------------------------+
-
-SQLite3 Extension
-
-You can write your own extension module for sqlite3. For example, below is a
-extension for Regexp matcher operation.
-
-    #include <pcre.h>
-    #include <string.h>
-    #include <stdio.h>
-    #include <sqlite3ext.h>
-    
-    SQLITE_EXTENSION_INIT1
-    static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) {
-      if (argc >= 2) {
-        const char *target  = (const char *)sqlite3_value_text(argv[1]);
-        const char *pattern = (const char *)sqlite3_value_text(argv[0]);
-        const char* errstr = NULL;
-        int erroff = 0;
-        int vec[500];
-        int n, rc;
-        pcre* re = pcre_compile(pattern, 0, &errstr, &erroff, NULL);
-        rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500); 
-        if (rc <= 0) {
-          sqlite3_result_error(context, errstr, 0);
-          return;
-        }
-        sqlite3_result_int(context, 1);
-      }
-    }
-    
-    #ifdef _WIN32
-    __declspec(dllexport)
-    #endif
-    int sqlite3_extension_init(sqlite3 *db, char **errmsg,
-          const sqlite3_api_routines *api) {
-      SQLITE_EXTENSION_INIT2(api);
-      return sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8,
-          (void*)db, regexp_func, NULL, NULL);
-    }
-
-It need to build as so/dll shared library. And you need to register
-extension module like below.
-
-	sql.Register("sqlite3_with_extensions",
-		&sqlite3.SQLiteDriver{
-			Extensions: []string{
-				"sqlite3_mod_regexp",
-			},
-		})
-
-Then, you can use this extension.
-
-	rows, err := db.Query("select text from mytable where name regexp '^golang'")
-
-Connection Hook
-
-You can hook and inject your codes when connection established. database/sql
-doesn't provide the way to get native go-sqlite3 interfaces. So if you want,
-you need to hook ConnectHook and get the SQLiteConn.
-
-	sql.Register("sqlite3_with_hook_example",
-			&sqlite3.SQLiteDriver{
-					ConnectHook: func(conn *sqlite3.SQLiteConn) error {
-						sqlite3conn = append(sqlite3conn, conn)
-						return nil
-					},
-			})
-
-*/
-package sqlite3

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error.go b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error.go
deleted file mode 100644
index b910108..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error.go
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package sqlite3
-
-import "C"
-
-type ErrNo int
-
-const ErrNoMask C.int = 0xff
-
-type ErrNoExtended int
-
-type Error struct {
-	Code         ErrNo         /* The error code returned by SQLite */
-	ExtendedCode ErrNoExtended /* The extended error code returned by SQLite */
-	err          string        /* The error string returned by sqlite3_errmsg(),
-	this usually contains more specific details. */
-}
-
-// result codes from http://www.sqlite.org/c3ref/c_abort.html
-var (
-	ErrError      = ErrNo(1)  /* SQL error or missing database */
-	ErrInternal   = ErrNo(2)  /* Internal logic error in SQLite */
-	ErrPerm       = ErrNo(3)  /* Access permission denied */
-	ErrAbort      = ErrNo(4)  /* Callback routine requested an abort */
-	ErrBusy       = ErrNo(5)  /* The database file is locked */
-	ErrLocked     = ErrNo(6)  /* A table in the database is locked */
-	ErrNomem      = ErrNo(7)  /* A malloc() failed */
-	ErrReadonly   = ErrNo(8)  /* Attempt to write a readonly database */
-	ErrInterrupt  = ErrNo(9)  /* Operation terminated by sqlite3_interrupt() */
-	ErrIoErr      = ErrNo(10) /* Some kind of disk I/O error occurred */
-	ErrCorrupt    = ErrNo(11) /* The database disk image is malformed */
-	ErrNotFound   = ErrNo(12) /* Unknown opcode in sqlite3_file_control() */
-	ErrFull       = ErrNo(13) /* Insertion failed because database is full */
-	ErrCantOpen   = ErrNo(14) /* Unable to open the database file */
-	ErrProtocol   = ErrNo(15) /* Database lock protocol error */
-	ErrEmpty      = ErrNo(16) /* Database is empty */
-	ErrSchema     = ErrNo(17) /* The database schema changed */
-	ErrTooBig     = ErrNo(18) /* String or BLOB exceeds size limit */
-	ErrConstraint = ErrNo(19) /* Abort due to constraint violation */
-	ErrMismatch   = ErrNo(20) /* Data type mismatch */
-	ErrMisuse     = ErrNo(21) /* Library used incorrectly */
-	ErrNoLFS      = ErrNo(22) /* Uses OS features not supported on host */
-	ErrAuth       = ErrNo(23) /* Authorization denied */
-	ErrFormat     = ErrNo(24) /* Auxiliary database format error */
-	ErrRange      = ErrNo(25) /* 2nd parameter to sqlite3_bind out of range */
-	ErrNotADB     = ErrNo(26) /* File opened that is not a database file */
-	ErrNotice     = ErrNo(27) /* Notifications from sqlite3_log() */
-	ErrWarning    = ErrNo(28) /* Warnings from sqlite3_log() */
-)
-
-func (err ErrNo) Error() string {
-	return Error{Code: err}.Error()
-}
-
-func (err ErrNo) Extend(by int) ErrNoExtended {
-	return ErrNoExtended(int(err) | (by << 8))
-}
-
-func (err ErrNoExtended) Error() string {
-	return Error{Code: ErrNo(C.int(err) & ErrNoMask), ExtendedCode: err}.Error()
-}
-
-func (err Error) Error() string {
-	if err.err != "" {
-		return err.err
-	}
-	return errorString(err)
-}
-
-// result codes from http://www.sqlite.org/c3ref/c_abort_rollback.html
-var (
-	ErrIoErrRead              = ErrIoErr.Extend(1)
-	ErrIoErrShortRead         = ErrIoErr.Extend(2)
-	ErrIoErrWrite             = ErrIoErr.Extend(3)
-	ErrIoErrFsync             = ErrIoErr.Extend(4)
-	ErrIoErrDirFsync          = ErrIoErr.Extend(5)
-	ErrIoErrTruncate          = ErrIoErr.Extend(6)
-	ErrIoErrFstat             = ErrIoErr.Extend(7)
-	ErrIoErrUnlock            = ErrIoErr.Extend(8)
-	ErrIoErrRDlock            = ErrIoErr.Extend(9)
-	ErrIoErrDelete            = ErrIoErr.Extend(10)
-	ErrIoErrBlocked           = ErrIoErr.Extend(11)
-	ErrIoErrNoMem             = ErrIoErr.Extend(12)
-	ErrIoErrAccess            = ErrIoErr.Extend(13)
-	ErrIoErrCheckReservedLock = ErrIoErr.Extend(14)
-	ErrIoErrLock              = ErrIoErr.Extend(15)
-	ErrIoErrClose             = ErrIoErr.Extend(16)
-	ErrIoErrDirClose          = ErrIoErr.Extend(17)
-	ErrIoErrSHMOpen           = ErrIoErr.Extend(18)
-	ErrIoErrSHMSize           = ErrIoErr.Extend(19)
-	ErrIoErrSHMLock           = ErrIoErr.Extend(20)
-	ErrIoErrSHMMap            = ErrIoErr.Extend(21)
-	ErrIoErrSeek              = ErrIoErr.Extend(22)
-	ErrIoErrDeleteNoent       = ErrIoErr.Extend(23)
-	ErrIoErrMMap              = ErrIoErr.Extend(24)
-	ErrIoErrGetTempPath       = ErrIoErr.Extend(25)
-	ErrIoErrConvPath          = ErrIoErr.Extend(26)
-	ErrLockedSharedCache      = ErrLocked.Extend(1)
-	ErrBusyRecovery           = ErrBusy.Extend(1)
-	ErrBusySnapshot           = ErrBusy.Extend(2)
-	ErrCantOpenNoTempDir      = ErrCantOpen.Extend(1)
-	ErrCantOpenIsDir          = ErrCantOpen.Extend(2)
-	ErrCantOpenFullPath       = ErrCantOpen.Extend(3)
-	ErrCantOpenConvPath       = ErrCantOpen.Extend(4)
-	ErrCorruptVTab            = ErrCorrupt.Extend(1)
-	ErrReadonlyRecovery       = ErrReadonly.Extend(1)
-	ErrReadonlyCantLock       = ErrReadonly.Extend(2)
-	ErrReadonlyRollback       = ErrReadonly.Extend(3)
-	ErrReadonlyDbMoved        = ErrReadonly.Extend(4)
-	ErrAbortRollback          = ErrAbort.Extend(2)
-	ErrConstraintCheck        = ErrConstraint.Extend(1)
-	ErrConstraintCommitHook   = ErrConstraint.Extend(2)
-	ErrConstraintForeignKey   = ErrConstraint.Extend(3)
-	ErrConstraintFunction     = ErrConstraint.Extend(4)
-	ErrConstraintNotNull      = ErrConstraint.Extend(5)
-	ErrConstraintPrimaryKey   = ErrConstraint.Extend(6)
-	ErrConstraintTrigger      = ErrConstraint.Extend(7)
-	ErrConstraintUnique       = ErrConstraint.Extend(8)
-	ErrConstraintVTab         = ErrConstraint.Extend(9)
-	ErrConstraintRowId        = ErrConstraint.Extend(10)
-	ErrNoticeRecoverWAL       = ErrNotice.Extend(1)
-	ErrNoticeRecoverRollback  = ErrNotice.Extend(2)
-	ErrWarningAutoIndex       = ErrWarning.Extend(1)
-)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error_test.go b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error_test.go
deleted file mode 100644
index 1ccbe5b..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error_test.go
+++ /dev/null
@@ -1,242 +0,0 @@
-// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package sqlite3
-
-import (
-	"database/sql"
-	"io/ioutil"
-	"os"
-	"path"
-	"testing"
-)
-
-func TestSimpleError(t *testing.T) {
-	e := ErrError.Error()
-	if e != "SQL logic error or missing database" {
-		t.Error("wrong error code:" + e)
-	}
-}
-
-func TestCorruptDbErrors(t *testing.T) {
-	dirName, err := ioutil.TempDir("", "sqlite3")
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer os.RemoveAll(dirName)
-
-	dbFileName := path.Join(dirName, "test.db")
-	f, err := os.Create(dbFileName)
-	if err != nil {
-		t.Error(err)
-	}
-	f.Write([]byte{1, 2, 3, 4, 5})
-	f.Close()
-
-	db, err := sql.Open("sqlite3", dbFileName)
-	if err == nil {
-		_, err = db.Exec("drop table foo")
-	}
-
-	sqliteErr := err.(Error)
-	if sqliteErr.Code != ErrNotADB {
-		t.Error("wrong error code for corrupted DB")
-	}
-	if err.Error() == "" {
-		t.Error("wrong error string for corrupted DB")
-	}
-	db.Close()
-}
-
-func TestSqlLogicErrors(t *testing.T) {
-	dirName, err := ioutil.TempDir("", "sqlite3")
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer os.RemoveAll(dirName)
-
-	dbFileName := path.Join(dirName, "test.db")
-	db, err := sql.Open("sqlite3", dbFileName)
-	if err != nil {
-		t.Error(err)
-	}
-	defer db.Close()
-
-	_, err = db.Exec("CREATE TABLE Foo (id INTEGER PRIMARY KEY)")
-	if err != nil {
-		t.Error(err)
-	}
-
-	const expectedErr = "table Foo already exists"
-	_, err = db.Exec("CREATE TABLE Foo (id INTEGER PRIMARY KEY)")
-	if err.Error() != expectedErr {
-		t.Errorf("Unexpected error: %s, expected %s", err.Error(), expectedErr)
-	}
-
-}
-
-func TestExtendedErrorCodes_ForeignKey(t *testing.T) {
-	dirName, err := ioutil.TempDir("", "sqlite3-err")
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer os.RemoveAll(dirName)
-
-	dbFileName := path.Join(dirName, "test.db")
-	db, err := sql.Open("sqlite3", dbFileName)
-	if err != nil {
-		t.Error(err)
-	}
-	defer db.Close()
-
-	_, err = db.Exec("PRAGMA foreign_keys=ON;")
-	if err != nil {
-		t.Errorf("PRAGMA foreign_keys=ON: %v", err)
-	}
-
-	_, err = db.Exec(`CREATE TABLE Foo (
-		id INTEGER PRIMARY KEY AUTOINCREMENT,
-		value INTEGER NOT NULL,
-		ref INTEGER NULL REFERENCES Foo (id),
-		UNIQUE(value)
-	);`)
-	if err != nil {
-		t.Error(err)
-	}
-
-	_, err = db.Exec("INSERT INTO Foo (ref, value) VALUES (100, 100);")
-	if err == nil {
-		t.Error("No error!")
-	} else {
-		sqliteErr := err.(Error)
-		if sqliteErr.Code != ErrConstraint {
-			t.Errorf("Wrong basic error code: %d != %d",
-				sqliteErr.Code, ErrConstraint)
-		}
-		if sqliteErr.ExtendedCode != ErrConstraintForeignKey {
-			t.Errorf("Wrong extended error code: %d != %d",
-				sqliteErr.ExtendedCode, ErrConstraintForeignKey)
-		}
-	}
-
-}
-
-func TestExtendedErrorCodes_NotNull(t *testing.T) {
-	dirName, err := ioutil.TempDir("", "sqlite3-err")
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer os.RemoveAll(dirName)
-
-	dbFileName := path.Join(dirName, "test.db")
-	db, err := sql.Open("sqlite3", dbFileName)
-	if err != nil {
-		t.Error(err)
-	}
-	defer db.Close()
-
-	_, err = db.Exec("PRAGMA foreign_keys=ON;")
-	if err != nil {
-		t.Errorf("PRAGMA foreign_keys=ON: %v", err)
-	}
-
-	_, err = db.Exec(`CREATE TABLE Foo (
-		id INTEGER PRIMARY KEY AUTOINCREMENT,
-		value INTEGER NOT NULL,
-		ref INTEGER NULL REFERENCES Foo (id),
-		UNIQUE(value)
-	);`)
-	if err != nil {
-		t.Error(err)
-	}
-
-	res, err := db.Exec("INSERT INTO Foo (value) VALUES (100);")
-	if err != nil {
-		t.Fatalf("Creating first row: %v", err)
-	}
-
-	id, err := res.LastInsertId()
-	if err != nil {
-		t.Fatalf("Retrieving last insert id: %v", err)
-	}
-
-	_, err = db.Exec("INSERT INTO Foo (ref) VALUES (?);", id)
-	if err == nil {
-		t.Error("No error!")
-	} else {
-		sqliteErr := err.(Error)
-		if sqliteErr.Code != ErrConstraint {
-			t.Errorf("Wrong basic error code: %d != %d",
-				sqliteErr.Code, ErrConstraint)
-		}
-		if sqliteErr.ExtendedCode != ErrConstraintNotNull {
-			t.Errorf("Wrong extended error code: %d != %d",
-				sqliteErr.ExtendedCode, ErrConstraintNotNull)
-		}
-	}
-
-}
-
-func TestExtendedErrorCodes_Unique(t *testing.T) {
-	dirName, err := ioutil.TempDir("", "sqlite3-err")
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer os.RemoveAll(dirName)
-
-	dbFileName := path.Join(dirName, "test.db")
-	db, err := sql.Open("sqlite3", dbFileName)
-	if err != nil {
-		t.Error(err)
-	}
-	defer db.Close()
-
-	_, err = db.Exec("PRAGMA foreign_keys=ON;")
-	if err != nil {
-		t.Errorf("PRAGMA foreign_keys=ON: %v", err)
-	}
-
-	_, err = db.Exec(`CREATE TABLE Foo (
-		id INTEGER PRIMARY KEY AUTOINCREMENT,
-		value INTEGER NOT NULL,
-		ref INTEGER NULL REFERENCES Foo (id),
-		UNIQUE(value)
-	);`)
-	if err != nil {
-		t.Error(err)
-	}
-
-	res, err := db.Exec("INSERT INTO Foo (value) VALUES (100);")
-	if err != nil {
-		t.Fatalf("Creating first row: %v", err)
-	}
-
-	id, err := res.LastInsertId()
-	if err != nil {
-		t.Fatalf("Retrieving last insert id: %v", err)
-	}
-
-	_, err = db.Exec("INSERT INTO Foo (ref, value) VALUES (?, 100);", id)
-	if err == nil {
-		t.Error("No error!")
-	} else {
-		sqliteErr := err.(Error)
-		if sqliteErr.Code != ErrConstraint {
-			t.Errorf("Wrong basic error code: %d != %d",
-				sqliteErr.Code, ErrConstraint)
-		}
-		if sqliteErr.ExtendedCode != ErrConstraintUnique {
-			t.Errorf("Wrong extended error code: %d != %d",
-				sqliteErr.ExtendedCode, ErrConstraintUnique)
-		}
-		extended := sqliteErr.Code.Extend(3).Error()
-		expected := "constraint failed"
-		if extended != expected {
-			t.Errorf("Wrong basic error code: %q != %q",
-				extended, expected)
-		}
-	}
-
-}


[10/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/command.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/command.go b/newt/Godeps/_workspace/src/github.com/spf13/cobra/command.go
new file mode 100644
index 0000000..141cfab
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/command.go
@@ -0,0 +1,1032 @@
+// Copyright © 2013 Steve Francia <sp...@spf13.com>.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
+//In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code.
+package cobra
+
+import (
+	"bytes"
+	"fmt"
+	"io"
+	"os"
+	"runtime"
+	"strings"
+	"time"
+
+	"github.com/inconshreveable/mousetrap"
+	flag "github.com/spf13/pflag"
+)
+
+// Command is just that, a command for your application.
+// eg.  'go run' ... 'run' is the command. Cobra requires
+// you to define the usage and description as part of your command
+// definition to ensure usability.
+type Command struct {
+	// Name is the command name, usually the executable's name.
+	name string
+	// The one-line usage message.
+	Use string
+	// An array of aliases that can be used instead of the first word in Use.
+	Aliases []string
+	// The short description shown in the 'help' output.
+	Short string
+	// The long message shown in the 'help <this-command>' output.
+	Long string
+	// Examples of how to use the command
+	Example string
+	// List of all valid non-flag arguments, used for bash completions *TODO* actually validate these
+	ValidArgs []string
+	// Custom functions used by the bash autocompletion generator
+	BashCompletionFunction string
+	// Is this command deprecated and should print this string when used?
+	Deprecated string
+	// Full set of flags
+	flags *flag.FlagSet
+	// Set of flags childrens of this command will inherit
+	pflags *flag.FlagSet
+	// Flags that are declared specifically by this command (not inherited).
+	lflags *flag.FlagSet
+	// The *Run functions are executed in the following order:
+	//   * PersistentPreRun()
+	//   * PreRun()
+	//   * Run()
+	//   * PostRun()
+	//   * PersistentPostRun()
+	// All functions get the same args, the arguments after the command name
+	// PersistentPreRun: children of this command will inherit and execute
+	PersistentPreRun func(cmd *Command, args []string)
+	// PreRun: children of this command will not inherit.
+	PreRun func(cmd *Command, args []string)
+	// Run: Typically the actual work function. Most commands will only implement this
+	Run func(cmd *Command, args []string)
+	// PostRun: run after the Run command.
+	PostRun func(cmd *Command, args []string)
+	// PersistentPostRun: children of this command will inherit and execute after PostRun
+	PersistentPostRun func(cmd *Command, args []string)
+	// Commands is the list of commands supported by this program.
+	commands []*Command
+	// Parent Command for this command
+	parent *Command
+	// max lengths of commands' string lengths for use in padding
+	commandsMaxUseLen         int
+	commandsMaxCommandPathLen int
+	commandsMaxNameLen        int
+
+	flagErrorBuf *bytes.Buffer
+	cmdErrorBuf  *bytes.Buffer
+
+	args          []string                 // actual args parsed from flags
+	output        *io.Writer               // nil means stderr; use Out() method instead
+	usageFunc     func(*Command) error     // Usage can be defined by application
+	usageTemplate string                   // Can be defined by Application
+	helpTemplate  string                   // Can be defined by Application
+	helpFunc      func(*Command, []string) // Help can be defined by application
+	helpCommand   *Command                 // The help command
+	helpFlagVal   bool
+	// The global normalization function that we can use on every pFlag set and children commands
+	globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName
+}
+
+// os.Args[1:] by default, if desired, can be overridden
+// particularly useful when testing.
+func (c *Command) SetArgs(a []string) {
+	c.args = a
+}
+
+func (c *Command) getOut(def io.Writer) io.Writer {
+	if c.output != nil {
+		return *c.output
+	}
+
+	if c.HasParent() {
+		return c.parent.Out()
+	} else {
+		return def
+	}
+}
+
+func (c *Command) Out() io.Writer {
+	return c.getOut(os.Stderr)
+}
+
+func (c *Command) getOutOrStdout() io.Writer {
+	return c.getOut(os.Stdout)
+}
+
+// SetOutput sets the destination for usage and error messages.
+// If output is nil, os.Stderr is used.
+func (c *Command) SetOutput(output io.Writer) {
+	c.output = &output
+}
+
+// Usage can be defined by application
+func (c *Command) SetUsageFunc(f func(*Command) error) {
+	c.usageFunc = f
+}
+
+// Can be defined by Application
+func (c *Command) SetUsageTemplate(s string) {
+	c.usageTemplate = s
+}
+
+// Can be defined by Application
+func (c *Command) SetHelpFunc(f func(*Command, []string)) {
+	c.helpFunc = f
+}
+
+func (c *Command) SetHelpCommand(cmd *Command) {
+	c.helpCommand = cmd
+}
+
+// Can be defined by Application
+func (c *Command) SetHelpTemplate(s string) {
+	c.helpTemplate = s
+}
+
+// SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands.
+// The user should not have a cyclic dependency on commands.
+func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) {
+	c.Flags().SetNormalizeFunc(n)
+	c.PersistentFlags().SetNormalizeFunc(n)
+	c.LocalFlags().SetNormalizeFunc(n)
+	c.globNormFunc = n
+
+	for _, command := range c.commands {
+		command.SetGlobalNormalizationFunc(n)
+	}
+}
+
+func (c *Command) UsageFunc() (f func(*Command) error) {
+	if c.usageFunc != nil {
+		return c.usageFunc
+	}
+
+	if c.HasParent() {
+		return c.parent.UsageFunc()
+	} else {
+		return func(c *Command) error {
+			err := tmpl(c.Out(), c.UsageTemplate(), c)
+			return err
+		}
+	}
+}
+func (c *Command) HelpFunc() func(*Command, []string) {
+	if c.helpFunc != nil {
+		return c.helpFunc
+	}
+
+	if c.HasParent() {
+		return c.parent.HelpFunc()
+	} else {
+		return func(c *Command, args []string) {
+			if len(args) == 0 {
+				// Help called without any topic, calling on root
+				c.Root().Help()
+				return
+			}
+
+			cmd, _, e := c.Root().Find(args)
+			if cmd == nil || e != nil {
+				c.Printf("Unknown help topic %#q.", args)
+
+				c.Root().Usage()
+			} else {
+				err := cmd.Help()
+				if err != nil {
+					c.Println(err)
+				}
+			}
+		}
+	}
+}
+
+var minUsagePadding int = 25
+
+func (c *Command) UsagePadding() int {
+	if c.parent == nil || minUsagePadding > c.parent.commandsMaxUseLen {
+		return minUsagePadding
+	} else {
+		return c.parent.commandsMaxUseLen
+	}
+}
+
+var minCommandPathPadding int = 11
+
+//
+func (c *Command) CommandPathPadding() int {
+	if c.parent == nil || minCommandPathPadding > c.parent.commandsMaxCommandPathLen {
+		return minCommandPathPadding
+	} else {
+		return c.parent.commandsMaxCommandPathLen
+	}
+}
+
+var minNamePadding int = 11
+
+func (c *Command) NamePadding() int {
+	if c.parent == nil || minNamePadding > c.parent.commandsMaxNameLen {
+		return minNamePadding
+	} else {
+		return c.parent.commandsMaxNameLen
+	}
+}
+
+func (c *Command) UsageTemplate() string {
+	if c.usageTemplate != "" {
+		return c.usageTemplate
+	}
+
+	if c.HasParent() {
+		return c.parent.UsageTemplate()
+	} else {
+		return `{{ $cmd := . }}
+Usage: {{if .Runnable}}
+  {{.UseLine}}{{if .HasFlags}} [flags]{{end}}{{end}}{{if .HasSubCommands}}
+  {{ .CommandPath}} [command]{{end}}{{if gt .Aliases 0}}
+
+Aliases:
+  {{.NameAndAliases}}
+{{end}}{{if .HasExample}}
+
+Examples:
+{{ .Example }}
+{{end}}{{ if .HasRunnableSubCommands}}
+
+Available Commands: {{range .Commands}}{{if and (.Runnable) (not .Deprecated)}}
+  {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}
+{{end}}
+{{ if .HasLocalFlags}}Flags:
+{{.LocalFlags.FlagUsages}}{{end}}
+{{ if .HasInheritedFlags}}Global Flags:
+{{.InheritedFlags.FlagUsages}}{{end}}{{if or (.HasHelpSubCommands) (.HasRunnableSiblings)}}
+Additional help topics:
+{{if .HasHelpSubCommands}}{{range .Commands}}{{if and (not .Runnable) (not .Deprecated)}} {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasRunnableSiblings }}{{range .Parent.Commands}}{{if and (not .Runnable) (not .Deprecated)}}{{if not (eq .Name $cmd.Name) }}
+  {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{end}}
+{{end}}{{ if .HasSubCommands }}
+Use "{{.Root.Name}} help [command]" for more information about a command.
+{{end}}`
+	}
+}
+
+func (c *Command) HelpTemplate() string {
+	if c.helpTemplate != "" {
+		return c.helpTemplate
+	}
+
+	if c.HasParent() {
+		return c.parent.HelpTemplate()
+	} else {
+		return `{{with or .Long .Short }}{{. | trim}}{{end}}
+{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}
+`
+	}
+}
+
+// Really only used when casting a command to a commander
+func (c *Command) resetChildrensParents() {
+	for _, x := range c.commands {
+		x.parent = c
+	}
+}
+
+// Test if the named flag is a boolean flag.
+func isBooleanFlag(name string, f *flag.FlagSet) bool {
+	flag := f.Lookup(name)
+	if flag == nil {
+		return false
+	}
+	return flag.Value.Type() == "bool"
+}
+
+// Test if the named flag is a boolean flag.
+func isBooleanShortFlag(name string, f *flag.FlagSet) bool {
+	result := false
+	f.VisitAll(func(f *flag.Flag) {
+		if f.Shorthand == name && f.Value.Type() == "bool" {
+			result = true
+		}
+	})
+	return result
+}
+
+func stripFlags(args []string, c *Command) []string {
+	if len(args) < 1 {
+		return args
+	}
+	c.mergePersistentFlags()
+
+	commands := []string{}
+
+	inQuote := false
+	inFlag := false
+	for _, y := range args {
+		if !inQuote {
+			switch {
+			case strings.HasPrefix(y, "\""):
+				inQuote = true
+			case strings.Contains(y, "=\""):
+				inQuote = true
+			case strings.HasPrefix(y, "--") && !strings.Contains(y, "="):
+				// TODO: this isn't quite right, we should really check ahead for 'true' or 'false'
+				inFlag = !isBooleanFlag(y[2:], c.Flags())
+			case strings.HasPrefix(y, "-") && !strings.Contains(y, "=") && len(y) == 2 && !isBooleanShortFlag(y[1:], c.Flags()):
+				inFlag = true
+			case inFlag:
+				inFlag = false
+			case y == "":
+				// strip empty commands, as the go tests expect this to be ok....
+			case !strings.HasPrefix(y, "-"):
+				commands = append(commands, y)
+				inFlag = false
+			}
+		}
+
+		if strings.HasSuffix(y, "\"") && !strings.HasSuffix(y, "\\\"") {
+			inQuote = false
+		}
+	}
+
+	return commands
+}
+
+// argsMinusFirstX removes only the first x from args.  Otherwise, commands that look like
+// openshift admin policy add-role-to-user admin my-user, lose the admin argument (arg[4]).
+func argsMinusFirstX(args []string, x string) []string {
+	for i, y := range args {
+		if x == y {
+			ret := []string{}
+			ret = append(ret, args[:i]...)
+			ret = append(ret, args[i+1:]...)
+			return ret
+		}
+	}
+	return args
+}
+
+// find the target command given the args and command tree
+// Meant to be run on the highest node. Only searches down.
+func (c *Command) Find(args []string) (*Command, []string, error) {
+	if c == nil {
+		return nil, nil, fmt.Errorf("Called find() on a nil Command")
+	}
+
+	// If there are no arguments, return the root command. If the root has no
+	// subcommands, args reflects arguments that should actually be passed to
+	// the root command, so also return the root command.
+	if len(args) == 0 || !c.Root().HasSubCommands() {
+		return c.Root(), args, nil
+	}
+
+	var innerfind func(*Command, []string) (*Command, []string)
+
+	innerfind = func(c *Command, innerArgs []string) (*Command, []string) {
+		if len(innerArgs) > 0 && c.HasSubCommands() {
+			argsWOflags := stripFlags(innerArgs, c)
+			if len(argsWOflags) > 0 {
+				matches := make([]*Command, 0)
+				for _, cmd := range c.commands {
+					if cmd.Name() == argsWOflags[0] || cmd.HasAlias(argsWOflags[0]) { // exact name or alias match
+						return innerfind(cmd, argsMinusFirstX(innerArgs, argsWOflags[0]))
+					} else if EnablePrefixMatching {
+						if strings.HasPrefix(cmd.Name(), argsWOflags[0]) { // prefix match
+							matches = append(matches, cmd)
+						}
+						for _, x := range cmd.Aliases {
+							if strings.HasPrefix(x, argsWOflags[0]) {
+								matches = append(matches, cmd)
+							}
+						}
+					}
+				}
+
+				// only accept a single prefix match - multiple matches would be ambiguous
+				if len(matches) == 1 {
+					return innerfind(matches[0], argsMinusFirstX(innerArgs, argsWOflags[0]))
+				}
+			}
+		}
+
+		return c, innerArgs
+	}
+
+	commandFound, a := innerfind(c, args)
+
+	// If we matched on the root, but we asked for a subcommand, return an error
+	argsWOflags := stripFlags(a, commandFound)
+	if commandFound == c && len(argsWOflags) > 0 {
+		return nil, a, fmt.Errorf("unknown command %q", argsWOflags[0])
+	}
+
+	return commandFound, a, nil
+}
+
+func (c *Command) Root() *Command {
+	var findRoot func(*Command) *Command
+
+	findRoot = func(x *Command) *Command {
+		if x.HasParent() {
+			return findRoot(x.parent)
+		} else {
+			return x
+		}
+	}
+
+	return findRoot(c)
+}
+
+func (c *Command) execute(a []string) (err error) {
+	if c == nil {
+		return fmt.Errorf("Called Execute() on a nil Command")
+	}
+
+	if len(c.Deprecated) > 0 {
+		c.Printf("Command %q is deprecated, %s\n", c.Name(), c.Deprecated)
+	}
+
+	err = c.ParseFlags(a)
+	if err == flag.ErrHelp {
+		c.Help()
+		return nil
+	}
+	if err != nil {
+		// We're writing subcommand usage to root command's error buffer to have it displayed to the user
+		r := c.Root()
+		if r.cmdErrorBuf == nil {
+			r.cmdErrorBuf = new(bytes.Buffer)
+		}
+		// for writing the usage to the buffer we need to switch the output temporarily
+		// since Out() returns root output, you also need to revert that on root
+		out := r.Out()
+		r.SetOutput(r.cmdErrorBuf)
+		c.Usage()
+		r.SetOutput(out)
+		return err
+	}
+	// If help is called, regardless of other flags, we print that.
+	// Print help also if c.Run is nil.
+	if c.helpFlagVal || !c.Runnable() {
+		c.Help()
+		return nil
+	}
+
+	c.preRun()
+	argWoFlags := c.Flags().Args()
+
+	for p := c; p != nil; p = p.Parent() {
+		if p.PersistentPreRun != nil {
+			p.PersistentPreRun(c, argWoFlags)
+			break
+		}
+	}
+	if c.PreRun != nil {
+		c.PreRun(c, argWoFlags)
+	}
+
+	c.Run(c, argWoFlags)
+
+	if c.PostRun != nil {
+		c.PostRun(c, argWoFlags)
+	}
+	for p := c; p != nil; p = p.Parent() {
+		if p.PersistentPostRun != nil {
+			p.PersistentPostRun(c, argWoFlags)
+			break
+		}
+	}
+
+	return nil
+}
+
+func (c *Command) preRun() {
+	for _, x := range initializers {
+		x()
+	}
+}
+
+func (c *Command) errorMsgFromParse() string {
+	s := c.flagErrorBuf.String()
+
+	x := strings.Split(s, "\n")
+
+	if len(x) > 0 {
+		return x[0]
+	} else {
+		return ""
+	}
+}
+
+// Call execute to use the args (os.Args[1:] by default)
+// and run through the command tree finding appropriate matches
+// for commands and then corresponding flags.
+func (c *Command) Execute() (err error) {
+
+	// Regardless of what command execute is called on, run on Root only
+	if c.HasParent() {
+		return c.Root().Execute()
+	}
+
+	if EnableWindowsMouseTrap && runtime.GOOS == "windows" {
+		if mousetrap.StartedByExplorer() {
+			c.Print(MousetrapHelpText)
+			time.Sleep(5 * time.Second)
+			os.Exit(1)
+		}
+	}
+
+	// initialize help as the last point possible to allow for user
+	// overriding
+	c.initHelp()
+
+	var args []string
+
+	if len(c.args) == 0 {
+		args = os.Args[1:]
+	} else {
+		args = c.args
+	}
+
+	cmd, flags, err := c.Find(args)
+	if err == nil {
+		err = cmd.execute(flags)
+	}
+
+	if err != nil {
+		if err == flag.ErrHelp {
+			c.Help()
+
+		} else {
+			c.Println("Error:", err.Error())
+			c.Printf("Run '%v help' for usage.\n", c.Root().Name())
+		}
+	}
+
+	return
+}
+
+func (c *Command) initHelp() {
+	if c.helpCommand == nil {
+		if !c.HasSubCommands() {
+			return
+		}
+
+		c.helpCommand = &Command{
+			Use:   "help [command]",
+			Short: "Help about any command",
+			Long: `Help provides help for any command in the application.
+    Simply type ` + c.Name() + ` help [path to command] for full details.`,
+			Run:               c.HelpFunc(),
+			PersistentPreRun:  func(cmd *Command, args []string) {},
+			PersistentPostRun: func(cmd *Command, args []string) {},
+		}
+	}
+	c.AddCommand(c.helpCommand)
+}
+
+// Used for testing
+func (c *Command) ResetCommands() {
+	c.commands = nil
+	c.helpCommand = nil
+	c.cmdErrorBuf = new(bytes.Buffer)
+	c.cmdErrorBuf.Reset()
+}
+
+//Commands returns a slice of child commands.
+func (c *Command) Commands() []*Command {
+	return c.commands
+}
+
+// AddCommand adds one or more commands to this parent command.
+func (c *Command) AddCommand(cmds ...*Command) {
+	for i, x := range cmds {
+		if cmds[i] == c {
+			panic("Command can't be a child of itself")
+		}
+		cmds[i].parent = c
+		// update max lengths
+		usageLen := len(x.Use)
+		if usageLen > c.commandsMaxUseLen {
+			c.commandsMaxUseLen = usageLen
+		}
+		commandPathLen := len(x.CommandPath())
+		if commandPathLen > c.commandsMaxCommandPathLen {
+			c.commandsMaxCommandPathLen = commandPathLen
+		}
+		nameLen := len(x.Name())
+		if nameLen > c.commandsMaxNameLen {
+			c.commandsMaxNameLen = nameLen
+		}
+		// If glabal normalization function exists, update all children
+		if c.globNormFunc != nil {
+			x.SetGlobalNormalizationFunc(c.globNormFunc)
+		}
+		c.commands = append(c.commands, x)
+	}
+}
+
+// AddCommand removes one or more commands from a parent command.
+func (c *Command) RemoveCommand(cmds ...*Command) {
+	commands := []*Command{}
+main:
+	for _, command := range c.commands {
+		for _, cmd := range cmds {
+			if command == cmd {
+				command.parent = nil
+				continue main
+			}
+		}
+		commands = append(commands, command)
+	}
+	c.commands = commands
+	// recompute all lengths
+	c.commandsMaxUseLen = 0
+	c.commandsMaxCommandPathLen = 0
+	c.commandsMaxNameLen = 0
+	for _, command := range c.commands {
+		usageLen := len(command.Use)
+		if usageLen > c.commandsMaxUseLen {
+			c.commandsMaxUseLen = usageLen
+		}
+		commandPathLen := len(command.CommandPath())
+		if commandPathLen > c.commandsMaxCommandPathLen {
+			c.commandsMaxCommandPathLen = commandPathLen
+		}
+		nameLen := len(command.Name())
+		if nameLen > c.commandsMaxNameLen {
+			c.commandsMaxNameLen = nameLen
+		}
+	}
+}
+
+// Convenience method to Print to the defined output
+func (c *Command) Print(i ...interface{}) {
+	fmt.Fprint(c.Out(), i...)
+}
+
+// Convenience method to Println to the defined output
+func (c *Command) Println(i ...interface{}) {
+	str := fmt.Sprintln(i...)
+	c.Print(str)
+}
+
+// Convenience method to Printf to the defined output
+func (c *Command) Printf(format string, i ...interface{}) {
+	str := fmt.Sprintf(format, i...)
+	c.Print(str)
+}
+
+// Output the usage for the command
+// Used when a user provides invalid input
+// Can be defined by user by overriding UsageFunc
+func (c *Command) Usage() error {
+	c.mergePersistentFlags()
+	err := c.UsageFunc()(c)
+	return err
+}
+
+// Output the help for the command
+// Used when a user calls help [command]
+// by the default HelpFunc in the commander
+func (c *Command) Help() error {
+	c.mergePersistentFlags()
+	err := tmpl(c.getOutOrStdout(), c.HelpTemplate(), c)
+	return err
+}
+
+func (c *Command) UsageString() string {
+	tmpOutput := c.output
+	bb := new(bytes.Buffer)
+	c.SetOutput(bb)
+	c.Usage()
+	c.output = tmpOutput
+	return bb.String()
+}
+
+// CommandPath returns the full path to this command.
+func (c *Command) CommandPath() string {
+	str := c.Name()
+	x := c
+	for x.HasParent() {
+		str = x.parent.Name() + " " + str
+		x = x.parent
+	}
+	return str
+}
+
+//The full usage for a given command (including parents)
+func (c *Command) UseLine() string {
+	str := ""
+	if c.HasParent() {
+		str = c.parent.CommandPath() + " "
+	}
+	return str + c.Use
+}
+
+// For use in determining which flags have been assigned to which commands
+// and which persist
+func (c *Command) DebugFlags() {
+	c.Println("DebugFlags called on", c.Name())
+	var debugflags func(*Command)
+
+	debugflags = func(x *Command) {
+		if x.HasFlags() || x.HasPersistentFlags() {
+			c.Println(x.Name())
+		}
+		if x.HasFlags() {
+			x.flags.VisitAll(func(f *flag.Flag) {
+				if x.HasPersistentFlags() {
+					if x.persistentFlag(f.Name) == nil {
+						c.Println("  -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, "  [L]")
+					} else {
+						c.Println("  -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, "  [LP]")
+					}
+				} else {
+					c.Println("  -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, "  [L]")
+				}
+			})
+		}
+		if x.HasPersistentFlags() {
+			x.pflags.VisitAll(func(f *flag.Flag) {
+				if x.HasFlags() {
+					if x.flags.Lookup(f.Name) == nil {
+						c.Println("  -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, "  [P]")
+					}
+				} else {
+					c.Println("  -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, "  [P]")
+				}
+			})
+		}
+		c.Println(x.flagErrorBuf)
+		if x.HasSubCommands() {
+			for _, y := range x.commands {
+				debugflags(y)
+			}
+		}
+	}
+
+	debugflags(c)
+}
+
+// Name returns the command's name: the first word in the use line.
+func (c *Command) Name() string {
+	if c.name != "" {
+		return c.name
+	}
+	name := c.Use
+	i := strings.Index(name, " ")
+	if i >= 0 {
+		name = name[:i]
+	}
+	return name
+}
+
+// Determine if a given string is an alias of the command.
+func (c *Command) HasAlias(s string) bool {
+	for _, a := range c.Aliases {
+		if a == s {
+			return true
+		}
+	}
+	return false
+}
+
+func (c *Command) NameAndAliases() string {
+	return strings.Join(append([]string{c.Name()}, c.Aliases...), ", ")
+}
+
+func (c *Command) HasExample() bool {
+	return len(c.Example) > 0
+}
+
+// Determine if the command is itself runnable
+func (c *Command) Runnable() bool {
+	return c.Run != nil
+}
+
+// Determine if the command has children commands
+func (c *Command) HasSubCommands() bool {
+	return len(c.commands) > 0
+}
+
+func (c *Command) HasRunnableSiblings() bool {
+	if !c.HasParent() {
+		return false
+	}
+	for _, sub := range c.parent.commands {
+		if sub.Runnable() {
+			return true
+		}
+	}
+	return false
+}
+
+func (c *Command) HasHelpSubCommands() bool {
+	for _, sub := range c.commands {
+		if !sub.Runnable() {
+			return true
+		}
+	}
+	return false
+}
+
+// Determine if the command has runnable children commands
+func (c *Command) HasRunnableSubCommands() bool {
+	for _, sub := range c.commands {
+		if sub.Runnable() {
+			return true
+		}
+	}
+	return false
+}
+
+// Determine if the command is a child command
+func (c *Command) HasParent() bool {
+	return c.parent != nil
+}
+
+// GlobalNormalizationFunc returns the global normalization function or nil if doesn't exists
+func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName {
+	return c.globNormFunc
+}
+
+// Get the complete FlagSet that applies to this command (local and persistent declared here and by all parents)
+func (c *Command) Flags() *flag.FlagSet {
+	if c.flags == nil {
+		c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+		if c.flagErrorBuf == nil {
+			c.flagErrorBuf = new(bytes.Buffer)
+		}
+		c.flags.SetOutput(c.flagErrorBuf)
+		c.PersistentFlags().BoolVarP(&c.helpFlagVal, "help", "h", false, "help for "+c.Name())
+	}
+	return c.flags
+}
+
+// Get the local FlagSet specifically set in the current command
+func (c *Command) LocalFlags() *flag.FlagSet {
+	c.mergePersistentFlags()
+
+	local := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+	c.lflags.VisitAll(func(f *flag.Flag) {
+		local.AddFlag(f)
+	})
+	return local
+}
+
+// All Flags which were inherited from parents commands
+func (c *Command) InheritedFlags() *flag.FlagSet {
+	c.mergePersistentFlags()
+
+	inherited := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+	local := c.LocalFlags()
+
+	var rmerge func(x *Command)
+
+	rmerge = func(x *Command) {
+		if x.HasPersistentFlags() {
+			x.PersistentFlags().VisitAll(func(f *flag.Flag) {
+				if inherited.Lookup(f.Name) == nil && local.Lookup(f.Name) == nil {
+					inherited.AddFlag(f)
+				}
+			})
+		}
+		if x.HasParent() {
+			rmerge(x.parent)
+		}
+	}
+
+	if c.HasParent() {
+		rmerge(c.parent)
+	}
+
+	return inherited
+}
+
+// All Flags which were not inherited from parent commands
+func (c *Command) NonInheritedFlags() *flag.FlagSet {
+	return c.LocalFlags()
+}
+
+// Get the Persistent FlagSet specifically set in the current command
+func (c *Command) PersistentFlags() *flag.FlagSet {
+	if c.pflags == nil {
+		c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+		if c.flagErrorBuf == nil {
+			c.flagErrorBuf = new(bytes.Buffer)
+		}
+		c.pflags.SetOutput(c.flagErrorBuf)
+	}
+	return c.pflags
+}
+
+// For use in testing
+func (c *Command) ResetFlags() {
+	c.flagErrorBuf = new(bytes.Buffer)
+	c.flagErrorBuf.Reset()
+	c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+	c.flags.SetOutput(c.flagErrorBuf)
+	c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+	c.pflags.SetOutput(c.flagErrorBuf)
+}
+
+// Does the command contain any flags (local plus persistent from the entire structure)
+func (c *Command) HasFlags() bool {
+	return c.Flags().HasFlags()
+}
+
+// Does the command contain persistent flags
+func (c *Command) HasPersistentFlags() bool {
+	return c.PersistentFlags().HasFlags()
+}
+
+// Does the command has flags specifically declared locally
+func (c *Command) HasLocalFlags() bool {
+	return c.LocalFlags().HasFlags()
+}
+
+func (c *Command) HasInheritedFlags() bool {
+	return c.InheritedFlags().HasFlags()
+}
+
+// Climbs up the command tree looking for matching flag
+func (c *Command) Flag(name string) (flag *flag.Flag) {
+	flag = c.Flags().Lookup(name)
+
+	if flag == nil {
+		flag = c.persistentFlag(name)
+	}
+
+	return
+}
+
+// recursively find matching persistent flag
+func (c *Command) persistentFlag(name string) (flag *flag.Flag) {
+	if c.HasPersistentFlags() {
+		flag = c.PersistentFlags().Lookup(name)
+	}
+
+	if flag == nil && c.HasParent() {
+		flag = c.parent.persistentFlag(name)
+	}
+	return
+}
+
+// Parses persistent flag tree & local flags
+func (c *Command) ParseFlags(args []string) (err error) {
+	c.mergePersistentFlags()
+	err = c.Flags().Parse(args)
+	return
+}
+
+func (c *Command) Parent() *Command {
+	return c.parent
+}
+
+func (c *Command) mergePersistentFlags() {
+	var rmerge func(x *Command)
+
+	// Save the set of local flags
+	if c.lflags == nil {
+		c.lflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+		if c.flagErrorBuf == nil {
+			c.flagErrorBuf = new(bytes.Buffer)
+		}
+		c.lflags.SetOutput(c.flagErrorBuf)
+		addtolocal := func(f *flag.Flag) {
+			c.lflags.AddFlag(f)
+		}
+		c.Flags().VisitAll(addtolocal)
+		c.PersistentFlags().VisitAll(addtolocal)
+	}
+	rmerge = func(x *Command) {
+		if !x.HasParent() {
+			flag.CommandLine.VisitAll(func(f *flag.Flag) {
+				if x.PersistentFlags().Lookup(f.Name) == nil {
+					x.PersistentFlags().AddFlag(f)
+				}
+			})
+		}
+		if x.HasPersistentFlags() {
+			x.PersistentFlags().VisitAll(func(f *flag.Flag) {
+				if c.Flags().Lookup(f.Name) == nil {
+					c.Flags().AddFlag(f)
+				}
+			})
+		}
+		if x.HasParent() {
+			rmerge(x.parent)
+		}
+	}
+
+	rmerge(c)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/command_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/command_test.go b/newt/Godeps/_workspace/src/github.com/spf13/cobra/command_test.go
new file mode 100644
index 0000000..477d84e
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/command_test.go
@@ -0,0 +1,90 @@
+package cobra
+
+import (
+	"reflect"
+	"testing"
+)
+
+func TestStripFlags(t *testing.T) {
+	tests := []struct {
+		input  []string
+		output []string
+	}{
+		{
+			[]string{"foo", "bar"},
+			[]string{"foo", "bar"},
+		},
+		{
+			[]string{"foo", "--bar", "-b"},
+			[]string{"foo"},
+		},
+		{
+			[]string{"-b", "foo", "--bar", "bar"},
+			[]string{},
+		},
+		{
+			[]string{"-i10", "echo"},
+			[]string{"echo"},
+		},
+		{
+			[]string{"-i=10", "echo"},
+			[]string{"echo"},
+		},
+		{
+			[]string{"--int=100", "echo"},
+			[]string{"echo"},
+		},
+		{
+			[]string{"-ib", "echo", "-bfoo", "baz"},
+			[]string{"echo", "baz"},
+		},
+		{
+			[]string{"-i=baz", "bar", "-i", "foo", "blah"},
+			[]string{"bar", "blah"},
+		},
+		{
+			[]string{"--int=baz", "-bbar", "-i", "foo", "blah"},
+			[]string{"blah"},
+		},
+		{
+			[]string{"--cat", "bar", "-i", "foo", "blah"},
+			[]string{"bar", "blah"},
+		},
+		{
+			[]string{"-c", "bar", "-i", "foo", "blah"},
+			[]string{"bar", "blah"},
+		},
+		{
+			[]string{"--persist", "bar"},
+			[]string{"bar"},
+		},
+		{
+			[]string{"-p", "bar"},
+			[]string{"bar"},
+		},
+	}
+
+	cmdPrint := &Command{
+		Use:   "print [string to print]",
+		Short: "Print anything to the screen",
+		Long:  `an utterly useless command for testing.`,
+		Run: func(cmd *Command, args []string) {
+			tp = args
+		},
+	}
+
+	var flagi int
+	var flagstr string
+	var flagbool bool
+	cmdPrint.PersistentFlags().BoolVarP(&flagbool, "persist", "p", false, "help for persistent one")
+	cmdPrint.Flags().IntVarP(&flagi, "int", "i", 345, "help message for flag int")
+	cmdPrint.Flags().StringVarP(&flagstr, "bar", "b", "bar", "help message for flag string")
+	cmdPrint.Flags().BoolVarP(&flagbool, "cat", "c", false, "help message for flag bool")
+
+	for _, test := range tests {
+		output := stripFlags(test.input, cmdPrint)
+		if !reflect.DeepEqual(test.output, output) {
+			t.Errorf("expected: %v, got: %v", test.output, output)
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.go b/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.go
new file mode 100644
index 0000000..6092c85
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.go
@@ -0,0 +1,138 @@
+//Copyright 2015 Red Hat Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cobra
+
+import (
+	"bytes"
+	"fmt"
+	"os"
+	"sort"
+	"strings"
+	"time"
+)
+
+func printOptions(out *bytes.Buffer, cmd *Command, name string) {
+	flags := cmd.NonInheritedFlags()
+	flags.SetOutput(out)
+	if flags.HasFlags() {
+		fmt.Fprintf(out, "### Options\n\n```\n")
+		flags.PrintDefaults()
+		fmt.Fprintf(out, "```\n\n")
+	}
+
+	parentFlags := cmd.InheritedFlags()
+	parentFlags.SetOutput(out)
+	if parentFlags.HasFlags() {
+		fmt.Fprintf(out, "### Options inherited from parent commands\n\n```\n")
+		parentFlags.PrintDefaults()
+		fmt.Fprintf(out, "```\n\n")
+	}
+}
+
+type byName []*Command
+
+func (s byName) Len() int           { return len(s) }
+func (s byName) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
+func (s byName) Less(i, j int) bool { return s[i].Name() < s[j].Name() }
+
+func GenMarkdown(cmd *Command, out *bytes.Buffer) {
+	GenMarkdownCustom(cmd, out, func(s string) string { return s })
+}
+
+func GenMarkdownCustom(cmd *Command, out *bytes.Buffer, linkHandler func(string) string) {
+	name := cmd.CommandPath()
+
+	short := cmd.Short
+	long := cmd.Long
+	if len(long) == 0 {
+		long = short
+	}
+
+	fmt.Fprintf(out, "## %s\n\n", name)
+	fmt.Fprintf(out, "%s\n\n", short)
+	fmt.Fprintf(out, "### Synopsis\n\n")
+	fmt.Fprintf(out, "\n%s\n\n", long)
+
+	if cmd.Runnable() {
+		fmt.Fprintf(out, "```\n%s\n```\n\n", cmd.UseLine())
+	}
+
+	if len(cmd.Example) > 0 {
+		fmt.Fprintf(out, "### Examples\n\n")
+		fmt.Fprintf(out, "```\n%s\n```\n\n", cmd.Example)
+	}
+
+	printOptions(out, cmd, name)
+
+	if len(cmd.Commands()) > 0 || cmd.HasParent() {
+		fmt.Fprintf(out, "### SEE ALSO\n")
+		if cmd.HasParent() {
+			parent := cmd.Parent()
+			pname := parent.CommandPath()
+			link := pname + ".md"
+			link = strings.Replace(link, " ", "_", -1)
+			fmt.Fprintf(out, "* [%s](%s)\t - %s\n", pname, linkHandler(link), parent.Short)
+		}
+
+		children := cmd.Commands()
+		sort.Sort(byName(children))
+
+		for _, child := range children {
+			if len(child.Deprecated) > 0 {
+				continue
+			}
+			cname := name + " " + child.Name()
+			link := cname + ".md"
+			link = strings.Replace(link, " ", "_", -1)
+			fmt.Fprintf(out, "* [%s](%s)\t - %s\n", cname, linkHandler(link), child.Short)
+		}
+		fmt.Fprintf(out, "\n")
+	}
+
+	fmt.Fprintf(out, "###### Auto generated by spf13/cobra at %s\n", time.Now().UTC())
+}
+
+func GenMarkdownTree(cmd *Command, dir string) {
+	identity := func(s string) string { return s }
+	emptyStr := func(s string) string { return "" }
+	GenMarkdownTreeCustom(cmd, dir, emptyStr, identity)
+}
+
+func GenMarkdownTreeCustom(cmd *Command, dir string, filePrepender func(string) string, linkHandler func(string) string) {
+	for _, c := range cmd.Commands() {
+		GenMarkdownTreeCustom(c, dir, filePrepender, linkHandler)
+	}
+	out := new(bytes.Buffer)
+
+	GenMarkdownCustom(cmd, out, linkHandler)
+
+	filename := cmd.CommandPath()
+	filename = dir + strings.Replace(filename, " ", "_", -1) + ".md"
+	outFile, err := os.Create(filename)
+	if err != nil {
+		fmt.Println(err)
+		os.Exit(1)
+	}
+	defer outFile.Close()
+	_, err = outFile.WriteString(filePrepender(filename))
+	if err != nil {
+		fmt.Println(err)
+		os.Exit(1)
+	}
+	_, err = outFile.Write(out.Bytes())
+	if err != nil {
+		fmt.Println(err)
+		os.Exit(1)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.md b/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.md
new file mode 100644
index 0000000..3a0d55a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs.md
@@ -0,0 +1,81 @@
+# Generating Markdown Docs For Your Own cobra.Command
+
+## Generate markdown docs for the entire command tree
+
+This program can actually generate docs for the kubectl command in the kubernetes project
+
+```go
+package main
+
+import (
+	"io/ioutil"
+	"os"
+
+	"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd"
+	"github.com/spf13/cobra"
+)
+
+func main() {
+	kubectl := cmd.NewFactory(nil).NewKubectlCommand(os.Stdin, ioutil.Discard, ioutil.Discard)
+	cobra.GenMarkdownTree(kubectl, "./")
+}
+```
+
+This will generate a whole series of files, one for each command in the tree, in the directory specified (in this case "./")
+
+## Generate markdown docs for a single command
+
+You may wish to have more control over the output, or only generate for a single command, instead of the entire command tree. If this is the case you may prefer to `GenMarkdown` instead of `GenMarkdownTree`
+
+```go
+	out := new(bytes.Buffer)
+	cobra.GenMarkdown(cmd, out)
+```
+
+This will write the markdown doc for ONLY "cmd" into the out, buffer.
+
+## Customize the output
+
+Both `GenMarkdown` and `GenMarkdownTree` have alternate versions with callbacks to get some control of the output:
+
+```go
+func GenMarkdownTreeCustom(cmd *Command, dir string, filePrepender func(string) string, linkHandler func(string) string) {
+    //...
+}
+```
+
+```go
+func GenMarkdownCustom(cmd *Command, out *bytes.Buffer, linkHandler func(string) string) {
+    //...
+}
+```
+
+The `filePrepender` will prepend the return value given the full filepath to the rendered Markdown file. A common use case is to add front matter to use the generated documentation with [Hugo](http://gohugo.io/):
+
+```go
+const fmTemplate = `---
+date: %s
+title: "%s"
+slug: %s
+url: %s
+---
+`
+
+filePrepender := func(filename string) string {
+	now := time.Now().Format(time.RFC3339)
+	name := filepath.Base(filename)
+	base := strings.TrimSuffix(name, path.Ext(name))
+	url := "/commands/" + strings.ToLower(base) + "/"
+	return fmt.Sprintf(fmTemplate, now, strings.Replace(base, "_", " ", -1), base, url)
+}
+```
+
+The `linkHandler` can be used to customize the rendered internal links to the commands, given a filename:
+
+```go
+linkHandler := func(name string) string {
+	base := strings.TrimSuffix(name, path.Ext(name))
+	return "/commands/" + strings.ToLower(base) + "/"
+}
+```
+ 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs_test.go b/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs_test.go
new file mode 100644
index 0000000..defc941
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/md_docs_test.go
@@ -0,0 +1,67 @@
+package cobra
+
+import (
+	"bytes"
+	"fmt"
+	"os"
+	"strings"
+	"testing"
+)
+
+var _ = fmt.Println
+var _ = os.Stderr
+
+func TestGenMdDoc(t *testing.T) {
+	c := initializeWithRootCmd()
+	// Need two commands to run the command alphabetical sort
+	cmdEcho.AddCommand(cmdTimes, cmdEchoSub, cmdDeprecated)
+	c.AddCommand(cmdPrint, cmdEcho)
+	cmdRootWithRun.PersistentFlags().StringVarP(&flags2a, "rootflag", "r", "two", strtwoParentHelp)
+
+	out := new(bytes.Buffer)
+
+	// We generate on s subcommand so we have both subcommands and parents
+	GenMarkdown(cmdEcho, out)
+	found := out.String()
+
+	// Our description
+	expected := cmdEcho.Long
+	if !strings.Contains(found, expected) {
+		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
+	}
+
+	// Better have our example
+	expected = cmdEcho.Example
+	if !strings.Contains(found, expected) {
+		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
+	}
+
+	// A local flag
+	expected = "boolone"
+	if !strings.Contains(found, expected) {
+		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
+	}
+
+	// persistent flag on parent
+	expected = "rootflag"
+	if !strings.Contains(found, expected) {
+		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
+	}
+
+	// We better output info about our parent
+	expected = cmdRootWithRun.Short
+	if !strings.Contains(found, expected) {
+		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
+	}
+
+	// And about subcommands
+	expected = cmdEchoSub.Short
+	if !strings.Contains(found, expected) {
+		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
+	}
+
+	unexpected := cmdDeprecated.Short
+	if strings.Contains(found, unexpected) {
+		t.Errorf("Unexpected response.\nFound: %v\nBut should not have!!\n", unexpected)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/.gitignore b/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/.gitignore
new file mode 100644
index 0000000..0026861
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/.gitignore
@@ -0,0 +1,22 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/LICENSE b/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/LICENSE
new file mode 100644
index 0000000..4527efb
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Steve Francia
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/README.md b/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/README.md
new file mode 100644
index 0000000..2f6c9c8
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/README.md
@@ -0,0 +1,158 @@
+jWalterWeatherman
+=================
+
+Seamless printing to the terminal (stdout) and logging to a io.Writer
+(file) that’s as easy to use as fmt.Println.
+
+![Always Leave A Note](http://spf13.github.com/jwalterweatherman/and_that__s_why_you_always_leave_a_note_by_jonnyetc-d57q7um.jpg)
+Graphic by [JonnyEtc](http://jonnyetc.deviantart.com/art/And-That-s-Why-You-Always-Leave-a-Note-315311422)
+
+JWW is primarily a wrapper around the excellent standard log library. It
+provides a few advantages over using the standard log library alone.
+
+1. Ready to go out of the box. 
+2. One library for both printing to the terminal and logging (to files).
+3. Really easy to log to either a temp file or a file you specify.
+
+
+I really wanted a very straightforward library that could seamlessly do
+the following things.
+
+1. Replace all the println, printf, etc statements thought my code with
+   something more useful
+2. Allow the user to easily control what levels are printed to stdout
+3. Allow the user to easily control what levels are logged
+4. Provide an easy mechanism (like fmt.Println) to print info to the user
+   which can be easily logged as well 
+5. Due to 2 & 3 provide easy verbose mode for output and logs
+6. Not have any unnecessary initialization cruft. Just use it.
+
+# Usage
+
+## Step 1. Use it
+Put calls throughout your source based on type of feedback.
+No initialization or setup needs to happen. Just start calling things.
+
+Available Loggers are:
+
+ * TRACE
+ * DEBUG
+ * INFO
+ * WARN
+ * ERROR
+ * CRITICAL
+ * FATAL
+
+These each are loggers based on the log standard library and follow the
+standard usage. Eg..
+
+```go
+    import (
+        jww "github.com/spf13/jwalterweatherman"
+    )
+
+    ...
+
+    if err != nil {
+
+        // This is a pretty serious error and the user should know about
+        // it. It will be printed to the terminal as well as logged under the
+        // default thresholds.
+
+        jww.ERROR.Println(err)
+    }
+
+    if err2 != nil {
+        // This error isn’t going to materially change the behavior of the
+        // application, but it’s something that may not be what the user
+        // expects. Under the default thresholds, Warn will be logged, but
+        // not printed to the terminal. 
+
+        jww.WARN.Println(err2)
+    }
+
+    // Information that’s relevant to what’s happening, but not very
+    // important for the user. Under the default thresholds this will be
+    // discarded.
+
+    jww.INFO.Printf("information %q", response)
+
+```
+
+_Why 7 levels?_
+
+Maybe you think that 7 levels are too much for any application... and you
+are probably correct. Just because there are seven levels doesn’t mean
+that you should be using all 7 levels. Pick the right set for your needs.
+Remember they only have to mean something to your project.
+
+## Step 2. Optionally configure JWW
+
+Under the default thresholds :
+
+ * Debug, Trace & Info goto /dev/null
+ * Warn and above is logged (when a log file/io.Writer is provided)
+ * Error and above is printed to the terminal (stdout)
+
+### Changing the thresholds
+
+The threshold can be changed at any time, but will only affect calls that
+execute after the change was made.
+
+This is very useful if your application has a verbose mode. Of course you
+can decide what verbose means to you or even have multiple levels of
+verbosity.
+
+
+```go
+    import (
+        jww "github.com/spf13/jwalterweatherman"
+    )
+
+    if Verbose {
+        jww.SetLogThreshold(jww.LevelTrace)
+        jww.SetStdoutThreshold(jww.LevelInfo)
+    }
+```
+
+### Using a temp log file
+
+JWW conveniently creates a temporary file and sets the log Handle to
+a io.Writer created for it. You should call this early in your application
+initialization routine as it will only log calls made after it is executed. 
+When this option is used, the library will fmt.Println where to find the
+log file.
+
+```go
+    import (
+        jww "github.com/spf13/jwalterweatherman"
+    )
+
+    jww.UseTempLogFile("YourAppName") 
+
+```
+
+### Setting a log file
+
+JWW can log to any file you provide a path to (provided it’s writable).
+Will only append to this file.
+
+
+```go
+    import (
+        jww "github.com/spf13/jwalterweatherman"
+    )
+
+    jww.SetLogFile("/path/to/logfile") 
+
+```
+
+
+# More information
+
+This is an early release. I’ve been using it for a while and this is the
+third interface I’ve tried. I like this one pretty well, but no guarantees
+that it won’t change a bit.
+
+I wrote this for use in [hugo](http://hugo.spf13.com). If you are looking
+for a static website engine that’s super fast please checkout Hugo.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/jww_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/jww_test.go b/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/jww_test.go
new file mode 100644
index 0000000..b6d118a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/jww_test.go
@@ -0,0 +1,56 @@
+// Copyright © 2014 Steve Francia <sp...@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package jwalterweatherman
+
+import (
+    "bytes"
+    "github.com/stretchr/testify/assert"
+    "testing"
+)
+
+func TestLevels(t *testing.T) {
+    SetStdoutThreshold(LevelError)
+    assert.Equal(t, StdoutThreshold(), LevelError)
+    SetLogThreshold(LevelCritical)
+    assert.Equal(t, LogThreshold(), LevelCritical)
+    assert.NotEqual(t, StdoutThreshold(), LevelCritical)
+    SetStdoutThreshold(LevelWarn)
+    assert.Equal(t, StdoutThreshold(), LevelWarn)
+}
+
+func TestDefaultLogging(t *testing.T) {
+    outputBuf := new(bytes.Buffer)
+    logBuf := new(bytes.Buffer)
+    LogHandle = logBuf
+    OutHandle = outputBuf
+
+    SetLogThreshold(LevelWarn)
+    SetStdoutThreshold(LevelError)
+
+    FATAL.Println("fatal err")
+    CRITICAL.Println("critical err")
+    ERROR.Println("an error")
+    WARN.Println("a warning")
+    INFO.Println("information")
+    DEBUG.Println("debugging info")
+    TRACE.Println("trace")
+
+    assert.Contains(t, logBuf.String(), "fatal err")
+    assert.Contains(t, logBuf.String(), "critical err")
+    assert.Contains(t, logBuf.String(), "an error")
+    assert.Contains(t, logBuf.String(), "a warning")
+    assert.NotContains(t, logBuf.String(), "information")
+    assert.NotContains(t, logBuf.String(), "debugging info")
+    assert.NotContains(t, logBuf.String(), "trace")
+
+    assert.Contains(t, outputBuf.String(), "fatal err")
+    assert.Contains(t, outputBuf.String(), "critical err")
+    assert.Contains(t, outputBuf.String(), "an error")
+    assert.NotContains(t, outputBuf.String(), "a warning")
+    assert.NotContains(t, outputBuf.String(), "information")
+    assert.NotContains(t, outputBuf.String(), "debugging info")
+    assert.NotContains(t, outputBuf.String(), "trace")
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go b/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go
new file mode 100644
index 0000000..2f3d721
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go
@@ -0,0 +1,183 @@
+// Copyright © 2014 Steve Francia <sp...@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package jwalterweatherman
+
+import (
+	"fmt"
+	"io"
+	"io/ioutil"
+	"log"
+	"os"
+)
+
+// Level describes the chosen log level between
+// debug and critical.
+type Level int
+
+type NotePad struct {
+	Handle io.Writer
+	Level  Level
+	Prefix string
+	Logger **log.Logger
+}
+
+// Feedback is special. It writes plainly to the output while
+// logging with the standard extra information (date, file, etc)
+// Only Println and Printf are currently provided for this
+type Feedback struct{}
+
+const (
+	LevelTrace Level = iota
+	LevelDebug
+	LevelInfo
+	LevelWarn
+	LevelError
+	LevelCritical
+	LevelFatal
+	DefaultLogThreshold    = LevelWarn
+	DefaultStdoutThreshold = LevelError
+)
+
+var (
+	TRACE      *log.Logger
+	DEBUG      *log.Logger
+	INFO       *log.Logger
+	WARN       *log.Logger
+	ERROR      *log.Logger
+	CRITICAL   *log.Logger
+	FATAL      *log.Logger
+	LOG        *log.Logger
+	FEEDBACK   Feedback
+	LogHandle  io.Writer  = ioutil.Discard
+	OutHandle  io.Writer  = os.Stdout
+	BothHandle io.Writer  = io.MultiWriter(LogHandle, OutHandle)
+	NotePads   []*NotePad = []*NotePad{trace, debug, info, warn, err, critical, fatal}
+
+	trace           *NotePad = &NotePad{Level: LevelTrace, Handle: os.Stdout, Logger: &TRACE, Prefix: "TRACE: "}
+	debug           *NotePad = &NotePad{Level: LevelDebug, Handle: os.Stdout, Logger: &DEBUG, Prefix: "DEBUG: "}
+	info            *NotePad = &NotePad{Level: LevelInfo, Handle: os.Stdout, Logger: &INFO, Prefix: "INFO: "}
+	warn            *NotePad = &NotePad{Level: LevelWarn, Handle: os.Stdout, Logger: &WARN, Prefix: "WARN: "}
+	err             *NotePad = &NotePad{Level: LevelError, Handle: os.Stdout, Logger: &ERROR, Prefix: "ERROR: "}
+	critical        *NotePad = &NotePad{Level: LevelCritical, Handle: os.Stdout, Logger: &CRITICAL, Prefix: "CRITICAL: "}
+	fatal           *NotePad = &NotePad{Level: LevelFatal, Handle: os.Stdout, Logger: &FATAL, Prefix: "FATAL: "}
+	logThreshold    Level    = DefaultLogThreshold
+	outputThreshold Level    = DefaultStdoutThreshold
+)
+
+func init() {
+	SetStdoutThreshold(DefaultStdoutThreshold)
+}
+
+// initialize will setup the jWalterWeatherman standard approach of providing the user
+// some feedback and logging a potentially different amount based on independent log and output thresholds.
+// By default the output has a lower threshold than logged
+// Don't use if you have manually set the Handles of the different levels as it will overwrite them.
+func initialize() {
+	BothHandle = io.MultiWriter(LogHandle, OutHandle)
+
+	for _, n := range NotePads {
+		if n.Level < outputThreshold && n.Level < logThreshold {
+			n.Handle = ioutil.Discard
+		} else if n.Level >= outputThreshold && n.Level >= logThreshold {
+			n.Handle = BothHandle
+		} else if n.Level >= outputThreshold && n.Level < logThreshold {
+			n.Handle = OutHandle
+		} else {
+			n.Handle = LogHandle
+		}
+	}
+
+	for _, n := range NotePads {
+		*n.Logger = log.New(n.Handle, n.Prefix, log.Ldate)
+	}
+
+	LOG = log.New(LogHandle,
+		"LOG:   ",
+		log.Ldate|log.Ltime|log.Lshortfile)
+}
+
+// Level returns the current global log threshold.
+func LogThreshold() Level {
+	return logThreshold
+}
+
+// Level returns the current global output threshold.
+func StdoutThreshold() Level {
+	return outputThreshold
+}
+
+// Ensures that the level provided is within the bounds of available levels
+func levelCheck(level Level) Level {
+	switch {
+	case level <= LevelTrace:
+		return LevelTrace
+	case level >= LevelFatal:
+		return LevelFatal
+	default:
+		return level
+	}
+}
+
+// Establishes a threshold where anything matching or above will be logged
+func SetLogThreshold(level Level) {
+	logThreshold = levelCheck(level)
+	initialize()
+}
+
+// Establishes a threshold where anything matching or above will be output
+func SetStdoutThreshold(level Level) {
+	outputThreshold = levelCheck(level)
+	initialize()
+}
+
+// Conveniently Sets the Log Handle to a io.writer created for the file behind the given filepath
+// Will only append to this file
+func SetLogFile(path string) {
+	file, err := os.OpenFile(path, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666)
+	if err != nil {
+		CRITICAL.Println("Failed to open log file:", path, err)
+		os.Exit(-1)
+	}
+        fmt.Println("Logging to", file.Name())
+
+	LogHandle = file
+	initialize()
+}
+
+// Conveniently Creates a temporary file and sets the Log Handle to a io.writer created for it
+func UseTempLogFile(prefix string) {
+	file, err := ioutil.TempFile(os.TempDir(), prefix)
+	if err != nil {
+		CRITICAL.Println(err)
+	}
+
+	fmt.Println("Logging to", file.Name())
+
+	LogHandle = file
+	initialize()
+}
+
+// Disables logging for the entire JWW system
+func DiscardLogging() {
+	LogHandle = ioutil.Discard
+	initialize()
+}
+
+// Feedback is special. It writes plainly to the output while
+// logging with the standard extra information (date, file, etc)
+// Only Println and Printf are currently provided for this
+func (fb *Feedback) Println(v ...interface{}) {
+	fmt.Println(v...)
+	LOG.Println(v...)
+}
+
+// Feedback is special. It writes plainly to the output while
+// logging with the standard extra information (date, file, etc)
+// Only Println and Printf are currently provided for this
+func (fb *Feedback) Printf(format string, v ...interface{}) {
+	fmt.Printf(format, v...)
+	LOG.Printf(format, v...)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml b/newt/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml
new file mode 100644
index 0000000..c4d88e3
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml
@@ -0,0 +1,8 @@
+sudo: false
+
+language: go
+
+go:
+        - 1.3
+        - 1.4
+        - tip

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE b/newt/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE
new file mode 100644
index 0000000..63ed1cf
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2012 Alex Ogier. All rights reserved.
+Copyright (c) 2012 The Go Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+   * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+   * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+   * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/README.md b/newt/Godeps/_workspace/src/github.com/spf13/pflag/README.md
new file mode 100644
index 0000000..deee931
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/README.md
@@ -0,0 +1,228 @@
+[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag)
+
+## Description
+
+pflag is a drop-in replacement for Go's flag package, implementing
+POSIX/GNU-style --flags.
+
+pflag is compatible with the [GNU extensions to the POSIX recommendations
+for command-line options][1]. For a more precise description, see the
+"Command-line flag syntax" section below.
+
+[1]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
+
+pflag is available under the same style of BSD license as the Go language,
+which can be found in the LICENSE file.
+
+## Installation
+
+pflag is available using the standard `go get` command.
+
+Install by running:
+
+    go get github.com/spf13/pflag
+
+Run tests by running:
+
+    go test github.com/spf13/pflag
+
+## Usage
+
+pflag is a drop-in replacement of Go's native flag package. If you import
+pflag under the name "flag" then all code should continue to function
+with no changes.
+
+``` go
+import flag "github.com/spf13/pflag"
+```
+
+There is one exception to this: if you directly instantiate the Flag struct
+there is one more field "Shorthand" that you will need to set.
+Most code never instantiates this struct directly, and instead uses
+functions such as String(), BoolVar(), and Var(), and is therefore
+unaffected.
+
+Define flags using flag.String(), Bool(), Int(), etc.
+
+This declares an integer flag, -flagname, stored in the pointer ip, with type *int.
+
+``` go
+var ip *int = flag.Int("flagname", 1234, "help message for flagname")
+```
+
+If you like, you can bind the flag to a variable using the Var() functions.
+
+``` go
+var flagvar int
+func init() {
+    flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname")
+}
+```
+
+Or you can create custom flags that satisfy the Value interface (with
+pointer receivers) and couple them to flag parsing by
+
+``` go
+flag.Var(&flagVal, "name", "help message for flagname")
+```
+
+For such flags, the default value is just the initial value of the variable.
+
+After all flags are defined, call
+
+``` go
+flag.Parse()
+```
+
+to parse the command line into the defined flags.
+
+Flags may then be used directly. If you're using the flags themselves,
+they are all pointers; if you bind to variables, they're values.
+
+``` go
+fmt.Println("ip has value ", *ip)
+fmt.Println("flagvar has value ", flagvar)
+```
+
+There are helpers function to get values later if you have the FlagSet but
+it was difficult to keep up with all of the the flag pointers in your code.
+If you have a pflag.FlagSet with a flag called 'flagname' of type int you
+can use GetInt() to get the int value. But notice that 'flagname' must exist
+and it must be an int. GetString("flagname") will fail.
+
+``` go
+i, err := flagset.GetInt("flagname")
+```
+
+After parsing, the arguments after the flag are available as the
+slice flag.Args() or individually as flag.Arg(i).
+The arguments are indexed from 0 through flag.NArg()-1.
+
+The pflag package also defines some new functions that are not in flag,
+that give one-letter shorthands for flags. You can use these by appending
+'P' to the name of any function that defines a flag.
+
+``` go
+var ip = flag.IntP("flagname", "f", 1234, "help message")
+var flagvar bool
+func init() {
+    flag.BoolVarP("boolname", "b", true, "help message")
+}
+flag.VarP(&flagVar, "varname", "v", 1234, "help message")
+```
+
+Shorthand letters can be used with single dashes on the command line.
+Boolean shorthand flags can be combined with other shorthand flags.
+
+The default set of command-line flags is controlled by
+top-level functions.  The FlagSet type allows one to define
+independent sets of flags, such as to implement subcommands
+in a command-line interface. The methods of FlagSet are
+analogous to the top-level functions for the command-line
+flag set.
+
+## Setting no option default values for flags
+
+After you create a flag it is possible to set the pflag.NoOptDefVal for
+the given flag. Doing this changes the meaning of the flag slightly. If
+a flag has a NoOptDefVal and the flag is set on the command line without
+an option the flag will be set to the NoOptDefVal. For example given:
+
+``` go
+var ip = flag.IntP("flagname", "f", 1234, "help message")
+flag.Lookup("flagname").NoOptDefVal = "4321"
+```
+
+Would result in something like
+
+| Parsed Arguments | Resulting Value |
+| -------------    | -------------   |
+| --flagname=1357  | ip=1357         |
+| --flagname       | ip=4321         |
+| [nothing]        | ip=1234         |
+
+## Command line flag syntax
+
+```
+--flag    // boolean flags, or flags with no option default values
+--flag x  // only on flags without a default value
+--flag=x
+```
+
+Unlike the flag package, a single dash before an option means something
+different than a double dash. Single dashes signify a series of shorthand
+letters for flags. All but the last shorthand letter must be boolean flags
+or a flag with a default value
+
+```
+// boolean or flags where the 'no option default value' is set
+-f
+-f=true
+-abc
+but
+-b true is INVALID
+
+// non-boolean and flags without a 'no option default value'
+-n 1234
+-n=1234
+-n1234
+
+// mixed
+-abcs "hello"
+-absd="hello"
+-abcs1234
+```
+
+Flag parsing stops after the terminator "--". Unlike the flag package,
+flags can be interspersed with arguments anywhere on the command line
+before this terminator.
+
+Integer flags accept 1234, 0664, 0x1234 and may be negative.
+Boolean flags (in their long form) accept 1, 0, t, f, true, false,
+TRUE, FALSE, True, False.
+Duration flags accept any input valid for time.ParseDuration.
+
+## Mutating or "Normalizing" Flag names
+
+It is possible to set a custom flag name 'normalization function.' It allows flag names to be mutated both when created in the code and when used on the command line to some 'normalized' form. The 'normalized' form is used for comparison. Two examples of using the custom normalization func follow.
+
+**Example #1**: You want -, _, and . in flags to compare the same. aka --my-flag == --my_flag == --my.flag
+
+``` go
+func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
+	from := []string{"-", "_"}
+	to := "."
+	for _, sep := range from {
+		name = strings.Replace(name, sep, to, -1)
+	}
+	return pflag.NormalizedName(name)
+}
+
+myFlagSet.SetNormalizeFunc(wordSepNormalizeFunc)
+```
+
+**Example #2**: You want to alias two flags. aka --old-flag-name == --new-flag-name
+
+``` go
+func aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
+	switch name {
+	case "old-flag-name":
+		name = "new-flag-name"
+		break
+	}
+	return pflag.NormalizedName(name)
+}
+
+myFlagSet.SetNormalizeFunc(aliasNormalizeFunc)
+```
+
+## More info
+
+You can see the full reference documentation of the pflag package
+[at godoc.org][3], or through go's standard documentation system by
+running `godoc -http=:6060` and browsing to
+[http://localhost:6060/pkg/github.com/ogier/pflag][2] after
+installation.
+
+[2]: http://localhost:6060/pkg/github.com/ogier/pflag
+[3]: http://godoc.org/github.com/ogier/pflag

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/bool.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/bool.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/bool.go
new file mode 100644
index 0000000..04c9b5a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/bool.go
@@ -0,0 +1,97 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// optional interface to indicate boolean flags that can be
+// supplied without "=value" text
+type boolFlag interface {
+	Value
+	IsBoolFlag() bool
+}
+
+// -- bool Value
+type boolValue bool
+
+func newBoolValue(val bool, p *bool) *boolValue {
+	*p = val
+	return (*boolValue)(p)
+}
+
+func (b *boolValue) Set(s string) error {
+	v, err := strconv.ParseBool(s)
+	*b = boolValue(v)
+	return err
+}
+
+func (b *boolValue) Type() string {
+	return "bool"
+}
+
+func (b *boolValue) String() string { return fmt.Sprintf("%v", *b) }
+
+func (b *boolValue) IsBoolFlag() bool { return true }
+
+func boolConv(sval string) (interface{}, error) {
+	return strconv.ParseBool(sval)
+}
+
+// GetBool return the bool value of a flag with the given name
+func (f *FlagSet) GetBool(name string) (bool, error) {
+	val, err := f.getFlagType(name, "bool", boolConv)
+	if err != nil {
+		return false, err
+	}
+	return val.(bool), nil
+}
+
+// BoolVar defines a bool flag with specified name, default value, and usage string.
+// The argument p points to a bool variable in which to store the value of the flag.
+func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) {
+	f.BoolVarP(p, name, "", value, usage)
+}
+
+// Like BoolVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
+	flag := f.VarPF(newBoolValue(value, p), name, shorthand, usage)
+	flag.NoOptDefVal = "true"
+}
+
+// BoolVar defines a bool flag with specified name, default value, and usage string.
+// The argument p points to a bool variable in which to store the value of the flag.
+func BoolVar(p *bool, name string, value bool, usage string) {
+	BoolVarP(p, name, "", value, usage)
+}
+
+// Like BoolVar, but accepts a shorthand letter that can be used after a single dash.
+func BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
+	flag := CommandLine.VarPF(newBoolValue(value, p), name, shorthand, usage)
+	flag.NoOptDefVal = "true"
+}
+
+// Bool defines a bool flag with specified name, default value, and usage string.
+// The return value is the address of a bool variable that stores the value of the flag.
+func (f *FlagSet) Bool(name string, value bool, usage string) *bool {
+	return f.BoolP(name, "", value, usage)
+}
+
+// Like Bool, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool {
+	p := new(bool)
+	f.BoolVarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Bool defines a bool flag with specified name, default value, and usage string.
+// The return value is the address of a bool variable that stores the value of the flag.
+func Bool(name string, value bool, usage string) *bool {
+	return BoolP(name, "", value, usage)
+}
+
+// Like Bool, but accepts a shorthand letter that can be used after a single dash.
+func BoolP(name, shorthand string, value bool, usage string) *bool {
+	b := CommandLine.BoolP(name, shorthand, value, usage)
+	return b
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/bool_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/bool_test.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/bool_test.go
new file mode 100644
index 0000000..febf667
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/bool_test.go
@@ -0,0 +1,180 @@
+// 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.
+
+package pflag
+
+import (
+	"bytes"
+	"fmt"
+	"strconv"
+	"testing"
+)
+
+// This value can be a boolean ("true", "false") or "maybe"
+type triStateValue int
+
+const (
+	triStateFalse triStateValue = 0
+	triStateTrue  triStateValue = 1
+	triStateMaybe triStateValue = 2
+)
+
+const strTriStateMaybe = "maybe"
+
+func (v *triStateValue) IsBoolFlag() bool {
+	return true
+}
+
+func (v *triStateValue) Get() interface{} {
+	return triStateValue(*v)
+}
+
+func (v *triStateValue) Set(s string) error {
+	if s == strTriStateMaybe {
+		*v = triStateMaybe
+		return nil
+	}
+	boolVal, err := strconv.ParseBool(s)
+	if boolVal {
+		*v = triStateTrue
+	} else {
+		*v = triStateFalse
+	}
+	return err
+}
+
+func (v *triStateValue) String() string {
+	if *v == triStateMaybe {
+		return strTriStateMaybe
+	}
+	return fmt.Sprintf("%v", bool(*v == triStateTrue))
+}
+
+// The type of the flag as requred by the pflag.Value interface
+func (v *triStateValue) Type() string {
+	return "version"
+}
+
+func setUpFlagSet(tristate *triStateValue) *FlagSet {
+	f := NewFlagSet("test", ContinueOnError)
+	*tristate = triStateFalse
+	flag := f.VarPF(tristate, "tristate", "t", "tristate value (true, maybe or false)")
+	flag.NoOptDefVal = "true"
+	return f
+}
+
+func TestExplicitTrue(t *testing.T) {
+	var tristate triStateValue
+	f := setUpFlagSet(&tristate)
+	err := f.Parse([]string{"--tristate=true"})
+	if err != nil {
+		t.Fatal("expected no error; got", err)
+	}
+	if tristate != triStateTrue {
+		t.Fatal("expected", triStateTrue, "(triStateTrue) but got", tristate, "instead")
+	}
+}
+
+func TestImplicitTrue(t *testing.T) {
+	var tristate triStateValue
+	f := setUpFlagSet(&tristate)
+	err := f.Parse([]string{"--tristate"})
+	if err != nil {
+		t.Fatal("expected no error; got", err)
+	}
+	if tristate != triStateTrue {
+		t.Fatal("expected", triStateTrue, "(triStateTrue) but got", tristate, "instead")
+	}
+}
+
+func TestShortFlag(t *testing.T) {
+	var tristate triStateValue
+	f := setUpFlagSet(&tristate)
+	err := f.Parse([]string{"-t"})
+	if err != nil {
+		t.Fatal("expected no error; got", err)
+	}
+	if tristate != triStateTrue {
+		t.Fatal("expected", triStateTrue, "(triStateTrue) but got", tristate, "instead")
+	}
+}
+
+func TestShortFlagExtraArgument(t *testing.T) {
+	var tristate triStateValue
+	f := setUpFlagSet(&tristate)
+	// The"maybe"turns into an arg, since short boolean options will only do true/false
+	err := f.Parse([]string{"-t", "maybe"})
+	if err != nil {
+		t.Fatal("expected no error; got", err)
+	}
+	if tristate != triStateTrue {
+		t.Fatal("expected", triStateTrue, "(triStateTrue) but got", tristate, "instead")
+	}
+	args := f.Args()
+	if len(args) != 1 || args[0] != "maybe" {
+		t.Fatal("expected an extra 'maybe' argument to stick around")
+	}
+}
+
+func TestExplicitMaybe(t *testing.T) {
+	var tristate triStateValue
+	f := setUpFlagSet(&tristate)
+	err := f.Parse([]string{"--tristate=maybe"})
+	if err != nil {
+		t.Fatal("expected no error; got", err)
+	}
+	if tristate != triStateMaybe {
+		t.Fatal("expected", triStateMaybe, "(triStateMaybe) but got", tristate, "instead")
+	}
+}
+
+func TestExplicitFalse(t *testing.T) {
+	var tristate triStateValue
+	f := setUpFlagSet(&tristate)
+	err := f.Parse([]string{"--tristate=false"})
+	if err != nil {
+		t.Fatal("expected no error; got", err)
+	}
+	if tristate != triStateFalse {
+		t.Fatal("expected", triStateFalse, "(triStateFalse) but got", tristate, "instead")
+	}
+}
+
+func TestImplicitFalse(t *testing.T) {
+	var tristate triStateValue
+	f := setUpFlagSet(&tristate)
+	err := f.Parse([]string{})
+	if err != nil {
+		t.Fatal("expected no error; got", err)
+	}
+	if tristate != triStateFalse {
+		t.Fatal("expected", triStateFalse, "(triStateFalse) but got", tristate, "instead")
+	}
+}
+
+func TestInvalidValue(t *testing.T) {
+	var tristate triStateValue
+	f := setUpFlagSet(&tristate)
+	var buf bytes.Buffer
+	f.SetOutput(&buf)
+	err := f.Parse([]string{"--tristate=invalid"})
+	if err == nil {
+		t.Fatal("expected an error but did not get any, tristate has value", tristate)
+	}
+}
+
+func TestBoolP(t *testing.T) {
+	b := BoolP("bool", "b", false, "bool value in CommandLine")
+	c := BoolP("c", "c", false, "other bool value")
+	args := []string{"--bool"}
+	if err := CommandLine.Parse(args); err != nil {
+		t.Error("expected no error, got ", err)
+	}
+	if *b != true {
+		t.Errorf("expected b=true got b=%s", b)
+	}
+	if *c != false {
+		t.Errorf("expect c=false got c=%s", c)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/duration.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/duration.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/duration.go
new file mode 100644
index 0000000..382ffd3
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/duration.go
@@ -0,0 +1,86 @@
+package pflag
+
+import (
+	"time"
+)
+
+// -- time.Duration Value
+type durationValue time.Duration
+
+func newDurationValue(val time.Duration, p *time.Duration) *durationValue {
+	*p = val
+	return (*durationValue)(p)
+}
+
+func (d *durationValue) Set(s string) error {
+	v, err := time.ParseDuration(s)
+	*d = durationValue(v)
+	return err
+}
+
+func (d *durationValue) Type() string {
+	return "duration"
+}
+
+func (d *durationValue) String() string { return (*time.Duration)(d).String() }
+
+func durationConv(sval string) (interface{}, error) {
+	return time.ParseDuration(sval)
+}
+
+// GetDuration return the duration value of a flag with the given name
+func (f *FlagSet) GetDuration(name string) (time.Duration, error) {
+	val, err := f.getFlagType(name, "duration", durationConv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(time.Duration), nil
+}
+
+// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
+// The argument p points to a time.Duration variable in which to store the value of the flag.
+func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
+	f.VarP(newDurationValue(value, p), name, "", usage)
+}
+
+// Like DurationVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {
+	f.VarP(newDurationValue(value, p), name, shorthand, usage)
+}
+
+// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
+// The argument p points to a time.Duration variable in which to store the value of the flag.
+func DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
+	CommandLine.VarP(newDurationValue(value, p), name, "", usage)
+}
+
+// Like DurationVar, but accepts a shorthand letter that can be used after a single dash.
+func DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {
+	CommandLine.VarP(newDurationValue(value, p), name, shorthand, usage)
+}
+
+// Duration defines a time.Duration flag with specified name, default value, and usage string.
+// The return value is the address of a time.Duration variable that stores the value of the flag.
+func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration {
+	p := new(time.Duration)
+	f.DurationVarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Duration, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {
+	p := new(time.Duration)
+	f.DurationVarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Duration defines a time.Duration flag with specified name, default value, and usage string.
+// The return value is the address of a time.Duration variable that stores the value of the flag.
+func Duration(name string, value time.Duration, usage string) *time.Duration {
+	return CommandLine.DurationP(name, "", value, usage)
+}
+
+// Like Duration, but accepts a shorthand letter that can be used after a single dash.
+func DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {
+	return CommandLine.DurationP(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/example_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/example_test.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/example_test.go
new file mode 100644
index 0000000..9be7a49
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/example_test.go
@@ -0,0 +1,77 @@
+// Copyright 2012 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.
+
+// These examples demonstrate more intricate uses of the flag package.
+package pflag_test
+
+import (
+	"errors"
+	"fmt"
+	"strings"
+	"time"
+
+	flag "github.com/spf13/pflag"
+)
+
+// Example 1: A single string flag called "species" with default value "gopher".
+var species = flag.String("species", "gopher", "the species we are studying")
+
+// Example 2: A flag with a shorthand letter.
+var gopherType = flag.StringP("gopher_type", "g", "pocket", "the variety of gopher")
+
+// Example 3: A user-defined flag type, a slice of durations.
+type interval []time.Duration
+
+// String is the method to format the flag's value, part of the flag.Value interface.
+// The String method's output will be used in diagnostics.
+func (i *interval) String() string {
+	return fmt.Sprint(*i)
+}
+
+func (i *interval) Type() string {
+	return "interval"
+}
+
+// Set is the method to set the flag value, part of the flag.Value interface.
+// Set's argument is a string to be parsed to set the flag.
+// It's a comma-separated list, so we split it.
+func (i *interval) Set(value string) error {
+	// If we wanted to allow the flag to be set multiple times,
+	// accumulating values, we would delete this if statement.
+	// That would permit usages such as
+	//	-deltaT 10s -deltaT 15s
+	// and other combinations.
+	if len(*i) > 0 {
+		return errors.New("interval flag already set")
+	}
+	for _, dt := range strings.Split(value, ",") {
+		duration, err := time.ParseDuration(dt)
+		if err != nil {
+			return err
+		}
+		*i = append(*i, duration)
+	}
+	return nil
+}
+
+// Define a flag to accumulate durations. Because it has a special type,
+// we need to use the Var function and therefore create the flag during
+// init.
+
+var intervalFlag interval
+
+func init() {
+	// Tie the command-line flag to the intervalFlag variable and
+	// set a usage message.
+	flag.Var(&intervalFlag, "deltaT", "comma-separated list of intervals to use between events")
+}
+
+func Example() {
+	// All the interesting pieces are with the variables declared above, but
+	// to enable the flag package to see the flags defined there, one must
+	// execute, typically at the start of main (not init!):
+	//	flag.Parse()
+	// We don't run it here because this is not a main function and
+	// the testing suite has already parsed the flags.
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/export_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/export_test.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/export_test.go
new file mode 100644
index 0000000..9318fee
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/export_test.go
@@ -0,0 +1,29 @@
+// Copyright 2010 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.
+
+package pflag
+
+import (
+	"io/ioutil"
+	"os"
+)
+
+// Additional routines compiled into the package only during testing.
+
+// ResetForTesting clears all flag state and sets the usage function as directed.
+// After calling ResetForTesting, parse errors in flag handling will not
+// exit the program.
+func ResetForTesting(usage func()) {
+	CommandLine = &FlagSet{
+		name:          os.Args[0],
+		errorHandling: ContinueOnError,
+		output:        ioutil.Discard,
+	}
+	Usage = usage
+}
+
+// GetCommandLine returns the default FlagSet.
+func GetCommandLine() *FlagSet {
+	return CommandLine
+}


[14/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.h
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.h b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.h
new file mode 100644
index 0000000..e86d83f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.h
@@ -0,0 +1,7478 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code.  In place of
+** a legal notice, here is a blessing:
+**
+**    May you do good and not evil.
+**    May you find forgiveness for yourself and forgive others.
+**    May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This header file defines the interface that the SQLite library
+** presents to client programs.  If a C-function, structure, datatype,
+** or constant definition does not appear in this file, then it is
+** not a published API of SQLite, is subject to change without
+** notice, and should not be referenced by programs that use SQLite.
+**
+** Some of the definitions that are in this file are marked as
+** "experimental".  Experimental interfaces are normally new
+** features recently added to SQLite.  We do not anticipate changes
+** to experimental interfaces but reserve the right to make minor changes
+** if experience from use "in the wild" suggest such changes are prudent.
+**
+** The official C-language API documentation for SQLite is derived
+** from comments in this file.  This file is the authoritative source
+** on how SQLite interfaces are suppose to operate.
+**
+** The name of this file under configuration management is "sqlite.h.in".
+** The makefile makes some minor changes to this file (such as inserting
+** the version number) and changes its name to "sqlite3.h" as
+** part of the build process.
+*/
+#ifndef _SQLITE3_H_
+#define _SQLITE3_H_
+#include <stdarg.h>     /* Needed for the definition of va_list */
+
+/*
+** Make sure we can call this stuff from C++.
+*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*
+** Add the ability to override 'extern'
+*/
+#ifndef SQLITE_EXTERN
+# define SQLITE_EXTERN extern
+#endif
+
+#ifndef SQLITE_API
+# define SQLITE_API
+#endif
+
+
+/*
+** These no-op macros are used in front of interfaces to mark those
+** interfaces as either deprecated or experimental.  New applications
+** should not use deprecated interfaces - they are support for backwards
+** compatibility only.  Application writers should be aware that
+** experimental interfaces are subject to change in point releases.
+**
+** These macros used to resolve to various kinds of compiler magic that
+** would generate warning messages when they were used.  But that
+** compiler magic ended up generating such a flurry of bug reports
+** that we have taken it all out and gone back to using simple
+** noop macros.
+*/
+#define SQLITE_DEPRECATED
+#define SQLITE_EXPERIMENTAL
+
+/*
+** Ensure these symbols were not defined by some previous header file.
+*/
+#ifdef SQLITE_VERSION
+# undef SQLITE_VERSION
+#endif
+#ifdef SQLITE_VERSION_NUMBER
+# undef SQLITE_VERSION_NUMBER
+#endif
+
+/*
+** CAPI3REF: Compile-Time Library Version Numbers
+**
+** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header
+** evaluates to a string literal that is the SQLite version in the
+** format "X.Y.Z" where X is the major version number (always 3 for
+** SQLite3) and Y is the minor version number and Z is the release number.)^
+** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer
+** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same
+** numbers used in [SQLITE_VERSION].)^
+** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
+** be larger than the release from which it is derived.  Either Y will
+** be held constant and Z will be incremented or else Y will be incremented
+** and Z will be reset to zero.
+**
+** Since version 3.6.18, SQLite source code has been stored in the
+** <a href="http://www.fossil-scm.org/">Fossil configuration management
+** system</a>.  ^The SQLITE_SOURCE_ID macro evaluates to
+** a string which identifies a particular check-in of SQLite
+** within its configuration management system.  ^The SQLITE_SOURCE_ID
+** string contains the date and time of the check-in (UTC) and an SHA1
+** hash of the entire source tree.
+**
+** See also: [sqlite3_libversion()],
+** [sqlite3_libversion_number()], [sqlite3_sourceid()],
+** [sqlite_version()] and [sqlite_source_id()].
+*/
+#define SQLITE_VERSION        "3.8.5"
+#define SQLITE_VERSION_NUMBER 3008005
+#define SQLITE_SOURCE_ID      "2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212"
+
+/*
+** CAPI3REF: Run-Time Library Version Numbers
+** KEYWORDS: sqlite3_version, sqlite3_sourceid
+**
+** These interfaces provide the same information as the [SQLITE_VERSION],
+** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
+** but are associated with the library instead of the header file.  ^(Cautious
+** programmers might include assert() statements in their application to
+** verify that values returned by these interfaces match the macros in
+** the header, and thus insure that the application is
+** compiled with matching library and header files.
+**
+** <blockquote><pre>
+** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
+** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
+** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
+** </pre></blockquote>)^
+**
+** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
+** macro.  ^The sqlite3_libversion() function returns a pointer to the
+** to the sqlite3_version[] string constant.  The sqlite3_libversion()
+** function is provided for use in DLLs since DLL users usually do not have
+** direct access to string constants within the DLL.  ^The
+** sqlite3_libversion_number() function returns an integer equal to
+** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns 
+** a pointer to a string constant whose value is the same as the 
+** [SQLITE_SOURCE_ID] C preprocessor macro.
+**
+** See also: [sqlite_version()] and [sqlite_source_id()].
+*/
+SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
+SQLITE_API const char *sqlite3_libversion(void);
+SQLITE_API const char *sqlite3_sourceid(void);
+SQLITE_API int sqlite3_libversion_number(void);
+
+/*
+** CAPI3REF: Run-Time Library Compilation Options Diagnostics
+**
+** ^The sqlite3_compileoption_used() function returns 0 or 1 
+** indicating whether the specified option was defined at 
+** compile time.  ^The SQLITE_ prefix may be omitted from the 
+** option name passed to sqlite3_compileoption_used().  
+**
+** ^The sqlite3_compileoption_get() function allows iterating
+** over the list of options that were defined at compile time by
+** returning the N-th compile time option string.  ^If N is out of range,
+** sqlite3_compileoption_get() returns a NULL pointer.  ^The SQLITE_ 
+** prefix is omitted from any strings returned by 
+** sqlite3_compileoption_get().
+**
+** ^Support for the diagnostic functions sqlite3_compileoption_used()
+** and sqlite3_compileoption_get() may be omitted by specifying the 
+** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
+**
+** See also: SQL functions [sqlite_compileoption_used()] and
+** [sqlite_compileoption_get()] and the [compile_options pragma].
+*/
+#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
+SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
+SQLITE_API const char *sqlite3_compileoption_get(int N);
+#endif
+
+/*
+** CAPI3REF: Test To See If The Library Is Threadsafe
+**
+** ^The sqlite3_threadsafe() function returns zero if and only if
+** SQLite was compiled with mutexing code omitted due to the
+** [SQLITE_THREADSAFE] compile-time option being set to 0.
+**
+** SQLite can be compiled with or without mutexes.  When
+** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes
+** are enabled and SQLite is threadsafe.  When the
+** [SQLITE_THREADSAFE] macro is 0, 
+** the mutexes are omitted.  Without the mutexes, it is not safe
+** to use SQLite concurrently from more than one thread.
+**
+** Enabling mutexes incurs a measurable performance penalty.
+** So if speed is of utmost importance, it makes sense to disable
+** the mutexes.  But for maximum safety, mutexes should be enabled.
+** ^The default behavior is for mutexes to be enabled.
+**
+** This interface can be used by an application to make sure that the
+** version of SQLite that it is linking against was compiled with
+** the desired setting of the [SQLITE_THREADSAFE] macro.
+**
+** This interface only reports on the compile-time mutex setting
+** of the [SQLITE_THREADSAFE] flag.  If SQLite is compiled with
+** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but
+** can be fully or partially disabled using a call to [sqlite3_config()]
+** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],
+** or [SQLITE_CONFIG_MUTEX].  ^(The return value of the
+** sqlite3_threadsafe() function shows only the compile-time setting of
+** thread safety, not any run-time changes to that setting made by
+** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
+** is unchanged by calls to sqlite3_config().)^
+**
+** See the [threading mode] documentation for additional information.
+*/
+SQLITE_API int sqlite3_threadsafe(void);
+
+/*
+** CAPI3REF: Database Connection Handle
+** KEYWORDS: {database connection} {database connections}
+**
+** Each open SQLite database is represented by a pointer to an instance of
+** the opaque structure named "sqlite3".  It is useful to think of an sqlite3
+** pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and
+** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
+** and [sqlite3_close_v2()] are its destructors.  There are many other
+** interfaces (such as
+** [sqlite3_prepare_v2()], [sqlite3_create_function()], and
+** [sqlite3_busy_timeout()] to name but three) that are methods on an
+** sqlite3 object.
+*/
+typedef struct sqlite3 sqlite3;
+
+/*
+** CAPI3REF: 64-Bit Integer Types
+** KEYWORDS: sqlite_int64 sqlite_uint64
+**
+** Because there is no cross-platform way to specify 64-bit integer types
+** SQLite includes typedefs for 64-bit signed and unsigned integers.
+**
+** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
+** The sqlite_int64 and sqlite_uint64 types are supported for backwards
+** compatibility only.
+**
+** ^The sqlite3_int64 and sqlite_int64 types can store integer values
+** between -9223372036854775808 and +9223372036854775807 inclusive.  ^The
+** sqlite3_uint64 and sqlite_uint64 types can store integer values 
+** between 0 and +18446744073709551615 inclusive.
+*/
+#ifdef SQLITE_INT64_TYPE
+  typedef SQLITE_INT64_TYPE sqlite_int64;
+  typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
+#elif defined(_MSC_VER) || defined(__BORLANDC__)
+  typedef __int64 sqlite_int64;
+  typedef unsigned __int64 sqlite_uint64;
+#else
+  typedef long long int sqlite_int64;
+  typedef unsigned long long int sqlite_uint64;
+#endif
+typedef sqlite_int64 sqlite3_int64;
+typedef sqlite_uint64 sqlite3_uint64;
+
+/*
+** If compiling for a processor that lacks floating point support,
+** substitute integer for floating-point.
+*/
+#ifdef SQLITE_OMIT_FLOATING_POINT
+# define double sqlite3_int64
+#endif
+
+/*
+** CAPI3REF: Closing A Database Connection
+**
+** ^The sqlite3_close() and sqlite3_close_v2() routines are destructors
+** for the [sqlite3] object.
+** ^Calls to sqlite3_close() and sqlite3_close_v2() return SQLITE_OK if
+** the [sqlite3] object is successfully destroyed and all associated
+** resources are deallocated.
+**
+** ^If the database connection is associated with unfinalized prepared
+** statements or unfinished sqlite3_backup objects then sqlite3_close()
+** will leave the database connection open and return [SQLITE_BUSY].
+** ^If sqlite3_close_v2() is called with unfinalized prepared statements
+** and unfinished sqlite3_backups, then the database connection becomes
+** an unusable "zombie" which will automatically be deallocated when the
+** last prepared statement is finalized or the last sqlite3_backup is
+** finished.  The sqlite3_close_v2() interface is intended for use with
+** host languages that are garbage collected, and where the order in which
+** destructors are called is arbitrary.
+**
+** Applications should [sqlite3_finalize | finalize] all [prepared statements],
+** [sqlite3_blob_close | close] all [BLOB handles], and 
+** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
+** with the [sqlite3] object prior to attempting to close the object.  ^If
+** sqlite3_close_v2() is called on a [database connection] that still has
+** outstanding [prepared statements], [BLOB handles], and/or
+** [sqlite3_backup] objects then it returns SQLITE_OK but the deallocation
+** of resources is deferred until all [prepared statements], [BLOB handles],
+** and [sqlite3_backup] objects are also destroyed.
+**
+** ^If an [sqlite3] object is destroyed while a transaction is open,
+** the transaction is automatically rolled back.
+**
+** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
+** must be either a NULL
+** pointer or an [sqlite3] object pointer obtained
+** from [sqlite3_open()], [sqlite3_open16()], or
+** [sqlite3_open_v2()], and not previously closed.
+** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
+** argument is a harmless no-op.
+*/
+SQLITE_API int sqlite3_close(sqlite3*);
+SQLITE_API int sqlite3_close_v2(sqlite3*);
+
+/*
+** The type for a callback function.
+** This is legacy and deprecated.  It is included for historical
+** compatibility and is not documented.
+*/
+typedef int (*sqlite3_callback)(void*,int,char**, char**);
+
+/*
+** CAPI3REF: One-Step Query Execution Interface
+**
+** The sqlite3_exec() interface is a convenience wrapper around
+** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
+** that allows an application to run multiple statements of SQL
+** without having to use a lot of C code. 
+**
+** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
+** semicolon-separate SQL statements passed into its 2nd argument,
+** in the context of the [database connection] passed in as its 1st
+** argument.  ^If the callback function of the 3rd argument to
+** sqlite3_exec() is not NULL, then it is invoked for each result row
+** coming out of the evaluated SQL statements.  ^The 4th argument to
+** sqlite3_exec() is relayed through to the 1st argument of each
+** callback invocation.  ^If the callback pointer to sqlite3_exec()
+** is NULL, then no callback is ever invoked and result rows are
+** ignored.
+**
+** ^If an error occurs while evaluating the SQL statements passed into
+** sqlite3_exec(), then execution of the current statement stops and
+** subsequent statements are skipped.  ^If the 5th parameter to sqlite3_exec()
+** is not NULL then any error message is written into memory obtained
+** from [sqlite3_malloc()] and passed back through the 5th parameter.
+** To avoid memory leaks, the application should invoke [sqlite3_free()]
+** on error message strings returned through the 5th parameter of
+** of sqlite3_exec() after the error message string is no longer needed.
+** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
+** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
+** NULL before returning.
+**
+** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
+** routine returns SQLITE_ABORT without invoking the callback again and
+** without running any subsequent SQL statements.
+**
+** ^The 2nd argument to the sqlite3_exec() callback function is the
+** number of columns in the result.  ^The 3rd argument to the sqlite3_exec()
+** callback is an array of pointers to strings obtained as if from
+** [sqlite3_column_text()], one for each column.  ^If an element of a
+** result row is NULL then the corresponding string pointer for the
+** sqlite3_exec() callback is a NULL pointer.  ^The 4th argument to the
+** sqlite3_exec() callback is an array of pointers to strings where each
+** entry represents the name of corresponding result column as obtained
+** from [sqlite3_column_name()].
+**
+** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
+** to an empty string, or a pointer that contains only whitespace and/or 
+** SQL comments, then no SQL statements are evaluated and the database
+** is not changed.
+**
+** Restrictions:
+**
+** <ul>
+** <li> The application must insure that the 1st parameter to sqlite3_exec()
+**      is a valid and open [database connection].
+** <li> The application must not close the [database connection] specified by
+**      the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
+** <li> The application must not modify the SQL statement text passed into
+**      the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
+** </ul>
+*/
+SQLITE_API int sqlite3_exec(
+  sqlite3*,                                  /* An open database */
+  const char *sql,                           /* SQL to be evaluated */
+  int (*callback)(void*,int,char**,char**),  /* Callback function */
+  void *,                                    /* 1st argument to callback */
+  char **errmsg                              /* Error msg written here */
+);
+
+/*
+** CAPI3REF: Result Codes
+** KEYWORDS: SQLITE_OK {error code} {error codes}
+** KEYWORDS: {result code} {result codes}
+**
+** Many SQLite functions return an integer result code from the set shown
+** here in order to indicate success or failure.
+**
+** New error codes may be added in future versions of SQLite.
+**
+** See also: [SQLITE_IOERR_READ | extended result codes],
+** [sqlite3_vtab_on_conflict()] [SQLITE_ROLLBACK | result codes].
+*/
+#define SQLITE_OK           0   /* Successful result */
+/* beginning-of-error-codes */
+#define SQLITE_ERROR        1   /* SQL error or missing database */
+#define SQLITE_INTERNAL     2   /* Internal logic error in SQLite */
+#define SQLITE_PERM         3   /* Access permission denied */
+#define SQLITE_ABORT        4   /* Callback routine requested an abort */
+#define SQLITE_BUSY         5   /* The database file is locked */
+#define SQLITE_LOCKED       6   /* A table in the database is locked */
+#define SQLITE_NOMEM        7   /* A malloc() failed */
+#define SQLITE_READONLY     8   /* Attempt to write a readonly database */
+#define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite3_interrupt()*/
+#define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
+#define SQLITE_CORRUPT     11   /* The database disk image is malformed */
+#define SQLITE_NOTFOUND    12   /* Unknown opcode in sqlite3_file_control() */
+#define SQLITE_FULL        13   /* Insertion failed because database is full */
+#define SQLITE_CANTOPEN    14   /* Unable to open the database file */
+#define SQLITE_PROTOCOL    15   /* Database lock protocol error */
+#define SQLITE_EMPTY       16   /* Database is empty */
+#define SQLITE_SCHEMA      17   /* The database schema changed */
+#define SQLITE_TOOBIG      18   /* String or BLOB exceeds size limit */
+#define SQLITE_CONSTRAINT  19   /* Abort due to constraint violation */
+#define SQLITE_MISMATCH    20   /* Data type mismatch */
+#define SQLITE_MISUSE      21   /* Library used incorrectly */
+#define SQLITE_NOLFS       22   /* Uses OS features not supported on host */
+#define SQLITE_AUTH        23   /* Authorization denied */
+#define SQLITE_FORMAT      24   /* Auxiliary database format error */
+#define SQLITE_RANGE       25   /* 2nd parameter to sqlite3_bind out of range */
+#define SQLITE_NOTADB      26   /* File opened that is not a database file */
+#define SQLITE_NOTICE      27   /* Notifications from sqlite3_log() */
+#define SQLITE_WARNING     28   /* Warnings from sqlite3_log() */
+#define SQLITE_ROW         100  /* sqlite3_step() has another row ready */
+#define SQLITE_DONE        101  /* sqlite3_step() has finished executing */
+/* end-of-error-codes */
+
+/*
+** CAPI3REF: Extended Result Codes
+** KEYWORDS: {extended error code} {extended error codes}
+** KEYWORDS: {extended result code} {extended result codes}
+**
+** In its default configuration, SQLite API routines return one of 26 integer
+** [SQLITE_OK | result codes].  However, experience has shown that many of
+** these result codes are too coarse-grained.  They do not provide as
+** much information about problems as programmers might like.  In an effort to
+** address this, newer versions of SQLite (version 3.3.8 and later) include
+** support for additional result codes that provide more detailed information
+** about errors. The extended result codes are enabled or disabled
+** on a per database connection basis using the
+** [sqlite3_extended_result_codes()] API.
+**
+** Some of the available extended result codes are listed here.
+** One may expect the number of extended result codes will increase
+** over time.  Software that uses extended result codes should expect
+** to see new result codes in future releases of SQLite.
+**
+** The SQLITE_OK result code will never be extended.  It will always
+** be exactly zero.
+*/
+#define SQLITE_IOERR_READ              (SQLITE_IOERR | (1<<8))
+#define SQLITE_IOERR_SHORT_READ        (SQLITE_IOERR | (2<<8))
+#define SQLITE_IOERR_WRITE             (SQLITE_IOERR | (3<<8))
+#define SQLITE_IOERR_FSYNC             (SQLITE_IOERR | (4<<8))
+#define SQLITE_IOERR_DIR_FSYNC         (SQLITE_IOERR | (5<<8))
+#define SQLITE_IOERR_TRUNCATE          (SQLITE_IOERR | (6<<8))
+#define SQLITE_IOERR_FSTAT             (SQLITE_IOERR | (7<<8))
+#define SQLITE_IOERR_UNLOCK            (SQLITE_IOERR | (8<<8))
+#define SQLITE_IOERR_RDLOCK            (SQLITE_IOERR | (9<<8))
+#define SQLITE_IOERR_DELETE            (SQLITE_IOERR | (10<<8))
+#define SQLITE_IOERR_BLOCKED           (SQLITE_IOERR | (11<<8))
+#define SQLITE_IOERR_NOMEM             (SQLITE_IOERR | (12<<8))
+#define SQLITE_IOERR_ACCESS            (SQLITE_IOERR | (13<<8))
+#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8))
+#define SQLITE_IOERR_LOCK              (SQLITE_IOERR | (15<<8))
+#define SQLITE_IOERR_CLOSE             (SQLITE_IOERR | (16<<8))
+#define SQLITE_IOERR_DIR_CLOSE         (SQLITE_IOERR | (17<<8))
+#define SQLITE_IOERR_SHMOPEN           (SQLITE_IOERR | (18<<8))
+#define SQLITE_IOERR_SHMSIZE           (SQLITE_IOERR | (19<<8))
+#define SQLITE_IOERR_SHMLOCK           (SQLITE_IOERR | (20<<8))
+#define SQLITE_IOERR_SHMMAP            (SQLITE_IOERR | (21<<8))
+#define SQLITE_IOERR_SEEK              (SQLITE_IOERR | (22<<8))
+#define SQLITE_IOERR_DELETE_NOENT      (SQLITE_IOERR | (23<<8))
+#define SQLITE_IOERR_MMAP              (SQLITE_IOERR | (24<<8))
+#define SQLITE_IOERR_GETTEMPPATH       (SQLITE_IOERR | (25<<8))
+#define SQLITE_IOERR_CONVPATH          (SQLITE_IOERR | (26<<8))
+#define SQLITE_LOCKED_SHAREDCACHE      (SQLITE_LOCKED |  (1<<8))
+#define SQLITE_BUSY_RECOVERY           (SQLITE_BUSY   |  (1<<8))
+#define SQLITE_BUSY_SNAPSHOT           (SQLITE_BUSY   |  (2<<8))
+#define SQLITE_CANTOPEN_NOTEMPDIR      (SQLITE_CANTOPEN | (1<<8))
+#define SQLITE_CANTOPEN_ISDIR          (SQLITE_CANTOPEN | (2<<8))
+#define SQLITE_CANTOPEN_FULLPATH       (SQLITE_CANTOPEN | (3<<8))
+#define SQLITE_CANTOPEN_CONVPATH       (SQLITE_CANTOPEN | (4<<8))
+#define SQLITE_CORRUPT_VTAB            (SQLITE_CORRUPT | (1<<8))
+#define SQLITE_READONLY_RECOVERY       (SQLITE_READONLY | (1<<8))
+#define SQLITE_READONLY_CANTLOCK       (SQLITE_READONLY | (2<<8))
+#define SQLITE_READONLY_ROLLBACK       (SQLITE_READONLY | (3<<8))
+#define SQLITE_READONLY_DBMOVED        (SQLITE_READONLY | (4<<8))
+#define SQLITE_ABORT_ROLLBACK          (SQLITE_ABORT | (2<<8))
+#define SQLITE_CONSTRAINT_CHECK        (SQLITE_CONSTRAINT | (1<<8))
+#define SQLITE_CONSTRAINT_COMMITHOOK   (SQLITE_CONSTRAINT | (2<<8))
+#define SQLITE_CONSTRAINT_FOREIGNKEY   (SQLITE_CONSTRAINT | (3<<8))
+#define SQLITE_CONSTRAINT_FUNCTION     (SQLITE_CONSTRAINT | (4<<8))
+#define SQLITE_CONSTRAINT_NOTNULL      (SQLITE_CONSTRAINT | (5<<8))
+#define SQLITE_CONSTRAINT_PRIMARYKEY   (SQLITE_CONSTRAINT | (6<<8))
+#define SQLITE_CONSTRAINT_TRIGGER      (SQLITE_CONSTRAINT | (7<<8))
+#define SQLITE_CONSTRAINT_UNIQUE       (SQLITE_CONSTRAINT | (8<<8))
+#define SQLITE_CONSTRAINT_VTAB         (SQLITE_CONSTRAINT | (9<<8))
+#define SQLITE_CONSTRAINT_ROWID        (SQLITE_CONSTRAINT |(10<<8))
+#define SQLITE_NOTICE_RECOVER_WAL      (SQLITE_NOTICE | (1<<8))
+#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
+#define SQLITE_WARNING_AUTOINDEX       (SQLITE_WARNING | (1<<8))
+
+/*
+** CAPI3REF: Flags For File Open Operations
+**
+** These bit values are intended for use in the
+** 3rd parameter to the [sqlite3_open_v2()] interface and
+** in the 4th parameter to the [sqlite3_vfs.xOpen] method.
+*/
+#define SQLITE_OPEN_READONLY         0x00000001  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_READWRITE        0x00000002  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_CREATE           0x00000004  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_DELETEONCLOSE    0x00000008  /* VFS only */
+#define SQLITE_OPEN_EXCLUSIVE        0x00000010  /* VFS only */
+#define SQLITE_OPEN_AUTOPROXY        0x00000020  /* VFS only */
+#define SQLITE_OPEN_URI              0x00000040  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_MEMORY           0x00000080  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_MAIN_DB          0x00000100  /* VFS only */
+#define SQLITE_OPEN_TEMP_DB          0x00000200  /* VFS only */
+#define SQLITE_OPEN_TRANSIENT_DB     0x00000400  /* VFS only */
+#define SQLITE_OPEN_MAIN_JOURNAL     0x00000800  /* VFS only */
+#define SQLITE_OPEN_TEMP_JOURNAL     0x00001000  /* VFS only */
+#define SQLITE_OPEN_SUBJOURNAL       0x00002000  /* VFS only */
+#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000  /* VFS only */
+#define SQLITE_OPEN_NOMUTEX          0x00008000  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_FULLMUTEX        0x00010000  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_SHAREDCACHE      0x00020000  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_PRIVATECACHE     0x00040000  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_WAL              0x00080000  /* VFS only */
+
+/* Reserved:                         0x00F00000 */
+
+/*
+** CAPI3REF: Device Characteristics
+**
+** The xDeviceCharacteristics method of the [sqlite3_io_methods]
+** object returns an integer which is a vector of these
+** bit values expressing I/O characteristics of the mass storage
+** device that holds the file that the [sqlite3_io_methods]
+** refers to.
+**
+** The SQLITE_IOCAP_ATOMIC property means that all writes of
+** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
+** mean that writes of blocks that are nnn bytes in size and
+** are aligned to an address which is an integer multiple of
+** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
+** that when data is appended to a file, the data is appended
+** first then the size of the file is extended, never the other
+** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
+** information is written to disk in the same order as calls
+** to xWrite().  The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
+** after reboot following a crash or power loss, the only bytes in a
+** file that were written at the application level might have changed
+** and that adjacent bytes, even bytes within the same sector are
+** guaranteed to be unchanged.  The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
+** flag indicate that a file cannot be deleted when open.  The
+** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
+** read-only media and cannot be changed even by processes with
+** elevated privileges.
+*/
+#define SQLITE_IOCAP_ATOMIC                 0x00000001
+#define SQLITE_IOCAP_ATOMIC512              0x00000002
+#define SQLITE_IOCAP_ATOMIC1K               0x00000004
+#define SQLITE_IOCAP_ATOMIC2K               0x00000008
+#define SQLITE_IOCAP_ATOMIC4K               0x00000010
+#define SQLITE_IOCAP_ATOMIC8K               0x00000020
+#define SQLITE_IOCAP_ATOMIC16K              0x00000040
+#define SQLITE_IOCAP_ATOMIC32K              0x00000080
+#define SQLITE_IOCAP_ATOMIC64K              0x00000100
+#define SQLITE_IOCAP_SAFE_APPEND            0x00000200
+#define SQLITE_IOCAP_SEQUENTIAL             0x00000400
+#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN  0x00000800
+#define SQLITE_IOCAP_POWERSAFE_OVERWRITE    0x00001000
+#define SQLITE_IOCAP_IMMUTABLE              0x00002000
+
+/*
+** CAPI3REF: File Locking Levels
+**
+** SQLite uses one of these integer values as the second
+** argument to calls it makes to the xLock() and xUnlock() methods
+** of an [sqlite3_io_methods] object.
+*/
+#define SQLITE_LOCK_NONE          0
+#define SQLITE_LOCK_SHARED        1
+#define SQLITE_LOCK_RESERVED      2
+#define SQLITE_LOCK_PENDING       3
+#define SQLITE_LOCK_EXCLUSIVE     4
+
+/*
+** CAPI3REF: Synchronization Type Flags
+**
+** When SQLite invokes the xSync() method of an
+** [sqlite3_io_methods] object it uses a combination of
+** these integer values as the second argument.
+**
+** When the SQLITE_SYNC_DATAONLY flag is used, it means that the
+** sync operation only needs to flush data to mass storage.  Inode
+** information need not be flushed. If the lower four bits of the flag
+** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
+** If the lower four bits equal SQLITE_SYNC_FULL, that means
+** to use Mac OS X style fullsync instead of fsync().
+**
+** Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
+** with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
+** settings.  The [synchronous pragma] determines when calls to the
+** xSync VFS method occur and applies uniformly across all platforms.
+** The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
+** energetic or rigorous or forceful the sync operations are and
+** only make a difference on Mac OSX for the default SQLite code.
+** (Third-party VFS implementations might also make the distinction
+** between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
+** operating systems natively supported by SQLite, only Mac OSX
+** cares about the difference.)
+*/
+#define SQLITE_SYNC_NORMAL        0x00002
+#define SQLITE_SYNC_FULL          0x00003
+#define SQLITE_SYNC_DATAONLY      0x00010
+
+/*
+** CAPI3REF: OS Interface Open File Handle
+**
+** An [sqlite3_file] object represents an open file in the 
+** [sqlite3_vfs | OS interface layer].  Individual OS interface
+** implementations will
+** want to subclass this object by appending additional fields
+** for their own use.  The pMethods entry is a pointer to an
+** [sqlite3_io_methods] object that defines methods for performing
+** I/O operations on the open file.
+*/
+typedef struct sqlite3_file sqlite3_file;
+struct sqlite3_file {
+  const struct sqlite3_io_methods *pMethods;  /* Methods for an open file */
+};
+
+/*
+** CAPI3REF: OS Interface File Virtual Methods Object
+**
+** Every file opened by the [sqlite3_vfs.xOpen] method populates an
+** [sqlite3_file] object (or, more commonly, a subclass of the
+** [sqlite3_file] object) with a pointer to an instance of this object.
+** This object defines the methods used to perform various operations
+** against the open file represented by the [sqlite3_file] object.
+**
+** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element 
+** to a non-NULL pointer, then the sqlite3_io_methods.xClose method
+** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed.  The
+** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen]
+** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
+** to NULL.
+**
+** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or
+** [SQLITE_SYNC_FULL].  The first choice is the normal fsync().
+** The second choice is a Mac OS X style fullsync.  The [SQLITE_SYNC_DATAONLY]
+** flag may be ORed in to indicate that only the data of the file
+** and not its inode needs to be synced.
+**
+** The integer values to xLock() and xUnlock() are one of
+** <ul>
+** <li> [SQLITE_LOCK_NONE],
+** <li> [SQLITE_LOCK_SHARED],
+** <li> [SQLITE_LOCK_RESERVED],
+** <li> [SQLITE_LOCK_PENDING], or
+** <li> [SQLITE_LOCK_EXCLUSIVE].
+** </ul>
+** xLock() increases the lock. xUnlock() decreases the lock.
+** The xCheckReservedLock() method checks whether any database connection,
+** either in this process or in some other process, is holding a RESERVED,
+** PENDING, or EXCLUSIVE lock on the file.  It returns true
+** if such a lock exists and false otherwise.
+**
+** The xFileControl() method is a generic interface that allows custom
+** VFS implementations to directly control an open file using the
+** [sqlite3_file_control()] interface.  The second "op" argument is an
+** integer opcode.  The third argument is a generic pointer intended to
+** point to a structure that may contain arguments or space in which to
+** write return values.  Potential uses for xFileControl() might be
+** functions to enable blocking locks with timeouts, to change the
+** locking strategy (for example to use dot-file locks), to inquire
+** about the status of a lock, or to break stale locks.  The SQLite
+** core reserves all opcodes less than 100 for its own use.
+** A [SQLITE_FCNTL_LOCKSTATE | list of opcodes] less than 100 is available.
+** Applications that define a custom xFileControl method should use opcodes
+** greater than 100 to avoid conflicts.  VFS implementations should
+** return [SQLITE_NOTFOUND] for file control opcodes that they do not
+** recognize.
+**
+** The xSectorSize() method returns the sector size of the
+** device that underlies the file.  The sector size is the
+** minimum write that can be performed without disturbing
+** other bytes in the file.  The xDeviceCharacteristics()
+** method returns a bit vector describing behaviors of the
+** underlying device:
+**
+** <ul>
+** <li> [SQLITE_IOCAP_ATOMIC]
+** <li> [SQLITE_IOCAP_ATOMIC512]
+** <li> [SQLITE_IOCAP_ATOMIC1K]
+** <li> [SQLITE_IOCAP_ATOMIC2K]
+** <li> [SQLITE_IOCAP_ATOMIC4K]
+** <li> [SQLITE_IOCAP_ATOMIC8K]
+** <li> [SQLITE_IOCAP_ATOMIC16K]
+** <li> [SQLITE_IOCAP_ATOMIC32K]
+** <li> [SQLITE_IOCAP_ATOMIC64K]
+** <li> [SQLITE_IOCAP_SAFE_APPEND]
+** <li> [SQLITE_IOCAP_SEQUENTIAL]
+** </ul>
+**
+** The SQLITE_IOCAP_ATOMIC property means that all writes of
+** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
+** mean that writes of blocks that are nnn bytes in size and
+** are aligned to an address which is an integer multiple of
+** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
+** that when data is appended to a file, the data is appended
+** first then the size of the file is extended, never the other
+** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
+** information is written to disk in the same order as calls
+** to xWrite().
+**
+** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
+** in the unread portions of the buffer with zeros.  A VFS that
+** fails to zero-fill short reads might seem to work.  However,
+** failure to zero-fill short reads will eventually lead to
+** database corruption.
+*/
+typedef struct sqlite3_io_methods sqlite3_io_methods;
+struct sqlite3_io_methods {
+  int iVersion;
+  int (*xClose)(sqlite3_file*);
+  int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
+  int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
+  int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
+  int (*xSync)(sqlite3_file*, int flags);
+  int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
+  int (*xLock)(sqlite3_file*, int);
+  int (*xUnlock)(sqlite3_file*, int);
+  int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
+  int (*xFileControl)(sqlite3_file*, int op, void *pArg);
+  int (*xSectorSize)(sqlite3_file*);
+  int (*xDeviceCharacteristics)(sqlite3_file*);
+  /* Methods above are valid for version 1 */
+  int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
+  int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
+  void (*xShmBarrier)(sqlite3_file*);
+  int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
+  /* Methods above are valid for version 2 */
+  int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
+  int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
+  /* Methods above are valid for version 3 */
+  /* Additional methods may be added in future releases */
+};
+
+/*
+** CAPI3REF: Standard File Control Opcodes
+**
+** These integer constants are opcodes for the xFileControl method
+** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()]
+** interface.
+**
+** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging.  This
+** opcode causes the xFileControl method to write the current state of
+** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],
+** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])
+** into an integer that the pArg argument points to. This capability
+** is used during testing and only needs to be supported when SQLITE_TEST
+** is defined.
+** <ul>
+** <li>[[SQLITE_FCNTL_SIZE_HINT]]
+** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
+** layer a hint of how large the database file will grow to be during the
+** current transaction.  This hint is not guaranteed to be accurate but it
+** is often close.  The underlying VFS might choose to preallocate database
+** file space based on this hint in order to help writes to the database
+** file run faster.
+**
+** <li>[[SQLITE_FCNTL_CHUNK_SIZE]]
+** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS
+** extends and truncates the database file in chunks of a size specified
+** by the user. The fourth argument to [sqlite3_file_control()] should 
+** point to an integer (type int) containing the new chunk-size to use
+** for the nominated database. Allocating database file space in large
+** chunks (say 1MB at a time), may reduce file-system fragmentation and
+** improve performance on some systems.
+**
+** <li>[[SQLITE_FCNTL_FILE_POINTER]]
+** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer
+** to the [sqlite3_file] object associated with a particular database
+** connection.  See the [sqlite3_file_control()] documentation for
+** additional information.
+**
+** <li>[[SQLITE_FCNTL_SYNC_OMITTED]]
+** No longer in use.
+**
+** <li>[[SQLITE_FCNTL_SYNC]]
+** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and
+** sent to the VFS immediately before the xSync method is invoked on a
+** database file descriptor. Or, if the xSync method is not invoked 
+** because the user has configured SQLite with 
+** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place 
+** of the xSync method. In most cases, the pointer argument passed with
+** this file-control is NULL. However, if the database file is being synced
+** as part of a multi-database commit, the argument points to a nul-terminated
+** string containing the transactions master-journal file name. VFSes that 
+** do not need this signal should silently ignore this opcode. Applications 
+** should not call [sqlite3_file_control()] with this opcode as doing so may 
+** disrupt the operation of the specialized VFSes that do require it.  
+**
+** <li>[[SQLITE_FCNTL_COMMIT_PHASETWO]]
+** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite
+** and sent to the VFS after a transaction has been committed immediately
+** but before the database is unlocked. VFSes that do not need this signal
+** should silently ignore this opcode. Applications should not call
+** [sqlite3_file_control()] with this opcode as doing so may disrupt the 
+** operation of the specialized VFSes that do require it.  
+**
+** <li>[[SQLITE_FCNTL_WIN32_AV_RETRY]]
+** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic
+** retry counts and intervals for certain disk I/O operations for the
+** windows [VFS] in order to provide robustness in the presence of
+** anti-virus programs.  By default, the windows VFS will retry file read,
+** file write, and file delete operations up to 10 times, with a delay
+** of 25 milliseconds before the first retry and with the delay increasing
+** by an additional 25 milliseconds with each subsequent retry.  This
+** opcode allows these two values (10 retries and 25 milliseconds of delay)
+** to be adjusted.  The values are changed for all database connections
+** within the same process.  The argument is a pointer to an array of two
+** integers where the first integer i the new retry count and the second
+** integer is the delay.  If either integer is negative, then the setting
+** is not changed but instead the prior value of that setting is written
+** into the array entry, allowing the current retry settings to be
+** interrogated.  The zDbName parameter is ignored.
+**
+** <li>[[SQLITE_FCNTL_PERSIST_WAL]]
+** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the
+** persistent [WAL | Write Ahead Log] setting.  By default, the auxiliary
+** write ahead log and shared memory files used for transaction control
+** are automatically deleted when the latest connection to the database
+** closes.  Setting persistent WAL mode causes those files to persist after
+** close.  Persisting the files is useful when other processes that do not
+** have write permission on the directory containing the database file want
+** to read the database file, as the WAL and shared memory files must exist
+** in order for the database to be readable.  The fourth parameter to
+** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
+** That integer is 0 to disable persistent WAL mode or 1 to enable persistent
+** WAL mode.  If the integer is -1, then it is overwritten with the current
+** WAL persistence setting.
+**
+** <li>[[SQLITE_FCNTL_POWERSAFE_OVERWRITE]]
+** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the
+** persistent "powersafe-overwrite" or "PSOW" setting.  The PSOW setting
+** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the
+** xDeviceCharacteristics methods. The fourth parameter to
+** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
+** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage
+** mode.  If the integer is -1, then it is overwritten with the current
+** zero-damage mode setting.
+**
+** <li>[[SQLITE_FCNTL_OVERWRITE]]
+** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening
+** a write transaction to indicate that, unless it is rolled back for some
+** reason, the entire database file will be overwritten by the current 
+** transaction. This is used by VACUUM operations.
+**
+** <li>[[SQLITE_FCNTL_VFSNAME]]
+** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
+** all [VFSes] in the VFS stack.  The names are of all VFS shims and the
+** final bottom-level VFS are written into memory obtained from 
+** [sqlite3_malloc()] and the result is stored in the char* variable
+** that the fourth parameter of [sqlite3_file_control()] points to.
+** The caller is responsible for freeing the memory when done.  As with
+** all file-control actions, there is no guarantee that this will actually
+** do anything.  Callers should initialize the char* variable to a NULL
+** pointer in case this file-control is not implemented.  This file-control
+** is intended for diagnostic use only.
+**
+** <li>[[SQLITE_FCNTL_PRAGMA]]
+** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] 
+** file control is sent to the open [sqlite3_file] object corresponding
+** to the database file to which the pragma statement refers. ^The argument
+** to the [SQLITE_FCNTL_PRAGMA] file control is an array of
+** pointers to strings (char**) in which the second element of the array
+** is the name of the pragma and the third element is the argument to the
+** pragma or NULL if the pragma has no argument.  ^The handler for an
+** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element
+** of the char** argument point to a string obtained from [sqlite3_mprintf()]
+** or the equivalent and that string will become the result of the pragma or
+** the error message if the pragma fails. ^If the
+** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal 
+** [PRAGMA] processing continues.  ^If the [SQLITE_FCNTL_PRAGMA]
+** file control returns [SQLITE_OK], then the parser assumes that the
+** VFS has handled the PRAGMA itself and the parser generates a no-op
+** prepared statement.  ^If the [SQLITE_FCNTL_PRAGMA] file control returns
+** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means
+** that the VFS encountered an error while handling the [PRAGMA] and the
+** compilation of the PRAGMA fails with an error.  ^The [SQLITE_FCNTL_PRAGMA]
+** file control occurs at the beginning of pragma statement analysis and so
+** it is able to override built-in [PRAGMA] statements.
+**
+** <li>[[SQLITE_FCNTL_BUSYHANDLER]]
+** ^The [SQLITE_FCNTL_BUSYHANDLER]
+** file-control may be invoked by SQLite on the database file handle
+** shortly after it is opened in order to provide a custom VFS with access
+** to the connections busy-handler callback. The argument is of type (void **)
+** - an array of two (void *) values. The first (void *) actually points
+** to a function of type (int (*)(void *)). In order to invoke the connections
+** busy-handler, this function should be invoked with the second (void *) in
+** the array as the only argument. If it returns non-zero, then the operation
+** should be retried. If it returns zero, the custom VFS should abandon the
+** current operation.
+**
+** <li>[[SQLITE_FCNTL_TEMPFILENAME]]
+** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control
+** to have SQLite generate a
+** temporary filename using the same algorithm that is followed to generate
+** temporary filenames for TEMP tables and other internal uses.  The
+** argument should be a char** which will be filled with the filename
+** written into memory obtained from [sqlite3_malloc()].  The caller should
+** invoke [sqlite3_free()] on the result to avoid a memory leak.
+**
+** <li>[[SQLITE_FCNTL_MMAP_SIZE]]
+** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the
+** maximum number of bytes that will be used for memory-mapped I/O.
+** The argument is a pointer to a value of type sqlite3_int64 that
+** is an advisory maximum number of bytes in the file to memory map.  The
+** pointer is overwritten with the old value.  The limit is not changed if
+** the value originally pointed to is negative, and so the current limit 
+** can be queried by passing in a pointer to a negative number.  This
+** file-control is used internally to implement [PRAGMA mmap_size].
+**
+** <li>[[SQLITE_FCNTL_TRACE]]
+** The [SQLITE_FCNTL_TRACE] file control provides advisory information
+** to the VFS about what the higher layers of the SQLite stack are doing.
+** This file control is used by some VFS activity tracing [shims].
+** The argument is a zero-terminated string.  Higher layers in the
+** SQLite stack may generate instances of this file control if
+** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled.
+**
+** <li>[[SQLITE_FCNTL_HAS_MOVED]]
+** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a
+** pointer to an integer and it writes a boolean into that integer depending
+** on whether or not the file has been renamed, moved, or deleted since it
+** was first opened.
+**
+** <li>[[SQLITE_FCNTL_WIN32_SET_HANDLE]]
+** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging.  This
+** opcode causes the xFileControl method to swap the file handle with the one
+** pointed to by the pArg argument.  This capability is used during testing
+** and only needs to be supported when SQLITE_TEST is defined.
+**
+** </ul>
+*/
+#define SQLITE_FCNTL_LOCKSTATE               1
+#define SQLITE_GET_LOCKPROXYFILE             2
+#define SQLITE_SET_LOCKPROXYFILE             3
+#define SQLITE_LAST_ERRNO                    4
+#define SQLITE_FCNTL_SIZE_HINT               5
+#define SQLITE_FCNTL_CHUNK_SIZE              6
+#define SQLITE_FCNTL_FILE_POINTER            7
+#define SQLITE_FCNTL_SYNC_OMITTED            8
+#define SQLITE_FCNTL_WIN32_AV_RETRY          9
+#define SQLITE_FCNTL_PERSIST_WAL            10
+#define SQLITE_FCNTL_OVERWRITE              11
+#define SQLITE_FCNTL_VFSNAME                12
+#define SQLITE_FCNTL_POWERSAFE_OVERWRITE    13
+#define SQLITE_FCNTL_PRAGMA                 14
+#define SQLITE_FCNTL_BUSYHANDLER            15
+#define SQLITE_FCNTL_TEMPFILENAME           16
+#define SQLITE_FCNTL_MMAP_SIZE              18
+#define SQLITE_FCNTL_TRACE                  19
+#define SQLITE_FCNTL_HAS_MOVED              20
+#define SQLITE_FCNTL_SYNC                   21
+#define SQLITE_FCNTL_COMMIT_PHASETWO        22
+#define SQLITE_FCNTL_WIN32_SET_HANDLE       23
+
+/*
+** CAPI3REF: Mutex Handle
+**
+** The mutex module within SQLite defines [sqlite3_mutex] to be an
+** abstract type for a mutex object.  The SQLite core never looks
+** at the internal representation of an [sqlite3_mutex].  It only
+** deals with pointers to the [sqlite3_mutex] object.
+**
+** Mutexes are created using [sqlite3_mutex_alloc()].
+*/
+typedef struct sqlite3_mutex sqlite3_mutex;
+
+/*
+** CAPI3REF: OS Interface Object
+**
+** An instance of the sqlite3_vfs object defines the interface between
+** the SQLite core and the underlying operating system.  The "vfs"
+** in the name of the object stands for "virtual file system".  See
+** the [VFS | VFS documentation] for further information.
+**
+** The value of the iVersion field is initially 1 but may be larger in
+** future versions of SQLite.  Additional fields may be appended to this
+** object when the iVersion value is increased.  Note that the structure
+** of the sqlite3_vfs object changes in the transaction between
+** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not
+** modified.
+**
+** The szOsFile field is the size of the subclassed [sqlite3_file]
+** structure used by this VFS.  mxPathname is the maximum length of
+** a pathname in this VFS.
+**
+** Registered sqlite3_vfs objects are kept on a linked list formed by
+** the pNext pointer.  The [sqlite3_vfs_register()]
+** and [sqlite3_vfs_unregister()] interfaces manage this list
+** in a thread-safe way.  The [sqlite3_vfs_find()] interface
+** searches the list.  Neither the application code nor the VFS
+** implementation should use the pNext pointer.
+**
+** The pNext field is the only field in the sqlite3_vfs
+** structure that SQLite will ever modify.  SQLite will only access
+** or modify this field while holding a particular static mutex.
+** The application should never modify anything within the sqlite3_vfs
+** object once the object has been registered.
+**
+** The zName field holds the name of the VFS module.  The name must
+** be unique across all VFS modules.
+**
+** [[sqlite3_vfs.xOpen]]
+** ^SQLite guarantees that the zFilename parameter to xOpen
+** is either a NULL pointer or string obtained
+** from xFullPathname() with an optional suffix added.
+** ^If a suffix is added to the zFilename parameter, it will
+** consist of a single "-" character followed by no more than
+** 11 alphanumeric and/or "-" characters.
+** ^SQLite further guarantees that
+** the string will be valid and unchanged until xClose() is
+** called. Because of the previous sentence,
+** the [sqlite3_file] can safely store a pointer to the
+** filename if it needs to remember the filename for some reason.
+** If the zFilename parameter to xOpen is a NULL pointer then xOpen
+** must invent its own temporary name for the file.  ^Whenever the 
+** xFilename parameter is NULL it will also be the case that the
+** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
+**
+** The flags argument to xOpen() includes all bits set in
+** the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]
+** or [sqlite3_open16()] is used, then flags includes at least
+** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. 
+** If xOpen() opens a file read-only then it sets *pOutFlags to
+** include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.
+**
+** ^(SQLite will also add one of the following flags to the xOpen()
+** call, depending on the object being opened:
+**
+** <ul>
+** <li>  [SQLITE_OPEN_MAIN_DB]
+** <li>  [SQLITE_OPEN_MAIN_JOURNAL]
+** <li>  [SQLITE_OPEN_TEMP_DB]
+** <li>  [SQLITE_OPEN_TEMP_JOURNAL]
+** <li>  [SQLITE_OPEN_TRANSIENT_DB]
+** <li>  [SQLITE_OPEN_SUBJOURNAL]
+** <li>  [SQLITE_OPEN_MASTER_JOURNAL]
+** <li>  [SQLITE_OPEN_WAL]
+** </ul>)^
+**
+** The file I/O implementation can use the object type flags to
+** change the way it deals with files.  For example, an application
+** that does not care about crash recovery or rollback might make
+** the open of a journal file a no-op.  Writes to this journal would
+** also be no-ops, and any attempt to read the journal would return
+** SQLITE_IOERR.  Or the implementation might recognize that a database
+** file will be doing page-aligned sector reads and writes in a random
+** order and set up its I/O subsystem accordingly.
+**
+** SQLite might also add one of the following flags to the xOpen method:
+**
+** <ul>
+** <li> [SQLITE_OPEN_DELETEONCLOSE]
+** <li> [SQLITE_OPEN_EXCLUSIVE]
+** </ul>
+**
+** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
+** deleted when it is closed.  ^The [SQLITE_OPEN_DELETEONCLOSE]
+** will be set for TEMP databases and their journals, transient
+** databases, and subjournals.
+**
+** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction
+** with the [SQLITE_OPEN_CREATE] flag, which are both directly
+** analogous to the O_EXCL and O_CREAT flags of the POSIX open()
+** API.  The SQLITE_OPEN_EXCLUSIVE flag, when paired with the 
+** SQLITE_OPEN_CREATE, is used to indicate that file should always
+** be created, and that it is an error if it already exists.
+** It is <i>not</i> used to indicate the file should be opened 
+** for exclusive access.
+**
+** ^At least szOsFile bytes of memory are allocated by SQLite
+** to hold the  [sqlite3_file] structure passed as the third
+** argument to xOpen.  The xOpen method does not have to
+** allocate the structure; it should just fill it in.  Note that
+** the xOpen method must set the sqlite3_file.pMethods to either
+** a valid [sqlite3_io_methods] object or to NULL.  xOpen must do
+** this even if the open fails.  SQLite expects that the sqlite3_file.pMethods
+** element will be valid after xOpen returns regardless of the success
+** or failure of the xOpen call.
+**
+** [[sqlite3_vfs.xAccess]]
+** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
+** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
+** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
+** to test whether a file is at least readable.   The file can be a
+** directory.
+**
+** ^SQLite will always allocate at least mxPathname+1 bytes for the
+** output buffer xFullPathname.  The exact size of the output buffer
+** is also passed as a parameter to both  methods. If the output buffer
+** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
+** handled as a fatal error by SQLite, vfs implementations should endeavor
+** to prevent this by setting mxPathname to a sufficiently large value.
+**
+** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
+** interfaces are not strictly a part of the filesystem, but they are
+** included in the VFS structure for completeness.
+** The xRandomness() function attempts to return nBytes bytes
+** of good-quality randomness into zOut.  The return value is
+** the actual number of bytes of randomness obtained.
+** The xSleep() method causes the calling thread to sleep for at
+** least the number of microseconds given.  ^The xCurrentTime()
+** method returns a Julian Day Number for the current date and time as
+** a floating point value.
+** ^The xCurrentTimeInt64() method returns, as an integer, the Julian
+** Day Number multiplied by 86400000 (the number of milliseconds in 
+** a 24-hour day).  
+** ^SQLite will use the xCurrentTimeInt64() method to get the current
+** date and time if that method is available (if iVersion is 2 or 
+** greater and the function pointer is not NULL) and will fall back
+** to xCurrentTime() if xCurrentTimeInt64() is unavailable.
+**
+** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces
+** are not used by the SQLite core.  These optional interfaces are provided
+** by some VFSes to facilitate testing of the VFS code. By overriding 
+** system calls with functions under its control, a test program can
+** simulate faults and error conditions that would otherwise be difficult
+** or impossible to induce.  The set of system calls that can be overridden
+** varies from one VFS to another, and from one version of the same VFS to the
+** next.  Applications that use these interfaces must be prepared for any
+** or all of these interfaces to be NULL or for their behavior to change
+** from one release to the next.  Applications must not attempt to access
+** any of these methods if the iVersion of the VFS is less than 3.
+*/
+typedef struct sqlite3_vfs sqlite3_vfs;
+typedef void (*sqlite3_syscall_ptr)(void);
+struct sqlite3_vfs {
+  int iVersion;            /* Structure version number (currently 3) */
+  int szOsFile;            /* Size of subclassed sqlite3_file */
+  int mxPathname;          /* Maximum file pathname length */
+  sqlite3_vfs *pNext;      /* Next registered VFS */
+  const char *zName;       /* Name of this virtual file system */
+  void *pAppData;          /* Pointer to application-specific data */
+  int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
+               int flags, int *pOutFlags);
+  int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
+  int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
+  int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
+  void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
+  void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
+  void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
+  void (*xDlClose)(sqlite3_vfs*, void*);
+  int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
+  int (*xSleep)(sqlite3_vfs*, int microseconds);
+  int (*xCurrentTime)(sqlite3_vfs*, double*);
+  int (*xGetLastError)(sqlite3_vfs*, int, char *);
+  /*
+  ** The methods above are in version 1 of the sqlite_vfs object
+  ** definition.  Those that follow are added in version 2 or later
+  */
+  int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
+  /*
+  ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
+  ** Those below are for version 3 and greater.
+  */
+  int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
+  sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
+  const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
+  /*
+  ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
+  ** New fields may be appended in figure versions.  The iVersion
+  ** value will increment whenever this happens. 
+  */
+};
+
+/*
+** CAPI3REF: Flags for the xAccess VFS method
+**
+** These integer constants can be used as the third parameter to
+** the xAccess method of an [sqlite3_vfs] object.  They determine
+** what kind of permissions the xAccess method is looking for.
+** With SQLITE_ACCESS_EXISTS, the xAccess method
+** simply checks whether the file exists.
+** With SQLITE_ACCESS_READWRITE, the xAccess method
+** checks whether the named directory is both readable and writable
+** (in other words, if files can be added, removed, and renamed within
+** the directory).
+** The SQLITE_ACCESS_READWRITE constant is currently used only by the
+** [temp_store_directory pragma], though this could change in a future
+** release of SQLite.
+** With SQLITE_ACCESS_READ, the xAccess method
+** checks whether the file is readable.  The SQLITE_ACCESS_READ constant is
+** currently unused, though it might be used in a future release of
+** SQLite.
+*/
+#define SQLITE_ACCESS_EXISTS    0
+#define SQLITE_ACCESS_READWRITE 1   /* Used by PRAGMA temp_store_directory */
+#define SQLITE_ACCESS_READ      2   /* Unused */
+
+/*
+** CAPI3REF: Flags for the xShmLock VFS method
+**
+** These integer constants define the various locking operations
+** allowed by the xShmLock method of [sqlite3_io_methods].  The
+** following are the only legal combinations of flags to the
+** xShmLock method:
+**
+** <ul>
+** <li>  SQLITE_SHM_LOCK | SQLITE_SHM_SHARED
+** <li>  SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE
+** <li>  SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED
+** <li>  SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE
+** </ul>
+**
+** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as
+** was given no the corresponding lock.  
+**
+** The xShmLock method can transition between unlocked and SHARED or
+** between unlocked and EXCLUSIVE.  It cannot transition between SHARED
+** and EXCLUSIVE.
+*/
+#define SQLITE_SHM_UNLOCK       1
+#define SQLITE_SHM_LOCK         2
+#define SQLITE_SHM_SHARED       4
+#define SQLITE_SHM_EXCLUSIVE    8
+
+/*
+** CAPI3REF: Maximum xShmLock index
+**
+** The xShmLock method on [sqlite3_io_methods] may use values
+** between 0 and this upper bound as its "offset" argument.
+** The SQLite core will never attempt to acquire or release a
+** lock outside of this range
+*/
+#define SQLITE_SHM_NLOCK        8
+
+
+/*
+** CAPI3REF: Initialize The SQLite Library
+**
+** ^The sqlite3_initialize() routine initializes the
+** SQLite library.  ^The sqlite3_shutdown() routine
+** deallocates any resources that were allocated by sqlite3_initialize().
+** These routines are designed to aid in process initialization and
+** shutdown on embedded systems.  Workstation applications using
+** SQLite normally do not need to invoke either of these routines.
+**
+** A call to sqlite3_initialize() is an "effective" call if it is
+** the first time sqlite3_initialize() is invoked during the lifetime of
+** the process, or if it is the first time sqlite3_initialize() is invoked
+** following a call to sqlite3_shutdown().  ^(Only an effective call
+** of sqlite3_initialize() does any initialization.  All other calls
+** are harmless no-ops.)^
+**
+** A call to sqlite3_shutdown() is an "effective" call if it is the first
+** call to sqlite3_shutdown() since the last sqlite3_initialize().  ^(Only
+** an effective call to sqlite3_shutdown() does any deinitialization.
+** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^
+**
+** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown()
+** is not.  The sqlite3_shutdown() interface must only be called from a
+** single thread.  All open [database connections] must be closed and all
+** other SQLite resources must be deallocated prior to invoking
+** sqlite3_shutdown().
+**
+** Among other things, ^sqlite3_initialize() will invoke
+** sqlite3_os_init().  Similarly, ^sqlite3_shutdown()
+** will invoke sqlite3_os_end().
+**
+** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success.
+** ^If for some reason, sqlite3_initialize() is unable to initialize
+** the library (perhaps it is unable to allocate a needed resource such
+** as a mutex) it returns an [error code] other than [SQLITE_OK].
+**
+** ^The sqlite3_initialize() routine is called internally by many other
+** SQLite interfaces so that an application usually does not need to
+** invoke sqlite3_initialize() directly.  For example, [sqlite3_open()]
+** calls sqlite3_initialize() so the SQLite library will be automatically
+** initialized when [sqlite3_open()] is called if it has not be initialized
+** already.  ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
+** compile-time option, then the automatic calls to sqlite3_initialize()
+** are omitted and the application must call sqlite3_initialize() directly
+** prior to using any other SQLite interface.  For maximum portability,
+** it is recommended that applications always invoke sqlite3_initialize()
+** directly prior to using any other SQLite interface.  Future releases
+** of SQLite may require this.  In other words, the behavior exhibited
+** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the
+** default behavior in some future release of SQLite.
+**
+** The sqlite3_os_init() routine does operating-system specific
+** initialization of the SQLite library.  The sqlite3_os_end()
+** routine undoes the effect of sqlite3_os_init().  Typical tasks
+** performed by these routines include allocation or deallocation
+** of static resources, initialization of global variables,
+** setting up a default [sqlite3_vfs] module, or setting up
+** a default configuration using [sqlite3_config()].
+**
+** The application should never invoke either sqlite3_os_init()
+** or sqlite3_os_end() directly.  The application should only invoke
+** sqlite3_initialize() and sqlite3_shutdown().  The sqlite3_os_init()
+** interface is called automatically by sqlite3_initialize() and
+** sqlite3_os_end() is called by sqlite3_shutdown().  Appropriate
+** implementations for sqlite3_os_init() and sqlite3_os_end()
+** are built into SQLite when it is compiled for Unix, Windows, or OS/2.
+** When [custom builds | built for other platforms]
+** (using the [SQLITE_OS_OTHER=1] compile-time
+** option) the application must supply a suitable implementation for
+** sqlite3_os_init() and sqlite3_os_end().  An application-supplied
+** implementation of sqlite3_os_init() or sqlite3_os_end()
+** must return [SQLITE_OK] on success and some other [error code] upon
+** failure.
+*/
+SQLITE_API int sqlite3_initialize(void);
+SQLITE_API int sqlite3_shutdown(void);
+SQLITE_API int sqlite3_os_init(void);
+SQLITE_API int sqlite3_os_end(void);
+
+/*
+** CAPI3REF: Configuring The SQLite Library
+**
+** The sqlite3_config() interface is used to make global configuration
+** changes to SQLite in order to tune SQLite to the specific needs of
+** the application.  The default configuration is recommended for most
+** applications and so this routine is usually not necessary.  It is
+** provided to support rare applications with unusual needs.
+**
+** The sqlite3_config() interface is not threadsafe.  The application
+** must insure that no other SQLite interfaces are invoked by other
+** threads while sqlite3_config() is running.  Furthermore, sqlite3_config()
+** may only be invoked prior to library initialization using
+** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()].
+** ^If sqlite3_config() is called after [sqlite3_initialize()] and before
+** [sqlite3_shutdown()] then it will return SQLITE_MISUSE.
+** Note, however, that ^sqlite3_config() can be called as part of the
+** implementation of an application-defined [sqlite3_os_init()].
+**
+** The first argument to sqlite3_config() is an integer
+** [configuration option] that determines
+** what property of SQLite is to be configured.  Subsequent arguments
+** vary depending on the [configuration option]
+** in the first argument.
+**
+** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
+** ^If the option is unknown or SQLite is unable to set the option
+** then this routine returns a non-zero [error code].
+*/
+SQLITE_API int sqlite3_config(int, ...);
+
+/*
+** CAPI3REF: Configure database connections
+**
+** The sqlite3_db_config() interface is used to make configuration
+** changes to a [database connection].  The interface is similar to
+** [sqlite3_config()] except that the changes apply to a single
+** [database connection] (specified in the first argument).
+**
+** The second argument to sqlite3_db_config(D,V,...)  is the
+** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code 
+** that indicates what aspect of the [database connection] is being configured.
+** Subsequent arguments vary depending on the configuration verb.
+**
+** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
+** the call is considered successful.
+*/
+SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
+
+/*
+** CAPI3REF: Memory Allocation Routines
+**
+** An instance of this object defines the interface between SQLite
+** and low-level memory allocation routines.
+**
+** This object is used in only one place in the SQLite interface.
+** A pointer to an instance of this object is the argument to
+** [sqlite3_config()] when the configuration option is
+** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].  
+** By creating an instance of this object
+** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])
+** during configuration, an application can specify an alternative
+** memory allocation subsystem for SQLite to use for all of its
+** dynamic memory needs.
+**
+** Note that SQLite comes with several [built-in memory allocators]
+** that are perfectly adequate for the overwhelming majority of applications
+** and that this object is only useful to a tiny minority of applications
+** with specialized memory allocation requirements.  This object is
+** also used during testing of SQLite in order to specify an alternative
+** memory allocator that simulates memory out-of-memory conditions in
+** order to verify that SQLite recovers gracefully from such
+** conditions.
+**
+** The xMalloc, xRealloc, and xFree methods must work like the
+** malloc(), realloc() and free() functions from the standard C library.
+** ^SQLite guarantees that the second argument to
+** xRealloc is always a value returned by a prior call to xRoundup.
+**
+** xSize should return the allocated size of a memory allocation
+** previously obtained from xMalloc or xRealloc.  The allocated size
+** is always at least as big as the requested size but may be larger.
+**
+** The xRoundup method returns what would be the allocated size of
+** a memory allocation given a particular requested size.  Most memory
+** allocators round up memory allocations at least to the next multiple
+** of 8.  Some allocators round up to a larger multiple or to a power of 2.
+** Every memory allocation request coming in through [sqlite3_malloc()]
+** or [sqlite3_realloc()] first calls xRoundup.  If xRoundup returns 0, 
+** that causes the corresponding memory allocation to fail.
+**
+** The xInit method initializes the memory allocator.  For example,
+** it might allocate any require mutexes or initialize internal data
+** structures.  The xShutdown method is invoked (indirectly) by
+** [sqlite3_shutdown()] and should deallocate any resources acquired
+** by xInit.  The pAppData pointer is used as the only parameter to
+** xInit and xShutdown.
+**
+** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+** the xInit method, so the xInit method need not be threadsafe.  The
+** xShutdown method is only called from [sqlite3_shutdown()] so it does
+** not need to be threadsafe either.  For all other methods, SQLite
+** holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
+** [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which
+** it is by default) and so the methods are automatically serialized.
+** However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other
+** methods must be threadsafe or else make their own arrangements for
+** serialization.
+**
+** SQLite will never invoke xInit() more than once without an intervening
+** call to xShutdown().
+*/
+typedef struct sqlite3_mem_methods sqlite3_mem_methods;
+struct sqlite3_mem_methods {
+  void *(*xMalloc)(int);         /* Memory allocation function */
+  void (*xFree)(void*);          /* Free a prior allocation */
+  void *(*xRealloc)(void*,int);  /* Resize an allocation */
+  int (*xSize)(void*);           /* Return the size of an allocation */
+  int (*xRoundup)(int);          /* Round up request size to allocation size */
+  int (*xInit)(void*);           /* Initialize the memory allocator */
+  void (*xShutdown)(void*);      /* Deinitialize the memory allocator */
+  void *pAppData;                /* Argument to xInit() and xShutdown() */
+};
+
+/*
+** CAPI3REF: Configuration Options
+** KEYWORDS: {configuration option}
+**
+** These constants are the available integer configuration options that
+** can be passed as the first argument to the [sqlite3_config()] interface.
+**
+** New configuration options may be added in future releases of SQLite.
+** Existing configuration options might be discontinued.  Applications
+** should check the return code from [sqlite3_config()] to make sure that
+** the call worked.  The [sqlite3_config()] interface will return a
+** non-zero [error code] if a discontinued or unsupported configuration option
+** is invoked.
+**
+** <dl>
+** [[SQLITE_CONFIG_SINGLETHREAD]] <dt>SQLITE_CONFIG_SINGLETHREAD</dt>
+** <dd>There are no arguments to this option.  ^This option sets the
+** [threading mode] to Single-thread.  In other words, it disables
+** all mutexing and puts SQLite into a mode where it can only be used
+** by a single thread.   ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** it is not possible to change the [threading mode] from its default
+** value of Single-thread and so [sqlite3_config()] will return 
+** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD
+** configuration option.</dd>
+**
+** [[SQLITE_CONFIG_MULTITHREAD]] <dt>SQLITE_CONFIG_MULTITHREAD</dt>
+** <dd>There are no arguments to this option.  ^This option sets the
+** [threading mode] to Multi-thread.  In other words, it disables
+** mutexing on [database connection] and [prepared statement] objects.
+** The application is responsible for serializing access to
+** [database connections] and [prepared statements].  But other mutexes
+** are enabled so that SQLite will be safe to use in a multi-threaded
+** environment as long as no two threads attempt to use the same
+** [database connection] at the same time.  ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** it is not possible to set the Multi-thread [threading mode] and
+** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
+** SQLITE_CONFIG_MULTITHREAD configuration option.</dd>
+**
+** [[SQLITE_CONFIG_SERIALIZED]] <dt>SQLITE_CONFIG_SERIALIZED</dt>
+** <dd>There are no arguments to this option.  ^This option sets the
+** [threading mode] to Serialized. In other words, this option enables
+** all mutexes including the recursive
+** mutexes on [database connection] and [prepared statement] objects.
+** In this mode (which is the default when SQLite is compiled with
+** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
+** to [database connections] and [prepared statements] so that the
+** application is free to use the same [database connection] or the
+** same [prepared statement] in different threads at the same time.
+** ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** it is not possible to set the Serialized [threading mode] and
+** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
+** SQLITE_CONFIG_SERIALIZED configuration option.</dd>
+**
+** [[SQLITE_CONFIG_MALLOC]] <dt>SQLITE_CONFIG_MALLOC</dt>
+** <dd> ^(This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mem_methods] structure.  The argument specifies
+** alternative low-level memory allocation routines to be used in place of
+** the memory allocation routines built into SQLite.)^ ^SQLite makes
+** its own private copy of the content of the [sqlite3_mem_methods] structure
+** before the [sqlite3_config()] call returns.</dd>
+**
+** [[SQLITE_CONFIG_GETMALLOC]] <dt>SQLITE_CONFIG_GETMALLOC</dt>
+** <dd> ^(This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mem_methods] structure.  The [sqlite3_mem_methods]
+** structure is filled with the currently defined memory allocation routines.)^
+** This option can be used to overload the default memory allocation
+** routines with a wrapper that simulations memory allocation failure or
+** tracks memory usage, for example. </dd>
+**
+** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
+** <dd> ^This option takes single argument of type int, interpreted as a 
+** boolean, which enables or disables the collection of memory allocation 
+** statistics. ^(When memory allocation statistics are disabled, the 
+** following SQLite interfaces become non-operational:
+**   <ul>
+**   <li> [sqlite3_memory_used()]
+**   <li> [sqlite3_memory_highwater()]
+**   <li> [sqlite3_soft_heap_limit64()]
+**   <li> [sqlite3_status()]
+**   </ul>)^
+** ^Memory allocation statistics are enabled by default unless SQLite is
+** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory
+** allocation statistics are disabled by default.
+** </dd>
+**
+** [[SQLITE_CONFIG_SCRATCH]] <dt>SQLITE_CONFIG_SCRATCH</dt>
+** <dd> ^This option specifies a static memory buffer that SQLite can use for
+** scratch memory.  There are three arguments:  A pointer an 8-byte
+** aligned memory buffer from which the scratch allocations will be
+** drawn, the size of each scratch allocation (sz),
+** and the maximum number of scratch allocations (N).  The sz
+** argument must be a multiple of 16.
+** The first argument must be a pointer to an 8-byte aligned buffer
+** of at least sz*N bytes of memory.
+** ^SQLite will use no more than two scratch buffers per thread.  So
+** N should be set to twice the expected maximum number of threads.
+** ^SQLite will never require a scratch buffer that is more than 6
+** times the database page size. ^If SQLite needs needs additional
+** scratch memory beyond what is provided by this configuration option, then 
+** [sqlite3_malloc()] will be used to obtain the memory needed.</dd>
+**
+** [[SQLITE_CONFIG_PAGECACHE]] <dt>SQLITE_CONFIG_PAGECACHE</dt>
+** <dd> ^This option specifies a static memory buffer that SQLite can use for
+** the database page cache with the default page cache implementation.  
+** This configuration should not be used if an application-define page
+** cache implementation is loaded using the SQLITE_CONFIG_PCACHE2 option.
+** There are three arguments to this option: A pointer to 8-byte aligned
+** memory, the size of each page buffer (sz), and the number of pages (N).
+** The sz argument should be the size of the largest database page
+** (a power of two between 512 and 32768) plus a little extra for each
+** page header.  ^The page header size is 20 to 40 bytes depending on
+** the host architecture.  ^It is harmless, apart from the wasted memory,
+** to make sz a little too large.  The first
+** argument should point to an allocation of at least sz*N bytes of memory.
+** ^SQLite will use the memory provided by the first argument to satisfy its
+** memory needs for the first N pages that it adds to cache.  ^If additional
+** page cache memory is needed beyond what is provided by this option, then
+** SQLite goes to [sqlite3_malloc()] for the additional storage space.
+** The pointer in the first argument must
+** be aligned to an 8-byte boundary or subsequent behavior of SQLite
+** will be undefined.</dd>
+**
+** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
+** <dd> ^This option specifies a static memory buffer that SQLite will use
+** for all of its dynamic memory allocation needs beyond those provided
+** for by [SQLITE_CONFIG_SCRATCH] and [SQLITE_CONFIG_PAGECACHE].
+** There are three arguments: An 8-byte aligned pointer to the memory,
+** the number of bytes in the memory buffer, and the minimum allocation size.
+** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts
+** to using its default memory allocator (the system malloc() implementation),
+** undoing any prior invocation of [SQLITE_CONFIG_MALLOC].  ^If the
+** memory pointer is not NULL and either [SQLITE_ENABLE_MEMSYS3] or
+** [SQLITE_ENABLE_MEMSYS5] are defined, then the alternative memory
+** allocator is engaged to handle all of SQLites memory allocation needs.
+** The first pointer (the memory pointer) must be aligned to an 8-byte
+** boundary or subsequent behavior of SQLite will be undefined.
+** The minimum allocation size is capped at 2**12. Reasonable values
+** for the minimum allocation size are 2**5 through 2**8.</dd>
+**
+** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
+** <dd> ^(This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mutex_methods] structure.  The argument specifies
+** alternative low-level mutex routines to be used in place
+** the mutex routines built into SQLite.)^  ^SQLite makes a copy of the
+** content of the [sqlite3_mutex_methods] structure before the call to
+** [sqlite3_config()] returns. ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** the entire mutexing subsystem is omitted from the build and hence calls to
+** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
+** return [SQLITE_ERROR].</dd>
+**
+** [[SQLITE_CONFIG_GETMUTEX]] <dt>SQLITE_CONFIG_GETMUTEX</dt>
+** <dd> ^(This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mutex_methods] structure.  The
+** [sqlite3_mutex_methods]
+** structure is filled with the currently defined mutex routines.)^
+** This option can be used to overload the default mutex allocation
+** routines with a wrapper used to track mutex usage for performance
+** profiling or testing, for example.   ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** the entire mutexing subsystem is omitted from the build and hence calls to
+** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will
+** return [SQLITE_ERROR].</dd>
+**
+** [[SQLITE_CONFIG_LOOKASIDE]] <dt>SQLITE_CONFIG_LOOKASIDE</dt>
+** <dd> ^(This option takes two arguments that determine the default
+** memory allocation for the lookaside memory allocator on each
+** [database connection].  The first argument is the
+** size of each lookaside buffer slot and the second is the number of
+** slots allocated to each database connection.)^  ^(This option sets the
+** <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]
+** verb to [sqlite3_db_config()] can be used to change the lookaside
+** configuration on individual connections.)^ </dd>
+**
+** [[SQLITE_CONFIG_PCACHE2]] <dt>SQLITE_CONFIG_PCACHE2</dt>
+** <dd> ^(This option takes a single argument which is a pointer to
+** an [sqlite3_pcache_methods2] object.  This object specifies the interface
+** to a custom page cache implementation.)^  ^SQLite makes a copy of the
+** object and uses it for page cache memory allocations.</dd>
+**
+** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
+** <dd> ^(This option takes a single argument which is a pointer to an
+** [sqlite3_pcache_methods2] object.  SQLite copies of the current
+** page cache implementation into that object.)^ </dd>
+**
+** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
+** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
+** global [error log].
+** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
+** function with a call signature of void(*)(void*,int,const char*), 
+** and a pointer to void. ^If the function pointer is not NULL, it is
+** invoked by [sqlite3_log()] to process each logging event.  ^If the
+** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
+** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
+** passed through as the first parameter to the application-defined logger
+** function whenever that function is invoked.  ^The second parameter to
+** the logger function is a copy of the first parameter to the corresponding
+** [sqlite3_log()] call and is intended to be a [result code] or an
+** [extended result code].  ^The third parameter passed to the logger is
+** log message after formatting via [sqlite3_snprintf()].
+** The SQLite logging interface is not reentrant; the logger function
+** supplied by the application must not invoke any SQLite interface.
+** In a multi-threaded application, the application-defined logger
+** function must be threadsafe. </dd>
+**
+** [[SQLITE_CONFIG_URI]] <dt>SQLITE_CONFIG_URI
+** <dd>^(This option takes a single argument of type int. If non-zero, then
+** URI handling is globally enabled. If the parameter is zero, then URI handling
+** is globally disabled.)^ ^If URI handling is globally enabled, all filenames
+** passed to [sqlite3_open()], [sqlite3_open_v2()], [sqlite3_open16()] or
+** specified as part of [ATTACH] commands are interpreted as URIs, regardless
+** of whether or not the [SQLITE_OPEN_URI] flag is set when the database
+** connection is opened. ^If it is globally disabled, filenames are
+** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the
+** database connection is opened. ^(By default, URI handling is globally
+** disabled. The default value may be changed by compiling with the
+** [SQLITE_USE_URI] symbol defined.)^
+**
+** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] <dt>SQLITE_CONFIG_COVERING_INDEX_SCAN
+** <dd>^This option takes a single integer argument which is interpreted as
+** a boolean in order to enable or disable the use of covering indices for
+** full table scans in the query optimizer.  ^The default setting is determined
+** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on"
+** if that compile-time option is omitted.
+** The ability to disable the use of covering indices for full table scans
+** is because some incorrectly coded legacy applications might malfunction
+** when the optimization is enabled.  Providing the ability to
+** disable the optimization allows the older, buggy application code to work
+** without change even with newer versions of SQLite.
+**
+** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]]
+** <dt>SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE
+** <dd> These options are obsolete and should not be used by new code.
+** They are retained for backwards compatibility but are now no-ops.
+** </dd>
+**
+** [[SQLITE_CONFIG_SQLLOG]]
+** <dt>SQLITE_CONFIG_SQLLOG
+** <dd>This option is only available if sqlite is compiled with the
+** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
+** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
+** The second should be of type (void*). The callback is invoked by the library
+** in three separate circumstances, identified by the value passed as the
+** fourth parameter. If the fourth parameter is 0, then the database connection
+** passed as the second argument has just been opened. The third argument
+** points to a buffer containing the name of the main database file. If the
+** fourth parameter is 1, then the SQL statement that the third parameter
+** points to has just been executed. Or, if the fourth parameter is 2, then
+** the connection being passed as the second parameter is being closed. The
+** third parameter is passed NULL In this case.  An example of using this
+** configuration option can be seen in the "test_sqllog.c" source file in
+** the canonical SQLite source tree.</dd>
+**
+** [[SQLITE_CONFIG_MMAP_SIZE]]
+** <dt>SQLITE_CONFIG_MMAP_SIZE
+** <dd>^SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
+** that are the default mmap size limit (the default setting for
+** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
+** ^The default setting can be overridden by each database connection using
+** either the [PRAGMA mmap_size] command, or by using the
+** [SQLITE_FCNTL_MMAP_SIZE] file control.  ^(The maximum allowed mmap size
+** cannot be changed at run-time.  Nor may the maximum allowed mmap size
+** exceed the compile-time maximum mmap size set by the
+** [SQLITE_MAX_MMAP_SIZE] compile-time option.)^
+** ^If either argument to this option is negative, then that argument is
+** changed to its compile-time default.
+**
+** [[SQLITE_CONFIG_WIN32_HEAPSIZE]]
+** <dt>SQLITE_CONFIG_WIN32_HEAPSIZE
+** <dd>^This option is only available if SQLite is compiled for Windows
+** with the [SQLITE_WIN32_MALLOC] pre-processor macro defined.
+** SQLITE_CONFIG_WIN32_HEAPSIZE takes 

<TRUNCATED>


[24/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/yaml.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/yaml.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/yaml.go
deleted file mode 100644
index af4df8a..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/yaml.go
+++ /dev/null
@@ -1,344 +0,0 @@
-// Package yaml implements YAML support for the Go language.
-//
-// Source code and other details for the project are available at GitHub:
-//
-//   https://github.com/go-yaml/yaml
-//
-package yaml
-
-import (
-	"errors"
-	"fmt"
-	"reflect"
-	"strings"
-	"sync"
-)
-
-// MapSlice encodes and decodes as a YAML map.
-// The order of keys is preserved when encoding and decoding.
-type MapSlice []MapItem
-
-// MapItem is an item in a MapSlice.
-type MapItem struct {
-	Key, Value interface{}
-}
-
-// The Unmarshaler interface may be implemented by types to customize their
-// behavior when being unmarshaled from a YAML document. The UnmarshalYAML
-// method receives a function that may be called to unmarshal the original
-// YAML value into a field or variable. It is safe to call the unmarshal
-// function parameter more than once if necessary.
-type Unmarshaler interface {
-	UnmarshalYAML(unmarshal func(interface{}) error) error
-}
-
-// The Marshaler interface may be implemented by types to customize their
-// behavior when being marshaled into a YAML document. The returned value
-// is marshaled in place of the original value implementing Marshaler.
-//
-// If an error is returned by MarshalYAML, the marshaling procedure stops
-// and returns with the provided error.
-type Marshaler interface {
-	MarshalYAML() (interface{}, error)
-}
-
-// Unmarshal decodes the first document found within the in byte slice
-// and assigns decoded values into the out value.
-//
-// Maps and pointers (to a struct, string, int, etc) are accepted as out
-// values. If an internal pointer within a struct is not initialized,
-// the yaml package will initialize it if necessary for unmarshalling
-// the provided data. The out parameter must not be nil.
-//
-// The type of the decoded values should be compatible with the respective
-// values in out. If one or more values cannot be decoded due to a type
-// mismatches, decoding continues partially until the end of the YAML
-// content, and a *yaml.TypeError is returned with details for all
-// missed values.
-//
-// Struct fields are only unmarshalled if they are exported (have an
-// upper case first letter), and are unmarshalled using the field name
-// lowercased as the default key. Custom keys may be defined via the
-// "yaml" name in the field tag: the content preceding the first comma
-// is used as the key, and the following comma-separated options are
-// used to tweak the marshalling process (see Marshal).
-// Conflicting names result in a runtime error.
-//
-// For example:
-//
-//     type T struct {
-//         F int `yaml:"a,omitempty"`
-//         B int
-//     }
-//     var t T
-//     yaml.Unmarshal([]byte("a: 1\nb: 2"), &t)
-//
-// See the documentation of Marshal for the format of tags and a list of
-// supported tag options.
-//
-func Unmarshal(in []byte, out interface{}) (err error) {
-	defer handleErr(&err)
-	d := newDecoder()
-	p := newParser(in)
-	defer p.destroy()
-	node := p.parse()
-	if node != nil {
-		v := reflect.ValueOf(out)
-		if v.Kind() == reflect.Ptr && !v.IsNil() {
-			v = v.Elem()
-		}
-		d.unmarshal(node, v)
-	}
-	if len(d.terrors) > 0 {
-		return &TypeError{d.terrors}
-	}
-	return nil
-}
-
-// Marshal serializes the value provided into a YAML document. The structure
-// of the generated document will reflect the structure of the value itself.
-// Maps and pointers (to struct, string, int, etc) are accepted as the in value.
-//
-// Struct fields are only unmarshalled if they are exported (have an upper case
-// first letter), and are unmarshalled using the field name lowercased as the
-// default key. Custom keys may be defined via the "yaml" name in the field
-// tag: the content preceding the first comma is used as the key, and the
-// following comma-separated options are used to tweak the marshalling process.
-// Conflicting names result in a runtime error.
-//
-// The field tag format accepted is:
-//
-//     `(...) yaml:"[<key>][,<flag1>[,<flag2>]]" (...)`
-//
-// The following flags are currently supported:
-//
-//     omitempty    Only include the field if it's not set to the zero
-//                  value for the type or to empty slices or maps.
-//                  Does not apply to zero valued structs.
-//
-//     flow         Marshal using a flow style (useful for structs,
-//                  sequences and maps).
-//
-//     inline       Inline the field, which must be a struct or a map,
-//                  causing all of its fields or keys to be processed as if
-//                  they were part of the outer struct. For maps, keys must
-//                  not conflict with the yaml keys of other struct fields.
-//
-// In addition, if the key is "-", the field is ignored.
-//
-// For example:
-//
-//     type T struct {
-//         F int "a,omitempty"
-//         B int
-//     }
-//     yaml.Marshal(&T{B: 2}) // Returns "b: 2\n"
-//     yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n"
-//
-func Marshal(in interface{}) (out []byte, err error) {
-	defer handleErr(&err)
-	e := newEncoder()
-	defer e.destroy()
-	e.marshal("", reflect.ValueOf(in))
-	e.finish()
-	out = e.out
-	return
-}
-
-func handleErr(err *error) {
-	if v := recover(); v != nil {
-		if e, ok := v.(yamlError); ok {
-			*err = e.err
-		} else {
-			panic(v)
-		}
-	}
-}
-
-type yamlError struct {
-	err error
-}
-
-func fail(err error) {
-	panic(yamlError{err})
-}
-
-func failf(format string, args ...interface{}) {
-	panic(yamlError{fmt.Errorf("yaml: "+format, args...)})
-}
-
-// A TypeError is returned by Unmarshal when one or more fields in
-// the YAML document cannot be properly decoded into the requested
-// types. When this error is returned, the value is still
-// unmarshaled partially.
-type TypeError struct {
-	Errors []string
-}
-
-func (e *TypeError) Error() string {
-	return fmt.Sprintf("yaml: unmarshal errors:\n  %s", strings.Join(e.Errors, "\n  "))
-}
-
-// --------------------------------------------------------------------------
-// Maintain a mapping of keys to structure field indexes
-
-// The code in this section was copied from mgo/bson.
-
-// structInfo holds details for the serialization of fields of
-// a given struct.
-type structInfo struct {
-	FieldsMap  map[string]fieldInfo
-	FieldsList []fieldInfo
-
-	// InlineMap is the number of the field in the struct that
-	// contains an ,inline map, or -1 if there's none.
-	InlineMap int
-}
-
-type fieldInfo struct {
-	Key       string
-	Num       int
-	OmitEmpty bool
-	Flow      bool
-
-	// Inline holds the field index if the field is part of an inlined struct.
-	Inline []int
-}
-
-var structMap = make(map[reflect.Type]*structInfo)
-var fieldMapMutex sync.RWMutex
-
-func getStructInfo(st reflect.Type) (*structInfo, error) {
-	fieldMapMutex.RLock()
-	sinfo, found := structMap[st]
-	fieldMapMutex.RUnlock()
-	if found {
-		return sinfo, nil
-	}
-
-	n := st.NumField()
-	fieldsMap := make(map[string]fieldInfo)
-	fieldsList := make([]fieldInfo, 0, n)
-	inlineMap := -1
-	for i := 0; i != n; i++ {
-		field := st.Field(i)
-		if field.PkgPath != "" {
-			continue // Private field
-		}
-
-		info := fieldInfo{Num: i}
-
-		tag := field.Tag.Get("yaml")
-		if tag == "" && strings.Index(string(field.Tag), ":") < 0 {
-			tag = string(field.Tag)
-		}
-		if tag == "-" {
-			continue
-		}
-
-		inline := false
-		fields := strings.Split(tag, ",")
-		if len(fields) > 1 {
-			for _, flag := range fields[1:] {
-				switch flag {
-				case "omitempty":
-					info.OmitEmpty = true
-				case "flow":
-					info.Flow = true
-				case "inline":
-					inline = true
-				default:
-					return nil, errors.New(fmt.Sprintf("Unsupported flag %q in tag %q of type %s", flag, tag, st))
-				}
-			}
-			tag = fields[0]
-		}
-
-		if inline {
-			switch field.Type.Kind() {
-			case reflect.Map:
-				if inlineMap >= 0 {
-					return nil, errors.New("Multiple ,inline maps in struct " + st.String())
-				}
-				if field.Type.Key() != reflect.TypeOf("") {
-					return nil, errors.New("Option ,inline needs a map with string keys in struct " + st.String())
-				}
-				inlineMap = info.Num
-			case reflect.Struct:
-				sinfo, err := getStructInfo(field.Type)
-				if err != nil {
-					return nil, err
-				}
-				for _, finfo := range sinfo.FieldsList {
-					if _, found := fieldsMap[finfo.Key]; found {
-						msg := "Duplicated key '" + finfo.Key + "' in struct " + st.String()
-						return nil, errors.New(msg)
-					}
-					if finfo.Inline == nil {
-						finfo.Inline = []int{i, finfo.Num}
-					} else {
-						finfo.Inline = append([]int{i}, finfo.Inline...)
-					}
-					fieldsMap[finfo.Key] = finfo
-					fieldsList = append(fieldsList, finfo)
-				}
-			default:
-				//return nil, errors.New("Option ,inline needs a struct value or map field")
-				return nil, errors.New("Option ,inline needs a struct value field")
-			}
-			continue
-		}
-
-		if tag != "" {
-			info.Key = tag
-		} else {
-			info.Key = strings.ToLower(field.Name)
-		}
-
-		if _, found = fieldsMap[info.Key]; found {
-			msg := "Duplicated key '" + info.Key + "' in struct " + st.String()
-			return nil, errors.New(msg)
-		}
-
-		fieldsList = append(fieldsList, info)
-		fieldsMap[info.Key] = info
-	}
-
-	sinfo = &structInfo{fieldsMap, fieldsList, inlineMap}
-
-	fieldMapMutex.Lock()
-	structMap[st] = sinfo
-	fieldMapMutex.Unlock()
-	return sinfo, nil
-}
-
-func isZero(v reflect.Value) bool {
-	switch v.Kind() {
-	case reflect.String:
-		return len(v.String()) == 0
-	case reflect.Interface, reflect.Ptr:
-		return v.IsNil()
-	case reflect.Slice:
-		return v.Len() == 0
-	case reflect.Map:
-		return v.Len() == 0
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		return v.Int() == 0
-	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
-		return v.Uint() == 0
-	case reflect.Bool:
-		return !v.Bool()
-	case reflect.Struct:
-		vt := v.Type()
-		for i := v.NumField()-1; i >= 0; i-- {
-			if vt.Field(i).PkgPath != "" {
-				continue // Private field
-			}
-			if !isZero(v.Field(i)) {
-				return false
-			}
-		}
-		return true
-	}
-	return false
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlh.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlh.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlh.go
deleted file mode 100644
index d60a6b6..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlh.go
+++ /dev/null
@@ -1,716 +0,0 @@
-package yaml
-
-import (
-	"io"
-)
-
-// The version directive data.
-type yaml_version_directive_t struct {
-	major int8 // The major version number.
-	minor int8 // The minor version number.
-}
-
-// The tag directive data.
-type yaml_tag_directive_t struct {
-	handle []byte // The tag handle.
-	prefix []byte // The tag prefix.
-}
-
-type yaml_encoding_t int
-
-// The stream encoding.
-const (
-	// Let the parser choose the encoding.
-	yaml_ANY_ENCODING yaml_encoding_t = iota
-
-	yaml_UTF8_ENCODING    // The default UTF-8 encoding.
-	yaml_UTF16LE_ENCODING // The UTF-16-LE encoding with BOM.
-	yaml_UTF16BE_ENCODING // The UTF-16-BE encoding with BOM.
-)
-
-type yaml_break_t int
-
-// Line break types.
-const (
-	// Let the parser choose the break type.
-	yaml_ANY_BREAK yaml_break_t = iota
-
-	yaml_CR_BREAK   // Use CR for line breaks (Mac style).
-	yaml_LN_BREAK   // Use LN for line breaks (Unix style).
-	yaml_CRLN_BREAK // Use CR LN for line breaks (DOS style).
-)
-
-type yaml_error_type_t int
-
-// Many bad things could happen with the parser and emitter.
-const (
-	// No error is produced.
-	yaml_NO_ERROR yaml_error_type_t = iota
-
-	yaml_MEMORY_ERROR   // Cannot allocate or reallocate a block of memory.
-	yaml_READER_ERROR   // Cannot read or decode the input stream.
-	yaml_SCANNER_ERROR  // Cannot scan the input stream.
-	yaml_PARSER_ERROR   // Cannot parse the input stream.
-	yaml_COMPOSER_ERROR // Cannot compose a YAML document.
-	yaml_WRITER_ERROR   // Cannot write to the output stream.
-	yaml_EMITTER_ERROR  // Cannot emit a YAML stream.
-)
-
-// The pointer position.
-type yaml_mark_t struct {
-	index  int // The position index.
-	line   int // The position line.
-	column int // The position column.
-}
-
-// Node Styles
-
-type yaml_style_t int8
-
-type yaml_scalar_style_t yaml_style_t
-
-// Scalar styles.
-const (
-	// Let the emitter choose the style.
-	yaml_ANY_SCALAR_STYLE yaml_scalar_style_t = iota
-
-	yaml_PLAIN_SCALAR_STYLE         // The plain scalar style.
-	yaml_SINGLE_QUOTED_SCALAR_STYLE // The single-quoted scalar style.
-	yaml_DOUBLE_QUOTED_SCALAR_STYLE // The double-quoted scalar style.
-	yaml_LITERAL_SCALAR_STYLE       // The literal scalar style.
-	yaml_FOLDED_SCALAR_STYLE        // The folded scalar style.
-)
-
-type yaml_sequence_style_t yaml_style_t
-
-// Sequence styles.
-const (
-	// Let the emitter choose the style.
-	yaml_ANY_SEQUENCE_STYLE yaml_sequence_style_t = iota
-
-	yaml_BLOCK_SEQUENCE_STYLE // The block sequence style.
-	yaml_FLOW_SEQUENCE_STYLE  // The flow sequence style.
-)
-
-type yaml_mapping_style_t yaml_style_t
-
-// Mapping styles.
-const (
-	// Let the emitter choose the style.
-	yaml_ANY_MAPPING_STYLE yaml_mapping_style_t = iota
-
-	yaml_BLOCK_MAPPING_STYLE // The block mapping style.
-	yaml_FLOW_MAPPING_STYLE  // The flow mapping style.
-)
-
-// Tokens
-
-type yaml_token_type_t int
-
-// Token types.
-const (
-	// An empty token.
-	yaml_NO_TOKEN yaml_token_type_t = iota
-
-	yaml_STREAM_START_TOKEN // A STREAM-START token.
-	yaml_STREAM_END_TOKEN   // A STREAM-END token.
-
-	yaml_VERSION_DIRECTIVE_TOKEN // A VERSION-DIRECTIVE token.
-	yaml_TAG_DIRECTIVE_TOKEN     // A TAG-DIRECTIVE token.
-	yaml_DOCUMENT_START_TOKEN    // A DOCUMENT-START token.
-	yaml_DOCUMENT_END_TOKEN      // A DOCUMENT-END token.
-
-	yaml_BLOCK_SEQUENCE_START_TOKEN // A BLOCK-SEQUENCE-START token.
-	yaml_BLOCK_MAPPING_START_TOKEN  // A BLOCK-SEQUENCE-END token.
-	yaml_BLOCK_END_TOKEN            // A BLOCK-END token.
-
-	yaml_FLOW_SEQUENCE_START_TOKEN // A FLOW-SEQUENCE-START token.
-	yaml_FLOW_SEQUENCE_END_TOKEN   // A FLOW-SEQUENCE-END token.
-	yaml_FLOW_MAPPING_START_TOKEN  // A FLOW-MAPPING-START token.
-	yaml_FLOW_MAPPING_END_TOKEN    // A FLOW-MAPPING-END token.
-
-	yaml_BLOCK_ENTRY_TOKEN // A BLOCK-ENTRY token.
-	yaml_FLOW_ENTRY_TOKEN  // A FLOW-ENTRY token.
-	yaml_KEY_TOKEN         // A KEY token.
-	yaml_VALUE_TOKEN       // A VALUE token.
-
-	yaml_ALIAS_TOKEN  // An ALIAS token.
-	yaml_ANCHOR_TOKEN // An ANCHOR token.
-	yaml_TAG_TOKEN    // A TAG token.
-	yaml_SCALAR_TOKEN // A SCALAR token.
-)
-
-func (tt yaml_token_type_t) String() string {
-	switch tt {
-	case yaml_NO_TOKEN:
-		return "yaml_NO_TOKEN"
-	case yaml_STREAM_START_TOKEN:
-		return "yaml_STREAM_START_TOKEN"
-	case yaml_STREAM_END_TOKEN:
-		return "yaml_STREAM_END_TOKEN"
-	case yaml_VERSION_DIRECTIVE_TOKEN:
-		return "yaml_VERSION_DIRECTIVE_TOKEN"
-	case yaml_TAG_DIRECTIVE_TOKEN:
-		return "yaml_TAG_DIRECTIVE_TOKEN"
-	case yaml_DOCUMENT_START_TOKEN:
-		return "yaml_DOCUMENT_START_TOKEN"
-	case yaml_DOCUMENT_END_TOKEN:
-		return "yaml_DOCUMENT_END_TOKEN"
-	case yaml_BLOCK_SEQUENCE_START_TOKEN:
-		return "yaml_BLOCK_SEQUENCE_START_TOKEN"
-	case yaml_BLOCK_MAPPING_START_TOKEN:
-		return "yaml_BLOCK_MAPPING_START_TOKEN"
-	case yaml_BLOCK_END_TOKEN:
-		return "yaml_BLOCK_END_TOKEN"
-	case yaml_FLOW_SEQUENCE_START_TOKEN:
-		return "yaml_FLOW_SEQUENCE_START_TOKEN"
-	case yaml_FLOW_SEQUENCE_END_TOKEN:
-		return "yaml_FLOW_SEQUENCE_END_TOKEN"
-	case yaml_FLOW_MAPPING_START_TOKEN:
-		return "yaml_FLOW_MAPPING_START_TOKEN"
-	case yaml_FLOW_MAPPING_END_TOKEN:
-		return "yaml_FLOW_MAPPING_END_TOKEN"
-	case yaml_BLOCK_ENTRY_TOKEN:
-		return "yaml_BLOCK_ENTRY_TOKEN"
-	case yaml_FLOW_ENTRY_TOKEN:
-		return "yaml_FLOW_ENTRY_TOKEN"
-	case yaml_KEY_TOKEN:
-		return "yaml_KEY_TOKEN"
-	case yaml_VALUE_TOKEN:
-		return "yaml_VALUE_TOKEN"
-	case yaml_ALIAS_TOKEN:
-		return "yaml_ALIAS_TOKEN"
-	case yaml_ANCHOR_TOKEN:
-		return "yaml_ANCHOR_TOKEN"
-	case yaml_TAG_TOKEN:
-		return "yaml_TAG_TOKEN"
-	case yaml_SCALAR_TOKEN:
-		return "yaml_SCALAR_TOKEN"
-	}
-	return "<unknown token>"
-}
-
-// The token structure.
-type yaml_token_t struct {
-	// The token type.
-	typ yaml_token_type_t
-
-	// The start/end of the token.
-	start_mark, end_mark yaml_mark_t
-
-	// The stream encoding (for yaml_STREAM_START_TOKEN).
-	encoding yaml_encoding_t
-
-	// The alias/anchor/scalar value or tag/tag directive handle
-	// (for yaml_ALIAS_TOKEN, yaml_ANCHOR_TOKEN, yaml_SCALAR_TOKEN, yaml_TAG_TOKEN, yaml_TAG_DIRECTIVE_TOKEN).
-	value []byte
-
-	// The tag suffix (for yaml_TAG_TOKEN).
-	suffix []byte
-
-	// The tag directive prefix (for yaml_TAG_DIRECTIVE_TOKEN).
-	prefix []byte
-
-	// The scalar style (for yaml_SCALAR_TOKEN).
-	style yaml_scalar_style_t
-
-	// The version directive major/minor (for yaml_VERSION_DIRECTIVE_TOKEN).
-	major, minor int8
-}
-
-// Events
-
-type yaml_event_type_t int8
-
-// Event types.
-const (
-	// An empty event.
-	yaml_NO_EVENT yaml_event_type_t = iota
-
-	yaml_STREAM_START_EVENT   // A STREAM-START event.
-	yaml_STREAM_END_EVENT     // A STREAM-END event.
-	yaml_DOCUMENT_START_EVENT // A DOCUMENT-START event.
-	yaml_DOCUMENT_END_EVENT   // A DOCUMENT-END event.
-	yaml_ALIAS_EVENT          // An ALIAS event.
-	yaml_SCALAR_EVENT         // A SCALAR event.
-	yaml_SEQUENCE_START_EVENT // A SEQUENCE-START event.
-	yaml_SEQUENCE_END_EVENT   // A SEQUENCE-END event.
-	yaml_MAPPING_START_EVENT  // A MAPPING-START event.
-	yaml_MAPPING_END_EVENT    // A MAPPING-END event.
-)
-
-// The event structure.
-type yaml_event_t struct {
-
-	// The event type.
-	typ yaml_event_type_t
-
-	// The start and end of the event.
-	start_mark, end_mark yaml_mark_t
-
-	// The document encoding (for yaml_STREAM_START_EVENT).
-	encoding yaml_encoding_t
-
-	// The version directive (for yaml_DOCUMENT_START_EVENT).
-	version_directive *yaml_version_directive_t
-
-	// The list of tag directives (for yaml_DOCUMENT_START_EVENT).
-	tag_directives []yaml_tag_directive_t
-
-	// The anchor (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_ALIAS_EVENT).
-	anchor []byte
-
-	// The tag (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT).
-	tag []byte
-
-	// The scalar value (for yaml_SCALAR_EVENT).
-	value []byte
-
-	// Is the document start/end indicator implicit, or the tag optional?
-	// (for yaml_DOCUMENT_START_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_SCALAR_EVENT).
-	implicit bool
-
-	// Is the tag optional for any non-plain style? (for yaml_SCALAR_EVENT).
-	quoted_implicit bool
-
-	// The style (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT).
-	style yaml_style_t
-}
-
-func (e *yaml_event_t) scalar_style() yaml_scalar_style_t     { return yaml_scalar_style_t(e.style) }
-func (e *yaml_event_t) sequence_style() yaml_sequence_style_t { return yaml_sequence_style_t(e.style) }
-func (e *yaml_event_t) mapping_style() yaml_mapping_style_t   { return yaml_mapping_style_t(e.style) }
-
-// Nodes
-
-const (
-	yaml_NULL_TAG      = "tag:yaml.org,2002:null"      // The tag !!null with the only possible value: null.
-	yaml_BOOL_TAG      = "tag:yaml.org,2002:bool"      // The tag !!bool with the values: true and false.
-	yaml_STR_TAG       = "tag:yaml.org,2002:str"       // The tag !!str for string values.
-	yaml_INT_TAG       = "tag:yaml.org,2002:int"       // The tag !!int for integer values.
-	yaml_FLOAT_TAG     = "tag:yaml.org,2002:float"     // The tag !!float for float values.
-	yaml_TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp" // The tag !!timestamp for date and time values.
-
-	yaml_SEQ_TAG = "tag:yaml.org,2002:seq" // The tag !!seq is used to denote sequences.
-	yaml_MAP_TAG = "tag:yaml.org,2002:map" // The tag !!map is used to denote mapping.
-
-	// Not in original libyaml.
-	yaml_BINARY_TAG = "tag:yaml.org,2002:binary"
-	yaml_MERGE_TAG  = "tag:yaml.org,2002:merge"
-
-	yaml_DEFAULT_SCALAR_TAG   = yaml_STR_TAG // The default scalar tag is !!str.
-	yaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG // The default sequence tag is !!seq.
-	yaml_DEFAULT_MAPPING_TAG  = yaml_MAP_TAG // The default mapping tag is !!map.
-)
-
-type yaml_node_type_t int
-
-// Node types.
-const (
-	// An empty node.
-	yaml_NO_NODE yaml_node_type_t = iota
-
-	yaml_SCALAR_NODE   // A scalar node.
-	yaml_SEQUENCE_NODE // A sequence node.
-	yaml_MAPPING_NODE  // A mapping node.
-)
-
-// An element of a sequence node.
-type yaml_node_item_t int
-
-// An element of a mapping node.
-type yaml_node_pair_t struct {
-	key   int // The key of the element.
-	value int // The value of the element.
-}
-
-// The node structure.
-type yaml_node_t struct {
-	typ yaml_node_type_t // The node type.
-	tag []byte           // The node tag.
-
-	// The node data.
-
-	// The scalar parameters (for yaml_SCALAR_NODE).
-	scalar struct {
-		value  []byte              // The scalar value.
-		length int                 // The length of the scalar value.
-		style  yaml_scalar_style_t // The scalar style.
-	}
-
-	// The sequence parameters (for YAML_SEQUENCE_NODE).
-	sequence struct {
-		items_data []yaml_node_item_t    // The stack of sequence items.
-		style      yaml_sequence_style_t // The sequence style.
-	}
-
-	// The mapping parameters (for yaml_MAPPING_NODE).
-	mapping struct {
-		pairs_data  []yaml_node_pair_t   // The stack of mapping pairs (key, value).
-		pairs_start *yaml_node_pair_t    // The beginning of the stack.
-		pairs_end   *yaml_node_pair_t    // The end of the stack.
-		pairs_top   *yaml_node_pair_t    // The top of the stack.
-		style       yaml_mapping_style_t // The mapping style.
-	}
-
-	start_mark yaml_mark_t // The beginning of the node.
-	end_mark   yaml_mark_t // The end of the node.
-
-}
-
-// The document structure.
-type yaml_document_t struct {
-
-	// The document nodes.
-	nodes []yaml_node_t
-
-	// The version directive.
-	version_directive *yaml_version_directive_t
-
-	// The list of tag directives.
-	tag_directives_data  []yaml_tag_directive_t
-	tag_directives_start int // The beginning of the tag directives list.
-	tag_directives_end   int // The end of the tag directives list.
-
-	start_implicit int // Is the document start indicator implicit?
-	end_implicit   int // Is the document end indicator implicit?
-
-	// The start/end of the document.
-	start_mark, end_mark yaml_mark_t
-}
-
-// The prototype of a read handler.
-//
-// The read handler is called when the parser needs to read more bytes from the
-// source. The handler should write not more than size bytes to the buffer.
-// The number of written bytes should be set to the size_read variable.
-//
-// [in,out]   data        A pointer to an application data specified by
-//                        yaml_parser_set_input().
-// [out]      buffer      The buffer to write the data from the source.
-// [in]       size        The size of the buffer.
-// [out]      size_read   The actual number of bytes read from the source.
-//
-// On success, the handler should return 1.  If the handler failed,
-// the returned value should be 0. On EOF, the handler should set the
-// size_read to 0 and return 1.
-type yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error)
-
-// This structure holds information about a potential simple key.
-type yaml_simple_key_t struct {
-	possible     bool        // Is a simple key possible?
-	required     bool        // Is a simple key required?
-	token_number int         // The number of the token.
-	mark         yaml_mark_t // The position mark.
-}
-
-// The states of the parser.
-type yaml_parser_state_t int
-
-const (
-	yaml_PARSE_STREAM_START_STATE yaml_parser_state_t = iota
-
-	yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE           // Expect the beginning of an implicit document.
-	yaml_PARSE_DOCUMENT_START_STATE                    // Expect DOCUMENT-START.
-	yaml_PARSE_DOCUMENT_CONTENT_STATE                  // Expect the content of a document.
-	yaml_PARSE_DOCUMENT_END_STATE                      // Expect DOCUMENT-END.
-	yaml_PARSE_BLOCK_NODE_STATE                        // Expect a block node.
-	yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE // Expect a block node or indentless sequence.
-	yaml_PARSE_FLOW_NODE_STATE                         // Expect a flow node.
-	yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE        // Expect the first entry of a block sequence.
-	yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE              // Expect an entry of a block sequence.
-	yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE         // Expect an entry of an indentless sequence.
-	yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE           // Expect the first key of a block mapping.
-	yaml_PARSE_BLOCK_MAPPING_KEY_STATE                 // Expect a block mapping key.
-	yaml_PARSE_BLOCK_MAPPING_VALUE_STATE               // Expect a block mapping value.
-	yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE         // Expect the first entry of a flow sequence.
-	yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE               // Expect an entry of a flow sequence.
-	yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE   // Expect a key of an ordered mapping.
-	yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE // Expect a value of an ordered mapping.
-	yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE   // Expect the and of an ordered mapping entry.
-	yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE            // Expect the first key of a flow mapping.
-	yaml_PARSE_FLOW_MAPPING_KEY_STATE                  // Expect a key of a flow mapping.
-	yaml_PARSE_FLOW_MAPPING_VALUE_STATE                // Expect a value of a flow mapping.
-	yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE          // Expect an empty value of a flow mapping.
-	yaml_PARSE_END_STATE                               // Expect nothing.
-)
-
-func (ps yaml_parser_state_t) String() string {
-	switch ps {
-	case yaml_PARSE_STREAM_START_STATE:
-		return "yaml_PARSE_STREAM_START_STATE"
-	case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE:
-		return "yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE"
-	case yaml_PARSE_DOCUMENT_START_STATE:
-		return "yaml_PARSE_DOCUMENT_START_STATE"
-	case yaml_PARSE_DOCUMENT_CONTENT_STATE:
-		return "yaml_PARSE_DOCUMENT_CONTENT_STATE"
-	case yaml_PARSE_DOCUMENT_END_STATE:
-		return "yaml_PARSE_DOCUMENT_END_STATE"
-	case yaml_PARSE_BLOCK_NODE_STATE:
-		return "yaml_PARSE_BLOCK_NODE_STATE"
-	case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:
-		return "yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE"
-	case yaml_PARSE_FLOW_NODE_STATE:
-		return "yaml_PARSE_FLOW_NODE_STATE"
-	case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:
-		return "yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE"
-	case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:
-		return "yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE"
-	case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:
-		return "yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE"
-	case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:
-		return "yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE"
-	case yaml_PARSE_BLOCK_MAPPING_KEY_STATE:
-		return "yaml_PARSE_BLOCK_MAPPING_KEY_STATE"
-	case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE:
-		return "yaml_PARSE_BLOCK_MAPPING_VALUE_STATE"
-	case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:
-		return "yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE"
-	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE:
-		return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE"
-	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:
-		return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE"
-	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:
-		return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE"
-	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:
-		return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE"
-	case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:
-		return "yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE"
-	case yaml_PARSE_FLOW_MAPPING_KEY_STATE:
-		return "yaml_PARSE_FLOW_MAPPING_KEY_STATE"
-	case yaml_PARSE_FLOW_MAPPING_VALUE_STATE:
-		return "yaml_PARSE_FLOW_MAPPING_VALUE_STATE"
-	case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:
-		return "yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE"
-	case yaml_PARSE_END_STATE:
-		return "yaml_PARSE_END_STATE"
-	}
-	return "<unknown parser state>"
-}
-
-// This structure holds aliases data.
-type yaml_alias_data_t struct {
-	anchor []byte      // The anchor.
-	index  int         // The node id.
-	mark   yaml_mark_t // The anchor mark.
-}
-
-// The parser structure.
-//
-// All members are internal. Manage the structure using the
-// yaml_parser_ family of functions.
-type yaml_parser_t struct {
-
-	// Error handling
-
-	error yaml_error_type_t // Error type.
-
-	problem string // Error description.
-
-	// The byte about which the problem occured.
-	problem_offset int
-	problem_value  int
-	problem_mark   yaml_mark_t
-
-	// The error context.
-	context      string
-	context_mark yaml_mark_t
-
-	// Reader stuff
-
-	read_handler yaml_read_handler_t // Read handler.
-
-	input_file io.Reader // File input data.
-	input      []byte    // String input data.
-	input_pos  int
-
-	eof bool // EOF flag
-
-	buffer     []byte // The working buffer.
-	buffer_pos int    // The current position of the buffer.
-
-	unread int // The number of unread characters in the buffer.
-
-	raw_buffer     []byte // The raw buffer.
-	raw_buffer_pos int    // The current position of the buffer.
-
-	encoding yaml_encoding_t // The input encoding.
-
-	offset int         // The offset of the current position (in bytes).
-	mark   yaml_mark_t // The mark of the current position.
-
-	// Scanner stuff
-
-	stream_start_produced bool // Have we started to scan the input stream?
-	stream_end_produced   bool // Have we reached the end of the input stream?
-
-	flow_level int // The number of unclosed '[' and '{' indicators.
-
-	tokens          []yaml_token_t // The tokens queue.
-	tokens_head     int            // The head of the tokens queue.
-	tokens_parsed   int            // The number of tokens fetched from the queue.
-	token_available bool           // Does the tokens queue contain a token ready for dequeueing.
-
-	indent  int   // The current indentation level.
-	indents []int // The indentation levels stack.
-
-	simple_key_allowed bool                // May a simple key occur at the current position?
-	simple_keys        []yaml_simple_key_t // The stack of simple keys.
-
-	// Parser stuff
-
-	state          yaml_parser_state_t    // The current parser state.
-	states         []yaml_parser_state_t  // The parser states stack.
-	marks          []yaml_mark_t          // The stack of marks.
-	tag_directives []yaml_tag_directive_t // The list of TAG directives.
-
-	// Dumper stuff
-
-	aliases []yaml_alias_data_t // The alias data.
-
-	document *yaml_document_t // The currently parsed document.
-}
-
-// Emitter Definitions
-
-// The prototype of a write handler.
-//
-// The write handler is called when the emitter needs to flush the accumulated
-// characters to the output.  The handler should write @a size bytes of the
-// @a buffer to the output.
-//
-// @param[in,out]   data        A pointer to an application data specified by
-//                              yaml_emitter_set_output().
-// @param[in]       buffer      The buffer with bytes to be written.
-// @param[in]       size        The size of the buffer.
-//
-// @returns On success, the handler should return @c 1.  If the handler failed,
-// the returned value should be @c 0.
-//
-type yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error
-
-type yaml_emitter_state_t int
-
-// The emitter states.
-const (
-	// Expect STREAM-START.
-	yaml_EMIT_STREAM_START_STATE yaml_emitter_state_t = iota
-
-	yaml_EMIT_FIRST_DOCUMENT_START_STATE       // Expect the first DOCUMENT-START or STREAM-END.
-	yaml_EMIT_DOCUMENT_START_STATE             // Expect DOCUMENT-START or STREAM-END.
-	yaml_EMIT_DOCUMENT_CONTENT_STATE           // Expect the content of a document.
-	yaml_EMIT_DOCUMENT_END_STATE               // Expect DOCUMENT-END.
-	yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE   // Expect the first item of a flow sequence.
-	yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE         // Expect an item of a flow sequence.
-	yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE     // Expect the first key of a flow mapping.
-	yaml_EMIT_FLOW_MAPPING_KEY_STATE           // Expect a key of a flow mapping.
-	yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE  // Expect a value for a simple key of a flow mapping.
-	yaml_EMIT_FLOW_MAPPING_VALUE_STATE         // Expect a value of a flow mapping.
-	yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE  // Expect the first item of a block sequence.
-	yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE        // Expect an item of a block sequence.
-	yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE    // Expect the first key of a block mapping.
-	yaml_EMIT_BLOCK_MAPPING_KEY_STATE          // Expect the key of a block mapping.
-	yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a block mapping.
-	yaml_EMIT_BLOCK_MAPPING_VALUE_STATE        // Expect a value of a block mapping.
-	yaml_EMIT_END_STATE                        // Expect nothing.
-)
-
-// The emitter structure.
-//
-// All members are internal.  Manage the structure using the @c yaml_emitter_
-// family of functions.
-type yaml_emitter_t struct {
-
-	// Error handling
-
-	error   yaml_error_type_t // Error type.
-	problem string            // Error description.
-
-	// Writer stuff
-
-	write_handler yaml_write_handler_t // Write handler.
-
-	output_buffer *[]byte   // String output data.
-	output_file   io.Writer // File output data.
-
-	buffer     []byte // The working buffer.
-	buffer_pos int    // The current position of the buffer.
-
-	raw_buffer     []byte // The raw buffer.
-	raw_buffer_pos int    // The current position of the buffer.
-
-	encoding yaml_encoding_t // The stream encoding.
-
-	// Emitter stuff
-
-	canonical   bool         // If the output is in the canonical style?
-	best_indent int          // The number of indentation spaces.
-	best_width  int          // The preferred width of the output lines.
-	unicode     bool         // Allow unescaped non-ASCII characters?
-	line_break  yaml_break_t // The preferred line break.
-
-	state  yaml_emitter_state_t   // The current emitter state.
-	states []yaml_emitter_state_t // The stack of states.
-
-	events      []yaml_event_t // The event queue.
-	events_head int            // The head of the event queue.
-
-	indents []int // The stack of indentation levels.
-
-	tag_directives []yaml_tag_directive_t // The list of tag directives.
-
-	indent int // The current indentation level.
-
-	flow_level int // The current flow level.
-
-	root_context       bool // Is it the document root context?
-	sequence_context   bool // Is it a sequence context?
-	mapping_context    bool // Is it a mapping context?
-	simple_key_context bool // Is it a simple mapping key context?
-
-	line       int  // The current line.
-	column     int  // The current column.
-	whitespace bool // If the last character was a whitespace?
-	indention  bool // If the last character was an indentation character (' ', '-', '?', ':')?
-	open_ended bool // If an explicit document end is required?
-
-	// Anchor analysis.
-	anchor_data struct {
-		anchor []byte // The anchor value.
-		alias  bool   // Is it an alias?
-	}
-
-	// Tag analysis.
-	tag_data struct {
-		handle []byte // The tag handle.
-		suffix []byte // The tag suffix.
-	}
-
-	// Scalar analysis.
-	scalar_data struct {
-		value                 []byte              // The scalar value.
-		multiline             bool                // Does the scalar contain line breaks?
-		flow_plain_allowed    bool                // Can the scalar be expessed in the flow plain style?
-		block_plain_allowed   bool                // Can the scalar be expressed in the block plain style?
-		single_quoted_allowed bool                // Can the scalar be expressed in the single quoted style?
-		block_allowed         bool                // Can the scalar be expressed in the literal or folded styles?
-		style                 yaml_scalar_style_t // The output style.
-	}
-
-	// Dumper stuff
-
-	opened bool // If the stream was already opened?
-	closed bool // If the stream was already closed?
-
-	// The information associated with the document nodes.
-	anchors *struct {
-		references int  // The number of references.
-		anchor     int  // The anchor id.
-		serialized bool // If the node has been emitted?
-	}
-
-	last_anchor_id int // The last assigned anchor id.
-
-	document *yaml_document_t // The currently emitted document.
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlprivateh.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlprivateh.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlprivateh.go
deleted file mode 100644
index 8110ce3..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlprivateh.go
+++ /dev/null
@@ -1,173 +0,0 @@
-package yaml
-
-const (
-	// The size of the input raw buffer.
-	input_raw_buffer_size = 512
-
-	// The size of the input buffer.
-	// It should be possible to decode the whole raw buffer.
-	input_buffer_size = input_raw_buffer_size * 3
-
-	// The size of the output buffer.
-	output_buffer_size = 128
-
-	// The size of the output raw buffer.
-	// It should be possible to encode the whole output buffer.
-	output_raw_buffer_size = (output_buffer_size*2 + 2)
-
-	// The size of other stacks and queues.
-	initial_stack_size  = 16
-	initial_queue_size  = 16
-	initial_string_size = 16
-)
-
-// Check if the character at the specified position is an alphabetical
-// character, a digit, '_', or '-'.
-func is_alpha(b []byte, i int) bool {
-	return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-'
-}
-
-// Check if the character at the specified position is a digit.
-func is_digit(b []byte, i int) bool {
-	return b[i] >= '0' && b[i] <= '9'
-}
-
-// Get the value of a digit.
-func as_digit(b []byte, i int) int {
-	return int(b[i]) - '0'
-}
-
-// Check if the character at the specified position is a hex-digit.
-func is_hex(b []byte, i int) bool {
-	return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || b[i] >= 'a' && b[i] <= 'f'
-}
-
-// Get the value of a hex-digit.
-func as_hex(b []byte, i int) int {
-	bi := b[i]
-	if bi >= 'A' && bi <= 'F' {
-		return int(bi) - 'A' + 10
-	}
-	if bi >= 'a' && bi <= 'f' {
-		return int(bi) - 'a' + 10
-	}
-	return int(bi) - '0'
-}
-
-// Check if the character is ASCII.
-func is_ascii(b []byte, i int) bool {
-	return b[i] <= 0x7F
-}
-
-// Check if the character at the start of the buffer can be printed unescaped.
-func is_printable(b []byte, i int) bool {
-	return ((b[i] == 0x0A) || // . == #x0A
-		(b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E
-		(b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF
-		(b[i] > 0xC2 && b[i] < 0xED) ||
-		(b[i] == 0xED && b[i+1] < 0xA0) ||
-		(b[i] == 0xEE) ||
-		(b[i] == 0xEF && // #xE000 <= . <= #xFFFD
-			!(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF
-			!(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF))))
-}
-
-// Check if the character at the specified position is NUL.
-func is_z(b []byte, i int) bool {
-	return b[i] == 0x00
-}
-
-// Check if the beginning of the buffer is a BOM.
-func is_bom(b []byte, i int) bool {
-	return b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF
-}
-
-// Check if the character at the specified position is space.
-func is_space(b []byte, i int) bool {
-	return b[i] == ' '
-}
-
-// Check if the character at the specified position is tab.
-func is_tab(b []byte, i int) bool {
-	return b[i] == '\t'
-}
-
-// Check if the character at the specified position is blank (space or tab).
-func is_blank(b []byte, i int) bool {
-	//return is_space(b, i) || is_tab(b, i)
-	return b[i] == ' ' || b[i] == '\t'
-}
-
-// Check if the character at the specified position is a line break.
-func is_break(b []byte, i int) bool {
-	return (b[i] == '\r' || // CR (#xD)
-		b[i] == '\n' || // LF (#xA)
-		b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
-		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
-		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029)
-}
-
-func is_crlf(b []byte, i int) bool {
-	return b[i] == '\r' && b[i+1] == '\n'
-}
-
-// Check if the character is a line break or NUL.
-func is_breakz(b []byte, i int) bool {
-	//return is_break(b, i) || is_z(b, i)
-	return (        // is_break:
-	b[i] == '\r' || // CR (#xD)
-		b[i] == '\n' || // LF (#xA)
-		b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
-		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
-		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)
-		// is_z:
-		b[i] == 0)
-}
-
-// Check if the character is a line break, space, or NUL.
-func is_spacez(b []byte, i int) bool {
-	//return is_space(b, i) || is_breakz(b, i)
-	return ( // is_space:
-	b[i] == ' ' ||
-		// is_breakz:
-		b[i] == '\r' || // CR (#xD)
-		b[i] == '\n' || // LF (#xA)
-		b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
-		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
-		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)
-		b[i] == 0)
-}
-
-// Check if the character is a line break, space, tab, or NUL.
-func is_blankz(b []byte, i int) bool {
-	//return is_blank(b, i) || is_breakz(b, i)
-	return ( // is_blank:
-	b[i] == ' ' || b[i] == '\t' ||
-		// is_breakz:
-		b[i] == '\r' || // CR (#xD)
-		b[i] == '\n' || // LF (#xA)
-		b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
-		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
-		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)
-		b[i] == 0)
-}
-
-// Determine the width of the character.
-func width(b byte) int {
-	// Don't replace these by a switch without first
-	// confirming that it is being inlined.
-	if b&0x80 == 0x00 {
-		return 1
-	}
-	if b&0xE0 == 0xC0 {
-		return 2
-	}
-	if b&0xF0 == 0xE0 {
-		return 3
-	}
-	if b&0xF8 == 0xF0 {
-		return 4
-	}
-	return 0
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 8f71f43..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "{}"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright {yyyy} {name of copyright owner}
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
deleted file mode 100644
index 2e46929..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Newt OS 
-
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/build.go
----------------------------------------------------------------------
diff --git a/cli/build.go b/cli/build.go
deleted file mode 100644
index 9e52ddf..0000000
--- a/cli/build.go
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cli
-
-import (
-	"os"
-)
-
-// Recursively iterates through an egg's dependencies, adding each egg
-// encountered to the supplied set.
-func collectDepsAux(clutch *Clutch, egg *Egg, set *map[*Egg]bool) error {
-	if (*set)[egg] {
-		return nil
-	}
-
-	(*set)[egg] = true
-
-	for _, dep := range egg.Deps {
-		if dep.Name == "" {
-			break
-		}
-
-		// Get egg structure
-		degg, err := clutch.ResolveEggName(dep.Name)
-		if err != nil {
-			return err
-		}
-
-		collectDepsAux(clutch, degg, set)
-	}
-
-	return nil
-}
-
-// Recursively iterates through an egg's dependencies.  The resulting array
-// contains a pointer to each encountered egg.
-func collectDeps(clutch *Clutch, egg *Egg) ([]*Egg, error) {
-	set := map[*Egg]bool{}
-
-	err := collectDepsAux(clutch, egg, &set)
-	if err != nil {
-		return nil, err
-	}
-
-	arr := []*Egg{}
-	for p, _ := range set {
-		arr = append(arr, p)
-	}
-
-	return arr, nil
-}
-
-// Calculates the include paths exported by the specified egg and all of
-// its recursive dependencies.
-func recursiveIncludePaths(clutch *Clutch, egg *Egg,
-	t *Target) ([]string, error) {
-
-	deps, err := collectDeps(clutch, egg)
-	if err != nil {
-		return nil, err
-	}
-
-	incls := []string{}
-	for _, p := range deps {
-		eggIncls, err := p.GetIncludes(t)
-		if err != nil {
-			return nil, err
-		}
-		incls = append(incls, eggIncls...)
-	}
-
-	return incls, nil
-}
-
-// Calculates the include paths exported by the specified target's BSP and all
-// of its recursive dependencies.
-func BspIncludePaths(clutch *Clutch, t *Target) ([]string, error) {
-	if t.Bsp == "" {
-		return nil, NewNewtError("Expected a BSP")
-	}
-
-	bspEgg, err := clutch.ResolveEggName(t.Bsp)
-	if err != nil {
-		return nil, NewNewtError("No BSP egg for " + t.Bsp + " exists")
-	}
-
-	return recursiveIncludePaths(clutch, bspEgg, t)
-}
-
-func buildBsp(t *Target, clutch *Clutch, incls *[]string,
-	libs *[]string, capEggs map[string]string) (string, error) {
-
-	if t.Bsp == "" {
-		return "", NewNewtError("Expected a BSP")
-	}
-
-	bspEgg, err := clutch.ResolveEggName(t.Bsp)
-	if err != nil {
-		return "", NewNewtError("No BSP egg for " + t.Bsp + " exists")
-	}
-
-	if err = clutch.Build(t, t.Bsp, *incls, libs); err != nil {
-		return "", err
-	}
-
-	// A BSP doesn't have to contain source; don't fail if no library was
-	// built.
-	if lib := clutch.GetEggLib(t, bspEgg); NodeExist(lib) {
-		*libs = append(*libs, lib)
-	}
-
-	var linkerScript string
-	if bspEgg.LinkerScript != "" {
-		linkerScript = bspEgg.BasePath + "/" + bspEgg.LinkerScript
-	} else {
-		linkerScript = ""
-	}
-
-	return linkerScript, nil
-}
-
-// Creates the set of compiler flags that should be specified when building a
-// particular target-entity pair.  The "entity" is what is being built; either
-// an egg or a project.
-func CreateCflags(clutch *Clutch, c *Compiler, t *Target,
-	entityCflags string) string {
-
-	cflags := c.Cflags + " " + entityCflags + " " + t.Cflags
-
-	// The 'test' identity causes the TEST symbol to be defined.  This allows
-	// egg code to behave differently in test builds.
-	if t.HasIdentity("test") {
-		cflags += " -DTEST"
-	}
-
-	cflags += " -DARCH_" + t.Arch
-
-	// If a non-BSP egg is being built, add the BSP's C flags to the list.
-	// The BSP's compiler flags get exported to all eggs.
-	bspEgg, err := clutch.ResolveEggName(t.Bsp)
-	if err == nil && bspEgg.Cflags != entityCflags {
-		cflags += " " + bspEgg.Cflags
-	}
-
-	return cflags
-}
-
-func EggIncludeDirs(egg *Egg, t *Target) []string {
-	srcDir := egg.BasePath + "/src/"
-
-	incls := egg.Includes
-	incls = append(incls, srcDir)
-	incls = append(incls, srcDir+"/arch/"+t.Arch)
-
-	if t.HasIdentity("test") {
-		testSrcDir := srcDir + "/test"
-		incls = append(incls, testSrcDir)
-		incls = append(incls, testSrcDir+"/arch/"+t.Arch)
-	}
-
-	return incls
-}
-
-// Recursively compiles all the .c and .s files in the specified directory.
-// Architecture-specific files are also compiled.
-func BuildDir(srcDir string, c *Compiler, t *Target, ignDirs []string) error {
-	var err error
-
-	StatusMessage(VERBOSITY_VERBOSE, "compiling src in base directory: %s\n",
-		srcDir)
-
-	// First change into the egg src directory, and build all the objects
-	// there
-	os.Chdir(srcDir)
-
-	// Don't recurse into destination directories.
-	ignDirs = append(ignDirs, "obj")
-	ignDirs = append(ignDirs, "bin")
-
-	// Ignore architecture-specific source files for now.  Use a temporary
-	// string array here so that the "arch" directory is not ignored in the
-	// subsequent architecture-specific compile phase.
-	baseIgnDirs := append(ignDirs, "arch")
-
-	if err = c.RecursiveCompile("*.c", 0, baseIgnDirs); err != nil {
-		return err
-	}
-
-	archDir := srcDir + "/arch/" + t.Arch + "/"
-	StatusMessage(VERBOSITY_VERBOSE,
-		"compiling architecture specific src eggs in directory: %s\n",
-		archDir)
-
-	if NodeExist(archDir) {
-		if err := os.Chdir(archDir); err != nil {
-			return NewNewtError(err.Error())
-		}
-		if err := c.RecursiveCompile("*.c", 0, ignDirs); err != nil {
-			return err
-		}
-
-		// compile assembly sources in recursive compile as well
-		if err = c.RecursiveCompile("*.s", 1, ignDirs); err != nil {
-			return err
-		}
-	}
-
-	return nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/clutch.go
----------------------------------------------------------------------
diff --git a/cli/clutch.go b/cli/clutch.go
deleted file mode 100644
index 3d59fc3..0000000
--- a/cli/clutch.go
+++ /dev/null
@@ -1,1002 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cli
-
-import (
-	"bytes"
-	"fmt"
-	"github.com/spf13/viper"
-	"io/ioutil"
-	"log"
-	"os"
-	"path/filepath"
-	"strings"
-)
-
-type Clutch struct {
-	// Nestsitory associated with the Eggs
-	Nest *Nest
-
-	// List of packages for Nest
-	Eggs map[string]*Egg
-
-	EggShells map[string]*EggShell
-
-	Name string
-
-	LarvaFile string
-
-	RemoteUrl string
-
-	Branch string
-}
-
-// Allocate a new package manager structure, and initialize it.
-func NewClutch(nest *Nest) (*Clutch, error) {
-	clutch := &Clutch{
-		Nest: nest,
-	}
-	err := clutch.Init()
-
-	return clutch, err
-}
-
-func (clutch *Clutch) LoadConfigs(t *Target, force bool) error {
-	for _, egg := range clutch.Eggs {
-		if err := egg.LoadConfig(t, force); err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-func (clutch *Clutch) CheckEggDeps(egg *Egg,
-	deps map[string]*DependencyRequirement,
-	reqcap map[string]*DependencyRequirement,
-	caps map[string]*DependencyRequirement,
-	capEggs map[string]string) error {
-
-	for _, depReq := range egg.Deps {
-		// don't process this package if we've already processed it
-		if _, ok := deps[depReq.String()]; ok {
-			continue
-		}
-
-		eggName := egg.Name
-		StatusMessage(VERBOSITY_VERBOSE,
-			"Checking dependency %s for package %s\n", depReq.Name, eggName)
-		egg, ok := clutch.Eggs[depReq.Name]
-		if !ok {
-			return NewNewtError(
-				fmt.Sprintf("No package dependency %s found for %s",
-					depReq.Name, eggName))
-		}
-
-		if ok := depReq.SatisfiesDependency(egg); !ok {
-			return NewNewtError(fmt.Sprintf("Egg %s doesn't satisfy dependency %s",
-				egg.Name, depReq))
-		}
-
-		// We've checked this dependency requirement, all is gute!
-		deps[depReq.String()] = depReq
-	}
-
-	for _, reqCap := range egg.ReqCapabilities {
-		reqcap[reqCap.String()] = reqCap
-	}
-
-	for _, cap := range egg.Capabilities {
-		if caps[cap.String()] != nil && capEggs[cap.String()] != egg.FullName {
-			return NewNewtError(fmt.Sprintf("Multiple eggs with capability %s",
-				cap.String()))
-		}
-		caps[cap.String()] = cap
-		if capEggs != nil {
-			capEggs[cap.String()] = egg.FullName
-		}
-	}
-
-	// Now go through and recurse through the sub-package dependencies
-	for _, depReq := range egg.Deps {
-		if _, ok := deps[depReq.String()]; ok {
-			continue
-		}
-
-		if err := clutch.CheckEggDeps(clutch.Eggs[depReq.Name], deps,
-			reqcap, caps, capEggs); err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-func (clutch *Clutch) VerifyCaps(reqcaps map[string]*DependencyRequirement,
-	caps map[string]*DependencyRequirement) error {
-
-	for name, rcap := range reqcaps {
-		capability, ok := caps[name]
-		if !ok {
-			return NewNewtError(fmt.Sprintf("Required capability %s not found",
-				name))
-		}
-
-		if err := rcap.SatisfiesCapability(capability); err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-func (clutch *Clutch) CheckDeps() error {
-	// Go through all the packages and check that their dependencies are satisfied
-	for _, egg := range clutch.Eggs {
-		deps := map[string]*DependencyRequirement{}
-		reqcap := map[string]*DependencyRequirement{}
-		caps := map[string]*DependencyRequirement{}
-
-		if err := clutch.CheckEggDeps(egg, deps, reqcap, caps, nil); err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-// Load an individual package specified by eggName into the package list for
-// this repository
-func (clutch *Clutch) loadEgg(eggDir string, eggPrefix string,
-	eggName string) error {
-	StatusMessage(VERBOSITY_VERBOSE, "Loading Egg "+eggDir+"...\n")
-
-	if clutch.Eggs == nil {
-		clutch.Eggs = make(map[string]*Egg)
-	}
-
-	egg, err := NewEgg(clutch.Nest, eggDir)
-	if err != nil {
-		return nil
-	}
-
-	clutch.Eggs[eggPrefix+eggName] = egg
-
-	return nil
-}
-
-func (clutch *Clutch) String() string {
-	str := ""
-	for eggName, _ := range clutch.Eggs {
-		str += eggName + " "
-	}
-	return str
-}
-
-// Recursively load a package.  Given the baseDir of the packages (e.g. egg/ or
-// hw/bsp), and the base package name.
-func (clutch *Clutch) loadEggDir(baseDir string, eggPrefix string,
-	eggName string) error {
-	log.Printf("[DEBUG] Loading eggs in %s, starting with egg %s",
-		baseDir, eggName)
-
-	// first recurse and load subpackages
-	list, err := ioutil.ReadDir(baseDir + "/" + eggName)
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	for _, ent := range list {
-		if !ent.IsDir() {
-			continue
-		}
-
-		name := ent.Name()
-
-		if name == "src" || name == "include" || strings.HasPrefix(name, ".") ||
-			name == "bin" {
-			continue
-		} else {
-			if err := clutch.loadEggDir(baseDir, eggPrefix,
-				eggName+"/"+name); err != nil {
-				return err
-			}
-		}
-	}
-
-	if NodeNotExist(baseDir + "/" + eggName + "/egg.yml") {
-		return nil
-	}
-
-	return clutch.loadEgg(baseDir+"/"+eggName, eggPrefix, eggName)
-}
-
-// Load all the packages in the repository into the package structure
-func (clutch *Clutch) loadEggs() error {
-	nest := clutch.Nest
-
-	// Multiple package directories to be searched
-	searchDirs := []string{
-		"compiler/",
-		"libs/",
-		"net/",
-		"hw/bsp/",
-		"hw/mcu/",
-		"hw/mcu/stm",
-		"hw/drivers/",
-		"hw/",
-		"project/",
-	}
-
-	for _, eggDir := range searchDirs {
-		eggBaseDir := nest.BasePath + "/" + eggDir
-
-		if NodeNotExist(eggBaseDir) {
-			continue
-		}
-
-		eggList, err := ioutil.ReadDir(eggBaseDir)
-		if err != nil {
-			return NewNewtError(err.Error())
-		}
-
-		for _, subEggDir := range eggList {
-			name := subEggDir.Name()
-			if filepath.HasPrefix(name, ".") || filepath.HasPrefix(name, "..") {
-				continue
-			}
-
-			if !subEggDir.IsDir() {
-				continue
-			}
-
-			if err = clutch.loadEggDir(eggBaseDir, eggDir, name); err != nil {
-				return err
-			}
-		}
-	}
-
-	return nil
-}
-
-// Initialize the package manager
-func (clutch *Clutch) Init() error {
-	if err := clutch.loadEggs(); err != nil {
-		return err
-	}
-
-	clutch.EggShells = map[string]*EggShell{}
-
-	return nil
-}
-
-// Resolve the package specified by eggName into a package structure.
-func (clutch *Clutch) ResolveEggName(eggName string) (*Egg, error) {
-	egg, ok := clutch.Eggs[eggName]
-	if !ok {
-		return nil, NewNewtError(fmt.Sprintf("Invalid egg '%s' specified "+
-			"(eggs = %s)", eggName, clutch))
-	}
-	return egg, nil
-}
-
-func (clutch *Clutch) ResolveEggShellName(eggName string) (*EggShell, error) {
-	eggShell, ok := clutch.EggShells[eggName]
-	if !ok {
-		return nil, NewNewtError(fmt.Sprintf("Invalid egg '%s' specified "+
-			"(eggs = %s)", eggName, clutch))
-	}
-	return eggShell, nil
-}
-
-func (clutch *Clutch) ResolveEggDir(eggDir string) (*Egg, error) {
-	eggDir = filepath.Clean(eggDir)
-	for name, egg := range clutch.Eggs {
-		if filepath.Clean(egg.BasePath) == eggDir {
-			return clutch.Eggs[name], nil
-		}
-	}
-	return nil, NewNewtError(fmt.Sprintf("Cannot resolve package dir %s in "+
-		"package manager", eggDir))
-}
-
-// Clean the build for the package specified by eggName.   if cleanAll is
-// specified, all architectures are cleaned.
-func (clutch *Clutch) BuildClean(t *Target, eggName string, cleanAll bool) error {
-	egg, err := clutch.ResolveEggName(eggName)
-	if err != nil {
-		return err
-	}
-
-	if err := egg.LoadConfig(t, false); err != nil {
-		return err
-	}
-
-	tName := t.Name + "/"
-	if cleanAll {
-		tName = ""
-	}
-
-	if egg.Clean {
-		return nil
-	}
-	egg.Clean = true
-
-	for _, dep := range egg.Deps {
-		if err := clutch.BuildClean(t, dep.Name, cleanAll); err != nil {
-			return err
-		}
-	}
-
-	c, err := NewCompiler(t.GetCompiler(), t.Cdef, t.Name, []string{})
-	if err != nil {
-		return err
-	}
-
-	if NodeExist(egg.BasePath + "/src/") {
-		if err := c.RecursiveClean(egg.BasePath+"/src/", tName); err != nil {
-			return err
-		}
-
-		if err := os.RemoveAll(egg.BasePath + "/bin/" + tName); err != nil {
-			return NewNewtError(err.Error())
-		}
-	}
-
-	egg.Clean = true
-
-	return nil
-}
-
-func (clutch *Clutch) GetEggLib(t *Target, egg *Egg) string {
-	libDir := egg.BasePath + "/bin/" + t.Name + "/" +
-		"lib" + filepath.Base(egg.Name) + ".a"
-	return libDir
-}
-
-// @param incls                 Extra include paths that get specified during
-//                                  build; not modified by this function.
-// @param libs                  List of libraries that have been built so far;
-//                                  This function appends entries to this list.
-func (clutch *Clutch) buildDeps(egg *Egg, t *Target, incls *[]string,
-	libs *[]string) error {
-
-	StatusMessage(VERBOSITY_VERBOSE,
-		"Building egg dependencies for %s, target %s\n", egg.Name, t.Name)
-
-	var err error
-
-	if egg.Includes, err = egg.GetIncludes(t); err != nil {
-		return err
-	}
-
-	if incls == nil {
-		incls = &[]string{}
-	}
-	if libs == nil {
-		libs = &[]string{}
-	}
-
-	for _, dep := range egg.Deps {
-		if dep.Name == "" {
-			break
-		}
-
-		log.Printf("[DEBUG] Loading package dependency: %s", dep.Name)
-		// Get package structure
-		degg, err := clutch.ResolveEggName(dep.Name)
-		if err != nil {
-			return err
-		}
-
-		// Build the package
-		if err = clutch.Build(t, dep.Name, *incls, libs); err != nil {
-			return err
-		}
-
-		// After build, get dependency package includes.  Build function
-		// generates all the package includes
-		egg.Includes = append(egg.Includes, degg.Includes...)
-		if lib := clutch.GetEggLib(t, degg); NodeExist(lib) {
-			*libs = append(*libs, lib)
-		}
-	}
-
-	// Add on dependency includes to package includes
-	log.Printf("[DEBUG] Egg dependencies for %s built, incls = %s",
-		egg.Name, egg.Includes)
-
-	return nil
-}
-
-// Build the package specified by eggName
-//
-// @param incls            Extra include paths that get specified during
-//                             build.  Note: passed by value.
-// @param lib              List of libraries that have been built so far;
-//                             This function appends entries to this list.
-func (clutch *Clutch) Build(t *Target, eggName string, incls []string,
-	libs *[]string) error {
-
-	// Look up package structure
-	egg, err := clutch.ResolveEggName(eggName)
-	if err != nil {
-		return err
-	}
-
-	if err := egg.LoadConfig(t, false); err != nil {
-		return err
-	}
-
-	// already built the package, no need to rebuild.  This is to handle
-	// recursive calls to Build()
-	if egg.Built {
-		return nil
-	}
-	egg.Built = true
-
-	if err := clutch.buildDeps(egg, t, &incls, libs); err != nil {
-		return err
-	}
-
-	StatusMessage(VERBOSITY_VERBOSE, "Building egg %s for arch %s\n",
-		eggName, t.Arch)
-
-	// NOTE: this assignment must happen after the call to buildDeps(), as
-	// buildDeps() fills in the package includes.
-	incls = append(incls, EggIncludeDirs(egg, t)...)
-	log.Printf("[DEBUG] Egg includes for %s are %s", eggName, incls)
-
-	srcDir := egg.BasePath + "/src/"
-	if NodeNotExist(srcDir) {
-		// nothing to compile, return true!
-		return nil
-	}
-
-	// Build the package designated by eggName
-	// Initialize a compiler
-	c, err := NewCompiler(t.GetCompiler(), t.Cdef, t.Name, incls)
-	if err != nil {
-		return err
-	}
-	// setup Cflags, Lflags and Aflags
-	c.Cflags = CreateCflags(clutch, c, t, egg.Cflags)
-	c.Lflags += " " + egg.Lflags + " " + t.Lflags
-	c.Aflags += " " + egg.Aflags + " " + t.Aflags
-
-	log.Printf("[DEBUG] compiling src eggs in base egg directory: %s", srcDir)
-
-	// For now, ignore test code.  Tests get built later if the test identity
-	// is in effect.
-	ignDirs := []string{"test"}
-
-	if err = BuildDir(srcDir, c, t, ignDirs); err != nil {
-		return err
-	}
-
-	// Now build the test code if requested.
-	if t.HasIdentity("test") {
-		testSrcDir := srcDir + "/test"
-		if err = BuildDir(testSrcDir, c, t, ignDirs); err != nil {
-			return err
-		}
-	}
-
-	// Archive everything into a static library, which can be linked with a
-	// main program
-	if err := os.Chdir(egg.BasePath + "/"); err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	binDir := egg.BasePath + "/bin/" + t.Name + "/"
-
-	if NodeNotExist(binDir) {
-		if err := os.MkdirAll(binDir, 0755); err != nil {
-			return NewNewtError(err.Error())
-		}
-	}
-
-	if err = c.CompileArchive(clutch.GetEggLib(t, egg), []string{}); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// Check the include directories for the package, to make sure there are
-// no conflicts in include paths for source code
-func (clutch *Clutch) checkIncludes(egg *Egg) error {
-	incls, err := filepath.Glob(egg.BasePath + "/include/*")
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	// Append all the architecture specific directories
-	archDir := egg.BasePath + "/include/" + egg.Name + "/arch/"
-	dirs, err := ioutil.ReadDir(archDir)
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	for _, dir := range dirs {
-		if !dir.IsDir() {
-			return NewNewtError(fmt.Sprintf(
-				"Only directories are allowed in architecture dir: %s",
-				archDir+dir.Name()))
-		}
-
-		incls2, err := filepath.Glob(archDir + dir.Name() + "/*")
-		if err != nil {
-			return NewNewtError(err.Error())
-		}
-
-		incls = append(incls, incls2...)
-	}
-
-	for _, incl := range incls {
-		finfo, err := os.Stat(incl)
-		if err != nil {
-			return NewNewtError(err.Error())
-		}
-
-		bad := false
-		if !finfo.IsDir() {
-			bad = true
-		}
-
-		if filepath.Base(incl) != egg.Name {
-			if egg.IsBsp && filepath.Base(incl) != "bsp" {
-				bad = true
-			}
-		}
-
-		if bad {
-			return NewNewtError(fmt.Sprintf("File %s should not exist"+
-				"in include directory, only file allowed in include "+
-				"directory is a directory with the package name %s",
-				incl, egg.Name))
-		}
-	}
-
-	return nil
-}
-
-// Clean the tests in the tests parameter, for the package identified by
-// eggName.  If cleanAll is set to true, all architectures will be removed.
-func (clutch *Clutch) TestClean(t *Target, eggName string,
-	cleanAll bool) error {
-	egg, err := clutch.ResolveEggName(eggName)
-	if err != nil {
-		return err
-	}
-
-	if err := egg.LoadConfig(t, false); err != nil {
-		return err
-	}
-
-	tName := t.Name + "/"
-	if cleanAll {
-		tName = ""
-	}
-
-	if err := os.RemoveAll(egg.BasePath + "/src/test/bin/" + tName); err != nil {
-		return NewNewtError(err.Error())
-	}
-	if err := os.RemoveAll(egg.BasePath + "/src/test/obj/" + tName); err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	return nil
-}
-
-// Compile tests specified by the tests parameter.  The tests are linked
-// to the package specified by the egg parameter
-func (clutch *Clutch) linkTests(t *Target, egg *Egg,
-	incls []string, libs *[]string) error {
-
-	c, err := NewCompiler(t.GetCompiler(), t.Cdef, t.Name, incls)
-	if err != nil {
-		return err
-	}
-
-	// Configure Lflags.  Since we are only linking, Cflags and Aflags are
-	// unnecessary.
-	c.Lflags += " " + egg.Lflags + " " + t.Lflags
-
-	testBinDir := egg.BasePath + "/src/test/bin/" + t.Name + "/"
-	binFile := testBinDir + egg.TestBinName()
-	options := map[string]bool{}
-
-	// Determine if the test executable is already up to date.
-	linkRequired, err := c.depTracker.LinkRequired(binFile, options, *libs)
-	if err != nil {
-		return err
-	}
-
-	// Build the test executable if necessary.
-	if linkRequired {
-		if NodeNotExist(testBinDir) {
-			if err := os.MkdirAll(testBinDir, 0755); err != nil {
-				return NewNewtError(err.Error())
-			}
-		}
-
-		err = c.CompileBinary(binFile, options, *libs)
-		if err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-// Run all the tests in the tests parameter.  egg is the package to check for
-// the tests.  exitOnFailure specifies whether to exit immediately when a
-// test fails, or continue executing all tests.
-func (clutch *Clutch) runTests(t *Target, egg *Egg, exitOnFailure bool) error {
-	StatusMessage(VERBOSITY_DEFAULT, "Testing egg %s for arch %s\n",
-		egg.Name, t.Arch)
-
-	if err := os.Chdir(egg.BasePath + "/src/test/bin/" + t.Name +
-		"/"); err != nil {
-		return err
-	}
-
-	o, err := ShellCommand("./" + egg.TestBinName())
-	if err != nil {
-		StatusMessage(VERBOSITY_DEFAULT, "%s", string(o))
-
-		// Always terminate on test failure since only one test is being run.
-		return NewtErrorNoTrace(fmt.Sprintf("Test %s failed",
-			egg.TestBinName()))
-	} else {
-		StatusMessage(VERBOSITY_VERBOSE, "%s", string(o))
-		StatusMessage(VERBOSITY_DEFAULT, "Test %s ok!\n", egg.TestBinName())
-		return nil
-	}
-}
-
-// Check to ensure tests exist.  Go through the array of tests specified by
-// the tests parameter.  egg is the package to check for these tests.
-func (clutch *Clutch) testsExist(egg *Egg) error {
-	dirName := egg.BasePath + "/src/test/"
-	if NodeNotExist(dirName) {
-		return NewNewtError("No test exists for package " + egg.Name)
-	}
-
-	return nil
-}
-
-// Test the package identified by eggName, by executing the tests specified.
-// exitOnFailure signifies whether to stop the test program when one of them
-// fails.
-func (clutch *Clutch) Test(t *Target, eggName string,
-	exitOnFailure bool) error {
-
-	// A few identities are implicitly exported when the test command is used:
-	// *    test:       ensures that the test code gets compiled.
-	// *    selftest:   indicates that there is no project
-	t.Identities["test"] = "test"
-	t.Identities["selftest"] = "selftest"
-
-	egg, err := clutch.ResolveEggName(eggName)
-	if err != nil {
-		return err
-	}
-
-	if err := egg.LoadConfig(t, false); err != nil {
-		return err
-	}
-
-	// Make sure the test directories exist
-	if err := clutch.testsExist(egg); err != nil {
-		return err
-	}
-
-	// The egg under test must be compiled with the PKG_TEST symbol defined so
-	// that the appropriate main function gets built.
-	egg.Cflags += " -DPKG_TEST"
-
-	incls := []string{}
-	libs := []string{}
-
-	// If there is a BSP:
-	//     1. Calculate the include paths that it and its dependencies export.
-	//        This set of include paths is accessible during all subsequent
-	//        builds.
-	//     2. Build the BSP package.
-	if t.Bsp != "" {
-		incls, err = BspIncludePaths(clutch, t)
-		if err != nil {
-			return err
-		}
-		_, err = buildBsp(t, clutch, &incls, &libs, nil)
-		if err != nil {
-			return err
-		}
-	}
-
-	// Build the package under test.
-	if err := clutch.Build(t, eggName, incls, &libs); err != nil {
-		return err
-	}
-	lib := clutch.GetEggLib(t, egg)
-	if !NodeExist(lib) {
-		return NewNewtError("Egg " + eggName + " did not produce binary")
-	}
-	libs = append(libs, lib)
-
-	// Compile the package's test code.
-	if err := clutch.linkTests(t, egg, incls, &libs); err != nil {
-		return err
-	}
-
-	// Run the tests.
-	if err := clutch.runTests(t, egg, exitOnFailure); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (cl *Clutch) LoadFromClutch(local *Clutch) error {
-	var err error
-	for _, egg := range local.Eggs {
-		if err := egg.LoadConfig(nil, false); err != nil {
-			return err
-		}
-
-		log.Printf("[DEBUG] Egg %s loaded, putting it into clutch %s",
-			egg.FullName, local.Name)
-
-		eggShell := &EggShell{}
-		eggShell.FullName = egg.FullName
-		eggShell.Deps = egg.Deps
-		eggShell.Caps = egg.Capabilities
-		eggShell.ReqCaps = egg.ReqCapabilities
-		eggShell.Version = egg.Version
-		eggShell.Hash, err = egg.GetHash()
-		if err != nil {
-			return err
-		}
-
-		cl.EggShells[eggShell.FullName] = eggShell
-	}
-
-	return nil
-}
-
-func (cl *Clutch) Serialize() (string, error) {
-	clStr := "name: " + cl.Name + "\n"
-	clStr = clStr + "url: " + cl.RemoteUrl + "\n"
-	clStr = clStr + "eggs:\n"
-
-	buf := bytes.Buffer{}
-
-	indent := "    "
-	for _, eggShell := range cl.EggShells {
-		buf.WriteString(eggShell.Serialize(indent))
-	}
-
-	return clStr + buf.String(), nil
-}
-
-func (cl *Clutch) strSliceToDr(list []string) ([]*DependencyRequirement, error) {
-	drList := []*DependencyRequirement{}
-
-	for _, name := range list {
-		req, err := NewDependencyRequirementParseString(name)
-		if err != nil {
-			return nil, err
-		}
-		drList = append(drList, req)
-	}
-
-	if len(drList) == 0 {
-		return nil, nil
-	} else {
-		return drList, nil
-	}
-}
-
-func (cl *Clutch) fileToEggList(cfg *viper.Viper) (map[string]*EggShell,
-	error) {
-	eggMap := cfg.GetStringMap("eggs")
-
-	eggList := map[string]*EggShell{}
-
-	for name, _ := range eggMap {
-		eggShell, err := NewEggShell(cl)
-		if err != nil {
-			return nil, err
-		}
-		eggShell.FullName = name
-
-		eggDef := cfg.GetStringMap("eggs." + name)
-		eggShell.Version, err = NewVersParseString(eggDef["vers"].(string))
-		if err != nil {
-			return nil, err
-		}
-
-		eggShell.Deps, err = cl.strSliceToDr(
-			cfg.GetStringSlice("eggs." + name + ".deps"))
-		if err != nil {
-			return nil, err
-		}
-
-		eggShell.Caps, err = cl.strSliceToDr(
-			cfg.GetStringSlice("eggs." + name + ".caps"))
-		if err != nil {
-			return nil, err
-		}
-
-		eggShell.ReqCaps, err = cl.strSliceToDr(
-			cfg.GetStringSlice("eggs." + name + ".req_caps"))
-		if err != nil {
-			return nil, err
-		}
-
-		eggList[name] = eggShell
-	}
-
-	return eggList, nil
-}
-
-// Create the manifest file name, it's the manifest dir + manifest name +
-// branch and a.yml extension
-func (clutch *Clutch) GetClutchFile(name string, branch string) string {
-	return name + "@" + branch
-}
-
-func (clutch *Clutch) GetClutchFullFile(name string, branch string) string {
-	return clutch.Nest.ClutchPath + clutch.GetClutchFile(name, branch) + ".yml"
-}
-
-func (clutch *Clutch) Load(name string) error {
-	cfg, err := ReadConfig(clutch.Nest.ClutchPath, name)
-	if err != nil {
-		return err
-	}
-
-	clutchName := name
-	branchName := "master"
-
-	parts := strings.Split(name, "@")
-	if len(parts) == 2 {
-		clutchName = parts[0]
-		branchName = parts[1]
-	}
-
-	if cfg.GetString("name") != clutchName {
-		return NewNewtError(
-			fmt.Sprintf("Wrong name %s in remote larva file (expected %s)",
-				cfg.GetString("name"), clutchName))
-	}
-
-	clutch.Name = cfg.GetString("name")
-	clutch.Branch = branchName
-	clutch.RemoteUrl = cfg.GetString("url")
-
-	clutch.EggShells, err = clutch.fileToEggList(cfg)
-	if err != nil {
-		return err
-	}
-
-	clutch.Nest.Clutches[name] = clutch
-
-	return nil
-}
-
-func (cl *Clutch) Install(name string, url string, branch string) error {
-	clutchFile := cl.GetClutchFullFile(name, branch)
-
-	// XXX: Should warn if file already exists, and require force option
-	os.Remove(clutchFile)
-
-	// Download the manifest
-	dl, err := NewDownloader()
-	if err != nil {
-		return err
-	}
-
-	StatusMessage(VERBOSITY_DEFAULT, "Downloading clutch.yml from %s/"+
-		"%s...", url, branch)
-
-	if err := dl.DownloadFile(url, branch, "clutch.yml",
-		clutchFile); err != nil {
-		return err
-	}
-
-	StatusMessage(VERBOSITY_DEFAULT, OK_STRING)
-
-	// Load the manifest, and ensure that it is in the correct format
-	StatusMessage(VERBOSITY_DEFAULT, "Verifying clutch.yml format...\n")
-	if err := cl.Load(cl.GetClutchFile(name, branch)); err != nil {
-		os.Remove(clutchFile)
-		return err
-	}
-	StatusMessage(VERBOSITY_DEFAULT, OK_STRING)
-
-	return nil
-}
-
-func (clutch *Clutch) InstallEgg(eggName string, branch string,
-	downloaded []*RemoteNest) ([]*RemoteNest, error) {
-	log.Print("[VERBOSE] Looking for ", eggName)
-	egg, err := clutch.ResolveEggName(eggName)
-	if err == nil {
-		log.Printf("[VERBOSE] ", eggName, " installed already")
-		return downloaded, nil
-	}
-	nest := clutch.Nest
-	for _, remoteNest := range downloaded {
-		egg, err = remoteNest.ResolveEggName(eggName)
-		if err == nil {
-			log.Print("[VERBOSE] ", eggName, " present in downloaded clutch ",
-				remoteNest.Name)
-
-			err = remoteNest.fetchEgg(eggName, nest.BasePath)
-			if err != nil {
-				return downloaded, err
-			}
-
-			// update local clutch
-			err = clutch.loadEggDir(nest.BasePath, "", eggName)
-			if err != nil {
-				return downloaded, err
-			}
-
-			deps, err := egg.GetDependencies()
-			if err != nil {
-				return downloaded, err
-			}
-			for _, dep := range deps {
-				log.Print("[VERBOSE] ", eggName, " checking dependency ",
-					dep.Name)
-				depBranch := dep.BranchName()
-				downloaded, err = clutch.InstallEgg(dep.Name, depBranch,
-					downloaded)
-				if err != nil {
-					return downloaded, err
-				}
-			}
-			return downloaded, nil
-		}
-	}
-
-	// Not in downloaded clutches
-	clutches, err := nest.GetClutches()
-	if err != nil {
-		return downloaded, err
-	}
-	for _, remoteClutch := range clutches {
-		eggShell, err := remoteClutch.ResolveEggShellName(eggName)
-		if err == nil {
-			log.Print("[VERBOSE] ", eggName, " present in remote clutch ",
-				remoteClutch.Name, remoteClutch.Branch)
-			if branch == "" {
-				branch = remoteClutch.Branch
-			}
-			remoteNest, err := NewRemoteNest(remoteClutch, branch)
-			if err != nil {
-				return downloaded, err
-			}
-			downloaded = append(downloaded, remoteNest)
-			return clutch.InstallEgg(eggShell.FullName, branch, downloaded)
-		}
-	}
-
-	return downloaded, NewNewtError(fmt.Sprintf("No package %s found\n", eggName))
-}


[35/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.h
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.h b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.h
deleted file mode 100644
index e86d83f..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.h
+++ /dev/null
@@ -1,7478 +0,0 @@
-/*
-** 2001 September 15
-**
-** The author disclaims copyright to this source code.  In place of
-** a legal notice, here is a blessing:
-**
-**    May you do good and not evil.
-**    May you find forgiveness for yourself and forgive others.
-**    May you share freely, never taking more than you give.
-**
-*************************************************************************
-** This header file defines the interface that the SQLite library
-** presents to client programs.  If a C-function, structure, datatype,
-** or constant definition does not appear in this file, then it is
-** not a published API of SQLite, is subject to change without
-** notice, and should not be referenced by programs that use SQLite.
-**
-** Some of the definitions that are in this file are marked as
-** "experimental".  Experimental interfaces are normally new
-** features recently added to SQLite.  We do not anticipate changes
-** to experimental interfaces but reserve the right to make minor changes
-** if experience from use "in the wild" suggest such changes are prudent.
-**
-** The official C-language API documentation for SQLite is derived
-** from comments in this file.  This file is the authoritative source
-** on how SQLite interfaces are suppose to operate.
-**
-** The name of this file under configuration management is "sqlite.h.in".
-** The makefile makes some minor changes to this file (such as inserting
-** the version number) and changes its name to "sqlite3.h" as
-** part of the build process.
-*/
-#ifndef _SQLITE3_H_
-#define _SQLITE3_H_
-#include <stdarg.h>     /* Needed for the definition of va_list */
-
-/*
-** Make sure we can call this stuff from C++.
-*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*
-** Add the ability to override 'extern'
-*/
-#ifndef SQLITE_EXTERN
-# define SQLITE_EXTERN extern
-#endif
-
-#ifndef SQLITE_API
-# define SQLITE_API
-#endif
-
-
-/*
-** These no-op macros are used in front of interfaces to mark those
-** interfaces as either deprecated or experimental.  New applications
-** should not use deprecated interfaces - they are support for backwards
-** compatibility only.  Application writers should be aware that
-** experimental interfaces are subject to change in point releases.
-**
-** These macros used to resolve to various kinds of compiler magic that
-** would generate warning messages when they were used.  But that
-** compiler magic ended up generating such a flurry of bug reports
-** that we have taken it all out and gone back to using simple
-** noop macros.
-*/
-#define SQLITE_DEPRECATED
-#define SQLITE_EXPERIMENTAL
-
-/*
-** Ensure these symbols were not defined by some previous header file.
-*/
-#ifdef SQLITE_VERSION
-# undef SQLITE_VERSION
-#endif
-#ifdef SQLITE_VERSION_NUMBER
-# undef SQLITE_VERSION_NUMBER
-#endif
-
-/*
-** CAPI3REF: Compile-Time Library Version Numbers
-**
-** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header
-** evaluates to a string literal that is the SQLite version in the
-** format "X.Y.Z" where X is the major version number (always 3 for
-** SQLite3) and Y is the minor version number and Z is the release number.)^
-** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer
-** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same
-** numbers used in [SQLITE_VERSION].)^
-** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
-** be larger than the release from which it is derived.  Either Y will
-** be held constant and Z will be incremented or else Y will be incremented
-** and Z will be reset to zero.
-**
-** Since version 3.6.18, SQLite source code has been stored in the
-** <a href="http://www.fossil-scm.org/">Fossil configuration management
-** system</a>.  ^The SQLITE_SOURCE_ID macro evaluates to
-** a string which identifies a particular check-in of SQLite
-** within its configuration management system.  ^The SQLITE_SOURCE_ID
-** string contains the date and time of the check-in (UTC) and an SHA1
-** hash of the entire source tree.
-**
-** See also: [sqlite3_libversion()],
-** [sqlite3_libversion_number()], [sqlite3_sourceid()],
-** [sqlite_version()] and [sqlite_source_id()].
-*/
-#define SQLITE_VERSION        "3.8.5"
-#define SQLITE_VERSION_NUMBER 3008005
-#define SQLITE_SOURCE_ID      "2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212"
-
-/*
-** CAPI3REF: Run-Time Library Version Numbers
-** KEYWORDS: sqlite3_version, sqlite3_sourceid
-**
-** These interfaces provide the same information as the [SQLITE_VERSION],
-** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
-** but are associated with the library instead of the header file.  ^(Cautious
-** programmers might include assert() statements in their application to
-** verify that values returned by these interfaces match the macros in
-** the header, and thus insure that the application is
-** compiled with matching library and header files.
-**
-** <blockquote><pre>
-** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
-** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
-** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
-** </pre></blockquote>)^
-**
-** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
-** macro.  ^The sqlite3_libversion() function returns a pointer to the
-** to the sqlite3_version[] string constant.  The sqlite3_libversion()
-** function is provided for use in DLLs since DLL users usually do not have
-** direct access to string constants within the DLL.  ^The
-** sqlite3_libversion_number() function returns an integer equal to
-** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns 
-** a pointer to a string constant whose value is the same as the 
-** [SQLITE_SOURCE_ID] C preprocessor macro.
-**
-** See also: [sqlite_version()] and [sqlite_source_id()].
-*/
-SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
-SQLITE_API const char *sqlite3_libversion(void);
-SQLITE_API const char *sqlite3_sourceid(void);
-SQLITE_API int sqlite3_libversion_number(void);
-
-/*
-** CAPI3REF: Run-Time Library Compilation Options Diagnostics
-**
-** ^The sqlite3_compileoption_used() function returns 0 or 1 
-** indicating whether the specified option was defined at 
-** compile time.  ^The SQLITE_ prefix may be omitted from the 
-** option name passed to sqlite3_compileoption_used().  
-**
-** ^The sqlite3_compileoption_get() function allows iterating
-** over the list of options that were defined at compile time by
-** returning the N-th compile time option string.  ^If N is out of range,
-** sqlite3_compileoption_get() returns a NULL pointer.  ^The SQLITE_ 
-** prefix is omitted from any strings returned by 
-** sqlite3_compileoption_get().
-**
-** ^Support for the diagnostic functions sqlite3_compileoption_used()
-** and sqlite3_compileoption_get() may be omitted by specifying the 
-** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
-**
-** See also: SQL functions [sqlite_compileoption_used()] and
-** [sqlite_compileoption_get()] and the [compile_options pragma].
-*/
-#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
-SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
-SQLITE_API const char *sqlite3_compileoption_get(int N);
-#endif
-
-/*
-** CAPI3REF: Test To See If The Library Is Threadsafe
-**
-** ^The sqlite3_threadsafe() function returns zero if and only if
-** SQLite was compiled with mutexing code omitted due to the
-** [SQLITE_THREADSAFE] compile-time option being set to 0.
-**
-** SQLite can be compiled with or without mutexes.  When
-** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes
-** are enabled and SQLite is threadsafe.  When the
-** [SQLITE_THREADSAFE] macro is 0, 
-** the mutexes are omitted.  Without the mutexes, it is not safe
-** to use SQLite concurrently from more than one thread.
-**
-** Enabling mutexes incurs a measurable performance penalty.
-** So if speed is of utmost importance, it makes sense to disable
-** the mutexes.  But for maximum safety, mutexes should be enabled.
-** ^The default behavior is for mutexes to be enabled.
-**
-** This interface can be used by an application to make sure that the
-** version of SQLite that it is linking against was compiled with
-** the desired setting of the [SQLITE_THREADSAFE] macro.
-**
-** This interface only reports on the compile-time mutex setting
-** of the [SQLITE_THREADSAFE] flag.  If SQLite is compiled with
-** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but
-** can be fully or partially disabled using a call to [sqlite3_config()]
-** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],
-** or [SQLITE_CONFIG_MUTEX].  ^(The return value of the
-** sqlite3_threadsafe() function shows only the compile-time setting of
-** thread safety, not any run-time changes to that setting made by
-** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
-** is unchanged by calls to sqlite3_config().)^
-**
-** See the [threading mode] documentation for additional information.
-*/
-SQLITE_API int sqlite3_threadsafe(void);
-
-/*
-** CAPI3REF: Database Connection Handle
-** KEYWORDS: {database connection} {database connections}
-**
-** Each open SQLite database is represented by a pointer to an instance of
-** the opaque structure named "sqlite3".  It is useful to think of an sqlite3
-** pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and
-** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
-** and [sqlite3_close_v2()] are its destructors.  There are many other
-** interfaces (such as
-** [sqlite3_prepare_v2()], [sqlite3_create_function()], and
-** [sqlite3_busy_timeout()] to name but three) that are methods on an
-** sqlite3 object.
-*/
-typedef struct sqlite3 sqlite3;
-
-/*
-** CAPI3REF: 64-Bit Integer Types
-** KEYWORDS: sqlite_int64 sqlite_uint64
-**
-** Because there is no cross-platform way to specify 64-bit integer types
-** SQLite includes typedefs for 64-bit signed and unsigned integers.
-**
-** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
-** The sqlite_int64 and sqlite_uint64 types are supported for backwards
-** compatibility only.
-**
-** ^The sqlite3_int64 and sqlite_int64 types can store integer values
-** between -9223372036854775808 and +9223372036854775807 inclusive.  ^The
-** sqlite3_uint64 and sqlite_uint64 types can store integer values 
-** between 0 and +18446744073709551615 inclusive.
-*/
-#ifdef SQLITE_INT64_TYPE
-  typedef SQLITE_INT64_TYPE sqlite_int64;
-  typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
-#elif defined(_MSC_VER) || defined(__BORLANDC__)
-  typedef __int64 sqlite_int64;
-  typedef unsigned __int64 sqlite_uint64;
-#else
-  typedef long long int sqlite_int64;
-  typedef unsigned long long int sqlite_uint64;
-#endif
-typedef sqlite_int64 sqlite3_int64;
-typedef sqlite_uint64 sqlite3_uint64;
-
-/*
-** If compiling for a processor that lacks floating point support,
-** substitute integer for floating-point.
-*/
-#ifdef SQLITE_OMIT_FLOATING_POINT
-# define double sqlite3_int64
-#endif
-
-/*
-** CAPI3REF: Closing A Database Connection
-**
-** ^The sqlite3_close() and sqlite3_close_v2() routines are destructors
-** for the [sqlite3] object.
-** ^Calls to sqlite3_close() and sqlite3_close_v2() return SQLITE_OK if
-** the [sqlite3] object is successfully destroyed and all associated
-** resources are deallocated.
-**
-** ^If the database connection is associated with unfinalized prepared
-** statements or unfinished sqlite3_backup objects then sqlite3_close()
-** will leave the database connection open and return [SQLITE_BUSY].
-** ^If sqlite3_close_v2() is called with unfinalized prepared statements
-** and unfinished sqlite3_backups, then the database connection becomes
-** an unusable "zombie" which will automatically be deallocated when the
-** last prepared statement is finalized or the last sqlite3_backup is
-** finished.  The sqlite3_close_v2() interface is intended for use with
-** host languages that are garbage collected, and where the order in which
-** destructors are called is arbitrary.
-**
-** Applications should [sqlite3_finalize | finalize] all [prepared statements],
-** [sqlite3_blob_close | close] all [BLOB handles], and 
-** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
-** with the [sqlite3] object prior to attempting to close the object.  ^If
-** sqlite3_close_v2() is called on a [database connection] that still has
-** outstanding [prepared statements], [BLOB handles], and/or
-** [sqlite3_backup] objects then it returns SQLITE_OK but the deallocation
-** of resources is deferred until all [prepared statements], [BLOB handles],
-** and [sqlite3_backup] objects are also destroyed.
-**
-** ^If an [sqlite3] object is destroyed while a transaction is open,
-** the transaction is automatically rolled back.
-**
-** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
-** must be either a NULL
-** pointer or an [sqlite3] object pointer obtained
-** from [sqlite3_open()], [sqlite3_open16()], or
-** [sqlite3_open_v2()], and not previously closed.
-** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
-** argument is a harmless no-op.
-*/
-SQLITE_API int sqlite3_close(sqlite3*);
-SQLITE_API int sqlite3_close_v2(sqlite3*);
-
-/*
-** The type for a callback function.
-** This is legacy and deprecated.  It is included for historical
-** compatibility and is not documented.
-*/
-typedef int (*sqlite3_callback)(void*,int,char**, char**);
-
-/*
-** CAPI3REF: One-Step Query Execution Interface
-**
-** The sqlite3_exec() interface is a convenience wrapper around
-** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
-** that allows an application to run multiple statements of SQL
-** without having to use a lot of C code. 
-**
-** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
-** semicolon-separate SQL statements passed into its 2nd argument,
-** in the context of the [database connection] passed in as its 1st
-** argument.  ^If the callback function of the 3rd argument to
-** sqlite3_exec() is not NULL, then it is invoked for each result row
-** coming out of the evaluated SQL statements.  ^The 4th argument to
-** sqlite3_exec() is relayed through to the 1st argument of each
-** callback invocation.  ^If the callback pointer to sqlite3_exec()
-** is NULL, then no callback is ever invoked and result rows are
-** ignored.
-**
-** ^If an error occurs while evaluating the SQL statements passed into
-** sqlite3_exec(), then execution of the current statement stops and
-** subsequent statements are skipped.  ^If the 5th parameter to sqlite3_exec()
-** is not NULL then any error message is written into memory obtained
-** from [sqlite3_malloc()] and passed back through the 5th parameter.
-** To avoid memory leaks, the application should invoke [sqlite3_free()]
-** on error message strings returned through the 5th parameter of
-** of sqlite3_exec() after the error message string is no longer needed.
-** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
-** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
-** NULL before returning.
-**
-** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
-** routine returns SQLITE_ABORT without invoking the callback again and
-** without running any subsequent SQL statements.
-**
-** ^The 2nd argument to the sqlite3_exec() callback function is the
-** number of columns in the result.  ^The 3rd argument to the sqlite3_exec()
-** callback is an array of pointers to strings obtained as if from
-** [sqlite3_column_text()], one for each column.  ^If an element of a
-** result row is NULL then the corresponding string pointer for the
-** sqlite3_exec() callback is a NULL pointer.  ^The 4th argument to the
-** sqlite3_exec() callback is an array of pointers to strings where each
-** entry represents the name of corresponding result column as obtained
-** from [sqlite3_column_name()].
-**
-** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
-** to an empty string, or a pointer that contains only whitespace and/or 
-** SQL comments, then no SQL statements are evaluated and the database
-** is not changed.
-**
-** Restrictions:
-**
-** <ul>
-** <li> The application must insure that the 1st parameter to sqlite3_exec()
-**      is a valid and open [database connection].
-** <li> The application must not close the [database connection] specified by
-**      the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
-** <li> The application must not modify the SQL statement text passed into
-**      the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
-** </ul>
-*/
-SQLITE_API int sqlite3_exec(
-  sqlite3*,                                  /* An open database */
-  const char *sql,                           /* SQL to be evaluated */
-  int (*callback)(void*,int,char**,char**),  /* Callback function */
-  void *,                                    /* 1st argument to callback */
-  char **errmsg                              /* Error msg written here */
-);
-
-/*
-** CAPI3REF: Result Codes
-** KEYWORDS: SQLITE_OK {error code} {error codes}
-** KEYWORDS: {result code} {result codes}
-**
-** Many SQLite functions return an integer result code from the set shown
-** here in order to indicate success or failure.
-**
-** New error codes may be added in future versions of SQLite.
-**
-** See also: [SQLITE_IOERR_READ | extended result codes],
-** [sqlite3_vtab_on_conflict()] [SQLITE_ROLLBACK | result codes].
-*/
-#define SQLITE_OK           0   /* Successful result */
-/* beginning-of-error-codes */
-#define SQLITE_ERROR        1   /* SQL error or missing database */
-#define SQLITE_INTERNAL     2   /* Internal logic error in SQLite */
-#define SQLITE_PERM         3   /* Access permission denied */
-#define SQLITE_ABORT        4   /* Callback routine requested an abort */
-#define SQLITE_BUSY         5   /* The database file is locked */
-#define SQLITE_LOCKED       6   /* A table in the database is locked */
-#define SQLITE_NOMEM        7   /* A malloc() failed */
-#define SQLITE_READONLY     8   /* Attempt to write a readonly database */
-#define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite3_interrupt()*/
-#define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
-#define SQLITE_CORRUPT     11   /* The database disk image is malformed */
-#define SQLITE_NOTFOUND    12   /* Unknown opcode in sqlite3_file_control() */
-#define SQLITE_FULL        13   /* Insertion failed because database is full */
-#define SQLITE_CANTOPEN    14   /* Unable to open the database file */
-#define SQLITE_PROTOCOL    15   /* Database lock protocol error */
-#define SQLITE_EMPTY       16   /* Database is empty */
-#define SQLITE_SCHEMA      17   /* The database schema changed */
-#define SQLITE_TOOBIG      18   /* String or BLOB exceeds size limit */
-#define SQLITE_CONSTRAINT  19   /* Abort due to constraint violation */
-#define SQLITE_MISMATCH    20   /* Data type mismatch */
-#define SQLITE_MISUSE      21   /* Library used incorrectly */
-#define SQLITE_NOLFS       22   /* Uses OS features not supported on host */
-#define SQLITE_AUTH        23   /* Authorization denied */
-#define SQLITE_FORMAT      24   /* Auxiliary database format error */
-#define SQLITE_RANGE       25   /* 2nd parameter to sqlite3_bind out of range */
-#define SQLITE_NOTADB      26   /* File opened that is not a database file */
-#define SQLITE_NOTICE      27   /* Notifications from sqlite3_log() */
-#define SQLITE_WARNING     28   /* Warnings from sqlite3_log() */
-#define SQLITE_ROW         100  /* sqlite3_step() has another row ready */
-#define SQLITE_DONE        101  /* sqlite3_step() has finished executing */
-/* end-of-error-codes */
-
-/*
-** CAPI3REF: Extended Result Codes
-** KEYWORDS: {extended error code} {extended error codes}
-** KEYWORDS: {extended result code} {extended result codes}
-**
-** In its default configuration, SQLite API routines return one of 26 integer
-** [SQLITE_OK | result codes].  However, experience has shown that many of
-** these result codes are too coarse-grained.  They do not provide as
-** much information about problems as programmers might like.  In an effort to
-** address this, newer versions of SQLite (version 3.3.8 and later) include
-** support for additional result codes that provide more detailed information
-** about errors. The extended result codes are enabled or disabled
-** on a per database connection basis using the
-** [sqlite3_extended_result_codes()] API.
-**
-** Some of the available extended result codes are listed here.
-** One may expect the number of extended result codes will increase
-** over time.  Software that uses extended result codes should expect
-** to see new result codes in future releases of SQLite.
-**
-** The SQLITE_OK result code will never be extended.  It will always
-** be exactly zero.
-*/
-#define SQLITE_IOERR_READ              (SQLITE_IOERR | (1<<8))
-#define SQLITE_IOERR_SHORT_READ        (SQLITE_IOERR | (2<<8))
-#define SQLITE_IOERR_WRITE             (SQLITE_IOERR | (3<<8))
-#define SQLITE_IOERR_FSYNC             (SQLITE_IOERR | (4<<8))
-#define SQLITE_IOERR_DIR_FSYNC         (SQLITE_IOERR | (5<<8))
-#define SQLITE_IOERR_TRUNCATE          (SQLITE_IOERR | (6<<8))
-#define SQLITE_IOERR_FSTAT             (SQLITE_IOERR | (7<<8))
-#define SQLITE_IOERR_UNLOCK            (SQLITE_IOERR | (8<<8))
-#define SQLITE_IOERR_RDLOCK            (SQLITE_IOERR | (9<<8))
-#define SQLITE_IOERR_DELETE            (SQLITE_IOERR | (10<<8))
-#define SQLITE_IOERR_BLOCKED           (SQLITE_IOERR | (11<<8))
-#define SQLITE_IOERR_NOMEM             (SQLITE_IOERR | (12<<8))
-#define SQLITE_IOERR_ACCESS            (SQLITE_IOERR | (13<<8))
-#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8))
-#define SQLITE_IOERR_LOCK              (SQLITE_IOERR | (15<<8))
-#define SQLITE_IOERR_CLOSE             (SQLITE_IOERR | (16<<8))
-#define SQLITE_IOERR_DIR_CLOSE         (SQLITE_IOERR | (17<<8))
-#define SQLITE_IOERR_SHMOPEN           (SQLITE_IOERR | (18<<8))
-#define SQLITE_IOERR_SHMSIZE           (SQLITE_IOERR | (19<<8))
-#define SQLITE_IOERR_SHMLOCK           (SQLITE_IOERR | (20<<8))
-#define SQLITE_IOERR_SHMMAP            (SQLITE_IOERR | (21<<8))
-#define SQLITE_IOERR_SEEK              (SQLITE_IOERR | (22<<8))
-#define SQLITE_IOERR_DELETE_NOENT      (SQLITE_IOERR | (23<<8))
-#define SQLITE_IOERR_MMAP              (SQLITE_IOERR | (24<<8))
-#define SQLITE_IOERR_GETTEMPPATH       (SQLITE_IOERR | (25<<8))
-#define SQLITE_IOERR_CONVPATH          (SQLITE_IOERR | (26<<8))
-#define SQLITE_LOCKED_SHAREDCACHE      (SQLITE_LOCKED |  (1<<8))
-#define SQLITE_BUSY_RECOVERY           (SQLITE_BUSY   |  (1<<8))
-#define SQLITE_BUSY_SNAPSHOT           (SQLITE_BUSY   |  (2<<8))
-#define SQLITE_CANTOPEN_NOTEMPDIR      (SQLITE_CANTOPEN | (1<<8))
-#define SQLITE_CANTOPEN_ISDIR          (SQLITE_CANTOPEN | (2<<8))
-#define SQLITE_CANTOPEN_FULLPATH       (SQLITE_CANTOPEN | (3<<8))
-#define SQLITE_CANTOPEN_CONVPATH       (SQLITE_CANTOPEN | (4<<8))
-#define SQLITE_CORRUPT_VTAB            (SQLITE_CORRUPT | (1<<8))
-#define SQLITE_READONLY_RECOVERY       (SQLITE_READONLY | (1<<8))
-#define SQLITE_READONLY_CANTLOCK       (SQLITE_READONLY | (2<<8))
-#define SQLITE_READONLY_ROLLBACK       (SQLITE_READONLY | (3<<8))
-#define SQLITE_READONLY_DBMOVED        (SQLITE_READONLY | (4<<8))
-#define SQLITE_ABORT_ROLLBACK          (SQLITE_ABORT | (2<<8))
-#define SQLITE_CONSTRAINT_CHECK        (SQLITE_CONSTRAINT | (1<<8))
-#define SQLITE_CONSTRAINT_COMMITHOOK   (SQLITE_CONSTRAINT | (2<<8))
-#define SQLITE_CONSTRAINT_FOREIGNKEY   (SQLITE_CONSTRAINT | (3<<8))
-#define SQLITE_CONSTRAINT_FUNCTION     (SQLITE_CONSTRAINT | (4<<8))
-#define SQLITE_CONSTRAINT_NOTNULL      (SQLITE_CONSTRAINT | (5<<8))
-#define SQLITE_CONSTRAINT_PRIMARYKEY   (SQLITE_CONSTRAINT | (6<<8))
-#define SQLITE_CONSTRAINT_TRIGGER      (SQLITE_CONSTRAINT | (7<<8))
-#define SQLITE_CONSTRAINT_UNIQUE       (SQLITE_CONSTRAINT | (8<<8))
-#define SQLITE_CONSTRAINT_VTAB         (SQLITE_CONSTRAINT | (9<<8))
-#define SQLITE_CONSTRAINT_ROWID        (SQLITE_CONSTRAINT |(10<<8))
-#define SQLITE_NOTICE_RECOVER_WAL      (SQLITE_NOTICE | (1<<8))
-#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
-#define SQLITE_WARNING_AUTOINDEX       (SQLITE_WARNING | (1<<8))
-
-/*
-** CAPI3REF: Flags For File Open Operations
-**
-** These bit values are intended for use in the
-** 3rd parameter to the [sqlite3_open_v2()] interface and
-** in the 4th parameter to the [sqlite3_vfs.xOpen] method.
-*/
-#define SQLITE_OPEN_READONLY         0x00000001  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_READWRITE        0x00000002  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_CREATE           0x00000004  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_DELETEONCLOSE    0x00000008  /* VFS only */
-#define SQLITE_OPEN_EXCLUSIVE        0x00000010  /* VFS only */
-#define SQLITE_OPEN_AUTOPROXY        0x00000020  /* VFS only */
-#define SQLITE_OPEN_URI              0x00000040  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_MEMORY           0x00000080  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_MAIN_DB          0x00000100  /* VFS only */
-#define SQLITE_OPEN_TEMP_DB          0x00000200  /* VFS only */
-#define SQLITE_OPEN_TRANSIENT_DB     0x00000400  /* VFS only */
-#define SQLITE_OPEN_MAIN_JOURNAL     0x00000800  /* VFS only */
-#define SQLITE_OPEN_TEMP_JOURNAL     0x00001000  /* VFS only */
-#define SQLITE_OPEN_SUBJOURNAL       0x00002000  /* VFS only */
-#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000  /* VFS only */
-#define SQLITE_OPEN_NOMUTEX          0x00008000  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_FULLMUTEX        0x00010000  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_SHAREDCACHE      0x00020000  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_PRIVATECACHE     0x00040000  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_WAL              0x00080000  /* VFS only */
-
-/* Reserved:                         0x00F00000 */
-
-/*
-** CAPI3REF: Device Characteristics
-**
-** The xDeviceCharacteristics method of the [sqlite3_io_methods]
-** object returns an integer which is a vector of these
-** bit values expressing I/O characteristics of the mass storage
-** device that holds the file that the [sqlite3_io_methods]
-** refers to.
-**
-** The SQLITE_IOCAP_ATOMIC property means that all writes of
-** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
-** mean that writes of blocks that are nnn bytes in size and
-** are aligned to an address which is an integer multiple of
-** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
-** that when data is appended to a file, the data is appended
-** first then the size of the file is extended, never the other
-** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
-** information is written to disk in the same order as calls
-** to xWrite().  The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
-** after reboot following a crash or power loss, the only bytes in a
-** file that were written at the application level might have changed
-** and that adjacent bytes, even bytes within the same sector are
-** guaranteed to be unchanged.  The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
-** flag indicate that a file cannot be deleted when open.  The
-** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
-** read-only media and cannot be changed even by processes with
-** elevated privileges.
-*/
-#define SQLITE_IOCAP_ATOMIC                 0x00000001
-#define SQLITE_IOCAP_ATOMIC512              0x00000002
-#define SQLITE_IOCAP_ATOMIC1K               0x00000004
-#define SQLITE_IOCAP_ATOMIC2K               0x00000008
-#define SQLITE_IOCAP_ATOMIC4K               0x00000010
-#define SQLITE_IOCAP_ATOMIC8K               0x00000020
-#define SQLITE_IOCAP_ATOMIC16K              0x00000040
-#define SQLITE_IOCAP_ATOMIC32K              0x00000080
-#define SQLITE_IOCAP_ATOMIC64K              0x00000100
-#define SQLITE_IOCAP_SAFE_APPEND            0x00000200
-#define SQLITE_IOCAP_SEQUENTIAL             0x00000400
-#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN  0x00000800
-#define SQLITE_IOCAP_POWERSAFE_OVERWRITE    0x00001000
-#define SQLITE_IOCAP_IMMUTABLE              0x00002000
-
-/*
-** CAPI3REF: File Locking Levels
-**
-** SQLite uses one of these integer values as the second
-** argument to calls it makes to the xLock() and xUnlock() methods
-** of an [sqlite3_io_methods] object.
-*/
-#define SQLITE_LOCK_NONE          0
-#define SQLITE_LOCK_SHARED        1
-#define SQLITE_LOCK_RESERVED      2
-#define SQLITE_LOCK_PENDING       3
-#define SQLITE_LOCK_EXCLUSIVE     4
-
-/*
-** CAPI3REF: Synchronization Type Flags
-**
-** When SQLite invokes the xSync() method of an
-** [sqlite3_io_methods] object it uses a combination of
-** these integer values as the second argument.
-**
-** When the SQLITE_SYNC_DATAONLY flag is used, it means that the
-** sync operation only needs to flush data to mass storage.  Inode
-** information need not be flushed. If the lower four bits of the flag
-** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
-** If the lower four bits equal SQLITE_SYNC_FULL, that means
-** to use Mac OS X style fullsync instead of fsync().
-**
-** Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
-** with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
-** settings.  The [synchronous pragma] determines when calls to the
-** xSync VFS method occur and applies uniformly across all platforms.
-** The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
-** energetic or rigorous or forceful the sync operations are and
-** only make a difference on Mac OSX for the default SQLite code.
-** (Third-party VFS implementations might also make the distinction
-** between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
-** operating systems natively supported by SQLite, only Mac OSX
-** cares about the difference.)
-*/
-#define SQLITE_SYNC_NORMAL        0x00002
-#define SQLITE_SYNC_FULL          0x00003
-#define SQLITE_SYNC_DATAONLY      0x00010
-
-/*
-** CAPI3REF: OS Interface Open File Handle
-**
-** An [sqlite3_file] object represents an open file in the 
-** [sqlite3_vfs | OS interface layer].  Individual OS interface
-** implementations will
-** want to subclass this object by appending additional fields
-** for their own use.  The pMethods entry is a pointer to an
-** [sqlite3_io_methods] object that defines methods for performing
-** I/O operations on the open file.
-*/
-typedef struct sqlite3_file sqlite3_file;
-struct sqlite3_file {
-  const struct sqlite3_io_methods *pMethods;  /* Methods for an open file */
-};
-
-/*
-** CAPI3REF: OS Interface File Virtual Methods Object
-**
-** Every file opened by the [sqlite3_vfs.xOpen] method populates an
-** [sqlite3_file] object (or, more commonly, a subclass of the
-** [sqlite3_file] object) with a pointer to an instance of this object.
-** This object defines the methods used to perform various operations
-** against the open file represented by the [sqlite3_file] object.
-**
-** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element 
-** to a non-NULL pointer, then the sqlite3_io_methods.xClose method
-** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed.  The
-** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen]
-** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
-** to NULL.
-**
-** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or
-** [SQLITE_SYNC_FULL].  The first choice is the normal fsync().
-** The second choice is a Mac OS X style fullsync.  The [SQLITE_SYNC_DATAONLY]
-** flag may be ORed in to indicate that only the data of the file
-** and not its inode needs to be synced.
-**
-** The integer values to xLock() and xUnlock() are one of
-** <ul>
-** <li> [SQLITE_LOCK_NONE],
-** <li> [SQLITE_LOCK_SHARED],
-** <li> [SQLITE_LOCK_RESERVED],
-** <li> [SQLITE_LOCK_PENDING], or
-** <li> [SQLITE_LOCK_EXCLUSIVE].
-** </ul>
-** xLock() increases the lock. xUnlock() decreases the lock.
-** The xCheckReservedLock() method checks whether any database connection,
-** either in this process or in some other process, is holding a RESERVED,
-** PENDING, or EXCLUSIVE lock on the file.  It returns true
-** if such a lock exists and false otherwise.
-**
-** The xFileControl() method is a generic interface that allows custom
-** VFS implementations to directly control an open file using the
-** [sqlite3_file_control()] interface.  The second "op" argument is an
-** integer opcode.  The third argument is a generic pointer intended to
-** point to a structure that may contain arguments or space in which to
-** write return values.  Potential uses for xFileControl() might be
-** functions to enable blocking locks with timeouts, to change the
-** locking strategy (for example to use dot-file locks), to inquire
-** about the status of a lock, or to break stale locks.  The SQLite
-** core reserves all opcodes less than 100 for its own use.
-** A [SQLITE_FCNTL_LOCKSTATE | list of opcodes] less than 100 is available.
-** Applications that define a custom xFileControl method should use opcodes
-** greater than 100 to avoid conflicts.  VFS implementations should
-** return [SQLITE_NOTFOUND] for file control opcodes that they do not
-** recognize.
-**
-** The xSectorSize() method returns the sector size of the
-** device that underlies the file.  The sector size is the
-** minimum write that can be performed without disturbing
-** other bytes in the file.  The xDeviceCharacteristics()
-** method returns a bit vector describing behaviors of the
-** underlying device:
-**
-** <ul>
-** <li> [SQLITE_IOCAP_ATOMIC]
-** <li> [SQLITE_IOCAP_ATOMIC512]
-** <li> [SQLITE_IOCAP_ATOMIC1K]
-** <li> [SQLITE_IOCAP_ATOMIC2K]
-** <li> [SQLITE_IOCAP_ATOMIC4K]
-** <li> [SQLITE_IOCAP_ATOMIC8K]
-** <li> [SQLITE_IOCAP_ATOMIC16K]
-** <li> [SQLITE_IOCAP_ATOMIC32K]
-** <li> [SQLITE_IOCAP_ATOMIC64K]
-** <li> [SQLITE_IOCAP_SAFE_APPEND]
-** <li> [SQLITE_IOCAP_SEQUENTIAL]
-** </ul>
-**
-** The SQLITE_IOCAP_ATOMIC property means that all writes of
-** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
-** mean that writes of blocks that are nnn bytes in size and
-** are aligned to an address which is an integer multiple of
-** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
-** that when data is appended to a file, the data is appended
-** first then the size of the file is extended, never the other
-** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
-** information is written to disk in the same order as calls
-** to xWrite().
-**
-** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
-** in the unread portions of the buffer with zeros.  A VFS that
-** fails to zero-fill short reads might seem to work.  However,
-** failure to zero-fill short reads will eventually lead to
-** database corruption.
-*/
-typedef struct sqlite3_io_methods sqlite3_io_methods;
-struct sqlite3_io_methods {
-  int iVersion;
-  int (*xClose)(sqlite3_file*);
-  int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
-  int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
-  int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
-  int (*xSync)(sqlite3_file*, int flags);
-  int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
-  int (*xLock)(sqlite3_file*, int);
-  int (*xUnlock)(sqlite3_file*, int);
-  int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
-  int (*xFileControl)(sqlite3_file*, int op, void *pArg);
-  int (*xSectorSize)(sqlite3_file*);
-  int (*xDeviceCharacteristics)(sqlite3_file*);
-  /* Methods above are valid for version 1 */
-  int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
-  int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
-  void (*xShmBarrier)(sqlite3_file*);
-  int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
-  /* Methods above are valid for version 2 */
-  int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
-  int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
-  /* Methods above are valid for version 3 */
-  /* Additional methods may be added in future releases */
-};
-
-/*
-** CAPI3REF: Standard File Control Opcodes
-**
-** These integer constants are opcodes for the xFileControl method
-** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()]
-** interface.
-**
-** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging.  This
-** opcode causes the xFileControl method to write the current state of
-** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],
-** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])
-** into an integer that the pArg argument points to. This capability
-** is used during testing and only needs to be supported when SQLITE_TEST
-** is defined.
-** <ul>
-** <li>[[SQLITE_FCNTL_SIZE_HINT]]
-** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
-** layer a hint of how large the database file will grow to be during the
-** current transaction.  This hint is not guaranteed to be accurate but it
-** is often close.  The underlying VFS might choose to preallocate database
-** file space based on this hint in order to help writes to the database
-** file run faster.
-**
-** <li>[[SQLITE_FCNTL_CHUNK_SIZE]]
-** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS
-** extends and truncates the database file in chunks of a size specified
-** by the user. The fourth argument to [sqlite3_file_control()] should 
-** point to an integer (type int) containing the new chunk-size to use
-** for the nominated database. Allocating database file space in large
-** chunks (say 1MB at a time), may reduce file-system fragmentation and
-** improve performance on some systems.
-**
-** <li>[[SQLITE_FCNTL_FILE_POINTER]]
-** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer
-** to the [sqlite3_file] object associated with a particular database
-** connection.  See the [sqlite3_file_control()] documentation for
-** additional information.
-**
-** <li>[[SQLITE_FCNTL_SYNC_OMITTED]]
-** No longer in use.
-**
-** <li>[[SQLITE_FCNTL_SYNC]]
-** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and
-** sent to the VFS immediately before the xSync method is invoked on a
-** database file descriptor. Or, if the xSync method is not invoked 
-** because the user has configured SQLite with 
-** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place 
-** of the xSync method. In most cases, the pointer argument passed with
-** this file-control is NULL. However, if the database file is being synced
-** as part of a multi-database commit, the argument points to a nul-terminated
-** string containing the transactions master-journal file name. VFSes that 
-** do not need this signal should silently ignore this opcode. Applications 
-** should not call [sqlite3_file_control()] with this opcode as doing so may 
-** disrupt the operation of the specialized VFSes that do require it.  
-**
-** <li>[[SQLITE_FCNTL_COMMIT_PHASETWO]]
-** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite
-** and sent to the VFS after a transaction has been committed immediately
-** but before the database is unlocked. VFSes that do not need this signal
-** should silently ignore this opcode. Applications should not call
-** [sqlite3_file_control()] with this opcode as doing so may disrupt the 
-** operation of the specialized VFSes that do require it.  
-**
-** <li>[[SQLITE_FCNTL_WIN32_AV_RETRY]]
-** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic
-** retry counts and intervals for certain disk I/O operations for the
-** windows [VFS] in order to provide robustness in the presence of
-** anti-virus programs.  By default, the windows VFS will retry file read,
-** file write, and file delete operations up to 10 times, with a delay
-** of 25 milliseconds before the first retry and with the delay increasing
-** by an additional 25 milliseconds with each subsequent retry.  This
-** opcode allows these two values (10 retries and 25 milliseconds of delay)
-** to be adjusted.  The values are changed for all database connections
-** within the same process.  The argument is a pointer to an array of two
-** integers where the first integer i the new retry count and the second
-** integer is the delay.  If either integer is negative, then the setting
-** is not changed but instead the prior value of that setting is written
-** into the array entry, allowing the current retry settings to be
-** interrogated.  The zDbName parameter is ignored.
-**
-** <li>[[SQLITE_FCNTL_PERSIST_WAL]]
-** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the
-** persistent [WAL | Write Ahead Log] setting.  By default, the auxiliary
-** write ahead log and shared memory files used for transaction control
-** are automatically deleted when the latest connection to the database
-** closes.  Setting persistent WAL mode causes those files to persist after
-** close.  Persisting the files is useful when other processes that do not
-** have write permission on the directory containing the database file want
-** to read the database file, as the WAL and shared memory files must exist
-** in order for the database to be readable.  The fourth parameter to
-** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
-** That integer is 0 to disable persistent WAL mode or 1 to enable persistent
-** WAL mode.  If the integer is -1, then it is overwritten with the current
-** WAL persistence setting.
-**
-** <li>[[SQLITE_FCNTL_POWERSAFE_OVERWRITE]]
-** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the
-** persistent "powersafe-overwrite" or "PSOW" setting.  The PSOW setting
-** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the
-** xDeviceCharacteristics methods. The fourth parameter to
-** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
-** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage
-** mode.  If the integer is -1, then it is overwritten with the current
-** zero-damage mode setting.
-**
-** <li>[[SQLITE_FCNTL_OVERWRITE]]
-** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening
-** a write transaction to indicate that, unless it is rolled back for some
-** reason, the entire database file will be overwritten by the current 
-** transaction. This is used by VACUUM operations.
-**
-** <li>[[SQLITE_FCNTL_VFSNAME]]
-** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
-** all [VFSes] in the VFS stack.  The names are of all VFS shims and the
-** final bottom-level VFS are written into memory obtained from 
-** [sqlite3_malloc()] and the result is stored in the char* variable
-** that the fourth parameter of [sqlite3_file_control()] points to.
-** The caller is responsible for freeing the memory when done.  As with
-** all file-control actions, there is no guarantee that this will actually
-** do anything.  Callers should initialize the char* variable to a NULL
-** pointer in case this file-control is not implemented.  This file-control
-** is intended for diagnostic use only.
-**
-** <li>[[SQLITE_FCNTL_PRAGMA]]
-** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] 
-** file control is sent to the open [sqlite3_file] object corresponding
-** to the database file to which the pragma statement refers. ^The argument
-** to the [SQLITE_FCNTL_PRAGMA] file control is an array of
-** pointers to strings (char**) in which the second element of the array
-** is the name of the pragma and the third element is the argument to the
-** pragma or NULL if the pragma has no argument.  ^The handler for an
-** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element
-** of the char** argument point to a string obtained from [sqlite3_mprintf()]
-** or the equivalent and that string will become the result of the pragma or
-** the error message if the pragma fails. ^If the
-** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal 
-** [PRAGMA] processing continues.  ^If the [SQLITE_FCNTL_PRAGMA]
-** file control returns [SQLITE_OK], then the parser assumes that the
-** VFS has handled the PRAGMA itself and the parser generates a no-op
-** prepared statement.  ^If the [SQLITE_FCNTL_PRAGMA] file control returns
-** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means
-** that the VFS encountered an error while handling the [PRAGMA] and the
-** compilation of the PRAGMA fails with an error.  ^The [SQLITE_FCNTL_PRAGMA]
-** file control occurs at the beginning of pragma statement analysis and so
-** it is able to override built-in [PRAGMA] statements.
-**
-** <li>[[SQLITE_FCNTL_BUSYHANDLER]]
-** ^The [SQLITE_FCNTL_BUSYHANDLER]
-** file-control may be invoked by SQLite on the database file handle
-** shortly after it is opened in order to provide a custom VFS with access
-** to the connections busy-handler callback. The argument is of type (void **)
-** - an array of two (void *) values. The first (void *) actually points
-** to a function of type (int (*)(void *)). In order to invoke the connections
-** busy-handler, this function should be invoked with the second (void *) in
-** the array as the only argument. If it returns non-zero, then the operation
-** should be retried. If it returns zero, the custom VFS should abandon the
-** current operation.
-**
-** <li>[[SQLITE_FCNTL_TEMPFILENAME]]
-** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control
-** to have SQLite generate a
-** temporary filename using the same algorithm that is followed to generate
-** temporary filenames for TEMP tables and other internal uses.  The
-** argument should be a char** which will be filled with the filename
-** written into memory obtained from [sqlite3_malloc()].  The caller should
-** invoke [sqlite3_free()] on the result to avoid a memory leak.
-**
-** <li>[[SQLITE_FCNTL_MMAP_SIZE]]
-** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the
-** maximum number of bytes that will be used for memory-mapped I/O.
-** The argument is a pointer to a value of type sqlite3_int64 that
-** is an advisory maximum number of bytes in the file to memory map.  The
-** pointer is overwritten with the old value.  The limit is not changed if
-** the value originally pointed to is negative, and so the current limit 
-** can be queried by passing in a pointer to a negative number.  This
-** file-control is used internally to implement [PRAGMA mmap_size].
-**
-** <li>[[SQLITE_FCNTL_TRACE]]
-** The [SQLITE_FCNTL_TRACE] file control provides advisory information
-** to the VFS about what the higher layers of the SQLite stack are doing.
-** This file control is used by some VFS activity tracing [shims].
-** The argument is a zero-terminated string.  Higher layers in the
-** SQLite stack may generate instances of this file control if
-** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled.
-**
-** <li>[[SQLITE_FCNTL_HAS_MOVED]]
-** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a
-** pointer to an integer and it writes a boolean into that integer depending
-** on whether or not the file has been renamed, moved, or deleted since it
-** was first opened.
-**
-** <li>[[SQLITE_FCNTL_WIN32_SET_HANDLE]]
-** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging.  This
-** opcode causes the xFileControl method to swap the file handle with the one
-** pointed to by the pArg argument.  This capability is used during testing
-** and only needs to be supported when SQLITE_TEST is defined.
-**
-** </ul>
-*/
-#define SQLITE_FCNTL_LOCKSTATE               1
-#define SQLITE_GET_LOCKPROXYFILE             2
-#define SQLITE_SET_LOCKPROXYFILE             3
-#define SQLITE_LAST_ERRNO                    4
-#define SQLITE_FCNTL_SIZE_HINT               5
-#define SQLITE_FCNTL_CHUNK_SIZE              6
-#define SQLITE_FCNTL_FILE_POINTER            7
-#define SQLITE_FCNTL_SYNC_OMITTED            8
-#define SQLITE_FCNTL_WIN32_AV_RETRY          9
-#define SQLITE_FCNTL_PERSIST_WAL            10
-#define SQLITE_FCNTL_OVERWRITE              11
-#define SQLITE_FCNTL_VFSNAME                12
-#define SQLITE_FCNTL_POWERSAFE_OVERWRITE    13
-#define SQLITE_FCNTL_PRAGMA                 14
-#define SQLITE_FCNTL_BUSYHANDLER            15
-#define SQLITE_FCNTL_TEMPFILENAME           16
-#define SQLITE_FCNTL_MMAP_SIZE              18
-#define SQLITE_FCNTL_TRACE                  19
-#define SQLITE_FCNTL_HAS_MOVED              20
-#define SQLITE_FCNTL_SYNC                   21
-#define SQLITE_FCNTL_COMMIT_PHASETWO        22
-#define SQLITE_FCNTL_WIN32_SET_HANDLE       23
-
-/*
-** CAPI3REF: Mutex Handle
-**
-** The mutex module within SQLite defines [sqlite3_mutex] to be an
-** abstract type for a mutex object.  The SQLite core never looks
-** at the internal representation of an [sqlite3_mutex].  It only
-** deals with pointers to the [sqlite3_mutex] object.
-**
-** Mutexes are created using [sqlite3_mutex_alloc()].
-*/
-typedef struct sqlite3_mutex sqlite3_mutex;
-
-/*
-** CAPI3REF: OS Interface Object
-**
-** An instance of the sqlite3_vfs object defines the interface between
-** the SQLite core and the underlying operating system.  The "vfs"
-** in the name of the object stands for "virtual file system".  See
-** the [VFS | VFS documentation] for further information.
-**
-** The value of the iVersion field is initially 1 but may be larger in
-** future versions of SQLite.  Additional fields may be appended to this
-** object when the iVersion value is increased.  Note that the structure
-** of the sqlite3_vfs object changes in the transaction between
-** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not
-** modified.
-**
-** The szOsFile field is the size of the subclassed [sqlite3_file]
-** structure used by this VFS.  mxPathname is the maximum length of
-** a pathname in this VFS.
-**
-** Registered sqlite3_vfs objects are kept on a linked list formed by
-** the pNext pointer.  The [sqlite3_vfs_register()]
-** and [sqlite3_vfs_unregister()] interfaces manage this list
-** in a thread-safe way.  The [sqlite3_vfs_find()] interface
-** searches the list.  Neither the application code nor the VFS
-** implementation should use the pNext pointer.
-**
-** The pNext field is the only field in the sqlite3_vfs
-** structure that SQLite will ever modify.  SQLite will only access
-** or modify this field while holding a particular static mutex.
-** The application should never modify anything within the sqlite3_vfs
-** object once the object has been registered.
-**
-** The zName field holds the name of the VFS module.  The name must
-** be unique across all VFS modules.
-**
-** [[sqlite3_vfs.xOpen]]
-** ^SQLite guarantees that the zFilename parameter to xOpen
-** is either a NULL pointer or string obtained
-** from xFullPathname() with an optional suffix added.
-** ^If a suffix is added to the zFilename parameter, it will
-** consist of a single "-" character followed by no more than
-** 11 alphanumeric and/or "-" characters.
-** ^SQLite further guarantees that
-** the string will be valid and unchanged until xClose() is
-** called. Because of the previous sentence,
-** the [sqlite3_file] can safely store a pointer to the
-** filename if it needs to remember the filename for some reason.
-** If the zFilename parameter to xOpen is a NULL pointer then xOpen
-** must invent its own temporary name for the file.  ^Whenever the 
-** xFilename parameter is NULL it will also be the case that the
-** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
-**
-** The flags argument to xOpen() includes all bits set in
-** the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]
-** or [sqlite3_open16()] is used, then flags includes at least
-** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. 
-** If xOpen() opens a file read-only then it sets *pOutFlags to
-** include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.
-**
-** ^(SQLite will also add one of the following flags to the xOpen()
-** call, depending on the object being opened:
-**
-** <ul>
-** <li>  [SQLITE_OPEN_MAIN_DB]
-** <li>  [SQLITE_OPEN_MAIN_JOURNAL]
-** <li>  [SQLITE_OPEN_TEMP_DB]
-** <li>  [SQLITE_OPEN_TEMP_JOURNAL]
-** <li>  [SQLITE_OPEN_TRANSIENT_DB]
-** <li>  [SQLITE_OPEN_SUBJOURNAL]
-** <li>  [SQLITE_OPEN_MASTER_JOURNAL]
-** <li>  [SQLITE_OPEN_WAL]
-** </ul>)^
-**
-** The file I/O implementation can use the object type flags to
-** change the way it deals with files.  For example, an application
-** that does not care about crash recovery or rollback might make
-** the open of a journal file a no-op.  Writes to this journal would
-** also be no-ops, and any attempt to read the journal would return
-** SQLITE_IOERR.  Or the implementation might recognize that a database
-** file will be doing page-aligned sector reads and writes in a random
-** order and set up its I/O subsystem accordingly.
-**
-** SQLite might also add one of the following flags to the xOpen method:
-**
-** <ul>
-** <li> [SQLITE_OPEN_DELETEONCLOSE]
-** <li> [SQLITE_OPEN_EXCLUSIVE]
-** </ul>
-**
-** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
-** deleted when it is closed.  ^The [SQLITE_OPEN_DELETEONCLOSE]
-** will be set for TEMP databases and their journals, transient
-** databases, and subjournals.
-**
-** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction
-** with the [SQLITE_OPEN_CREATE] flag, which are both directly
-** analogous to the O_EXCL and O_CREAT flags of the POSIX open()
-** API.  The SQLITE_OPEN_EXCLUSIVE flag, when paired with the 
-** SQLITE_OPEN_CREATE, is used to indicate that file should always
-** be created, and that it is an error if it already exists.
-** It is <i>not</i> used to indicate the file should be opened 
-** for exclusive access.
-**
-** ^At least szOsFile bytes of memory are allocated by SQLite
-** to hold the  [sqlite3_file] structure passed as the third
-** argument to xOpen.  The xOpen method does not have to
-** allocate the structure; it should just fill it in.  Note that
-** the xOpen method must set the sqlite3_file.pMethods to either
-** a valid [sqlite3_io_methods] object or to NULL.  xOpen must do
-** this even if the open fails.  SQLite expects that the sqlite3_file.pMethods
-** element will be valid after xOpen returns regardless of the success
-** or failure of the xOpen call.
-**
-** [[sqlite3_vfs.xAccess]]
-** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
-** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
-** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
-** to test whether a file is at least readable.   The file can be a
-** directory.
-**
-** ^SQLite will always allocate at least mxPathname+1 bytes for the
-** output buffer xFullPathname.  The exact size of the output buffer
-** is also passed as a parameter to both  methods. If the output buffer
-** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
-** handled as a fatal error by SQLite, vfs implementations should endeavor
-** to prevent this by setting mxPathname to a sufficiently large value.
-**
-** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
-** interfaces are not strictly a part of the filesystem, but they are
-** included in the VFS structure for completeness.
-** The xRandomness() function attempts to return nBytes bytes
-** of good-quality randomness into zOut.  The return value is
-** the actual number of bytes of randomness obtained.
-** The xSleep() method causes the calling thread to sleep for at
-** least the number of microseconds given.  ^The xCurrentTime()
-** method returns a Julian Day Number for the current date and time as
-** a floating point value.
-** ^The xCurrentTimeInt64() method returns, as an integer, the Julian
-** Day Number multiplied by 86400000 (the number of milliseconds in 
-** a 24-hour day).  
-** ^SQLite will use the xCurrentTimeInt64() method to get the current
-** date and time if that method is available (if iVersion is 2 or 
-** greater and the function pointer is not NULL) and will fall back
-** to xCurrentTime() if xCurrentTimeInt64() is unavailable.
-**
-** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces
-** are not used by the SQLite core.  These optional interfaces are provided
-** by some VFSes to facilitate testing of the VFS code. By overriding 
-** system calls with functions under its control, a test program can
-** simulate faults and error conditions that would otherwise be difficult
-** or impossible to induce.  The set of system calls that can be overridden
-** varies from one VFS to another, and from one version of the same VFS to the
-** next.  Applications that use these interfaces must be prepared for any
-** or all of these interfaces to be NULL or for their behavior to change
-** from one release to the next.  Applications must not attempt to access
-** any of these methods if the iVersion of the VFS is less than 3.
-*/
-typedef struct sqlite3_vfs sqlite3_vfs;
-typedef void (*sqlite3_syscall_ptr)(void);
-struct sqlite3_vfs {
-  int iVersion;            /* Structure version number (currently 3) */
-  int szOsFile;            /* Size of subclassed sqlite3_file */
-  int mxPathname;          /* Maximum file pathname length */
-  sqlite3_vfs *pNext;      /* Next registered VFS */
-  const char *zName;       /* Name of this virtual file system */
-  void *pAppData;          /* Pointer to application-specific data */
-  int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
-               int flags, int *pOutFlags);
-  int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
-  int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
-  int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
-  void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
-  void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
-  void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
-  void (*xDlClose)(sqlite3_vfs*, void*);
-  int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
-  int (*xSleep)(sqlite3_vfs*, int microseconds);
-  int (*xCurrentTime)(sqlite3_vfs*, double*);
-  int (*xGetLastError)(sqlite3_vfs*, int, char *);
-  /*
-  ** The methods above are in version 1 of the sqlite_vfs object
-  ** definition.  Those that follow are added in version 2 or later
-  */
-  int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
-  /*
-  ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
-  ** Those below are for version 3 and greater.
-  */
-  int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
-  sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
-  const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
-  /*
-  ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
-  ** New fields may be appended in figure versions.  The iVersion
-  ** value will increment whenever this happens. 
-  */
-};
-
-/*
-** CAPI3REF: Flags for the xAccess VFS method
-**
-** These integer constants can be used as the third parameter to
-** the xAccess method of an [sqlite3_vfs] object.  They determine
-** what kind of permissions the xAccess method is looking for.
-** With SQLITE_ACCESS_EXISTS, the xAccess method
-** simply checks whether the file exists.
-** With SQLITE_ACCESS_READWRITE, the xAccess method
-** checks whether the named directory is both readable and writable
-** (in other words, if files can be added, removed, and renamed within
-** the directory).
-** The SQLITE_ACCESS_READWRITE constant is currently used only by the
-** [temp_store_directory pragma], though this could change in a future
-** release of SQLite.
-** With SQLITE_ACCESS_READ, the xAccess method
-** checks whether the file is readable.  The SQLITE_ACCESS_READ constant is
-** currently unused, though it might be used in a future release of
-** SQLite.
-*/
-#define SQLITE_ACCESS_EXISTS    0
-#define SQLITE_ACCESS_READWRITE 1   /* Used by PRAGMA temp_store_directory */
-#define SQLITE_ACCESS_READ      2   /* Unused */
-
-/*
-** CAPI3REF: Flags for the xShmLock VFS method
-**
-** These integer constants define the various locking operations
-** allowed by the xShmLock method of [sqlite3_io_methods].  The
-** following are the only legal combinations of flags to the
-** xShmLock method:
-**
-** <ul>
-** <li>  SQLITE_SHM_LOCK | SQLITE_SHM_SHARED
-** <li>  SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE
-** <li>  SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED
-** <li>  SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE
-** </ul>
-**
-** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as
-** was given no the corresponding lock.  
-**
-** The xShmLock method can transition between unlocked and SHARED or
-** between unlocked and EXCLUSIVE.  It cannot transition between SHARED
-** and EXCLUSIVE.
-*/
-#define SQLITE_SHM_UNLOCK       1
-#define SQLITE_SHM_LOCK         2
-#define SQLITE_SHM_SHARED       4
-#define SQLITE_SHM_EXCLUSIVE    8
-
-/*
-** CAPI3REF: Maximum xShmLock index
-**
-** The xShmLock method on [sqlite3_io_methods] may use values
-** between 0 and this upper bound as its "offset" argument.
-** The SQLite core will never attempt to acquire or release a
-** lock outside of this range
-*/
-#define SQLITE_SHM_NLOCK        8
-
-
-/*
-** CAPI3REF: Initialize The SQLite Library
-**
-** ^The sqlite3_initialize() routine initializes the
-** SQLite library.  ^The sqlite3_shutdown() routine
-** deallocates any resources that were allocated by sqlite3_initialize().
-** These routines are designed to aid in process initialization and
-** shutdown on embedded systems.  Workstation applications using
-** SQLite normally do not need to invoke either of these routines.
-**
-** A call to sqlite3_initialize() is an "effective" call if it is
-** the first time sqlite3_initialize() is invoked during the lifetime of
-** the process, or if it is the first time sqlite3_initialize() is invoked
-** following a call to sqlite3_shutdown().  ^(Only an effective call
-** of sqlite3_initialize() does any initialization.  All other calls
-** are harmless no-ops.)^
-**
-** A call to sqlite3_shutdown() is an "effective" call if it is the first
-** call to sqlite3_shutdown() since the last sqlite3_initialize().  ^(Only
-** an effective call to sqlite3_shutdown() does any deinitialization.
-** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^
-**
-** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown()
-** is not.  The sqlite3_shutdown() interface must only be called from a
-** single thread.  All open [database connections] must be closed and all
-** other SQLite resources must be deallocated prior to invoking
-** sqlite3_shutdown().
-**
-** Among other things, ^sqlite3_initialize() will invoke
-** sqlite3_os_init().  Similarly, ^sqlite3_shutdown()
-** will invoke sqlite3_os_end().
-**
-** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success.
-** ^If for some reason, sqlite3_initialize() is unable to initialize
-** the library (perhaps it is unable to allocate a needed resource such
-** as a mutex) it returns an [error code] other than [SQLITE_OK].
-**
-** ^The sqlite3_initialize() routine is called internally by many other
-** SQLite interfaces so that an application usually does not need to
-** invoke sqlite3_initialize() directly.  For example, [sqlite3_open()]
-** calls sqlite3_initialize() so the SQLite library will be automatically
-** initialized when [sqlite3_open()] is called if it has not be initialized
-** already.  ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
-** compile-time option, then the automatic calls to sqlite3_initialize()
-** are omitted and the application must call sqlite3_initialize() directly
-** prior to using any other SQLite interface.  For maximum portability,
-** it is recommended that applications always invoke sqlite3_initialize()
-** directly prior to using any other SQLite interface.  Future releases
-** of SQLite may require this.  In other words, the behavior exhibited
-** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the
-** default behavior in some future release of SQLite.
-**
-** The sqlite3_os_init() routine does operating-system specific
-** initialization of the SQLite library.  The sqlite3_os_end()
-** routine undoes the effect of sqlite3_os_init().  Typical tasks
-** performed by these routines include allocation or deallocation
-** of static resources, initialization of global variables,
-** setting up a default [sqlite3_vfs] module, or setting up
-** a default configuration using [sqlite3_config()].
-**
-** The application should never invoke either sqlite3_os_init()
-** or sqlite3_os_end() directly.  The application should only invoke
-** sqlite3_initialize() and sqlite3_shutdown().  The sqlite3_os_init()
-** interface is called automatically by sqlite3_initialize() and
-** sqlite3_os_end() is called by sqlite3_shutdown().  Appropriate
-** implementations for sqlite3_os_init() and sqlite3_os_end()
-** are built into SQLite when it is compiled for Unix, Windows, or OS/2.
-** When [custom builds | built for other platforms]
-** (using the [SQLITE_OS_OTHER=1] compile-time
-** option) the application must supply a suitable implementation for
-** sqlite3_os_init() and sqlite3_os_end().  An application-supplied
-** implementation of sqlite3_os_init() or sqlite3_os_end()
-** must return [SQLITE_OK] on success and some other [error code] upon
-** failure.
-*/
-SQLITE_API int sqlite3_initialize(void);
-SQLITE_API int sqlite3_shutdown(void);
-SQLITE_API int sqlite3_os_init(void);
-SQLITE_API int sqlite3_os_end(void);
-
-/*
-** CAPI3REF: Configuring The SQLite Library
-**
-** The sqlite3_config() interface is used to make global configuration
-** changes to SQLite in order to tune SQLite to the specific needs of
-** the application.  The default configuration is recommended for most
-** applications and so this routine is usually not necessary.  It is
-** provided to support rare applications with unusual needs.
-**
-** The sqlite3_config() interface is not threadsafe.  The application
-** must insure that no other SQLite interfaces are invoked by other
-** threads while sqlite3_config() is running.  Furthermore, sqlite3_config()
-** may only be invoked prior to library initialization using
-** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()].
-** ^If sqlite3_config() is called after [sqlite3_initialize()] and before
-** [sqlite3_shutdown()] then it will return SQLITE_MISUSE.
-** Note, however, that ^sqlite3_config() can be called as part of the
-** implementation of an application-defined [sqlite3_os_init()].
-**
-** The first argument to sqlite3_config() is an integer
-** [configuration option] that determines
-** what property of SQLite is to be configured.  Subsequent arguments
-** vary depending on the [configuration option]
-** in the first argument.
-**
-** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
-** ^If the option is unknown or SQLite is unable to set the option
-** then this routine returns a non-zero [error code].
-*/
-SQLITE_API int sqlite3_config(int, ...);
-
-/*
-** CAPI3REF: Configure database connections
-**
-** The sqlite3_db_config() interface is used to make configuration
-** changes to a [database connection].  The interface is similar to
-** [sqlite3_config()] except that the changes apply to a single
-** [database connection] (specified in the first argument).
-**
-** The second argument to sqlite3_db_config(D,V,...)  is the
-** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code 
-** that indicates what aspect of the [database connection] is being configured.
-** Subsequent arguments vary depending on the configuration verb.
-**
-** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
-** the call is considered successful.
-*/
-SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
-
-/*
-** CAPI3REF: Memory Allocation Routines
-**
-** An instance of this object defines the interface between SQLite
-** and low-level memory allocation routines.
-**
-** This object is used in only one place in the SQLite interface.
-** A pointer to an instance of this object is the argument to
-** [sqlite3_config()] when the configuration option is
-** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].  
-** By creating an instance of this object
-** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])
-** during configuration, an application can specify an alternative
-** memory allocation subsystem for SQLite to use for all of its
-** dynamic memory needs.
-**
-** Note that SQLite comes with several [built-in memory allocators]
-** that are perfectly adequate for the overwhelming majority of applications
-** and that this object is only useful to a tiny minority of applications
-** with specialized memory allocation requirements.  This object is
-** also used during testing of SQLite in order to specify an alternative
-** memory allocator that simulates memory out-of-memory conditions in
-** order to verify that SQLite recovers gracefully from such
-** conditions.
-**
-** The xMalloc, xRealloc, and xFree methods must work like the
-** malloc(), realloc() and free() functions from the standard C library.
-** ^SQLite guarantees that the second argument to
-** xRealloc is always a value returned by a prior call to xRoundup.
-**
-** xSize should return the allocated size of a memory allocation
-** previously obtained from xMalloc or xRealloc.  The allocated size
-** is always at least as big as the requested size but may be larger.
-**
-** The xRoundup method returns what would be the allocated size of
-** a memory allocation given a particular requested size.  Most memory
-** allocators round up memory allocations at least to the next multiple
-** of 8.  Some allocators round up to a larger multiple or to a power of 2.
-** Every memory allocation request coming in through [sqlite3_malloc()]
-** or [sqlite3_realloc()] first calls xRoundup.  If xRoundup returns 0, 
-** that causes the corresponding memory allocation to fail.
-**
-** The xInit method initializes the memory allocator.  For example,
-** it might allocate any require mutexes or initialize internal data
-** structures.  The xShutdown method is invoked (indirectly) by
-** [sqlite3_shutdown()] and should deallocate any resources acquired
-** by xInit.  The pAppData pointer is used as the only parameter to
-** xInit and xShutdown.
-**
-** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
-** the xInit method, so the xInit method need not be threadsafe.  The
-** xShutdown method is only called from [sqlite3_shutdown()] so it does
-** not need to be threadsafe either.  For all other methods, SQLite
-** holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
-** [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which
-** it is by default) and so the methods are automatically serialized.
-** However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other
-** methods must be threadsafe or else make their own arrangements for
-** serialization.
-**
-** SQLite will never invoke xInit() more than once without an intervening
-** call to xShutdown().
-*/
-typedef struct sqlite3_mem_methods sqlite3_mem_methods;
-struct sqlite3_mem_methods {
-  void *(*xMalloc)(int);         /* Memory allocation function */
-  void (*xFree)(void*);          /* Free a prior allocation */
-  void *(*xRealloc)(void*,int);  /* Resize an allocation */
-  int (*xSize)(void*);           /* Return the size of an allocation */
-  int (*xRoundup)(int);          /* Round up request size to allocation size */
-  int (*xInit)(void*);           /* Initialize the memory allocator */
-  void (*xShutdown)(void*);      /* Deinitialize the memory allocator */
-  void *pAppData;                /* Argument to xInit() and xShutdown() */
-};
-
-/*
-** CAPI3REF: Configuration Options
-** KEYWORDS: {configuration option}
-**
-** These constants are the available integer configuration options that
-** can be passed as the first argument to the [sqlite3_config()] interface.
-**
-** New configuration options may be added in future releases of SQLite.
-** Existing configuration options might be discontinued.  Applications
-** should check the return code from [sqlite3_config()] to make sure that
-** the call worked.  The [sqlite3_config()] interface will return a
-** non-zero [error code] if a discontinued or unsupported configuration option
-** is invoked.
-**
-** <dl>
-** [[SQLITE_CONFIG_SINGLETHREAD]] <dt>SQLITE_CONFIG_SINGLETHREAD</dt>
-** <dd>There are no arguments to this option.  ^This option sets the
-** [threading mode] to Single-thread.  In other words, it disables
-** all mutexing and puts SQLite into a mode where it can only be used
-** by a single thread.   ^If SQLite is compiled with
-** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
-** it is not possible to change the [threading mode] from its default
-** value of Single-thread and so [sqlite3_config()] will return 
-** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD
-** configuration option.</dd>
-**
-** [[SQLITE_CONFIG_MULTITHREAD]] <dt>SQLITE_CONFIG_MULTITHREAD</dt>
-** <dd>There are no arguments to this option.  ^This option sets the
-** [threading mode] to Multi-thread.  In other words, it disables
-** mutexing on [database connection] and [prepared statement] objects.
-** The application is responsible for serializing access to
-** [database connections] and [prepared statements].  But other mutexes
-** are enabled so that SQLite will be safe to use in a multi-threaded
-** environment as long as no two threads attempt to use the same
-** [database connection] at the same time.  ^If SQLite is compiled with
-** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
-** it is not possible to set the Multi-thread [threading mode] and
-** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
-** SQLITE_CONFIG_MULTITHREAD configuration option.</dd>
-**
-** [[SQLITE_CONFIG_SERIALIZED]] <dt>SQLITE_CONFIG_SERIALIZED</dt>
-** <dd>There are no arguments to this option.  ^This option sets the
-** [threading mode] to Serialized. In other words, this option enables
-** all mutexes including the recursive
-** mutexes on [database connection] and [prepared statement] objects.
-** In this mode (which is the default when SQLite is compiled with
-** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
-** to [database connections] and [prepared statements] so that the
-** application is free to use the same [database connection] or the
-** same [prepared statement] in different threads at the same time.
-** ^If SQLite is compiled with
-** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
-** it is not possible to set the Serialized [threading mode] and
-** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
-** SQLITE_CONFIG_SERIALIZED configuration option.</dd>
-**
-** [[SQLITE_CONFIG_MALLOC]] <dt>SQLITE_CONFIG_MALLOC</dt>
-** <dd> ^(This option takes a single argument which is a pointer to an
-** instance of the [sqlite3_mem_methods] structure.  The argument specifies
-** alternative low-level memory allocation routines to be used in place of
-** the memory allocation routines built into SQLite.)^ ^SQLite makes
-** its own private copy of the content of the [sqlite3_mem_methods] structure
-** before the [sqlite3_config()] call returns.</dd>
-**
-** [[SQLITE_CONFIG_GETMALLOC]] <dt>SQLITE_CONFIG_GETMALLOC</dt>
-** <dd> ^(This option takes a single argument which is a pointer to an
-** instance of the [sqlite3_mem_methods] structure.  The [sqlite3_mem_methods]
-** structure is filled with the currently defined memory allocation routines.)^
-** This option can be used to overload the default memory allocation
-** routines with a wrapper that simulations memory allocation failure or
-** tracks memory usage, for example. </dd>
-**
-** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
-** <dd> ^This option takes single argument of type int, interpreted as a 
-** boolean, which enables or disables the collection of memory allocation 
-** statistics. ^(When memory allocation statistics are disabled, the 
-** following SQLite interfaces become non-operational:
-**   <ul>
-**   <li> [sqlite3_memory_used()]
-**   <li> [sqlite3_memory_highwater()]
-**   <li> [sqlite3_soft_heap_limit64()]
-**   <li> [sqlite3_status()]
-**   </ul>)^
-** ^Memory allocation statistics are enabled by default unless SQLite is
-** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory
-** allocation statistics are disabled by default.
-** </dd>
-**
-** [[SQLITE_CONFIG_SCRATCH]] <dt>SQLITE_CONFIG_SCRATCH</dt>
-** <dd> ^This option specifies a static memory buffer that SQLite can use for
-** scratch memory.  There are three arguments:  A pointer an 8-byte
-** aligned memory buffer from which the scratch allocations will be
-** drawn, the size of each scratch allocation (sz),
-** and the maximum number of scratch allocations (N).  The sz
-** argument must be a multiple of 16.
-** The first argument must be a pointer to an 8-byte aligned buffer
-** of at least sz*N bytes of memory.
-** ^SQLite will use no more than two scratch buffers per thread.  So
-** N should be set to twice the expected maximum number of threads.
-** ^SQLite will never require a scratch buffer that is more than 6
-** times the database page size. ^If SQLite needs needs additional
-** scratch memory beyond what is provided by this configuration option, then 
-** [sqlite3_malloc()] will be used to obtain the memory needed.</dd>
-**
-** [[SQLITE_CONFIG_PAGECACHE]] <dt>SQLITE_CONFIG_PAGECACHE</dt>
-** <dd> ^This option specifies a static memory buffer that SQLite can use for
-** the database page cache with the default page cache implementation.  
-** This configuration should not be used if an application-define page
-** cache implementation is loaded using the SQLITE_CONFIG_PCACHE2 option.
-** There are three arguments to this option: A pointer to 8-byte aligned
-** memory, the size of each page buffer (sz), and the number of pages (N).
-** The sz argument should be the size of the largest database page
-** (a power of two between 512 and 32768) plus a little extra for each
-** page header.  ^The page header size is 20 to 40 bytes depending on
-** the host architecture.  ^It is harmless, apart from the wasted memory,
-** to make sz a little too large.  The first
-** argument should point to an allocation of at least sz*N bytes of memory.
-** ^SQLite will use the memory provided by the first argument to satisfy its
-** memory needs for the first N pages that it adds to cache.  ^If additional
-** page cache memory is needed beyond what is provided by this option, then
-** SQLite goes to [sqlite3_malloc()] for the additional storage space.
-** The pointer in the first argument must
-** be aligned to an 8-byte boundary or subsequent behavior of SQLite
-** will be undefined.</dd>
-**
-** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
-** <dd> ^This option specifies a static memory buffer that SQLite will use
-** for all of its dynamic memory allocation needs beyond those provided
-** for by [SQLITE_CONFIG_SCRATCH] and [SQLITE_CONFIG_PAGECACHE].
-** There are three arguments: An 8-byte aligned pointer to the memory,
-** the number of bytes in the memory buffer, and the minimum allocation size.
-** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts
-** to using its default memory allocator (the system malloc() implementation),
-** undoing any prior invocation of [SQLITE_CONFIG_MALLOC].  ^If the
-** memory pointer is not NULL and either [SQLITE_ENABLE_MEMSYS3] or
-** [SQLITE_ENABLE_MEMSYS5] are defined, then the alternative memory
-** allocator is engaged to handle all of SQLites memory allocation needs.
-** The first pointer (the memory pointer) must be aligned to an 8-byte
-** boundary or subsequent behavior of SQLite will be undefined.
-** The minimum allocation size is capped at 2**12. Reasonable values
-** for the minimum allocation size are 2**5 through 2**8.</dd>
-**
-** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
-** <dd> ^(This option takes a single argument which is a pointer to an
-** instance of the [sqlite3_mutex_methods] structure.  The argument specifies
-** alternative low-level mutex routines to be used in place
-** the mutex routines built into SQLite.)^  ^SQLite makes a copy of the
-** content of the [sqlite3_mutex_methods] structure before the call to
-** [sqlite3_config()] returns. ^If SQLite is compiled with
-** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
-** the entire mutexing subsystem is omitted from the build and hence calls to
-** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
-** return [SQLITE_ERROR].</dd>
-**
-** [[SQLITE_CONFIG_GETMUTEX]] <dt>SQLITE_CONFIG_GETMUTEX</dt>
-** <dd> ^(This option takes a single argument which is a pointer to an
-** instance of the [sqlite3_mutex_methods] structure.  The
-** [sqlite3_mutex_methods]
-** structure is filled with the currently defined mutex routines.)^
-** This option can be used to overload the default mutex allocation
-** routines with a wrapper used to track mutex usage for performance
-** profiling or testing, for example.   ^If SQLite is compiled with
-** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
-** the entire mutexing subsystem is omitted from the build and hence calls to
-** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will
-** return [SQLITE_ERROR].</dd>
-**
-** [[SQLITE_CONFIG_LOOKASIDE]] <dt>SQLITE_CONFIG_LOOKASIDE</dt>
-** <dd> ^(This option takes two arguments that determine the default
-** memory allocation for the lookaside memory allocator on each
-** [database connection].  The first argument is the
-** size of each lookaside buffer slot and the second is the number of
-** slots allocated to each database connection.)^  ^(This option sets the
-** <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]
-** verb to [sqlite3_db_config()] can be used to change the lookaside
-** configuration on individual connections.)^ </dd>
-**
-** [[SQLITE_CONFIG_PCACHE2]] <dt>SQLITE_CONFIG_PCACHE2</dt>
-** <dd> ^(This option takes a single argument which is a pointer to
-** an [sqlite3_pcache_methods2] object.  This object specifies the interface
-** to a custom page cache implementation.)^  ^SQLite makes a copy of the
-** object and uses it for page cache memory allocations.</dd>
-**
-** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
-** <dd> ^(This option takes a single argument which is a pointer to an
-** [sqlite3_pcache_methods2] object.  SQLite copies of the current
-** page cache implementation into that object.)^ </dd>
-**
-** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
-** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
-** global [error log].
-** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
-** function with a call signature of void(*)(void*,int,const char*), 
-** and a pointer to void. ^If the function pointer is not NULL, it is
-** invoked by [sqlite3_log()] to process each logging event.  ^If the
-** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
-** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
-** passed through as the first parameter to the application-defined logger
-** function whenever that function is invoked.  ^The second parameter to
-** the logger function is a copy of the first parameter to the corresponding
-** [sqlite3_log()] call and is intended to be a [result code] or an
-** [extended result code].  ^The third parameter passed to the logger is
-** log message after formatting via [sqlite3_snprintf()].
-** The SQLite logging interface is not reentrant; the logger function
-** supplied by the application must not invoke any SQLite interface.
-** In a multi-threaded application, the application-defined logger
-** function must be threadsafe. </dd>
-**
-** [[SQLITE_CONFIG_URI]] <dt>SQLITE_CONFIG_URI
-** <dd>^(This option takes a single argument of type int. If non-zero, then
-** URI handling is globally enabled. If the parameter is zero, then URI handling
-** is globally disabled.)^ ^If URI handling is globally enabled, all filenames
-** passed to [sqlite3_open()], [sqlite3_open_v2()], [sqlite3_open16()] or
-** specified as part of [ATTACH] commands are interpreted as URIs, regardless
-** of whether or not the [SQLITE_OPEN_URI] flag is set when the database
-** connection is opened. ^If it is globally disabled, filenames are
-** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the
-** database connection is opened. ^(By default, URI handling is globally
-** disabled. The default value may be changed by compiling with the
-** [SQLITE_USE_URI] symbol defined.)^
-**
-** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] <dt>SQLITE_CONFIG_COVERING_INDEX_SCAN
-** <dd>^This option takes a single integer argument which is interpreted as
-** a boolean in order to enable or disable the use of covering indices for
-** full table scans in the query optimizer.  ^The default setting is determined
-** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on"
-** if that compile-time option is omitted.
-** The ability to disable the use of covering indices for full table scans
-** is because some incorrectly coded legacy applications might malfunction
-** when the optimization is enabled.  Providing the ability to
-** disable the optimization allows the older, buggy application code to work
-** without change even with newer versions of SQLite.
-**
-** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]]
-** <dt>SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE
-** <dd> These options are obsolete and should not be used by new code.
-** They are retained for backwards compatibility but are now no-ops.
-** </dd>
-**
-** [[SQLITE_CONFIG_SQLLOG]]
-** <dt>SQLITE_CONFIG_SQLLOG
-** <dd>This option is only available if sqlite is compiled with the
-** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
-** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
-** The second should be of type (void*). The callback is invoked by the library
-** in three separate circumstances, identified by the value passed as the
-** fourth parameter. If the fourth parameter is 0, then the database connection
-** passed as the second argument has just been opened. The third argument
-** points to a buffer containing the name of the main database file. If the
-** fourth parameter is 1, then the SQL statement that the third parameter
-** points to has just been executed. Or, if the fourth parameter is 2, then
-** the connection being passed as the second parameter is being closed. The
-** third parameter is passed NULL In this case.  An example of using this
-** configuration option can be seen in the "test_sqllog.c" source file in
-** the canonical SQLite source tree.</dd>
-**
-** [[SQLITE_CONFIG_MMAP_SIZE]]
-** <dt>SQLITE_CONFIG_MMAP_SIZE
-** <dd>^SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
-** that are the default mmap size limit (the default setting for
-** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
-** ^The default setting can be overridden by each database connection using
-** either the [PRAGMA mmap_size] command, or by using the
-** [SQLITE_FCNTL_MMAP_SIZE] file control.  ^(The maximum allowed mmap size
-** cannot be changed at run-time.  Nor may the maximum allowed mmap size
-** exceed the compile-time maximum mmap size set by the
-** [SQLITE_MAX_MMAP_SIZE] compile-time option.)^
-** ^If either argument to this option is negative, then that argument is
-** changed to its compile-time default.
-**
-** [[SQLITE_CONFIG_WIN32_HEAPSIZE]]
-** <dt>SQLITE_CONFIG_WIN32_HEAPSIZE
-** <dd>^This option is only available if SQLite is compiled for Windows
-** with the [SQLITE_WIN32_MALLOC] pre-processor macro defined.
-** SQLITE_CONFIG_WIN32_HEAPSIZE takes a 32-bit unsigne

<TRUNCATED>


[42/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
Move newt source into a "newt" subdirectory.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/e95057f4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/e95057f4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/e95057f4

Branch: refs/heads/master
Commit: e95057f45d20958bf20461a942369c5036469fe2
Parents: e5b282f
Author: Christopher Collins <cc...@gmail.com>
Authored: Fri Nov 20 16:42:10 2015 -0800
Committer: Christopher Collins <cc...@gmail.com>
Committed: Fri Nov 20 16:42:10 2015 -0800

----------------------------------------------------------------------
 .gitignore                                      |      2 +-
 Godeps/Godeps.json                              |     70 -
 Godeps/Readme                                   |      5 -
 Godeps/_workspace/.gitignore                    |      2 -
 .../src/github.com/BurntSushi/toml/.gitignore   |      5 -
 .../src/github.com/BurntSushi/toml/.travis.yml  |     12 -
 .../src/github.com/BurntSushi/toml/COMPATIBLE   |      3 -
 .../src/github.com/BurntSushi/toml/COPYING      |     14 -
 .../src/github.com/BurntSushi/toml/Makefile     |     19 -
 .../src/github.com/BurntSushi/toml/README.md    |    220 -
 .../toml/cmd/toml-test-decoder/COPYING          |     14 -
 .../toml/cmd/toml-test-decoder/README.md        |     14 -
 .../toml/cmd/toml-test-decoder/main.go          |     90 -
 .../toml/cmd/toml-test-encoder/COPYING          |     14 -
 .../toml/cmd/toml-test-encoder/README.md        |     14 -
 .../toml/cmd/toml-test-encoder/main.go          |    131 -
 .../BurntSushi/toml/cmd/tomlv/COPYING           |     14 -
 .../BurntSushi/toml/cmd/tomlv/README.md         |     22 -
 .../BurntSushi/toml/cmd/tomlv/main.go           |     61 -
 .../src/github.com/BurntSushi/toml/decode.go    |    492 -
 .../github.com/BurntSushi/toml/decode_meta.go   |    122 -
 .../github.com/BurntSushi/toml/decode_test.go   |    950 -
 .../src/github.com/BurntSushi/toml/doc.go       |     27 -
 .../src/github.com/BurntSushi/toml/encode.go    |    551 -
 .../github.com/BurntSushi/toml/encode_test.go   |    542 -
 .../BurntSushi/toml/encoding_types.go           |     19 -
 .../BurntSushi/toml/encoding_types_1.1.go       |     18 -
 .../src/github.com/BurntSushi/toml/lex.go       |    874 -
 .../src/github.com/BurntSushi/toml/parse.go     |    498 -
 .../src/github.com/BurntSushi/toml/session.vim  |      1 -
 .../github.com/BurntSushi/toml/type_check.go    |     91 -
 .../github.com/BurntSushi/toml/type_fields.go   |    241 -
 .../src/github.com/andelf/go-curl/.gitignore    |      4 -
 .../src/github.com/andelf/go-curl/.travis.yml   |     15 -
 .../src/github.com/andelf/go-curl/LICENSE       |     13 -
 .../src/github.com/andelf/go-curl/README.md     |     73 -
 .../src/github.com/andelf/go-curl/c-callback.c  |     68 -
 .../src/github.com/andelf/go-curl/callback.go   |     90 -
 .../src/github.com/andelf/go-curl/callback.h    |      6 -
 .../src/github.com/andelf/go-curl/compat.h      |    380 -
 .../src/github.com/andelf/go-curl/const.go      |    179 -
 .../src/github.com/andelf/go-curl/const_gen.go  |    410 -
 .../src/github.com/andelf/go-curl/core.go       |    118 -
 .../src/github.com/andelf/go-curl/core_test.go  |     23 -
 .../src/github.com/andelf/go-curl/easy.go       |    495 -
 .../src/github.com/andelf/go-curl/easy_test.go  |     61 -
 .../andelf/go-curl/examples/channal_callback.go |     47 -
 .../andelf/go-curl/examples/ftpget.go           |     37 -
 .../github.com/andelf/go-curl/examples/https.go |     17 -
 .../github.com/andelf/go-curl/examples/misc.go  |    104 -
 .../andelf/go-curl/examples/multi_and_select.go |    101 -
 .../andelf/go-curl/examples/multi_sample.go     |     36 -
 .../andelf/go-curl/examples/post-callback.go    |     43 -
 .../andelf/go-curl/examples/progress.go         |     47 -
 .../andelf/go-curl/examples/renren_login.go     |     36 -
 .../andelf/go-curl/examples/renren_upload.go    |     77 -
 .../andelf/go-curl/examples/sendrecv.go         |     44 -
 .../andelf/go-curl/examples/sepheaders.go       |     49 -
 .../andelf/go-curl/examples/simple.go           |     14 -
 .../src/github.com/andelf/go-curl/logging.go    |     56 -
 .../github.com/andelf/go-curl/logging_test.go   |     64 -
 .../github.com/andelf/go-curl/misc/codegen.py   |     88 -
 .../github.com/andelf/go-curl/misc/compatgen.py |    162 -
 .../src/github.com/andelf/go-curl/multi.go      |    154 -
 .../src/github.com/andelf/go-curl/share.go      |     62 -
 .../github.com/hashicorp/logutils/.gitignore    |     22 -
 .../src/github.com/hashicorp/logutils/LICENSE   |    354 -
 .../src/github.com/hashicorp/logutils/README.md |     36 -
 .../src/github.com/hashicorp/logutils/level.go  |     81 -
 .../hashicorp/logutils/level_benchmark_test.go  |     37 -
 .../github.com/hashicorp/logutils/level_test.go |     94 -
 .../inconshreveable/mousetrap/LICENSE           |     13 -
 .../inconshreveable/mousetrap/README.md         |     23 -
 .../inconshreveable/mousetrap/trap_others.go    |     15 -
 .../inconshreveable/mousetrap/trap_windows.go   |     98 -
 .../mousetrap/trap_windows_1.4.go               |     46 -
 .../src/github.com/kr/pretty/.gitignore         |      4 -
 .../_workspace/src/github.com/kr/pretty/License |     21 -
 .../_workspace/src/github.com/kr/pretty/Readme  |      9 -
 .../_workspace/src/github.com/kr/pretty/diff.go |    158 -
 .../src/github.com/kr/pretty/diff_test.go       |     74 -
 .../src/github.com/kr/pretty/example_test.go    |     20 -
 .../src/github.com/kr/pretty/formatter.go       |    337 -
 .../src/github.com/kr/pretty/formatter_test.go  |    261 -
 .../src/github.com/kr/pretty/pretty.go          |     98 -
 .../_workspace/src/github.com/kr/pretty/zero.go |     41 -
 .../_workspace/src/github.com/kr/text/License   |     19 -
 Godeps/_workspace/src/github.com/kr/text/Readme |      3 -
 .../src/github.com/kr/text/colwriter/Readme     |      5 -
 .../src/github.com/kr/text/colwriter/column.go  |    147 -
 .../github.com/kr/text/colwriter/column_test.go |     90 -
 Godeps/_workspace/src/github.com/kr/text/doc.go |      3 -
 .../_workspace/src/github.com/kr/text/indent.go |     74 -
 .../src/github.com/kr/text/indent_test.go       |    119 -
 .../_workspace/src/github.com/kr/text/mc/Readme |      9 -
 .../_workspace/src/github.com/kr/text/mc/mc.go  |     62 -
 .../_workspace/src/github.com/kr/text/wrap.go   |     86 -
 .../src/github.com/kr/text/wrap_test.go         |     44 -
 .../github.com/magiconair/properties/.gitignore |      2 -
 .../magiconair/properties/.travis.yml           |      5 -
 .../github.com/magiconair/properties/LICENSE    |     25 -
 .../github.com/magiconair/properties/README.md  |    121 -
 .../magiconair/properties/benchmark_test.go     |     22 -
 .../src/github.com/magiconair/properties/doc.go |    135 -
 .../magiconair/properties/example_test.go       |     93 -
 .../src/github.com/magiconair/properties/lex.go |    409 -
 .../github.com/magiconair/properties/load.go    |    124 -
 .../magiconair/properties/load_test.go          |    137 -
 .../github.com/magiconair/properties/parser.go  |     95 -
 .../magiconair/properties/properties.go         |    698 -
 .../magiconair/properties/properties_test.go    |    846 -
 .../magiconair/properties/rangecheck.go         |     31 -
 .../src/github.com/mattn/go-sqlite3/.gitignore  |      3 -
 .../src/github.com/mattn/go-sqlite3/.travis.yml |      9 -
 .../src/github.com/mattn/go-sqlite3/LICENSE     |     21 -
 .../src/github.com/mattn/go-sqlite3/README.md   |     62 -
 .../src/github.com/mattn/go-sqlite3/backup.go   |     70 -
 .../src/github.com/mattn/go-sqlite3/doc.go      |     95 -
 .../src/github.com/mattn/go-sqlite3/error.go    |    128 -
 .../github.com/mattn/go-sqlite3/error_test.go   |    242 -
 .../mattn/go-sqlite3/sqlite3-binding.c          | 147782 ----------------
 .../mattn/go-sqlite3/sqlite3-binding.h          |   7478 -
 .../src/github.com/mattn/go-sqlite3/sqlite3.go  |    675 -
 .../mattn/go-sqlite3/sqlite3_fts3_test.go       |     83 -
 .../mattn/go-sqlite3/sqlite3_other.go           |     13 -
 .../github.com/mattn/go-sqlite3/sqlite3_test.go |   1058 -
 .../mattn/go-sqlite3/sqlite3_test/sqltest.go    |    412 -
 .../mattn/go-sqlite3/sqlite3_windows.go         |     14 -
 .../github.com/mattn/go-sqlite3/sqlite3ext.h    |    487 -
 .../mitchellh/mapstructure/.travis.yml          |      7 -
 .../github.com/mitchellh/mapstructure/LICENSE   |     21 -
 .../github.com/mitchellh/mapstructure/README.md |     46 -
 .../mitchellh/mapstructure/decode_hooks.go      |    151 -
 .../mitchellh/mapstructure/decode_hooks_test.go |    229 -
 .../github.com/mitchellh/mapstructure/error.go  |     50 -
 .../mitchellh/mapstructure/mapstructure.go      |    745 -
 .../mapstructure/mapstructure_benchmark_test.go |    243 -
 .../mapstructure/mapstructure_bugs_test.go      |     47 -
 .../mapstructure/mapstructure_examples_test.go  |    203 -
 .../mitchellh/mapstructure/mapstructure_test.go |    999 -
 .../src/github.com/spf13/cast/.gitignore        |     23 -
 .../src/github.com/spf13/cast/LICENSE           |     21 -
 .../src/github.com/spf13/cast/README.md         |     72 -
 .../src/github.com/spf13/cast/cast.go           |     68 -
 .../src/github.com/spf13/cast/cast_test.go      |    117 -
 .../src/github.com/spf13/cast/caste.go          |    378 -
 .../src/github.com/spf13/cobra/.gitignore       |     24 -
 .../src/github.com/spf13/cobra/.travis.yml      |      8 -
 .../src/github.com/spf13/cobra/LICENSE.txt      |    174 -
 .../src/github.com/spf13/cobra/README.md        |    485 -
 .../github.com/spf13/cobra/bash_completions.go  |    370 -
 .../github.com/spf13/cobra/bash_completions.md  |    149 -
 .../spf13/cobra/bash_completions_test.go        |     80 -
 .../src/github.com/spf13/cobra/cobra.go         |    112 -
 .../src/github.com/spf13/cobra/cobra_test.go    |    965 -
 .../src/github.com/spf13/cobra/command.go       |   1032 -
 .../src/github.com/spf13/cobra/command_test.go  |     90 -
 .../src/github.com/spf13/cobra/md_docs.go       |    138 -
 .../src/github.com/spf13/cobra/md_docs.md       |     81 -
 .../src/github.com/spf13/cobra/md_docs_test.go  |     67 -
 .../spf13/jwalterweatherman/.gitignore          |     22 -
 .../github.com/spf13/jwalterweatherman/LICENSE  |     21 -
 .../spf13/jwalterweatherman/README.md           |    158 -
 .../spf13/jwalterweatherman/jww_test.go         |     56 -
 .../thatswhyyoualwaysleaveanote.go              |    183 -
 .../src/github.com/spf13/pflag/.travis.yml      |      8 -
 .../src/github.com/spf13/pflag/LICENSE          |     28 -
 .../src/github.com/spf13/pflag/README.md        |    228 -
 .../src/github.com/spf13/pflag/bool.go          |     97 -
 .../src/github.com/spf13/pflag/bool_test.go     |    180 -
 .../src/github.com/spf13/pflag/duration.go      |     86 -
 .../src/github.com/spf13/pflag/example_test.go  |     77 -
 .../src/github.com/spf13/pflag/export_test.go   |     29 -
 .../src/github.com/spf13/pflag/flag.go          |    749 -
 .../src/github.com/spf13/pflag/flag_test.go     |    755 -
 .../src/github.com/spf13/pflag/float32.go       |     91 -
 .../src/github.com/spf13/pflag/float64.go       |     87 -
 .../src/github.com/spf13/pflag/int.go           |     87 -
 .../src/github.com/spf13/pflag/int32.go         |     91 -
 .../src/github.com/spf13/pflag/int64.go         |     87 -
 .../src/github.com/spf13/pflag/int8.go          |     91 -
 .../src/github.com/spf13/pflag/int_slice.go     |    113 -
 .../github.com/spf13/pflag/int_slice_test.go    |     49 -
 .../_workspace/src/github.com/spf13/pflag/ip.go |     93 -
 .../src/github.com/spf13/pflag/ipmask.go        |    122 -
 .../src/github.com/spf13/pflag/string.go        |     82 -
 .../src/github.com/spf13/pflag/string_slice.go  |     86 -
 .../github.com/spf13/pflag/string_slice_test.go |     44 -
 .../src/github.com/spf13/pflag/uint.go          |     91 -
 .../src/github.com/spf13/pflag/uint16.go        |     89 -
 .../src/github.com/spf13/pflag/uint32.go        |     89 -
 .../src/github.com/spf13/pflag/uint64.go        |     91 -
 .../src/github.com/spf13/pflag/uint8.go         |     91 -
 .../src/github.com/spf13/viper/.gitignore       |     23 -
 .../src/github.com/spf13/viper/.travis.yml      |      8 -
 .../src/github.com/spf13/viper/LICENSE          |     21 -
 .../src/github.com/spf13/viper/README.md        |    445 -
 .../src/github.com/spf13/viper/remote/remote.go |     77 -
 .../src/github.com/spf13/viper/util.go          |    198 -
 .../src/github.com/spf13/viper/viper.go         |    982 -
 .../src/github.com/spf13/viper/viper_test.go    |    559 -
 Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE  |    188 -
 .../src/gopkg.in/yaml.v2/LICENSE.libyaml        |     31 -
 .../_workspace/src/gopkg.in/yaml.v2/README.md   |    128 -
 Godeps/_workspace/src/gopkg.in/yaml.v2/apic.go  |    742 -
 .../_workspace/src/gopkg.in/yaml.v2/decode.go   |    683 -
 .../src/gopkg.in/yaml.v2/decode_test.go         |    966 -
 .../_workspace/src/gopkg.in/yaml.v2/emitterc.go |   1685 -
 .../_workspace/src/gopkg.in/yaml.v2/encode.go   |    306 -
 .../src/gopkg.in/yaml.v2/encode_test.go         |    495 -
 .../_workspace/src/gopkg.in/yaml.v2/parserc.go  |   1096 -
 .../_workspace/src/gopkg.in/yaml.v2/readerc.go  |    391 -
 .../_workspace/src/gopkg.in/yaml.v2/resolve.go  |    203 -
 .../_workspace/src/gopkg.in/yaml.v2/scannerc.go |   2710 -
 .../_workspace/src/gopkg.in/yaml.v2/sorter.go   |    104 -
 .../src/gopkg.in/yaml.v2/suite_test.go          |     12 -
 .../_workspace/src/gopkg.in/yaml.v2/writerc.go  |     89 -
 Godeps/_workspace/src/gopkg.in/yaml.v2/yaml.go  |    344 -
 Godeps/_workspace/src/gopkg.in/yaml.v2/yamlh.go |    716 -
 .../src/gopkg.in/yaml.v2/yamlprivateh.go        |    173 -
 LICENSE                                         |    202 -
 README.md                                       |      3 -
 cli/build.go                                    |    222 -
 cli/clutch.go                                   |   1002 -
 cli/compiler.go                                 |    619 -
 cli/deps.go                                     |    239 -
 cli/downloader.go                               |     90 -
 cli/egg.go                                      |    775 -
 cli/nest.go                                     |    467 -
 cli/project.go                                  |    484 -
 cli/remotenest.go                               |    121 -
 cli/target.go                                   |    806 -
 cli/util.go                                     |    357 -
 coding_style.txt                                |     57 -
 design.txt                                      |    370 -
 newt.go                                         |   1395 -
 newt/Godeps/Godeps.json                         |     70 +
 newt/Godeps/Readme                              |      5 +
 newt/Godeps/_workspace/.gitignore               |      2 +
 .../src/github.com/BurntSushi/toml/.gitignore   |      5 +
 .../src/github.com/BurntSushi/toml/.travis.yml  |     12 +
 .../src/github.com/BurntSushi/toml/COMPATIBLE   |      3 +
 .../src/github.com/BurntSushi/toml/COPYING      |     14 +
 .../src/github.com/BurntSushi/toml/Makefile     |     19 +
 .../src/github.com/BurntSushi/toml/README.md    |    220 +
 .../toml/cmd/toml-test-decoder/COPYING          |     14 +
 .../toml/cmd/toml-test-decoder/README.md        |     14 +
 .../toml/cmd/toml-test-decoder/main.go          |     90 +
 .../toml/cmd/toml-test-encoder/COPYING          |     14 +
 .../toml/cmd/toml-test-encoder/README.md        |     14 +
 .../toml/cmd/toml-test-encoder/main.go          |    131 +
 .../BurntSushi/toml/cmd/tomlv/COPYING           |     14 +
 .../BurntSushi/toml/cmd/tomlv/README.md         |     22 +
 .../BurntSushi/toml/cmd/tomlv/main.go           |     61 +
 .../src/github.com/BurntSushi/toml/decode.go    |    492 +
 .../github.com/BurntSushi/toml/decode_meta.go   |    122 +
 .../github.com/BurntSushi/toml/decode_test.go   |    950 +
 .../src/github.com/BurntSushi/toml/doc.go       |     27 +
 .../src/github.com/BurntSushi/toml/encode.go    |    551 +
 .../github.com/BurntSushi/toml/encode_test.go   |    542 +
 .../BurntSushi/toml/encoding_types.go           |     19 +
 .../BurntSushi/toml/encoding_types_1.1.go       |     18 +
 .../src/github.com/BurntSushi/toml/lex.go       |    874 +
 .../src/github.com/BurntSushi/toml/parse.go     |    498 +
 .../src/github.com/BurntSushi/toml/session.vim  |      1 +
 .../github.com/BurntSushi/toml/type_check.go    |     91 +
 .../github.com/BurntSushi/toml/type_fields.go   |    241 +
 .../src/github.com/andelf/go-curl/.gitignore    |      4 +
 .../src/github.com/andelf/go-curl/.travis.yml   |     15 +
 .../src/github.com/andelf/go-curl/LICENSE       |     13 +
 .../src/github.com/andelf/go-curl/README.md     |     73 +
 .../src/github.com/andelf/go-curl/c-callback.c  |     68 +
 .../src/github.com/andelf/go-curl/callback.go   |     90 +
 .../src/github.com/andelf/go-curl/callback.h    |      6 +
 .../src/github.com/andelf/go-curl/compat.h      |    380 +
 .../src/github.com/andelf/go-curl/const.go      |    179 +
 .../src/github.com/andelf/go-curl/const_gen.go  |    410 +
 .../src/github.com/andelf/go-curl/core.go       |    118 +
 .../src/github.com/andelf/go-curl/core_test.go  |     23 +
 .../src/github.com/andelf/go-curl/easy.go       |    495 +
 .../src/github.com/andelf/go-curl/easy_test.go  |     61 +
 .../andelf/go-curl/examples/channal_callback.go |     47 +
 .../andelf/go-curl/examples/ftpget.go           |     37 +
 .../github.com/andelf/go-curl/examples/https.go |     17 +
 .../github.com/andelf/go-curl/examples/misc.go  |    104 +
 .../andelf/go-curl/examples/multi_and_select.go |    101 +
 .../andelf/go-curl/examples/multi_sample.go     |     36 +
 .../andelf/go-curl/examples/post-callback.go    |     43 +
 .../andelf/go-curl/examples/progress.go         |     47 +
 .../andelf/go-curl/examples/renren_login.go     |     36 +
 .../andelf/go-curl/examples/renren_upload.go    |     77 +
 .../andelf/go-curl/examples/sendrecv.go         |     44 +
 .../andelf/go-curl/examples/sepheaders.go       |     49 +
 .../andelf/go-curl/examples/simple.go           |     14 +
 .../src/github.com/andelf/go-curl/logging.go    |     56 +
 .../github.com/andelf/go-curl/logging_test.go   |     64 +
 .../github.com/andelf/go-curl/misc/codegen.py   |     88 +
 .../github.com/andelf/go-curl/misc/compatgen.py |    162 +
 .../src/github.com/andelf/go-curl/multi.go      |    154 +
 .../src/github.com/andelf/go-curl/share.go      |     62 +
 .../github.com/hashicorp/logutils/.gitignore    |     22 +
 .../src/github.com/hashicorp/logutils/LICENSE   |    354 +
 .../src/github.com/hashicorp/logutils/README.md |     36 +
 .../src/github.com/hashicorp/logutils/level.go  |     81 +
 .../hashicorp/logutils/level_benchmark_test.go  |     37 +
 .../github.com/hashicorp/logutils/level_test.go |     94 +
 .../inconshreveable/mousetrap/LICENSE           |     13 +
 .../inconshreveable/mousetrap/README.md         |     23 +
 .../inconshreveable/mousetrap/trap_others.go    |     15 +
 .../inconshreveable/mousetrap/trap_windows.go   |     98 +
 .../mousetrap/trap_windows_1.4.go               |     46 +
 .../src/github.com/kr/pretty/.gitignore         |      4 +
 .../_workspace/src/github.com/kr/pretty/License |     21 +
 .../_workspace/src/github.com/kr/pretty/Readme  |      9 +
 .../_workspace/src/github.com/kr/pretty/diff.go |    158 +
 .../src/github.com/kr/pretty/diff_test.go       |     74 +
 .../src/github.com/kr/pretty/example_test.go    |     20 +
 .../src/github.com/kr/pretty/formatter.go       |    337 +
 .../src/github.com/kr/pretty/formatter_test.go  |    261 +
 .../src/github.com/kr/pretty/pretty.go          |     98 +
 .../_workspace/src/github.com/kr/pretty/zero.go |     41 +
 .../_workspace/src/github.com/kr/text/License   |     19 +
 .../_workspace/src/github.com/kr/text/Readme    |      3 +
 .../src/github.com/kr/text/colwriter/Readme     |      5 +
 .../src/github.com/kr/text/colwriter/column.go  |    147 +
 .../github.com/kr/text/colwriter/column_test.go |     90 +
 .../_workspace/src/github.com/kr/text/doc.go    |      3 +
 .../_workspace/src/github.com/kr/text/indent.go |     74 +
 .../src/github.com/kr/text/indent_test.go       |    119 +
 .../_workspace/src/github.com/kr/text/mc/Readme |      9 +
 .../_workspace/src/github.com/kr/text/mc/mc.go  |     62 +
 .../_workspace/src/github.com/kr/text/wrap.go   |     86 +
 .../src/github.com/kr/text/wrap_test.go         |     44 +
 .../github.com/magiconair/properties/.gitignore |      2 +
 .../magiconair/properties/.travis.yml           |      5 +
 .../github.com/magiconair/properties/LICENSE    |     25 +
 .../github.com/magiconair/properties/README.md  |    121 +
 .../magiconair/properties/benchmark_test.go     |     22 +
 .../src/github.com/magiconair/properties/doc.go |    135 +
 .../magiconair/properties/example_test.go       |     93 +
 .../src/github.com/magiconair/properties/lex.go |    409 +
 .../github.com/magiconair/properties/load.go    |    124 +
 .../magiconair/properties/load_test.go          |    137 +
 .../github.com/magiconair/properties/parser.go  |     95 +
 .../magiconair/properties/properties.go         |    698 +
 .../magiconair/properties/properties_test.go    |    846 +
 .../magiconair/properties/rangecheck.go         |     31 +
 .../src/github.com/mattn/go-sqlite3/.gitignore  |      3 +
 .../src/github.com/mattn/go-sqlite3/.travis.yml |      9 +
 .../src/github.com/mattn/go-sqlite3/LICENSE     |     21 +
 .../src/github.com/mattn/go-sqlite3/README.md   |     62 +
 .../src/github.com/mattn/go-sqlite3/backup.go   |     70 +
 .../src/github.com/mattn/go-sqlite3/doc.go      |     95 +
 .../src/github.com/mattn/go-sqlite3/error.go    |    128 +
 .../github.com/mattn/go-sqlite3/error_test.go   |    242 +
 .../mattn/go-sqlite3/sqlite3-binding.c          | 147782 ++++++++++++++++
 .../mattn/go-sqlite3/sqlite3-binding.h          |   7478 +
 .../src/github.com/mattn/go-sqlite3/sqlite3.go  |    675 +
 .../mattn/go-sqlite3/sqlite3_fts3_test.go       |     83 +
 .../mattn/go-sqlite3/sqlite3_other.go           |     13 +
 .../github.com/mattn/go-sqlite3/sqlite3_test.go |   1058 +
 .../mattn/go-sqlite3/sqlite3_test/sqltest.go    |    412 +
 .../mattn/go-sqlite3/sqlite3_windows.go         |     14 +
 .../github.com/mattn/go-sqlite3/sqlite3ext.h    |    487 +
 .../mitchellh/mapstructure/.travis.yml          |      7 +
 .../github.com/mitchellh/mapstructure/LICENSE   |     21 +
 .../github.com/mitchellh/mapstructure/README.md |     46 +
 .../mitchellh/mapstructure/decode_hooks.go      |    151 +
 .../mitchellh/mapstructure/decode_hooks_test.go |    229 +
 .../github.com/mitchellh/mapstructure/error.go  |     50 +
 .../mitchellh/mapstructure/mapstructure.go      |    745 +
 .../mapstructure/mapstructure_benchmark_test.go |    243 +
 .../mapstructure/mapstructure_bugs_test.go      |     47 +
 .../mapstructure/mapstructure_examples_test.go  |    203 +
 .../mitchellh/mapstructure/mapstructure_test.go |    999 +
 .../src/github.com/spf13/cast/.gitignore        |     23 +
 .../src/github.com/spf13/cast/LICENSE           |     21 +
 .../src/github.com/spf13/cast/README.md         |     72 +
 .../src/github.com/spf13/cast/cast.go           |     68 +
 .../src/github.com/spf13/cast/cast_test.go      |    117 +
 .../src/github.com/spf13/cast/caste.go          |    378 +
 .../src/github.com/spf13/cobra/.gitignore       |     24 +
 .../src/github.com/spf13/cobra/.travis.yml      |      8 +
 .../src/github.com/spf13/cobra/LICENSE.txt      |    174 +
 .../src/github.com/spf13/cobra/README.md        |    485 +
 .../github.com/spf13/cobra/bash_completions.go  |    370 +
 .../github.com/spf13/cobra/bash_completions.md  |    149 +
 .../spf13/cobra/bash_completions_test.go        |     80 +
 .../src/github.com/spf13/cobra/cobra.go         |    112 +
 .../src/github.com/spf13/cobra/cobra_test.go    |    965 +
 .../src/github.com/spf13/cobra/command.go       |   1032 +
 .../src/github.com/spf13/cobra/command_test.go  |     90 +
 .../src/github.com/spf13/cobra/md_docs.go       |    138 +
 .../src/github.com/spf13/cobra/md_docs.md       |     81 +
 .../src/github.com/spf13/cobra/md_docs_test.go  |     67 +
 .../spf13/jwalterweatherman/.gitignore          |     22 +
 .../github.com/spf13/jwalterweatherman/LICENSE  |     21 +
 .../spf13/jwalterweatherman/README.md           |    158 +
 .../spf13/jwalterweatherman/jww_test.go         |     56 +
 .../thatswhyyoualwaysleaveanote.go              |    183 +
 .../src/github.com/spf13/pflag/.travis.yml      |      8 +
 .../src/github.com/spf13/pflag/LICENSE          |     28 +
 .../src/github.com/spf13/pflag/README.md        |    228 +
 .../src/github.com/spf13/pflag/bool.go          |     97 +
 .../src/github.com/spf13/pflag/bool_test.go     |    180 +
 .../src/github.com/spf13/pflag/duration.go      |     86 +
 .../src/github.com/spf13/pflag/example_test.go  |     77 +
 .../src/github.com/spf13/pflag/export_test.go   |     29 +
 .../src/github.com/spf13/pflag/flag.go          |    749 +
 .../src/github.com/spf13/pflag/flag_test.go     |    755 +
 .../src/github.com/spf13/pflag/float32.go       |     91 +
 .../src/github.com/spf13/pflag/float64.go       |     87 +
 .../src/github.com/spf13/pflag/int.go           |     87 +
 .../src/github.com/spf13/pflag/int32.go         |     91 +
 .../src/github.com/spf13/pflag/int64.go         |     87 +
 .../src/github.com/spf13/pflag/int8.go          |     91 +
 .../src/github.com/spf13/pflag/int_slice.go     |    113 +
 .../github.com/spf13/pflag/int_slice_test.go    |     49 +
 .../_workspace/src/github.com/spf13/pflag/ip.go |     93 +
 .../src/github.com/spf13/pflag/ipmask.go        |    122 +
 .../src/github.com/spf13/pflag/string.go        |     82 +
 .../src/github.com/spf13/pflag/string_slice.go  |     86 +
 .../github.com/spf13/pflag/string_slice_test.go |     44 +
 .../src/github.com/spf13/pflag/uint.go          |     91 +
 .../src/github.com/spf13/pflag/uint16.go        |     89 +
 .../src/github.com/spf13/pflag/uint32.go        |     89 +
 .../src/github.com/spf13/pflag/uint64.go        |     91 +
 .../src/github.com/spf13/pflag/uint8.go         |     91 +
 .../src/github.com/spf13/viper/.gitignore       |     23 +
 .../src/github.com/spf13/viper/.travis.yml      |      8 +
 .../src/github.com/spf13/viper/LICENSE          |     21 +
 .../src/github.com/spf13/viper/README.md        |    445 +
 .../src/github.com/spf13/viper/remote/remote.go |     77 +
 .../src/github.com/spf13/viper/util.go          |    198 +
 .../src/github.com/spf13/viper/viper.go         |    982 +
 .../src/github.com/spf13/viper/viper_test.go    |    559 +
 .../_workspace/src/gopkg.in/yaml.v2/LICENSE     |    188 +
 .../src/gopkg.in/yaml.v2/LICENSE.libyaml        |     31 +
 .../_workspace/src/gopkg.in/yaml.v2/README.md   |    128 +
 .../_workspace/src/gopkg.in/yaml.v2/apic.go     |    742 +
 .../_workspace/src/gopkg.in/yaml.v2/decode.go   |    683 +
 .../src/gopkg.in/yaml.v2/decode_test.go         |    966 +
 .../_workspace/src/gopkg.in/yaml.v2/emitterc.go |   1685 +
 .../_workspace/src/gopkg.in/yaml.v2/encode.go   |    306 +
 .../src/gopkg.in/yaml.v2/encode_test.go         |    495 +
 .../_workspace/src/gopkg.in/yaml.v2/parserc.go  |   1096 +
 .../_workspace/src/gopkg.in/yaml.v2/readerc.go  |    391 +
 .../_workspace/src/gopkg.in/yaml.v2/resolve.go  |    203 +
 .../_workspace/src/gopkg.in/yaml.v2/scannerc.go |   2710 +
 .../_workspace/src/gopkg.in/yaml.v2/sorter.go   |    104 +
 .../src/gopkg.in/yaml.v2/suite_test.go          |     12 +
 .../_workspace/src/gopkg.in/yaml.v2/writerc.go  |     89 +
 .../_workspace/src/gopkg.in/yaml.v2/yaml.go     |    344 +
 .../_workspace/src/gopkg.in/yaml.v2/yamlh.go    |    716 +
 .../src/gopkg.in/yaml.v2/yamlprivateh.go        |    173 +
 newt/LICENSE                                    |    202 +
 newt/README.md                                  |      3 +
 newt/cli/build.go                               |    222 +
 newt/cli/clutch.go                              |   1002 +
 newt/cli/compiler.go                            |    619 +
 newt/cli/deps.go                                |    239 +
 newt/cli/downloader.go                          |     90 +
 newt/cli/egg.go                                 |    775 +
 newt/cli/nest.go                                |    467 +
 newt/cli/project.go                             |    484 +
 newt/cli/remotenest.go                          |    121 +
 newt/cli/target.go                              |    806 +
 newt/cli/util.go                                |    357 +
 newt/coding_style.txt                           |     57 +
 newt/design.txt                                 |    370 +
 newt/newt.go                                    |   1395 +
 471 files changed, 204232 insertions(+), 204232 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 9dc5efc..40f7e1d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
 *.swp
 *.swo 
 tags
-newt
+newt/newt

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/Godeps.json
----------------------------------------------------------------------
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
deleted file mode 100644
index ff5e92a..0000000
--- a/Godeps/Godeps.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
-	"ImportPath": "github.com/mynewt/newt",
-	"GoVersion": "go1.4.2",
-	"Deps": [
-		{
-			"ImportPath": "github.com/BurntSushi/toml",
-			"Comment": "v0.1.0-21-g056c9bc",
-			"Rev": "056c9bc7be7190eaa7715723883caffa5f8fa3e4"
-		},
-		{
-			"ImportPath": "github.com/andelf/go-curl",
-			"Comment": "compatible-with-go-release.r60-63-gc965868",
-			"Rev": "c965868dde67fef2abe524c33f1661d9ad233fac"
-		},
-		{
-			"ImportPath": "github.com/hashicorp/logutils",
-			"Rev": "0dc08b1671f34c4250ce212759ebd880f743d883"
-		},
-		{
-			"ImportPath": "github.com/inconshreveable/mousetrap",
-			"Rev": "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
-		},
-		{
-			"ImportPath": "github.com/kr/pretty",
-			"Comment": "go.weekly.2011-12-22-27-ge6ac2fc",
-			"Rev": "e6ac2fc51e89a3249e82157fa0bb7a18ef9dd5bb"
-		},
-		{
-			"ImportPath": "github.com/kr/text",
-			"Rev": "e373e137fafd8abd480af49182dea0513914adb4"
-		},
-		{
-			"ImportPath": "github.com/magiconair/properties",
-			"Comment": "v1.5.3",
-			"Rev": "624009598839a9432bd97bb75552389422357723"
-		},
-		{
-			"ImportPath": "github.com/mattn/go-sqlite3",
-			"Rev": "542ae647f8601bafd96233961b150cae198e0295"
-		},
-		{
-			"ImportPath": "github.com/mitchellh/mapstructure",
-			"Rev": "2caf8efc93669b6c43e0441cdc6aed17546c96f3"
-		},
-		{
-			"ImportPath": "github.com/spf13/cast",
-			"Rev": "4d07383ffe94b5e5a6fa3af9211374a4507a0184"
-		},
-		{
-			"ImportPath": "github.com/spf13/cobra",
-			"Rev": "66816bcd0378e248c613e3c443c020f544c28804"
-		},
-		{
-			"ImportPath": "github.com/spf13/jwalterweatherman",
-			"Rev": "3d60171a64319ef63c78bd45bd60e6eab1e75f8b"
-		},
-		{
-			"ImportPath": "github.com/spf13/pflag",
-			"Rev": "67cbc198fd11dab704b214c1e629a97af392c085"
-		},
-		{
-			"ImportPath": "github.com/spf13/viper",
-			"Rev": "db7ff930a189b98d602179d9001d33345f42b8c7"
-		},
-		{
-			"ImportPath": "gopkg.in/yaml.v2",
-			"Rev": "c1cd2254a6dd314c9d73c338c12688c9325d85c6"
-		}
-	]
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/Readme
----------------------------------------------------------------------
diff --git a/Godeps/Readme b/Godeps/Readme
deleted file mode 100644
index 4cdaa53..0000000
--- a/Godeps/Readme
+++ /dev/null
@@ -1,5 +0,0 @@
-This directory tree is generated automatically by godep.
-
-Please do not edit.
-
-See https://github.com/tools/godep for more information.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/.gitignore b/Godeps/_workspace/.gitignore
deleted file mode 100644
index f037d68..0000000
--- a/Godeps/_workspace/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/pkg
-/bin

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/.gitignore b/Godeps/_workspace/src/github.com/BurntSushi/toml/.gitignore
deleted file mode 100644
index 0cd3800..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-TAGS
-tags
-.*.swp
-tomlcheck/tomlcheck
-toml.test

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/.travis.yml
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/.travis.yml b/Godeps/_workspace/src/github.com/BurntSushi/toml/.travis.yml
deleted file mode 100644
index 43caf6d..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/.travis.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-language: go
-go:
-  - 1.1
-  - 1.2
-  - tip
-install:
-  - go install ./...
-  - go get github.com/BurntSushi/toml-test
-script:
-  - export PATH="$PATH:$HOME/gopath/bin"
-  - make test
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/COMPATIBLE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/COMPATIBLE b/Godeps/_workspace/src/github.com/BurntSushi/toml/COMPATIBLE
deleted file mode 100644
index 21e0938..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/COMPATIBLE
+++ /dev/null
@@ -1,3 +0,0 @@
-Compatible with TOML version
-[v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md)
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/COPYING
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/COPYING b/Godeps/_workspace/src/github.com/BurntSushi/toml/COPYING
deleted file mode 100644
index 5a8e332..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/COPYING
+++ /dev/null
@@ -1,14 +0,0 @@
-            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-                    Version 2, December 2004
-
- Copyright (C) 2004 Sam Hocevar <sa...@hocevar.net>
-
- Everyone is permitted to copy and distribute verbatim or modified
- copies of this license document, and changing it is allowed as long
- as the name is changed.
-
-            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. You just DO WHAT THE FUCK YOU WANT TO.
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/Makefile
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/Makefile b/Godeps/_workspace/src/github.com/BurntSushi/toml/Makefile
deleted file mode 100644
index 3600848..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-install:
-	go install ./...
-
-test: install
-	go test -v
-	toml-test toml-test-decoder
-	toml-test -encoder toml-test-encoder
-
-fmt:
-	gofmt -w *.go */*.go
-	colcheck *.go */*.go
-
-tags:
-	find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS
-
-push:
-	git push origin master
-	git push github master
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/README.md b/Godeps/_workspace/src/github.com/BurntSushi/toml/README.md
deleted file mode 100644
index 5a5df63..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/README.md
+++ /dev/null
@@ -1,220 +0,0 @@
-## TOML parser and encoder for Go with reflection
-
-TOML stands for Tom's Obvious, Minimal Language. This Go package provides a
-reflection interface similar to Go's standard library `json` and `xml` 
-packages. This package also supports the `encoding.TextUnmarshaler` and
-`encoding.TextMarshaler` interfaces so that you can define custom data 
-representations. (There is an example of this below.)
-
-Spec: https://github.com/mojombo/toml
-
-Compatible with TOML version
-[v0.2.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.2.0.md)
-
-Documentation: http://godoc.org/github.com/BurntSushi/toml
-
-Installation:
-
-```bash
-go get github.com/BurntSushi/toml
-```
-
-Try the toml validator:
-
-```bash
-go get github.com/BurntSushi/toml/cmd/tomlv
-tomlv some-toml-file.toml
-```
-
-[![Build status](https://api.travis-ci.org/BurntSushi/toml.png)](https://travis-ci.org/BurntSushi/toml)
-
-
-### Testing
-
-This package passes all tests in
-[toml-test](https://github.com/BurntSushi/toml-test) for both the decoder
-and the encoder.
-
-### Examples
-
-This package works similarly to how the Go standard library handles `XML`
-and `JSON`. Namely, data is loaded into Go values via reflection.
-
-For the simplest example, consider some TOML file as just a list of keys
-and values:
-
-```toml
-Age = 25
-Cats = [ "Cauchy", "Plato" ]
-Pi = 3.14
-Perfection = [ 6, 28, 496, 8128 ]
-DOB = 1987-07-05T05:45:00Z
-```
-
-Which could be defined in Go as:
-
-```go
-type Config struct {
-  Age int
-  Cats []string
-  Pi float64
-  Perfection []int
-  DOB time.Time // requires `import time`
-}
-```
-
-And then decoded with:
-
-```go
-var conf Config
-if _, err := toml.Decode(tomlData, &conf); err != nil {
-  // handle error
-}
-```
-
-You can also use struct tags if your struct field name doesn't map to a TOML
-key value directly:
-
-```toml
-some_key_NAME = "wat"
-```
-
-```go
-type TOML struct {
-  ObscureKey string `toml:"some_key_NAME"`
-}
-```
-
-### Using the `encoding.TextUnmarshaler` interface
-
-Here's an example that automatically parses duration strings into 
-`time.Duration` values:
-
-```toml
-[[song]]
-name = "Thunder Road"
-duration = "4m49s"
-
-[[song]]
-name = "Stairway to Heaven"
-duration = "8m03s"
-```
-
-Which can be decoded with:
-
-```go
-type song struct {
-  Name     string
-  Duration duration
-}
-type songs struct {
-  Song []song
-}
-var favorites songs
-if _, err := toml.Decode(blob, &favorites); err != nil {
-  log.Fatal(err)
-}
-
-for _, s := range favorites.Song {
-  fmt.Printf("%s (%s)\n", s.Name, s.Duration)
-}
-```
-
-And you'll also need a `duration` type that satisfies the 
-`encoding.TextUnmarshaler` interface:
-
-```go
-type duration struct {
-	time.Duration
-}
-
-func (d *duration) UnmarshalText(text []byte) error {
-	var err error
-	d.Duration, err = time.ParseDuration(string(text))
-	return err
-}
-```
-
-### More complex usage
-
-Here's an example of how to load the example from the official spec page:
-
-```toml
-# This is a TOML document. Boom.
-
-title = "TOML Example"
-
-[owner]
-name = "Tom Preston-Werner"
-organization = "GitHub"
-bio = "GitHub Cofounder & CEO\nLikes tater tots and beer."
-dob = 1979-05-27T07:32:00Z # First class dates? Why not?
-
-[database]
-server = "192.168.1.1"
-ports = [ 8001, 8001, 8002 ]
-connection_max = 5000
-enabled = true
-
-[servers]
-
-  # You can indent as you please. Tabs or spaces. TOML don't care.
-  [servers.alpha]
-  ip = "10.0.0.1"
-  dc = "eqdc10"
-
-  [servers.beta]
-  ip = "10.0.0.2"
-  dc = "eqdc10"
-
-[clients]
-data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it
-
-# Line breaks are OK when inside arrays
-hosts = [
-  "alpha",
-  "omega"
-]
-```
-
-And the corresponding Go types are:
-
-```go
-type tomlConfig struct {
-	Title string
-	Owner ownerInfo
-	DB database `toml:"database"`
-	Servers map[string]server
-	Clients clients
-}
-
-type ownerInfo struct {
-	Name string
-	Org string `toml:"organization"`
-	Bio string
-	DOB time.Time
-}
-
-type database struct {
-	Server string
-	Ports []int
-	ConnMax int `toml:"connection_max"`
-	Enabled bool
-}
-
-type server struct {
-	IP string
-	DC string
-}
-
-type clients struct {
-	Data [][]interface{}
-	Hosts []string
-}
-```
-
-Note that a case insensitive match will be tried if an exact match can't be
-found.
-
-A working example of the above can be found in `_examples/example.{go,toml}`.
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING b/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING
deleted file mode 100644
index 5a8e332..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING
+++ /dev/null
@@ -1,14 +0,0 @@
-            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-                    Version 2, December 2004
-
- Copyright (C) 2004 Sam Hocevar <sa...@hocevar.net>
-
- Everyone is permitted to copy and distribute verbatim or modified
- copies of this license document, and changing it is allowed as long
- as the name is changed.
-
-            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. You just DO WHAT THE FUCK YOU WANT TO.
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/README.md b/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/README.md
deleted file mode 100644
index 24421eb..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# Implements the TOML test suite interface
-
-This is an implementation of the interface expected by
-[toml-test](https://github.com/BurntSushi/toml-test) for my
-[toml parser written in Go](https://github.com/BurntSushi/toml).
-In particular, it maps TOML data on `stdin` to a JSON format on `stdout`.
-
-
-Compatible with TOML version
-[v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md)
-
-Compatible with `toml-test` version
-[v0.2.0](https://github.com/BurntSushi/toml-test/tree/v0.2.0)
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go
deleted file mode 100644
index 14e7557..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go
+++ /dev/null
@@ -1,90 +0,0 @@
-// Command toml-test-decoder satisfies the toml-test interface for testing
-// TOML decoders. Namely, it accepts TOML on stdin and outputs JSON on stdout.
-package main
-
-import (
-	"encoding/json"
-	"flag"
-	"fmt"
-	"log"
-	"os"
-	"path"
-	"time"
-
-	"github.com/BurntSushi/toml"
-)
-
-func init() {
-	log.SetFlags(0)
-
-	flag.Usage = usage
-	flag.Parse()
-}
-
-func usage() {
-	log.Printf("Usage: %s < toml-file\n", path.Base(os.Args[0]))
-	flag.PrintDefaults()
-
-	os.Exit(1)
-}
-
-func main() {
-	if flag.NArg() != 0 {
-		flag.Usage()
-	}
-
-	var tmp interface{}
-	if _, err := toml.DecodeReader(os.Stdin, &tmp); err != nil {
-		log.Fatalf("Error decoding TOML: %s", err)
-	}
-
-	typedTmp := translate(tmp)
-	if err := json.NewEncoder(os.Stdout).Encode(typedTmp); err != nil {
-		log.Fatalf("Error encoding JSON: %s", err)
-	}
-}
-
-func translate(tomlData interface{}) interface{} {
-	switch orig := tomlData.(type) {
-	case map[string]interface{}:
-		typed := make(map[string]interface{}, len(orig))
-		for k, v := range orig {
-			typed[k] = translate(v)
-		}
-		return typed
-	case []map[string]interface{}:
-		typed := make([]map[string]interface{}, len(orig))
-		for i, v := range orig {
-			typed[i] = translate(v).(map[string]interface{})
-		}
-		return typed
-	case []interface{}:
-		typed := make([]interface{}, len(orig))
-		for i, v := range orig {
-			typed[i] = translate(v)
-		}
-
-		// We don't really need to tag arrays, but let's be future proof.
-		// (If TOML ever supports tuples, we'll need this.)
-		return tag("array", typed)
-	case time.Time:
-		return tag("datetime", orig.Format("2006-01-02T15:04:05Z"))
-	case bool:
-		return tag("bool", fmt.Sprintf("%v", orig))
-	case int64:
-		return tag("integer", fmt.Sprintf("%d", orig))
-	case float64:
-		return tag("float", fmt.Sprintf("%v", orig))
-	case string:
-		return tag("string", orig)
-	}
-
-	panic(fmt.Sprintf("Unknown type: %T", tomlData))
-}
-
-func tag(typeName string, data interface{}) map[string]interface{} {
-	return map[string]interface{}{
-		"type":  typeName,
-		"value": data,
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING b/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING
deleted file mode 100644
index 5a8e332..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING
+++ /dev/null
@@ -1,14 +0,0 @@
-            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-                    Version 2, December 2004
-
- Copyright (C) 2004 Sam Hocevar <sa...@hocevar.net>
-
- Everyone is permitted to copy and distribute verbatim or modified
- copies of this license document, and changing it is allowed as long
- as the name is changed.
-
-            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. You just DO WHAT THE FUCK YOU WANT TO.
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/README.md b/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/README.md
deleted file mode 100644
index 45a603f..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# Implements the TOML test suite interface for TOML encoders
-
-This is an implementation of the interface expected by
-[toml-test](https://github.com/BurntSushi/toml-test) for the
-[TOML encoder](https://github.com/BurntSushi/toml).
-In particular, it maps JSON data on `stdin` to a TOML format on `stdout`.
-
-
-Compatible with TOML version
-[v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md)
-
-Compatible with `toml-test` version
-[v0.2.0](https://github.com/BurntSushi/toml-test/tree/v0.2.0)
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go
deleted file mode 100644
index 092cc68..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go
+++ /dev/null
@@ -1,131 +0,0 @@
-// Command toml-test-encoder satisfies the toml-test interface for testing
-// TOML encoders. Namely, it accepts JSON on stdin and outputs TOML on stdout.
-package main
-
-import (
-	"encoding/json"
-	"flag"
-	"log"
-	"os"
-	"path"
-	"strconv"
-	"time"
-
-	"github.com/BurntSushi/toml"
-)
-
-func init() {
-	log.SetFlags(0)
-
-	flag.Usage = usage
-	flag.Parse()
-}
-
-func usage() {
-	log.Printf("Usage: %s < json-file\n", path.Base(os.Args[0]))
-	flag.PrintDefaults()
-
-	os.Exit(1)
-}
-
-func main() {
-	if flag.NArg() != 0 {
-		flag.Usage()
-	}
-
-	var tmp interface{}
-	if err := json.NewDecoder(os.Stdin).Decode(&tmp); err != nil {
-		log.Fatalf("Error decoding JSON: %s", err)
-	}
-
-	tomlData := translate(tmp)
-	if err := toml.NewEncoder(os.Stdout).Encode(tomlData); err != nil {
-		log.Fatalf("Error encoding TOML: %s", err)
-	}
-}
-
-func translate(typedJson interface{}) interface{} {
-	switch v := typedJson.(type) {
-	case map[string]interface{}:
-		if len(v) == 2 && in("type", v) && in("value", v) {
-			return untag(v)
-		}
-		m := make(map[string]interface{}, len(v))
-		for k, v2 := range v {
-			m[k] = translate(v2)
-		}
-		return m
-	case []interface{}:
-		tabArray := make([]map[string]interface{}, len(v))
-		for i := range v {
-			if m, ok := translate(v[i]).(map[string]interface{}); ok {
-				tabArray[i] = m
-			} else {
-				log.Fatalf("JSON arrays may only contain objects. This " +
-					"corresponds to only tables being allowed in " +
-					"TOML table arrays.")
-			}
-		}
-		return tabArray
-	}
-	log.Fatalf("Unrecognized JSON format '%T'.", typedJson)
-	panic("unreachable")
-}
-
-func untag(typed map[string]interface{}) interface{} {
-	t := typed["type"].(string)
-	v := typed["value"]
-	switch t {
-	case "string":
-		return v.(string)
-	case "integer":
-		v := v.(string)
-		n, err := strconv.Atoi(v)
-		if err != nil {
-			log.Fatalf("Could not parse '%s' as integer: %s", v, err)
-		}
-		return n
-	case "float":
-		v := v.(string)
-		f, err := strconv.ParseFloat(v, 64)
-		if err != nil {
-			log.Fatalf("Could not parse '%s' as float64: %s", v, err)
-		}
-		return f
-	case "datetime":
-		v := v.(string)
-		t, err := time.Parse("2006-01-02T15:04:05Z", v)
-		if err != nil {
-			log.Fatalf("Could not parse '%s' as a datetime: %s", v, err)
-		}
-		return t
-	case "bool":
-		v := v.(string)
-		switch v {
-		case "true":
-			return true
-		case "false":
-			return false
-		}
-		log.Fatalf("Could not parse '%s' as a boolean.", v)
-	case "array":
-		v := v.([]interface{})
-		array := make([]interface{}, len(v))
-		for i := range v {
-			if m, ok := v[i].(map[string]interface{}); ok {
-				array[i] = untag(m)
-			} else {
-				log.Fatalf("Arrays may only contain other arrays or "+
-					"primitive values, but found a '%T'.", m)
-			}
-		}
-		return array
-	}
-	log.Fatalf("Unrecognized tag type '%s'.", t)
-	panic("unreachable")
-}
-
-func in(key string, m map[string]interface{}) bool {
-	_, ok := m[key]
-	return ok
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/COPYING
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/COPYING b/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/COPYING
deleted file mode 100644
index 5a8e332..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/COPYING
+++ /dev/null
@@ -1,14 +0,0 @@
-            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-                    Version 2, December 2004
-
- Copyright (C) 2004 Sam Hocevar <sa...@hocevar.net>
-
- Everyone is permitted to copy and distribute verbatim or modified
- copies of this license document, and changing it is allowed as long
- as the name is changed.
-
-            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. You just DO WHAT THE FUCK YOU WANT TO.
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/README.md b/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/README.md
deleted file mode 100644
index 5df0dc3..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# TOML Validator
-
-If Go is installed, it's simple to try it out:
-
-```bash
-go get github.com/BurntSushi/toml/cmd/tomlv
-tomlv some-toml-file.toml
-```
-
-You can see the types of every key in a TOML file with:
-
-```bash
-tomlv -types some-toml-file.toml
-```
-
-At the moment, only one error message is reported at a time. Error messages
-include line numbers. No output means that the files given are valid TOML, or 
-there is a bug in `tomlv`.
-
-Compatible with TOML version
-[v0.1.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.1.0.md)
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/main.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/main.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/main.go
deleted file mode 100644
index c7d689a..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/main.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// Command tomlv validates TOML documents and prints each key's type.
-package main
-
-import (
-	"flag"
-	"fmt"
-	"log"
-	"os"
-	"path"
-	"strings"
-	"text/tabwriter"
-
-	"github.com/BurntSushi/toml"
-)
-
-var (
-	flagTypes = false
-)
-
-func init() {
-	log.SetFlags(0)
-
-	flag.BoolVar(&flagTypes, "types", flagTypes,
-		"When set, the types of every defined key will be shown.")
-
-	flag.Usage = usage
-	flag.Parse()
-}
-
-func usage() {
-	log.Printf("Usage: %s toml-file [ toml-file ... ]\n",
-		path.Base(os.Args[0]))
-	flag.PrintDefaults()
-
-	os.Exit(1)
-}
-
-func main() {
-	if flag.NArg() < 1 {
-		flag.Usage()
-	}
-	for _, f := range flag.Args() {
-		var tmp interface{}
-		md, err := toml.DecodeFile(f, &tmp)
-		if err != nil {
-			log.Fatalf("Error in '%s': %s", f, err)
-		}
-		if flagTypes {
-			printTypes(md)
-		}
-	}
-}
-
-func printTypes(md toml.MetaData) {
-	tabw := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
-	for _, key := range md.Keys() {
-		fmt.Fprintf(tabw, "%s%s\t%s\n",
-			strings.Repeat("    ", len(key)-1), key, md.Type(key...))
-	}
-	tabw.Flush()
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/decode.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/decode.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/decode.go
deleted file mode 100644
index 6c7d398..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/decode.go
+++ /dev/null
@@ -1,492 +0,0 @@
-package toml
-
-import (
-	"fmt"
-	"io"
-	"io/ioutil"
-	"math"
-	"reflect"
-	"strings"
-	"time"
-)
-
-var e = fmt.Errorf
-
-// Unmarshaler is the interface implemented by objects that can unmarshal a
-// TOML description of themselves.
-type Unmarshaler interface {
-	UnmarshalTOML(interface{}) error
-}
-
-// Unmarshal decodes the contents of `p` in TOML format into a pointer `v`.
-func Unmarshal(p []byte, v interface{}) error {
-	_, err := Decode(string(p), v)
-	return err
-}
-
-// Primitive is a TOML value that hasn't been decoded into a Go value.
-// When using the various `Decode*` functions, the type `Primitive` may
-// be given to any value, and its decoding will be delayed.
-//
-// A `Primitive` value can be decoded using the `PrimitiveDecode` function.
-//
-// The underlying representation of a `Primitive` value is subject to change.
-// Do not rely on it.
-//
-// N.B. Primitive values are still parsed, so using them will only avoid
-// the overhead of reflection. They can be useful when you don't know the
-// exact type of TOML data until run time.
-type Primitive struct {
-	undecoded interface{}
-	context   Key
-}
-
-// DEPRECATED!
-//
-// Use MetaData.PrimitiveDecode instead.
-func PrimitiveDecode(primValue Primitive, v interface{}) error {
-	md := MetaData{decoded: make(map[string]bool)}
-	return md.unify(primValue.undecoded, rvalue(v))
-}
-
-// PrimitiveDecode is just like the other `Decode*` functions, except it
-// decodes a TOML value that has already been parsed. Valid primitive values
-// can *only* be obtained from values filled by the decoder functions,
-// including this method. (i.e., `v` may contain more `Primitive`
-// values.)
-//
-// Meta data for primitive values is included in the meta data returned by
-// the `Decode*` functions with one exception: keys returned by the Undecoded
-// method will only reflect keys that were decoded. Namely, any keys hidden
-// behind a Primitive will be considered undecoded. Executing this method will
-// update the undecoded keys in the meta data. (See the example.)
-func (md *MetaData) PrimitiveDecode(primValue Primitive, v interface{}) error {
-	md.context = primValue.context
-	defer func() { md.context = nil }()
-	return md.unify(primValue.undecoded, rvalue(v))
-}
-
-// Decode will decode the contents of `data` in TOML format into a pointer
-// `v`.
-//
-// TOML hashes correspond to Go structs or maps. (Dealer's choice. They can be
-// used interchangeably.)
-//
-// TOML arrays of tables correspond to either a slice of structs or a slice
-// of maps.
-//
-// TOML datetimes correspond to Go `time.Time` values.
-//
-// All other TOML types (float, string, int, bool and array) correspond
-// to the obvious Go types.
-//
-// An exception to the above rules is if a type implements the
-// encoding.TextUnmarshaler interface. In this case, any primitive TOML value
-// (floats, strings, integers, booleans and datetimes) will be converted to
-// a byte string and given to the value's UnmarshalText method. See the
-// Unmarshaler example for a demonstration with time duration strings.
-//
-// Key mapping
-//
-// TOML keys can map to either keys in a Go map or field names in a Go
-// struct. The special `toml` struct tag may be used to map TOML keys to
-// struct fields that don't match the key name exactly. (See the example.)
-// A case insensitive match to struct names will be tried if an exact match
-// can't be found.
-//
-// The mapping between TOML values and Go values is loose. That is, there
-// may exist TOML values that cannot be placed into your representation, and
-// there may be parts of your representation that do not correspond to
-// TOML values. This loose mapping can be made stricter by using the IsDefined
-// and/or Undecoded methods on the MetaData returned.
-//
-// This decoder will not handle cyclic types. If a cyclic type is passed,
-// `Decode` will not terminate.
-func Decode(data string, v interface{}) (MetaData, error) {
-	p, err := parse(data)
-	if err != nil {
-		return MetaData{}, err
-	}
-	md := MetaData{
-		p.mapping, p.types, p.ordered,
-		make(map[string]bool, len(p.ordered)), nil,
-	}
-	return md, md.unify(p.mapping, rvalue(v))
-}
-
-// DecodeFile is just like Decode, except it will automatically read the
-// contents of the file at `fpath` and decode it for you.
-func DecodeFile(fpath string, v interface{}) (MetaData, error) {
-	bs, err := ioutil.ReadFile(fpath)
-	if err != nil {
-		return MetaData{}, err
-	}
-	return Decode(string(bs), v)
-}
-
-// DecodeReader is just like Decode, except it will consume all bytes
-// from the reader and decode it for you.
-func DecodeReader(r io.Reader, v interface{}) (MetaData, error) {
-	bs, err := ioutil.ReadAll(r)
-	if err != nil {
-		return MetaData{}, err
-	}
-	return Decode(string(bs), v)
-}
-
-// unify performs a sort of type unification based on the structure of `rv`,
-// which is the client representation.
-//
-// Any type mismatch produces an error. Finding a type that we don't know
-// how to handle produces an unsupported type error.
-func (md *MetaData) unify(data interface{}, rv reflect.Value) error {
-
-	// Special case. Look for a `Primitive` value.
-	if rv.Type() == reflect.TypeOf((*Primitive)(nil)).Elem() {
-		// Save the undecoded data and the key context into the primitive
-		// value.
-		context := make(Key, len(md.context))
-		copy(context, md.context)
-		rv.Set(reflect.ValueOf(Primitive{
-			undecoded: data,
-			context:   context,
-		}))
-		return nil
-	}
-
-	// Special case. Unmarshaler Interface support.
-	if rv.CanAddr() {
-		if v, ok := rv.Addr().Interface().(Unmarshaler); ok {
-			return v.UnmarshalTOML(data)
-		}
-	}
-
-	// Special case. Handle time.Time values specifically.
-	// TODO: Remove this code when we decide to drop support for Go 1.1.
-	// This isn't necessary in Go 1.2 because time.Time satisfies the encoding
-	// interfaces.
-	if rv.Type().AssignableTo(rvalue(time.Time{}).Type()) {
-		return md.unifyDatetime(data, rv)
-	}
-
-	// Special case. Look for a value satisfying the TextUnmarshaler interface.
-	if v, ok := rv.Interface().(TextUnmarshaler); ok {
-		return md.unifyText(data, v)
-	}
-	// BUG(burntsushi)
-	// The behavior here is incorrect whenever a Go type satisfies the
-	// encoding.TextUnmarshaler interface but also corresponds to a TOML
-	// hash or array. In particular, the unmarshaler should only be applied
-	// to primitive TOML values. But at this point, it will be applied to
-	// all kinds of values and produce an incorrect error whenever those values
-	// are hashes or arrays (including arrays of tables).
-
-	k := rv.Kind()
-
-	// laziness
-	if k >= reflect.Int && k <= reflect.Uint64 {
-		return md.unifyInt(data, rv)
-	}
-	switch k {
-	case reflect.Ptr:
-		elem := reflect.New(rv.Type().Elem())
-		err := md.unify(data, reflect.Indirect(elem))
-		if err != nil {
-			return err
-		}
-		rv.Set(elem)
-		return nil
-	case reflect.Struct:
-		return md.unifyStruct(data, rv)
-	case reflect.Map:
-		return md.unifyMap(data, rv)
-	case reflect.Array:
-		return md.unifyArray(data, rv)
-	case reflect.Slice:
-		return md.unifySlice(data, rv)
-	case reflect.String:
-		return md.unifyString(data, rv)
-	case reflect.Bool:
-		return md.unifyBool(data, rv)
-	case reflect.Interface:
-		// we only support empty interfaces.
-		if rv.NumMethod() > 0 {
-			return e("Unsupported type '%s'.", rv.Kind())
-		}
-		return md.unifyAnything(data, rv)
-	case reflect.Float32:
-		fallthrough
-	case reflect.Float64:
-		return md.unifyFloat64(data, rv)
-	}
-	return e("Unsupported type '%s'.", rv.Kind())
-}
-
-func (md *MetaData) unifyStruct(mapping interface{}, rv reflect.Value) error {
-	tmap, ok := mapping.(map[string]interface{})
-	if !ok {
-		return mismatch(rv, "map", mapping)
-	}
-
-	for key, datum := range tmap {
-		var f *field
-		fields := cachedTypeFields(rv.Type())
-		for i := range fields {
-			ff := &fields[i]
-			if ff.name == key {
-				f = ff
-				break
-			}
-			if f == nil && strings.EqualFold(ff.name, key) {
-				f = ff
-			}
-		}
-		if f != nil {
-			subv := rv
-			for _, i := range f.index {
-				subv = indirect(subv.Field(i))
-			}
-			if isUnifiable(subv) {
-				md.decoded[md.context.add(key).String()] = true
-				md.context = append(md.context, key)
-				if err := md.unify(datum, subv); err != nil {
-					return e("Type mismatch for '%s.%s': %s",
-						rv.Type().String(), f.name, err)
-				}
-				md.context = md.context[0 : len(md.context)-1]
-			} else if f.name != "" {
-				// Bad user! No soup for you!
-				return e("Field '%s.%s' is unexported, and therefore cannot "+
-					"be loaded with reflection.", rv.Type().String(), f.name)
-			}
-		}
-	}
-	return nil
-}
-
-func (md *MetaData) unifyMap(mapping interface{}, rv reflect.Value) error {
-	tmap, ok := mapping.(map[string]interface{})
-	if !ok {
-		return badtype("map", mapping)
-	}
-	if rv.IsNil() {
-		rv.Set(reflect.MakeMap(rv.Type()))
-	}
-	for k, v := range tmap {
-		md.decoded[md.context.add(k).String()] = true
-		md.context = append(md.context, k)
-
-		rvkey := indirect(reflect.New(rv.Type().Key()))
-		rvval := reflect.Indirect(reflect.New(rv.Type().Elem()))
-		if err := md.unify(v, rvval); err != nil {
-			return err
-		}
-		md.context = md.context[0 : len(md.context)-1]
-
-		rvkey.SetString(k)
-		rv.SetMapIndex(rvkey, rvval)
-	}
-	return nil
-}
-
-func (md *MetaData) unifyArray(data interface{}, rv reflect.Value) error {
-	datav := reflect.ValueOf(data)
-	if datav.Kind() != reflect.Slice {
-		return badtype("slice", data)
-	}
-	sliceLen := datav.Len()
-	if sliceLen != rv.Len() {
-		return e("expected array length %d; got TOML array of length %d",
-			rv.Len(), sliceLen)
-	}
-	return md.unifySliceArray(datav, rv)
-}
-
-func (md *MetaData) unifySlice(data interface{}, rv reflect.Value) error {
-	datav := reflect.ValueOf(data)
-	if datav.Kind() != reflect.Slice {
-		return badtype("slice", data)
-	}
-	sliceLen := datav.Len()
-	if rv.IsNil() {
-		rv.Set(reflect.MakeSlice(rv.Type(), sliceLen, sliceLen))
-	}
-	return md.unifySliceArray(datav, rv)
-}
-
-func (md *MetaData) unifySliceArray(data, rv reflect.Value) error {
-	sliceLen := data.Len()
-	for i := 0; i < sliceLen; i++ {
-		v := data.Index(i).Interface()
-		sliceval := indirect(rv.Index(i))
-		if err := md.unify(v, sliceval); err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-func (md *MetaData) unifyDatetime(data interface{}, rv reflect.Value) error {
-	if _, ok := data.(time.Time); ok {
-		rv.Set(reflect.ValueOf(data))
-		return nil
-	}
-	return badtype("time.Time", data)
-}
-
-func (md *MetaData) unifyString(data interface{}, rv reflect.Value) error {
-	if s, ok := data.(string); ok {
-		rv.SetString(s)
-		return nil
-	}
-	return badtype("string", data)
-}
-
-func (md *MetaData) unifyFloat64(data interface{}, rv reflect.Value) error {
-	if num, ok := data.(float64); ok {
-		switch rv.Kind() {
-		case reflect.Float32:
-			fallthrough
-		case reflect.Float64:
-			rv.SetFloat(num)
-		default:
-			panic("bug")
-		}
-		return nil
-	}
-	return badtype("float", data)
-}
-
-func (md *MetaData) unifyInt(data interface{}, rv reflect.Value) error {
-	if num, ok := data.(int64); ok {
-		if rv.Kind() >= reflect.Int && rv.Kind() <= reflect.Int64 {
-			switch rv.Kind() {
-			case reflect.Int, reflect.Int64:
-				// No bounds checking necessary.
-			case reflect.Int8:
-				if num < math.MinInt8 || num > math.MaxInt8 {
-					return e("Value '%d' is out of range for int8.", num)
-				}
-			case reflect.Int16:
-				if num < math.MinInt16 || num > math.MaxInt16 {
-					return e("Value '%d' is out of range for int16.", num)
-				}
-			case reflect.Int32:
-				if num < math.MinInt32 || num > math.MaxInt32 {
-					return e("Value '%d' is out of range for int32.", num)
-				}
-			}
-			rv.SetInt(num)
-		} else if rv.Kind() >= reflect.Uint && rv.Kind() <= reflect.Uint64 {
-			unum := uint64(num)
-			switch rv.Kind() {
-			case reflect.Uint, reflect.Uint64:
-				// No bounds checking necessary.
-			case reflect.Uint8:
-				if num < 0 || unum > math.MaxUint8 {
-					return e("Value '%d' is out of range for uint8.", num)
-				}
-			case reflect.Uint16:
-				if num < 0 || unum > math.MaxUint16 {
-					return e("Value '%d' is out of range for uint16.", num)
-				}
-			case reflect.Uint32:
-				if num < 0 || unum > math.MaxUint32 {
-					return e("Value '%d' is out of range for uint32.", num)
-				}
-			}
-			rv.SetUint(unum)
-		} else {
-			panic("unreachable")
-		}
-		return nil
-	}
-	return badtype("integer", data)
-}
-
-func (md *MetaData) unifyBool(data interface{}, rv reflect.Value) error {
-	if b, ok := data.(bool); ok {
-		rv.SetBool(b)
-		return nil
-	}
-	return badtype("boolean", data)
-}
-
-func (md *MetaData) unifyAnything(data interface{}, rv reflect.Value) error {
-	rv.Set(reflect.ValueOf(data))
-	return nil
-}
-
-func (md *MetaData) unifyText(data interface{}, v TextUnmarshaler) error {
-	var s string
-	switch sdata := data.(type) {
-	case TextMarshaler:
-		text, err := sdata.MarshalText()
-		if err != nil {
-			return err
-		}
-		s = string(text)
-	case fmt.Stringer:
-		s = sdata.String()
-	case string:
-		s = sdata
-	case bool:
-		s = fmt.Sprintf("%v", sdata)
-	case int64:
-		s = fmt.Sprintf("%d", sdata)
-	case float64:
-		s = fmt.Sprintf("%f", sdata)
-	default:
-		return badtype("primitive (string-like)", data)
-	}
-	if err := v.UnmarshalText([]byte(s)); err != nil {
-		return err
-	}
-	return nil
-}
-
-// rvalue returns a reflect.Value of `v`. All pointers are resolved.
-func rvalue(v interface{}) reflect.Value {
-	return indirect(reflect.ValueOf(v))
-}
-
-// indirect returns the value pointed to by a pointer.
-// Pointers are followed until the value is not a pointer.
-// New values are allocated for each nil pointer.
-//
-// An exception to this rule is if the value satisfies an interface of
-// interest to us (like encoding.TextUnmarshaler).
-func indirect(v reflect.Value) reflect.Value {
-	if v.Kind() != reflect.Ptr {
-		if v.CanAddr() {
-			pv := v.Addr()
-			if _, ok := pv.Interface().(TextUnmarshaler); ok {
-				return pv
-			}
-		}
-		return v
-	}
-	if v.IsNil() {
-		v.Set(reflect.New(v.Type().Elem()))
-	}
-	return indirect(reflect.Indirect(v))
-}
-
-func isUnifiable(rv reflect.Value) bool {
-	if rv.CanSet() {
-		return true
-	}
-	if _, ok := rv.Interface().(TextUnmarshaler); ok {
-		return true
-	}
-	return false
-}
-
-func badtype(expected string, data interface{}) error {
-	return e("Expected %s but found '%T'.", expected, data)
-}
-
-func mismatch(user reflect.Value, expected string, data interface{}) error {
-	return e("Type mismatch for %s. Expected %s but found '%T'.",
-		user.Type().String(), expected, data)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_meta.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_meta.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_meta.go
deleted file mode 100644
index ef6f545..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_meta.go
+++ /dev/null
@@ -1,122 +0,0 @@
-package toml
-
-import "strings"
-
-// MetaData allows access to meta information about TOML data that may not
-// be inferrable via reflection. In particular, whether a key has been defined
-// and the TOML type of a key.
-type MetaData struct {
-	mapping map[string]interface{}
-	types   map[string]tomlType
-	keys    []Key
-	decoded map[string]bool
-	context Key // Used only during decoding.
-}
-
-// IsDefined returns true if the key given exists in the TOML data. The key
-// should be specified hierarchially. e.g.,
-//
-//	// access the TOML key 'a.b.c'
-//	IsDefined("a", "b", "c")
-//
-// IsDefined will return false if an empty key given. Keys are case sensitive.
-func (md *MetaData) IsDefined(key ...string) bool {
-	if len(key) == 0 {
-		return false
-	}
-
-	var hash map[string]interface{}
-	var ok bool
-	var hashOrVal interface{} = md.mapping
-	for _, k := range key {
-		if hash, ok = hashOrVal.(map[string]interface{}); !ok {
-			return false
-		}
-		if hashOrVal, ok = hash[k]; !ok {
-			return false
-		}
-	}
-	return true
-}
-
-// Type returns a string representation of the type of the key specified.
-//
-// Type will return the empty string if given an empty key or a key that
-// does not exist. Keys are case sensitive.
-func (md *MetaData) Type(key ...string) string {
-	fullkey := strings.Join(key, ".")
-	if typ, ok := md.types[fullkey]; ok {
-		return typ.typeString()
-	}
-	return ""
-}
-
-// Key is the type of any TOML key, including key groups. Use (MetaData).Keys
-// to get values of this type.
-type Key []string
-
-func (k Key) String() string {
-	return strings.Join(k, ".")
-}
-
-func (k Key) maybeQuotedAll() string {
-	var ss []string
-	for i := range k {
-		ss = append(ss, k.maybeQuoted(i))
-	}
-	return strings.Join(ss, ".")
-}
-
-func (k Key) maybeQuoted(i int) string {
-	quote := false
-	for _, c := range k[i] {
-		if !isBareKeyChar(c) {
-			quote = true
-			break
-		}
-	}
-	if quote {
-		return "\"" + strings.Replace(k[i], "\"", "\\\"", -1) + "\""
-	} else {
-		return k[i]
-	}
-}
-
-func (k Key) add(piece string) Key {
-	newKey := make(Key, len(k)+1)
-	copy(newKey, k)
-	newKey[len(k)] = piece
-	return newKey
-}
-
-// Keys returns a slice of every key in the TOML data, including key groups.
-// Each key is itself a slice, where the first element is the top of the
-// hierarchy and the last is the most specific.
-//
-// The list will have the same order as the keys appeared in the TOML data.
-//
-// All keys returned are non-empty.
-func (md *MetaData) Keys() []Key {
-	return md.keys
-}
-
-// Undecoded returns all keys that have not been decoded in the order in which
-// they appear in the original TOML document.
-//
-// This includes keys that haven't been decoded because of a Primitive value.
-// Once the Primitive value is decoded, the keys will be considered decoded.
-//
-// Also note that decoding into an empty interface will result in no decoding,
-// and so no keys will be considered decoded.
-//
-// In this sense, the Undecoded keys correspond to keys in the TOML document
-// that do not have a concrete type in your representation.
-func (md *MetaData) Undecoded() []Key {
-	undecoded := make([]Key, 0, len(md.keys))
-	for _, key := range md.keys {
-		if !md.decoded[key.String()] {
-			undecoded = append(undecoded, key)
-		}
-	}
-	return undecoded
-}


[33/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/README.md b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/README.md
deleted file mode 100644
index 659d688..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# mapstructure
-
-mapstructure is a Go library for decoding generic map values to structures
-and vice versa, while providing helpful error handling.
-
-This library is most useful when decoding values from some data stream (JSON,
-Gob, etc.) where you don't _quite_ know the structure of the underlying data
-until you read a part of it. You can therefore read a `map[string]interface{}`
-and use this library to decode it into the proper underlying native Go
-structure.
-
-## Installation
-
-Standard `go get`:
-
-```
-$ go get github.com/mitchellh/mapstructure
-```
-
-## Usage & Example
-
-For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/mapstructure).
-
-The `Decode` function has examples associated with it there.
-
-## But Why?!
-
-Go offers fantastic standard libraries for decoding formats such as JSON.
-The standard method is to have a struct pre-created, and populate that struct
-from the bytes of the encoded format. This is great, but the problem is if
-you have configuration or an encoding that changes slightly depending on
-specific fields. For example, consider this JSON:
-
-```json
-{
-  "type": "person",
-  "name": "Mitchell"
-}
-```
-
-Perhaps we can't populate a specific structure without first reading
-the "type" field from the JSON. We could always do two passes over the
-decoding of the JSON (reading the "type" first, and the rest later).
-However, it is much simpler to just decode this into a `map[string]interface{}`
-structure, read the "type" key, then use something like this library
-to decode it into the proper structure.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks.go b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks.go
deleted file mode 100644
index aa91f76..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks.go
+++ /dev/null
@@ -1,151 +0,0 @@
-package mapstructure
-
-import (
-	"errors"
-	"reflect"
-	"strconv"
-	"strings"
-	"time"
-)
-
-// typedDecodeHook takes a raw DecodeHookFunc (an interface{}) and turns
-// it into the proper DecodeHookFunc type, such as DecodeHookFuncType.
-func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc {
-	// Create variables here so we can reference them with the reflect pkg
-	var f1 DecodeHookFuncType
-	var f2 DecodeHookFuncKind
-
-	// Fill in the variables into this interface and the rest is done
-	// automatically using the reflect package.
-	potential := []interface{}{f1, f2}
-
-	v := reflect.ValueOf(h)
-	vt := v.Type()
-	for _, raw := range potential {
-		pt := reflect.ValueOf(raw).Type()
-		if vt.ConvertibleTo(pt) {
-			return v.Convert(pt).Interface()
-		}
-	}
-
-	return nil
-}
-
-// DecodeHookExec executes the given decode hook. This should be used
-// since it'll naturally degrade to the older backwards compatible DecodeHookFunc
-// that took reflect.Kind instead of reflect.Type.
-func DecodeHookExec(
-	raw DecodeHookFunc,
-	from reflect.Type, to reflect.Type,
-	data interface{}) (interface{}, error) {
-	// Build our arguments that reflect expects
-	argVals := make([]reflect.Value, 3)
-	argVals[0] = reflect.ValueOf(from)
-	argVals[1] = reflect.ValueOf(to)
-	argVals[2] = reflect.ValueOf(data)
-
-	switch f := typedDecodeHook(raw).(type) {
-	case DecodeHookFuncType:
-		return f(from, to, data)
-	case DecodeHookFuncKind:
-		return f(from.Kind(), to.Kind(), data)
-	default:
-		return nil, errors.New("invalid decode hook signature")
-	}
-}
-
-// ComposeDecodeHookFunc creates a single DecodeHookFunc that
-// automatically composes multiple DecodeHookFuncs.
-//
-// The composed funcs are called in order, with the result of the
-// previous transformation.
-func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc {
-	return func(
-		f reflect.Type,
-		t reflect.Type,
-		data interface{}) (interface{}, error) {
-		var err error
-		for _, f1 := range fs {
-			data, err = DecodeHookExec(f1, f, t, data)
-			if err != nil {
-				return nil, err
-			}
-
-			// Modify the from kind to be correct with the new data
-			f = reflect.ValueOf(data).Type()
-		}
-
-		return data, nil
-	}
-}
-
-// StringToSliceHookFunc returns a DecodeHookFunc that converts
-// string to []string by splitting on the given sep.
-func StringToSliceHookFunc(sep string) DecodeHookFunc {
-	return func(
-		f reflect.Kind,
-		t reflect.Kind,
-		data interface{}) (interface{}, error) {
-		if f != reflect.String || t != reflect.Slice {
-			return data, nil
-		}
-
-		raw := data.(string)
-		if raw == "" {
-			return []string{}, nil
-		}
-
-		return strings.Split(raw, sep), nil
-	}
-}
-
-// StringToTimeDurationHookFunc returns a DecodeHookFunc that converts
-// strings to time.Duration.
-func StringToTimeDurationHookFunc() DecodeHookFunc {
-	return func(
-		f reflect.Type,
-		t reflect.Type,
-		data interface{}) (interface{}, error) {
-		if f.Kind() != reflect.String {
-			return data, nil
-		}
-		if t != reflect.TypeOf(time.Duration(5)) {
-			return data, nil
-		}
-
-		// Convert it by parsing
-		return time.ParseDuration(data.(string))
-	}
-}
-
-func WeaklyTypedHook(
-	f reflect.Kind,
-	t reflect.Kind,
-	data interface{}) (interface{}, error) {
-	dataVal := reflect.ValueOf(data)
-	switch t {
-	case reflect.String:
-		switch f {
-		case reflect.Bool:
-			if dataVal.Bool() {
-				return "1", nil
-			} else {
-				return "0", nil
-			}
-		case reflect.Float32:
-			return strconv.FormatFloat(dataVal.Float(), 'f', -1, 64), nil
-		case reflect.Int:
-			return strconv.FormatInt(dataVal.Int(), 10), nil
-		case reflect.Slice:
-			dataType := dataVal.Type()
-			elemKind := dataType.Elem().Kind()
-			if elemKind == reflect.Uint8 {
-				return string(dataVal.Interface().([]uint8)), nil
-			}
-		case reflect.Uint:
-			return strconv.FormatUint(dataVal.Uint(), 10), nil
-		}
-	}
-
-	return data, nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks_test.go b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks_test.go
deleted file mode 100644
index 53289af..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks_test.go
+++ /dev/null
@@ -1,229 +0,0 @@
-package mapstructure
-
-import (
-	"errors"
-	"reflect"
-	"testing"
-	"time"
-)
-
-func TestComposeDecodeHookFunc(t *testing.T) {
-	f1 := func(
-		f reflect.Kind,
-		t reflect.Kind,
-		data interface{}) (interface{}, error) {
-		return data.(string) + "foo", nil
-	}
-
-	f2 := func(
-		f reflect.Kind,
-		t reflect.Kind,
-		data interface{}) (interface{}, error) {
-		return data.(string) + "bar", nil
-	}
-
-	f := ComposeDecodeHookFunc(f1, f2)
-
-	result, err := DecodeHookExec(
-		f, reflect.TypeOf(""), reflect.TypeOf([]byte("")), "")
-	if err != nil {
-		t.Fatalf("bad: %s", err)
-	}
-	if result.(string) != "foobar" {
-		t.Fatalf("bad: %#v", result)
-	}
-}
-
-func TestComposeDecodeHookFunc_err(t *testing.T) {
-	f1 := func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) {
-		return nil, errors.New("foo")
-	}
-
-	f2 := func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) {
-		panic("NOPE")
-	}
-
-	f := ComposeDecodeHookFunc(f1, f2)
-
-	_, err := DecodeHookExec(
-		f, reflect.TypeOf(""), reflect.TypeOf([]byte("")), 42)
-	if err.Error() != "foo" {
-		t.Fatalf("bad: %s", err)
-	}
-}
-
-func TestComposeDecodeHookFunc_kinds(t *testing.T) {
-	var f2From reflect.Kind
-
-	f1 := func(
-		f reflect.Kind,
-		t reflect.Kind,
-		data interface{}) (interface{}, error) {
-		return int(42), nil
-	}
-
-	f2 := func(
-		f reflect.Kind,
-		t reflect.Kind,
-		data interface{}) (interface{}, error) {
-		f2From = f
-		return data, nil
-	}
-
-	f := ComposeDecodeHookFunc(f1, f2)
-
-	_, err := DecodeHookExec(
-		f, reflect.TypeOf(""), reflect.TypeOf([]byte("")), "")
-	if err != nil {
-		t.Fatalf("bad: %s", err)
-	}
-	if f2From != reflect.Int {
-		t.Fatalf("bad: %#v", f2From)
-	}
-}
-
-func TestStringToSliceHookFunc(t *testing.T) {
-	f := StringToSliceHookFunc(",")
-
-	strType := reflect.TypeOf("")
-	sliceType := reflect.TypeOf([]byte(""))
-	cases := []struct {
-		f, t   reflect.Type
-		data   interface{}
-		result interface{}
-		err    bool
-	}{
-		{sliceType, sliceType, 42, 42, false},
-		{strType, strType, 42, 42, false},
-		{
-			strType,
-			sliceType,
-			"foo,bar,baz",
-			[]string{"foo", "bar", "baz"},
-			false,
-		},
-		{
-			strType,
-			sliceType,
-			"",
-			[]string{},
-			false,
-		},
-	}
-
-	for i, tc := range cases {
-		actual, err := DecodeHookExec(f, tc.f, tc.t, tc.data)
-		if tc.err != (err != nil) {
-			t.Fatalf("case %d: expected err %#v", i, tc.err)
-		}
-		if !reflect.DeepEqual(actual, tc.result) {
-			t.Fatalf(
-				"case %d: expected %#v, got %#v",
-				i, tc.result, actual)
-		}
-	}
-}
-
-func TestStringToTimeDurationHookFunc(t *testing.T) {
-	f := StringToTimeDurationHookFunc()
-
-	strType := reflect.TypeOf("")
-	timeType := reflect.TypeOf(time.Duration(5))
-	cases := []struct {
-		f, t   reflect.Type
-		data   interface{}
-		result interface{}
-		err    bool
-	}{
-		{strType, timeType, "5s", 5 * time.Second, false},
-		{strType, timeType, "5", time.Duration(0), true},
-		{strType, strType, "5", "5", false},
-	}
-
-	for i, tc := range cases {
-		actual, err := DecodeHookExec(f, tc.f, tc.t, tc.data)
-		if tc.err != (err != nil) {
-			t.Fatalf("case %d: expected err %#v", i, tc.err)
-		}
-		if !reflect.DeepEqual(actual, tc.result) {
-			t.Fatalf(
-				"case %d: expected %#v, got %#v",
-				i, tc.result, actual)
-		}
-	}
-}
-
-func TestWeaklyTypedHook(t *testing.T) {
-	var f DecodeHookFunc = WeaklyTypedHook
-
-	boolType := reflect.TypeOf(true)
-	strType := reflect.TypeOf("")
-	sliceType := reflect.TypeOf([]byte(""))
-	cases := []struct {
-		f, t   reflect.Type
-		data   interface{}
-		result interface{}
-		err    bool
-	}{
-		// TO STRING
-		{
-			boolType,
-			strType,
-			false,
-			"0",
-			false,
-		},
-
-		{
-			boolType,
-			strType,
-			true,
-			"1",
-			false,
-		},
-
-		{
-			reflect.TypeOf(float32(1)),
-			strType,
-			float32(7),
-			"7",
-			false,
-		},
-
-		{
-			reflect.TypeOf(int(1)),
-			strType,
-			int(7),
-			"7",
-			false,
-		},
-
-		{
-			sliceType,
-			strType,
-			[]uint8("foo"),
-			"foo",
-			false,
-		},
-
-		{
-			reflect.TypeOf(uint(1)),
-			strType,
-			uint(7),
-			"7",
-			false,
-		},
-	}
-
-	for i, tc := range cases {
-		actual, err := DecodeHookExec(f, tc.f, tc.t, tc.data)
-		if tc.err != (err != nil) {
-			t.Fatalf("case %d: expected err %#v", i, tc.err)
-		}
-		if !reflect.DeepEqual(actual, tc.result) {
-			t.Fatalf(
-				"case %d: expected %#v, got %#v",
-				i, tc.result, actual)
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/error.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/error.go b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/error.go
deleted file mode 100644
index 47a99e5..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/error.go
+++ /dev/null
@@ -1,50 +0,0 @@
-package mapstructure
-
-import (
-	"errors"
-	"fmt"
-	"sort"
-	"strings"
-)
-
-// Error implements the error interface and can represents multiple
-// errors that occur in the course of a single decode.
-type Error struct {
-	Errors []string
-}
-
-func (e *Error) Error() string {
-	points := make([]string, len(e.Errors))
-	for i, err := range e.Errors {
-		points[i] = fmt.Sprintf("* %s", err)
-	}
-
-	sort.Strings(points)
-	return fmt.Sprintf(
-		"%d error(s) decoding:\n\n%s",
-		len(e.Errors), strings.Join(points, "\n"))
-}
-
-// WrappedErrors implements the errwrap.Wrapper interface to make this
-// return value more useful with the errwrap and go-multierror libraries.
-func (e *Error) WrappedErrors() []error {
-	if e == nil {
-		return nil
-	}
-
-	result := make([]error, len(e.Errors))
-	for i, e := range e.Errors {
-		result[i] = errors.New(e)
-	}
-
-	return result
-}
-
-func appendErrors(errors []string, err error) []string {
-	switch e := err.(type) {
-	case *Error:
-		return append(errors, e.Errors...)
-	default:
-		return append(errors, e.Error())
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure.go b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure.go
deleted file mode 100644
index 40be511..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure.go
+++ /dev/null
@@ -1,745 +0,0 @@
-// The mapstructure package exposes functionality to convert an
-// abitrary map[string]interface{} into a native Go structure.
-//
-// The Go structure can be arbitrarily complex, containing slices,
-// other structs, etc. and the decoder will properly decode nested
-// maps and so on into the proper structures in the native Go struct.
-// See the examples to see what the decoder is capable of.
-package mapstructure
-
-import (
-	"errors"
-	"fmt"
-	"reflect"
-	"sort"
-	"strconv"
-	"strings"
-)
-
-// DecodeHookFunc is the callback function that can be used for
-// data transformations. See "DecodeHook" in the DecoderConfig
-// struct.
-//
-// The type should be DecodeHookFuncType or DecodeHookFuncKind.
-// Either is accepted. Types are a superset of Kinds (Types can return
-// Kinds) and are generally a richer thing to use, but Kinds are simpler
-// if you only need those.
-//
-// The reason DecodeHookFunc is multi-typed is for backwards compatibility:
-// we started with Kinds and then realized Types were the better solution,
-// but have a promise to not break backwards compat so we now support
-// both.
-type DecodeHookFunc interface{}
-
-type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface{}, error)
-type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error)
-
-// DecoderConfig is the configuration that is used to create a new decoder
-// and allows customization of various aspects of decoding.
-type DecoderConfig struct {
-	// DecodeHook, if set, will be called before any decoding and any
-	// type conversion (if WeaklyTypedInput is on). This lets you modify
-	// the values before they're set down onto the resulting struct.
-	//
-	// If an error is returned, the entire decode will fail with that
-	// error.
-	DecodeHook DecodeHookFunc
-
-	// If ErrorUnused is true, then it is an error for there to exist
-	// keys in the original map that were unused in the decoding process
-	// (extra keys).
-	ErrorUnused bool
-
-	// ZeroFields, if set to true, will zero fields before writing them.
-	// For example, a map will be emptied before decoded values are put in
-	// it. If this is false, a map will be merged.
-	ZeroFields bool
-
-	// If WeaklyTypedInput is true, the decoder will make the following
-	// "weak" conversions:
-	//
-	//   - bools to string (true = "1", false = "0")
-	//   - numbers to string (base 10)
-	//   - bools to int/uint (true = 1, false = 0)
-	//   - strings to int/uint (base implied by prefix)
-	//   - int to bool (true if value != 0)
-	//   - string to bool (accepts: 1, t, T, TRUE, true, True, 0, f, F,
-	//     FALSE, false, False. Anything else is an error)
-	//   - empty array = empty map and vice versa
-	//   - negative numbers to overflowed uint values (base 10)
-	//
-	WeaklyTypedInput bool
-
-	// Metadata is the struct that will contain extra metadata about
-	// the decoding. If this is nil, then no metadata will be tracked.
-	Metadata *Metadata
-
-	// Result is a pointer to the struct that will contain the decoded
-	// value.
-	Result interface{}
-
-	// The tag name that mapstructure reads for field names. This
-	// defaults to "mapstructure"
-	TagName string
-}
-
-// A Decoder takes a raw interface value and turns it into structured
-// data, keeping track of rich error information along the way in case
-// anything goes wrong. Unlike the basic top-level Decode method, you can
-// more finely control how the Decoder behaves using the DecoderConfig
-// structure. The top-level Decode method is just a convenience that sets
-// up the most basic Decoder.
-type Decoder struct {
-	config *DecoderConfig
-}
-
-// Metadata contains information about decoding a structure that
-// is tedious or difficult to get otherwise.
-type Metadata struct {
-	// Keys are the keys of the structure which were successfully decoded
-	Keys []string
-
-	// Unused is a slice of keys that were found in the raw value but
-	// weren't decoded since there was no matching field in the result interface
-	Unused []string
-}
-
-// Decode takes a map and uses reflection to convert it into the
-// given Go native structure. val must be a pointer to a struct.
-func Decode(m interface{}, rawVal interface{}) error {
-	config := &DecoderConfig{
-		Metadata: nil,
-		Result:   rawVal,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		return err
-	}
-
-	return decoder.Decode(m)
-}
-
-// WeakDecode is the same as Decode but is shorthand to enable
-// WeaklyTypedInput. See DecoderConfig for more info.
-func WeakDecode(input, output interface{}) error {
-	config := &DecoderConfig{
-		Metadata:         nil,
-		Result:           output,
-		WeaklyTypedInput: true,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		return err
-	}
-
-	return decoder.Decode(input)
-}
-
-// NewDecoder returns a new decoder for the given configuration. Once
-// a decoder has been returned, the same configuration must not be used
-// again.
-func NewDecoder(config *DecoderConfig) (*Decoder, error) {
-	val := reflect.ValueOf(config.Result)
-	if val.Kind() != reflect.Ptr {
-		return nil, errors.New("result must be a pointer")
-	}
-
-	val = val.Elem()
-	if !val.CanAddr() {
-		return nil, errors.New("result must be addressable (a pointer)")
-	}
-
-	if config.Metadata != nil {
-		if config.Metadata.Keys == nil {
-			config.Metadata.Keys = make([]string, 0)
-		}
-
-		if config.Metadata.Unused == nil {
-			config.Metadata.Unused = make([]string, 0)
-		}
-	}
-
-	if config.TagName == "" {
-		config.TagName = "mapstructure"
-	}
-
-	result := &Decoder{
-		config: config,
-	}
-
-	return result, nil
-}
-
-// Decode decodes the given raw interface to the target pointer specified
-// by the configuration.
-func (d *Decoder) Decode(raw interface{}) error {
-	return d.decode("", raw, reflect.ValueOf(d.config.Result).Elem())
-}
-
-// Decodes an unknown data type into a specific reflection value.
-func (d *Decoder) decode(name string, data interface{}, val reflect.Value) error {
-	if data == nil {
-		// If the data is nil, then we don't set anything.
-		return nil
-	}
-
-	dataVal := reflect.ValueOf(data)
-	if !dataVal.IsValid() {
-		// If the data value is invalid, then we just set the value
-		// to be the zero value.
-		val.Set(reflect.Zero(val.Type()))
-		return nil
-	}
-
-	if d.config.DecodeHook != nil {
-		// We have a DecodeHook, so let's pre-process the data.
-		var err error
-		data, err = DecodeHookExec(
-			d.config.DecodeHook,
-			dataVal.Type(), val.Type(), data)
-		if err != nil {
-			return err
-		}
-	}
-
-	var err error
-	dataKind := getKind(val)
-	switch dataKind {
-	case reflect.Bool:
-		err = d.decodeBool(name, data, val)
-	case reflect.Interface:
-		err = d.decodeBasic(name, data, val)
-	case reflect.String:
-		err = d.decodeString(name, data, val)
-	case reflect.Int:
-		err = d.decodeInt(name, data, val)
-	case reflect.Uint:
-		err = d.decodeUint(name, data, val)
-	case reflect.Float32:
-		err = d.decodeFloat(name, data, val)
-	case reflect.Struct:
-		err = d.decodeStruct(name, data, val)
-	case reflect.Map:
-		err = d.decodeMap(name, data, val)
-	case reflect.Ptr:
-		err = d.decodePtr(name, data, val)
-	case reflect.Slice:
-		err = d.decodeSlice(name, data, val)
-	default:
-		// If we reached this point then we weren't able to decode it
-		return fmt.Errorf("%s: unsupported type: %s", name, dataKind)
-	}
-
-	// If we reached here, then we successfully decoded SOMETHING, so
-	// mark the key as used if we're tracking metadata.
-	if d.config.Metadata != nil && name != "" {
-		d.config.Metadata.Keys = append(d.config.Metadata.Keys, name)
-	}
-
-	return err
-}
-
-// This decodes a basic type (bool, int, string, etc.) and sets the
-// value to "data" of that type.
-func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error {
-	dataVal := reflect.ValueOf(data)
-	dataValType := dataVal.Type()
-	if !dataValType.AssignableTo(val.Type()) {
-		return fmt.Errorf(
-			"'%s' expected type '%s', got '%s'",
-			name, val.Type(), dataValType)
-	}
-
-	val.Set(dataVal)
-	return nil
-}
-
-func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) error {
-	dataVal := reflect.ValueOf(data)
-	dataKind := getKind(dataVal)
-
-	converted := true
-	switch {
-	case dataKind == reflect.String:
-		val.SetString(dataVal.String())
-	case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
-		if dataVal.Bool() {
-			val.SetString("1")
-		} else {
-			val.SetString("0")
-		}
-	case dataKind == reflect.Int && d.config.WeaklyTypedInput:
-		val.SetString(strconv.FormatInt(dataVal.Int(), 10))
-	case dataKind == reflect.Uint && d.config.WeaklyTypedInput:
-		val.SetString(strconv.FormatUint(dataVal.Uint(), 10))
-	case dataKind == reflect.Float32 && d.config.WeaklyTypedInput:
-		val.SetString(strconv.FormatFloat(dataVal.Float(), 'f', -1, 64))
-	case dataKind == reflect.Slice && d.config.WeaklyTypedInput:
-		dataType := dataVal.Type()
-		elemKind := dataType.Elem().Kind()
-		switch {
-		case elemKind == reflect.Uint8:
-			val.SetString(string(dataVal.Interface().([]uint8)))
-		default:
-			converted = false
-		}
-	default:
-		converted = false
-	}
-
-	if !converted {
-		return fmt.Errorf(
-			"'%s' expected type '%s', got unconvertible type '%s'",
-			name, val.Type(), dataVal.Type())
-	}
-
-	return nil
-}
-
-func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) error {
-	dataVal := reflect.ValueOf(data)
-	dataKind := getKind(dataVal)
-
-	switch {
-	case dataKind == reflect.Int:
-		val.SetInt(dataVal.Int())
-	case dataKind == reflect.Uint:
-		val.SetInt(int64(dataVal.Uint()))
-	case dataKind == reflect.Float32:
-		val.SetInt(int64(dataVal.Float()))
-	case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
-		if dataVal.Bool() {
-			val.SetInt(1)
-		} else {
-			val.SetInt(0)
-		}
-	case dataKind == reflect.String && d.config.WeaklyTypedInput:
-		i, err := strconv.ParseInt(dataVal.String(), 0, val.Type().Bits())
-		if err == nil {
-			val.SetInt(i)
-		} else {
-			return fmt.Errorf("cannot parse '%s' as int: %s", name, err)
-		}
-	default:
-		return fmt.Errorf(
-			"'%s' expected type '%s', got unconvertible type '%s'",
-			name, val.Type(), dataVal.Type())
-	}
-
-	return nil
-}
-
-func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) error {
-	dataVal := reflect.ValueOf(data)
-	dataKind := getKind(dataVal)
-
-	switch {
-	case dataKind == reflect.Int:
-		i := dataVal.Int()
-		if i < 0 && !d.config.WeaklyTypedInput {
-			return fmt.Errorf("cannot parse '%s', %d overflows uint",
-				name, i)
-		}
-		val.SetUint(uint64(i))
-	case dataKind == reflect.Uint:
-		val.SetUint(dataVal.Uint())
-	case dataKind == reflect.Float32:
-		f := dataVal.Float()
-		if f < 0 && !d.config.WeaklyTypedInput {
-			return fmt.Errorf("cannot parse '%s', %f overflows uint",
-				name, f)
-		}
-		val.SetUint(uint64(f))
-	case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
-		if dataVal.Bool() {
-			val.SetUint(1)
-		} else {
-			val.SetUint(0)
-		}
-	case dataKind == reflect.String && d.config.WeaklyTypedInput:
-		i, err := strconv.ParseUint(dataVal.String(), 0, val.Type().Bits())
-		if err == nil {
-			val.SetUint(i)
-		} else {
-			return fmt.Errorf("cannot parse '%s' as uint: %s", name, err)
-		}
-	default:
-		return fmt.Errorf(
-			"'%s' expected type '%s', got unconvertible type '%s'",
-			name, val.Type(), dataVal.Type())
-	}
-
-	return nil
-}
-
-func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) error {
-	dataVal := reflect.ValueOf(data)
-	dataKind := getKind(dataVal)
-
-	switch {
-	case dataKind == reflect.Bool:
-		val.SetBool(dataVal.Bool())
-	case dataKind == reflect.Int && d.config.WeaklyTypedInput:
-		val.SetBool(dataVal.Int() != 0)
-	case dataKind == reflect.Uint && d.config.WeaklyTypedInput:
-		val.SetBool(dataVal.Uint() != 0)
-	case dataKind == reflect.Float32 && d.config.WeaklyTypedInput:
-		val.SetBool(dataVal.Float() != 0)
-	case dataKind == reflect.String && d.config.WeaklyTypedInput:
-		b, err := strconv.ParseBool(dataVal.String())
-		if err == nil {
-			val.SetBool(b)
-		} else if dataVal.String() == "" {
-			val.SetBool(false)
-		} else {
-			return fmt.Errorf("cannot parse '%s' as bool: %s", name, err)
-		}
-	default:
-		return fmt.Errorf(
-			"'%s' expected type '%s', got unconvertible type '%s'",
-			name, val.Type(), dataVal.Type())
-	}
-
-	return nil
-}
-
-func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) error {
-	dataVal := reflect.ValueOf(data)
-	dataKind := getKind(dataVal)
-
-	switch {
-	case dataKind == reflect.Int:
-		val.SetFloat(float64(dataVal.Int()))
-	case dataKind == reflect.Uint:
-		val.SetFloat(float64(dataVal.Uint()))
-	case dataKind == reflect.Float32:
-		val.SetFloat(float64(dataVal.Float()))
-	case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
-		if dataVal.Bool() {
-			val.SetFloat(1)
-		} else {
-			val.SetFloat(0)
-		}
-	case dataKind == reflect.String && d.config.WeaklyTypedInput:
-		f, err := strconv.ParseFloat(dataVal.String(), val.Type().Bits())
-		if err == nil {
-			val.SetFloat(f)
-		} else {
-			return fmt.Errorf("cannot parse '%s' as float: %s", name, err)
-		}
-	default:
-		return fmt.Errorf(
-			"'%s' expected type '%s', got unconvertible type '%s'",
-			name, val.Type(), dataVal.Type())
-	}
-
-	return nil
-}
-
-func (d *Decoder) decodeMap(name string, data interface{}, val reflect.Value) error {
-	valType := val.Type()
-	valKeyType := valType.Key()
-	valElemType := valType.Elem()
-
-	// By default we overwrite keys in the current map
-	valMap := val
-
-	// If the map is nil or we're purposely zeroing fields, make a new map
-	if valMap.IsNil() || d.config.ZeroFields {
-		// Make a new map to hold our result
-		mapType := reflect.MapOf(valKeyType, valElemType)
-		valMap = reflect.MakeMap(mapType)
-	}
-
-	// Check input type
-	dataVal := reflect.Indirect(reflect.ValueOf(data))
-	if dataVal.Kind() != reflect.Map {
-		// Accept empty array/slice instead of an empty map in weakly typed mode
-		if d.config.WeaklyTypedInput &&
-			(dataVal.Kind() == reflect.Slice || dataVal.Kind() == reflect.Array) &&
-			dataVal.Len() == 0 {
-			val.Set(valMap)
-			return nil
-		} else {
-			return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind())
-		}
-	}
-
-	// Accumulate errors
-	errors := make([]string, 0)
-
-	for _, k := range dataVal.MapKeys() {
-		fieldName := fmt.Sprintf("%s[%s]", name, k)
-
-		// First decode the key into the proper type
-		currentKey := reflect.Indirect(reflect.New(valKeyType))
-		if err := d.decode(fieldName, k.Interface(), currentKey); err != nil {
-			errors = appendErrors(errors, err)
-			continue
-		}
-
-		// Next decode the data into the proper type
-		v := dataVal.MapIndex(k).Interface()
-		currentVal := reflect.Indirect(reflect.New(valElemType))
-		if err := d.decode(fieldName, v, currentVal); err != nil {
-			errors = appendErrors(errors, err)
-			continue
-		}
-
-		valMap.SetMapIndex(currentKey, currentVal)
-	}
-
-	// Set the built up map to the value
-	val.Set(valMap)
-
-	// If we had errors, return those
-	if len(errors) > 0 {
-		return &Error{errors}
-	}
-
-	return nil
-}
-
-func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) error {
-	// Create an element of the concrete (non pointer) type and decode
-	// into that. Then set the value of the pointer to this type.
-	valType := val.Type()
-	valElemType := valType.Elem()
-	realVal := reflect.New(valElemType)
-	if err := d.decode(name, data, reflect.Indirect(realVal)); err != nil {
-		return err
-	}
-
-	val.Set(realVal)
-	return nil
-}
-
-func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) error {
-	dataVal := reflect.Indirect(reflect.ValueOf(data))
-	dataValKind := dataVal.Kind()
-	valType := val.Type()
-	valElemType := valType.Elem()
-	sliceType := reflect.SliceOf(valElemType)
-
-	// Check input type
-	if dataValKind != reflect.Array && dataValKind != reflect.Slice {
-		// Accept empty map instead of array/slice in weakly typed mode
-		if d.config.WeaklyTypedInput && dataVal.Kind() == reflect.Map && dataVal.Len() == 0 {
-			val.Set(reflect.MakeSlice(sliceType, 0, 0))
-			return nil
-		} else {
-			return fmt.Errorf(
-				"'%s': source data must be an array or slice, got %s", name, dataValKind)
-		}
-	}
-
-	// Make a new slice to hold our result, same size as the original data.
-	valSlice := reflect.MakeSlice(sliceType, dataVal.Len(), dataVal.Len())
-
-	// Accumulate any errors
-	errors := make([]string, 0)
-
-	for i := 0; i < dataVal.Len(); i++ {
-		currentData := dataVal.Index(i).Interface()
-		currentField := valSlice.Index(i)
-
-		fieldName := fmt.Sprintf("%s[%d]", name, i)
-		if err := d.decode(fieldName, currentData, currentField); err != nil {
-			errors = appendErrors(errors, err)
-		}
-	}
-
-	// Finally, set the value to the slice we built up
-	val.Set(valSlice)
-
-	// If there were errors, we return those
-	if len(errors) > 0 {
-		return &Error{errors}
-	}
-
-	return nil
-}
-
-func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) error {
-	dataVal := reflect.Indirect(reflect.ValueOf(data))
-
-	// If the type of the value to write to and the data match directly,
-	// then we just set it directly instead of recursing into the structure.
-	if dataVal.Type() == val.Type() {
-		val.Set(dataVal)
-		return nil
-	}
-
-	dataValKind := dataVal.Kind()
-	if dataValKind != reflect.Map {
-		return fmt.Errorf("'%s' expected a map, got '%s'", name, dataValKind)
-	}
-
-	dataValType := dataVal.Type()
-	if kind := dataValType.Key().Kind(); kind != reflect.String && kind != reflect.Interface {
-		return fmt.Errorf(
-			"'%s' needs a map with string keys, has '%s' keys",
-			name, dataValType.Key().Kind())
-	}
-
-	dataValKeys := make(map[reflect.Value]struct{})
-	dataValKeysUnused := make(map[interface{}]struct{})
-	for _, dataValKey := range dataVal.MapKeys() {
-		dataValKeys[dataValKey] = struct{}{}
-		dataValKeysUnused[dataValKey.Interface()] = struct{}{}
-	}
-
-	errors := make([]string, 0)
-
-	// This slice will keep track of all the structs we'll be decoding.
-	// There can be more than one struct if there are embedded structs
-	// that are squashed.
-	structs := make([]reflect.Value, 1, 5)
-	structs[0] = val
-
-	// Compile the list of all the fields that we're going to be decoding
-	// from all the structs.
-	fields := make(map[*reflect.StructField]reflect.Value)
-	for len(structs) > 0 {
-		structVal := structs[0]
-		structs = structs[1:]
-
-		structType := structVal.Type()
-		for i := 0; i < structType.NumField(); i++ {
-			fieldType := structType.Field(i)
-
-			if fieldType.Anonymous {
-				fieldKind := fieldType.Type.Kind()
-				if fieldKind != reflect.Struct {
-					errors = appendErrors(errors,
-						fmt.Errorf("%s: unsupported type: %s", fieldType.Name, fieldKind))
-					continue
-				}
-			}
-
-			// If "squash" is specified in the tag, we squash the field down.
-			squash := false
-			tagParts := strings.Split(fieldType.Tag.Get(d.config.TagName), ",")
-			for _, tag := range tagParts[1:] {
-				if tag == "squash" {
-					squash = true
-					break
-				}
-			}
-
-			if squash {
-				structs = append(structs, val.FieldByName(fieldType.Name))
-				continue
-			}
-
-			// Normal struct field, store it away
-			fields[&fieldType] = structVal.Field(i)
-		}
-	}
-
-	for fieldType, field := range fields {
-		fieldName := fieldType.Name
-
-		tagValue := fieldType.Tag.Get(d.config.TagName)
-		tagValue = strings.SplitN(tagValue, ",", 2)[0]
-		if tagValue != "" {
-			fieldName = tagValue
-		}
-
-		rawMapKey := reflect.ValueOf(fieldName)
-		rawMapVal := dataVal.MapIndex(rawMapKey)
-		if !rawMapVal.IsValid() {
-			// Do a slower search by iterating over each key and
-			// doing case-insensitive search.
-			for dataValKey, _ := range dataValKeys {
-				mK, ok := dataValKey.Interface().(string)
-				if !ok {
-					// Not a string key
-					continue
-				}
-
-				if strings.EqualFold(mK, fieldName) {
-					rawMapKey = dataValKey
-					rawMapVal = dataVal.MapIndex(dataValKey)
-					break
-				}
-			}
-
-			if !rawMapVal.IsValid() {
-				// There was no matching key in the map for the value in
-				// the struct. Just ignore.
-				continue
-			}
-		}
-
-		// Delete the key we're using from the unused map so we stop tracking
-		delete(dataValKeysUnused, rawMapKey.Interface())
-
-		if !field.IsValid() {
-			// This should never happen
-			panic("field is not valid")
-		}
-
-		// If we can't set the field, then it is unexported or something,
-		// and we just continue onwards.
-		if !field.CanSet() {
-			continue
-		}
-
-		// If the name is empty string, then we're at the root, and we
-		// don't dot-join the fields.
-		if name != "" {
-			fieldName = fmt.Sprintf("%s.%s", name, fieldName)
-		}
-
-		if err := d.decode(fieldName, rawMapVal.Interface(), field); err != nil {
-			errors = appendErrors(errors, err)
-		}
-	}
-
-	if d.config.ErrorUnused && len(dataValKeysUnused) > 0 {
-		keys := make([]string, 0, len(dataValKeysUnused))
-		for rawKey, _ := range dataValKeysUnused {
-			keys = append(keys, rawKey.(string))
-		}
-		sort.Strings(keys)
-
-		err := fmt.Errorf("'%s' has invalid keys: %s", name, strings.Join(keys, ", "))
-		errors = appendErrors(errors, err)
-	}
-
-	if len(errors) > 0 {
-		return &Error{errors}
-	}
-
-	// Add the unused keys to the list of unused keys if we're tracking metadata
-	if d.config.Metadata != nil {
-		for rawKey, _ := range dataValKeysUnused {
-			key := rawKey.(string)
-			if name != "" {
-				key = fmt.Sprintf("%s.%s", name, key)
-			}
-
-			d.config.Metadata.Unused = append(d.config.Metadata.Unused, key)
-		}
-	}
-
-	return nil
-}
-
-func getKind(val reflect.Value) reflect.Kind {
-	kind := val.Kind()
-
-	switch {
-	case kind >= reflect.Int && kind <= reflect.Int64:
-		return reflect.Int
-	case kind >= reflect.Uint && kind <= reflect.Uint64:
-		return reflect.Uint
-	case kind >= reflect.Float32 && kind <= reflect.Float64:
-		return reflect.Float32
-	default:
-		return kind
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go
deleted file mode 100644
index b50ac36..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go
+++ /dev/null
@@ -1,243 +0,0 @@
-package mapstructure
-
-import (
-	"testing"
-)
-
-func Benchmark_Decode(b *testing.B) {
-	type Person struct {
-		Name   string
-		Age    int
-		Emails []string
-		Extra  map[string]string
-	}
-
-	input := map[string]interface{}{
-		"name":   "Mitchell",
-		"age":    91,
-		"emails": []string{"one", "two", "three"},
-		"extra": map[string]string{
-			"twitter": "mitchellh",
-		},
-	}
-
-	var result Person
-	for i := 0; i < b.N; i++ {
-		Decode(input, &result)
-	}
-}
-
-func Benchmark_DecodeBasic(b *testing.B) {
-	input := map[string]interface{}{
-		"vstring": "foo",
-		"vint":    42,
-		"Vuint":   42,
-		"vbool":   true,
-		"Vfloat":  42.42,
-		"vsilent": true,
-		"vdata":   42,
-	}
-
-	var result Basic
-	for i := 0; i < b.N; i++ {
-		Decode(input, &result)
-	}
-}
-
-func Benchmark_DecodeEmbedded(b *testing.B) {
-	input := map[string]interface{}{
-		"vstring": "foo",
-		"Basic": map[string]interface{}{
-			"vstring": "innerfoo",
-		},
-		"vunique": "bar",
-	}
-
-	var result Embedded
-	for i := 0; i < b.N; i++ {
-		Decode(input, &result)
-	}
-}
-
-func Benchmark_DecodeTypeConversion(b *testing.B) {
-	input := map[string]interface{}{
-		"IntToFloat":    42,
-		"IntToUint":     42,
-		"IntToBool":     1,
-		"IntToString":   42,
-		"UintToInt":     42,
-		"UintToFloat":   42,
-		"UintToBool":    42,
-		"UintToString":  42,
-		"BoolToInt":     true,
-		"BoolToUint":    true,
-		"BoolToFloat":   true,
-		"BoolToString":  true,
-		"FloatToInt":    42.42,
-		"FloatToUint":   42.42,
-		"FloatToBool":   42.42,
-		"FloatToString": 42.42,
-		"StringToInt":   "42",
-		"StringToUint":  "42",
-		"StringToBool":  "1",
-		"StringToFloat": "42.42",
-		"SliceToMap":    []interface{}{},
-		"MapToSlice":    map[string]interface{}{},
-	}
-
-	var resultStrict TypeConversionResult
-	for i := 0; i < b.N; i++ {
-		Decode(input, &resultStrict)
-	}
-}
-
-func Benchmark_DecodeMap(b *testing.B) {
-	input := map[string]interface{}{
-		"vfoo": "foo",
-		"vother": map[interface{}]interface{}{
-			"foo": "foo",
-			"bar": "bar",
-		},
-	}
-
-	var result Map
-	for i := 0; i < b.N; i++ {
-		Decode(input, &result)
-	}
-}
-
-func Benchmark_DecodeMapOfStruct(b *testing.B) {
-	input := map[string]interface{}{
-		"value": map[string]interface{}{
-			"foo": map[string]string{"vstring": "one"},
-			"bar": map[string]string{"vstring": "two"},
-		},
-	}
-
-	var result MapOfStruct
-	for i := 0; i < b.N; i++ {
-		Decode(input, &result)
-	}
-}
-
-func Benchmark_DecodeSlice(b *testing.B) {
-	input := map[string]interface{}{
-		"vfoo": "foo",
-		"vbar": []string{"foo", "bar", "baz"},
-	}
-
-	var result Slice
-	for i := 0; i < b.N; i++ {
-		Decode(input, &result)
-	}
-}
-
-func Benchmark_DecodeSliceOfStruct(b *testing.B) {
-	input := map[string]interface{}{
-		"value": []map[string]interface{}{
-			{"vstring": "one"},
-			{"vstring": "two"},
-		},
-	}
-
-	var result SliceOfStruct
-	for i := 0; i < b.N; i++ {
-		Decode(input, &result)
-	}
-}
-
-func Benchmark_DecodeWeaklyTypedInput(b *testing.B) {
-	type Person struct {
-		Name   string
-		Age    int
-		Emails []string
-	}
-
-	// This input can come from anywhere, but typically comes from
-	// something like decoding JSON, generated by a weakly typed language
-	// such as PHP.
-	input := map[string]interface{}{
-		"name":   123,                      // number => string
-		"age":    "42",                     // string => number
-		"emails": map[string]interface{}{}, // empty map => empty array
-	}
-
-	var result Person
-	config := &DecoderConfig{
-		WeaklyTypedInput: true,
-		Result:           &result,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		panic(err)
-	}
-
-	for i := 0; i < b.N; i++ {
-		decoder.Decode(input)
-	}
-}
-
-func Benchmark_DecodeMetadata(b *testing.B) {
-	type Person struct {
-		Name string
-		Age  int
-	}
-
-	input := map[string]interface{}{
-		"name":  "Mitchell",
-		"age":   91,
-		"email": "foo@bar.com",
-	}
-
-	var md Metadata
-	var result Person
-	config := &DecoderConfig{
-		Metadata: &md,
-		Result:   &result,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		panic(err)
-	}
-
-	for i := 0; i < b.N; i++ {
-		decoder.Decode(input)
-	}
-}
-
-func Benchmark_DecodeMetadataEmbedded(b *testing.B) {
-	input := map[string]interface{}{
-		"vstring": "foo",
-		"vunique": "bar",
-	}
-
-	var md Metadata
-	var result EmbeddedSquash
-	config := &DecoderConfig{
-		Metadata: &md,
-		Result:   &result,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		b.Fatalf("err: %s", err)
-	}
-
-	for i := 0; i < b.N; i++ {
-		decoder.Decode(input)
-	}
-}
-
-func Benchmark_DecodeTagged(b *testing.B) {
-	input := map[string]interface{}{
-		"foo": "bar",
-		"bar": "value",
-	}
-
-	var result Tagged
-	for i := 0; i < b.N; i++ {
-		Decode(input, &result)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go
deleted file mode 100644
index 7054f1a..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package mapstructure
-
-import "testing"
-
-// GH-1
-func TestDecode_NilValue(t *testing.T) {
-	input := map[string]interface{}{
-		"vfoo":   nil,
-		"vother": nil,
-	}
-
-	var result Map
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("should not error: %s", err)
-	}
-
-	if result.Vfoo != "" {
-		t.Fatalf("value should be default: %s", result.Vfoo)
-	}
-
-	if result.Vother != nil {
-		t.Fatalf("Vother should be nil: %s", result.Vother)
-	}
-}
-
-// GH-10
-func TestDecode_mapInterfaceInterface(t *testing.T) {
-	input := map[interface{}]interface{}{
-		"vfoo":   nil,
-		"vother": nil,
-	}
-
-	var result Map
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("should not error: %s", err)
-	}
-
-	if result.Vfoo != "" {
-		t.Fatalf("value should be default: %s", result.Vfoo)
-	}
-
-	if result.Vother != nil {
-		t.Fatalf("Vother should be nil: %s", result.Vother)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_examples_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_examples_test.go b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_examples_test.go
deleted file mode 100644
index f17c214..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_examples_test.go
+++ /dev/null
@@ -1,203 +0,0 @@
-package mapstructure
-
-import (
-	"fmt"
-)
-
-func ExampleDecode() {
-	type Person struct {
-		Name   string
-		Age    int
-		Emails []string
-		Extra  map[string]string
-	}
-
-	// This input can come from anywhere, but typically comes from
-	// something like decoding JSON where we're not quite sure of the
-	// struct initially.
-	input := map[string]interface{}{
-		"name":   "Mitchell",
-		"age":    91,
-		"emails": []string{"one", "two", "three"},
-		"extra": map[string]string{
-			"twitter": "mitchellh",
-		},
-	}
-
-	var result Person
-	err := Decode(input, &result)
-	if err != nil {
-		panic(err)
-	}
-
-	fmt.Printf("%#v", result)
-	// Output:
-	// mapstructure.Person{Name:"Mitchell", Age:91, Emails:[]string{"one", "two", "three"}, Extra:map[string]string{"twitter":"mitchellh"}}
-}
-
-func ExampleDecode_errors() {
-	type Person struct {
-		Name   string
-		Age    int
-		Emails []string
-		Extra  map[string]string
-	}
-
-	// This input can come from anywhere, but typically comes from
-	// something like decoding JSON where we're not quite sure of the
-	// struct initially.
-	input := map[string]interface{}{
-		"name":   123,
-		"age":    "bad value",
-		"emails": []int{1, 2, 3},
-	}
-
-	var result Person
-	err := Decode(input, &result)
-	if err == nil {
-		panic("should have an error")
-	}
-
-	fmt.Println(err.Error())
-	// Output:
-	// 5 error(s) decoding:
-	//
-	// * 'Age' expected type 'int', got unconvertible type 'string'
-	// * 'Emails[0]' expected type 'string', got unconvertible type 'int'
-	// * 'Emails[1]' expected type 'string', got unconvertible type 'int'
-	// * 'Emails[2]' expected type 'string', got unconvertible type 'int'
-	// * 'Name' expected type 'string', got unconvertible type 'int'
-}
-
-func ExampleDecode_metadata() {
-	type Person struct {
-		Name string
-		Age  int
-	}
-
-	// This input can come from anywhere, but typically comes from
-	// something like decoding JSON where we're not quite sure of the
-	// struct initially.
-	input := map[string]interface{}{
-		"name":  "Mitchell",
-		"age":   91,
-		"email": "foo@bar.com",
-	}
-
-	// For metadata, we make a more advanced DecoderConfig so we can
-	// more finely configure the decoder that is used. In this case, we
-	// just tell the decoder we want to track metadata.
-	var md Metadata
-	var result Person
-	config := &DecoderConfig{
-		Metadata: &md,
-		Result:   &result,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		panic(err)
-	}
-
-	if err := decoder.Decode(input); err != nil {
-		panic(err)
-	}
-
-	fmt.Printf("Unused keys: %#v", md.Unused)
-	// Output:
-	// Unused keys: []string{"email"}
-}
-
-func ExampleDecode_weaklyTypedInput() {
-	type Person struct {
-		Name   string
-		Age    int
-		Emails []string
-	}
-
-	// This input can come from anywhere, but typically comes from
-	// something like decoding JSON, generated by a weakly typed language
-	// such as PHP.
-	input := map[string]interface{}{
-		"name":   123,                      // number => string
-		"age":    "42",                     // string => number
-		"emails": map[string]interface{}{}, // empty map => empty array
-	}
-
-	var result Person
-	config := &DecoderConfig{
-		WeaklyTypedInput: true,
-		Result:           &result,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		panic(err)
-	}
-
-	err = decoder.Decode(input)
-	if err != nil {
-		panic(err)
-	}
-
-	fmt.Printf("%#v", result)
-	// Output: mapstructure.Person{Name:"123", Age:42, Emails:[]string{}}
-}
-
-func ExampleDecode_tags() {
-	// Note that the mapstructure tags defined in the struct type
-	// can indicate which fields the values are mapped to.
-	type Person struct {
-		Name string `mapstructure:"person_name"`
-		Age  int    `mapstructure:"person_age"`
-	}
-
-	input := map[string]interface{}{
-		"person_name": "Mitchell",
-		"person_age":  91,
-	}
-
-	var result Person
-	err := Decode(input, &result)
-	if err != nil {
-		panic(err)
-	}
-
-	fmt.Printf("%#v", result)
-	// Output:
-	// mapstructure.Person{Name:"Mitchell", Age:91}
-}
-
-func ExampleDecode_embeddedStruct() {
-	// Squashing multiple embedded structs is allowed using the squash tag.
-	// This is demonstrated by creating a composite struct of multiple types
-	// and decoding into it. In this case, a person can carry with it both
-	// a Family and a Location, as well as their own FirstName.
-	type Family struct {
-		LastName string
-	}
-	type Location struct {
-		City string
-	}
-	type Person struct {
-		Family    `mapstructure:",squash"`
-		Location  `mapstructure:",squash"`
-		FirstName string
-	}
-
-	input := map[string]interface{}{
-		"FirstName": "Mitchell",
-		"LastName":  "Hashimoto",
-		"City":      "San Francisco",
-	}
-
-	var result Person
-	err := Decode(input, &result)
-	if err != nil {
-		panic(err)
-	}
-
-	fmt.Printf("%s %s, %s", result.FirstName, result.LastName, result.City)
-	// Output:
-	// Mitchell Hashimoto, San Francisco
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_test.go b/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_test.go
deleted file mode 100644
index 8a27647..0000000
--- a/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_test.go
+++ /dev/null
@@ -1,999 +0,0 @@
-package mapstructure
-
-import (
-	"reflect"
-	"sort"
-	"testing"
-)
-
-type Basic struct {
-	Vstring string
-	Vint    int
-	Vuint   uint
-	Vbool   bool
-	Vfloat  float64
-	Vextra  string
-	vsilent bool
-	Vdata   interface{}
-}
-
-type BasicSquash struct {
-	Test Basic `mapstructure:",squash"`
-}
-
-type Embedded struct {
-	Basic
-	Vunique string
-}
-
-type EmbeddedPointer struct {
-	*Basic
-	Vunique string
-}
-
-type EmbeddedSquash struct {
-	Basic   `mapstructure:",squash"`
-	Vunique string
-}
-
-type Map struct {
-	Vfoo   string
-	Vother map[string]string
-}
-
-type MapOfStruct struct {
-	Value map[string]Basic
-}
-
-type Nested struct {
-	Vfoo string
-	Vbar Basic
-}
-
-type NestedPointer struct {
-	Vfoo string
-	Vbar *Basic
-}
-
-type Slice struct {
-	Vfoo string
-	Vbar []string
-}
-
-type SliceOfStruct struct {
-	Value []Basic
-}
-
-type Tagged struct {
-	Extra string `mapstructure:"bar,what,what"`
-	Value string `mapstructure:"foo"`
-}
-
-type TypeConversionResult struct {
-	IntToFloat         float32
-	IntToUint          uint
-	IntToBool          bool
-	IntToString        string
-	UintToInt          int
-	UintToFloat        float32
-	UintToBool         bool
-	UintToString       string
-	BoolToInt          int
-	BoolToUint         uint
-	BoolToFloat        float32
-	BoolToString       string
-	FloatToInt         int
-	FloatToUint        uint
-	FloatToBool        bool
-	FloatToString      string
-	SliceUint8ToString string
-	StringToInt        int
-	StringToUint       uint
-	StringToBool       bool
-	StringToFloat      float32
-	SliceToMap         map[string]interface{}
-	MapToSlice         []interface{}
-}
-
-func TestBasicTypes(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vstring": "foo",
-		"vint":    42,
-		"Vuint":   42,
-		"vbool":   true,
-		"Vfloat":  42.42,
-		"vsilent": true,
-		"vdata":   42,
-	}
-
-	var result Basic
-	err := Decode(input, &result)
-	if err != nil {
-		t.Errorf("got an err: %s", err.Error())
-		t.FailNow()
-	}
-
-	if result.Vstring != "foo" {
-		t.Errorf("vstring value should be 'foo': %#v", result.Vstring)
-	}
-
-	if result.Vint != 42 {
-		t.Errorf("vint value should be 42: %#v", result.Vint)
-	}
-
-	if result.Vuint != 42 {
-		t.Errorf("vuint value should be 42: %#v", result.Vuint)
-	}
-
-	if result.Vbool != true {
-		t.Errorf("vbool value should be true: %#v", result.Vbool)
-	}
-
-	if result.Vfloat != 42.42 {
-		t.Errorf("vfloat value should be 42.42: %#v", result.Vfloat)
-	}
-
-	if result.Vextra != "" {
-		t.Errorf("vextra value should be empty: %#v", result.Vextra)
-	}
-
-	if result.vsilent != false {
-		t.Error("vsilent should not be set, it is unexported")
-	}
-
-	if result.Vdata != 42 {
-		t.Error("vdata should be valid")
-	}
-}
-
-func TestBasic_IntWithFloat(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vint": float64(42),
-	}
-
-	var result Basic
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an err: %s", err)
-	}
-}
-
-func TestBasic_Merge(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vint": 42,
-	}
-
-	var result Basic
-	result.Vuint = 100
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an err: %s", err)
-	}
-
-	expected := Basic{
-		Vint:  42,
-		Vuint: 100,
-	}
-	if !reflect.DeepEqual(result, expected) {
-		t.Fatalf("bad: %#v", result)
-	}
-}
-
-func TestDecode_BasicSquash(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vstring": "foo",
-	}
-
-	var result BasicSquash
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an err: %s", err.Error())
-	}
-
-	if result.Test.Vstring != "foo" {
-		t.Errorf("vstring value should be 'foo': %#v", result.Test.Vstring)
-	}
-}
-
-func TestDecode_Embedded(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vstring": "foo",
-		"Basic": map[string]interface{}{
-			"vstring": "innerfoo",
-		},
-		"vunique": "bar",
-	}
-
-	var result Embedded
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an err: %s", err.Error())
-	}
-
-	if result.Vstring != "innerfoo" {
-		t.Errorf("vstring value should be 'innerfoo': %#v", result.Vstring)
-	}
-
-	if result.Vunique != "bar" {
-		t.Errorf("vunique value should be 'bar': %#v", result.Vunique)
-	}
-}
-
-func TestDecode_EmbeddedPointer(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vstring": "foo",
-		"Basic": map[string]interface{}{
-			"vstring": "innerfoo",
-		},
-		"vunique": "bar",
-	}
-
-	var result EmbeddedPointer
-	err := Decode(input, &result)
-	if err == nil {
-		t.Fatal("should get error")
-	}
-}
-
-func TestDecode_EmbeddedSquash(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vstring": "foo",
-		"vunique": "bar",
-	}
-
-	var result EmbeddedSquash
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an err: %s", err.Error())
-	}
-
-	if result.Vstring != "foo" {
-		t.Errorf("vstring value should be 'foo': %#v", result.Vstring)
-	}
-
-	if result.Vunique != "bar" {
-		t.Errorf("vunique value should be 'bar': %#v", result.Vunique)
-	}
-}
-
-func TestDecode_DecodeHook(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vint": "WHAT",
-	}
-
-	decodeHook := func(from reflect.Kind, to reflect.Kind, v interface{}) (interface{}, error) {
-		if from == reflect.String && to != reflect.String {
-			return 5, nil
-		}
-
-		return v, nil
-	}
-
-	var result Basic
-	config := &DecoderConfig{
-		DecodeHook: decodeHook,
-		Result:     &result,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		t.Fatalf("err: %s", err)
-	}
-
-	err = decoder.Decode(input)
-	if err != nil {
-		t.Fatalf("got an err: %s", err)
-	}
-
-	if result.Vint != 5 {
-		t.Errorf("vint should be 5: %#v", result.Vint)
-	}
-}
-
-func TestDecode_DecodeHookType(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vint": "WHAT",
-	}
-
-	decodeHook := func(from reflect.Type, to reflect.Type, v interface{}) (interface{}, error) {
-		if from.Kind() == reflect.String &&
-			to.Kind() != reflect.String {
-			return 5, nil
-		}
-
-		return v, nil
-	}
-
-	var result Basic
-	config := &DecoderConfig{
-		DecodeHook: decodeHook,
-		Result:     &result,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		t.Fatalf("err: %s", err)
-	}
-
-	err = decoder.Decode(input)
-	if err != nil {
-		t.Fatalf("got an err: %s", err)
-	}
-
-	if result.Vint != 5 {
-		t.Errorf("vint should be 5: %#v", result.Vint)
-	}
-}
-
-func TestDecode_Nil(t *testing.T) {
-	t.Parallel()
-
-	var input interface{} = nil
-	result := Basic{
-		Vstring: "foo",
-	}
-
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("err: %s", err)
-	}
-
-	if result.Vstring != "foo" {
-		t.Fatalf("bad: %#v", result.Vstring)
-	}
-}
-
-func TestDecode_NonStruct(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"foo": "bar",
-		"bar": "baz",
-	}
-
-	var result map[string]string
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("err: %s", err)
-	}
-
-	if result["foo"] != "bar" {
-		t.Fatal("foo is not bar")
-	}
-}
-
-func TestDecode_StructMatch(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vbar": Basic{
-			Vstring: "foo",
-		},
-	}
-
-	var result Nested
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an err: %s", err.Error())
-	}
-
-	if result.Vbar.Vstring != "foo" {
-		t.Errorf("bad: %#v", result)
-	}
-}
-
-func TestDecode_TypeConversion(t *testing.T) {
-	input := map[string]interface{}{
-		"IntToFloat":         42,
-		"IntToUint":          42,
-		"IntToBool":          1,
-		"IntToString":        42,
-		"UintToInt":          42,
-		"UintToFloat":        42,
-		"UintToBool":         42,
-		"UintToString":       42,
-		"BoolToInt":          true,
-		"BoolToUint":         true,
-		"BoolToFloat":        true,
-		"BoolToString":       true,
-		"FloatToInt":         42.42,
-		"FloatToUint":        42.42,
-		"FloatToBool":        42.42,
-		"FloatToString":      42.42,
-		"SliceUint8ToString": []uint8("foo"),
-		"StringToInt":        "42",
-		"StringToUint":       "42",
-		"StringToBool":       "1",
-		"StringToFloat":      "42.42",
-		"SliceToMap":         []interface{}{},
-		"MapToSlice":         map[string]interface{}{},
-	}
-
-	expectedResultStrict := TypeConversionResult{
-		IntToFloat:  42.0,
-		IntToUint:   42,
-		UintToInt:   42,
-		UintToFloat: 42,
-		BoolToInt:   0,
-		BoolToUint:  0,
-		BoolToFloat: 0,
-		FloatToInt:  42,
-		FloatToUint: 42,
-	}
-
-	expectedResultWeak := TypeConversionResult{
-		IntToFloat:         42.0,
-		IntToUint:          42,
-		IntToBool:          true,
-		IntToString:        "42",
-		UintToInt:          42,
-		UintToFloat:        42,
-		UintToBool:         true,
-		UintToString:       "42",
-		BoolToInt:          1,
-		BoolToUint:         1,
-		BoolToFloat:        1,
-		BoolToString:       "1",
-		FloatToInt:         42,
-		FloatToUint:        42,
-		FloatToBool:        true,
-		FloatToString:      "42.42",
-		SliceUint8ToString: "foo",
-		StringToInt:        42,
-		StringToUint:       42,
-		StringToBool:       true,
-		StringToFloat:      42.42,
-		SliceToMap:         map[string]interface{}{},
-		MapToSlice:         []interface{}{},
-	}
-
-	// Test strict type conversion
-	var resultStrict TypeConversionResult
-	err := Decode(input, &resultStrict)
-	if err == nil {
-		t.Errorf("should return an error")
-	}
-	if !reflect.DeepEqual(resultStrict, expectedResultStrict) {
-		t.Errorf("expected %v, got: %v", expectedResultStrict, resultStrict)
-	}
-
-	// Test weak type conversion
-	var decoder *Decoder
-	var resultWeak TypeConversionResult
-
-	config := &DecoderConfig{
-		WeaklyTypedInput: true,
-		Result:           &resultWeak,
-	}
-
-	decoder, err = NewDecoder(config)
-	if err != nil {
-		t.Fatalf("err: %s", err)
-	}
-
-	err = decoder.Decode(input)
-	if err != nil {
-		t.Fatalf("got an err: %s", err)
-	}
-
-	if !reflect.DeepEqual(resultWeak, expectedResultWeak) {
-		t.Errorf("expected \n%#v, got: \n%#v", expectedResultWeak, resultWeak)
-	}
-}
-
-func TestDecoder_ErrorUnused(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vstring": "hello",
-		"foo":     "bar",
-	}
-
-	var result Basic
-	config := &DecoderConfig{
-		ErrorUnused: true,
-		Result:      &result,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		t.Fatalf("err: %s", err)
-	}
-
-	err = decoder.Decode(input)
-	if err == nil {
-		t.Fatal("expected error")
-	}
-}
-
-func TestMap(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vfoo": "foo",
-		"vother": map[interface{}]interface{}{
-			"foo": "foo",
-			"bar": "bar",
-		},
-	}
-
-	var result Map
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an error: %s", err)
-	}
-
-	if result.Vfoo != "foo" {
-		t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo)
-	}
-
-	if result.Vother == nil {
-		t.Fatal("vother should not be nil")
-	}
-
-	if len(result.Vother) != 2 {
-		t.Error("vother should have two items")
-	}
-
-	if result.Vother["foo"] != "foo" {
-		t.Errorf("'foo' key should be foo, got: %#v", result.Vother["foo"])
-	}
-
-	if result.Vother["bar"] != "bar" {
-		t.Errorf("'bar' key should be bar, got: %#v", result.Vother["bar"])
-	}
-}
-
-func TestMapMerge(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vfoo": "foo",
-		"vother": map[interface{}]interface{}{
-			"foo": "foo",
-			"bar": "bar",
-		},
-	}
-
-	var result Map
-	result.Vother = map[string]string{"hello": "world"}
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an error: %s", err)
-	}
-
-	if result.Vfoo != "foo" {
-		t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo)
-	}
-
-	expected := map[string]string{
-		"foo":   "foo",
-		"bar":   "bar",
-		"hello": "world",
-	}
-	if !reflect.DeepEqual(result.Vother, expected) {
-		t.Errorf("bad: %#v", result.Vother)
-	}
-}
-
-func TestMapOfStruct(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"value": map[string]interface{}{
-			"foo": map[string]string{"vstring": "one"},
-			"bar": map[string]string{"vstring": "two"},
-		},
-	}
-
-	var result MapOfStruct
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an err: %s", err)
-	}
-
-	if result.Value == nil {
-		t.Fatal("value should not be nil")
-	}
-
-	if len(result.Value) != 2 {
-		t.Error("value should have two items")
-	}
-
-	if result.Value["foo"].Vstring != "one" {
-		t.Errorf("foo value should be 'one', got: %s", result.Value["foo"].Vstring)
-	}
-
-	if result.Value["bar"].Vstring != "two" {
-		t.Errorf("bar value should be 'two', got: %s", result.Value["bar"].Vstring)
-	}
-}
-
-func TestNestedType(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vfoo": "foo",
-		"vbar": map[string]interface{}{
-			"vstring": "foo",
-			"vint":    42,
-			"vbool":   true,
-		},
-	}
-
-	var result Nested
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an err: %s", err.Error())
-	}
-
-	if result.Vfoo != "foo" {
-		t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo)
-	}
-
-	if result.Vbar.Vstring != "foo" {
-		t.Errorf("vstring value should be 'foo': %#v", result.Vbar.Vstring)
-	}
-
-	if result.Vbar.Vint != 42 {
-		t.Errorf("vint value should be 42: %#v", result.Vbar.Vint)
-	}
-
-	if result.Vbar.Vbool != true {
-		t.Errorf("vbool value should be true: %#v", result.Vbar.Vbool)
-	}
-
-	if result.Vbar.Vextra != "" {
-		t.Errorf("vextra value should be empty: %#v", result.Vbar.Vextra)
-	}
-}
-
-func TestNestedTypePointer(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vfoo": "foo",
-		"vbar": &map[string]interface{}{
-			"vstring": "foo",
-			"vint":    42,
-			"vbool":   true,
-		},
-	}
-
-	var result NestedPointer
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got an err: %s", err.Error())
-	}
-
-	if result.Vfoo != "foo" {
-		t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo)
-	}
-
-	if result.Vbar.Vstring != "foo" {
-		t.Errorf("vstring value should be 'foo': %#v", result.Vbar.Vstring)
-	}
-
-	if result.Vbar.Vint != 42 {
-		t.Errorf("vint value should be 42: %#v", result.Vbar.Vint)
-	}
-
-	if result.Vbar.Vbool != true {
-		t.Errorf("vbool value should be true: %#v", result.Vbar.Vbool)
-	}
-
-	if result.Vbar.Vextra != "" {
-		t.Errorf("vextra value should be empty: %#v", result.Vbar.Vextra)
-	}
-}
-
-func TestSlice(t *testing.T) {
-	t.Parallel()
-
-	inputStringSlice := map[string]interface{}{
-		"vfoo": "foo",
-		"vbar": []string{"foo", "bar", "baz"},
-	}
-
-	inputStringSlicePointer := map[string]interface{}{
-		"vfoo": "foo",
-		"vbar": &[]string{"foo", "bar", "baz"},
-	}
-
-	outputStringSlice := &Slice{
-		"foo",
-		[]string{"foo", "bar", "baz"},
-	}
-
-	testSliceInput(t, inputStringSlice, outputStringSlice)
-	testSliceInput(t, inputStringSlicePointer, outputStringSlice)
-}
-
-func TestInvalidSlice(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vfoo": "foo",
-		"vbar": 42,
-	}
-
-	result := Slice{}
-	err := Decode(input, &result)
-	if err == nil {
-		t.Errorf("expected failure")
-	}
-}
-
-func TestSliceOfStruct(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"value": []map[string]interface{}{
-			{"vstring": "one"},
-			{"vstring": "two"},
-		},
-	}
-
-	var result SliceOfStruct
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got unexpected error: %s", err)
-	}
-
-	if len(result.Value) != 2 {
-		t.Fatalf("expected two values, got %d", len(result.Value))
-	}
-
-	if result.Value[0].Vstring != "one" {
-		t.Errorf("first value should be 'one', got: %s", result.Value[0].Vstring)
-	}
-
-	if result.Value[1].Vstring != "two" {
-		t.Errorf("second value should be 'two', got: %s", result.Value[1].Vstring)
-	}
-}
-
-func TestInvalidType(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vstring": 42,
-	}
-
-	var result Basic
-	err := Decode(input, &result)
-	if err == nil {
-		t.Fatal("error should exist")
-	}
-
-	derr, ok := err.(*Error)
-	if !ok {
-		t.Fatalf("error should be kind of Error, instead: %#v", err)
-	}
-
-	if derr.Errors[0] != "'Vstring' expected type 'string', got unconvertible type 'int'" {
-		t.Errorf("got unexpected error: %s", err)
-	}
-
-	inputNegIntUint := map[string]interface{}{
-		"vuint": -42,
-	}
-
-	err = Decode(inputNegIntUint, &result)
-	if err == nil {
-		t.Fatal("error should exist")
-	}
-
-	derr, ok = err.(*Error)
-	if !ok {
-		t.Fatalf("error should be kind of Error, instead: %#v", err)
-	}
-
-	if derr.Errors[0] != "cannot parse 'Vuint', -42 overflows uint" {
-		t.Errorf("got unexpected error: %s", err)
-	}
-
-	inputNegFloatUint := map[string]interface{}{
-		"vuint": -42.0,
-	}
-
-	err = Decode(inputNegFloatUint, &result)
-	if err == nil {
-		t.Fatal("error should exist")
-	}
-
-	derr, ok = err.(*Error)
-	if !ok {
-		t.Fatalf("error should be kind of Error, instead: %#v", err)
-	}
-
-	if derr.Errors[0] != "cannot parse 'Vuint', -42.000000 overflows uint" {
-		t.Errorf("got unexpected error: %s", err)
-	}
-}
-
-func TestMetadata(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vfoo": "foo",
-		"vbar": map[string]interface{}{
-			"vstring": "foo",
-			"Vuint":   42,
-			"foo":     "bar",
-		},
-		"bar": "nil",
-	}
-
-	var md Metadata
-	var result Nested
-	config := &DecoderConfig{
-		Metadata: &md,
-		Result:   &result,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		t.Fatalf("err: %s", err)
-	}
-
-	err = decoder.Decode(input)
-	if err != nil {
-		t.Fatalf("err: %s", err.Error())
-	}
-
-	expectedKeys := []string{"Vbar", "Vbar.Vstring", "Vbar.Vuint", "Vfoo"}
-	sort.Strings(md.Keys)
-	if !reflect.DeepEqual(md.Keys, expectedKeys) {
-		t.Fatalf("bad keys: %#v", md.Keys)
-	}
-
-	expectedUnused := []string{"Vbar.foo", "bar"}
-	if !reflect.DeepEqual(md.Unused, expectedUnused) {
-		t.Fatalf("bad unused: %#v", md.Unused)
-	}
-}
-
-func TestMetadata_Embedded(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"vstring": "foo",
-		"vunique": "bar",
-	}
-
-	var md Metadata
-	var result EmbeddedSquash
-	config := &DecoderConfig{
-		Metadata: &md,
-		Result:   &result,
-	}
-
-	decoder, err := NewDecoder(config)
-	if err != nil {
-		t.Fatalf("err: %s", err)
-	}
-
-	err = decoder.Decode(input)
-	if err != nil {
-		t.Fatalf("err: %s", err.Error())
-	}
-
-	expectedKeys := []string{"Vstring", "Vunique"}
-
-	sort.Strings(md.Keys)
-	if !reflect.DeepEqual(md.Keys, expectedKeys) {
-		t.Fatalf("bad keys: %#v", md.Keys)
-	}
-
-	expectedUnused := []string{}
-	if !reflect.DeepEqual(md.Unused, expectedUnused) {
-		t.Fatalf("bad unused: %#v", md.Unused)
-	}
-}
-
-func TestNonPtrValue(t *testing.T) {
-	t.Parallel()
-
-	err := Decode(map[string]interface{}{}, Basic{})
-	if err == nil {
-		t.Fatal("error should exist")
-	}
-
-	if err.Error() != "result must be a pointer" {
-		t.Errorf("got unexpected error: %s", err)
-	}
-}
-
-func TestTagged(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"foo": "bar",
-		"bar": "value",
-	}
-
-	var result Tagged
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("unexpected error: %s", err)
-	}
-
-	if result.Value != "bar" {
-		t.Errorf("value should be 'bar', got: %#v", result.Value)
-	}
-
-	if result.Extra != "value" {
-		t.Errorf("extra should be 'value', got: %#v", result.Extra)
-	}
-}
-
-func TestWeakDecode(t *testing.T) {
-	t.Parallel()
-
-	input := map[string]interface{}{
-		"foo": "4",
-		"bar": "value",
-	}
-
-	var result struct {
-		Foo int
-		Bar string
-	}
-
-	if err := WeakDecode(input, &result); err != nil {
-		t.Fatalf("err: %s", err)
-	}
-	if result.Foo != 4 {
-		t.Fatalf("bad: %#v", result)
-	}
-	if result.Bar != "value" {
-		t.Fatalf("bad: %#v", result)
-	}
-}
-
-func testSliceInput(t *testing.T, input map[string]interface{}, expected *Slice) {
-	var result Slice
-	err := Decode(input, &result)
-	if err != nil {
-		t.Fatalf("got error: %s", err)
-	}
-
-	if result.Vfoo != expected.Vfoo {
-		t.Errorf("Vfoo expected '%s', got '%s'", expected.Vfoo, result.Vfoo)
-	}
-
-	if result.Vbar == nil {
-		t.Fatalf("Vbar a slice, got '%#v'", result.Vbar)
-	}
-
-	if len(result.Vbar) != len(expected.Vbar) {
-		t.Errorf("Vbar length should be %d, got %d", len(expected.Vbar), len(result.Vbar))
-	}
-
-	for i, v := range result.Vbar {
-		if v != expected.Vbar[i] {
-			t.Errorf(
-				"Vbar[%d] should be '%#v', got '%#v'",
-				i, expected.Vbar[i], v)
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cast/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cast/.gitignore b/Godeps/_workspace/src/github.com/spf13/cast/.gitignore
deleted file mode 100644
index 8365624..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cast/.gitignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-*.test

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cast/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cast/LICENSE b/Godeps/_workspace/src/github.com/spf13/cast/LICENSE
deleted file mode 100644
index 4527efb..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cast/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Steve Francia
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cast/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cast/README.md b/Godeps/_workspace/src/github.com/spf13/cast/README.md
deleted file mode 100644
index af7a1fd..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cast/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-cast
-====
-
-Easy and safe casting from one type to another in Go
-
-Don’t Panic! ... Cast
-
-## What is Cast?
-
-Cast is a library to convert between different go types in a consistent and easy way.
-
-Cast provides simple functions to easily convert a number to a string, an
-interface into a bool, etc. Cast does this intelligently when an obvious
-conversion is possible. It doesn’t make any attempts to guess what you meant,
-for example you can only convert a string to an int when it is a string
-representation of an int such as “8”. Cast was developed for use in
-[Hugo](http://hugo.spf13.com), a website engine which uses YAML, TOML or JSON
-for meta data.
-
-## Why use Cast?
-
-When working with dynamic data in Go you often need to cast or convert the data
-from one type into another. Cast goes beyond just using type assertion (though
-it uses that when possible) to provide a very straightforward and convenient
-library.
-
-If you are working with interfaces to handle things like dynamic content
-you’ll need an easy way to convert an interface into a given type. This
-is the library for you.
-
-If you are taking in data from YAML, TOML or JSON or other formats which lack
-full types, then Cast is the library for you.
-
-## Usage
-
-Cast provides a handful of To_____ methods. These methods will always return
-the desired type. **If input is provided that will not convert to that type, the
-0 or nil value for that type will be returned**.
-
-Cast also provides identical methods To_____E. These return the same result as
-the To_____ methods, plus an additional error which tells you if it successfully
-converted. Using these methods you can tell the difference between when the
-input matched the zero value or when the conversion failed and the zero value
-was returned.
-
-The following examples are merely a sample of what is available. Please review
-the code for a complete set.
-
-### Example ‘ToString’:
-
-    cast.ToString("mayonegg")         // "mayonegg"
-    cast.ToString(8)                  // "8"
-    cast.ToString(8.31)               // "8.31"
-    cast.ToString([]byte("one time")) // "one time"
-    cast.ToString(nil)                // ""
-
-	var foo interface{} = "one more time"
-    cast.ToString(foo)                // "one more time"
-
-
-### Example ‘ToInt’:
-
-    cast.ToInt(8)                  // 8
-    cast.ToInt(8.31)               // 8
-    cast.ToInt("8")                // 8
-    cast.ToInt(true)               // 1
-    cast.ToInt(false)              // 0
-
-	var eight interface{} = 8
-    cast.ToInt(eight)              // 8
-    cast.ToInt(nil)                // 0
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cast/cast.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cast/cast.go b/Godeps/_workspace/src/github.com/spf13/cast/cast.go
deleted file mode 100644
index 1dde519..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cast/cast.go
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright © 2014 Steve Francia <sp...@spf13.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package cast
-
-import "time"
-
-func ToBool(i interface{}) bool {
-	v, _ := ToBoolE(i)
-	return v
-}
-
-func ToTime(i interface{}) time.Time {
-	v, _ := ToTimeE(i)
-	return v
-}
-
-func ToDuration(i interface{}) time.Duration {
-	v, _ := ToDurationE(i)
-	return v
-}
-
-func ToFloat64(i interface{}) float64 {
-	v, _ := ToFloat64E(i)
-	return v
-}
-
-func ToInt(i interface{}) int {
-	v, _ := ToIntE(i)
-	return v
-}
-
-func ToString(i interface{}) string {
-	v, _ := ToStringE(i)
-	return v
-}
-
-func ToStringMapString(i interface{}) map[string]string {
-	v, _ := ToStringMapStringE(i)
-	return v
-}
-
-func ToStringMapBool(i interface{}) map[string]bool {
-	v, _ := ToStringMapBoolE(i)
-	return v
-}
-
-func ToStringMap(i interface{}) map[string]interface{} {
-	v, _ := ToStringMapE(i)
-	return v
-}
-
-func ToSlice(i interface{}) []interface{} {
-	v, _ := ToSliceE(i)
-	return v
-}
-
-func ToStringSlice(i interface{}) []string {
-	v, _ := ToStringSliceE(i)
-	return v
-}
-
-func ToIntSlice(i interface{}) []int {
-	v, _ := ToIntSliceE(i)
-	return v
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cast/cast_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cast/cast_test.go b/Godeps/_workspace/src/github.com/spf13/cast/cast_test.go
deleted file mode 100644
index 3fa717f..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cast/cast_test.go
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright © 2014 Steve Francia <sp...@spf13.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package cast
-
-import (
-	"testing"
-
-	"html/template"
-
-	"github.com/stretchr/testify/assert"
-)
-
-func TestToInt(t *testing.T) {
-	var eight interface{} = 8
-	assert.Equal(t, ToInt(8), 8)
-	assert.Equal(t, ToInt(8.31), 8)
-	assert.Equal(t, ToInt("8"), 8)
-	assert.Equal(t, ToInt(true), 1)
-	assert.Equal(t, ToInt(false), 0)
-	assert.Equal(t, ToInt(eight), 8)
-}
-
-func TestToFloat64(t *testing.T) {
-	var eight interface{} = 8
-	assert.Equal(t, ToFloat64(8), 8.00)
-	assert.Equal(t, ToFloat64(8.31), 8.31)
-	assert.Equal(t, ToFloat64("8.31"), 8.31)
-	assert.Equal(t, ToFloat64(eight), 8.0)
-}
-
-func TestToString(t *testing.T) {
-	var foo interface{} = "one more time"
-	assert.Equal(t, ToString(8), "8")
-	assert.Equal(t, ToString(8.12), "8.12")
-	assert.Equal(t, ToString([]byte("one time")), "one time")
-	assert.Equal(t, ToString(template.HTML("one time")), "one time")
-	assert.Equal(t, ToString(foo), "one more time")
-	assert.Equal(t, ToString(nil), "")
-}
-
-type foo struct {
-	val string
-}
-
-func (x foo) String() string {
-	return x.val
-}
-
-func TestStringerToString(t *testing.T) {
-
-	var x foo
-	x.val = "bar"
-	assert.Equal(t, "bar", ToString(x))
-}
-
-type fu struct {
-	val string
-}
-
-func (x fu) Error() string {
-	return x.val
-}
-
-func TestErrorToString(t *testing.T) {
-	var x fu
-	x.val = "bar"
-	assert.Equal(t, "bar", ToString(x))
-}
-
-func TestMaps(t *testing.T) {
-	var taxonomies = map[interface{}]interface{}{"tag": "tags", "group": "groups"}
-	var stringMapBool = map[interface{}]interface{}{"v1": true, "v2": false}
-	assert.Equal(t, ToStringMap(taxonomies), map[string]interface{}{"tag": "tags", "group": "groups"})
-	assert.Equal(t, ToStringMapBool(stringMapBool), map[string]bool{"v1": true, "v2": false})
-}
-
-func TestSlices(t *testing.T) {
-	assert.Equal(t, []string{"a", "b"}, ToStringSlice([]string{"a", "b"}))
-	assert.Equal(t, []string{"1", "3"}, ToStringSlice([]interface{}{1, 3}))
-	assert.Equal(t, []int{1, 3}, ToIntSlice([]int{1, 3}))
-	assert.Equal(t, []int{1, 3}, ToIntSlice([]interface{}{1.2, 3.2}))
-	assert.Equal(t, []int{2, 3}, ToIntSlice([]string{"2", "3"}))
-	assert.Equal(t, []int{2, 3}, ToIntSlice([2]string{"2", "3"}))
-}
-
-func TestToBool(t *testing.T) {
-	assert.Equal(t, ToBool(0), false)
-	assert.Equal(t, ToBool(nil), false)
-	assert.Equal(t, ToBool("false"), false)
-	assert.Equal(t, ToBool("FALSE"), false)
-	assert.Equal(t, ToBool("False"), false)
-	assert.Equal(t, ToBool("f"), false)
-	assert.Equal(t, ToBool("F"), false)
-	assert.Equal(t, ToBool(false), false)
-	assert.Equal(t, ToBool("foo"), false)
-
-	assert.Equal(t, ToBool("true"), true)
-	assert.Equal(t, ToBool("TRUE"), true)
-	assert.Equal(t, ToBool("True"), true)
-	assert.Equal(t, ToBool("t"), true)
-	assert.Equal(t, ToBool("T"), true)
-	assert.Equal(t, ToBool(1), true)
-	assert.Equal(t, ToBool(true), true)
-	assert.Equal(t, ToBool(-1), true)
-}
-
-func TestIndirectPointers(t *testing.T) {
-	x := 13
-	y := &x
-	z := &y
-
-	assert.Equal(t, ToInt(y), 13)
-	assert.Equal(t, ToInt(z), 13)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cast/caste.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cast/caste.go b/Godeps/_workspace/src/github.com/spf13/cast/caste.go
deleted file mode 100644
index 58d72df..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cast/caste.go
+++ /dev/null
@@ -1,378 +0,0 @@
-// Copyright © 2014 Steve Francia <sp...@spf13.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package cast
-
-import (
-	"errors"
-	"fmt"
-	"html/template"
-	"reflect"
-	"strconv"
-	"strings"
-	"time"
-
-	jww "github.com/spf13/jwalterweatherman"
-)
-
-func ToTimeE(i interface{}) (tim time.Time, err error) {
-	i = indirect(i)
-	jww.DEBUG.Println("ToTimeE called on type:", reflect.TypeOf(i))
-
-	switch s := i.(type) {
-	case time.Time:
-		return s, nil
-	case string:
-		d, e := StringToDate(s)
-		if e == nil {
-			return d, nil
-		}
-		return time.Time{}, fmt.Errorf("Could not parse Date/Time format: %v\n", e)
-	default:
-		return time.Time{}, fmt.Errorf("Unable to Cast %#v to Time\n", i)
-	}
-}
-
-func ToDurationE(i interface{}) (d time.Duration, err error) {
-	i = indirect(i)
-	jww.DEBUG.Println("ToDurationE called on type:", reflect.TypeOf(i))
-
-	switch s := i.(type) {
-	case time.Duration:
-		return s, nil
-	case string:
-		d, err = time.ParseDuration(s)
-		return
-	default:
-		err = fmt.Errorf("Unable to Cast %#v to Duration\n", i)
-		return
-	}
-}
-
-func ToBoolE(i interface{}) (bool, error) {
-	i = indirect(i)
-	jww.DEBUG.Println("ToBoolE called on type:", reflect.TypeOf(i))
-
-	switch b := i.(type) {
-	case bool:
-		return b, nil
-	case nil:
-		return false, nil
-	case int:
-		if i.(int) != 0 {
-			return true, nil
-		}
-		return false, nil
-	case string:
-		return strconv.ParseBool(i.(string))
-	default:
-		return false, fmt.Errorf("Unable to Cast %#v to bool", i)
-	}
-}
-
-func ToFloat64E(i interface{}) (float64, error) {
-	i = indirect(i)
-	jww.DEBUG.Println("ToFloat64E called on type:", reflect.TypeOf(i))
-
-	switch s := i.(type) {
-	case float64:
-		return s, nil
-	case float32:
-		return float64(s), nil
-	case int64:
-		return float64(s), nil
-	case int32:
-		return float64(s), nil
-	case int16:
-		return float64(s), nil
-	case int8:
-		return float64(s), nil
-	case int:
-		return float64(s), nil
-	case string:
-		v, err := strconv.ParseFloat(s, 64)
-		if err == nil {
-			return float64(v), nil
-		} else {
-			return 0.0, fmt.Errorf("Unable to Cast %#v to float", i)
-		}
-	default:
-		return 0.0, fmt.Errorf("Unable to Cast %#v to float", i)
-	}
-}
-
-func ToIntE(i interface{}) (int, error) {
-	i = indirect(i)
-	jww.DEBUG.Println("ToIntE called on type:", reflect.TypeOf(i))
-
-	switch s := i.(type) {
-	case int:
-		return s, nil
-	case int64:
-		return int(s), nil
-	case int32:
-		return int(s), nil
-	case int16:
-		return int(s), nil
-	case int8:
-		return int(s), nil
-	case string:
-		v, err := strconv.ParseInt(s, 0, 0)
-		if err == nil {
-			return int(v), nil
-		} else {
-			return 0, fmt.Errorf("Unable to Cast %#v to int", i)
-		}
-	case float64:
-		return int(s), nil
-	case bool:
-		if bool(s) {
-			return 1, nil
-		} else {
-			return 0, nil
-		}
-	case nil:
-		return 0, nil
-	default:
-		return 0, fmt.Errorf("Unable to Cast %#v to int", i)
-	}
-}
-
-// From html/template/content.go
-// Copyright 2011 The Go Authors. All rights reserved.
-// indirect returns the value, after dereferencing as many times
-// as necessary to reach the base type (or nil).
-func indirect(a interface{}) interface{} {
-	if a == nil {
-		return nil
-	}
-	if t := reflect.TypeOf(a); t.Kind() != reflect.Ptr {
-		// Avoid creating a reflect.Value if it's not a pointer.
-		return a
-	}
-	v := reflect.ValueOf(a)
-	for v.Kind() == reflect.Ptr && !v.IsNil() {
-		v = v.Elem()
-	}
-	return v.Interface()
-}
-
-// From html/template/content.go
-// Copyright 2011 The Go Authors. All rights reserved.
-// indirectToStringerOrError returns the value, after dereferencing as many times
-// as necessary to reach the base type (or nil) or an implementation of fmt.Stringer
-// or error,
-func indirectToStringerOrError(a interface{}) interface{} {
-	if a == nil {
-		return nil
-	}
-
-	var errorType = reflect.TypeOf((*error)(nil)).Elem()
-	var fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
-
-	v := reflect.ValueOf(a)
-	for !v.Type().Implements(fmtStringerType) && !v.Type().Implements(errorType) && v.Kind() == reflect.Ptr && !v.IsNil() {
-		v = v.Elem()
-	}
-	return v.Interface()
-}
-
-func ToStringE(i interface{}) (string, error) {
-	i = indirectToStringerOrError(i)
-	jww.DEBUG.Println("ToStringE called on type:", reflect.TypeOf(i))
-
-	switch s := i.(type) {
-	case string:
-		return s, nil
-	case float64:
-		return strconv.FormatFloat(i.(float64), 'f', -1, 64), nil
-	case int:
-		return strconv.FormatInt(int64(i.(int)), 10), nil
-	case []byte:
-		return string(s), nil
-	case template.HTML:
-		return string(s), nil
-	case nil:
-		return "", nil
-	case fmt.Stringer:
-		return s.String(), nil
-	case error:
-		return s.Error(), nil
-	default:
-		return "", fmt.Errorf("Unable to Cast %#v to string", i)
-	}
-}
-
-func ToStringMapStringE(i interface{}) (map[string]string, error) {
-	jww.DEBUG.Println("ToStringMapStringE called on type:", reflect.TypeOf(i))
-
-	var m = map[string]string{}
-
-	switch v := i.(type) {
-	case map[interface{}]interface{}:
-		for k, val := range v {
-			m[ToString(k)] = ToString(val)
-		}
-		return m, nil
-	case map[string]interface{}:
-		for k, val := range v {
-			m[ToString(k)] = ToString(val)
-		}
-		return m, nil
-	case map[string]string:
-		return v, nil
-	default:
-		return m, fmt.Errorf("Unable to Cast %#v to map[string]string", i)
-	}
-	return m, fmt.Errorf("Unable to Cast %#v to map[string]string", i)
-}
-
-func ToStringMapBoolE(i interface{}) (map[string]bool, error) {
-	jww.DEBUG.Println("ToStringMapBoolE called on type:", reflect.TypeOf(i))
-
-	var m = map[string]bool{}
-
-	switch v := i.(type) {
-	case map[interface{}]interface{}:
-		for k, val := range v {
-			m[ToString(k)] = ToBool(val)
-		}
-		return m, nil
-	case map[string]interface{}:
-		for k, val := range v {
-			m[ToString(k)] = ToBool(val)
-		}
-		return m, nil
-	case map[string]bool:
-		return v, nil
-	default:
-		return m, fmt.Errorf("Unable to Cast %#v to map[string]bool", i)
-	}
-	return m, fmt.Errorf("Unable to Cast %#v to map[string]bool", i)
-}
-
-func ToStringMapE(i interface{}) (map[string]interface{}, error) {
-	jww.DEBUG.Println("ToStringMapE called on type:", reflect.TypeOf(i))
-
-	var m = map[string]interface{}{}
-
-	switch v := i.(type) {
-	case map[interface{}]interface{}:
-		for k, val := range v {
-			m[ToString(k)] = val
-		}
-		return m, nil
-	case map[string]interface{}:
-		return v, nil
-	default:
-		return m, fmt.Errorf("Unable to Cast %#v to map[string]interface{}", i)
-	}
-
-	return m, fmt.Errorf("Unable to Cast %#v to map[string]interface{}", i)
-}
-
-func ToSliceE(i interface{}) ([]interface{}, error) {
-	jww.DEBUG.Println("ToSliceE called on type:", reflect.TypeOf(i))
-
-	var s []interface{}
-
-	switch v := i.(type) {
-	case []interface{}:
-		for _, u := range v {
-			s = append(s, u)
-		}
-		return s, nil
-	case []map[string]interface{}:
-		for _, u := range v {
-			s = append(s, u)
-		}
-		return s, nil
-	default:
-		return s, fmt.Errorf("Unable to Cast %#v of type %v to []interface{}", i, reflect.TypeOf(i))
-	}
-
-	return s, fmt.Errorf("Unable to Cast %#v to []interface{}", i)
-}
-
-func ToStringSliceE(i interface{}) ([]string, error) {
-	jww.DEBUG.Println("ToStringSliceE called on type:", reflect.TypeOf(i))
-
-	var a []string
-
-	switch v := i.(type) {
-	case []interface{}:
-		for _, u := range v {
-			a = append(a, ToString(u))
-		}
-		return a, nil
-	case []string:
-		return v, nil
-	case string:
-		return strings.Fields(v), nil
-	default:
-		return a, fmt.Errorf("Unable to Cast %#v to []string", i)
-	}
-
-	return a, fmt.Errorf("Unable to Cast %#v to []string", i)
-}
-
-func ToIntSliceE(i interface{}) ([]int, error) {
-	jww.DEBUG.Println("ToIntSliceE called on type:", reflect.TypeOf(i))
-
-	if i == nil {
-		return []int{}, fmt.Errorf("Unable to Cast %#v to []int", i)
-	}
-
-	switch v := i.(type) {
-	case []int:
-		return v, nil
-	}
-
-	kind := reflect.TypeOf(i).Kind()
-	switch kind {
-	case reflect.Slice, reflect.Array:
-		s := reflect.ValueOf(i)
-		a := make([]int, s.Len())
-		for j := 0; j < s.Len(); j++ {
-			val, err := ToIntE(s.Index(j).Interface())
-			if err != nil {
-				return []int{}, fmt.Errorf("Unable to Cast %#v to []int", i)
-			}
-			a[j] = val
-		}
-		return a, nil
-	default:
-		return []int{}, fmt.Errorf("Unable to Cast %#v to []int", i)
-	}
-
-	return []int{}, fmt.Errorf("Unable to Cast %#v to []int", i)
-}
-
-func StringToDate(s string) (time.Time, error) {
-	return parseDateWith(s, []string{
-		time.RFC3339,
-		"2006-01-02T15:04:05", // iso8601 without timezone
-		time.RFC1123Z,
-		time.RFC1123,
-		time.RFC822Z,
-		time.RFC822,
-		time.ANSIC,
-		time.UnixDate,
-		time.RubyDate,
-		"2006-01-02 15:04:05Z07:00",
-		"02 Jan 06 15:04 MST",
-		"2006-01-02",
-		"02 Jan 2006",
-	})
-}
-
-func parseDateWith(s string, dates []string) (d time.Time, e error) {
-	for _, dateType := range dates {
-		if d, e = time.Parse(dateType, s); e == nil {
-			return
-		}
-	}
-	return d, errors.New(fmt.Sprintf("Unable to parse date: %s", s))
-}



[21/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/README.md b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/README.md
new file mode 100644
index 0000000..5a5df63
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/README.md
@@ -0,0 +1,220 @@
+## TOML parser and encoder for Go with reflection
+
+TOML stands for Tom's Obvious, Minimal Language. This Go package provides a
+reflection interface similar to Go's standard library `json` and `xml` 
+packages. This package also supports the `encoding.TextUnmarshaler` and
+`encoding.TextMarshaler` interfaces so that you can define custom data 
+representations. (There is an example of this below.)
+
+Spec: https://github.com/mojombo/toml
+
+Compatible with TOML version
+[v0.2.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.2.0.md)
+
+Documentation: http://godoc.org/github.com/BurntSushi/toml
+
+Installation:
+
+```bash
+go get github.com/BurntSushi/toml
+```
+
+Try the toml validator:
+
+```bash
+go get github.com/BurntSushi/toml/cmd/tomlv
+tomlv some-toml-file.toml
+```
+
+[![Build status](https://api.travis-ci.org/BurntSushi/toml.png)](https://travis-ci.org/BurntSushi/toml)
+
+
+### Testing
+
+This package passes all tests in
+[toml-test](https://github.com/BurntSushi/toml-test) for both the decoder
+and the encoder.
+
+### Examples
+
+This package works similarly to how the Go standard library handles `XML`
+and `JSON`. Namely, data is loaded into Go values via reflection.
+
+For the simplest example, consider some TOML file as just a list of keys
+and values:
+
+```toml
+Age = 25
+Cats = [ "Cauchy", "Plato" ]
+Pi = 3.14
+Perfection = [ 6, 28, 496, 8128 ]
+DOB = 1987-07-05T05:45:00Z
+```
+
+Which could be defined in Go as:
+
+```go
+type Config struct {
+  Age int
+  Cats []string
+  Pi float64
+  Perfection []int
+  DOB time.Time // requires `import time`
+}
+```
+
+And then decoded with:
+
+```go
+var conf Config
+if _, err := toml.Decode(tomlData, &conf); err != nil {
+  // handle error
+}
+```
+
+You can also use struct tags if your struct field name doesn't map to a TOML
+key value directly:
+
+```toml
+some_key_NAME = "wat"
+```
+
+```go
+type TOML struct {
+  ObscureKey string `toml:"some_key_NAME"`
+}
+```
+
+### Using the `encoding.TextUnmarshaler` interface
+
+Here's an example that automatically parses duration strings into 
+`time.Duration` values:
+
+```toml
+[[song]]
+name = "Thunder Road"
+duration = "4m49s"
+
+[[song]]
+name = "Stairway to Heaven"
+duration = "8m03s"
+```
+
+Which can be decoded with:
+
+```go
+type song struct {
+  Name     string
+  Duration duration
+}
+type songs struct {
+  Song []song
+}
+var favorites songs
+if _, err := toml.Decode(blob, &favorites); err != nil {
+  log.Fatal(err)
+}
+
+for _, s := range favorites.Song {
+  fmt.Printf("%s (%s)\n", s.Name, s.Duration)
+}
+```
+
+And you'll also need a `duration` type that satisfies the 
+`encoding.TextUnmarshaler` interface:
+
+```go
+type duration struct {
+	time.Duration
+}
+
+func (d *duration) UnmarshalText(text []byte) error {
+	var err error
+	d.Duration, err = time.ParseDuration(string(text))
+	return err
+}
+```
+
+### More complex usage
+
+Here's an example of how to load the example from the official spec page:
+
+```toml
+# This is a TOML document. Boom.
+
+title = "TOML Example"
+
+[owner]
+name = "Tom Preston-Werner"
+organization = "GitHub"
+bio = "GitHub Cofounder & CEO\nLikes tater tots and beer."
+dob = 1979-05-27T07:32:00Z # First class dates? Why not?
+
+[database]
+server = "192.168.1.1"
+ports = [ 8001, 8001, 8002 ]
+connection_max = 5000
+enabled = true
+
+[servers]
+
+  # You can indent as you please. Tabs or spaces. TOML don't care.
+  [servers.alpha]
+  ip = "10.0.0.1"
+  dc = "eqdc10"
+
+  [servers.beta]
+  ip = "10.0.0.2"
+  dc = "eqdc10"
+
+[clients]
+data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it
+
+# Line breaks are OK when inside arrays
+hosts = [
+  "alpha",
+  "omega"
+]
+```
+
+And the corresponding Go types are:
+
+```go
+type tomlConfig struct {
+	Title string
+	Owner ownerInfo
+	DB database `toml:"database"`
+	Servers map[string]server
+	Clients clients
+}
+
+type ownerInfo struct {
+	Name string
+	Org string `toml:"organization"`
+	Bio string
+	DOB time.Time
+}
+
+type database struct {
+	Server string
+	Ports []int
+	ConnMax int `toml:"connection_max"`
+	Enabled bool
+}
+
+type server struct {
+	IP string
+	DC string
+}
+
+type clients struct {
+	Data [][]interface{}
+	Hosts []string
+}
+```
+
+Note that a case insensitive match will be tried if an exact match can't be
+found.
+
+A working example of the above can be found in `_examples/example.{go,toml}`.
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING
new file mode 100644
index 0000000..5a8e332
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING
@@ -0,0 +1,14 @@
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+                    Version 2, December 2004
+
+ Copyright (C) 2004 Sam Hocevar <sa...@hocevar.net>
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. You just DO WHAT THE FUCK YOU WANT TO.
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/README.md b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/README.md
new file mode 100644
index 0000000..24421eb
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/README.md
@@ -0,0 +1,14 @@
+# Implements the TOML test suite interface
+
+This is an implementation of the interface expected by
+[toml-test](https://github.com/BurntSushi/toml-test) for my
+[toml parser written in Go](https://github.com/BurntSushi/toml).
+In particular, it maps TOML data on `stdin` to a JSON format on `stdout`.
+
+
+Compatible with TOML version
+[v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md)
+
+Compatible with `toml-test` version
+[v0.2.0](https://github.com/BurntSushi/toml-test/tree/v0.2.0)
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go
new file mode 100644
index 0000000..14e7557
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go
@@ -0,0 +1,90 @@
+// Command toml-test-decoder satisfies the toml-test interface for testing
+// TOML decoders. Namely, it accepts TOML on stdin and outputs JSON on stdout.
+package main
+
+import (
+	"encoding/json"
+	"flag"
+	"fmt"
+	"log"
+	"os"
+	"path"
+	"time"
+
+	"github.com/BurntSushi/toml"
+)
+
+func init() {
+	log.SetFlags(0)
+
+	flag.Usage = usage
+	flag.Parse()
+}
+
+func usage() {
+	log.Printf("Usage: %s < toml-file\n", path.Base(os.Args[0]))
+	flag.PrintDefaults()
+
+	os.Exit(1)
+}
+
+func main() {
+	if flag.NArg() != 0 {
+		flag.Usage()
+	}
+
+	var tmp interface{}
+	if _, err := toml.DecodeReader(os.Stdin, &tmp); err != nil {
+		log.Fatalf("Error decoding TOML: %s", err)
+	}
+
+	typedTmp := translate(tmp)
+	if err := json.NewEncoder(os.Stdout).Encode(typedTmp); err != nil {
+		log.Fatalf("Error encoding JSON: %s", err)
+	}
+}
+
+func translate(tomlData interface{}) interface{} {
+	switch orig := tomlData.(type) {
+	case map[string]interface{}:
+		typed := make(map[string]interface{}, len(orig))
+		for k, v := range orig {
+			typed[k] = translate(v)
+		}
+		return typed
+	case []map[string]interface{}:
+		typed := make([]map[string]interface{}, len(orig))
+		for i, v := range orig {
+			typed[i] = translate(v).(map[string]interface{})
+		}
+		return typed
+	case []interface{}:
+		typed := make([]interface{}, len(orig))
+		for i, v := range orig {
+			typed[i] = translate(v)
+		}
+
+		// We don't really need to tag arrays, but let's be future proof.
+		// (If TOML ever supports tuples, we'll need this.)
+		return tag("array", typed)
+	case time.Time:
+		return tag("datetime", orig.Format("2006-01-02T15:04:05Z"))
+	case bool:
+		return tag("bool", fmt.Sprintf("%v", orig))
+	case int64:
+		return tag("integer", fmt.Sprintf("%d", orig))
+	case float64:
+		return tag("float", fmt.Sprintf("%v", orig))
+	case string:
+		return tag("string", orig)
+	}
+
+	panic(fmt.Sprintf("Unknown type: %T", tomlData))
+}
+
+func tag(typeName string, data interface{}) map[string]interface{} {
+	return map[string]interface{}{
+		"type":  typeName,
+		"value": data,
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING
new file mode 100644
index 0000000..5a8e332
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING
@@ -0,0 +1,14 @@
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+                    Version 2, December 2004
+
+ Copyright (C) 2004 Sam Hocevar <sa...@hocevar.net>
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. You just DO WHAT THE FUCK YOU WANT TO.
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/README.md b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/README.md
new file mode 100644
index 0000000..45a603f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/README.md
@@ -0,0 +1,14 @@
+# Implements the TOML test suite interface for TOML encoders
+
+This is an implementation of the interface expected by
+[toml-test](https://github.com/BurntSushi/toml-test) for the
+[TOML encoder](https://github.com/BurntSushi/toml).
+In particular, it maps JSON data on `stdin` to a TOML format on `stdout`.
+
+
+Compatible with TOML version
+[v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md)
+
+Compatible with `toml-test` version
+[v0.2.0](https://github.com/BurntSushi/toml-test/tree/v0.2.0)
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go
new file mode 100644
index 0000000..092cc68
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go
@@ -0,0 +1,131 @@
+// Command toml-test-encoder satisfies the toml-test interface for testing
+// TOML encoders. Namely, it accepts JSON on stdin and outputs TOML on stdout.
+package main
+
+import (
+	"encoding/json"
+	"flag"
+	"log"
+	"os"
+	"path"
+	"strconv"
+	"time"
+
+	"github.com/BurntSushi/toml"
+)
+
+func init() {
+	log.SetFlags(0)
+
+	flag.Usage = usage
+	flag.Parse()
+}
+
+func usage() {
+	log.Printf("Usage: %s < json-file\n", path.Base(os.Args[0]))
+	flag.PrintDefaults()
+
+	os.Exit(1)
+}
+
+func main() {
+	if flag.NArg() != 0 {
+		flag.Usage()
+	}
+
+	var tmp interface{}
+	if err := json.NewDecoder(os.Stdin).Decode(&tmp); err != nil {
+		log.Fatalf("Error decoding JSON: %s", err)
+	}
+
+	tomlData := translate(tmp)
+	if err := toml.NewEncoder(os.Stdout).Encode(tomlData); err != nil {
+		log.Fatalf("Error encoding TOML: %s", err)
+	}
+}
+
+func translate(typedJson interface{}) interface{} {
+	switch v := typedJson.(type) {
+	case map[string]interface{}:
+		if len(v) == 2 && in("type", v) && in("value", v) {
+			return untag(v)
+		}
+		m := make(map[string]interface{}, len(v))
+		for k, v2 := range v {
+			m[k] = translate(v2)
+		}
+		return m
+	case []interface{}:
+		tabArray := make([]map[string]interface{}, len(v))
+		for i := range v {
+			if m, ok := translate(v[i]).(map[string]interface{}); ok {
+				tabArray[i] = m
+			} else {
+				log.Fatalf("JSON arrays may only contain objects. This " +
+					"corresponds to only tables being allowed in " +
+					"TOML table arrays.")
+			}
+		}
+		return tabArray
+	}
+	log.Fatalf("Unrecognized JSON format '%T'.", typedJson)
+	panic("unreachable")
+}
+
+func untag(typed map[string]interface{}) interface{} {
+	t := typed["type"].(string)
+	v := typed["value"]
+	switch t {
+	case "string":
+		return v.(string)
+	case "integer":
+		v := v.(string)
+		n, err := strconv.Atoi(v)
+		if err != nil {
+			log.Fatalf("Could not parse '%s' as integer: %s", v, err)
+		}
+		return n
+	case "float":
+		v := v.(string)
+		f, err := strconv.ParseFloat(v, 64)
+		if err != nil {
+			log.Fatalf("Could not parse '%s' as float64: %s", v, err)
+		}
+		return f
+	case "datetime":
+		v := v.(string)
+		t, err := time.Parse("2006-01-02T15:04:05Z", v)
+		if err != nil {
+			log.Fatalf("Could not parse '%s' as a datetime: %s", v, err)
+		}
+		return t
+	case "bool":
+		v := v.(string)
+		switch v {
+		case "true":
+			return true
+		case "false":
+			return false
+		}
+		log.Fatalf("Could not parse '%s' as a boolean.", v)
+	case "array":
+		v := v.([]interface{})
+		array := make([]interface{}, len(v))
+		for i := range v {
+			if m, ok := v[i].(map[string]interface{}); ok {
+				array[i] = untag(m)
+			} else {
+				log.Fatalf("Arrays may only contain other arrays or "+
+					"primitive values, but found a '%T'.", m)
+			}
+		}
+		return array
+	}
+	log.Fatalf("Unrecognized tag type '%s'.", t)
+	panic("unreachable")
+}
+
+func in(key string, m map[string]interface{}) bool {
+	_, ok := m[key]
+	return ok
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/COPYING
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/COPYING b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/COPYING
new file mode 100644
index 0000000..5a8e332
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/COPYING
@@ -0,0 +1,14 @@
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+                    Version 2, December 2004
+
+ Copyright (C) 2004 Sam Hocevar <sa...@hocevar.net>
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. You just DO WHAT THE FUCK YOU WANT TO.
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/README.md b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/README.md
new file mode 100644
index 0000000..5df0dc3
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/README.md
@@ -0,0 +1,22 @@
+# TOML Validator
+
+If Go is installed, it's simple to try it out:
+
+```bash
+go get github.com/BurntSushi/toml/cmd/tomlv
+tomlv some-toml-file.toml
+```
+
+You can see the types of every key in a TOML file with:
+
+```bash
+tomlv -types some-toml-file.toml
+```
+
+At the moment, only one error message is reported at a time. Error messages
+include line numbers. No output means that the files given are valid TOML, or 
+there is a bug in `tomlv`.
+
+Compatible with TOML version
+[v0.1.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.1.0.md)
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/main.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/main.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/main.go
new file mode 100644
index 0000000..c7d689a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/cmd/tomlv/main.go
@@ -0,0 +1,61 @@
+// Command tomlv validates TOML documents and prints each key's type.
+package main
+
+import (
+	"flag"
+	"fmt"
+	"log"
+	"os"
+	"path"
+	"strings"
+	"text/tabwriter"
+
+	"github.com/BurntSushi/toml"
+)
+
+var (
+	flagTypes = false
+)
+
+func init() {
+	log.SetFlags(0)
+
+	flag.BoolVar(&flagTypes, "types", flagTypes,
+		"When set, the types of every defined key will be shown.")
+
+	flag.Usage = usage
+	flag.Parse()
+}
+
+func usage() {
+	log.Printf("Usage: %s toml-file [ toml-file ... ]\n",
+		path.Base(os.Args[0]))
+	flag.PrintDefaults()
+
+	os.Exit(1)
+}
+
+func main() {
+	if flag.NArg() < 1 {
+		flag.Usage()
+	}
+	for _, f := range flag.Args() {
+		var tmp interface{}
+		md, err := toml.DecodeFile(f, &tmp)
+		if err != nil {
+			log.Fatalf("Error in '%s': %s", f, err)
+		}
+		if flagTypes {
+			printTypes(md)
+		}
+	}
+}
+
+func printTypes(md toml.MetaData) {
+	tabw := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
+	for _, key := range md.Keys() {
+		fmt.Fprintf(tabw, "%s%s\t%s\n",
+			strings.Repeat("    ", len(key)-1), key, md.Type(key...))
+	}
+	tabw.Flush()
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode.go
new file mode 100644
index 0000000..6c7d398
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode.go
@@ -0,0 +1,492 @@
+package toml
+
+import (
+	"fmt"
+	"io"
+	"io/ioutil"
+	"math"
+	"reflect"
+	"strings"
+	"time"
+)
+
+var e = fmt.Errorf
+
+// Unmarshaler is the interface implemented by objects that can unmarshal a
+// TOML description of themselves.
+type Unmarshaler interface {
+	UnmarshalTOML(interface{}) error
+}
+
+// Unmarshal decodes the contents of `p` in TOML format into a pointer `v`.
+func Unmarshal(p []byte, v interface{}) error {
+	_, err := Decode(string(p), v)
+	return err
+}
+
+// Primitive is a TOML value that hasn't been decoded into a Go value.
+// When using the various `Decode*` functions, the type `Primitive` may
+// be given to any value, and its decoding will be delayed.
+//
+// A `Primitive` value can be decoded using the `PrimitiveDecode` function.
+//
+// The underlying representation of a `Primitive` value is subject to change.
+// Do not rely on it.
+//
+// N.B. Primitive values are still parsed, so using them will only avoid
+// the overhead of reflection. They can be useful when you don't know the
+// exact type of TOML data until run time.
+type Primitive struct {
+	undecoded interface{}
+	context   Key
+}
+
+// DEPRECATED!
+//
+// Use MetaData.PrimitiveDecode instead.
+func PrimitiveDecode(primValue Primitive, v interface{}) error {
+	md := MetaData{decoded: make(map[string]bool)}
+	return md.unify(primValue.undecoded, rvalue(v))
+}
+
+// PrimitiveDecode is just like the other `Decode*` functions, except it
+// decodes a TOML value that has already been parsed. Valid primitive values
+// can *only* be obtained from values filled by the decoder functions,
+// including this method. (i.e., `v` may contain more `Primitive`
+// values.)
+//
+// Meta data for primitive values is included in the meta data returned by
+// the `Decode*` functions with one exception: keys returned by the Undecoded
+// method will only reflect keys that were decoded. Namely, any keys hidden
+// behind a Primitive will be considered undecoded. Executing this method will
+// update the undecoded keys in the meta data. (See the example.)
+func (md *MetaData) PrimitiveDecode(primValue Primitive, v interface{}) error {
+	md.context = primValue.context
+	defer func() { md.context = nil }()
+	return md.unify(primValue.undecoded, rvalue(v))
+}
+
+// Decode will decode the contents of `data` in TOML format into a pointer
+// `v`.
+//
+// TOML hashes correspond to Go structs or maps. (Dealer's choice. They can be
+// used interchangeably.)
+//
+// TOML arrays of tables correspond to either a slice of structs or a slice
+// of maps.
+//
+// TOML datetimes correspond to Go `time.Time` values.
+//
+// All other TOML types (float, string, int, bool and array) correspond
+// to the obvious Go types.
+//
+// An exception to the above rules is if a type implements the
+// encoding.TextUnmarshaler interface. In this case, any primitive TOML value
+// (floats, strings, integers, booleans and datetimes) will be converted to
+// a byte string and given to the value's UnmarshalText method. See the
+// Unmarshaler example for a demonstration with time duration strings.
+//
+// Key mapping
+//
+// TOML keys can map to either keys in a Go map or field names in a Go
+// struct. The special `toml` struct tag may be used to map TOML keys to
+// struct fields that don't match the key name exactly. (See the example.)
+// A case insensitive match to struct names will be tried if an exact match
+// can't be found.
+//
+// The mapping between TOML values and Go values is loose. That is, there
+// may exist TOML values that cannot be placed into your representation, and
+// there may be parts of your representation that do not correspond to
+// TOML values. This loose mapping can be made stricter by using the IsDefined
+// and/or Undecoded methods on the MetaData returned.
+//
+// This decoder will not handle cyclic types. If a cyclic type is passed,
+// `Decode` will not terminate.
+func Decode(data string, v interface{}) (MetaData, error) {
+	p, err := parse(data)
+	if err != nil {
+		return MetaData{}, err
+	}
+	md := MetaData{
+		p.mapping, p.types, p.ordered,
+		make(map[string]bool, len(p.ordered)), nil,
+	}
+	return md, md.unify(p.mapping, rvalue(v))
+}
+
+// DecodeFile is just like Decode, except it will automatically read the
+// contents of the file at `fpath` and decode it for you.
+func DecodeFile(fpath string, v interface{}) (MetaData, error) {
+	bs, err := ioutil.ReadFile(fpath)
+	if err != nil {
+		return MetaData{}, err
+	}
+	return Decode(string(bs), v)
+}
+
+// DecodeReader is just like Decode, except it will consume all bytes
+// from the reader and decode it for you.
+func DecodeReader(r io.Reader, v interface{}) (MetaData, error) {
+	bs, err := ioutil.ReadAll(r)
+	if err != nil {
+		return MetaData{}, err
+	}
+	return Decode(string(bs), v)
+}
+
+// unify performs a sort of type unification based on the structure of `rv`,
+// which is the client representation.
+//
+// Any type mismatch produces an error. Finding a type that we don't know
+// how to handle produces an unsupported type error.
+func (md *MetaData) unify(data interface{}, rv reflect.Value) error {
+
+	// Special case. Look for a `Primitive` value.
+	if rv.Type() == reflect.TypeOf((*Primitive)(nil)).Elem() {
+		// Save the undecoded data and the key context into the primitive
+		// value.
+		context := make(Key, len(md.context))
+		copy(context, md.context)
+		rv.Set(reflect.ValueOf(Primitive{
+			undecoded: data,
+			context:   context,
+		}))
+		return nil
+	}
+
+	// Special case. Unmarshaler Interface support.
+	if rv.CanAddr() {
+		if v, ok := rv.Addr().Interface().(Unmarshaler); ok {
+			return v.UnmarshalTOML(data)
+		}
+	}
+
+	// Special case. Handle time.Time values specifically.
+	// TODO: Remove this code when we decide to drop support for Go 1.1.
+	// This isn't necessary in Go 1.2 because time.Time satisfies the encoding
+	// interfaces.
+	if rv.Type().AssignableTo(rvalue(time.Time{}).Type()) {
+		return md.unifyDatetime(data, rv)
+	}
+
+	// Special case. Look for a value satisfying the TextUnmarshaler interface.
+	if v, ok := rv.Interface().(TextUnmarshaler); ok {
+		return md.unifyText(data, v)
+	}
+	// BUG(burntsushi)
+	// The behavior here is incorrect whenever a Go type satisfies the
+	// encoding.TextUnmarshaler interface but also corresponds to a TOML
+	// hash or array. In particular, the unmarshaler should only be applied
+	// to primitive TOML values. But at this point, it will be applied to
+	// all kinds of values and produce an incorrect error whenever those values
+	// are hashes or arrays (including arrays of tables).
+
+	k := rv.Kind()
+
+	// laziness
+	if k >= reflect.Int && k <= reflect.Uint64 {
+		return md.unifyInt(data, rv)
+	}
+	switch k {
+	case reflect.Ptr:
+		elem := reflect.New(rv.Type().Elem())
+		err := md.unify(data, reflect.Indirect(elem))
+		if err != nil {
+			return err
+		}
+		rv.Set(elem)
+		return nil
+	case reflect.Struct:
+		return md.unifyStruct(data, rv)
+	case reflect.Map:
+		return md.unifyMap(data, rv)
+	case reflect.Array:
+		return md.unifyArray(data, rv)
+	case reflect.Slice:
+		return md.unifySlice(data, rv)
+	case reflect.String:
+		return md.unifyString(data, rv)
+	case reflect.Bool:
+		return md.unifyBool(data, rv)
+	case reflect.Interface:
+		// we only support empty interfaces.
+		if rv.NumMethod() > 0 {
+			return e("Unsupported type '%s'.", rv.Kind())
+		}
+		return md.unifyAnything(data, rv)
+	case reflect.Float32:
+		fallthrough
+	case reflect.Float64:
+		return md.unifyFloat64(data, rv)
+	}
+	return e("Unsupported type '%s'.", rv.Kind())
+}
+
+func (md *MetaData) unifyStruct(mapping interface{}, rv reflect.Value) error {
+	tmap, ok := mapping.(map[string]interface{})
+	if !ok {
+		return mismatch(rv, "map", mapping)
+	}
+
+	for key, datum := range tmap {
+		var f *field
+		fields := cachedTypeFields(rv.Type())
+		for i := range fields {
+			ff := &fields[i]
+			if ff.name == key {
+				f = ff
+				break
+			}
+			if f == nil && strings.EqualFold(ff.name, key) {
+				f = ff
+			}
+		}
+		if f != nil {
+			subv := rv
+			for _, i := range f.index {
+				subv = indirect(subv.Field(i))
+			}
+			if isUnifiable(subv) {
+				md.decoded[md.context.add(key).String()] = true
+				md.context = append(md.context, key)
+				if err := md.unify(datum, subv); err != nil {
+					return e("Type mismatch for '%s.%s': %s",
+						rv.Type().String(), f.name, err)
+				}
+				md.context = md.context[0 : len(md.context)-1]
+			} else if f.name != "" {
+				// Bad user! No soup for you!
+				return e("Field '%s.%s' is unexported, and therefore cannot "+
+					"be loaded with reflection.", rv.Type().String(), f.name)
+			}
+		}
+	}
+	return nil
+}
+
+func (md *MetaData) unifyMap(mapping interface{}, rv reflect.Value) error {
+	tmap, ok := mapping.(map[string]interface{})
+	if !ok {
+		return badtype("map", mapping)
+	}
+	if rv.IsNil() {
+		rv.Set(reflect.MakeMap(rv.Type()))
+	}
+	for k, v := range tmap {
+		md.decoded[md.context.add(k).String()] = true
+		md.context = append(md.context, k)
+
+		rvkey := indirect(reflect.New(rv.Type().Key()))
+		rvval := reflect.Indirect(reflect.New(rv.Type().Elem()))
+		if err := md.unify(v, rvval); err != nil {
+			return err
+		}
+		md.context = md.context[0 : len(md.context)-1]
+
+		rvkey.SetString(k)
+		rv.SetMapIndex(rvkey, rvval)
+	}
+	return nil
+}
+
+func (md *MetaData) unifyArray(data interface{}, rv reflect.Value) error {
+	datav := reflect.ValueOf(data)
+	if datav.Kind() != reflect.Slice {
+		return badtype("slice", data)
+	}
+	sliceLen := datav.Len()
+	if sliceLen != rv.Len() {
+		return e("expected array length %d; got TOML array of length %d",
+			rv.Len(), sliceLen)
+	}
+	return md.unifySliceArray(datav, rv)
+}
+
+func (md *MetaData) unifySlice(data interface{}, rv reflect.Value) error {
+	datav := reflect.ValueOf(data)
+	if datav.Kind() != reflect.Slice {
+		return badtype("slice", data)
+	}
+	sliceLen := datav.Len()
+	if rv.IsNil() {
+		rv.Set(reflect.MakeSlice(rv.Type(), sliceLen, sliceLen))
+	}
+	return md.unifySliceArray(datav, rv)
+}
+
+func (md *MetaData) unifySliceArray(data, rv reflect.Value) error {
+	sliceLen := data.Len()
+	for i := 0; i < sliceLen; i++ {
+		v := data.Index(i).Interface()
+		sliceval := indirect(rv.Index(i))
+		if err := md.unify(v, sliceval); err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+func (md *MetaData) unifyDatetime(data interface{}, rv reflect.Value) error {
+	if _, ok := data.(time.Time); ok {
+		rv.Set(reflect.ValueOf(data))
+		return nil
+	}
+	return badtype("time.Time", data)
+}
+
+func (md *MetaData) unifyString(data interface{}, rv reflect.Value) error {
+	if s, ok := data.(string); ok {
+		rv.SetString(s)
+		return nil
+	}
+	return badtype("string", data)
+}
+
+func (md *MetaData) unifyFloat64(data interface{}, rv reflect.Value) error {
+	if num, ok := data.(float64); ok {
+		switch rv.Kind() {
+		case reflect.Float32:
+			fallthrough
+		case reflect.Float64:
+			rv.SetFloat(num)
+		default:
+			panic("bug")
+		}
+		return nil
+	}
+	return badtype("float", data)
+}
+
+func (md *MetaData) unifyInt(data interface{}, rv reflect.Value) error {
+	if num, ok := data.(int64); ok {
+		if rv.Kind() >= reflect.Int && rv.Kind() <= reflect.Int64 {
+			switch rv.Kind() {
+			case reflect.Int, reflect.Int64:
+				// No bounds checking necessary.
+			case reflect.Int8:
+				if num < math.MinInt8 || num > math.MaxInt8 {
+					return e("Value '%d' is out of range for int8.", num)
+				}
+			case reflect.Int16:
+				if num < math.MinInt16 || num > math.MaxInt16 {
+					return e("Value '%d' is out of range for int16.", num)
+				}
+			case reflect.Int32:
+				if num < math.MinInt32 || num > math.MaxInt32 {
+					return e("Value '%d' is out of range for int32.", num)
+				}
+			}
+			rv.SetInt(num)
+		} else if rv.Kind() >= reflect.Uint && rv.Kind() <= reflect.Uint64 {
+			unum := uint64(num)
+			switch rv.Kind() {
+			case reflect.Uint, reflect.Uint64:
+				// No bounds checking necessary.
+			case reflect.Uint8:
+				if num < 0 || unum > math.MaxUint8 {
+					return e("Value '%d' is out of range for uint8.", num)
+				}
+			case reflect.Uint16:
+				if num < 0 || unum > math.MaxUint16 {
+					return e("Value '%d' is out of range for uint16.", num)
+				}
+			case reflect.Uint32:
+				if num < 0 || unum > math.MaxUint32 {
+					return e("Value '%d' is out of range for uint32.", num)
+				}
+			}
+			rv.SetUint(unum)
+		} else {
+			panic("unreachable")
+		}
+		return nil
+	}
+	return badtype("integer", data)
+}
+
+func (md *MetaData) unifyBool(data interface{}, rv reflect.Value) error {
+	if b, ok := data.(bool); ok {
+		rv.SetBool(b)
+		return nil
+	}
+	return badtype("boolean", data)
+}
+
+func (md *MetaData) unifyAnything(data interface{}, rv reflect.Value) error {
+	rv.Set(reflect.ValueOf(data))
+	return nil
+}
+
+func (md *MetaData) unifyText(data interface{}, v TextUnmarshaler) error {
+	var s string
+	switch sdata := data.(type) {
+	case TextMarshaler:
+		text, err := sdata.MarshalText()
+		if err != nil {
+			return err
+		}
+		s = string(text)
+	case fmt.Stringer:
+		s = sdata.String()
+	case string:
+		s = sdata
+	case bool:
+		s = fmt.Sprintf("%v", sdata)
+	case int64:
+		s = fmt.Sprintf("%d", sdata)
+	case float64:
+		s = fmt.Sprintf("%f", sdata)
+	default:
+		return badtype("primitive (string-like)", data)
+	}
+	if err := v.UnmarshalText([]byte(s)); err != nil {
+		return err
+	}
+	return nil
+}
+
+// rvalue returns a reflect.Value of `v`. All pointers are resolved.
+func rvalue(v interface{}) reflect.Value {
+	return indirect(reflect.ValueOf(v))
+}
+
+// indirect returns the value pointed to by a pointer.
+// Pointers are followed until the value is not a pointer.
+// New values are allocated for each nil pointer.
+//
+// An exception to this rule is if the value satisfies an interface of
+// interest to us (like encoding.TextUnmarshaler).
+func indirect(v reflect.Value) reflect.Value {
+	if v.Kind() != reflect.Ptr {
+		if v.CanAddr() {
+			pv := v.Addr()
+			if _, ok := pv.Interface().(TextUnmarshaler); ok {
+				return pv
+			}
+		}
+		return v
+	}
+	if v.IsNil() {
+		v.Set(reflect.New(v.Type().Elem()))
+	}
+	return indirect(reflect.Indirect(v))
+}
+
+func isUnifiable(rv reflect.Value) bool {
+	if rv.CanSet() {
+		return true
+	}
+	if _, ok := rv.Interface().(TextUnmarshaler); ok {
+		return true
+	}
+	return false
+}
+
+func badtype(expected string, data interface{}) error {
+	return e("Expected %s but found '%T'.", expected, data)
+}
+
+func mismatch(user reflect.Value, expected string, data interface{}) error {
+	return e("Type mismatch for %s. Expected %s but found '%T'.",
+		user.Type().String(), expected, data)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_meta.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_meta.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_meta.go
new file mode 100644
index 0000000..ef6f545
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_meta.go
@@ -0,0 +1,122 @@
+package toml
+
+import "strings"
+
+// MetaData allows access to meta information about TOML data that may not
+// be inferrable via reflection. In particular, whether a key has been defined
+// and the TOML type of a key.
+type MetaData struct {
+	mapping map[string]interface{}
+	types   map[string]tomlType
+	keys    []Key
+	decoded map[string]bool
+	context Key // Used only during decoding.
+}
+
+// IsDefined returns true if the key given exists in the TOML data. The key
+// should be specified hierarchially. e.g.,
+//
+//	// access the TOML key 'a.b.c'
+//	IsDefined("a", "b", "c")
+//
+// IsDefined will return false if an empty key given. Keys are case sensitive.
+func (md *MetaData) IsDefined(key ...string) bool {
+	if len(key) == 0 {
+		return false
+	}
+
+	var hash map[string]interface{}
+	var ok bool
+	var hashOrVal interface{} = md.mapping
+	for _, k := range key {
+		if hash, ok = hashOrVal.(map[string]interface{}); !ok {
+			return false
+		}
+		if hashOrVal, ok = hash[k]; !ok {
+			return false
+		}
+	}
+	return true
+}
+
+// Type returns a string representation of the type of the key specified.
+//
+// Type will return the empty string if given an empty key or a key that
+// does not exist. Keys are case sensitive.
+func (md *MetaData) Type(key ...string) string {
+	fullkey := strings.Join(key, ".")
+	if typ, ok := md.types[fullkey]; ok {
+		return typ.typeString()
+	}
+	return ""
+}
+
+// Key is the type of any TOML key, including key groups. Use (MetaData).Keys
+// to get values of this type.
+type Key []string
+
+func (k Key) String() string {
+	return strings.Join(k, ".")
+}
+
+func (k Key) maybeQuotedAll() string {
+	var ss []string
+	for i := range k {
+		ss = append(ss, k.maybeQuoted(i))
+	}
+	return strings.Join(ss, ".")
+}
+
+func (k Key) maybeQuoted(i int) string {
+	quote := false
+	for _, c := range k[i] {
+		if !isBareKeyChar(c) {
+			quote = true
+			break
+		}
+	}
+	if quote {
+		return "\"" + strings.Replace(k[i], "\"", "\\\"", -1) + "\""
+	} else {
+		return k[i]
+	}
+}
+
+func (k Key) add(piece string) Key {
+	newKey := make(Key, len(k)+1)
+	copy(newKey, k)
+	newKey[len(k)] = piece
+	return newKey
+}
+
+// Keys returns a slice of every key in the TOML data, including key groups.
+// Each key is itself a slice, where the first element is the top of the
+// hierarchy and the last is the most specific.
+//
+// The list will have the same order as the keys appeared in the TOML data.
+//
+// All keys returned are non-empty.
+func (md *MetaData) Keys() []Key {
+	return md.keys
+}
+
+// Undecoded returns all keys that have not been decoded in the order in which
+// they appear in the original TOML document.
+//
+// This includes keys that haven't been decoded because of a Primitive value.
+// Once the Primitive value is decoded, the keys will be considered decoded.
+//
+// Also note that decoding into an empty interface will result in no decoding,
+// and so no keys will be considered decoded.
+//
+// In this sense, the Undecoded keys correspond to keys in the TOML document
+// that do not have a concrete type in your representation.
+func (md *MetaData) Undecoded() []Key {
+	undecoded := make([]Key, 0, len(md.keys))
+	for _, key := range md.keys {
+		if !md.decoded[key.String()] {
+			undecoded = append(undecoded, key)
+		}
+	}
+	return undecoded
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_test.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_test.go
new file mode 100644
index 0000000..3805931
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_test.go
@@ -0,0 +1,950 @@
+package toml
+
+import (
+	"fmt"
+	"log"
+	"reflect"
+	"testing"
+	"time"
+)
+
+func init() {
+	log.SetFlags(0)
+}
+
+func TestDecodeSimple(t *testing.T) {
+	var testSimple = `
+age = 250
+andrew = "gallant"
+kait = "brady"
+now = 1987-07-05T05:45:00Z
+yesOrNo = true
+pi = 3.14
+colors = [
+	["red", "green", "blue"],
+	["cyan", "magenta", "yellow", "black"],
+]
+
+[My.Cats]
+plato = "cat 1"
+cauchy = "cat 2"
+`
+
+	type cats struct {
+		Plato  string
+		Cauchy string
+	}
+	type simple struct {
+		Age     int
+		Colors  [][]string
+		Pi      float64
+		YesOrNo bool
+		Now     time.Time
+		Andrew  string
+		Kait    string
+		My      map[string]cats
+	}
+
+	var val simple
+	_, err := Decode(testSimple, &val)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	now, err := time.Parse("2006-01-02T15:04:05", "1987-07-05T05:45:00")
+	if err != nil {
+		panic(err)
+	}
+	var answer = simple{
+		Age:     250,
+		Andrew:  "gallant",
+		Kait:    "brady",
+		Now:     now,
+		YesOrNo: true,
+		Pi:      3.14,
+		Colors: [][]string{
+			{"red", "green", "blue"},
+			{"cyan", "magenta", "yellow", "black"},
+		},
+		My: map[string]cats{
+			"Cats": cats{Plato: "cat 1", Cauchy: "cat 2"},
+		},
+	}
+	if !reflect.DeepEqual(val, answer) {
+		t.Fatalf("Expected\n-----\n%#v\n-----\nbut got\n-----\n%#v\n",
+			answer, val)
+	}
+}
+
+func TestDecodeEmbedded(t *testing.T) {
+	type Dog struct{ Name string }
+	type Age int
+
+	tests := map[string]struct {
+		input       string
+		decodeInto  interface{}
+		wantDecoded interface{}
+	}{
+		"embedded struct": {
+			input:       `Name = "milton"`,
+			decodeInto:  &struct{ Dog }{},
+			wantDecoded: &struct{ Dog }{Dog{"milton"}},
+		},
+		"embedded non-nil pointer to struct": {
+			input:       `Name = "milton"`,
+			decodeInto:  &struct{ *Dog }{},
+			wantDecoded: &struct{ *Dog }{&Dog{"milton"}},
+		},
+		"embedded nil pointer to struct": {
+			input:       ``,
+			decodeInto:  &struct{ *Dog }{},
+			wantDecoded: &struct{ *Dog }{nil},
+		},
+		"embedded int": {
+			input:       `Age = -5`,
+			decodeInto:  &struct{ Age }{},
+			wantDecoded: &struct{ Age }{-5},
+		},
+	}
+
+	for label, test := range tests {
+		_, err := Decode(test.input, test.decodeInto)
+		if err != nil {
+			t.Fatal(err)
+		}
+		if !reflect.DeepEqual(test.wantDecoded, test.decodeInto) {
+			t.Errorf("%s: want decoded == %+v, got %+v",
+				label, test.wantDecoded, test.decodeInto)
+		}
+	}
+}
+
+func TestTableArrays(t *testing.T) {
+	var tomlTableArrays = `
+[[albums]]
+name = "Born to Run"
+
+  [[albums.songs]]
+  name = "Jungleland"
+
+  [[albums.songs]]
+  name = "Meeting Across the River"
+
+[[albums]]
+name = "Born in the USA"
+
+  [[albums.songs]]
+  name = "Glory Days"
+
+  [[albums.songs]]
+  name = "Dancing in the Dark"
+`
+
+	type Song struct {
+		Name string
+	}
+
+	type Album struct {
+		Name  string
+		Songs []Song
+	}
+
+	type Music struct {
+		Albums []Album
+	}
+
+	expected := Music{[]Album{
+		{"Born to Run", []Song{{"Jungleland"}, {"Meeting Across the River"}}},
+		{"Born in the USA", []Song{{"Glory Days"}, {"Dancing in the Dark"}}},
+	}}
+	var got Music
+	if _, err := Decode(tomlTableArrays, &got); err != nil {
+		t.Fatal(err)
+	}
+	if !reflect.DeepEqual(expected, got) {
+		t.Fatalf("\n%#v\n!=\n%#v\n", expected, got)
+	}
+}
+
+// Case insensitive matching tests.
+// A bit more comprehensive than needed given the current implementation,
+// but implementations change.
+// Probably still missing demonstrations of some ugly corner cases regarding
+// case insensitive matching and multiple fields.
+func TestCase(t *testing.T) {
+	var caseToml = `
+tOpString = "string"
+tOpInt = 1
+tOpFloat = 1.1
+tOpBool = true
+tOpdate = 2006-01-02T15:04:05Z
+tOparray = [ "array" ]
+Match = "i should be in Match only"
+MatcH = "i should be in MatcH only"
+once = "just once"
+[nEst.eD]
+nEstedString = "another string"
+`
+
+	type InsensitiveEd struct {
+		NestedString string
+	}
+
+	type InsensitiveNest struct {
+		Ed InsensitiveEd
+	}
+
+	type Insensitive struct {
+		TopString string
+		TopInt    int
+		TopFloat  float64
+		TopBool   bool
+		TopDate   time.Time
+		TopArray  []string
+		Match     string
+		MatcH     string
+		Once      string
+		OncE      string
+		Nest      InsensitiveNest
+	}
+
+	tme, err := time.Parse(time.RFC3339, time.RFC3339[:len(time.RFC3339)-5])
+	if err != nil {
+		panic(err)
+	}
+	expected := Insensitive{
+		TopString: "string",
+		TopInt:    1,
+		TopFloat:  1.1,
+		TopBool:   true,
+		TopDate:   tme,
+		TopArray:  []string{"array"},
+		MatcH:     "i should be in MatcH only",
+		Match:     "i should be in Match only",
+		Once:      "just once",
+		OncE:      "",
+		Nest: InsensitiveNest{
+			Ed: InsensitiveEd{NestedString: "another string"},
+		},
+	}
+	var got Insensitive
+	if _, err := Decode(caseToml, &got); err != nil {
+		t.Fatal(err)
+	}
+	if !reflect.DeepEqual(expected, got) {
+		t.Fatalf("\n%#v\n!=\n%#v\n", expected, got)
+	}
+}
+
+func TestPointers(t *testing.T) {
+	type Object struct {
+		Type        string
+		Description string
+	}
+
+	type Dict struct {
+		NamedObject map[string]*Object
+		BaseObject  *Object
+		Strptr      *string
+		Strptrs     []*string
+	}
+	s1, s2, s3 := "blah", "abc", "def"
+	expected := &Dict{
+		Strptr:  &s1,
+		Strptrs: []*string{&s2, &s3},
+		NamedObject: map[string]*Object{
+			"foo": {"FOO", "fooooo!!!"},
+			"bar": {"BAR", "ba-ba-ba-ba-barrrr!!!"},
+		},
+		BaseObject: &Object{"BASE", "da base"},
+	}
+
+	ex1 := `
+Strptr = "blah"
+Strptrs = ["abc", "def"]
+
+[NamedObject.foo]
+Type = "FOO"
+Description = "fooooo!!!"
+
+[NamedObject.bar]
+Type = "BAR"
+Description = "ba-ba-ba-ba-barrrr!!!"
+
+[BaseObject]
+Type = "BASE"
+Description = "da base"
+`
+	dict := new(Dict)
+	_, err := Decode(ex1, dict)
+	if err != nil {
+		t.Errorf("Decode error: %v", err)
+	}
+	if !reflect.DeepEqual(expected, dict) {
+		t.Fatalf("\n%#v\n!=\n%#v\n", expected, dict)
+	}
+}
+
+type sphere struct {
+	Center [3]float64
+	Radius float64
+}
+
+func TestDecodeSimpleArray(t *testing.T) {
+	var s1 sphere
+	if _, err := Decode(`center = [0.0, 1.5, 0.0]`, &s1); err != nil {
+		t.Fatal(err)
+	}
+}
+
+func TestDecodeArrayWrongSize(t *testing.T) {
+	var s1 sphere
+	if _, err := Decode(`center = [0.1, 2.3]`, &s1); err == nil {
+		t.Fatal("Expected array type mismatch error")
+	}
+}
+
+func TestDecodeLargeIntoSmallInt(t *testing.T) {
+	type table struct {
+		Value int8
+	}
+	var tab table
+	if _, err := Decode(`value = 500`, &tab); err == nil {
+		t.Fatal("Expected integer out-of-bounds error.")
+	}
+}
+
+func TestDecodeSizedInts(t *testing.T) {
+	type table struct {
+		U8  uint8
+		U16 uint16
+		U32 uint32
+		U64 uint64
+		U   uint
+		I8  int8
+		I16 int16
+		I32 int32
+		I64 int64
+		I   int
+	}
+	answer := table{1, 1, 1, 1, 1, -1, -1, -1, -1, -1}
+	toml := `
+	u8 = 1
+	u16 = 1
+	u32 = 1
+	u64 = 1
+	u = 1
+	i8 = -1
+	i16 = -1
+	i32 = -1
+	i64 = -1
+	i = -1
+	`
+	var tab table
+	if _, err := Decode(toml, &tab); err != nil {
+		t.Fatal(err.Error())
+	}
+	if answer != tab {
+		t.Fatalf("Expected %#v but got %#v", answer, tab)
+	}
+}
+
+func TestUnmarshaler(t *testing.T) {
+
+	var tomlBlob = `
+[dishes.hamboogie]
+name = "Hamboogie with fries"
+price = 10.99
+
+[[dishes.hamboogie.ingredients]]
+name = "Bread Bun"
+
+[[dishes.hamboogie.ingredients]]
+name = "Lettuce"
+
+[[dishes.hamboogie.ingredients]]
+name = "Real Beef Patty"
+
+[[dishes.hamboogie.ingredients]]
+name = "Tomato"
+
+[dishes.eggsalad]
+name = "Egg Salad with rice"
+price = 3.99
+
+[[dishes.eggsalad.ingredients]]
+name = "Egg"
+
+[[dishes.eggsalad.ingredients]]
+name = "Mayo"
+
+[[dishes.eggsalad.ingredients]]
+name = "Rice"
+`
+	m := &menu{}
+	if _, err := Decode(tomlBlob, m); err != nil {
+		log.Fatal(err)
+	}
+
+	if len(m.Dishes) != 2 {
+		t.Log("two dishes should be loaded with UnmarshalTOML()")
+		t.Errorf("expected %d but got %d", 2, len(m.Dishes))
+	}
+
+	eggSalad := m.Dishes["eggsalad"]
+	if _, ok := interface{}(eggSalad).(dish); !ok {
+		t.Errorf("expected a dish")
+	}
+
+	if eggSalad.Name != "Egg Salad with rice" {
+		t.Errorf("expected the dish to be named 'Egg Salad with rice'")
+	}
+
+	if len(eggSalad.Ingredients) != 3 {
+		t.Log("dish should be loaded with UnmarshalTOML()")
+		t.Errorf("expected %d but got %d", 3, len(eggSalad.Ingredients))
+	}
+
+	found := false
+	for _, i := range eggSalad.Ingredients {
+		if i.Name == "Rice" {
+			found = true
+			break
+		}
+	}
+	if !found {
+		t.Error("Rice was not loaded in UnmarshalTOML()")
+	}
+
+	// test on a value - must be passed as *
+	o := menu{}
+	if _, err := Decode(tomlBlob, &o); err != nil {
+		log.Fatal(err)
+	}
+
+}
+
+type menu struct {
+	Dishes map[string]dish
+}
+
+func (m *menu) UnmarshalTOML(p interface{}) error {
+	m.Dishes = make(map[string]dish)
+	data, _ := p.(map[string]interface{})
+	dishes := data["dishes"].(map[string]interface{})
+	for n, v := range dishes {
+		if d, ok := v.(map[string]interface{}); ok {
+			nd := dish{}
+			nd.UnmarshalTOML(d)
+			m.Dishes[n] = nd
+		} else {
+			return fmt.Errorf("not a dish")
+		}
+	}
+	return nil
+}
+
+type dish struct {
+	Name        string
+	Price       float32
+	Ingredients []ingredient
+}
+
+func (d *dish) UnmarshalTOML(p interface{}) error {
+	data, _ := p.(map[string]interface{})
+	d.Name, _ = data["name"].(string)
+	d.Price, _ = data["price"].(float32)
+	ingredients, _ := data["ingredients"].([]map[string]interface{})
+	for _, e := range ingredients {
+		n, _ := interface{}(e).(map[string]interface{})
+		name, _ := n["name"].(string)
+		i := ingredient{name}
+		d.Ingredients = append(d.Ingredients, i)
+	}
+	return nil
+}
+
+type ingredient struct {
+	Name string
+}
+
+func ExampleMetaData_PrimitiveDecode() {
+	var md MetaData
+	var err error
+
+	var tomlBlob = `
+ranking = ["Springsteen", "J Geils"]
+
+[bands.Springsteen]
+started = 1973
+albums = ["Greetings", "WIESS", "Born to Run", "Darkness"]
+
+[bands."J Geils"]
+started = 1970
+albums = ["The J. Geils Band", "Full House", "Blow Your Face Out"]
+`
+
+	type band struct {
+		Started int
+		Albums  []string
+	}
+	type classics struct {
+		Ranking []string
+		Bands   map[string]Primitive
+	}
+
+	// Do the initial decode. Reflection is delayed on Primitive values.
+	var music classics
+	if md, err = Decode(tomlBlob, &music); err != nil {
+		log.Fatal(err)
+	}
+
+	// MetaData still includes information on Primitive values.
+	fmt.Printf("Is `bands.Springsteen` defined? %v\n",
+		md.IsDefined("bands", "Springsteen"))
+
+	// Decode primitive data into Go values.
+	for _, artist := range music.Ranking {
+		// A band is a primitive value, so we need to decode it to get a
+		// real `band` value.
+		primValue := music.Bands[artist]
+
+		var aBand band
+		if err = md.PrimitiveDecode(primValue, &aBand); err != nil {
+			log.Fatal(err)
+		}
+		fmt.Printf("%s started in %d.\n", artist, aBand.Started)
+	}
+	// Check to see if there were any fields left undecoded.
+	// Note that this won't be empty before decoding the Primitive value!
+	fmt.Printf("Undecoded: %q\n", md.Undecoded())
+
+	// Output:
+	// Is `bands.Springsteen` defined? true
+	// Springsteen started in 1973.
+	// J Geils started in 1970.
+	// Undecoded: []
+}
+
+func ExampleDecode() {
+	var tomlBlob = `
+# Some comments.
+[alpha]
+ip = "10.0.0.1"
+
+	[alpha.config]
+	Ports = [ 8001, 8002 ]
+	Location = "Toronto"
+	Created = 1987-07-05T05:45:00Z
+
+[beta]
+ip = "10.0.0.2"
+
+	[beta.config]
+	Ports = [ 9001, 9002 ]
+	Location = "New Jersey"
+	Created = 1887-01-05T05:55:00Z
+`
+
+	type serverConfig struct {
+		Ports    []int
+		Location string
+		Created  time.Time
+	}
+
+	type server struct {
+		IP     string       `toml:"ip"`
+		Config serverConfig `toml:"config"`
+	}
+
+	type servers map[string]server
+
+	var config servers
+	if _, err := Decode(tomlBlob, &config); err != nil {
+		log.Fatal(err)
+	}
+
+	for _, name := range []string{"alpha", "beta"} {
+		s := config[name]
+		fmt.Printf("Server: %s (ip: %s) in %s created on %s\n",
+			name, s.IP, s.Config.Location,
+			s.Config.Created.Format("2006-01-02"))
+		fmt.Printf("Ports: %v\n", s.Config.Ports)
+	}
+
+	// Output:
+	// Server: alpha (ip: 10.0.0.1) in Toronto created on 1987-07-05
+	// Ports: [8001 8002]
+	// Server: beta (ip: 10.0.0.2) in New Jersey created on 1887-01-05
+	// Ports: [9001 9002]
+}
+
+type duration struct {
+	time.Duration
+}
+
+func (d *duration) UnmarshalText(text []byte) error {
+	var err error
+	d.Duration, err = time.ParseDuration(string(text))
+	return err
+}
+
+// Example Unmarshaler shows how to decode TOML strings into your own
+// custom data type.
+func Example_unmarshaler() {
+	blob := `
+[[song]]
+name = "Thunder Road"
+duration = "4m49s"
+
+[[song]]
+name = "Stairway to Heaven"
+duration = "8m03s"
+`
+	type song struct {
+		Name     string
+		Duration duration
+	}
+	type songs struct {
+		Song []song
+	}
+	var favorites songs
+	if _, err := Decode(blob, &favorites); err != nil {
+		log.Fatal(err)
+	}
+
+	// Code to implement the TextUnmarshaler interface for `duration`:
+	//
+	// type duration struct {
+	// 	time.Duration
+	// }
+	//
+	// func (d *duration) UnmarshalText(text []byte) error {
+	// 	var err error
+	// 	d.Duration, err = time.ParseDuration(string(text))
+	// 	return err
+	// }
+
+	for _, s := range favorites.Song {
+		fmt.Printf("%s (%s)\n", s.Name, s.Duration)
+	}
+	// Output:
+	// Thunder Road (4m49s)
+	// Stairway to Heaven (8m3s)
+}
+
+// Example StrictDecoding shows how to detect whether there are keys in the
+// TOML document that weren't decoded into the value given. This is useful
+// for returning an error to the user if they've included extraneous fields
+// in their configuration.
+func Example_strictDecoding() {
+	var blob = `
+key1 = "value1"
+key2 = "value2"
+key3 = "value3"
+`
+	type config struct {
+		Key1 string
+		Key3 string
+	}
+
+	var conf config
+	md, err := Decode(blob, &conf)
+	if err != nil {
+		log.Fatal(err)
+	}
+	fmt.Printf("Undecoded keys: %q\n", md.Undecoded())
+	// Output:
+	// Undecoded keys: ["key2"]
+}
+
+// Example UnmarshalTOML shows how to implement a struct type that knows how to
+// unmarshal itself. The struct must take full responsibility for mapping the
+// values passed into the struct. The method may be used with interfaces in a
+// struct in cases where the actual type is not known until the data is
+// examined.
+func Example_unmarshalTOML() {
+
+	var blob = `
+[[parts]]
+type = "valve"
+id = "valve-1"
+size = 1.2
+rating = 4
+
+[[parts]]
+type = "valve"
+id = "valve-2"
+size = 2.1
+rating = 5
+
+[[parts]]
+type = "pipe"
+id = "pipe-1"
+length = 2.1
+diameter = 12
+
+[[parts]]
+type = "cable"
+id = "cable-1"
+length = 12
+rating = 3.1
+`
+	o := &order{}
+	err := Unmarshal([]byte(blob), o)
+	if err != nil {
+		log.Fatal(err)
+	}
+
+	fmt.Println(len(o.parts))
+
+	for _, part := range o.parts {
+		fmt.Println(part.Name())
+	}
+
+	// Code to implement UmarshalJSON.
+
+	// type order struct {
+	// 	// NOTE `order.parts` is a private slice of type `part` which is an
+	// 	// interface and may only be loaded from toml using the
+	// 	// UnmarshalTOML() method of the Umarshaler interface.
+	// 	parts parts
+	// }
+
+	// func (o *order) UnmarshalTOML(data interface{}) error {
+
+	// 	// NOTE the example below contains detailed type casting to show how
+	// 	// the 'data' is retrieved. In operational use, a type cast wrapper
+	// 	// may be prefered e.g.
+	// 	//
+	// 	// func AsMap(v interface{}) (map[string]interface{}, error) {
+	// 	// 		return v.(map[string]interface{})
+	// 	// }
+	// 	//
+	// 	// resulting in:
+	// 	// d, _ := AsMap(data)
+	// 	//
+
+	// 	d, _ := data.(map[string]interface{})
+	// 	parts, _ := d["parts"].([]map[string]interface{})
+
+	// 	for _, p := range parts {
+
+	// 		typ, _ := p["type"].(string)
+	// 		id, _ := p["id"].(string)
+
+	// 		// detect the type of part and handle each case
+	// 		switch p["type"] {
+	// 		case "valve":
+
+	// 			size := float32(p["size"].(float64))
+	// 			rating := int(p["rating"].(int64))
+
+	// 			valve := &valve{
+	// 				Type:   typ,
+	// 				ID:     id,
+	// 				Size:   size,
+	// 				Rating: rating,
+	// 			}
+
+	// 			o.parts = append(o.parts, valve)
+
+	// 		case "pipe":
+
+	// 			length := float32(p["length"].(float64))
+	// 			diameter := int(p["diameter"].(int64))
+
+	// 			pipe := &pipe{
+	// 				Type:     typ,
+	// 				ID:       id,
+	// 				Length:   length,
+	// 				Diameter: diameter,
+	// 			}
+
+	// 			o.parts = append(o.parts, pipe)
+
+	// 		case "cable":
+
+	// 			length := int(p["length"].(int64))
+	// 			rating := float32(p["rating"].(float64))
+
+	// 			cable := &cable{
+	// 				Type:   typ,
+	// 				ID:     id,
+	// 				Length: length,
+	// 				Rating: rating,
+	// 			}
+
+	// 			o.parts = append(o.parts, cable)
+
+	// 		}
+	// 	}
+
+	// 	return nil
+	// }
+
+	// type parts []part
+
+	// type part interface {
+	// 	Name() string
+	// }
+
+	// type valve struct {
+	// 	Type   string
+	// 	ID     string
+	// 	Size   float32
+	// 	Rating int
+	// }
+
+	// func (v *valve) Name() string {
+	// 	return fmt.Sprintf("VALVE: %s", v.ID)
+	// }
+
+	// type pipe struct {
+	// 	Type     string
+	// 	ID       string
+	// 	Length   float32
+	// 	Diameter int
+	// }
+
+	// func (p *pipe) Name() string {
+	// 	return fmt.Sprintf("PIPE: %s", p.ID)
+	// }
+
+	// type cable struct {
+	// 	Type   string
+	// 	ID     string
+	// 	Length int
+	// 	Rating float32
+	// }
+
+	// func (c *cable) Name() string {
+	// 	return fmt.Sprintf("CABLE: %s", c.ID)
+	// }
+
+	// Output:
+	// 4
+	// VALVE: valve-1
+	// VALVE: valve-2
+	// PIPE: pipe-1
+	// CABLE: cable-1
+
+}
+
+type order struct {
+	// NOTE `order.parts` is a private slice of type `part` which is an
+	// interface and may only be loaded from toml using the UnmarshalTOML()
+	// method of the Umarshaler interface.
+	parts parts
+}
+
+func (o *order) UnmarshalTOML(data interface{}) error {
+
+	// NOTE the example below contains detailed type casting to show how
+	// the 'data' is retrieved. In operational use, a type cast wrapper
+	// may be prefered e.g.
+	//
+	// func AsMap(v interface{}) (map[string]interface{}, error) {
+	// 		return v.(map[string]interface{})
+	// }
+	//
+	// resulting in:
+	// d, _ := AsMap(data)
+	//
+
+	d, _ := data.(map[string]interface{})
+	parts, _ := d["parts"].([]map[string]interface{})
+
+	for _, p := range parts {
+
+		typ, _ := p["type"].(string)
+		id, _ := p["id"].(string)
+
+		// detect the type of part and handle each case
+		switch p["type"] {
+		case "valve":
+
+			size := float32(p["size"].(float64))
+			rating := int(p["rating"].(int64))
+
+			valve := &valve{
+				Type:   typ,
+				ID:     id,
+				Size:   size,
+				Rating: rating,
+			}
+
+			o.parts = append(o.parts, valve)
+
+		case "pipe":
+
+			length := float32(p["length"].(float64))
+			diameter := int(p["diameter"].(int64))
+
+			pipe := &pipe{
+				Type:     typ,
+				ID:       id,
+				Length:   length,
+				Diameter: diameter,
+			}
+
+			o.parts = append(o.parts, pipe)
+
+		case "cable":
+
+			length := int(p["length"].(int64))
+			rating := float32(p["rating"].(float64))
+
+			cable := &cable{
+				Type:   typ,
+				ID:     id,
+				Length: length,
+				Rating: rating,
+			}
+
+			o.parts = append(o.parts, cable)
+
+		}
+	}
+
+	return nil
+}
+
+type parts []part
+
+type part interface {
+	Name() string
+}
+
+type valve struct {
+	Type   string
+	ID     string
+	Size   float32
+	Rating int
+}
+
+func (v *valve) Name() string {
+	return fmt.Sprintf("VALVE: %s", v.ID)
+}
+
+type pipe struct {
+	Type     string
+	ID       string
+	Length   float32
+	Diameter int
+}
+
+func (p *pipe) Name() string {
+	return fmt.Sprintf("PIPE: %s", p.ID)
+}
+
+type cable struct {
+	Type   string
+	ID     string
+	Length int
+	Rating float32
+}
+
+func (c *cable) Name() string {
+	return fmt.Sprintf("CABLE: %s", c.ID)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/doc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/doc.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/doc.go
new file mode 100644
index 0000000..fe26800
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/doc.go
@@ -0,0 +1,27 @@
+/*
+Package toml provides facilities for decoding and encoding TOML configuration
+files via reflection. There is also support for delaying decoding with
+the Primitive type, and querying the set of keys in a TOML document with the
+MetaData type.
+
+The specification implemented: https://github.com/mojombo/toml
+
+The sub-command github.com/BurntSushi/toml/cmd/tomlv can be used to verify
+whether a file is a valid TOML document. It can also be used to print the
+type of each key in a TOML document.
+
+Testing
+
+There are two important types of tests used for this package. The first is
+contained inside '*_test.go' files and uses the standard Go unit testing
+framework. These tests are primarily devoted to holistically testing the
+decoder and encoder.
+
+The second type of testing is used to verify the implementation's adherence
+to the TOML specification. These tests have been factored into their own
+project: https://github.com/BurntSushi/toml-test
+
+The reason the tests are in a separate project is so that they can be used by
+any implementation of TOML. Namely, it is language agnostic.
+*/
+package toml

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encode.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encode.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encode.go
new file mode 100644
index 0000000..c7e227c
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encode.go
@@ -0,0 +1,551 @@
+package toml
+
+import (
+	"bufio"
+	"errors"
+	"fmt"
+	"io"
+	"reflect"
+	"sort"
+	"strconv"
+	"strings"
+	"time"
+)
+
+type tomlEncodeError struct{ error }
+
+var (
+	errArrayMixedElementTypes = errors.New(
+		"can't encode array with mixed element types")
+	errArrayNilElement = errors.New(
+		"can't encode array with nil element")
+	errNonString = errors.New(
+		"can't encode a map with non-string key type")
+	errAnonNonStruct = errors.New(
+		"can't encode an anonymous field that is not a struct")
+	errArrayNoTable = errors.New(
+		"TOML array element can't contain a table")
+	errNoKey = errors.New(
+		"top-level values must be a Go map or struct")
+	errAnything = errors.New("") // used in testing
+)
+
+var quotedReplacer = strings.NewReplacer(
+	"\t", "\\t",
+	"\n", "\\n",
+	"\r", "\\r",
+	"\"", "\\\"",
+	"\\", "\\\\",
+)
+
+// Encoder controls the encoding of Go values to a TOML document to some
+// io.Writer.
+//
+// The indentation level can be controlled with the Indent field.
+type Encoder struct {
+	// A single indentation level. By default it is two spaces.
+	Indent string
+
+	// hasWritten is whether we have written any output to w yet.
+	hasWritten bool
+	w          *bufio.Writer
+}
+
+// NewEncoder returns a TOML encoder that encodes Go values to the io.Writer
+// given. By default, a single indentation level is 2 spaces.
+func NewEncoder(w io.Writer) *Encoder {
+	return &Encoder{
+		w:      bufio.NewWriter(w),
+		Indent: "  ",
+	}
+}
+
+// Encode writes a TOML representation of the Go value to the underlying
+// io.Writer. If the value given cannot be encoded to a valid TOML document,
+// then an error is returned.
+//
+// The mapping between Go values and TOML values should be precisely the same
+// as for the Decode* functions. Similarly, the TextMarshaler interface is
+// supported by encoding the resulting bytes as strings. (If you want to write
+// arbitrary binary data then you will need to use something like base64 since
+// TOML does not have any binary types.)
+//
+// When encoding TOML hashes (i.e., Go maps or structs), keys without any
+// sub-hashes are encoded first.
+//
+// If a Go map is encoded, then its keys are sorted alphabetically for
+// deterministic output. More control over this behavior may be provided if
+// there is demand for it.
+//
+// Encoding Go values without a corresponding TOML representation---like map
+// types with non-string keys---will cause an error to be returned. Similarly
+// for mixed arrays/slices, arrays/slices with nil elements, embedded
+// non-struct types and nested slices containing maps or structs.
+// (e.g., [][]map[string]string is not allowed but []map[string]string is OK
+// and so is []map[string][]string.)
+func (enc *Encoder) Encode(v interface{}) error {
+	rv := eindirect(reflect.ValueOf(v))
+	if err := enc.safeEncode(Key([]string{}), rv); err != nil {
+		return err
+	}
+	return enc.w.Flush()
+}
+
+func (enc *Encoder) safeEncode(key Key, rv reflect.Value) (err error) {
+	defer func() {
+		if r := recover(); r != nil {
+			if terr, ok := r.(tomlEncodeError); ok {
+				err = terr.error
+				return
+			}
+			panic(r)
+		}
+	}()
+	enc.encode(key, rv)
+	return nil
+}
+
+func (enc *Encoder) encode(key Key, rv reflect.Value) {
+	// Special case. Time needs to be in ISO8601 format.
+	// Special case. If we can marshal the type to text, then we used that.
+	// Basically, this prevents the encoder for handling these types as
+	// generic structs (or whatever the underlying type of a TextMarshaler is).
+	switch rv.Interface().(type) {
+	case time.Time, TextMarshaler:
+		enc.keyEqElement(key, rv)
+		return
+	}
+
+	k := rv.Kind()
+	switch k {
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,
+		reflect.Int64,
+		reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32,
+		reflect.Uint64,
+		reflect.Float32, reflect.Float64, reflect.String, reflect.Bool:
+		enc.keyEqElement(key, rv)
+	case reflect.Array, reflect.Slice:
+		if typeEqual(tomlArrayHash, tomlTypeOfGo(rv)) {
+			enc.eArrayOfTables(key, rv)
+		} else {
+			enc.keyEqElement(key, rv)
+		}
+	case reflect.Interface:
+		if rv.IsNil() {
+			return
+		}
+		enc.encode(key, rv.Elem())
+	case reflect.Map:
+		if rv.IsNil() {
+			return
+		}
+		enc.eTable(key, rv)
+	case reflect.Ptr:
+		if rv.IsNil() {
+			return
+		}
+		enc.encode(key, rv.Elem())
+	case reflect.Struct:
+		enc.eTable(key, rv)
+	default:
+		panic(e("Unsupported type for key '%s': %s", key, k))
+	}
+}
+
+// eElement encodes any value that can be an array element (primitives and
+// arrays).
+func (enc *Encoder) eElement(rv reflect.Value) {
+	switch v := rv.Interface().(type) {
+	case time.Time:
+		// Special case time.Time as a primitive. Has to come before
+		// TextMarshaler below because time.Time implements
+		// encoding.TextMarshaler, but we need to always use UTC.
+		enc.wf(v.In(time.FixedZone("UTC", 0)).Format("2006-01-02T15:04:05Z"))
+		return
+	case TextMarshaler:
+		// Special case. Use text marshaler if it's available for this value.
+		if s, err := v.MarshalText(); err != nil {
+			encPanic(err)
+		} else {
+			enc.writeQuoted(string(s))
+		}
+		return
+	}
+	switch rv.Kind() {
+	case reflect.Bool:
+		enc.wf(strconv.FormatBool(rv.Bool()))
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,
+		reflect.Int64:
+		enc.wf(strconv.FormatInt(rv.Int(), 10))
+	case reflect.Uint, reflect.Uint8, reflect.Uint16,
+		reflect.Uint32, reflect.Uint64:
+		enc.wf(strconv.FormatUint(rv.Uint(), 10))
+	case reflect.Float32:
+		enc.wf(floatAddDecimal(strconv.FormatFloat(rv.Float(), 'f', -1, 32)))
+	case reflect.Float64:
+		enc.wf(floatAddDecimal(strconv.FormatFloat(rv.Float(), 'f', -1, 64)))
+	case reflect.Array, reflect.Slice:
+		enc.eArrayOrSliceElement(rv)
+	case reflect.Interface:
+		enc.eElement(rv.Elem())
+	case reflect.String:
+		enc.writeQuoted(rv.String())
+	default:
+		panic(e("Unexpected primitive type: %s", rv.Kind()))
+	}
+}
+
+// By the TOML spec, all floats must have a decimal with at least one
+// number on either side.
+func floatAddDecimal(fstr string) string {
+	if !strings.Contains(fstr, ".") {
+		return fstr + ".0"
+	}
+	return fstr
+}
+
+func (enc *Encoder) writeQuoted(s string) {
+	enc.wf("\"%s\"", quotedReplacer.Replace(s))
+}
+
+func (enc *Encoder) eArrayOrSliceElement(rv reflect.Value) {
+	length := rv.Len()
+	enc.wf("[")
+	for i := 0; i < length; i++ {
+		elem := rv.Index(i)
+		enc.eElement(elem)
+		if i != length-1 {
+			enc.wf(", ")
+		}
+	}
+	enc.wf("]")
+}
+
+func (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) {
+	if len(key) == 0 {
+		encPanic(errNoKey)
+	}
+	for i := 0; i < rv.Len(); i++ {
+		trv := rv.Index(i)
+		if isNil(trv) {
+			continue
+		}
+		panicIfInvalidKey(key)
+		enc.newline()
+		enc.wf("%s[[%s]]", enc.indentStr(key), key.maybeQuotedAll())
+		enc.newline()
+		enc.eMapOrStruct(key, trv)
+	}
+}
+
+func (enc *Encoder) eTable(key Key, rv reflect.Value) {
+	panicIfInvalidKey(key)
+	if len(key) == 1 {
+		// Output an extra new line between top-level tables.
+		// (The newline isn't written if nothing else has been written though.)
+		enc.newline()
+	}
+	if len(key) > 0 {
+		enc.wf("%s[%s]", enc.indentStr(key), key.maybeQuotedAll())
+		enc.newline()
+	}
+	enc.eMapOrStruct(key, rv)
+}
+
+func (enc *Encoder) eMapOrStruct(key Key, rv reflect.Value) {
+	switch rv := eindirect(rv); rv.Kind() {
+	case reflect.Map:
+		enc.eMap(key, rv)
+	case reflect.Struct:
+		enc.eStruct(key, rv)
+	default:
+		panic("eTable: unhandled reflect.Value Kind: " + rv.Kind().String())
+	}
+}
+
+func (enc *Encoder) eMap(key Key, rv reflect.Value) {
+	rt := rv.Type()
+	if rt.Key().Kind() != reflect.String {
+		encPanic(errNonString)
+	}
+
+	// Sort keys so that we have deterministic output. And write keys directly
+	// underneath this key first, before writing sub-structs or sub-maps.
+	var mapKeysDirect, mapKeysSub []string
+	for _, mapKey := range rv.MapKeys() {
+		k := mapKey.String()
+		if typeIsHash(tomlTypeOfGo(rv.MapIndex(mapKey))) {
+			mapKeysSub = append(mapKeysSub, k)
+		} else {
+			mapKeysDirect = append(mapKeysDirect, k)
+		}
+	}
+
+	var writeMapKeys = func(mapKeys []string) {
+		sort.Strings(mapKeys)
+		for _, mapKey := range mapKeys {
+			mrv := rv.MapIndex(reflect.ValueOf(mapKey))
+			if isNil(mrv) {
+				// Don't write anything for nil fields.
+				continue
+			}
+			enc.encode(key.add(mapKey), mrv)
+		}
+	}
+	writeMapKeys(mapKeysDirect)
+	writeMapKeys(mapKeysSub)
+}
+
+func (enc *Encoder) eStruct(key Key, rv reflect.Value) {
+	// Write keys for fields directly under this key first, because if we write
+	// a field that creates a new table, then all keys under it will be in that
+	// table (not the one we're writing here).
+	rt := rv.Type()
+	var fieldsDirect, fieldsSub [][]int
+	var addFields func(rt reflect.Type, rv reflect.Value, start []int)
+	addFields = func(rt reflect.Type, rv reflect.Value, start []int) {
+		for i := 0; i < rt.NumField(); i++ {
+			f := rt.Field(i)
+			// skip unexporded fields
+			if f.PkgPath != "" {
+				continue
+			}
+			frv := rv.Field(i)
+			if f.Anonymous {
+				frv := eindirect(frv)
+				t := frv.Type()
+				if t.Kind() != reflect.Struct {
+					encPanic(errAnonNonStruct)
+				}
+				addFields(t, frv, f.Index)
+			} else if typeIsHash(tomlTypeOfGo(frv)) {
+				fieldsSub = append(fieldsSub, append(start, f.Index...))
+			} else {
+				fieldsDirect = append(fieldsDirect, append(start, f.Index...))
+			}
+		}
+	}
+	addFields(rt, rv, nil)
+
+	var writeFields = func(fields [][]int) {
+		for _, fieldIndex := range fields {
+			sft := rt.FieldByIndex(fieldIndex)
+			sf := rv.FieldByIndex(fieldIndex)
+			if isNil(sf) {
+				// Don't write anything for nil fields.
+				continue
+			}
+
+			keyName := sft.Tag.Get("toml")
+			if keyName == "-" {
+				continue
+			}
+			if keyName == "" {
+				keyName = sft.Name
+			}
+
+			keyName, opts := getOptions(keyName)
+			if _, ok := opts["omitempty"]; ok && isEmpty(sf) {
+				continue
+			} else if _, ok := opts["omitzero"]; ok && isZero(sf) {
+				continue
+			}
+
+			enc.encode(key.add(keyName), sf)
+		}
+	}
+	writeFields(fieldsDirect)
+	writeFields(fieldsSub)
+}
+
+// tomlTypeName returns the TOML type name of the Go value's type. It is
+// used to determine whether the types of array elements are mixed (which is
+// forbidden). If the Go value is nil, then it is illegal for it to be an array
+// element, and valueIsNil is returned as true.
+
+// Returns the TOML type of a Go value. The type may be `nil`, which means
+// no concrete TOML type could be found.
+func tomlTypeOfGo(rv reflect.Value) tomlType {
+	if isNil(rv) || !rv.IsValid() {
+		return nil
+	}
+	switch rv.Kind() {
+	case reflect.Bool:
+		return tomlBool
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,
+		reflect.Int64,
+		reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32,
+		reflect.Uint64:
+		return tomlInteger
+	case reflect.Float32, reflect.Float64:
+		return tomlFloat
+	case reflect.Array, reflect.Slice:
+		if typeEqual(tomlHash, tomlArrayType(rv)) {
+			return tomlArrayHash
+		} else {
+			return tomlArray
+		}
+	case reflect.Ptr, reflect.Interface:
+		return tomlTypeOfGo(rv.Elem())
+	case reflect.String:
+		return tomlString
+	case reflect.Map:
+		return tomlHash
+	case reflect.Struct:
+		switch rv.Interface().(type) {
+		case time.Time:
+			return tomlDatetime
+		case TextMarshaler:
+			return tomlString
+		default:
+			return tomlHash
+		}
+	default:
+		panic("unexpected reflect.Kind: " + rv.Kind().String())
+	}
+}
+
+// tomlArrayType returns the element type of a TOML array. The type returned
+// may be nil if it cannot be determined (e.g., a nil slice or a zero length
+// slize). This function may also panic if it finds a type that cannot be
+// expressed in TOML (such as nil elements, heterogeneous arrays or directly
+// nested arrays of tables).
+func tomlArrayType(rv reflect.Value) tomlType {
+	if isNil(rv) || !rv.IsValid() || rv.Len() == 0 {
+		return nil
+	}
+	firstType := tomlTypeOfGo(rv.Index(0))
+	if firstType == nil {
+		encPanic(errArrayNilElement)
+	}
+
+	rvlen := rv.Len()
+	for i := 1; i < rvlen; i++ {
+		elem := rv.Index(i)
+		switch elemType := tomlTypeOfGo(elem); {
+		case elemType == nil:
+			encPanic(errArrayNilElement)
+		case !typeEqual(firstType, elemType):
+			encPanic(errArrayMixedElementTypes)
+		}
+	}
+	// If we have a nested array, then we must make sure that the nested
+	// array contains ONLY primitives.
+	// This checks arbitrarily nested arrays.
+	if typeEqual(firstType, tomlArray) || typeEqual(firstType, tomlArrayHash) {
+		nest := tomlArrayType(eindirect(rv.Index(0)))
+		if typeEqual(nest, tomlHash) || typeEqual(nest, tomlArrayHash) {
+			encPanic(errArrayNoTable)
+		}
+	}
+	return firstType
+}
+
+func getOptions(keyName string) (string, map[string]struct{}) {
+	opts := make(map[string]struct{})
+	ss := strings.Split(keyName, ",")
+	name := ss[0]
+	if len(ss) > 1 {
+		for _, opt := range ss {
+			opts[opt] = struct{}{}
+		}
+	}
+
+	return name, opts
+}
+
+func isZero(rv reflect.Value) bool {
+	switch rv.Kind() {
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		if rv.Int() == 0 {
+			return true
+		}
+	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+		if rv.Uint() == 0 {
+			return true
+		}
+	case reflect.Float32, reflect.Float64:
+		if rv.Float() == 0.0 {
+			return true
+		}
+	}
+
+	return false
+}
+
+func isEmpty(rv reflect.Value) bool {
+	switch rv.Kind() {
+	case reflect.String:
+		if len(strings.TrimSpace(rv.String())) == 0 {
+			return true
+		}
+	case reflect.Array, reflect.Slice, reflect.Map:
+		if rv.Len() == 0 {
+			return true
+		}
+	}
+
+	return false
+}
+
+func (enc *Encoder) newline() {
+	if enc.hasWritten {
+		enc.wf("\n")
+	}
+}
+
+func (enc *Encoder) keyEqElement(key Key, val reflect.Value) {
+	if len(key) == 0 {
+		encPanic(errNoKey)
+	}
+	panicIfInvalidKey(key)
+	enc.wf("%s%s = ", enc.indentStr(key), key.maybeQuoted(len(key)-1))
+	enc.eElement(val)
+	enc.newline()
+}
+
+func (enc *Encoder) wf(format string, v ...interface{}) {
+	if _, err := fmt.Fprintf(enc.w, format, v...); err != nil {
+		encPanic(err)
+	}
+	enc.hasWritten = true
+}
+
+func (enc *Encoder) indentStr(key Key) string {
+	return strings.Repeat(enc.Indent, len(key)-1)
+}
+
+func encPanic(err error) {
+	panic(tomlEncodeError{err})
+}
+
+func eindirect(v reflect.Value) reflect.Value {
+	switch v.Kind() {
+	case reflect.Ptr, reflect.Interface:
+		return eindirect(v.Elem())
+	default:
+		return v
+	}
+}
+
+func isNil(rv reflect.Value) bool {
+	switch rv.Kind() {
+	case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
+		return rv.IsNil()
+	default:
+		return false
+	}
+}
+
+func panicIfInvalidKey(key Key) {
+	for _, k := range key {
+		if len(k) == 0 {
+			encPanic(e("Key '%s' is not a valid table name. Key names "+
+				"cannot be empty.", key.maybeQuotedAll()))
+		}
+	}
+}
+
+func isValidKeyName(s string) bool {
+	return len(s) != 0
+}


[36/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.c
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.c b/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.c
deleted file mode 100644
index 9228d24..0000000
--- a/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.c
+++ /dev/null
@@ -1,147782 +0,0 @@
-/******************************************************************************
-** This file is an amalgamation of many separate C source files from SQLite
-** version 3.8.5.  By combining all the individual C code files into this 
-** single large file, the entire code can be compiled as a single translation
-** unit.  This allows many compilers to do optimizations that would not be
-** possible if the files were compiled separately.  Performance improvements
-** of 5% or more are commonly seen when SQLite is compiled as a single
-** translation unit.
-**
-** This file is all you need to compile SQLite.  To use SQLite in other
-** programs, you need this file and the "sqlite3.h" header file that defines
-** the programming interface to the SQLite library.  (If you do not have 
-** the "sqlite3.h" header file at hand, you will find a copy embedded within
-** the text of this file.  Search for "Begin file sqlite3.h" to find the start
-** of the embedded sqlite3.h header file.) Additional code files may be needed
-** if you want a wrapper to interface SQLite with your choice of programming
-** language. The code for the "sqlite3" command-line shell is also in a
-** separate file. This file contains only code for the core SQLite library.
-*/
-#define SQLITE_CORE 1
-#define SQLITE_AMALGAMATION 1
-#ifndef SQLITE_PRIVATE
-# define SQLITE_PRIVATE static
-#endif
-#ifndef SQLITE_API
-# define SQLITE_API
-#endif
-/************** Begin file sqliteInt.h ***************************************/
-/*
-** 2001 September 15
-**
-** The author disclaims copyright to this source code.  In place of
-** a legal notice, here is a blessing:
-**
-**    May you do good and not evil.
-**    May you find forgiveness for yourself and forgive others.
-**    May you share freely, never taking more than you give.
-**
-*************************************************************************
-** Internal interface definitions for SQLite.
-**
-*/
-#ifndef _SQLITEINT_H_
-#define _SQLITEINT_H_
-
-/*
-** These #defines should enable >2GB file support on POSIX if the
-** underlying operating system supports it.  If the OS lacks
-** large file support, or if the OS is windows, these should be no-ops.
-**
-** Ticket #2739:  The _LARGEFILE_SOURCE macro must appear before any
-** system #includes.  Hence, this block of code must be the very first
-** code in all source files.
-**
-** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
-** on the compiler command line.  This is necessary if you are compiling
-** on a recent machine (ex: Red Hat 7.2) but you want your code to work
-** on an older machine (ex: Red Hat 6.0).  If you compile on Red Hat 7.2
-** without this option, LFS is enable.  But LFS does not exist in the kernel
-** in Red Hat 6.0, so the code won't work.  Hence, for maximum binary
-** portability you should omit LFS.
-**
-** The previous paragraph was written in 2005.  (This paragraph is written
-** on 2008-11-28.) These days, all Linux kernels support large files, so
-** you should probably leave LFS enabled.  But some embedded platforms might
-** lack LFS in which case the SQLITE_DISABLE_LFS macro might still be useful.
-**
-** Similar is true for Mac OS X.  LFS is only supported on Mac OS X 9 and later.
-*/
-#ifndef SQLITE_DISABLE_LFS
-# define _LARGE_FILE       1
-# ifndef _FILE_OFFSET_BITS
-#   define _FILE_OFFSET_BITS 64
-# endif
-# define _LARGEFILE_SOURCE 1
-#endif
-
-/*
-** For MinGW, check to see if we can include the header file containing its
-** version information, among other things.  Normally, this internal MinGW
-** header file would [only] be included automatically by other MinGW header
-** files; however, the contained version information is now required by this
-** header file to work around binary compatibility issues (see below) and
-** this is the only known way to reliably obtain it.  This entire #if block
-** would be completely unnecessary if there was any other way of detecting
-** MinGW via their preprocessor (e.g. if they customized their GCC to define
-** some MinGW-specific macros).  When compiling for MinGW, either the
-** _HAVE_MINGW_H or _HAVE__MINGW_H (note the extra underscore) macro must be
-** defined; otherwise, detection of conditions specific to MinGW will be
-** disabled.
-*/
-#if defined(_HAVE_MINGW_H)
-# include "mingw.h"
-#elif defined(_HAVE__MINGW_H)
-# include "_mingw.h"
-#endif
-
-/*
-** For MinGW version 4.x (and higher), check to see if the _USE_32BIT_TIME_T
-** define is required to maintain binary compatibility with the MSVC runtime
-** library in use (e.g. for Windows XP).
-*/
-#if !defined(_USE_32BIT_TIME_T) && !defined(_USE_64BIT_TIME_T) && \
-    defined(_WIN32) && !defined(_WIN64) && \
-    defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION >= 4 && \
-    defined(__MSVCRT__)
-# define _USE_32BIT_TIME_T
-#endif
-
-/* The public SQLite interface.  The _FILE_OFFSET_BITS macro must appear
-** first in QNX.  Also, the _USE_32BIT_TIME_T macro must appear first for
-** MinGW.
-*/
-/************** Include sqlite3.h in the middle of sqliteInt.h ***************/
-/************** Begin file sqlite3.h *****************************************/
-/*
-** 2001 September 15
-**
-** The author disclaims copyright to this source code.  In place of
-** a legal notice, here is a blessing:
-**
-**    May you do good and not evil.
-**    May you find forgiveness for yourself and forgive others.
-**    May you share freely, never taking more than you give.
-**
-*************************************************************************
-** This header file defines the interface that the SQLite library
-** presents to client programs.  If a C-function, structure, datatype,
-** or constant definition does not appear in this file, then it is
-** not a published API of SQLite, is subject to change without
-** notice, and should not be referenced by programs that use SQLite.
-**
-** Some of the definitions that are in this file are marked as
-** "experimental".  Experimental interfaces are normally new
-** features recently added to SQLite.  We do not anticipate changes
-** to experimental interfaces but reserve the right to make minor changes
-** if experience from use "in the wild" suggest such changes are prudent.
-**
-** The official C-language API documentation for SQLite is derived
-** from comments in this file.  This file is the authoritative source
-** on how SQLite interfaces are suppose to operate.
-**
-** The name of this file under configuration management is "sqlite.h.in".
-** The makefile makes some minor changes to this file (such as inserting
-** the version number) and changes its name to "sqlite3.h" as
-** part of the build process.
-*/
-#ifndef _SQLITE3_H_
-#define _SQLITE3_H_
-#include <stdarg.h>     /* Needed for the definition of va_list */
-
-/*
-** Make sure we can call this stuff from C++.
-*/
-#if 0
-extern "C" {
-#endif
-
-
-/*
-** Add the ability to override 'extern'
-*/
-#ifndef SQLITE_EXTERN
-# define SQLITE_EXTERN extern
-#endif
-
-#ifndef SQLITE_API
-# define SQLITE_API
-#endif
-
-
-/*
-** These no-op macros are used in front of interfaces to mark those
-** interfaces as either deprecated or experimental.  New applications
-** should not use deprecated interfaces - they are support for backwards
-** compatibility only.  Application writers should be aware that
-** experimental interfaces are subject to change in point releases.
-**
-** These macros used to resolve to various kinds of compiler magic that
-** would generate warning messages when they were used.  But that
-** compiler magic ended up generating such a flurry of bug reports
-** that we have taken it all out and gone back to using simple
-** noop macros.
-*/
-#define SQLITE_DEPRECATED
-#define SQLITE_EXPERIMENTAL
-
-/*
-** Ensure these symbols were not defined by some previous header file.
-*/
-#ifdef SQLITE_VERSION
-# undef SQLITE_VERSION
-#endif
-#ifdef SQLITE_VERSION_NUMBER
-# undef SQLITE_VERSION_NUMBER
-#endif
-
-/*
-** CAPI3REF: Compile-Time Library Version Numbers
-**
-** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header
-** evaluates to a string literal that is the SQLite version in the
-** format "X.Y.Z" where X is the major version number (always 3 for
-** SQLite3) and Y is the minor version number and Z is the release number.)^
-** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer
-** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same
-** numbers used in [SQLITE_VERSION].)^
-** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
-** be larger than the release from which it is derived.  Either Y will
-** be held constant and Z will be incremented or else Y will be incremented
-** and Z will be reset to zero.
-**
-** Since version 3.6.18, SQLite source code has been stored in the
-** <a href="http://www.fossil-scm.org/">Fossil configuration management
-** system</a>.  ^The SQLITE_SOURCE_ID macro evaluates to
-** a string which identifies a particular check-in of SQLite
-** within its configuration management system.  ^The SQLITE_SOURCE_ID
-** string contains the date and time of the check-in (UTC) and an SHA1
-** hash of the entire source tree.
-**
-** See also: [sqlite3_libversion()],
-** [sqlite3_libversion_number()], [sqlite3_sourceid()],
-** [sqlite_version()] and [sqlite_source_id()].
-*/
-#define SQLITE_VERSION        "3.8.5"
-#define SQLITE_VERSION_NUMBER 3008005
-#define SQLITE_SOURCE_ID      "2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212"
-
-/*
-** CAPI3REF: Run-Time Library Version Numbers
-** KEYWORDS: sqlite3_version, sqlite3_sourceid
-**
-** These interfaces provide the same information as the [SQLITE_VERSION],
-** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
-** but are associated with the library instead of the header file.  ^(Cautious
-** programmers might include assert() statements in their application to
-** verify that values returned by these interfaces match the macros in
-** the header, and thus insure that the application is
-** compiled with matching library and header files.
-**
-** <blockquote><pre>
-** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
-** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
-** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
-** </pre></blockquote>)^
-**
-** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
-** macro.  ^The sqlite3_libversion() function returns a pointer to the
-** to the sqlite3_version[] string constant.  The sqlite3_libversion()
-** function is provided for use in DLLs since DLL users usually do not have
-** direct access to string constants within the DLL.  ^The
-** sqlite3_libversion_number() function returns an integer equal to
-** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns 
-** a pointer to a string constant whose value is the same as the 
-** [SQLITE_SOURCE_ID] C preprocessor macro.
-**
-** See also: [sqlite_version()] and [sqlite_source_id()].
-*/
-SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
-SQLITE_API const char *sqlite3_libversion(void);
-SQLITE_API const char *sqlite3_sourceid(void);
-SQLITE_API int sqlite3_libversion_number(void);
-
-/*
-** CAPI3REF: Run-Time Library Compilation Options Diagnostics
-**
-** ^The sqlite3_compileoption_used() function returns 0 or 1 
-** indicating whether the specified option was defined at 
-** compile time.  ^The SQLITE_ prefix may be omitted from the 
-** option name passed to sqlite3_compileoption_used().  
-**
-** ^The sqlite3_compileoption_get() function allows iterating
-** over the list of options that were defined at compile time by
-** returning the N-th compile time option string.  ^If N is out of range,
-** sqlite3_compileoption_get() returns a NULL pointer.  ^The SQLITE_ 
-** prefix is omitted from any strings returned by 
-** sqlite3_compileoption_get().
-**
-** ^Support for the diagnostic functions sqlite3_compileoption_used()
-** and sqlite3_compileoption_get() may be omitted by specifying the 
-** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
-**
-** See also: SQL functions [sqlite_compileoption_used()] and
-** [sqlite_compileoption_get()] and the [compile_options pragma].
-*/
-#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
-SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
-SQLITE_API const char *sqlite3_compileoption_get(int N);
-#endif
-
-/*
-** CAPI3REF: Test To See If The Library Is Threadsafe
-**
-** ^The sqlite3_threadsafe() function returns zero if and only if
-** SQLite was compiled with mutexing code omitted due to the
-** [SQLITE_THREADSAFE] compile-time option being set to 0.
-**
-** SQLite can be compiled with or without mutexes.  When
-** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes
-** are enabled and SQLite is threadsafe.  When the
-** [SQLITE_THREADSAFE] macro is 0, 
-** the mutexes are omitted.  Without the mutexes, it is not safe
-** to use SQLite concurrently from more than one thread.
-**
-** Enabling mutexes incurs a measurable performance penalty.
-** So if speed is of utmost importance, it makes sense to disable
-** the mutexes.  But for maximum safety, mutexes should be enabled.
-** ^The default behavior is for mutexes to be enabled.
-**
-** This interface can be used by an application to make sure that the
-** version of SQLite that it is linking against was compiled with
-** the desired setting of the [SQLITE_THREADSAFE] macro.
-**
-** This interface only reports on the compile-time mutex setting
-** of the [SQLITE_THREADSAFE] flag.  If SQLite is compiled with
-** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but
-** can be fully or partially disabled using a call to [sqlite3_config()]
-** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],
-** or [SQLITE_CONFIG_MUTEX].  ^(The return value of the
-** sqlite3_threadsafe() function shows only the compile-time setting of
-** thread safety, not any run-time changes to that setting made by
-** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
-** is unchanged by calls to sqlite3_config().)^
-**
-** See the [threading mode] documentation for additional information.
-*/
-SQLITE_API int sqlite3_threadsafe(void);
-
-/*
-** CAPI3REF: Database Connection Handle
-** KEYWORDS: {database connection} {database connections}
-**
-** Each open SQLite database is represented by a pointer to an instance of
-** the opaque structure named "sqlite3".  It is useful to think of an sqlite3
-** pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and
-** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
-** and [sqlite3_close_v2()] are its destructors.  There are many other
-** interfaces (such as
-** [sqlite3_prepare_v2()], [sqlite3_create_function()], and
-** [sqlite3_busy_timeout()] to name but three) that are methods on an
-** sqlite3 object.
-*/
-typedef struct sqlite3 sqlite3;
-
-/*
-** CAPI3REF: 64-Bit Integer Types
-** KEYWORDS: sqlite_int64 sqlite_uint64
-**
-** Because there is no cross-platform way to specify 64-bit integer types
-** SQLite includes typedefs for 64-bit signed and unsigned integers.
-**
-** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
-** The sqlite_int64 and sqlite_uint64 types are supported for backwards
-** compatibility only.
-**
-** ^The sqlite3_int64 and sqlite_int64 types can store integer values
-** between -9223372036854775808 and +9223372036854775807 inclusive.  ^The
-** sqlite3_uint64 and sqlite_uint64 types can store integer values 
-** between 0 and +18446744073709551615 inclusive.
-*/
-#ifdef SQLITE_INT64_TYPE
-  typedef SQLITE_INT64_TYPE sqlite_int64;
-  typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
-#elif defined(_MSC_VER) || defined(__BORLANDC__)
-  typedef __int64 sqlite_int64;
-  typedef unsigned __int64 sqlite_uint64;
-#else
-  typedef long long int sqlite_int64;
-  typedef unsigned long long int sqlite_uint64;
-#endif
-typedef sqlite_int64 sqlite3_int64;
-typedef sqlite_uint64 sqlite3_uint64;
-
-/*
-** If compiling for a processor that lacks floating point support,
-** substitute integer for floating-point.
-*/
-#ifdef SQLITE_OMIT_FLOATING_POINT
-# define double sqlite3_int64
-#endif
-
-/*
-** CAPI3REF: Closing A Database Connection
-**
-** ^The sqlite3_close() and sqlite3_close_v2() routines are destructors
-** for the [sqlite3] object.
-** ^Calls to sqlite3_close() and sqlite3_close_v2() return SQLITE_OK if
-** the [sqlite3] object is successfully destroyed and all associated
-** resources are deallocated.
-**
-** ^If the database connection is associated with unfinalized prepared
-** statements or unfinished sqlite3_backup objects then sqlite3_close()
-** will leave the database connection open and return [SQLITE_BUSY].
-** ^If sqlite3_close_v2() is called with unfinalized prepared statements
-** and unfinished sqlite3_backups, then the database connection becomes
-** an unusable "zombie" which will automatically be deallocated when the
-** last prepared statement is finalized or the last sqlite3_backup is
-** finished.  The sqlite3_close_v2() interface is intended for use with
-** host languages that are garbage collected, and where the order in which
-** destructors are called is arbitrary.
-**
-** Applications should [sqlite3_finalize | finalize] all [prepared statements],
-** [sqlite3_blob_close | close] all [BLOB handles], and 
-** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
-** with the [sqlite3] object prior to attempting to close the object.  ^If
-** sqlite3_close_v2() is called on a [database connection] that still has
-** outstanding [prepared statements], [BLOB handles], and/or
-** [sqlite3_backup] objects then it returns SQLITE_OK but the deallocation
-** of resources is deferred until all [prepared statements], [BLOB handles],
-** and [sqlite3_backup] objects are also destroyed.
-**
-** ^If an [sqlite3] object is destroyed while a transaction is open,
-** the transaction is automatically rolled back.
-**
-** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
-** must be either a NULL
-** pointer or an [sqlite3] object pointer obtained
-** from [sqlite3_open()], [sqlite3_open16()], or
-** [sqlite3_open_v2()], and not previously closed.
-** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
-** argument is a harmless no-op.
-*/
-SQLITE_API int sqlite3_close(sqlite3*);
-SQLITE_API int sqlite3_close_v2(sqlite3*);
-
-/*
-** The type for a callback function.
-** This is legacy and deprecated.  It is included for historical
-** compatibility and is not documented.
-*/
-typedef int (*sqlite3_callback)(void*,int,char**, char**);
-
-/*
-** CAPI3REF: One-Step Query Execution Interface
-**
-** The sqlite3_exec() interface is a convenience wrapper around
-** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
-** that allows an application to run multiple statements of SQL
-** without having to use a lot of C code. 
-**
-** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
-** semicolon-separate SQL statements passed into its 2nd argument,
-** in the context of the [database connection] passed in as its 1st
-** argument.  ^If the callback function of the 3rd argument to
-** sqlite3_exec() is not NULL, then it is invoked for each result row
-** coming out of the evaluated SQL statements.  ^The 4th argument to
-** sqlite3_exec() is relayed through to the 1st argument of each
-** callback invocation.  ^If the callback pointer to sqlite3_exec()
-** is NULL, then no callback is ever invoked and result rows are
-** ignored.
-**
-** ^If an error occurs while evaluating the SQL statements passed into
-** sqlite3_exec(), then execution of the current statement stops and
-** subsequent statements are skipped.  ^If the 5th parameter to sqlite3_exec()
-** is not NULL then any error message is written into memory obtained
-** from [sqlite3_malloc()] and passed back through the 5th parameter.
-** To avoid memory leaks, the application should invoke [sqlite3_free()]
-** on error message strings returned through the 5th parameter of
-** of sqlite3_exec() after the error message string is no longer needed.
-** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
-** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
-** NULL before returning.
-**
-** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
-** routine returns SQLITE_ABORT without invoking the callback again and
-** without running any subsequent SQL statements.
-**
-** ^The 2nd argument to the sqlite3_exec() callback function is the
-** number of columns in the result.  ^The 3rd argument to the sqlite3_exec()
-** callback is an array of pointers to strings obtained as if from
-** [sqlite3_column_text()], one for each column.  ^If an element of a
-** result row is NULL then the corresponding string pointer for the
-** sqlite3_exec() callback is a NULL pointer.  ^The 4th argument to the
-** sqlite3_exec() callback is an array of pointers to strings where each
-** entry represents the name of corresponding result column as obtained
-** from [sqlite3_column_name()].
-**
-** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
-** to an empty string, or a pointer that contains only whitespace and/or 
-** SQL comments, then no SQL statements are evaluated and the database
-** is not changed.
-**
-** Restrictions:
-**
-** <ul>
-** <li> The application must insure that the 1st parameter to sqlite3_exec()
-**      is a valid and open [database connection].
-** <li> The application must not close the [database connection] specified by
-**      the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
-** <li> The application must not modify the SQL statement text passed into
-**      the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
-** </ul>
-*/
-SQLITE_API int sqlite3_exec(
-  sqlite3*,                                  /* An open database */
-  const char *sql,                           /* SQL to be evaluated */
-  int (*callback)(void*,int,char**,char**),  /* Callback function */
-  void *,                                    /* 1st argument to callback */
-  char **errmsg                              /* Error msg written here */
-);
-
-/*
-** CAPI3REF: Result Codes
-** KEYWORDS: SQLITE_OK {error code} {error codes}
-** KEYWORDS: {result code} {result codes}
-**
-** Many SQLite functions return an integer result code from the set shown
-** here in order to indicate success or failure.
-**
-** New error codes may be added in future versions of SQLite.
-**
-** See also: [SQLITE_IOERR_READ | extended result codes],
-** [sqlite3_vtab_on_conflict()] [SQLITE_ROLLBACK | result codes].
-*/
-#define SQLITE_OK           0   /* Successful result */
-/* beginning-of-error-codes */
-#define SQLITE_ERROR        1   /* SQL error or missing database */
-#define SQLITE_INTERNAL     2   /* Internal logic error in SQLite */
-#define SQLITE_PERM         3   /* Access permission denied */
-#define SQLITE_ABORT        4   /* Callback routine requested an abort */
-#define SQLITE_BUSY         5   /* The database file is locked */
-#define SQLITE_LOCKED       6   /* A table in the database is locked */
-#define SQLITE_NOMEM        7   /* A malloc() failed */
-#define SQLITE_READONLY     8   /* Attempt to write a readonly database */
-#define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite3_interrupt()*/
-#define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
-#define SQLITE_CORRUPT     11   /* The database disk image is malformed */
-#define SQLITE_NOTFOUND    12   /* Unknown opcode in sqlite3_file_control() */
-#define SQLITE_FULL        13   /* Insertion failed because database is full */
-#define SQLITE_CANTOPEN    14   /* Unable to open the database file */
-#define SQLITE_PROTOCOL    15   /* Database lock protocol error */
-#define SQLITE_EMPTY       16   /* Database is empty */
-#define SQLITE_SCHEMA      17   /* The database schema changed */
-#define SQLITE_TOOBIG      18   /* String or BLOB exceeds size limit */
-#define SQLITE_CONSTRAINT  19   /* Abort due to constraint violation */
-#define SQLITE_MISMATCH    20   /* Data type mismatch */
-#define SQLITE_MISUSE      21   /* Library used incorrectly */
-#define SQLITE_NOLFS       22   /* Uses OS features not supported on host */
-#define SQLITE_AUTH        23   /* Authorization denied */
-#define SQLITE_FORMAT      24   /* Auxiliary database format error */
-#define SQLITE_RANGE       25   /* 2nd parameter to sqlite3_bind out of range */
-#define SQLITE_NOTADB      26   /* File opened that is not a database file */
-#define SQLITE_NOTICE      27   /* Notifications from sqlite3_log() */
-#define SQLITE_WARNING     28   /* Warnings from sqlite3_log() */
-#define SQLITE_ROW         100  /* sqlite3_step() has another row ready */
-#define SQLITE_DONE        101  /* sqlite3_step() has finished executing */
-/* end-of-error-codes */
-
-/*
-** CAPI3REF: Extended Result Codes
-** KEYWORDS: {extended error code} {extended error codes}
-** KEYWORDS: {extended result code} {extended result codes}
-**
-** In its default configuration, SQLite API routines return one of 26 integer
-** [SQLITE_OK | result codes].  However, experience has shown that many of
-** these result codes are too coarse-grained.  They do not provide as
-** much information about problems as programmers might like.  In an effort to
-** address this, newer versions of SQLite (version 3.3.8 and later) include
-** support for additional result codes that provide more detailed information
-** about errors. The extended result codes are enabled or disabled
-** on a per database connection basis using the
-** [sqlite3_extended_result_codes()] API.
-**
-** Some of the available extended result codes are listed here.
-** One may expect the number of extended result codes will increase
-** over time.  Software that uses extended result codes should expect
-** to see new result codes in future releases of SQLite.
-**
-** The SQLITE_OK result code will never be extended.  It will always
-** be exactly zero.
-*/
-#define SQLITE_IOERR_READ              (SQLITE_IOERR | (1<<8))
-#define SQLITE_IOERR_SHORT_READ        (SQLITE_IOERR | (2<<8))
-#define SQLITE_IOERR_WRITE             (SQLITE_IOERR | (3<<8))
-#define SQLITE_IOERR_FSYNC             (SQLITE_IOERR | (4<<8))
-#define SQLITE_IOERR_DIR_FSYNC         (SQLITE_IOERR | (5<<8))
-#define SQLITE_IOERR_TRUNCATE          (SQLITE_IOERR | (6<<8))
-#define SQLITE_IOERR_FSTAT             (SQLITE_IOERR | (7<<8))
-#define SQLITE_IOERR_UNLOCK            (SQLITE_IOERR | (8<<8))
-#define SQLITE_IOERR_RDLOCK            (SQLITE_IOERR | (9<<8))
-#define SQLITE_IOERR_DELETE            (SQLITE_IOERR | (10<<8))
-#define SQLITE_IOERR_BLOCKED           (SQLITE_IOERR | (11<<8))
-#define SQLITE_IOERR_NOMEM             (SQLITE_IOERR | (12<<8))
-#define SQLITE_IOERR_ACCESS            (SQLITE_IOERR | (13<<8))
-#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8))
-#define SQLITE_IOERR_LOCK              (SQLITE_IOERR | (15<<8))
-#define SQLITE_IOERR_CLOSE             (SQLITE_IOERR | (16<<8))
-#define SQLITE_IOERR_DIR_CLOSE         (SQLITE_IOERR | (17<<8))
-#define SQLITE_IOERR_SHMOPEN           (SQLITE_IOERR | (18<<8))
-#define SQLITE_IOERR_SHMSIZE           (SQLITE_IOERR | (19<<8))
-#define SQLITE_IOERR_SHMLOCK           (SQLITE_IOERR | (20<<8))
-#define SQLITE_IOERR_SHMMAP            (SQLITE_IOERR | (21<<8))
-#define SQLITE_IOERR_SEEK              (SQLITE_IOERR | (22<<8))
-#define SQLITE_IOERR_DELETE_NOENT      (SQLITE_IOERR | (23<<8))
-#define SQLITE_IOERR_MMAP              (SQLITE_IOERR | (24<<8))
-#define SQLITE_IOERR_GETTEMPPATH       (SQLITE_IOERR | (25<<8))
-#define SQLITE_IOERR_CONVPATH          (SQLITE_IOERR | (26<<8))
-#define SQLITE_LOCKED_SHAREDCACHE      (SQLITE_LOCKED |  (1<<8))
-#define SQLITE_BUSY_RECOVERY           (SQLITE_BUSY   |  (1<<8))
-#define SQLITE_BUSY_SNAPSHOT           (SQLITE_BUSY   |  (2<<8))
-#define SQLITE_CANTOPEN_NOTEMPDIR      (SQLITE_CANTOPEN | (1<<8))
-#define SQLITE_CANTOPEN_ISDIR          (SQLITE_CANTOPEN | (2<<8))
-#define SQLITE_CANTOPEN_FULLPATH       (SQLITE_CANTOPEN | (3<<8))
-#define SQLITE_CANTOPEN_CONVPATH       (SQLITE_CANTOPEN | (4<<8))
-#define SQLITE_CORRUPT_VTAB            (SQLITE_CORRUPT | (1<<8))
-#define SQLITE_READONLY_RECOVERY       (SQLITE_READONLY | (1<<8))
-#define SQLITE_READONLY_CANTLOCK       (SQLITE_READONLY | (2<<8))
-#define SQLITE_READONLY_ROLLBACK       (SQLITE_READONLY | (3<<8))
-#define SQLITE_READONLY_DBMOVED        (SQLITE_READONLY | (4<<8))
-#define SQLITE_ABORT_ROLLBACK          (SQLITE_ABORT | (2<<8))
-#define SQLITE_CONSTRAINT_CHECK        (SQLITE_CONSTRAINT | (1<<8))
-#define SQLITE_CONSTRAINT_COMMITHOOK   (SQLITE_CONSTRAINT | (2<<8))
-#define SQLITE_CONSTRAINT_FOREIGNKEY   (SQLITE_CONSTRAINT | (3<<8))
-#define SQLITE_CONSTRAINT_FUNCTION     (SQLITE_CONSTRAINT | (4<<8))
-#define SQLITE_CONSTRAINT_NOTNULL      (SQLITE_CONSTRAINT | (5<<8))
-#define SQLITE_CONSTRAINT_PRIMARYKEY   (SQLITE_CONSTRAINT | (6<<8))
-#define SQLITE_CONSTRAINT_TRIGGER      (SQLITE_CONSTRAINT | (7<<8))
-#define SQLITE_CONSTRAINT_UNIQUE       (SQLITE_CONSTRAINT | (8<<8))
-#define SQLITE_CONSTRAINT_VTAB         (SQLITE_CONSTRAINT | (9<<8))
-#define SQLITE_CONSTRAINT_ROWID        (SQLITE_CONSTRAINT |(10<<8))
-#define SQLITE_NOTICE_RECOVER_WAL      (SQLITE_NOTICE | (1<<8))
-#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
-#define SQLITE_WARNING_AUTOINDEX       (SQLITE_WARNING | (1<<8))
-
-/*
-** CAPI3REF: Flags For File Open Operations
-**
-** These bit values are intended for use in the
-** 3rd parameter to the [sqlite3_open_v2()] interface and
-** in the 4th parameter to the [sqlite3_vfs.xOpen] method.
-*/
-#define SQLITE_OPEN_READONLY         0x00000001  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_READWRITE        0x00000002  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_CREATE           0x00000004  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_DELETEONCLOSE    0x00000008  /* VFS only */
-#define SQLITE_OPEN_EXCLUSIVE        0x00000010  /* VFS only */
-#define SQLITE_OPEN_AUTOPROXY        0x00000020  /* VFS only */
-#define SQLITE_OPEN_URI              0x00000040  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_MEMORY           0x00000080  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_MAIN_DB          0x00000100  /* VFS only */
-#define SQLITE_OPEN_TEMP_DB          0x00000200  /* VFS only */
-#define SQLITE_OPEN_TRANSIENT_DB     0x00000400  /* VFS only */
-#define SQLITE_OPEN_MAIN_JOURNAL     0x00000800  /* VFS only */
-#define SQLITE_OPEN_TEMP_JOURNAL     0x00001000  /* VFS only */
-#define SQLITE_OPEN_SUBJOURNAL       0x00002000  /* VFS only */
-#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000  /* VFS only */
-#define SQLITE_OPEN_NOMUTEX          0x00008000  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_FULLMUTEX        0x00010000  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_SHAREDCACHE      0x00020000  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_PRIVATECACHE     0x00040000  /* Ok for sqlite3_open_v2() */
-#define SQLITE_OPEN_WAL              0x00080000  /* VFS only */
-
-/* Reserved:                         0x00F00000 */
-
-/*
-** CAPI3REF: Device Characteristics
-**
-** The xDeviceCharacteristics method of the [sqlite3_io_methods]
-** object returns an integer which is a vector of these
-** bit values expressing I/O characteristics of the mass storage
-** device that holds the file that the [sqlite3_io_methods]
-** refers to.
-**
-** The SQLITE_IOCAP_ATOMIC property means that all writes of
-** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
-** mean that writes of blocks that are nnn bytes in size and
-** are aligned to an address which is an integer multiple of
-** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
-** that when data is appended to a file, the data is appended
-** first then the size of the file is extended, never the other
-** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
-** information is written to disk in the same order as calls
-** to xWrite().  The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
-** after reboot following a crash or power loss, the only bytes in a
-** file that were written at the application level might have changed
-** and that adjacent bytes, even bytes within the same sector are
-** guaranteed to be unchanged.  The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
-** flag indicate that a file cannot be deleted when open.  The
-** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
-** read-only media and cannot be changed even by processes with
-** elevated privileges.
-*/
-#define SQLITE_IOCAP_ATOMIC                 0x00000001
-#define SQLITE_IOCAP_ATOMIC512              0x00000002
-#define SQLITE_IOCAP_ATOMIC1K               0x00000004
-#define SQLITE_IOCAP_ATOMIC2K               0x00000008
-#define SQLITE_IOCAP_ATOMIC4K               0x00000010
-#define SQLITE_IOCAP_ATOMIC8K               0x00000020
-#define SQLITE_IOCAP_ATOMIC16K              0x00000040
-#define SQLITE_IOCAP_ATOMIC32K              0x00000080
-#define SQLITE_IOCAP_ATOMIC64K              0x00000100
-#define SQLITE_IOCAP_SAFE_APPEND            0x00000200
-#define SQLITE_IOCAP_SEQUENTIAL             0x00000400
-#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN  0x00000800
-#define SQLITE_IOCAP_POWERSAFE_OVERWRITE    0x00001000
-#define SQLITE_IOCAP_IMMUTABLE              0x00002000
-
-/*
-** CAPI3REF: File Locking Levels
-**
-** SQLite uses one of these integer values as the second
-** argument to calls it makes to the xLock() and xUnlock() methods
-** of an [sqlite3_io_methods] object.
-*/
-#define SQLITE_LOCK_NONE          0
-#define SQLITE_LOCK_SHARED        1
-#define SQLITE_LOCK_RESERVED      2
-#define SQLITE_LOCK_PENDING       3
-#define SQLITE_LOCK_EXCLUSIVE     4
-
-/*
-** CAPI3REF: Synchronization Type Flags
-**
-** When SQLite invokes the xSync() method of an
-** [sqlite3_io_methods] object it uses a combination of
-** these integer values as the second argument.
-**
-** When the SQLITE_SYNC_DATAONLY flag is used, it means that the
-** sync operation only needs to flush data to mass storage.  Inode
-** information need not be flushed. If the lower four bits of the flag
-** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
-** If the lower four bits equal SQLITE_SYNC_FULL, that means
-** to use Mac OS X style fullsync instead of fsync().
-**
-** Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
-** with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
-** settings.  The [synchronous pragma] determines when calls to the
-** xSync VFS method occur and applies uniformly across all platforms.
-** The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
-** energetic or rigorous or forceful the sync operations are and
-** only make a difference on Mac OSX for the default SQLite code.
-** (Third-party VFS implementations might also make the distinction
-** between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
-** operating systems natively supported by SQLite, only Mac OSX
-** cares about the difference.)
-*/
-#define SQLITE_SYNC_NORMAL        0x00002
-#define SQLITE_SYNC_FULL          0x00003
-#define SQLITE_SYNC_DATAONLY      0x00010
-
-/*
-** CAPI3REF: OS Interface Open File Handle
-**
-** An [sqlite3_file] object represents an open file in the 
-** [sqlite3_vfs | OS interface layer].  Individual OS interface
-** implementations will
-** want to subclass this object by appending additional fields
-** for their own use.  The pMethods entry is a pointer to an
-** [sqlite3_io_methods] object that defines methods for performing
-** I/O operations on the open file.
-*/
-typedef struct sqlite3_file sqlite3_file;
-struct sqlite3_file {
-  const struct sqlite3_io_methods *pMethods;  /* Methods for an open file */
-};
-
-/*
-** CAPI3REF: OS Interface File Virtual Methods Object
-**
-** Every file opened by the [sqlite3_vfs.xOpen] method populates an
-** [sqlite3_file] object (or, more commonly, a subclass of the
-** [sqlite3_file] object) with a pointer to an instance of this object.
-** This object defines the methods used to perform various operations
-** against the open file represented by the [sqlite3_file] object.
-**
-** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element 
-** to a non-NULL pointer, then the sqlite3_io_methods.xClose method
-** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed.  The
-** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen]
-** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
-** to NULL.
-**
-** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or
-** [SQLITE_SYNC_FULL].  The first choice is the normal fsync().
-** The second choice is a Mac OS X style fullsync.  The [SQLITE_SYNC_DATAONLY]
-** flag may be ORed in to indicate that only the data of the file
-** and not its inode needs to be synced.
-**
-** The integer values to xLock() and xUnlock() are one of
-** <ul>
-** <li> [SQLITE_LOCK_NONE],
-** <li> [SQLITE_LOCK_SHARED],
-** <li> [SQLITE_LOCK_RESERVED],
-** <li> [SQLITE_LOCK_PENDING], or
-** <li> [SQLITE_LOCK_EXCLUSIVE].
-** </ul>
-** xLock() increases the lock. xUnlock() decreases the lock.
-** The xCheckReservedLock() method checks whether any database connection,
-** either in this process or in some other process, is holding a RESERVED,
-** PENDING, or EXCLUSIVE lock on the file.  It returns true
-** if such a lock exists and false otherwise.
-**
-** The xFileControl() method is a generic interface that allows custom
-** VFS implementations to directly control an open file using the
-** [sqlite3_file_control()] interface.  The second "op" argument is an
-** integer opcode.  The third argument is a generic pointer intended to
-** point to a structure that may contain arguments or space in which to
-** write return values.  Potential uses for xFileControl() might be
-** functions to enable blocking locks with timeouts, to change the
-** locking strategy (for example to use dot-file locks), to inquire
-** about the status of a lock, or to break stale locks.  The SQLite
-** core reserves all opcodes less than 100 for its own use.
-** A [SQLITE_FCNTL_LOCKSTATE | list of opcodes] less than 100 is available.
-** Applications that define a custom xFileControl method should use opcodes
-** greater than 100 to avoid conflicts.  VFS implementations should
-** return [SQLITE_NOTFOUND] for file control opcodes that they do not
-** recognize.
-**
-** The xSectorSize() method returns the sector size of the
-** device that underlies the file.  The sector size is the
-** minimum write that can be performed without disturbing
-** other bytes in the file.  The xDeviceCharacteristics()
-** method returns a bit vector describing behaviors of the
-** underlying device:
-**
-** <ul>
-** <li> [SQLITE_IOCAP_ATOMIC]
-** <li> [SQLITE_IOCAP_ATOMIC512]
-** <li> [SQLITE_IOCAP_ATOMIC1K]
-** <li> [SQLITE_IOCAP_ATOMIC2K]
-** <li> [SQLITE_IOCAP_ATOMIC4K]
-** <li> [SQLITE_IOCAP_ATOMIC8K]
-** <li> [SQLITE_IOCAP_ATOMIC16K]
-** <li> [SQLITE_IOCAP_ATOMIC32K]
-** <li> [SQLITE_IOCAP_ATOMIC64K]
-** <li> [SQLITE_IOCAP_SAFE_APPEND]
-** <li> [SQLITE_IOCAP_SEQUENTIAL]
-** </ul>
-**
-** The SQLITE_IOCAP_ATOMIC property means that all writes of
-** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
-** mean that writes of blocks that are nnn bytes in size and
-** are aligned to an address which is an integer multiple of
-** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
-** that when data is appended to a file, the data is appended
-** first then the size of the file is extended, never the other
-** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
-** information is written to disk in the same order as calls
-** to xWrite().
-**
-** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
-** in the unread portions of the buffer with zeros.  A VFS that
-** fails to zero-fill short reads might seem to work.  However,
-** failure to zero-fill short reads will eventually lead to
-** database corruption.
-*/
-typedef struct sqlite3_io_methods sqlite3_io_methods;
-struct sqlite3_io_methods {
-  int iVersion;
-  int (*xClose)(sqlite3_file*);
-  int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
-  int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
-  int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
-  int (*xSync)(sqlite3_file*, int flags);
-  int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
-  int (*xLock)(sqlite3_file*, int);
-  int (*xUnlock)(sqlite3_file*, int);
-  int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
-  int (*xFileControl)(sqlite3_file*, int op, void *pArg);
-  int (*xSectorSize)(sqlite3_file*);
-  int (*xDeviceCharacteristics)(sqlite3_file*);
-  /* Methods above are valid for version 1 */
-  int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
-  int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
-  void (*xShmBarrier)(sqlite3_file*);
-  int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
-  /* Methods above are valid for version 2 */
-  int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
-  int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
-  /* Methods above are valid for version 3 */
-  /* Additional methods may be added in future releases */
-};
-
-/*
-** CAPI3REF: Standard File Control Opcodes
-**
-** These integer constants are opcodes for the xFileControl method
-** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()]
-** interface.
-**
-** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging.  This
-** opcode causes the xFileControl method to write the current state of
-** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],
-** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])
-** into an integer that the pArg argument points to. This capability
-** is used during testing and only needs to be supported when SQLITE_TEST
-** is defined.
-** <ul>
-** <li>[[SQLITE_FCNTL_SIZE_HINT]]
-** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
-** layer a hint of how large the database file will grow to be during the
-** current transaction.  This hint is not guaranteed to be accurate but it
-** is often close.  The underlying VFS might choose to preallocate database
-** file space based on this hint in order to help writes to the database
-** file run faster.
-**
-** <li>[[SQLITE_FCNTL_CHUNK_SIZE]]
-** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS
-** extends and truncates the database file in chunks of a size specified
-** by the user. The fourth argument to [sqlite3_file_control()] should 
-** point to an integer (type int) containing the new chunk-size to use
-** for the nominated database. Allocating database file space in large
-** chunks (say 1MB at a time), may reduce file-system fragmentation and
-** improve performance on some systems.
-**
-** <li>[[SQLITE_FCNTL_FILE_POINTER]]
-** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer
-** to the [sqlite3_file] object associated with a particular database
-** connection.  See the [sqlite3_file_control()] documentation for
-** additional information.
-**
-** <li>[[SQLITE_FCNTL_SYNC_OMITTED]]
-** No longer in use.
-**
-** <li>[[SQLITE_FCNTL_SYNC]]
-** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and
-** sent to the VFS immediately before the xSync method is invoked on a
-** database file descriptor. Or, if the xSync method is not invoked 
-** because the user has configured SQLite with 
-** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place 
-** of the xSync method. In most cases, the pointer argument passed with
-** this file-control is NULL. However, if the database file is being synced
-** as part of a multi-database commit, the argument points to a nul-terminated
-** string containing the transactions master-journal file name. VFSes that 
-** do not need this signal should silently ignore this opcode. Applications 
-** should not call [sqlite3_file_control()] with this opcode as doing so may 
-** disrupt the operation of the specialized VFSes that do require it.  
-**
-** <li>[[SQLITE_FCNTL_COMMIT_PHASETWO]]
-** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite
-** and sent to the VFS after a transaction has been committed immediately
-** but before the database is unlocked. VFSes that do not need this signal
-** should silently ignore this opcode. Applications should not call
-** [sqlite3_file_control()] with this opcode as doing so may disrupt the 
-** operation of the specialized VFSes that do require it.  
-**
-** <li>[[SQLITE_FCNTL_WIN32_AV_RETRY]]
-** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic
-** retry counts and intervals for certain disk I/O operations for the
-** windows [VFS] in order to provide robustness in the presence of
-** anti-virus programs.  By default, the windows VFS will retry file read,
-** file write, and file delete operations up to 10 times, with a delay
-** of 25 milliseconds before the first retry and with the delay increasing
-** by an additional 25 milliseconds with each subsequent retry.  This
-** opcode allows these two values (10 retries and 25 milliseconds of delay)
-** to be adjusted.  The values are changed for all database connections
-** within the same process.  The argument is a pointer to an array of two
-** integers where the first integer i the new retry count and the second
-** integer is the delay.  If either integer is negative, then the setting
-** is not changed but instead the prior value of that setting is written
-** into the array entry, allowing the current retry settings to be
-** interrogated.  The zDbName parameter is ignored.
-**
-** <li>[[SQLITE_FCNTL_PERSIST_WAL]]
-** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the
-** persistent [WAL | Write Ahead Log] setting.  By default, the auxiliary
-** write ahead log and shared memory files used for transaction control
-** are automatically deleted when the latest connection to the database
-** closes.  Setting persistent WAL mode causes those files to persist after
-** close.  Persisting the files is useful when other processes that do not
-** have write permission on the directory containing the database file want
-** to read the database file, as the WAL and shared memory files must exist
-** in order for the database to be readable.  The fourth parameter to
-** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
-** That integer is 0 to disable persistent WAL mode or 1 to enable persistent
-** WAL mode.  If the integer is -1, then it is overwritten with the current
-** WAL persistence setting.
-**
-** <li>[[SQLITE_FCNTL_POWERSAFE_OVERWRITE]]
-** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the
-** persistent "powersafe-overwrite" or "PSOW" setting.  The PSOW setting
-** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the
-** xDeviceCharacteristics methods. The fourth parameter to
-** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
-** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage
-** mode.  If the integer is -1, then it is overwritten with the current
-** zero-damage mode setting.
-**
-** <li>[[SQLITE_FCNTL_OVERWRITE]]
-** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening
-** a write transaction to indicate that, unless it is rolled back for some
-** reason, the entire database file will be overwritten by the current 
-** transaction. This is used by VACUUM operations.
-**
-** <li>[[SQLITE_FCNTL_VFSNAME]]
-** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
-** all [VFSes] in the VFS stack.  The names are of all VFS shims and the
-** final bottom-level VFS are written into memory obtained from 
-** [sqlite3_malloc()] and the result is stored in the char* variable
-** that the fourth parameter of [sqlite3_file_control()] points to.
-** The caller is responsible for freeing the memory when done.  As with
-** all file-control actions, there is no guarantee that this will actually
-** do anything.  Callers should initialize the char* variable to a NULL
-** pointer in case this file-control is not implemented.  This file-control
-** is intended for diagnostic use only.
-**
-** <li>[[SQLITE_FCNTL_PRAGMA]]
-** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] 
-** file control is sent to the open [sqlite3_file] object corresponding
-** to the database file to which the pragma statement refers. ^The argument
-** to the [SQLITE_FCNTL_PRAGMA] file control is an array of
-** pointers to strings (char**) in which the second element of the array
-** is the name of the pragma and the third element is the argument to the
-** pragma or NULL if the pragma has no argument.  ^The handler for an
-** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element
-** of the char** argument point to a string obtained from [sqlite3_mprintf()]
-** or the equivalent and that string will become the result of the pragma or
-** the error message if the pragma fails. ^If the
-** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal 
-** [PRAGMA] processing continues.  ^If the [SQLITE_FCNTL_PRAGMA]
-** file control returns [SQLITE_OK], then the parser assumes that the
-** VFS has handled the PRAGMA itself and the parser generates a no-op
-** prepared statement.  ^If the [SQLITE_FCNTL_PRAGMA] file control returns
-** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means
-** that the VFS encountered an error while handling the [PRAGMA] and the
-** compilation of the PRAGMA fails with an error.  ^The [SQLITE_FCNTL_PRAGMA]
-** file control occurs at the beginning of pragma statement analysis and so
-** it is able to override built-in [PRAGMA] statements.
-**
-** <li>[[SQLITE_FCNTL_BUSYHANDLER]]
-** ^The [SQLITE_FCNTL_BUSYHANDLER]
-** file-control may be invoked by SQLite on the database file handle
-** shortly after it is opened in order to provide a custom VFS with access
-** to the connections busy-handler callback. The argument is of type (void **)
-** - an array of two (void *) values. The first (void *) actually points
-** to a function of type (int (*)(void *)). In order to invoke the connections
-** busy-handler, this function should be invoked with the second (void *) in
-** the array as the only argument. If it returns non-zero, then the operation
-** should be retried. If it returns zero, the custom VFS should abandon the
-** current operation.
-**
-** <li>[[SQLITE_FCNTL_TEMPFILENAME]]
-** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control
-** to have SQLite generate a
-** temporary filename using the same algorithm that is followed to generate
-** temporary filenames for TEMP tables and other internal uses.  The
-** argument should be a char** which will be filled with the filename
-** written into memory obtained from [sqlite3_malloc()].  The caller should
-** invoke [sqlite3_free()] on the result to avoid a memory leak.
-**
-** <li>[[SQLITE_FCNTL_MMAP_SIZE]]
-** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the
-** maximum number of bytes that will be used for memory-mapped I/O.
-** The argument is a pointer to a value of type sqlite3_int64 that
-** is an advisory maximum number of bytes in the file to memory map.  The
-** pointer is overwritten with the old value.  The limit is not changed if
-** the value originally pointed to is negative, and so the current limit 
-** can be queried by passing in a pointer to a negative number.  This
-** file-control is used internally to implement [PRAGMA mmap_size].
-**
-** <li>[[SQLITE_FCNTL_TRACE]]
-** The [SQLITE_FCNTL_TRACE] file control provides advisory information
-** to the VFS about what the higher layers of the SQLite stack are doing.
-** This file control is used by some VFS activity tracing [shims].
-** The argument is a zero-terminated string.  Higher layers in the
-** SQLite stack may generate instances of this file control if
-** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled.
-**
-** <li>[[SQLITE_FCNTL_HAS_MOVED]]
-** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a
-** pointer to an integer and it writes a boolean into that integer depending
-** on whether or not the file has been renamed, moved, or deleted since it
-** was first opened.
-**
-** <li>[[SQLITE_FCNTL_WIN32_SET_HANDLE]]
-** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging.  This
-** opcode causes the xFileControl method to swap the file handle with the one
-** pointed to by the pArg argument.  This capability is used during testing
-** and only needs to be supported when SQLITE_TEST is defined.
-**
-** </ul>
-*/
-#define SQLITE_FCNTL_LOCKSTATE               1
-#define SQLITE_GET_LOCKPROXYFILE             2
-#define SQLITE_SET_LOCKPROXYFILE             3
-#define SQLITE_LAST_ERRNO                    4
-#define SQLITE_FCNTL_SIZE_HINT               5
-#define SQLITE_FCNTL_CHUNK_SIZE              6
-#define SQLITE_FCNTL_FILE_POINTER            7
-#define SQLITE_FCNTL_SYNC_OMITTED            8
-#define SQLITE_FCNTL_WIN32_AV_RETRY          9
-#define SQLITE_FCNTL_PERSIST_WAL            10
-#define SQLITE_FCNTL_OVERWRITE              11
-#define SQLITE_FCNTL_VFSNAME                12
-#define SQLITE_FCNTL_POWERSAFE_OVERWRITE    13
-#define SQLITE_FCNTL_PRAGMA                 14
-#define SQLITE_FCNTL_BUSYHANDLER            15
-#define SQLITE_FCNTL_TEMPFILENAME           16
-#define SQLITE_FCNTL_MMAP_SIZE              18
-#define SQLITE_FCNTL_TRACE                  19
-#define SQLITE_FCNTL_HAS_MOVED              20
-#define SQLITE_FCNTL_SYNC                   21
-#define SQLITE_FCNTL_COMMIT_PHASETWO        22
-#define SQLITE_FCNTL_WIN32_SET_HANDLE       23
-
-/*
-** CAPI3REF: Mutex Handle
-**
-** The mutex module within SQLite defines [sqlite3_mutex] to be an
-** abstract type for a mutex object.  The SQLite core never looks
-** at the internal representation of an [sqlite3_mutex].  It only
-** deals with pointers to the [sqlite3_mutex] object.
-**
-** Mutexes are created using [sqlite3_mutex_alloc()].
-*/
-typedef struct sqlite3_mutex sqlite3_mutex;
-
-/*
-** CAPI3REF: OS Interface Object
-**
-** An instance of the sqlite3_vfs object defines the interface between
-** the SQLite core and the underlying operating system.  The "vfs"
-** in the name of the object stands for "virtual file system".  See
-** the [VFS | VFS documentation] for further information.
-**
-** The value of the iVersion field is initially 1 but may be larger in
-** future versions of SQLite.  Additional fields may be appended to this
-** object when the iVersion value is increased.  Note that the structure
-** of the sqlite3_vfs object changes in the transaction between
-** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not
-** modified.
-**
-** The szOsFile field is the size of the subclassed [sqlite3_file]
-** structure used by this VFS.  mxPathname is the maximum length of
-** a pathname in this VFS.
-**
-** Registered sqlite3_vfs objects are kept on a linked list formed by
-** the pNext pointer.  The [sqlite3_vfs_register()]
-** and [sqlite3_vfs_unregister()] interfaces manage this list
-** in a thread-safe way.  The [sqlite3_vfs_find()] interface
-** searches the list.  Neither the application code nor the VFS
-** implementation should use the pNext pointer.
-**
-** The pNext field is the only field in the sqlite3_vfs
-** structure that SQLite will ever modify.  SQLite will only access
-** or modify this field while holding a particular static mutex.
-** The application should never modify anything within the sqlite3_vfs
-** object once the object has been registered.
-**
-** The zName field holds the name of the VFS module.  The name must
-** be unique across all VFS modules.
-**
-** [[sqlite3_vfs.xOpen]]
-** ^SQLite guarantees that the zFilename parameter to xOpen
-** is either a NULL pointer or string obtained
-** from xFullPathname() with an optional suffix added.
-** ^If a suffix is added to the zFilename parameter, it will
-** consist of a single "-" character followed by no more than
-** 11 alphanumeric and/or "-" characters.
-** ^SQLite further guarantees that
-** the string will be valid and unchanged until xClose() is
-** called. Because of the previous sentence,
-** the [sqlite3_file] can safely store a pointer to the
-** filename if it needs to remember the filename for some reason.
-** If the zFilename parameter to xOpen is a NULL pointer then xOpen
-** must invent its own temporary name for the file.  ^Whenever the 
-** xFilename parameter is NULL it will also be the case that the
-** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
-**
-** The flags argument to xOpen() includes all bits set in
-** the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]
-** or [sqlite3_open16()] is used, then flags includes at least
-** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. 
-** If xOpen() opens a file read-only then it sets *pOutFlags to
-** include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.
-**
-** ^(SQLite will also add one of the following flags to the xOpen()
-** call, depending on the object being opened:
-**
-** <ul>
-** <li>  [SQLITE_OPEN_MAIN_DB]
-** <li>  [SQLITE_OPEN_MAIN_JOURNAL]
-** <li>  [SQLITE_OPEN_TEMP_DB]
-** <li>  [SQLITE_OPEN_TEMP_JOURNAL]
-** <li>  [SQLITE_OPEN_TRANSIENT_DB]
-** <li>  [SQLITE_OPEN_SUBJOURNAL]
-** <li>  [SQLITE_OPEN_MASTER_JOURNAL]
-** <li>  [SQLITE_OPEN_WAL]
-** </ul>)^
-**
-** The file I/O implementation can use the object type flags to
-** change the way it deals with files.  For example, an application
-** that does not care about crash recovery or rollback might make
-** the open of a journal file a no-op.  Writes to this journal would
-** also be no-ops, and any attempt to read the journal would return
-** SQLITE_IOERR.  Or the implementation might recognize that a database
-** file will be doing page-aligned sector reads and writes in a random
-** order and set up its I/O subsystem accordingly.
-**
-** SQLite might also add one of the following flags to the xOpen method:
-**
-** <ul>
-** <li> [SQLITE_OPEN_DELETEONCLOSE]
-** <li> [SQLITE_OPEN_EXCLUSIVE]
-** </ul>
-**
-** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
-** deleted when it is closed.  ^The [SQLITE_OPEN_DELETEONCLOSE]
-** will be set for TEMP databases and their journals, transient
-** databases, and subjournals.
-**
-** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction
-** with the [SQLITE_OPEN_CREATE] flag, which are both directly
-** analogous to the O_EXCL and O_CREAT flags of the POSIX open()
-** API.  The SQLITE_OPEN_EXCLUSIVE flag, when paired with the 
-** SQLITE_OPEN_CREATE, is used to indicate that file should always
-** be created, and that it is an error if it already exists.
-** It is <i>not</i> used to indicate the file should be opened 
-** for exclusive access.
-**
-** ^At least szOsFile bytes of memory are allocated by SQLite
-** to hold the  [sqlite3_file] structure passed as the third
-** argument to xOpen.  The xOpen method does not have to
-** allocate the structure; it should just fill it in.  Note that
-** the xOpen method must set the sqlite3_file.pMethods to either
-** a valid [sqlite3_io_methods] object or to NULL.  xOpen must do
-** this even if the open fails.  SQLite expects that the sqlite3_file.pMethods
-** element will be valid after xOpen returns regardless of the success
-** or failure of the xOpen call.
-**
-** [[sqlite3_vfs.xAccess]]
-** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
-** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
-** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
-** to test whether a file is at least readable.   The file can be a
-** directory.
-**
-** ^SQLite will always allocate at least mxPathname+1 bytes for the
-** output buffer xFullPathname.  The exact size of the output buffer
-** is also passed as a parameter to both  methods. If the output buffer
-** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
-** handled as a fatal error by SQLite, vfs implementations should endeavor
-** to prevent this by setting mxPathname to a sufficiently large value.
-**
-** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
-** interfaces are not strictly a part of the filesystem, but they are
-** included in the VFS structure for completeness.
-** The xRandomness() function attempts to return nBytes bytes
-** of good-quality randomness into zOut.  The return value is
-** the actual number of bytes of randomness obtained.
-** The xSleep() method causes the calling thread to sleep for at
-** least the number of microseconds given.  ^The xCurrentTime()
-** method returns a Julian Day Number for the current date and time as
-** a floating point value.
-** ^The xCurrentTimeInt64() method returns, as an integer, the Julian
-** Day Number multiplied by 86400000 (the number of milliseconds in 
-** a 24-hour day).  
-** ^SQLite will use the xCurrentTimeInt64() method to get the current
-** date and time if that method is available (if iVersion is 2 or 
-** greater and the function pointer is not NULL) and will fall back
-** to xCurrentTime() if xCurrentTimeInt64() is unavailable.
-**
-** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces
-** are not used by the SQLite core.  These optional interfaces are provided
-** by some VFSes to facilitate testing of the VFS code. By overriding 
-** system calls with functions under its control, a test program can
-** simulate faults and error conditions that would otherwise be difficult
-** or impossible to induce.  The set of system calls that can be overridden
-** varies from one VFS to another, and from one version of the same VFS to the
-** next.  Applications that use these interfaces must be prepared for any
-** or all of these interfaces to be NULL or for their behavior to change
-** from one release to the next.  Applications must not attempt to access
-** any of these methods if the iVersion of the VFS is less than 3.
-*/
-typedef struct sqlite3_vfs sqlite3_vfs;
-typedef void (*sqlite3_syscall_ptr)(void);
-struct sqlite3_vfs {
-  int iVersion;            /* Structure version number (currently 3) */
-  int szOsFile;            /* Size of subclassed sqlite3_file */
-  int mxPathname;          /* Maximum file pathname length */
-  sqlite3_vfs *pNext;      /* Next registered VFS */
-  const char *zName;       /* Name of this virtual file system */
-  void *pAppData;          /* Pointer to application-specific data */
-  int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
-               int flags, int *pOutFlags);
-  int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
-  int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
-  int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
-  void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
-  void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
-  void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
-  void (*xDlClose)(sqlite3_vfs*, void*);
-  int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
-  int (*xSleep)(sqlite3_vfs*, int microseconds);
-  int (*xCurrentTime)(sqlite3_vfs*, double*);
-  int (*xGetLastError)(sqlite3_vfs*, int, char *);
-  /*
-  ** The methods above are in version 1 of the sqlite_vfs object
-  ** definition.  Those that follow are added in version 2 or later
-  */
-  int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
-  /*
-  ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
-  ** Those below are for version 3 and greater.
-  */
-  int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
-  sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
-  const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
-  /*
-  ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
-  ** New fields may be appended in figure versions.  The iVersion
-  ** value will increment whenever this happens. 
-  */
-};
-
-/*
-** CAPI3REF: Flags for the xAccess VFS method
-**
-** These integer constants can be used as the third parameter to
-** the xAccess method of an [sqlite3_vfs] object.  They determine
-** what kind of permissions the xAccess method is looking for.
-** With SQLITE_ACCESS_EXISTS, the xAccess method
-** simply checks whether the file exists.
-** With SQLITE_ACCESS_READWRITE, the xAccess method
-** checks whether the named directory is both readable and writable
-** (in other words, if files can be added, removed, and renamed within
-** the directory).
-** The SQLITE_ACCESS_READWRITE constant is currently used only by the
-** [temp_store_directory pragma], though this could change in a future
-** release of SQLite.
-** With SQLITE_ACCESS_READ, the xAccess method
-** checks whether the file is readable.  The SQLITE_ACCESS_READ constant is
-** currently unused, though it might be used in a future release of
-** SQLite.
-*/
-#define SQLITE_ACCESS_EXISTS    0
-#define SQLITE_ACCESS_READWRITE 1   /* Used by PRAGMA temp_store_directory */
-#define SQLITE_ACCESS_READ      2   /* Unused */
-
-/*
-** CAPI3REF: Flags for the xShmLock VFS method
-**
-** These integer constants define the various locking operations
-** allowed by the xShmLock method of [sqlite3_io_methods].  The
-** following are the only legal combinations of flags to the
-** xShmLock method:
-**
-** <ul>
-** <li>  SQLITE_SHM_LOCK | SQLITE_SHM_SHARED
-** <li>  SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE
-** <li>  SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED
-** <li>  SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE
-** </ul>
-**
-** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as
-** was given no the corresponding lock.  
-**
-** The xShmLock method can transition between unlocked and SHARED or
-** between unlocked and EXCLUSIVE.  It cannot transition between SHARED
-** and EXCLUSIVE.
-*/
-#define SQLITE_SHM_UNLOCK       1
-#define SQLITE_SHM_LOCK         2
-#define SQLITE_SHM_SHARED       4
-#define SQLITE_SHM_EXCLUSIVE    8
-
-/*
-** CAPI3REF: Maximum xShmLock index
-**
-** The xShmLock method on [sqlite3_io_methods] may use values
-** between 0 and this upper bound as its "offset" argument.
-** The SQLite core will never attempt to acquire or release a
-** lock outside of this range
-*/
-#define SQLITE_SHM_NLOCK        8
-
-
-/*
-** CAPI3REF: Initialize The SQLite Library
-**
-** ^The sqlite3_initialize() routine initializes the
-** SQLite library.  ^The sqlite3_shutdown() routine
-** deallocates any resources that were allocated by sqlite3_initialize().
-** These routines are designed to aid in process initialization and
-** shutdown on embedded systems.  Workstation applications using
-** SQLite normally do not need to invoke either of these routines.
-**
-** A call to sqlite3_initialize() is an "effective" call if it is
-** the first time sqlite3_initialize() is invoked during the lifetime of
-** the process, or if it is the first time sqlite3_initialize() is invoked
-** following a call to sqlite3_shutdown().  ^(Only an effective call
-** of sqlite3_initialize() does any initialization.  All other calls
-** are harmless no-ops.)^
-**
-** A call to sqlite3_shutdown() is an "effective" call if it is the first
-** call to sqlite3_shutdown() since the last sqlite3_initialize().  ^(Only
-** an effective call to sqlite3_shutdown() does any deinitialization.
-** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^
-**
-** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown()
-** is not.  The sqlite3_shutdown() interface must only be called from a
-** single thread.  All open [database connections] must be closed and all
-** other SQLite resources must be deallocated prior to invoking
-** sqlite3_shutdown().
-**
-** Among other things, ^sqlite3_initialize() will invoke
-** sqlite3_os_init().  Similarly, ^sqlite3_shutdown()
-** will invoke sqlite3_os_end().
-**
-** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success.
-** ^If for some reason, sqlite3_initialize() is unable to initialize
-** the library (perhaps it is unable to allocate a needed resource such
-** as a mutex) it returns an [error code] other than [SQLITE_OK].
-**
-** ^The sqlite3_initialize() routine is called internally by many other
-** SQLite interfaces so that an application usually does not need to
-** invoke sqlite3_initialize() directly.  For example, [sqlite3_open()]
-** calls sqlite3_initialize() so the SQLite library will be automatically
-** initialized when [sqlite3_open()] is called if it has not be initialized
-** already.  ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
-** compile-time option, then the automatic calls to sqlite3_initialize()
-** are omitted and the application must call sqlite3_initialize() directly
-** prior to using any other SQLite interface.  For maximum portability,
-** it is recommended that applications always invoke sqlite3_initialize()
-** directly prior to using any other SQLite interface.  Future releases
-** of SQLite may require this.  In other words, the behavior exhibited
-** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the
-** default behavior in some future release of SQLite.
-**
-** The sqlite3_os_init() routine does operating-system specific
-** initialization of the SQLite library.  The sqlite3_os_end()
-** routine undoes the effect of sqlite3_os_init().  Typical tasks
-** performed by these routines include allocation or deallocation
-** of static resources, initialization of global variables,
-** setting up a default [sqlite3_vfs] module, or setting up
-** a default configuration using [sqlite3_config()].
-**
-** The application should never invoke either sqlite3_os_init()
-** or sqlite3_os_end() directly.  The application should only invoke
-** sqlite3_initialize() and sqlite3_shutdown().  The sqlite3_os_init()
-** interface is called automatically by sqlite3_initialize() and
-** sqlite3_os_end() is called by sqlite3_shutdown().  Appropriate
-** implementations for sqlite3_os_init() and sqlite3_os_end()
-** are built into SQLite when it is compiled for Unix, Windows, or OS/2.
-** When [custom builds | built for other platforms]
-** (using the [SQLITE_OS_OTHER=1] compile-time
-** option) the application must supply a suitable implementation for
-** sqlite3_os_init() and sqlite3_os_end().  An application-supplied
-** implementation of sqlite3_os_init() or sqlite3_os_end()
-** must return [SQLITE_OK] on success and some other [error code] upon
-** failure.
-*/
-SQLITE_API int sqlite3_initialize(void);
-SQLITE_API int sqlite3_shutdown(void);
-SQLITE_API int sqlite3_os_init(void);
-SQLITE_API int sqlite3_os_end(void);
-
-/*
-** CAPI3REF: Configuring The SQLite Library
-**
-** The sqlite3_config() interface is used to make global configuration
-** changes to SQLite in order to tune SQLite to the specific needs of
-** the application.  The default configuration is recommended for most
-** applications and so this routine is usually not necessary.  It is
-** provided to support rare applications with unusual needs.
-**
-** The sqlite3_config() interface is not threadsafe.  The application
-** must insure that no other SQLite interfaces are invoked by other
-** threads while sqlite3_config() is running.  Furthermore, sqlite3_config()
-** may only be invoked prior to library initialization using
-** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()].
-** ^If sqlite3_config() is called after [sqlite3_initialize()] and before
-** [sqlite3_shutdown()] then it will return SQLITE_MISUSE.
-** Note, however, that ^sqlite3_config() can be called as part of the
-** implementation of an application-defined [sqlite3_os_init()].
-**
-** The first argument to sqlite3_config() is an integer
-** [configuration option] that determines
-** what property of SQLite is to be configured.  Subsequent arguments
-** vary depending on the [configuration option]
-** in the first argument.
-**
-** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
-** ^If the option is unknown or SQLite is unable to set the option
-** then this routine returns a non-zero [error code].
-*/
-SQLITE_API int sqlite3_config(int, ...);
-
-/*
-** CAPI3REF: Configure database connections
-**
-** The sqlite3_db_config() interface is used to make configuration
-** changes to a [database connection].  The interface is similar to
-** [sqlite3_config()] except that the changes apply to a single
-** [database connection] (specified in the first argument).
-**
-** The second argument to sqlite3_db_config(D,V,...)  is the
-** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code 
-** that indicates what aspect of the [database connection] is being configured.
-** Subsequent arguments vary depending on the configuration verb.
-**
-** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
-** the call is considered successful.
-*/
-SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
-
-/*
-** CAPI3REF: Memory Allocation Routines
-**
-** An instance of this object defines the interface between SQLite
-** and low-level memory allocation routines.
-**
-** This object is used in only one place in the SQLite interface.
-** A pointer to an instance of this object is the argument to
-** [sqlite3_config()] when the configuration option is
-** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].  
-** By creating an instance of this object
-** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])
-** during configuration, an application can specify an alternative
-** memory allocation subsystem for SQLite to use for all of its
-** dynamic memory needs.
-**
-** Note that SQLite comes with several [built-in memory allocators]
-** that are perfectly adequate for the overwhelming majority of applications
-** and that this object is only useful to a tiny minority of applications
-** with specialized memory allocation requirements.  This object is
-** also used during testing of SQLite in order to specify an alternative
-** memory allocator that simulates memory out-of-memory conditions in
-** order to verify that SQLite recovers gracefully from such
-** conditions.
-**
-** The xMalloc, xRealloc, and xFree methods must work like the
-** malloc(), realloc() and free() functions from the standard C library.
-** ^SQLite guarantees that the second argument to
-** xRealloc is always a value returned by a prior call to xRoundup.
-**
-** xSize should return the allocated size of a memory allocation
-** previously obtained from xMalloc or xRealloc.  The allocated size
-** is always at least as big as the requested size but may be larger.
-**
-** The xRoundup method returns what would be the allocated size of
-** a memory allocation given a particular requested size.  Most memory
-** allocators round up memory allocations at least to the next multiple
-** of 8.  Some allocators round up to a larger multiple or to a power of 2.
-** Every memory allocation request coming in through [sqlite3_malloc()]
-** or [sqlite3_realloc()] first calls xRoundup.  If xRoundup returns 0, 
-** that causes the corresponding memory allocation to fail.
-**
-** The xInit method initializes the memory allocator.  For example,
-** it might allocate any require mutexes or initialize internal data
-** structures.  The xShutdown method is invoked (indirectly) by
-** [sqlite3_shutdown()] and should deallocate any resources acquired
-** by xInit.  The pAppData pointer is used as the only parameter to
-** xInit and xShutdown.
-**
-** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
-** the xInit method, so the xInit method need not be threadsafe.  The
-** xShutdown method is only called from [sqlite3_shutdown()] so it does
-** not need to be threadsafe either.  For all other methods, SQLite
-** holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
-** [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which
-** it is by default) and so the methods are automatically serialized.
-** However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other
-** methods must be threadsafe or else make their own arrangements for
-** serialization.
-**
-** SQLite will never invoke xInit() more than once without an intervening
-** call to xShutdown().
-*/
-typedef struct sqlite3_mem_methods sqlite3_mem_methods;
-struct sqlite3_mem_methods {
-  void *(*xMalloc)(int);         /* Memory allocation function */
-  void (*xFree)(void*);          /* Free a prior allocation */
-  void *(*xRealloc)(void*,int);  /* Resize an allocation */
-  int (*xSize)(void*);           /* Return the size of an allocation */
-  int (*xRoundup)(int);          /* Round up request size to allocation size */
-  int (*xInit)(void*);           /* Initialize the memory allocator */
-  void (*xShutdown)(void*);      /* Deinitialize the memory allocator */
-  void *pAppData;                /* Argument to xInit() and xShutdown() */
-};
-
-/*
-** CAPI3REF: Configuration Options
-** KEYWORDS: {configuration option}
-**
-** These constants are the available integer configuration options that
-** can be passed as the first argument to the [sqlite3_config()] interface.
-**
-** New configuration options may be added in future releases of SQLite.
-** Existing configuration options might be discontinued.  Applications
-** should check the return code from [sqlite3_config()] to make sure that
-** the call worked.  The [sqlite3_config()] interface will return a
-** non-zero [error code] if a discontinued or unsupported configuration option
-** is invoked.
-**
-** <dl>
-** [[SQLITE_CONFIG_SINGLETHREAD]] <dt>SQLITE_CONFIG_SINGLETHREAD</dt>
-** <dd>There are no arguments to this option.  ^This option sets the
-** [threading mode] to Single-thread.  In other words, it disables
-** all mutexing and puts SQLite into a mode where it can only be used
-** by a single thread.   ^If SQLite is compiled with
-** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
-** it is not possible to change the [threading mode] from its default
-** value of Single-thread and so [sqlite3_config()] will return 
-** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD
-** configuration option.</dd>
-**
-** [[SQLITE_CONFIG_MULTITHREAD]] <dt>SQLITE_CONFIG_MULTITHREAD</dt>
-** <dd>There are no arguments to this option.  ^This option sets the
-** [threading mode] to Multi-thread.  In other words, it disables
-** mutexing on [database connection] and [prepared statement] objects.
-** The application is responsible for serializing access to
-** [database connections] and [prepared statements].  But other mutexes
-** are enabled so that SQLite will be safe to use in a multi-threaded
-** environment as long as no two threads attempt to use the same
-** [database connection] at the same time.  ^If SQLite is compiled with
-** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
-** it is not possible to set the Multi-thread [threading mode] and
-** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
-** SQLITE_CONFIG_MULTITHREAD configuration option.</dd>
-**
-** [[SQLITE_CONFIG_SERIALIZED]] <dt>SQLITE_CONFIG_SERIALIZED</dt>
-** <dd>There are no arguments to this option.  ^This option sets the
-** [threading mode] to Serialized. In other words, this option enables
-** all mutexes including the recursive
-** mutexes on [database connection] and [prepared statement] objects.
-** In this mode (which is the default when SQLite is compiled with
-** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
-** to [database connections] and [prepared statements] so that the
-** application is free to use the same [database connection] or the
-** same [prepared statement] in different threads at the same time.
-** ^If SQLite is compiled with
-** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
-** it is not possible to set the Serialized [threading mode] and
-** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
-** SQLITE_CONFIG_SERIALIZED configuration option.</dd>
-**
-** [[SQLITE_CONFIG_MALLOC]] <dt>SQLITE_CONFIG_MALLOC</dt>
-** <dd> ^(This option takes a single argument which is a pointer to an
-** instance of the [sqlite3_mem_methods] structure.  The argument specifies
-** alternative low-level memory allocation routines to be used in place of
-** the memory allocation routines built into SQLite.)^ ^SQLite makes
-** its own private copy of the content of the [sqlite3_mem_methods] structure
-** before the [sqlite3_config()] call returns.</dd>
-**
-** [[SQLITE_CONFIG_GETMALLOC]] <dt>SQLITE_CONFIG_GETMALLOC</dt>
-** <dd> ^(This option takes a single argument which is a pointer to an
-** instance of the [sqlite3_mem_methods] structure.  The [sqlite3_mem_methods]
-** structure is filled with the currently defined memory allocation routines.)^
-** This option can be used to overload the default memory allocation
-** routines with a wrapper that simulations memory allocation failure or
-** tracks memory usage, for example. </dd>
-**
-** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
-** <dd> ^This option takes single argument of type int, interpreted as a 
-** boolean, which enables or disables the collection of memory allocation 
-** statistics. ^(When memory allocation statistics are disabled, the 
-** following SQLite interfaces become non-operational:
-**   <ul>
-**   <li> [sqlite3_memory_used()]
-**   <li> [sqlite3_memory_highwater()]
-**   <li> [sqlite3_soft_heap_limit64()]
-**   <li> [sqlite3_status()]
-**   </ul>)^
-** ^Memory allocation statistics are enabled by default unless SQLite is
-** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory
-** allocation statistics are disabled by default.
-** </dd>
-**
-** [[SQLITE_CONFIG_SCRATCH]] <dt>SQLITE_CONFIG_SCRATCH</dt>
-** <dd> ^This option specifies a static memory buffer that SQLite can use for
-** scratch memory.  There are three arguments:  A pointer an 8-byte
-** aligned memory buffer from which the scratch allocations will be
-** drawn, the size of each scratch allocation (sz),
-** and the maximum number of scratch allocations (N).  The sz
-** argument must be a multiple of 16.
-** The first argument must be a pointer to an 8-byte aligned buffer
-** of at least sz*N bytes of memory.
-** ^SQLite will use no more than two scratch buffers per thread.  So
-** N should be set to twice the expected maximum number of threads.
-** ^SQLite will never require a scratch buffer that is more than 6
-** times the database page size. ^If SQLite needs needs additional
-** scratch memory beyond what is provided by this configuration option, then 
-** [sqlite3_malloc()] will be used to obtain the memory needed.</dd>
-**
-** [[SQLITE_CONFIG_PAGECACHE]] <dt>SQLITE_CONFIG_PAGECACHE</dt>
-** <dd> ^This option specifies a static memory buffer that SQLite can use for
-** the database page cache with the default page cache implementation.  
-** This configuration should not be used if an application-define page
-** cache implementation is loaded using the SQLITE_CONFIG_PCACHE2 option.
-** There are three arguments to this option: A pointer to 8-byte aligned
-** memory, the size of each page buffer (sz), and the number of pages (N).
-** The sz argument should be the size of the largest database page
-** (a power of two between 512 and 32768) plus a little extra for each
-** page header.  ^The page header size is 20 to 40 bytes depending on
-** the host architecture.  ^It is harmless, apart from the wasted memory,
-** to make sz a little too large.  The first
-** argument should point to an allocation of at least sz*N bytes of memory.
-** ^SQLite will use the memory provided by the first argument to satisfy its
-** memory needs for the first N pages that it adds to cache.  ^If additional
-** page cache memory is needed beyond what is provided by this option, then
-** SQLite goes to [sqlite3_malloc()] for the additional storage space.
-** The pointer in the first argument must
-** be aligned to an 8-byte boundary or subsequent behavior of SQLite
-** will be undefined.</dd>
-**
-** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
-** <dd> ^This option specifies a static memory buffer that SQLite will use
-** for all of its dynamic memory allocation needs beyond those provided
-** for by [SQLITE_CONFIG_SCRATCH] and [SQLITE_CONFIG_PAGECACHE].
-** There are three arguments: An 8-byte aligned pointer to the memory,
-** the number of bytes in the memory buffer, and the minimum allocation size.
-** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts
-** to using its default memory allocator (the system malloc() implementation),
-** undoing any prior invocation of [SQLITE_CONFIG_MALLOC].  ^If the
-** memory pointer is not NULL and either [SQLITE_ENABLE_MEMSYS3] or
-** [SQLITE_ENABLE_MEMSYS5] are defined, then the alternative memory
-** allocator is engaged to handle all of SQLites memory allocation needs.
-** The first pointer (the memory pointer) must be aligned to an 8-byte
-** boundary or subsequent behavior of SQLite will be undefined.
-** The minimum allocation size is capped at 2**12. Reasonable values
-** for the minimum allocation size are 2**5 through 2**8.</dd>
-**
-** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
-** <dd> ^(This option takes a single argument which is a pointer to an
-** instance of the [sqlite3_mutex_methods] structure.  The argument specifies
-** alternative low-level mutex routines to be used in place
-** the mutex routines built into SQLite.)^  ^SQLite makes a copy of the
-** content of the [sqlite3_mutex_methods] structure before the call to
-** [sqlite3_config()] returns. ^If SQLite is compiled with
-** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
-** the entire mutexing subsystem is omitted from the build and hence calls to
-** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
-** return [SQLITE_ERROR].</dd>
-**
-** [[SQLITE_CONFIG_GETMUTEX]] <dt>SQLITE_CONFIG_GETMUTEX</dt>
-** <dd> ^(This option takes a single argument which is a pointer to an
-** instance of the [sqlite3_mutex_methods] structure.  The
-** [sqlite3_mutex_methods]
-** structure is filled with the currently defined mutex routines.)^
-** This option can be used to overload the default mutex allocation
-** routines with a wrapper used to track mutex usage for performance
-** profiling or testing, for example.   ^If SQLite is compiled with
-** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
-** the entire mutexing subsystem is omitted from the build and hence calls to
-** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will
-** return [SQLITE_ERROR].</dd>
-**
-** [[SQLITE_CONFIG_LOOKASIDE]] <dt>SQLITE_CONFIG_LOOKASIDE</dt>
-** <dd> ^(This option takes two arguments that determine the default
-** memory allocation for the lookaside memory allocator on each
-** [database connection].  The first argument is the
-** size of each lookaside buffer slot and the second is the number of
-** slots allocated to each database connection.)^  ^(This option sets the
-** <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]
-** verb to [sqlite3_db_config()] can be used to change the lookaside
-** configuration on individual connections.)^ </dd>
-**
-** [[SQLITE_CONFIG_PCACHE2]] <dt>SQLITE_CONFIG_PCACHE2</dt>
-** <dd> ^(This option takes a single argument which is a pointer to
-** an [sqlite3_pcache_methods2] object.  This object specifies the interface
-** to a custom page cache implementation.)^  ^SQLite makes a copy of the
-** object and uses it for page cache memory allocations.</dd>
-**
-** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
-** <dd> ^(This option takes a single argument which is a pointer to an
-** [sqlite3_pcache_methods2] object.  SQLite copies of the current
-** page cache implementation into that object.)^ </dd>
-**
-** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
-** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
-** global [error log

<TRUNCATED>


[08/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/string_slice_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/string_slice_test.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/string_slice_test.go
new file mode 100644
index 0000000..c37a91a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/string_slice_test.go
@@ -0,0 +1,44 @@
+// 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.
+
+package pflag
+
+import (
+	"fmt"
+	"strings"
+	"testing"
+)
+
+func setUpSSFlagSet(ssp *[]string) *FlagSet {
+	f := NewFlagSet("test", ContinueOnError)
+	f.StringSliceVar(ssp, "ss", []string{}, "Command seperated list!")
+	return f
+}
+
+func TestSS(t *testing.T) {
+	var ss []string
+	f := setUpSSFlagSet(&ss)
+
+	vals := []string{"one", "two", "4", "3"}
+	arg := fmt.Sprintf("--ss=%s", strings.Join(vals, ","))
+	err := f.Parse([]string{arg})
+	if err != nil {
+		t.Fatal("expected no error; got", err)
+	}
+	for i, v := range ss {
+		if vals[i] != v {
+			t.Fatal("expected ss[%d] to be %s but got: %s", i, vals[i], v)
+		}
+	}
+
+	getSS, err := f.GetStringSlice("ss")
+	if err != nil {
+		t.Fatal("got an error from GetStringSlice(): %v", err)
+	}
+	for i, v := range getSS {
+		if vals[i] != v {
+			t.Fatal("expected ss[%d] to be %s from GetStringSlice but got: %s", i, vals[i], v)
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint.go
new file mode 100644
index 0000000..d6f8e5b
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint.go
@@ -0,0 +1,91 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- uint Value
+type uintValue uint
+
+func newUintValue(val uint, p *uint) *uintValue {
+	*p = val
+	return (*uintValue)(p)
+}
+
+func (i *uintValue) Set(s string) error {
+	v, err := strconv.ParseUint(s, 0, 64)
+	*i = uintValue(v)
+	return err
+}
+
+func (i *uintValue) Type() string {
+	return "uint"
+}
+
+func (i *uintValue) String() string { return fmt.Sprintf("%v", *i) }
+
+func uintConv(sval string) (interface{}, error) {
+	v, err := strconv.ParseUint(sval, 0, 0)
+	if err != nil {
+		return 0, err
+	}
+	return uint(v), nil
+}
+
+// GetUint return the uint value of a flag with the given name
+func (f *FlagSet) GetUint(name string) (uint, error) {
+	val, err := f.getFlagType(name, "uint", uintConv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(uint), nil
+}
+
+// UintVar defines a uint flag with specified name, default value, and usage string.
+// The argument p points to a uint variable in which to store the value of the flag.
+func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) {
+	f.VarP(newUintValue(value, p), name, "", usage)
+}
+
+// Like UintVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage string) {
+	f.VarP(newUintValue(value, p), name, shorthand, usage)
+}
+
+// UintVar defines a uint flag with specified name, default value, and usage string.
+// The argument p points to a uint  variable in which to store the value of the flag.
+func UintVar(p *uint, name string, value uint, usage string) {
+	CommandLine.VarP(newUintValue(value, p), name, "", usage)
+}
+
+// Like UintVar, but accepts a shorthand letter that can be used after a single dash.
+func UintVarP(p *uint, name, shorthand string, value uint, usage string) {
+	CommandLine.VarP(newUintValue(value, p), name, shorthand, usage)
+}
+
+// Uint defines a uint flag with specified name, default value, and usage string.
+// The return value is the address of a uint  variable that stores the value of the flag.
+func (f *FlagSet) Uint(name string, value uint, usage string) *uint {
+	p := new(uint)
+	f.UintVarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Uint, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint {
+	p := new(uint)
+	f.UintVarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Uint defines a uint flag with specified name, default value, and usage string.
+// The return value is the address of a uint  variable that stores the value of the flag.
+func Uint(name string, value uint, usage string) *uint {
+	return CommandLine.UintP(name, "", value, usage)
+}
+
+// Like Uint, but accepts a shorthand letter that can be used after a single dash.
+func UintP(name, shorthand string, value uint, usage string) *uint {
+	return CommandLine.UintP(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint16.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint16.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint16.go
new file mode 100644
index 0000000..1cdc3df
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint16.go
@@ -0,0 +1,89 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- uint16 value
+type uint16Value uint16
+
+func newUint16Value(val uint16, p *uint16) *uint16Value {
+	*p = val
+	return (*uint16Value)(p)
+}
+func (i *uint16Value) String() string { return fmt.Sprintf("%d", *i) }
+func (i *uint16Value) Set(s string) error {
+	v, err := strconv.ParseUint(s, 0, 16)
+	*i = uint16Value(v)
+	return err
+}
+
+func (i *uint16Value) Type() string {
+	return "uint16"
+}
+
+func uint16Conv(sval string) (interface{}, error) {
+	v, err := strconv.ParseUint(sval, 0, 16)
+	if err != nil {
+		return 0, err
+	}
+	return uint16(v), nil
+}
+
+// GetUint16 return the uint16 value of a flag with the given name
+func (f *FlagSet) GetUint16(name string) (uint16, error) {
+	val, err := f.getFlagType(name, "uint16", uint16Conv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(uint16), nil
+}
+
+// Uint16Var defines a uint flag with specified name, default value, and usage string.
+// The argument p points to a uint variable in which to store the value of the flag.
+func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string) {
+	f.VarP(newUint16Value(value, p), name, "", usage)
+}
+
+// Like Uint16Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) {
+	f.VarP(newUint16Value(value, p), name, shorthand, usage)
+}
+
+// Uint16Var defines a uint flag with specified name, default value, and usage string.
+// The argument p points to a uint  variable in which to store the value of the flag.
+func Uint16Var(p *uint16, name string, value uint16, usage string) {
+	CommandLine.VarP(newUint16Value(value, p), name, "", usage)
+}
+
+// Like Uint16Var, but accepts a shorthand letter that can be used after a single dash.
+func Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) {
+	CommandLine.VarP(newUint16Value(value, p), name, shorthand, usage)
+}
+
+// Uint16 defines a uint flag with specified name, default value, and usage string.
+// The return value is the address of a uint  variable that stores the value of the flag.
+func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 {
+	p := new(uint16)
+	f.Uint16VarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Uint16, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage string) *uint16 {
+	p := new(uint16)
+	f.Uint16VarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Uint16 defines a uint flag with specified name, default value, and usage string.
+// The return value is the address of a uint  variable that stores the value of the flag.
+func Uint16(name string, value uint16, usage string) *uint16 {
+	return CommandLine.Uint16P(name, "", value, usage)
+}
+
+// Like Uint16, but accepts a shorthand letter that can be used after a single dash.
+func Uint16P(name, shorthand string, value uint16, usage string) *uint16 {
+	return CommandLine.Uint16P(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint32.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint32.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint32.go
new file mode 100644
index 0000000..1326e4a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint32.go
@@ -0,0 +1,89 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- uint16 value
+type uint32Value uint32
+
+func newUint32Value(val uint32, p *uint32) *uint32Value {
+	*p = val
+	return (*uint32Value)(p)
+}
+func (i *uint32Value) String() string { return fmt.Sprintf("%d", *i) }
+func (i *uint32Value) Set(s string) error {
+	v, err := strconv.ParseUint(s, 0, 32)
+	*i = uint32Value(v)
+	return err
+}
+
+func (i *uint32Value) Type() string {
+	return "uint32"
+}
+
+func uint32Conv(sval string) (interface{}, error) {
+	v, err := strconv.ParseUint(sval, 0, 32)
+	if err != nil {
+		return 0, err
+	}
+	return uint32(v), nil
+}
+
+// GetUint32 return the uint32 value of a flag with the given name
+func (f *FlagSet) GetUint32(name string) (uint32, error) {
+	val, err := f.getFlagType(name, "uint32", uint32Conv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(uint32), nil
+}
+
+// Uint32Var defines a uint32 flag with specified name, default value, and usage string.
+// The argument p points to a uint32 variable in which to store the value of the flag.
+func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string) {
+	f.VarP(newUint32Value(value, p), name, "", usage)
+}
+
+// Like Uint32Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {
+	f.VarP(newUint32Value(value, p), name, shorthand, usage)
+}
+
+// Uint32Var defines a uint32 flag with specified name, default value, and usage string.
+// The argument p points to a uint32  variable in which to store the value of the flag.
+func Uint32Var(p *uint32, name string, value uint32, usage string) {
+	CommandLine.VarP(newUint32Value(value, p), name, "", usage)
+}
+
+// Like Uint32Var, but accepts a shorthand letter that can be used after a single dash.
+func Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {
+	CommandLine.VarP(newUint32Value(value, p), name, shorthand, usage)
+}
+
+// Uint32 defines a uint32 flag with specified name, default value, and usage string.
+// The return value is the address of a uint32  variable that stores the value of the flag.
+func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 {
+	p := new(uint32)
+	f.Uint32VarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Uint32, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage string) *uint32 {
+	p := new(uint32)
+	f.Uint32VarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Uint32 defines a uint32 flag with specified name, default value, and usage string.
+// The return value is the address of a uint32  variable that stores the value of the flag.
+func Uint32(name string, value uint32, usage string) *uint32 {
+	return CommandLine.Uint32P(name, "", value, usage)
+}
+
+// Like Uint32, but accepts a shorthand letter that can be used after a single dash.
+func Uint32P(name, shorthand string, value uint32, usage string) *uint32 {
+	return CommandLine.Uint32P(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint64.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint64.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint64.go
new file mode 100644
index 0000000..6788bbf
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint64.go
@@ -0,0 +1,91 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- uint64 Value
+type uint64Value uint64
+
+func newUint64Value(val uint64, p *uint64) *uint64Value {
+	*p = val
+	return (*uint64Value)(p)
+}
+
+func (i *uint64Value) Set(s string) error {
+	v, err := strconv.ParseUint(s, 0, 64)
+	*i = uint64Value(v)
+	return err
+}
+
+func (i *uint64Value) Type() string {
+	return "uint64"
+}
+
+func (i *uint64Value) String() string { return fmt.Sprintf("%v", *i) }
+
+func uint64Conv(sval string) (interface{}, error) {
+	v, err := strconv.ParseUint(sval, 0, 64)
+	if err != nil {
+		return 0, err
+	}
+	return uint64(v), nil
+}
+
+// GetUint64 return the uint64 value of a flag with the given name
+func (f *FlagSet) GetUint64(name string) (uint64, error) {
+	val, err := f.getFlagType(name, "uint64", uint64Conv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(uint64), nil
+}
+
+// Uint64Var defines a uint64 flag with specified name, default value, and usage string.
+// The argument p points to a uint64 variable in which to store the value of the flag.
+func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) {
+	f.VarP(newUint64Value(value, p), name, "", usage)
+}
+
+// Like Uint64Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {
+	f.VarP(newUint64Value(value, p), name, shorthand, usage)
+}
+
+// Uint64Var defines a uint64 flag with specified name, default value, and usage string.
+// The argument p points to a uint64 variable in which to store the value of the flag.
+func Uint64Var(p *uint64, name string, value uint64, usage string) {
+	CommandLine.VarP(newUint64Value(value, p), name, "", usage)
+}
+
+// Like Uint64Var, but accepts a shorthand letter that can be used after a single dash.
+func Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {
+	CommandLine.VarP(newUint64Value(value, p), name, shorthand, usage)
+}
+
+// Uint64 defines a uint64 flag with specified name, default value, and usage string.
+// The return value is the address of a uint64 variable that stores the value of the flag.
+func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 {
+	p := new(uint64)
+	f.Uint64VarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Uint64, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage string) *uint64 {
+	p := new(uint64)
+	f.Uint64VarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Uint64 defines a uint64 flag with specified name, default value, and usage string.
+// The return value is the address of a uint64 variable that stores the value of the flag.
+func Uint64(name string, value uint64, usage string) *uint64 {
+	return CommandLine.Uint64P(name, "", value, usage)
+}
+
+// Like Uint64, but accepts a shorthand letter that can be used after a single dash.
+func Uint64P(name, shorthand string, value uint64, usage string) *uint64 {
+	return CommandLine.Uint64P(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint8.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint8.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint8.go
new file mode 100644
index 0000000..560c569
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/uint8.go
@@ -0,0 +1,91 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- uint8 Value
+type uint8Value uint8
+
+func newUint8Value(val uint8, p *uint8) *uint8Value {
+	*p = val
+	return (*uint8Value)(p)
+}
+
+func (i *uint8Value) Set(s string) error {
+	v, err := strconv.ParseUint(s, 0, 8)
+	*i = uint8Value(v)
+	return err
+}
+
+func (i *uint8Value) Type() string {
+	return "uint8"
+}
+
+func (i *uint8Value) String() string { return fmt.Sprintf("%v", *i) }
+
+func uint8Conv(sval string) (interface{}, error) {
+	v, err := strconv.ParseUint(sval, 0, 8)
+	if err != nil {
+		return 0, err
+	}
+	return uint8(v), nil
+}
+
+// GetUint8 return the uint8 value of a flag with the given name
+func (f *FlagSet) GetUint8(name string) (uint8, error) {
+	val, err := f.getFlagType(name, "uint8", uint8Conv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(uint8), nil
+}
+
+// Uint8Var defines a uint8 flag with specified name, default value, and usage string.
+// The argument p points to a uint8 variable in which to store the value of the flag.
+func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) {
+	f.VarP(newUint8Value(value, p), name, "", usage)
+}
+
+// Like Uint8Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) {
+	f.VarP(newUint8Value(value, p), name, shorthand, usage)
+}
+
+// Uint8Var defines a uint8 flag with specified name, default value, and usage string.
+// The argument p points to a uint8 variable in which to store the value of the flag.
+func Uint8Var(p *uint8, name string, value uint8, usage string) {
+	CommandLine.VarP(newUint8Value(value, p), name, "", usage)
+}
+
+// Like Uint8Var, but accepts a shorthand letter that can be used after a single dash.
+func Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) {
+	CommandLine.VarP(newUint8Value(value, p), name, shorthand, usage)
+}
+
+// Uint8 defines a uint8 flag with specified name, default value, and usage string.
+// The return value is the address of a uint8 variable that stores the value of the flag.
+func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 {
+	p := new(uint8)
+	f.Uint8VarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Uint8, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage string) *uint8 {
+	p := new(uint8)
+	f.Uint8VarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Uint8 defines a uint8 flag with specified name, default value, and usage string.
+// The return value is the address of a uint8 variable that stores the value of the flag.
+func Uint8(name string, value uint8, usage string) *uint8 {
+	return CommandLine.Uint8P(name, "", value, usage)
+}
+
+// Like Uint8, but accepts a shorthand letter that can be used after a single dash.
+func Uint8P(name, shorthand string, value uint8, usage string) *uint8 {
+	return CommandLine.Uint8P(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/viper/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/viper/.gitignore b/newt/Godeps/_workspace/src/github.com/spf13/viper/.gitignore
new file mode 100644
index 0000000..8365624
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/viper/.gitignore
@@ -0,0 +1,23 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe
+*.test

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/viper/.travis.yml
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/viper/.travis.yml b/newt/Godeps/_workspace/src/github.com/spf13/viper/.travis.yml
new file mode 100644
index 0000000..ae1f68e
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/viper/.travis.yml
@@ -0,0 +1,8 @@
+language: go
+go:
+  - 1.3
+  - release
+  - tip
+
+script:
+  - go test -v ./...

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/viper/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/viper/LICENSE b/newt/Godeps/_workspace/src/github.com/spf13/viper/LICENSE
new file mode 100644
index 0000000..4527efb
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/viper/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Steve Francia
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/viper/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/viper/README.md b/newt/Godeps/_workspace/src/github.com/spf13/viper/README.md
new file mode 100644
index 0000000..76e1071
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/viper/README.md
@@ -0,0 +1,445 @@
+viper [![Build Status](https://travis-ci.org/spf13/viper.svg)](https://travis-ci.org/spf13/viper)
+=====
+
+[![Join the chat at https://gitter.im/spf13/viper](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/spf13/viper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+Go configuration with fangs
+
+## What is Viper?
+
+Viper is a complete configuration solution for go applications. It has
+been designed to work within an application to handle all types of
+configuration. It supports
+
+* setting defaults
+* reading from json, toml and yaml config files
+* reading from environment variables
+* reading from remote config systems (Etcd or Consul), watching changes
+* reading from command line flags
+* reading from buffer
+* setting explicit values
+
+It can be thought of as a registry for all of your applications
+configuration needs.
+
+## Why Viper?
+
+When building a modern application, you don’t want to have to worry about
+configuration file formats; you want to focus on building awesome software.
+Viper is here to help with that.
+
+Viper does the following for you:
+
+1. Find, load and marshal a configuration file in JSON, TOML or YAML.
+2. Provide a mechanism to set default values for your different
+   configuration options.
+3. Provide a mechanism to set override values for options specified
+   through command line flags.
+4. Provide an alias system to easily rename parameters without breaking
+   existing code.
+5. Make it easy to tell the difference between when a user has provided
+   a command line or config file which is the same as the default.
+
+Viper uses the following precedence order. Each item takes precedence
+over the item below it:
+
+ * explicit call to Set
+ * flag
+ * env
+ * config
+ * key/value store
+ * default
+
+Viper configuration keys are case insensitive.
+
+## Putting Values into Viper
+
+### Establishing Defaults
+
+A good configuration system will support default values. A default value
+is not required for a key, but can establish a default to be used in the
+event that the key hasn’t be set via config file, environment variable,
+remote configuration or flag.
+
+Examples:
+
+	viper.SetDefault("ContentDir", "content")
+	viper.SetDefault("LayoutDir", "layouts")
+	viper.SetDefault("Taxonomies", map[string]string{"tag": "tags", "category": "categories"})
+
+### Reading Config Files
+
+If you want to support a config file, Viper requires a minimal
+configuration so it knows where to look for the config file. Viper
+supports json, toml and yaml files. Viper can search multiple paths, but
+currently a single viper only supports a single config file.
+
+	viper.SetConfigName("config") // name of config file (without extension)
+	viper.AddConfigPath("/etc/appname/")   // path to look for the config file in
+	viper.AddConfigPath("$HOME/.appname")  // call multiple times to add many search paths
+	err := viper.ReadInConfig() // Find and read the config file
+    if err != nil { // Handle errors reading the config file
+        panic(fmt.Errorf("Fatal error config file: %s \n", err))
+    }
+
+### Reading Config from io.Reader
+
+Viper predefined many configuration sources, such as files, environment variables, flags and 
+remote K/V store. But you are not bound to them. You can also implement your own way to
+require configuration and feed it to viper.
+
+````go
+viper.SetConfigType("yaml") // or viper.SetConfigType("YAML")
+
+// any approach to require this configuration into your program. 
+var yamlExample = []byte(`
+Hacker: true
+name: steve
+hobbies:
+- skateboarding
+- snowboarding
+- go
+clothing:
+  jacket: leather
+  trousers: denim
+age: 35
+eyes : brown
+beard: true
+`)
+
+viper.ReadConfig(bytes.NewBuffer(yamlExample))
+
+viper.Get("name") // this would be "steve"
+````
+
+### Setting Overrides
+
+These could be from a command line flag, or from your own application logic.
+
+    viper.Set("Verbose", true)
+    viper.Set("LogFile", LogFile)
+
+### Registering and Using Aliases
+
+Aliases permit a single value to be referenced by multiple keys
+
+    viper.RegisterAlias("loud", "Verbose")
+
+    viper.Set("verbose", true) // same result as next line
+    viper.Set("loud", true)   // same result as prior line
+
+    viper.GetBool("loud") // true
+    viper.GetBool("verbose") // true
+
+### Working with Environment Variables
+
+Viper has full support for environment variables. This enables 12 factor
+applications out of the box. There are four methods that exist to aid
+with working with ENV:
+
+ * AutomaticEnv()
+ * BindEnv(string...) : error
+ * SetEnvPrefix(string)
+ * SetEnvReplacer(string...) *strings.Replacer
+
+_When working with ENV variables, it’s important to recognize that Viper
+treats ENV variables as case sensitive._
+
+Viper provides a mechanism to try to ensure that ENV variables are
+unique. By using SetEnvPrefix, you can tell Viper to use add a prefix
+while reading from the environment variables. Both BindEnv and
+AutomaticEnv will use this prefix.
+
+BindEnv takes one or two parameters. The first parameter is the key
+name, the second is the name of the environment variable. The name of
+the environment variable is case sensitive. If the ENV variable name is
+not provided, then Viper will automatically assume that the key name
+matches the ENV variable name but the ENV variable is IN ALL CAPS. When
+you explicitly provide the ENV variable name, it **does not**
+automatically add the prefix.
+
+One important thing to recognize when working with ENV variables is that
+the value will be read each time it is accessed. It does not fix the
+value when the BindEnv is called.
+
+AutomaticEnv is a powerful helper especially when combined with
+SetEnvPrefix. When called, Viper will check for an environment variable
+any time a viper.Get request is made. It will apply the following rules.
+It will check for a environment variable with a name matching the key
+uppercased and prefixed with the EnvPrefix if set.
+
+SetEnvReplacer allows you to use a `strings.Replacer` object to rewrite Env keys
+to an extent. This is useful if you want to use `-` or something in your Get()
+calls, but want your environmental variables to use `_` delimiters. An example
+of using it can be found in `viper_test.go`.
+
+#### Env example
+
+	SetEnvPrefix("spf") // will be uppercased automatically
+	BindEnv("id")
+
+	os.Setenv("SPF_ID", "13") // typically done outside of the app
+
+	id := Get("id") // 13
+
+
+### Working with Flags
+
+Viper has the ability to bind to flags. Specifically, Viper supports
+Pflags as used in the [Cobra](https://github.com/spf13/cobra) library.
+
+Like BindEnv, the value is not set when the binding method is called, but
+when it is accessed. This means you can bind as early as you want, even
+in an init() function.
+
+The BindPFlag() method provides this functionality.
+
+Example:
+
+    serverCmd.Flags().Int("port", 1138, "Port to run Application server on")
+    viper.BindPFlag("port", serverCmd.Flags().Lookup("port"))
+
+
+### Remote Key/Value Store Support
+
+To enable remote support in Viper, do a blank import of the `viper/remote` package:
+
+`import _ github.com/spf13/viper/remote`
+
+Viper will read a config string (as JSON, TOML, or YAML) retrieved from a
+path in a Key/Value store such as Etcd or Consul.  These values take precedence
+over default values, but are overriden by configuration values retrieved from disk,
+flags, or environment variables.
+
+Viper uses [crypt](https://github.com/xordataexchange/crypt) to retrieve configuration
+from the K/V store, which means that you can store your configuration values
+encrypted and have them automatically decrypted if you have the correct
+gpg keyring.  Encryption is optional.
+
+You can use remote configuration in conjunction with local configuration, or
+independently of it.
+
+`crypt` has a command-line helper that you can use to put configurations
+in your K/V store. `crypt` defaults to etcd on http://127.0.0.1:4001.
+
+	go get github.com/xordataexchange/crypt/bin/crypt
+	crypt set -plaintext /config/hugo.json /Users/hugo/settings/config.json
+
+Confirm that your value was set:
+
+	crypt get -plaintext /config/hugo.json
+
+See the `crypt` documentation for examples of how to set encrypted values, or how
+to use Consul.
+
+### Remote Key/Value Store Example - Unencrypted
+
+	viper.AddRemoteProvider("etcd", "http://127.0.0.1:4001","/config/hugo.json")
+	viper.SetConfigType("json") // because there is no file extension in a stream of bytes
+	err := viper.ReadRemoteConfig()
+
+### Remote Key/Value Store Example - Encrypted
+
+	viper.AddSecureRemoteProvider("etcd","http://127.0.0.1:4001","/config/hugo.json","/etc/secrets/mykeyring.gpg")
+	viper.SetConfigType("json") // because there is no file extension in a stream of bytes
+	err := viper.ReadRemoteConfig()
+
+### Watching Changes in Etcd - Unencrypted
+
+    // alternatively, you can create a new viper instance.
+    var runtime_viper = viper.New()
+
+    runtime_viper.AddRemoteProvider("etcd", "http://127.0.0.1:4001", "/config/hugo.yml")
+    runtime_viper.SetConfigType("yaml") // because there is no file extension in a stream of bytes
+
+    // read from remote config the first time.
+    err := runtime_viper.ReadRemoteConfig()
+
+    // marshal config
+    runtime_viper.Marshal(&runtime_conf)
+
+    // open a goroutine to wath remote changes forever
+    go func(){
+        for {
+            time.Sleep(time.Second * 5) // delay after each request
+
+            // currenlty, only tested with etcd support
+            err := runtime_viper.WatchRemoteConfig()
+            if err != nil {
+                log.Errorf("unable to read remote config: %v", err)
+                continue
+            }
+
+            // marshal new config into our runtime config struct. you can also use channel 
+            // to implement a signal to notify the system of the changes
+            runtime_viper.Marshal(&runtime_conf)
+        }
+    }()
+
+
+## Getting Values From Viper
+
+In Viper, there are a few ways to get a value depending on what type of value you want to retrieved.
+The following functions and methods exist:
+
+ * Get(key string) : interface{}
+ * GetBool(key string) : bool
+ * GetFloat64(key string) : float64
+ * GetInt(key string) : int
+ * GetString(key string) : string
+ * GetStringMap(key string) : map[string]interface{}
+ * GetStringMapString(key string) : map[string]string
+ * GetStringSlice(key string) : []string
+ * GetTime(key string) : time.Time
+ * GetDuration(key string) : time.Duration
+ * IsSet(key string) : bool
+
+One important thing to recognize is that each Get function will return
+its zero value if it’s not found. To check if a given key exists, the IsSet()
+method has been provided.
+
+Example:
+
+    viper.GetString("logfile") // case-insensitive Setting & Getting
+    if viper.GetBool("verbose") {
+        fmt.Println("verbose enabled")
+    }
+
+### Accessing nested keys
+
+The accessor methods also accept formatted paths to deeply nested keys. 
+For example, if the following JSON file is loaded:
+
+```
+{
+    "host": {
+        "address": "localhost",
+        "port": 5799
+    },
+    "datastore": {
+        "metric": {
+            "host": "127.0.0.1",
+            "port": 3099
+        },
+        "warehouse": {
+            "host": "198.0.0.1",
+            "port": 2112
+        }
+    }
+}
+
+```
+
+Viper can access a nested field by passing a `.` delimited path of keys:
+```
+GetString("datastore.metric.host") // (returns "127.0.0.1")
+```
+
+This obeys the precendense rules established above; the search for the root key
+(in this examole, `datastore`) will cascade through the remaining configuration registries
+until found. The search for the subkeys (`metric` and `host`), however, will not.
+
+For example, if the `metric` key was not defined in the configuration loaded
+from file, but was defined in the defaults, Viper would return the zero value.
+
+On the other hand, if the primary key was not defined, Viper would go through the
+remaining registries looking for it.
+
+Lastly, if there exists a key that matches the delimited key path, its value will
+be returned instead. E.g. 
+
+```
+{
+    "datastore.metric.host": "0.0.0.0",
+    "host": {
+        "address": "localhost",
+        "port": 5799
+    },
+    "datastore": {
+        "metric": {
+            "host": "127.0.0.1",
+            "port": 3099
+        },
+        "warehouse": {
+            "host": "198.0.0.1",
+            "port": 2112
+        }
+    }
+}
+
+GetString("datastore.metric.host") //returns "0.0.0.0"
+```
+
+### Marshaling
+
+You also have the option of Marshaling all or a specific value to a struct, map, etc.
+
+There are two methods to do this:
+
+ * Marshal(rawVal interface{}) : error
+ * MarshalKey(key string, rawVal interface{}) : error
+
+Example:
+
+	type config struct {
+		Port int
+		Name string
+	}
+
+	var C config
+
+	err := Marshal(&C)
+	if err != nil {
+		t.Fatalf("unable to decode into struct, %v", err)
+	}
+
+
+## Viper or Vipers?
+
+Viper comes ready to use out of the box. There is no configuration or
+initialization needed to begin using Viper. Since most applications will
+want to use a single central repository for their configuration, the
+viper package provides this. It is similar to a singleton.
+
+In all of the examples above, they demonstrate using viper in its
+singleton style approach.
+
+### Working with multiple vipers
+
+You can also create many different vipers for use in your application.
+Each will have it’s own unique set of configurations and values. Each
+can read from a different config file, key value store, etc. All of the
+functions that viper package supports are mirrored as methods on a viper.
+
+Example:
+
+    x := viper.New()
+    y := viper.New()
+
+	x.SetDefault("ContentDir", "content")
+	y.SetDefault("ContentDir", "foobar")
+
+    ...
+
+When working with multiple vipers, it is up to the user to keep track of
+the different vipers.
+
+## Q & A
+
+Q: Why not INI files?
+
+A: Ini files are pretty awful. There’s no standard format, and they are hard to
+validate. Viper is designed to work with JSON, TOML or YAML files. If someone
+really wants to add this feature, I’d be happy to merge it. It’s easy to
+specify which formats your application will permit.
+
+Q: Why is it called “Viper”?
+
+A: Viper is designed to be a [companion](http://en.wikipedia.org/wiki/Viper_(G.I._Joe)) to
+[Cobra](https://github.com/spf13/cobra). While both can operate completely
+independently, together they make a powerful pair to handle much of your
+application foundation needs.
+
+Q: Why is it called “Cobra”?
+
+A: Is there a better name for a [commander](http://en.wikipedia.org/wiki/Cobra_Commander)?

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/viper/remote/remote.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/viper/remote/remote.go b/newt/Godeps/_workspace/src/github.com/spf13/viper/remote/remote.go
new file mode 100644
index 0000000..faaf3b3
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/viper/remote/remote.go
@@ -0,0 +1,77 @@
+// Copyright © 2015 Steve Francia <sp...@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+// Package remote integrates the remote features of Viper.
+package remote
+
+import (
+	"bytes"
+	"github.com/spf13/viper"
+	crypt "github.com/xordataexchange/crypt/config"
+	"io"
+	"os"
+)
+
+type remoteConfigProvider struct{}
+
+func (rc remoteConfigProvider) Get(rp viper.RemoteProvider) (io.Reader, error) {
+	cm, err := getConfigManager(rp)
+	if err != nil {
+		return nil, err
+	}
+	b, err := cm.Get(rp.Path())
+	if err != nil {
+		return nil, err
+	}
+	return bytes.NewReader(b), nil
+}
+
+func (rc remoteConfigProvider) Watch(rp viper.RemoteProvider) (io.Reader, error) {
+	cm, err := getConfigManager(rp)
+	if err != nil {
+		return nil, err
+	}
+	resp := <-cm.Watch(rp.Path(), nil)
+	err = resp.Error
+	if err != nil {
+		return nil, err
+	}
+
+	return bytes.NewReader(resp.Value), nil
+}
+
+func getConfigManager(rp viper.RemoteProvider) (crypt.ConfigManager, error) {
+
+	var cm crypt.ConfigManager
+	var err error
+
+	if rp.SecretKeyring() != "" {
+		kr, err := os.Open(rp.SecretKeyring())
+		defer kr.Close()
+		if err != nil {
+			return nil, err
+		}
+		if rp.Provider() == "etcd" {
+			cm, err = crypt.NewEtcdConfigManager([]string{rp.Endpoint()}, kr)
+		} else {
+			cm, err = crypt.NewConsulConfigManager([]string{rp.Endpoint()}, kr)
+		}
+	} else {
+		if rp.Provider() == "etcd" {
+			cm, err = crypt.NewStandardEtcdConfigManager([]string{rp.Endpoint()})
+		} else {
+			cm, err = crypt.NewStandardConsulConfigManager([]string{rp.Endpoint()})
+		}
+	}
+	if err != nil {
+		return nil, err
+	}
+	return cm, nil
+
+}
+
+func init() {
+	viper.RemoteConfig = &remoteConfigProvider{}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/viper/util.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/viper/util.go b/newt/Godeps/_workspace/src/github.com/spf13/viper/util.go
new file mode 100644
index 0000000..7904b1a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/viper/util.go
@@ -0,0 +1,198 @@
+// Copyright © 2014 Steve Francia <sp...@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+// Viper is a application configuration system.
+// It believes that applications can be configured a variety of ways
+// via flags, ENVIRONMENT variables, configuration files retrieved
+// from the file system, or a remote key/value store.
+
+package viper
+
+import (
+	"bytes"
+	"encoding/json"
+	"fmt"
+	"io"
+	"os"
+	"path/filepath"
+	"runtime"
+	"strings"
+	"unicode"
+
+	"github.com/BurntSushi/toml"
+	"github.com/magiconair/properties"
+	"github.com/spf13/cast"
+	jww "github.com/spf13/jwalterweatherman"
+	"gopkg.in/yaml.v2"
+)
+
+func insensitiviseMap(m map[string]interface{}) {
+	for key, val := range m {
+		lower := strings.ToLower(key)
+		if key != lower {
+			delete(m, key)
+			m[lower] = val
+		}
+	}
+}
+
+func absPathify(inPath string) string {
+	jww.INFO.Println("Trying to resolve absolute path to", inPath)
+
+	if strings.HasPrefix(inPath, "$HOME") {
+		inPath = userHomeDir() + inPath[5:]
+	}
+
+	if strings.HasPrefix(inPath, "$") {
+		end := strings.Index(inPath, string(os.PathSeparator))
+		inPath = os.Getenv(inPath[1:end]) + inPath[end:]
+	}
+
+	if filepath.IsAbs(inPath) {
+		return filepath.Clean(inPath)
+	}
+
+	p, err := filepath.Abs(inPath)
+	if err == nil {
+		return filepath.Clean(p)
+	} else {
+		jww.ERROR.Println("Couldn't discover absolute path")
+		jww.ERROR.Println(err)
+	}
+	return ""
+}
+
+// Check if File / Directory Exists
+func exists(path string) (bool, error) {
+	_, err := os.Stat(path)
+	if err == nil {
+		return true, nil
+	}
+	if os.IsNotExist(err) {
+		return false, nil
+	}
+	return false, err
+}
+
+func stringInSlice(a string, list []string) bool {
+	for _, b := range list {
+		if b == a {
+			return true
+		}
+	}
+	return false
+}
+
+func userHomeDir() string {
+	if runtime.GOOS == "windows" {
+		home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
+		if home == "" {
+			home = os.Getenv("USERPROFILE")
+		}
+		return home
+	}
+	return os.Getenv("HOME")
+}
+
+func findCWD() (string, error) {
+	serverFile, err := filepath.Abs(os.Args[0])
+
+	if err != nil {
+		return "", fmt.Errorf("Can't get absolute path for executable: %v", err)
+	}
+
+	path := filepath.Dir(serverFile)
+	realFile, err := filepath.EvalSymlinks(serverFile)
+
+	if err != nil {
+		if _, err = os.Stat(serverFile + ".exe"); err == nil {
+			realFile = filepath.Clean(serverFile + ".exe")
+		}
+	}
+
+	if err == nil && realFile != serverFile {
+		path = filepath.Dir(realFile)
+	}
+
+	return path, nil
+}
+
+func marshallConfigReader(in io.Reader, c map[string]interface{}, configType string) {
+	buf := new(bytes.Buffer)
+	buf.ReadFrom(in)
+
+	switch strings.ToLower(configType) {
+	case "yaml", "yml":
+		if err := yaml.Unmarshal(buf.Bytes(), &c); err != nil {
+			jww.ERROR.Fatalf("Error parsing config: %s", err)
+		}
+
+	case "json":
+		if err := json.Unmarshal(buf.Bytes(), &c); err != nil {
+			jww.ERROR.Fatalf("Error parsing config: %s", err)
+		}
+
+	case "toml":
+		if _, err := toml.Decode(buf.String(), &c); err != nil {
+			jww.ERROR.Fatalf("Error parsing config: %s", err)
+		}
+
+	case "properties", "props", "prop":
+		var p *properties.Properties
+		var err error
+		if p, err = properties.Load(buf.Bytes(), properties.UTF8); err != nil {
+			jww.ERROR.Fatalf("Error parsing config: %s", err)
+		}
+		for _, key := range p.Keys() {
+			value, _ := p.Get(key)
+			c[key] = value
+		}
+	}
+
+	insensitiviseMap(c)
+}
+
+func safeMul(a, b uint) uint {
+	c := a * b
+	if a > 1 && b > 1 && c/b != a {
+		return 0
+	}
+	return c
+}
+
+// parseSizeInBytes converts strings like 1GB or 12 mb into an unsigned integer number of bytes
+func parseSizeInBytes(sizeStr string) uint {
+	sizeStr = strings.TrimSpace(sizeStr)
+	lastChar := len(sizeStr) - 1
+	multiplier := uint(1)
+
+	if lastChar > 0 {
+		if sizeStr[lastChar] == 'b' || sizeStr[lastChar] == 'B' {
+			if lastChar > 1 {
+				switch unicode.ToLower(rune(sizeStr[lastChar-1])) {
+				case 'k':
+					multiplier = 1 << 10
+					sizeStr = strings.TrimSpace(sizeStr[:lastChar-1])
+				case 'm':
+					multiplier = 1 << 20
+					sizeStr = strings.TrimSpace(sizeStr[:lastChar-1])
+				case 'g':
+					multiplier = 1 << 30
+					sizeStr = strings.TrimSpace(sizeStr[:lastChar-1])
+				default:
+					multiplier = 1
+					sizeStr = strings.TrimSpace(sizeStr[:lastChar])
+				}
+			}
+		}
+	}
+
+	size := cast.ToInt(sizeStr)
+	if size < 0 {
+		size = 0
+	}
+
+	return safeMul(uint(size), multiplier)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/viper/viper.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/viper/viper.go b/newt/Godeps/_workspace/src/github.com/spf13/viper/viper.go
new file mode 100644
index 0000000..3db9cd2
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/viper/viper.go
@@ -0,0 +1,982 @@
+// Copyright © 2014 Steve Francia <sp...@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+// Viper is a application configuration system.
+// It believes that applications can be configured a variety of ways
+// via flags, ENVIRONMENT variables, configuration files retrieved
+// from the file system, or a remote key/value store.
+
+// Each item takes precedence over the item below it:
+
+// overrides
+// flag
+// env
+// config
+// key/value store
+// default
+
+package viper
+
+import (
+	"bytes"
+	"fmt"
+	"io"
+	"io/ioutil"
+	"os"
+	"path/filepath"
+	"reflect"
+	"strings"
+	"time"
+
+	"github.com/kr/pretty"
+	"github.com/mitchellh/mapstructure"
+	"github.com/spf13/cast"
+	jww "github.com/spf13/jwalterweatherman"
+	"github.com/spf13/pflag"
+)
+
+var v *Viper
+
+func init() {
+	v = New()
+}
+
+type remoteConfigFactory interface {
+	Get(rp RemoteProvider) (io.Reader, error)
+	Watch(rp RemoteProvider) (io.Reader, error)
+}
+
+// RemoteConfig is optional, see the remote package
+var RemoteConfig remoteConfigFactory
+
+// Denotes encountering an unsupported
+// configuration filetype.
+type UnsupportedConfigError string
+
+// Returns the formatted configuration error.
+func (str UnsupportedConfigError) Error() string {
+	return fmt.Sprintf("Unsupported Config Type %q", string(str))
+}
+
+// Denotes encountering an unsupported remote
+// provider. Currently only Etcd and Consul are
+// supported.
+type UnsupportedRemoteProviderError string
+
+// Returns the formatted remote provider error.
+func (str UnsupportedRemoteProviderError) Error() string {
+	return fmt.Sprintf("Unsupported Remote Provider Type %q", string(str))
+}
+
+// Denotes encountering an error while trying to
+// pull the configuration from the remote provider.
+type RemoteConfigError string
+
+// Returns the formatted remote provider error
+func (rce RemoteConfigError) Error() string {
+	return fmt.Sprintf("Remote Configurations Error: %s", string(rce))
+}
+
+// Viper is a prioritized configuration registry. It
+// maintains a set of configuration sources, fetches
+// values to populate those, and provides them according
+// to the source's priority.
+// The priority of the sources is the following:
+// 1. overrides
+// 2. flags
+// 3. env. variables
+// 4. config file
+// 5. key/value store
+// 6. defaults
+//
+// For example, if values from the following sources were loaded:
+//
+//  Defaults : {
+//  	"secret": "",
+//  	"user": "default",
+// 	    "endpoint": "https://localhost"
+//  }
+//  Config : {
+//  	"user": "root"
+//	    "secret": "defaultsecret"
+//  }
+//  Env : {
+//  	"secret": "somesecretkey"
+//  }
+//
+// The resulting config will have the following values:
+//
+//	{
+//		"secret": "somesecretkey",
+//		"user": "root",
+//		"endpoint": "https://localhost"
+//	}
+type Viper struct {
+	// Delimiter that separates a list of keys
+	// used to access a nested value in one go
+	keyDelim string
+
+	// A set of paths to look for the config file in
+	configPaths []string
+
+	// A set of remote providers to search for the configuration
+	remoteProviders []*defaultRemoteProvider
+
+	// Name of file to look for inside the path
+	configName string
+	configFile string
+	configType string
+	envPrefix  string
+
+	automaticEnvApplied bool
+	envKeyReplacer      *strings.Replacer
+
+	config   map[string]interface{}
+	override map[string]interface{}
+	defaults map[string]interface{}
+	kvstore  map[string]interface{}
+	pflags   map[string]*pflag.Flag
+	env      map[string]string
+	aliases  map[string]string
+}
+
+// Returns an initialized Viper instance.
+func New() *Viper {
+	v := new(Viper)
+	v.keyDelim = "."
+	v.configName = "config"
+	v.config = make(map[string]interface{})
+	v.override = make(map[string]interface{})
+	v.defaults = make(map[string]interface{})
+	v.kvstore = make(map[string]interface{})
+	v.pflags = make(map[string]*pflag.Flag)
+	v.env = make(map[string]string)
+	v.aliases = make(map[string]string)
+
+	return v
+}
+
+// Intended for testing, will reset all to default settings.
+// In the public interface for the viper package so applications
+// can use it in their testing as well.
+func Reset() {
+	v = New()
+	SupportedExts = []string{"json", "toml", "yaml", "yml"}
+	SupportedRemoteProviders = []string{"etcd", "consul"}
+}
+
+type defaultRemoteProvider struct {
+	provider      string
+	endpoint      string
+	path          string
+	secretKeyring string
+}
+
+func (rp defaultRemoteProvider) Provider() string {
+	return rp.provider
+}
+
+func (rp defaultRemoteProvider) Endpoint() string {
+	return rp.endpoint
+}
+
+func (rp defaultRemoteProvider) Path() string {
+	return rp.path
+}
+
+func (rp defaultRemoteProvider) SecretKeyring() string {
+	return rp.secretKeyring
+}
+
+// RemoteProvider stores the configuration necessary
+// to connect to a remote key/value store.
+// Optional secretKeyring to unencrypt encrypted values
+// can be provided.
+type RemoteProvider interface {
+	Provider() string
+	Endpoint() string
+	Path() string
+	SecretKeyring() string
+}
+
+// Universally supported extensions.
+var SupportedExts []string = []string{"json", "toml", "yaml", "yml", "properties", "props", "prop"}
+
+// Universally supported remote providers.
+var SupportedRemoteProviders []string = []string{"etcd", "consul"}
+
+// Explicitly define the path, name and extension of the config file
+// Viper will use this and not check any of the config paths
+func SetConfigFile(in string) { v.SetConfigFile(in) }
+func (v *Viper) SetConfigFile(in string) {
+	if in != "" {
+		v.configFile = in
+	}
+}
+
+// Define a prefix that ENVIRONMENT variables will use.
+// E.g. if your prefix is "spf", the env registry
+// will look for env. variables that start with "SPF_"
+func SetEnvPrefix(in string) { v.SetEnvPrefix(in) }
+func (v *Viper) SetEnvPrefix(in string) {
+	if in != "" {
+		v.envPrefix = in
+	}
+}
+
+func (v *Viper) mergeWithEnvPrefix(in string) string {
+	if v.envPrefix != "" {
+		return strings.ToUpper(v.envPrefix + "_" + in)
+	}
+
+	return strings.ToUpper(in)
+}
+
+// TODO: should getEnv logic be moved into find(). Can generalize the use of
+// rewriting keys many things, Ex: Get('someKey') -> some_key
+// (cammel case to snake case for JSON keys perhaps)
+
+// getEnv s a wrapper around os.Getenv which replaces characters in the original
+// key. This allows env vars which have different keys then the config object
+// keys
+func (v *Viper) getEnv(key string) string {
+	if v.envKeyReplacer != nil {
+		key = v.envKeyReplacer.Replace(key)
+	}
+	return os.Getenv(key)
+}
+
+// Return the file used to populate the config registry
+func ConfigFileUsed() string            { return v.ConfigFileUsed() }
+func (v *Viper) ConfigFileUsed() string { return v.configFile }
+
+// Add a path for Viper to search for the config file in.
+// Can be called multiple times to define multiple search paths.
+func AddConfigPath(in string) { v.AddConfigPath(in) }
+func (v *Viper) AddConfigPath(in string) {
+	if in != "" {
+		absin := absPathify(in)
+		jww.INFO.Println("adding", absin, "to paths to search")
+		if !stringInSlice(absin, v.configPaths) {
+			v.configPaths = append(v.configPaths, absin)
+		}
+	}
+}
+
+// AddRemoteProvider adds a remote configuration source.
+// Remote Providers are searched in the order they are added.
+// provider is a string value, "etcd" or "consul" are currently supported.
+// endpoint is the url.  etcd requires http://ip:port  consul requires ip:port
+// path is the path in the k/v store to retrieve configuration
+// To retrieve a config file called myapp.json from /configs/myapp.json
+// you should set path to /configs and set config name (SetConfigName()) to
+// "myapp"
+func AddRemoteProvider(provider, endpoint, path string) error {
+	return v.AddRemoteProvider(provider, endpoint, path)
+}
+func (v *Viper) AddRemoteProvider(provider, endpoint, path string) error {
+	if !stringInSlice(provider, SupportedRemoteProviders) {
+		return UnsupportedRemoteProviderError(provider)
+	}
+	if provider != "" && endpoint != "" {
+		jww.INFO.Printf("adding %s:%s to remote provider list", provider, endpoint)
+		rp := &defaultRemoteProvider{
+			endpoint: endpoint,
+			provider: provider,
+			path:     path,
+		}
+		if !v.providerPathExists(rp) {
+			v.remoteProviders = append(v.remoteProviders, rp)
+		}
+	}
+	return nil
+}
+
+// AddSecureRemoteProvider adds a remote configuration source.
+// Secure Remote Providers are searched in the order they are added.
+// provider is a string value, "etcd" or "consul" are currently supported.
+// endpoint is the url.  etcd requires http://ip:port  consul requires ip:port
+// secretkeyring is the filepath to your openpgp secret keyring.  e.g. /etc/secrets/myring.gpg
+// path is the path in the k/v store to retrieve configuration
+// To retrieve a config file called myapp.json from /configs/myapp.json
+// you should set path to /configs and set config name (SetConfigName()) to
+// "myapp"
+// Secure Remote Providers are implemented with github.com/xordataexchange/crypt
+func AddSecureRemoteProvider(provider, endpoint, path, secretkeyring string) error {
+	return v.AddSecureRemoteProvider(provider, endpoint, path, secretkeyring)
+}
+
+func (v *Viper) AddSecureRemoteProvider(provider, endpoint, path, secretkeyring string) error {
+	if !stringInSlice(provider, SupportedRemoteProviders) {
+		return UnsupportedRemoteProviderError(provider)
+	}
+	if provider != "" && endpoint != "" {
+		jww.INFO.Printf("adding %s:%s to remote provider list", provider, endpoint)
+		rp := &defaultRemoteProvider{
+			endpoint:      endpoint,
+			provider:      provider,
+			path:          path,
+			secretKeyring: secretkeyring,
+		}
+		if !v.providerPathExists(rp) {
+			v.remoteProviders = append(v.remoteProviders, rp)
+		}
+	}
+	return nil
+}
+
+func (v *Viper) providerPathExists(p *defaultRemoteProvider) bool {
+	for _, y := range v.remoteProviders {
+		if reflect.DeepEqual(y, p) {
+			return true
+		}
+	}
+	return false
+}
+
+func (v *Viper) searchMap(source map[string]interface{}, path []string) interface{} {
+
+	if len(path) == 0 {
+		return source
+	}
+
+	if next, ok := source[path[0]]; ok {
+		switch next.(type) {
+		case map[interface{}]interface{}:
+			return v.searchMap(cast.ToStringMap(next), path[1:])
+		case map[string]interface{}:
+			// Type assertion is safe here since it is only reached
+			// if the type of `next` is the same as the type being asserted
+			return v.searchMap(next.(map[string]interface{}), path[1:])
+		default:
+			return next
+		}
+	} else {
+		return nil
+	}
+}
+
+// Viper is essentially repository for configurations
+// Get can retrieve any value given the key to use
+// Get has the behavior of returning the value associated with the first
+// place from where it is set. Viper will check in the following order:
+// override, flag, env, config file, key/value store, default
+//
+// Get returns an interface. For a specific value use one of the Get____ methods.
+func Get(key string) interface{} { return v.Get(key) }
+func (v *Viper) Get(key string) interface{} {
+	path := strings.Split(key, v.keyDelim)
+
+	val := v.find(strings.ToLower(key))
+
+	if val == nil {
+		source := v.find(path[0])
+		if source == nil {
+			return nil
+		}
+
+		if reflect.TypeOf(source).Kind() == reflect.Map {
+			val = v.searchMap(cast.ToStringMap(source), path[1:])
+		}
+	}
+
+	switch val.(type) {
+	case bool:
+		return cast.ToBool(val)
+	case string:
+		return cast.ToString(val)
+	case int64, int32, int16, int8, int:
+		return cast.ToInt(val)
+	case float64, float32:
+		return cast.ToFloat64(val)
+	case time.Time:
+		return cast.ToTime(val)
+	case time.Duration:
+		return cast.ToDuration(val)
+	case []string:
+		return val
+	}
+	return val
+}
+
+// Returns the value associated with the key as a string
+func GetString(key string) string { return v.GetString(key) }
+func (v *Viper) GetString(key string) string {
+	return cast.ToString(v.Get(key))
+}
+
+// Returns the value associated with the key asa boolean
+func GetBool(key string) bool { return v.GetBool(key) }
+func (v *Viper) GetBool(key string) bool {
+	return cast.ToBool(v.Get(key))
+}
+
+// Returns the value associated with the key as an integer
+func GetInt(key string) int { return v.GetInt(key) }
+func (v *Viper) GetInt(key string) int {
+	return cast.ToInt(v.Get(key))
+}
+
+// Returns the value associated with the key as a float64
+func GetFloat64(key string) float64 { return v.GetFloat64(key) }
+func (v *Viper) GetFloat64(key string) float64 {
+	return cast.ToFloat64(v.Get(key))
+}
+
+// Returns the value associated with the key as time
+func GetTime(key string) time.Time { return v.GetTime(key) }
+func (v *Viper) GetTime(key string) time.Time {
+	return cast.ToTime(v.Get(key))
+}
+
+// Returns the value associated with the key as a duration
+func GetDuration(key string) time.Duration { return v.GetDuration(key) }
+func (v *Viper) GetDuration(key string) time.Duration {
+	return cast.ToDuration(v.Get(key))
+}
+
+// Returns the value associated with the key as a slice of strings
+func GetStringSlice(key string) []string { return v.GetStringSlice(key) }
+func (v *Viper) GetStringSlice(key string) []string {
+	return cast.ToStringSlice(v.Get(key))
+}
+
+// Returns the value associated with the key as a map of interfaces
+func GetStringMap(key string) map[string]interface{} { return v.GetStringMap(key) }
+func (v *Viper) GetStringMap(key string) map[string]interface{} {
+	return cast.ToStringMap(v.Get(key))
+}
+
+// Returns the value associated with the key as a map of strings
+func GetStringMapString(key string) map[string]string { return v.GetStringMapString(key) }
+func (v *Viper) GetStringMapString(key string) map[string]string {
+	return cast.ToStringMapString(v.Get(key))
+}
+
+// Returns the size of the value associated with the given key
+// in bytes.
+func GetSizeInBytes(key string) uint { return v.GetSizeInBytes(key) }
+func (v *Viper) GetSizeInBytes(key string) uint {
+	sizeStr := cast.ToString(v.Get(key))
+	return parseSizeInBytes(sizeStr)
+}
+
+// Takes a single key and marshals it into a Struct
+func MarshalKey(key string, rawVal interface{}) error { return v.MarshalKey(key, rawVal) }
+func (v *Viper) MarshalKey(key string, rawVal interface{}) error {
+	return mapstructure.Decode(v.Get(key), rawVal)
+}
+
+// Marshals the config into a Struct. Make sure that the tags
+// on the fields of the structure are properly set.
+func Marshal(rawVal interface{}) error { return v.Marshal(rawVal) }
+func (v *Viper) Marshal(rawVal interface{}) error {
+	err := mapstructure.WeakDecode(v.AllSettings(), rawVal)
+
+	if err != nil {
+		return err
+	}
+
+	v.insensitiviseMaps()
+
+	return nil
+}
+
+// Bind a full flag set to the configuration, using each flag's long
+// name as the config key.
+func BindPFlags(flags *pflag.FlagSet) (err error) { return v.BindPFlags(flags) }
+func (v *Viper) BindPFlags(flags *pflag.FlagSet) (err error) {
+	flags.VisitAll(func(flag *pflag.Flag) {
+		if err != nil {
+			// an error has been encountered in one of the previous flags
+			return
+		}
+
+		err = v.BindPFlag(flag.Name, flag)
+		switch flag.Value.Type() {
+		case "int", "int8", "int16", "int32", "int64":
+			v.SetDefault(flag.Name, cast.ToInt(flag.Value.String()))
+		case "bool":
+			v.SetDefault(flag.Name, cast.ToBool(flag.Value.String()))
+		default:
+			v.SetDefault(flag.Name, flag.Value.String())
+		}
+	})
+	return
+}
+
+// Bind a specific key to a flag (as used by cobra)
+// Example(where serverCmd is a Cobra instance):
+//
+//	 serverCmd.Flags().Int("port", 1138, "Port to run Application server on")
+//	 Viper.BindPFlag("port", serverCmd.Flags().Lookup("port"))
+//
+func BindPFlag(key string, flag *pflag.Flag) (err error) { return v.BindPFlag(key, flag) }
+func (v *Viper) BindPFlag(key string, flag *pflag.Flag) (err error) {
+	if flag == nil {
+		return fmt.Errorf("flag for %q is nil", key)
+	}
+	v.pflags[strings.ToLower(key)] = flag
+
+	switch flag.Value.Type() {
+	case "int", "int8", "int16", "int32", "int64":
+		SetDefault(key, cast.ToInt(flag.Value.String()))
+	case "bool":
+		SetDefault(key, cast.ToBool(flag.Value.String()))
+	default:
+		SetDefault(key, flag.Value.String())
+	}
+	return nil
+}
+
+// Binds a Viper key to a ENV variable
+// ENV variables are case sensitive
+// If only a key is provided, it will use the env key matching the key, uppercased.
+// EnvPrefix will be used when set when env name is not provided.
+func BindEnv(input ...string) (err error) { return v.BindEnv(input...) }
+func (v *Viper) BindEnv(input ...string) (err error) {
+	var key, envkey string
+	if len(input) == 0 {
+		return fmt.Errorf("BindEnv missing key to bind to")
+	}
+
+	key = strings.ToLower(input[0])
+
+	if len(input) == 1 {
+		envkey = v.mergeWithEnvPrefix(key)
+	} else {
+		envkey = input[1]
+	}
+
+	v.env[key] = envkey
+
+	return nil
+}
+
+// Given a key, find the value
+// Viper will check in the following order:
+// flag, env, config file, key/value store, default
+// Viper will check to see if an alias exists first
+func (v *Viper) find(key string) interface{} {
+	var val interface{}
+	var exists bool
+
+	// if the requested key is an alias, then return the proper key
+	key = v.realKey(key)
+
+	// PFlag Override first
+	flag, exists := v.pflags[key]
+	if exists {
+		if flag.Changed {
+			jww.TRACE.Println(key, "found in override (via pflag):", val)
+			return flag.Value.String()
+		}
+	}
+
+	val, exists = v.override[key]
+	if exists {
+		jww.TRACE.Println(key, "found in override:", val)
+		return val
+	}
+
+	if v.automaticEnvApplied {
+		// even if it hasn't been registered, if automaticEnv is used,
+		// check any Get request
+		if val = v.getEnv(v.mergeWithEnvPrefix(key)); val != "" {
+			jww.TRACE.Println(key, "found in environment with val:", val)
+			return val
+		}
+	}
+
+	envkey, exists := v.env[key]
+	if exists {
+		jww.TRACE.Println(key, "registered as env var", envkey)
+		if val = v.getEnv(envkey); val != "" {
+			jww.TRACE.Println(envkey, "found in environment with val:", val)
+			return val
+		} else {
+			jww.TRACE.Println(envkey, "env value unset:")
+		}
+	}
+
+	val, exists = v.config[key]
+	if exists {
+		jww.TRACE.Println(key, "found in config:", val)
+		return val
+	}
+
+	val, exists = v.kvstore[key]
+	if exists {
+		jww.TRACE.Println(key, "found in key/value store:", val)
+		return val
+	}
+
+	val, exists = v.defaults[key]
+	if exists {
+		jww.TRACE.Println(key, "found in defaults:", val)
+		return val
+	}
+
+	return nil
+}
+
+// Check to see if the key has been set in any of the data locations
+func IsSet(key string) bool { return v.IsSet(key) }
+func (v *Viper) IsSet(key string) bool {
+	t := v.Get(key)
+	return t != nil
+}
+
+// Have Viper check ENV variables for all
+// keys set in config, default & flags
+func AutomaticEnv() { v.AutomaticEnv() }
+func (v *Viper) AutomaticEnv() {
+	v.automaticEnvApplied = true
+}
+
+// SetEnvKeyReplacer sets the strings.Replacer on the viper object
+// Useful for mapping an environmental variable to a key that does
+// not match it.
+func SetEnvKeyReplacer(r *strings.Replacer) { v.SetEnvKeyReplacer(r) }
+func (v *Viper) SetEnvKeyReplacer(r *strings.Replacer) {
+	v.envKeyReplacer = r
+}
+
+// Aliases provide another accessor for the same key.
+// This enables one to change a name without breaking the application
+func RegisterAlias(alias string, key string) { v.RegisterAlias(alias, key) }
+func (v *Viper) RegisterAlias(alias string, key string) {
+	v.registerAlias(alias, strings.ToLower(key))
+}
+
+func (v *Viper) registerAlias(alias string, key string) {
+	alias = strings.ToLower(alias)
+	if alias != key && alias != v.realKey(key) {
+		_, exists := v.aliases[alias]
+
+		if !exists {
+			// if we alias something that exists in one of the maps to another
+			// name, we'll never be able to get that value using the original
+			// name, so move the config value to the new realkey.
+			if val, ok := v.config[alias]; ok {
+				delete(v.config, alias)
+				v.config[key] = val
+			}
+			if val, ok := v.kvstore[alias]; ok {
+				delete(v.kvstore, alias)
+				v.kvstore[key] = val
+			}
+			if val, ok := v.defaults[alias]; ok {
+				delete(v.defaults, alias)
+				v.defaults[key] = val
+			}
+			if val, ok := v.override[alias]; ok {
+				delete(v.override, alias)
+				v.override[key] = val
+			}
+			v.aliases[alias] = key
+		}
+	} else {
+		jww.WARN.Println("Creating circular reference alias", alias, key, v.realKey(key))
+	}
+}
+
+func (v *Viper) realKey(key string) string {
+	newkey, exists := v.aliases[key]
+	if exists {
+		jww.DEBUG.Println("Alias", key, "to", newkey)
+		return v.realKey(newkey)
+	} else {
+		return key
+	}
+}
+
+// Check to see if the given key (or an alias) is in the config file
+func InConfig(key string) bool { return v.InConfig(key) }
+func (v *Viper) InConfig(key string) bool {
+	// if the requested key is an alias, then return the proper key
+	key = v.realKey(key)
+
+	_, exists := v.config[key]
+	return exists
+}
+
+// Set the default value for this key.
+// Default only used when no value is provided by the user via flag, config or ENV.
+func SetDefault(key string, value interface{}) { v.SetDefault(key, value) }
+func (v *Viper) SetDefault(key string, value interface{}) {
+	// If alias passed in, then set the proper default
+	key = v.realKey(strings.ToLower(key))
+	v.defaults[key] = value
+}
+
+// Sets the value for the key in the override regiser.
+// Will be used instead of values obtained via
+// flags, config file, ENV, default, or key/value store
+func Set(key string, value interface{}) { v.Set(key, value) }
+func (v *Viper) Set(key string, value interface{}) {
+	// If alias passed in, then set the proper override
+	key = v.realKey(strings.ToLower(key))
+	v.override[key] = value
+}
+
+// Viper will discover and load the configuration file from disk
+// and key/value stores, searching in one of the defined paths.
+func ReadInConfig() error { return v.ReadInConfig() }
+func (v *Viper) ReadInConfig() error {
+	jww.INFO.Println("Attempting to read in config file")
+	if !stringInSlice(v.getConfigType(), SupportedExts) {
+		return UnsupportedConfigError(v.getConfigType())
+	}
+
+	file, err := ioutil.ReadFile(v.getConfigFile())
+	if err != nil {
+		return err
+	}
+
+	v.config = make(map[string]interface{})
+
+	v.marshalReader(bytes.NewReader(file), v.config)
+	return nil
+}
+
+func ReadConfig(in io.Reader) error { return v.ReadConfig(in) }
+func (v *Viper) ReadConfig(in io.Reader) error {
+	v.config = make(map[string]interface{})
+	v.marshalReader(in, v.config)
+	return nil
+}
+
+// func ReadBufConfig(buf *bytes.Buffer) error { return v.ReadBufConfig(buf) }
+// func (v *Viper) ReadBufConfig(buf *bytes.Buffer) error {
+// 	v.config = make(map[string]interface{})
+// 	v.marshalReader(buf, v.config)
+// 	return nil
+// }
+
+// Attempts to get configuration from a remote source
+// and read it in the remote configuration registry.
+func ReadRemoteConfig() error { return v.ReadRemoteConfig() }
+func (v *Viper) ReadRemoteConfig() error {
+	err := v.getKeyValueConfig()
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func WatchRemoteConfig() error { return v.WatchRemoteConfig() }
+func (v *Viper) WatchRemoteConfig() error {
+	err := v.watchKeyValueConfig()
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// Marshall a Reader into a map
+// Should probably be an unexported function
+func marshalReader(in io.Reader, c map[string]interface{}) { v.marshalReader(in, c) }
+func (v *Viper) marshalReader(in io.Reader, c map[string]interface{}) {
+	marshallConfigReader(in, c, v.getConfigType())
+}
+
+func (v *Viper) insensitiviseMaps() {
+	insensitiviseMap(v.config)
+	insensitiviseMap(v.defaults)
+	insensitiviseMap(v.override)
+	insensitiviseMap(v.kvstore)
+}
+
+// retrieve the first found remote configuration
+func (v *Viper) getKeyValueConfig() error {
+	if RemoteConfig == nil {
+		return RemoteConfigError("Enable the remote features by doing a blank import of the viper/remote package: '_ github.com/spf13/viper/remote'")
+	}
+
+	for _, rp := range v.remoteProviders {
+		val, err := v.getRemoteConfig(rp)
+		if err != nil {
+			continue
+		}
+		v.kvstore = val
+		return nil
+	}
+	return RemoteConfigError("No Files Found")
+}
+
+func (v *Viper) getRemoteConfig(provider *defaultRemoteProvider) (map[string]interface{}, error) {
+
+	reader, err := RemoteConfig.Get(provider)
+	if err != nil {
+		return nil, err
+	}
+	v.marshalReader(reader, v.kvstore)
+	return v.kvstore, err
+}
+
+// retrieve the first found remote configuration
+func (v *Viper) watchKeyValueConfig() error {
+	for _, rp := range v.remoteProviders {
+		val, err := v.watchRemoteConfig(rp)
+		if err != nil {
+			continue
+		}
+		v.kvstore = val
+		return nil
+	}
+	return RemoteConfigError("No Files Found")
+}
+
+func (v *Viper) watchRemoteConfig(provider *defaultRemoteProvider) (map[string]interface{}, error) {
+	reader, err := RemoteConfig.Watch(provider)
+	if err != nil {
+		return nil, err
+	}
+	v.marshalReader(reader, v.kvstore)
+	return v.kvstore, err
+}
+
+// Return all keys regardless where they are set
+func AllKeys() []string { return v.AllKeys() }
+func (v *Viper) AllKeys() []string {
+	m := map[string]struct{}{}
+
+	for key, _ := range v.defaults {
+		m[key] = struct{}{}
+	}
+
+	for key, _ := range v.config {
+		m[key] = struct{}{}
+	}
+
+	for key, _ := range v.kvstore {
+		m[key] = struct{}{}
+	}
+
+	for key, _ := range v.override {
+		m[key] = struct{}{}
+	}
+
+	a := []string{}
+	for x, _ := range m {
+		a = append(a, x)
+	}
+
+	return a
+}
+
+// Return all settings as a map[string]interface{}
+func AllSettings() map[string]interface{} { return v.AllSettings() }
+func (v *Viper) AllSettings() map[string]interface{} {
+	m := map[string]interface{}{}
+	for _, x := range v.AllKeys() {
+		m[x] = v.Get(x)
+	}
+
+	return m
+}
+
+// Name for the config file.
+// Does not include extension.
+func SetConfigName(in string) { v.SetConfigName(in) }
+func (v *Viper) SetConfigName(in string) {
+	if in != "" {
+		v.configName = in
+	}
+}
+
+// Sets the type of the configuration returned by the
+// remote source, e.g. "json".
+func SetConfigType(in string) { v.SetConfigType(in) }
+func (v *Viper) SetConfigType(in string) {
+	if in != "" {
+		v.configType = in
+	}
+}
+
+func (v *Viper) getConfigType() string {
+	if v.configType != "" {
+		return v.configType
+	}
+
+	cf := v.getConfigFile()
+	ext := filepath.Ext(cf)
+
+	if len(ext) > 1 {
+		return ext[1:]
+	} else {
+		return ""
+	}
+}
+
+func (v *Viper) getConfigFile() string {
+	// if explicitly set, then use it
+	if v.configFile != "" {
+		return v.configFile
+	}
+
+	cf, err := v.findConfigFile()
+	if err != nil {
+		return ""
+	}
+
+	v.configFile = cf
+	return v.getConfigFile()
+}
+
+func (v *Viper) searchInPath(in string) (filename string) {
+	jww.DEBUG.Println("Searching for config in ", in)
+	for _, ext := range SupportedExts {
+		jww.DEBUG.Println("Checking for", filepath.Join(in, v.configName+"."+ext))
+		if b, _ := exists(filepath.Join(in, v.configName+"."+ext)); b {
+			jww.DEBUG.Println("Found: ", filepath.Join(in, v.configName+"."+ext))
+			return filepath.Join(in, v.configName+"."+ext)
+		}
+	}
+
+	return ""
+}
+
+// search all configPaths for any config file.
+// Returns the first path that exists (and is a config file)
+func (v *Viper) findConfigFile() (string, error) {
+	jww.INFO.Println("Searching for config in ", v.configPaths)
+
+	for _, cp := range v.configPaths {
+		file := v.searchInPath(cp)
+		if file != "" {
+			return file, nil
+		}
+	}
+
+	// try the current working directory
+	wd, _ := os.Getwd()
+	file := v.searchInPath(wd)
+	if file != "" {
+		return file, nil
+	}
+	return "", fmt.Errorf("config file not found in: %s", v.configPaths)
+}
+
+// Prints all configuration registries for debugging
+// purposes.
+func Debug() { v.Debug() }
+func (v *Viper) Debug() {
+	fmt.Println("Aliases:")
+	pretty.Println(v.aliases)
+	fmt.Println("Override:")
+	pretty.Println(v.override)
+	fmt.Println("PFlags")
+	pretty.Println(v.pflags)
+	fmt.Println("Env:")
+	pretty.Println(v.env)
+	fmt.Println("Key/Value Store:")
+	pretty.Println(v.kvstore)
+	fmt.Println("Config:")
+	pretty.Println(v.config)
+	fmt.Println("Defaults:")
+	pretty.Println(v.defaults)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go b/newt/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go
new file mode 100644
index 0000000..8d7d152
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go
@@ -0,0 +1,559 @@
+// Copyright © 2014 Steve Francia <sp...@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package viper
+
+import (
+	"bytes"
+	"fmt"
+	"os"
+	"sort"
+	"strings"
+	"testing"
+	"time"
+
+	"github.com/spf13/pflag"
+	"github.com/stretchr/testify/assert"
+)
+
+var yamlExample = []byte(`Hacker: true
+name: steve
+hobbies:
+- skateboarding
+- snowboarding
+- go
+clothing:
+  jacket: leather
+  trousers: denim
+  pants:
+    size: large
+age: 35
+eyes : brown
+beard: true
+`)
+
+var tomlExample = []byte(`
+title = "TOML Example"
+
+[owner]
+organization = "MongoDB"
+Bio = "MongoDB Chief Developer Advocate & Hacker at Large"
+dob = 1979-05-27T07:32:00Z # First class dates? Why not?`)
+
+var jsonExample = []byte(`{
+"id": "0001",
+"type": "donut",
+"name": "Cake",
+"ppu": 0.55,
+"batters": {
+        "batter": [
+                { "type": "Regular" },
+                { "type": "Chocolate" },
+                { "type": "Blueberry" },
+                { "type": "Devil's Food" }
+            ]
+    }
+}`)
+
+var propertiesExample = []byte(`
+p_id: 0001
+p_type: donut
+p_name: Cake
+p_ppu: 0.55
+p_batters.batter.type: Regular
+`)
+
+var remoteExample = []byte(`{
+"id":"0002",
+"type":"cronut",
+"newkey":"remote"
+}`)
+
+func initConfigs() {
+	Reset()
+	SetConfigType("yaml")
+	r := bytes.NewReader(yamlExample)
+	marshalReader(r, v.config)
+
+	SetConfigType("json")
+	r = bytes.NewReader(jsonExample)
+	marshalReader(r, v.config)
+
+	SetConfigType("properties")
+	r = bytes.NewReader(propertiesExample)
+	marshalReader(r, v.config)
+
+	SetConfigType("toml")
+	r = bytes.NewReader(tomlExample)
+	marshalReader(r, v.config)
+
+	SetConfigType("json")
+	remote := bytes.NewReader(remoteExample)
+	marshalReader(remote, v.kvstore)
+}
+
+func initYAML() {
+	Reset()
+	SetConfigType("yaml")
+	r := bytes.NewReader(yamlExample)
+
+	marshalReader(r, v.config)
+}
+
+func initJSON() {
+	Reset()
+	SetConfigType("json")
+	r := bytes.NewReader(jsonExample)
+
+	marshalReader(r, v.config)
+}
+
+func initProperties() {
+	Reset()
+	SetConfigType("properties")
+	r := bytes.NewReader(propertiesExample)
+
+	marshalReader(r, v.config)
+}
+
+func initTOML() {
+	Reset()
+	SetConfigType("toml")
+	r := bytes.NewReader(tomlExample)
+
+	marshalReader(r, v.config)
+}
+
+//stubs for PFlag Values
+type stringValue string
+
+func newStringValue(val string, p *string) *stringValue {
+	*p = val
+	return (*stringValue)(p)
+}
+
+func (s *stringValue) Set(val string) error {
+	*s = stringValue(val)
+	return nil
+}
+
+func (s *stringValue) Type() string {
+	return "string"
+}
+
+func (s *stringValue) String() string {
+	return fmt.Sprintf("%s", *s)
+}
+
+func TestBasics(t *testing.T) {
+	SetConfigFile("/tmp/config.yaml")
+	assert.Equal(t, "/tmp/config.yaml", v.getConfigFile())
+}
+
+func TestDefault(t *testing.T) {
+	SetDefault("age", 45)
+	assert.Equal(t, 45, Get("age"))
+}
+
+func TestMarshalling(t *testing.T) {
+	SetConfigType("yaml")
+	r := bytes.NewReader(yamlExample)
+
+	marshalReader(r, v.config)
+	assert.True(t, InConfig("name"))
+	assert.False(t, InConfig("state"))
+	assert.Equal(t, "steve", Get("name"))
+	assert.Equal(t, []interface{}{"skateboarding", "snowboarding", "go"}, Get("hobbies"))
+	assert.Equal(t, map[interface{}]interface{}{"jacket": "leather", "trousers": "denim", "pants": map[interface{}]interface{}{"size": "large"}}, Get("clothing"))
+	assert.Equal(t, 35, Get("age"))
+}
+
+func TestOverrides(t *testing.T) {
+	Set("age", 40)
+	assert.Equal(t, 40, Get("age"))
+}
+
+func TestDefaultPost(t *testing.T) {
+	assert.NotEqual(t, "NYC", Get("state"))
+	SetDefault("state", "NYC")
+	assert.Equal(t, "NYC", Get("state"))
+}
+
+func TestAliases(t *testing.T) {
+	RegisterAlias("years", "age")
+	assert.Equal(t, 40, Get("years"))
+	Set("years", 45)
+	assert.Equal(t, 45, Get("age"))
+}
+
+func TestAliasInConfigFile(t *testing.T) {
+	// the config file specifies "beard".  If we make this an alias for
+	// "hasbeard", we still want the old config file to work with beard.
+	RegisterAlias("beard", "hasbeard")
+	assert.Equal(t, true, Get("hasbeard"))
+	Set("hasbeard", false)
+	assert.Equal(t, false, Get("beard"))
+}
+
+func TestYML(t *testing.T) {
+	initYAML()
+	assert.Equal(t, "steve", Get("name"))
+}
+
+func TestJSON(t *testing.T) {
+	initJSON()
+	assert.Equal(t, "0001", Get("id"))
+}
+
+func TestProperties(t *testing.T) {
+	initProperties()
+	assert.Equal(t, "0001", Get("p_id"))
+}
+
+func TestTOML(t *testing.T) {
+	initTOML()
+	assert.Equal(t, "TOML Example", Get("title"))
+}
+
+func TestRemotePrecedence(t *testing.T) {
+	initJSON()
+
+	remote := bytes.NewReader(remoteExample)
+	assert.Equal(t, "0001", Get("id"))
+	marshalReader(remote, v.kvstore)
+	assert.Equal(t, "0001", Get("id"))
+	assert.NotEqual(t, "cronut", Get("type"))
+	assert.Equal(t, "remote", Get("newkey"))
+	Set("newkey", "newvalue")
+	assert.NotEqual(t, "remote", Get("newkey"))
+	assert.Equal(t, "newvalue", Get("newkey"))
+	Set("newkey", "remote")
+}
+
+func TestEnv(t *testing.T) {
+	initJSON()
+
+	BindEnv("id")
+	BindEnv("f", "FOOD")
+
+	os.Setenv("ID", "13")
+	os.Setenv("FOOD", "apple")
+	os.Setenv("NAME", "crunk")
+
+	assert.Equal(t, "13", Get("id"))
+	assert.Equal(t, "apple", Get("f"))
+	assert.Equal(t, "Cake", Get("name"))
+
+	AutomaticEnv()
+
+	assert.Equal(t, "crunk", Get("name"))
+
+}
+
+func TestEnvPrefix(t *testing.T) {
+	initJSON()
+
+	SetEnvPrefix("foo") // will be uppercased automatically
+	BindEnv("id")
+	BindEnv("f", "FOOD") // not using prefix
+
+	os.Setenv("FOO_ID", "13")
+	os.Setenv("FOOD", "apple")
+	os.Setenv("FOO_NAME", "crunk")
+
+	assert.Equal(t, "13", Get("id"))
+	assert.Equal(t, "apple", Get("f"))
+	assert.Equal(t, "Cake", Get("name"))
+
+	AutomaticEnv()
+
+	assert.Equal(t, "crunk", Get("name"))
+}
+
+func TestAutoEnv(t *testing.T) {
+	Reset()
+
+	AutomaticEnv()
+	os.Setenv("FOO_BAR", "13")
+	assert.Equal(t, "13", Get("foo_bar"))
+}
+
+func TestAutoEnvWithPrefix(t *testing.T) {
+	Reset()
+
+	AutomaticEnv()
+	SetEnvPrefix("Baz")
+	os.Setenv("BAZ_BAR", "13")
+	assert.Equal(t, "13", Get("bar"))
+}
+
+func TestSetEnvReplacer(t *testing.T) {
+	Reset()
+
+	AutomaticEnv()
+	os.Setenv("REFRESH_INTERVAL", "30s")
+
+	replacer := strings.NewReplacer("-", "_")
+	SetEnvKeyReplacer(replacer)
+
+	assert.Equal(t, "30s", Get("refresh-interval"))
+}
+
+func TestAllKeys(t *testing.T) {
+	initConfigs()
+
+	ks := sort.StringSlice{"title", "newkey", "owner", "name", "beard", "ppu", "batters", "hobbies", "clothing", "age", "hacker", "id", "type", "eyes", "p_id", "p_ppu", "p_batters.batter.type", "p_type", "p_name"}
+	dob, _ := time.Parse(time.RFC3339, "1979-05-27T07:32:00Z")
+	all := map[string]interface{}{"owner": map[string]interface{}{"organization": "MongoDB", "Bio": "MongoDB Chief Developer Advocate & Hacker at Large", "dob": dob}, "title": "TOML Example", "ppu": 0.55, "eyes": "brown", "clothing": map[interface{}]interface{}{"trousers": "denim", "jacket": "leather", "pants": map[interface{}]interface{}{"size": "large"}}, "id": "0001", "batters": map[string]interface{}{"batter": []interface{}{map[string]interface{}{"type": "Regular"}, map[string]interface{}{"type": "Chocolate"}, map[string]interface{}{"type": "Blueberry"}, map[string]interface{}{"type": "Devil's Food"}}}, "hacker": true, "beard": true, "hobbies": []interface{}{"skateboarding", "snowboarding", "go"}, "age": 35, "type": "donut", "newkey": "remote", "name": "Cake", "p_id": "0001", "p_ppu": "0.55", "p_name": "Cake", "p_batters.batter.type": "Regular", "p_type": "donut"}
+
+	var allkeys sort.StringSlice
+	allkeys = AllKeys()
+	allkeys.Sort()
+	ks.Sort()
+
+	assert.Equal(t, ks, allkeys)
+	assert.Equal(t, all, AllSettings())
+}
+
+func TestCaseInSensitive(t *testing.T) {
+	assert.Equal(t, true, Get("hacker"))
+	Set("Title", "Checking Case")
+	assert.Equal(t, "Checking Case", Get("tItle"))
+}
+
+func TestAliasesOfAliases(t *testing.T) {
+	RegisterAlias("Foo", "Bar")
+	RegisterAlias("Bar", "Title")
+	assert.Equal(t, "Checking Case", Get("FOO"))
+}
+
+func TestRecursiveAliases(t *testing.T) {
+	RegisterAlias("Baz", "Roo")
+	RegisterAlias("Roo", "baz")
+}
+
+func TestMarshal(t *testing.T) {
+	SetDefault("port", 1313)
+	Set("name", "Steve")
+
+	type config struct {
+		Port int
+		Name string
+	}
+
+	var C config
+
+	err := Marshal(&C)
+	if err != nil {
+		t.Fatalf("unable to decode into struct, %v", err)
+	}
+
+	assert.Equal(t, &C, &config{Name: "Steve", Port: 1313})
+
+	Set("port", 1234)
+	err = Marshal(&C)
+	if err != nil {
+		t.Fatalf("unable to decode into struct, %v", err)
+	}
+	assert.Equal(t, &C, &config{Name: "Steve", Port: 1234})
+}
+
+func TestBindPFlags(t *testing.T) {
+	flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError)
+
+	var testValues = map[string]*string{
+		"host":     nil,
+		"port":     nil,
+		"endpoint": nil,
+	}
+
+	var mutatedTestValues = map[string]string{
+		"host":     "localhost",
+		"port":     "6060",
+		"endpoint": "/public",
+	}
+
+	for name, _ := range testValues {
+		testValues[name] = flagSet.String(name, "", "test")
+	}
+
+	err := BindPFlags(flagSet)
+	if err != nil {
+		t.Fatalf("error binding flag set, %v", err)
+	}
+
+	flagSet.VisitAll(func(flag *pflag.Flag) {
+		flag.Value.Set(mutatedTestValues[flag.Name])
+		flag.Changed = true
+	})
+
+	for name, expected := range mutatedTestValues {
+		assert.Equal(t, Get(name), expected)
+	}
+
+}
+
+func TestBindPFlag(t *testing.T) {
+	var testString = "testing"
+	var testValue = newStringValue(testString, &testString)
+
+	flag := &pflag.Flag{
+		Name:    "testflag",
+		Value:   testValue,
+		Changed: false,
+	}
+
+	BindPFlag("testvalue", flag)
+
+	assert.Equal(t, testString, Get("testvalue"))
+
+	flag.Value.Set("testing_mutate")
+	flag.Changed = true //hack for pflag usage
+
+	assert.Equal(t, "testing_mutate", Get("testvalue"))
+
+}
+
+func TestBoundCaseSensitivity(t *testing.T) {
+
+	assert.Equal(t, "brown", Get("eyes"))
+
+	BindEnv("eYEs", "TURTLE_EYES")
+	os.Setenv("TURTLE_EYES", "blue")
+
+	assert.Equal(t, "blue", Get("eyes"))
+
+	var testString = "green"
+	var testValue = newStringValue(testString, &testString)
+
+	flag := &pflag.Flag{
+		Name:    "eyeballs",
+		Value:   testValue,
+		Changed: true,
+	}
+
+	BindPFlag("eYEs", flag)
+	assert.Equal(t, "green", Get("eyes"))
+
+}
+
+func TestSizeInBytes(t *testing.T) {
+	input := map[string]uint{
+		"":               0,
+		"b":              0,
+		"12 bytes":       0,
+		"200000000000gb": 0,
+		"12 b":           12,
+		"43 MB":          43 * (1 << 20),
+		"10mb":           10 * (1 << 20),
+		"1gb":            1 << 30,
+	}
+
+	for str, expected := range input {
+		assert.Equal(t, expected, parseSizeInBytes(str), str)
+	}
+}
+
+func TestFindsNestedKeys(t *testing.T) {
+	initConfigs()
+	dob, _ := time.Parse(time.RFC3339, "1979-05-27T07:32:00Z")
+
+	Set("super", map[string]interface{}{
+		"deep": map[string]interface{}{
+			"nested": "value",
+		},
+	})
+
+	expected := map[string]interface{}{
+		"super": map[string]interface{}{
+			"deep": map[string]interface{}{
+				"nested": "value",
+			},
+		},
+		"super.deep": map[string]interface{}{
+			"nested": "value",
+		},
+		"super.deep.nested":  "value",
+		"owner.organization": "MongoDB",
+		"batters.batter": []interface{}{
+			map[string]interface{}{
+				"type": "Regular",
+			},
+			map[string]interface{}{
+				"type": "Chocolate",
+			},
+			map[string]interface{}{
+				"type": "Blueberry",
+			},
+			map[string]interface{}{
+				"type": "Devil's Food",
+			},
+		},
+		"hobbies": []interface{}{
+			"skateboarding", "snowboarding", "go",
+		},
+		"title":  "TOML Example",
+		"newkey": "remote",
+		"batters": map[string]interface{}{
+			"batter": []interface{}{
+				map[string]interface{}{
+					"type": "Regular",
+				},
+				map[string]interface{}{
+					"type": "Chocolate",
+				}, map[string]interface{}{
+					"type": "Blueberry",
+				}, map[string]interface{}{
+					"type": "Devil's Food",
+				},
+			},
+		},
+		"eyes": "brown",
+		"age":  35,
+		"owner": map[string]interface{}{
+			"organization": "MongoDB",
+			"Bio":          "MongoDB Chief Developer Advocate & Hacker at Large",
+			"dob":          dob,
+		},
+		"owner.Bio": "MongoDB Chief Developer Advocate & Hacker at Large",
+		"type":      "donut",
+		"id":        "0001",
+		"name":      "Cake",
+		"hacker":    true,
+		"ppu":       0.55,
+		"clothing": map[interface{}]interface{}{
+			"jacket":   "leather",
+			"trousers": "denim",
+			"pants": map[interface{}]interface{}{
+				"size": "large",
+			},
+		},
+		"clothing.jacket":     "leather",
+		"clothing.pants.size": "large",
+		"clothing.trousers":   "denim",
+		"owner.dob":           dob,
+		"beard":               true,
+	}
+
+	for key, expectedValue := range expected {
+
+		assert.Equal(t, expectedValue, v.Get(key))
+	}
+
+}
+
+func TestReadBufConfig(t *testing.T) {
+	v := New()
+	v.SetConfigType("yaml")
+	v.ReadConfig(bytes.NewBuffer(yamlExample))
+	t.Log(v.AllKeys())
+
+	assert.True(t, v.InConfig("name"))
+	assert.False(t, v.InConfig("state"))
+	assert.Equal(t, "steve", v.Get("name"))
+	assert.Equal(t, []interface{}{"skateboarding", "snowboarding", "go"}, v.Get("hobbies"))
+	assert.Equal(t, map[interface{}]interface{}{"jacket": "leather", "trousers": "denim", "pants": map[interface{}]interface{}{"size": "large"}}, v.Get("clothing"))
+	assert.Equal(t, 35, v.Get("age"))
+}


[38/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows_1.4.go b/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
deleted file mode 100644
index 9a28e57..0000000
--- a/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// +build windows
-// +build go1.4
-
-package mousetrap
-
-import (
-	"os"
-	"syscall"
-	"unsafe"
-)
-
-func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) {
-	snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0)
-	if err != nil {
-		return nil, err
-	}
-	defer syscall.CloseHandle(snapshot)
-	var procEntry syscall.ProcessEntry32
-	procEntry.Size = uint32(unsafe.Sizeof(procEntry))
-	if err = syscall.Process32First(snapshot, &procEntry); err != nil {
-		return nil, err
-	}
-	for {
-		if procEntry.ProcessID == uint32(pid) {
-			return &procEntry, nil
-		}
-		err = syscall.Process32Next(snapshot, &procEntry)
-		if err != nil {
-			return nil, err
-		}
-	}
-}
-
-// StartedByExplorer returns true if the program was invoked by the user double-clicking
-// on the executable from explorer.exe
-//
-// It is conservative and returns false if any of the internal calls fail.
-// It does not guarantee that the program was run from a terminal. It only can tell you
-// whether it was launched from explorer.exe
-func StartedByExplorer() bool {
-	pe, err := getProcessEntry(os.Getppid())
-	if err != nil {
-		return false
-	}
-	return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:])
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/pretty/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/pretty/.gitignore b/Godeps/_workspace/src/github.com/kr/pretty/.gitignore
deleted file mode 100644
index 1f0a99f..0000000
--- a/Godeps/_workspace/src/github.com/kr/pretty/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-[568].out
-_go*
-_test*
-_obj

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/pretty/License
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/pretty/License b/Godeps/_workspace/src/github.com/kr/pretty/License
deleted file mode 100644
index 05c783c..0000000
--- a/Godeps/_workspace/src/github.com/kr/pretty/License
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright 2012 Keith Rarick
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/pretty/Readme
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/pretty/Readme b/Godeps/_workspace/src/github.com/kr/pretty/Readme
deleted file mode 100644
index c589fc6..0000000
--- a/Godeps/_workspace/src/github.com/kr/pretty/Readme
+++ /dev/null
@@ -1,9 +0,0 @@
-package pretty
-
-    import "github.com/kr/pretty"
-
-    Package pretty provides pretty-printing for Go values.
-
-Documentation
-
-    http://godoc.org/github.com/kr/pretty

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/pretty/diff.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/pretty/diff.go b/Godeps/_workspace/src/github.com/kr/pretty/diff.go
deleted file mode 100644
index 8fe8e24..0000000
--- a/Godeps/_workspace/src/github.com/kr/pretty/diff.go
+++ /dev/null
@@ -1,158 +0,0 @@
-package pretty
-
-import (
-	"fmt"
-	"io"
-	"reflect"
-)
-
-type sbuf []string
-
-func (s *sbuf) Write(b []byte) (int, error) {
-	*s = append(*s, string(b))
-	return len(b), nil
-}
-
-// Diff returns a slice where each element describes
-// a difference between a and b.
-func Diff(a, b interface{}) (desc []string) {
-	Fdiff((*sbuf)(&desc), a, b)
-	return desc
-}
-
-// Fdiff writes to w a description of the differences between a and b.
-func Fdiff(w io.Writer, a, b interface{}) {
-	diffWriter{w: w}.diff(reflect.ValueOf(a), reflect.ValueOf(b))
-}
-
-type diffWriter struct {
-	w io.Writer
-	l string // label
-}
-
-func (w diffWriter) printf(f string, a ...interface{}) {
-	var l string
-	if w.l != "" {
-		l = w.l + ": "
-	}
-	fmt.Fprintf(w.w, l+f, a...)
-}
-
-func (w diffWriter) diff(av, bv reflect.Value) {
-	if !av.IsValid() && bv.IsValid() {
-		w.printf("nil != %#v", bv.Interface())
-		return
-	}
-	if av.IsValid() && !bv.IsValid() {
-		w.printf("%#v != nil", av.Interface())
-		return
-	}
-	if !av.IsValid() && !bv.IsValid() {
-		return
-	}
-
-	at := av.Type()
-	bt := bv.Type()
-	if at != bt {
-		w.printf("%v != %v", at, bt)
-		return
-	}
-
-	// numeric types, including bool
-	if at.Kind() < reflect.Array {
-		a, b := av.Interface(), bv.Interface()
-		if a != b {
-			w.printf("%#v != %#v", a, b)
-		}
-		return
-	}
-
-	switch at.Kind() {
-	case reflect.String:
-		a, b := av.Interface(), bv.Interface()
-		if a != b {
-			w.printf("%q != %q", a, b)
-		}
-	case reflect.Ptr:
-		switch {
-		case av.IsNil() && !bv.IsNil():
-			w.printf("nil != %v", bv.Interface())
-		case !av.IsNil() && bv.IsNil():
-			w.printf("%v != nil", av.Interface())
-		case !av.IsNil() && !bv.IsNil():
-			w.diff(av.Elem(), bv.Elem())
-		}
-	case reflect.Struct:
-		for i := 0; i < av.NumField(); i++ {
-			w.relabel(at.Field(i).Name).diff(av.Field(i), bv.Field(i))
-		}
-	case reflect.Slice:
-		lenA := av.Len()
-		lenB := bv.Len()
-		if lenA != lenB {
-			w.printf("%s[%d] != %s[%d]", av.Type(), lenA, bv.Type(), lenB)
-			break
-		}
-		for i := 0; i < lenA; i++ {
-			w.relabel(fmt.Sprintf("[%d]", i)).diff(av.Index(i), bv.Index(i))
-		}
-	case reflect.Map:
-		ak, both, bk := keyDiff(av.MapKeys(), bv.MapKeys())
-		for _, k := range ak {
-			w := w.relabel(fmt.Sprintf("[%#v]", k.Interface()))
-			w.printf("%q != (missing)", av.MapIndex(k))
-		}
-		for _, k := range both {
-			w := w.relabel(fmt.Sprintf("[%#v]", k.Interface()))
-			w.diff(av.MapIndex(k), bv.MapIndex(k))
-		}
-		for _, k := range bk {
-			w := w.relabel(fmt.Sprintf("[%#v]", k.Interface()))
-			w.printf("(missing) != %q", bv.MapIndex(k))
-		}
-	case reflect.Interface:
-		w.diff(reflect.ValueOf(av.Interface()), reflect.ValueOf(bv.Interface()))
-	default:
-		if !reflect.DeepEqual(av.Interface(), bv.Interface()) {
-			w.printf("%# v != %# v", Formatter(av.Interface()), Formatter(bv.Interface()))
-		}
-	}
-}
-
-func (d diffWriter) relabel(name string) (d1 diffWriter) {
-	d1 = d
-	if d.l != "" && name[0] != '[' {
-		d1.l += "."
-	}
-	d1.l += name
-	return d1
-}
-
-func keyDiff(a, b []reflect.Value) (ak, both, bk []reflect.Value) {
-	for _, av := range a {
-		inBoth := false
-		for _, bv := range b {
-			if reflect.DeepEqual(av.Interface(), bv.Interface()) {
-				inBoth = true
-				both = append(both, av)
-				break
-			}
-		}
-		if !inBoth {
-			ak = append(ak, av)
-		}
-	}
-	for _, bv := range b {
-		inBoth := false
-		for _, av := range a {
-			if reflect.DeepEqual(av.Interface(), bv.Interface()) {
-				inBoth = true
-				break
-			}
-		}
-		if !inBoth {
-			bk = append(bk, bv)
-		}
-	}
-	return
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/pretty/diff_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/pretty/diff_test.go b/Godeps/_workspace/src/github.com/kr/pretty/diff_test.go
deleted file mode 100644
index 3c388f1..0000000
--- a/Godeps/_workspace/src/github.com/kr/pretty/diff_test.go
+++ /dev/null
@@ -1,74 +0,0 @@
-package pretty
-
-import (
-	"testing"
-)
-
-type difftest struct {
-	a   interface{}
-	b   interface{}
-	exp []string
-}
-
-type S struct {
-	A int
-	S *S
-	I interface{}
-	C []int
-}
-
-var diffs = []difftest{
-	{a: nil, b: nil},
-	{a: S{A: 1}, b: S{A: 1}},
-
-	{0, "", []string{`int != string`}},
-	{0, 1, []string{`0 != 1`}},
-	{S{}, new(S), []string{`pretty.S != *pretty.S`}},
-	{"a", "b", []string{`"a" != "b"`}},
-	{S{}, S{A: 1}, []string{`A: 0 != 1`}},
-	{new(S), &S{A: 1}, []string{`A: 0 != 1`}},
-	{S{S: new(S)}, S{S: &S{A: 1}}, []string{`S.A: 0 != 1`}},
-	{S{}, S{I: 0}, []string{`I: nil != 0`}},
-	{S{I: 1}, S{I: "x"}, []string{`I: int != string`}},
-	{S{}, S{C: []int{1}}, []string{`C: []int[0] != []int[1]`}},
-	{S{C: []int{}}, S{C: []int{1}}, []string{`C: []int[0] != []int[1]`}},
-	{S{C: []int{1, 2, 3}}, S{C: []int{1, 2, 4}}, []string{`C[2]: 3 != 4`}},
-	{S{}, S{A: 1, S: new(S)}, []string{`A: 0 != 1`, `S: nil != &{0 <nil> <nil> []}`}},
-}
-
-func TestDiff(t *testing.T) {
-	for _, tt := range diffs {
-		got := Diff(tt.a, tt.b)
-		eq := len(got) == len(tt.exp)
-		if eq {
-			for i := range got {
-				eq = eq && got[i] == tt.exp[i]
-			}
-		}
-		if !eq {
-			t.Errorf("diffing % #v", tt.a)
-			t.Errorf("with    % #v", tt.b)
-			diffdiff(t, got, tt.exp)
-			continue
-		}
-	}
-}
-
-func diffdiff(t *testing.T, got, exp []string) {
-	minus(t, "unexpected:", got, exp)
-	minus(t, "missing:", exp, got)
-}
-
-func minus(t *testing.T, s string, a, b []string) {
-	var i, j int
-	for i = 0; i < len(a); i++ {
-		for j = 0; j < len(b); j++ {
-			if a[i] == b[j] {
-				break
-			}
-		}
-		if j == len(b) {
-			t.Error(s, a[i])
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/pretty/example_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/pretty/example_test.go b/Godeps/_workspace/src/github.com/kr/pretty/example_test.go
deleted file mode 100644
index ecf40f3..0000000
--- a/Godeps/_workspace/src/github.com/kr/pretty/example_test.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package pretty_test
-
-import (
-	"fmt"
-	"github.com/kr/pretty"
-)
-
-func Example() {
-	type myType struct {
-		a, b int
-	}
-	var x = []myType{{1, 2}, {3, 4}, {5, 6}}
-	fmt.Printf("%# v", pretty.Formatter(x))
-	// output:
-	// []pretty_test.myType{
-	//     {a:1, b:2},
-	//     {a:3, b:4},
-	//     {a:5, b:6},
-	// }
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/pretty/formatter.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/pretty/formatter.go b/Godeps/_workspace/src/github.com/kr/pretty/formatter.go
deleted file mode 100644
index 8dacda2..0000000
--- a/Godeps/_workspace/src/github.com/kr/pretty/formatter.go
+++ /dev/null
@@ -1,337 +0,0 @@
-package pretty
-
-import (
-	"fmt"
-	"io"
-	"reflect"
-	"strconv"
-	"text/tabwriter"
-
-	"github.com/kr/text"
-)
-
-const (
-	limit = 50
-)
-
-type formatter struct {
-	x     interface{}
-	force bool
-	quote bool
-}
-
-// Formatter makes a wrapper, f, that will format x as go source with line
-// breaks and tabs. Object f responds to the "%v" formatting verb when both the
-// "#" and " " (space) flags are set, for example:
-//
-//     fmt.Sprintf("%# v", Formatter(x))
-//
-// If one of these two flags is not set, or any other verb is used, f will
-// format x according to the usual rules of package fmt.
-// In particular, if x satisfies fmt.Formatter, then x.Format will be called.
-func Formatter(x interface{}) (f fmt.Formatter) {
-	return formatter{x: x, quote: true}
-}
-
-func (fo formatter) String() string {
-	return fmt.Sprint(fo.x) // unwrap it
-}
-
-func (fo formatter) passThrough(f fmt.State, c rune) {
-	s := "%"
-	for i := 0; i < 128; i++ {
-		if f.Flag(i) {
-			s += string(i)
-		}
-	}
-	if w, ok := f.Width(); ok {
-		s += fmt.Sprintf("%d", w)
-	}
-	if p, ok := f.Precision(); ok {
-		s += fmt.Sprintf(".%d", p)
-	}
-	s += string(c)
-	fmt.Fprintf(f, s, fo.x)
-}
-
-func (fo formatter) Format(f fmt.State, c rune) {
-	if fo.force || c == 'v' && f.Flag('#') && f.Flag(' ') {
-		w := tabwriter.NewWriter(f, 4, 4, 1, ' ', 0)
-		p := &printer{tw: w, Writer: w, visited: make(map[visit]int)}
-		p.printValue(reflect.ValueOf(fo.x), true, fo.quote)
-		w.Flush()
-		return
-	}
-	fo.passThrough(f, c)
-}
-
-type printer struct {
-	io.Writer
-	tw      *tabwriter.Writer
-	visited map[visit]int
-	depth   int
-}
-
-func (p *printer) indent() *printer {
-	q := *p
-	q.tw = tabwriter.NewWriter(p.Writer, 4, 4, 1, ' ', 0)
-	q.Writer = text.NewIndentWriter(q.tw, []byte{'\t'})
-	return &q
-}
-
-func (p *printer) printInline(v reflect.Value, x interface{}, showType bool) {
-	if showType {
-		io.WriteString(p, v.Type().String())
-		fmt.Fprintf(p, "(%#v)", x)
-	} else {
-		fmt.Fprintf(p, "%#v", x)
-	}
-}
-
-// printValue must keep track of already-printed pointer values to avoid
-// infinite recursion.
-type visit struct {
-	v   uintptr
-	typ reflect.Type
-}
-
-func (p *printer) printValue(v reflect.Value, showType, quote bool) {
-	if p.depth > 10 {
-		io.WriteString(p, "!%v(DEPTH EXCEEDED)")
-		return
-	}
-
-	switch v.Kind() {
-	case reflect.Bool:
-		p.printInline(v, v.Bool(), showType)
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		p.printInline(v, v.Int(), showType)
-	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
-		p.printInline(v, v.Uint(), showType)
-	case reflect.Float32, reflect.Float64:
-		p.printInline(v, v.Float(), showType)
-	case reflect.Complex64, reflect.Complex128:
-		fmt.Fprintf(p, "%#v", v.Complex())
-	case reflect.String:
-		p.fmtString(v.String(), quote)
-	case reflect.Map:
-		t := v.Type()
-		if showType {
-			io.WriteString(p, t.String())
-		}
-		writeByte(p, '{')
-		if nonzero(v) {
-			expand := !canInline(v.Type())
-			pp := p
-			if expand {
-				writeByte(p, '\n')
-				pp = p.indent()
-			}
-			keys := v.MapKeys()
-			for i := 0; i < v.Len(); i++ {
-				showTypeInStruct := true
-				k := keys[i]
-				mv := v.MapIndex(k)
-				pp.printValue(k, false, true)
-				writeByte(pp, ':')
-				if expand {
-					writeByte(pp, '\t')
-				}
-				showTypeInStruct = t.Elem().Kind() == reflect.Interface
-				pp.printValue(mv, showTypeInStruct, true)
-				if expand {
-					io.WriteString(pp, ",\n")
-				} else if i < v.Len()-1 {
-					io.WriteString(pp, ", ")
-				}
-			}
-			if expand {
-				pp.tw.Flush()
-			}
-		}
-		writeByte(p, '}')
-	case reflect.Struct:
-		t := v.Type()
-		if v.CanAddr() {
-			addr := v.UnsafeAddr()
-			vis := visit{addr, t}
-			if vd, ok := p.visited[vis]; ok && vd < p.depth {
-				p.fmtString(t.String()+"{(CYCLIC REFERENCE)}", false)
-				break // don't print v again
-			}
-			p.visited[vis] = p.depth
-		}
-
-		if showType {
-			io.WriteString(p, t.String())
-		}
-		writeByte(p, '{')
-		if nonzero(v) {
-			expand := !canInline(v.Type())
-			pp := p
-			if expand {
-				writeByte(p, '\n')
-				pp = p.indent()
-			}
-			for i := 0; i < v.NumField(); i++ {
-				showTypeInStruct := true
-				if f := t.Field(i); f.Name != "" {
-					io.WriteString(pp, f.Name)
-					writeByte(pp, ':')
-					if expand {
-						writeByte(pp, '\t')
-					}
-					showTypeInStruct = labelType(f.Type)
-				}
-				pp.printValue(getField(v, i), showTypeInStruct, true)
-				if expand {
-					io.WriteString(pp, ",\n")
-				} else if i < v.NumField()-1 {
-					io.WriteString(pp, ", ")
-				}
-			}
-			if expand {
-				pp.tw.Flush()
-			}
-		}
-		writeByte(p, '}')
-	case reflect.Interface:
-		switch e := v.Elem(); {
-		case e.Kind() == reflect.Invalid:
-			io.WriteString(p, "nil")
-		case e.IsValid():
-			pp := *p
-			pp.depth++
-			pp.printValue(e, showType, true)
-		default:
-			io.WriteString(p, v.Type().String())
-			io.WriteString(p, "(nil)")
-		}
-	case reflect.Array, reflect.Slice:
-		t := v.Type()
-		if showType {
-			io.WriteString(p, t.String())
-		}
-		if v.Kind() == reflect.Slice && v.IsNil() && showType {
-			io.WriteString(p, "(nil)")
-			break
-		}
-		if v.Kind() == reflect.Slice && v.IsNil() {
-			io.WriteString(p, "nil")
-			break
-		}
-		writeByte(p, '{')
-		expand := !canInline(v.Type())
-		pp := p
-		if expand {
-			writeByte(p, '\n')
-			pp = p.indent()
-		}
-		for i := 0; i < v.Len(); i++ {
-			showTypeInSlice := t.Elem().Kind() == reflect.Interface
-			pp.printValue(v.Index(i), showTypeInSlice, true)
-			if expand {
-				io.WriteString(pp, ",\n")
-			} else if i < v.Len()-1 {
-				io.WriteString(pp, ", ")
-			}
-		}
-		if expand {
-			pp.tw.Flush()
-		}
-		writeByte(p, '}')
-	case reflect.Ptr:
-		e := v.Elem()
-		if !e.IsValid() {
-			writeByte(p, '(')
-			io.WriteString(p, v.Type().String())
-			io.WriteString(p, ")(nil)")
-		} else {
-			pp := *p
-			pp.depth++
-			writeByte(pp, '&')
-			pp.printValue(e, true, true)
-		}
-	case reflect.Chan:
-		x := v.Pointer()
-		if showType {
-			writeByte(p, '(')
-			io.WriteString(p, v.Type().String())
-			fmt.Fprintf(p, ")(%#v)", x)
-		} else {
-			fmt.Fprintf(p, "%#v", x)
-		}
-	case reflect.Func:
-		io.WriteString(p, v.Type().String())
-		io.WriteString(p, " {...}")
-	case reflect.UnsafePointer:
-		p.printInline(v, v.Pointer(), showType)
-	case reflect.Invalid:
-		io.WriteString(p, "nil")
-	}
-}
-
-func canInline(t reflect.Type) bool {
-	switch t.Kind() {
-	case reflect.Map:
-		return !canExpand(t.Elem())
-	case reflect.Struct:
-		for i := 0; i < t.NumField(); i++ {
-			if canExpand(t.Field(i).Type) {
-				return false
-			}
-		}
-		return true
-	case reflect.Interface:
-		return false
-	case reflect.Array, reflect.Slice:
-		return !canExpand(t.Elem())
-	case reflect.Ptr:
-		return false
-	case reflect.Chan, reflect.Func, reflect.UnsafePointer:
-		return false
-	}
-	return true
-}
-
-func canExpand(t reflect.Type) bool {
-	switch t.Kind() {
-	case reflect.Map, reflect.Struct,
-		reflect.Interface, reflect.Array, reflect.Slice,
-		reflect.Ptr:
-		return true
-	}
-	return false
-}
-
-func labelType(t reflect.Type) bool {
-	switch t.Kind() {
-	case reflect.Interface, reflect.Struct:
-		return true
-	}
-	return false
-}
-
-func (p *printer) fmtString(s string, quote bool) {
-	if quote {
-		s = strconv.Quote(s)
-	}
-	io.WriteString(p, s)
-}
-
-func tryDeepEqual(a, b interface{}) bool {
-	defer func() { recover() }()
-	return reflect.DeepEqual(a, b)
-}
-
-func writeByte(w io.Writer, b byte) {
-	w.Write([]byte{b})
-}
-
-func getField(v reflect.Value, i int) reflect.Value {
-	val := v.Field(i)
-	if val.Kind() == reflect.Interface && !val.IsNil() {
-		val = val.Elem()
-	}
-	return val
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/pretty/formatter_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/pretty/formatter_test.go b/Godeps/_workspace/src/github.com/kr/pretty/formatter_test.go
deleted file mode 100644
index 5f3204e..0000000
--- a/Godeps/_workspace/src/github.com/kr/pretty/formatter_test.go
+++ /dev/null
@@ -1,261 +0,0 @@
-package pretty
-
-import (
-	"fmt"
-	"io"
-	"strings"
-	"testing"
-	"unsafe"
-)
-
-type test struct {
-	v interface{}
-	s string
-}
-
-type LongStructTypeName struct {
-	longFieldName      interface{}
-	otherLongFieldName interface{}
-}
-
-type SA struct {
-	t *T
-	v T
-}
-
-type T struct {
-	x, y int
-}
-
-type F int
-
-func (f F) Format(s fmt.State, c rune) {
-	fmt.Fprintf(s, "F(%d)", int(f))
-}
-
-var long = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-
-var gosyntax = []test{
-	{nil, `nil`},
-	{"", `""`},
-	{"a", `"a"`},
-	{1, "int(1)"},
-	{1.0, "float64(1)"},
-	{[]int(nil), "[]int(nil)"},
-	{[0]int{}, "[0]int{}"},
-	{complex(1, 0), "(1+0i)"},
-	//{make(chan int), "(chan int)(0x1234)"},
-	{unsafe.Pointer(uintptr(unsafe.Pointer(&long))), fmt.Sprintf("unsafe.Pointer(0x%02x)", uintptr(unsafe.Pointer(&long)))},
-	{func(int) {}, "func(int) {...}"},
-	{map[int]int{1: 1}, "map[int]int{1:1}"},
-	{int32(1), "int32(1)"},
-	{io.EOF, `&errors.errorString{s:"EOF"}`},
-	{[]string{"a"}, `[]string{"a"}`},
-	{
-		[]string{long},
-		`[]string{"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"}`,
-	},
-	{F(5), "pretty.F(5)"},
-	{
-		SA{&T{1, 2}, T{3, 4}},
-		`pretty.SA{
-    t:  &pretty.T{x:1, y:2},
-    v:  pretty.T{x:3, y:4},
-}`,
-	},
-	{
-		map[int][]byte{1: {}},
-		`map[int][]uint8{
-    1:  {},
-}`,
-	},
-	{
-		map[int]T{1: {}},
-		`map[int]pretty.T{
-    1:  {},
-}`,
-	},
-	{
-		long,
-		`"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"`,
-	},
-	{
-		LongStructTypeName{
-			longFieldName:      LongStructTypeName{},
-			otherLongFieldName: long,
-		},
-		`pretty.LongStructTypeName{
-    longFieldName:      pretty.LongStructTypeName{},
-    otherLongFieldName: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
-}`,
-	},
-	{
-		&LongStructTypeName{
-			longFieldName:      &LongStructTypeName{},
-			otherLongFieldName: (*LongStructTypeName)(nil),
-		},
-		`&pretty.LongStructTypeName{
-    longFieldName:      &pretty.LongStructTypeName{},
-    otherLongFieldName: (*pretty.LongStructTypeName)(nil),
-}`,
-	},
-	{
-		[]LongStructTypeName{
-			{nil, nil},
-			{3, 3},
-			{long, nil},
-		},
-		`[]pretty.LongStructTypeName{
-    {},
-    {
-        longFieldName:      int(3),
-        otherLongFieldName: int(3),
-    },
-    {
-        longFieldName:      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
-        otherLongFieldName: nil,
-    },
-}`,
-	},
-	{
-		[]interface{}{
-			LongStructTypeName{nil, nil},
-			[]byte{1, 2, 3},
-			T{3, 4},
-			LongStructTypeName{long, nil},
-		},
-		`[]interface {}{
-    pretty.LongStructTypeName{},
-    []uint8{0x1, 0x2, 0x3},
-    pretty.T{x:3, y:4},
-    pretty.LongStructTypeName{
-        longFieldName:      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
-        otherLongFieldName: nil,
-    },
-}`,
-	},
-}
-
-func TestGoSyntax(t *testing.T) {
-	for _, tt := range gosyntax {
-		s := fmt.Sprintf("%# v", Formatter(tt.v))
-		if tt.s != s {
-			t.Errorf("expected %q", tt.s)
-			t.Errorf("got      %q", s)
-			t.Errorf("expraw\n%s", tt.s)
-			t.Errorf("gotraw\n%s", s)
-		}
-	}
-}
-
-type I struct {
-	i int
-	R interface{}
-}
-
-func (i *I) I() *I { return i.R.(*I) }
-
-func TestCycle(t *testing.T) {
-	type A struct{ *A }
-	v := &A{}
-	v.A = v
-
-	// panics from stack overflow without cycle detection
-	t.Logf("Example cycle:\n%# v", Formatter(v))
-
-	p := &A{}
-	s := fmt.Sprintf("%# v", Formatter([]*A{p, p}))
-	if strings.Contains(s, "CYCLIC") {
-		t.Errorf("Repeated address detected as cyclic reference:\n%s", s)
-	}
-
-	type R struct {
-		i int
-		*R
-	}
-	r := &R{
-		i: 1,
-		R: &R{
-			i: 2,
-			R: &R{
-				i: 3,
-			},
-		},
-	}
-	r.R.R.R = r
-	t.Logf("Example longer cycle:\n%# v", Formatter(r))
-
-	r = &R{
-		i: 1,
-		R: &R{
-			i: 2,
-			R: &R{
-				i: 3,
-				R: &R{
-					i: 4,
-					R: &R{
-						i: 5,
-						R: &R{
-							i: 6,
-							R: &R{
-								i: 7,
-								R: &R{
-									i: 8,
-									R: &R{
-										i: 9,
-										R: &R{
-											i: 10,
-											R: &R{
-												i: 11,
-											},
-										},
-									},
-								},
-							},
-						},
-					},
-				},
-			},
-		},
-	}
-	// here be pirates
-	r.R.R.R.R.R.R.R.R.R.R.R = r
-	t.Logf("Example very long cycle:\n%# v", Formatter(r))
-
-	i := &I{
-		i: 1,
-		R: &I{
-			i: 2,
-			R: &I{
-				i: 3,
-				R: &I{
-					i: 4,
-					R: &I{
-						i: 5,
-						R: &I{
-							i: 6,
-							R: &I{
-								i: 7,
-								R: &I{
-									i: 8,
-									R: &I{
-										i: 9,
-										R: &I{
-											i: 10,
-											R: &I{
-												i: 11,
-											},
-										},
-									},
-								},
-							},
-						},
-					},
-				},
-			},
-		},
-	}
-	iv := i.I().I().I().I().I().I().I().I().I().I()
-	*iv = *i
-	t.Logf("Example long interface cycle:\n%# v", Formatter(i))
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/pretty/pretty.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/pretty/pretty.go b/Godeps/_workspace/src/github.com/kr/pretty/pretty.go
deleted file mode 100644
index d3df868..0000000
--- a/Godeps/_workspace/src/github.com/kr/pretty/pretty.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// Package pretty provides pretty-printing for Go values. This is
-// useful during debugging, to avoid wrapping long output lines in
-// the terminal.
-//
-// It provides a function, Formatter, that can be used with any
-// function that accepts a format string. It also provides
-// convenience wrappers for functions in packages fmt and log.
-package pretty
-
-import (
-	"fmt"
-	"io"
-	"log"
-)
-
-// Errorf is a convenience wrapper for fmt.Errorf.
-//
-// Calling Errorf(f, x, y) is equivalent to
-// fmt.Errorf(f, Formatter(x), Formatter(y)).
-func Errorf(format string, a ...interface{}) error {
-	return fmt.Errorf(format, wrap(a, false)...)
-}
-
-// Fprintf is a convenience wrapper for fmt.Fprintf.
-//
-// Calling Fprintf(w, f, x, y) is equivalent to
-// fmt.Fprintf(w, f, Formatter(x), Formatter(y)).
-func Fprintf(w io.Writer, format string, a ...interface{}) (n int, error error) {
-	return fmt.Fprintf(w, format, wrap(a, false)...)
-}
-
-// Log is a convenience wrapper for log.Printf.
-//
-// Calling Log(x, y) is equivalent to
-// log.Print(Formatter(x), Formatter(y)), but each operand is
-// formatted with "%# v".
-func Log(a ...interface{}) {
-	log.Print(wrap(a, true)...)
-}
-
-// Logf is a convenience wrapper for log.Printf.
-//
-// Calling Logf(f, x, y) is equivalent to
-// log.Printf(f, Formatter(x), Formatter(y)).
-func Logf(format string, a ...interface{}) {
-	log.Printf(format, wrap(a, false)...)
-}
-
-// Logln is a convenience wrapper for log.Printf.
-//
-// Calling Logln(x, y) is equivalent to
-// log.Println(Formatter(x), Formatter(y)), but each operand is
-// formatted with "%# v".
-func Logln(a ...interface{}) {
-	log.Println(wrap(a, true)...)
-}
-
-// Print pretty-prints its operands and writes to standard output.
-//
-// Calling Print(x, y) is equivalent to
-// fmt.Print(Formatter(x), Formatter(y)), but each operand is
-// formatted with "%# v".
-func Print(a ...interface{}) (n int, errno error) {
-	return fmt.Print(wrap(a, true)...)
-}
-
-// Printf is a convenience wrapper for fmt.Printf.
-//
-// Calling Printf(f, x, y) is equivalent to
-// fmt.Printf(f, Formatter(x), Formatter(y)).
-func Printf(format string, a ...interface{}) (n int, errno error) {
-	return fmt.Printf(format, wrap(a, false)...)
-}
-
-// Println pretty-prints its operands and writes to standard output.
-//
-// Calling Print(x, y) is equivalent to
-// fmt.Println(Formatter(x), Formatter(y)), but each operand is
-// formatted with "%# v".
-func Println(a ...interface{}) (n int, errno error) {
-	return fmt.Println(wrap(a, true)...)
-}
-
-// Sprintf is a convenience wrapper for fmt.Sprintf.
-//
-// Calling Sprintf(f, x, y) is equivalent to
-// fmt.Sprintf(f, Formatter(x), Formatter(y)).
-func Sprintf(format string, a ...interface{}) string {
-	return fmt.Sprintf(format, wrap(a, false)...)
-}
-
-func wrap(a []interface{}, force bool) []interface{} {
-	w := make([]interface{}, len(a))
-	for i, x := range a {
-		w[i] = formatter{x: x, force: force}
-	}
-	return w
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/pretty/zero.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/pretty/zero.go b/Godeps/_workspace/src/github.com/kr/pretty/zero.go
deleted file mode 100644
index abb5b6f..0000000
--- a/Godeps/_workspace/src/github.com/kr/pretty/zero.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package pretty
-
-import (
-	"reflect"
-)
-
-func nonzero(v reflect.Value) bool {
-	switch v.Kind() {
-	case reflect.Bool:
-		return v.Bool()
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		return v.Int() != 0
-	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
-		return v.Uint() != 0
-	case reflect.Float32, reflect.Float64:
-		return v.Float() != 0
-	case reflect.Complex64, reflect.Complex128:
-		return v.Complex() != complex(0, 0)
-	case reflect.String:
-		return v.String() != ""
-	case reflect.Struct:
-		for i := 0; i < v.NumField(); i++ {
-			if nonzero(getField(v, i)) {
-				return true
-			}
-		}
-		return false
-	case reflect.Array:
-		for i := 0; i < v.Len(); i++ {
-			if nonzero(v.Index(i)) {
-				return true
-			}
-		}
-		return false
-	case reflect.Map, reflect.Interface, reflect.Slice, reflect.Ptr, reflect.Chan, reflect.Func:
-		return !v.IsNil()
-	case reflect.UnsafePointer:
-		return v.Pointer() != 0
-	}
-	return true
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/License
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/License b/Godeps/_workspace/src/github.com/kr/text/License
deleted file mode 100644
index 480a328..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/License
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright 2012 Keith Rarick
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/Readme
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/Readme b/Godeps/_workspace/src/github.com/kr/text/Readme
deleted file mode 100644
index 7e6e7c0..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/Readme
+++ /dev/null
@@ -1,3 +0,0 @@
-This is a Go package for manipulating paragraphs of text.
-
-See http://go.pkgdoc.org/github.com/kr/text for full documentation.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/colwriter/Readme
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/colwriter/Readme b/Godeps/_workspace/src/github.com/kr/text/colwriter/Readme
deleted file mode 100644
index 1c1f4e6..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/colwriter/Readme
+++ /dev/null
@@ -1,5 +0,0 @@
-Package colwriter provides a write filter that formats
-input lines in multiple columns.
-
-The package is a straightforward translation from
-/src/cmd/draw/mc.c in Plan 9 from User Space.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/colwriter/column.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/colwriter/column.go b/Godeps/_workspace/src/github.com/kr/text/colwriter/column.go
deleted file mode 100644
index 7302ce9..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/colwriter/column.go
+++ /dev/null
@@ -1,147 +0,0 @@
-// Package colwriter provides a write filter that formats
-// input lines in multiple columns.
-//
-// The package is a straightforward translation from
-// /src/cmd/draw/mc.c in Plan 9 from User Space.
-package colwriter
-
-import (
-	"bytes"
-	"io"
-	"unicode/utf8"
-)
-
-const (
-	tab = 4
-)
-
-const (
-	// Print each input line ending in a colon ':' separately.
-	BreakOnColon uint = 1 << iota
-)
-
-// A Writer is a filter that arranges input lines in as many columns as will
-// fit in its width. Tab '\t' chars in the input are translated to sequences
-// of spaces ending at multiples of 4 positions.
-//
-// If BreakOnColon is set, each input line ending in a colon ':' is written
-// separately.
-//
-// The Writer assumes that all Unicode code points have the same width; this
-// may not be true in some fonts.
-type Writer struct {
-	w     io.Writer
-	buf   []byte
-	width int
-	flag  uint
-}
-
-// NewWriter allocates and initializes a new Writer writing to w.
-// Parameter width controls the total number of characters on each line
-// across all columns.
-func NewWriter(w io.Writer, width int, flag uint) *Writer {
-	return &Writer{
-		w:     w,
-		width: width,
-		flag:  flag,
-	}
-}
-
-// Write writes p to the writer w. The only errors returned are ones
-// encountered while writing to the underlying output stream.
-func (w *Writer) Write(p []byte) (n int, err error) {
-	var linelen int
-	var lastWasColon bool
-	for i, c := range p {
-		w.buf = append(w.buf, c)
-		linelen++
-		if c == '\t' {
-			w.buf[len(w.buf)-1] = ' '
-			for linelen%tab != 0 {
-				w.buf = append(w.buf, ' ')
-				linelen++
-			}
-		}
-		if w.flag&BreakOnColon != 0 && c == ':' {
-			lastWasColon = true
-		} else if lastWasColon {
-			if c == '\n' {
-				pos := bytes.LastIndex(w.buf[:len(w.buf)-1], []byte{'\n'})
-				if pos < 0 {
-					pos = 0
-				}
-				line := w.buf[pos:]
-				w.buf = w.buf[:pos]
-				if err = w.columnate(); err != nil {
-					if len(line) < i {
-						return i - len(line), err
-					}
-					return 0, err
-				}
-				if n, err := w.w.Write(line); err != nil {
-					if r := len(line) - n; r < i {
-						return i - r, err
-					}
-					return 0, err
-				}
-			}
-			lastWasColon = false
-		}
-		if c == '\n' {
-			linelen = 0
-		}
-	}
-	return len(p), nil
-}
-
-// Flush should be called after the last call to Write to ensure that any data
-// buffered in the Writer is written to output.
-func (w *Writer) Flush() error {
-	return w.columnate()
-}
-
-func (w *Writer) columnate() error {
-	words := bytes.Split(w.buf, []byte{'\n'})
-	w.buf = nil
-	if len(words[len(words)-1]) == 0 {
-		words = words[:len(words)-1]
-	}
-	maxwidth := 0
-	for _, wd := range words {
-		if n := utf8.RuneCount(wd); n > maxwidth {
-			maxwidth = n
-		}
-	}
-	maxwidth++ // space char
-	wordsPerLine := w.width / maxwidth
-	if wordsPerLine <= 0 {
-		wordsPerLine = 1
-	}
-	nlines := (len(words) + wordsPerLine - 1) / wordsPerLine
-	for i := 0; i < nlines; i++ {
-		col := 0
-		endcol := 0
-		for j := i; j < len(words); j += nlines {
-			endcol += maxwidth
-			_, err := w.w.Write(words[j])
-			if err != nil {
-				return err
-			}
-			col += utf8.RuneCount(words[j])
-			if j+nlines < len(words) {
-				for col < endcol {
-					_, err := w.w.Write([]byte{' '})
-					if err != nil {
-						return err
-					}
-					col++
-				}
-			}
-		}
-		_, err := w.w.Write([]byte{'\n'})
-		if err != nil {
-			return err
-		}
-	}
-	return nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/colwriter/column_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/colwriter/column_test.go b/Godeps/_workspace/src/github.com/kr/text/colwriter/column_test.go
deleted file mode 100644
index ce388f5..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/colwriter/column_test.go
+++ /dev/null
@@ -1,90 +0,0 @@
-package colwriter
-
-import (
-	"bytes"
-	"testing"
-)
-
-var src = `
-.git
-.gitignore
-.godir
-Procfile:
-README.md
-api.go
-apps.go
-auth.go
-darwin.go
-data.go
-dyno.go:
-env.go
-git.go
-help.go
-hkdist
-linux.go
-ls.go
-main.go
-plugin.go
-run.go
-scale.go
-ssh.go
-tail.go
-term
-unix.go
-update.go
-version.go
-windows.go
-`[1:]
-
-var tests = []struct {
-	wid  int
-	flag uint
-	src  string
-	want string
-}{
-	{80, 0, "", ""},
-	{80, 0, src, `
-.git       README.md  darwin.go  git.go     ls.go      scale.go   unix.go
-.gitignore api.go     data.go    help.go    main.go    ssh.go     update.go
-.godir     apps.go    dyno.go:   hkdist     plugin.go  tail.go    version.go
-Procfile:  auth.go    env.go     linux.go   run.go     term       windows.go
-`[1:]},
-	{80, BreakOnColon, src, `
-.git       .gitignore .godir
-
-Procfile:
-README.md api.go    apps.go   auth.go   darwin.go data.go
-
-dyno.go:
-env.go     hkdist     main.go    scale.go   term       version.go
-git.go     linux.go   plugin.go  ssh.go     unix.go    windows.go
-help.go    ls.go      run.go     tail.go    update.go
-`[1:]},
-	{20, 0, `
-Hello
-Γειά σου
-안녕
-今日は
-`[1:], `
-Hello    안녕
-Γειά σου 今日は
-`[1:]},
-}
-
-func TestWriter(t *testing.T) {
-	for _, test := range tests {
-		b := new(bytes.Buffer)
-		w := NewWriter(b, test.wid, test.flag)
-		if _, err := w.Write([]byte(test.src)); err != nil {
-			t.Error(err)
-		}
-		if err := w.Flush(); err != nil {
-			t.Error(err)
-		}
-		if g := b.String(); test.want != g {
-			t.Log("\n" + test.want)
-			t.Log("\n" + g)
-			t.Errorf("%q != %q", test.want, g)
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/doc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/doc.go b/Godeps/_workspace/src/github.com/kr/text/doc.go
deleted file mode 100644
index cf4c198..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/doc.go
+++ /dev/null
@@ -1,3 +0,0 @@
-// Package text provides rudimentary functions for manipulating text in
-// paragraphs.
-package text

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/indent.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/indent.go b/Godeps/_workspace/src/github.com/kr/text/indent.go
deleted file mode 100644
index 4ebac45..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/indent.go
+++ /dev/null
@@ -1,74 +0,0 @@
-package text
-
-import (
-	"io"
-)
-
-// Indent inserts prefix at the beginning of each non-empty line of s. The
-// end-of-line marker is NL.
-func Indent(s, prefix string) string {
-	return string(IndentBytes([]byte(s), []byte(prefix)))
-}
-
-// IndentBytes inserts prefix at the beginning of each non-empty line of b.
-// The end-of-line marker is NL.
-func IndentBytes(b, prefix []byte) []byte {
-	var res []byte
-	bol := true
-	for _, c := range b {
-		if bol && c != '\n' {
-			res = append(res, prefix...)
-		}
-		res = append(res, c)
-		bol = c == '\n'
-	}
-	return res
-}
-
-// Writer indents each line of its input.
-type indentWriter struct {
-	w   io.Writer
-	bol bool
-	pre [][]byte
-	sel int
-	off int
-}
-
-// NewIndentWriter makes a new write filter that indents the input
-// lines. Each line is prefixed in order with the corresponding
-// element of pre. If there are more lines than elements, the last
-// element of pre is repeated for each subsequent line.
-func NewIndentWriter(w io.Writer, pre ...[]byte) io.Writer {
-	return &indentWriter{
-		w:   w,
-		pre: pre,
-		bol: true,
-	}
-}
-
-// The only errors returned are from the underlying indentWriter.
-func (w *indentWriter) Write(p []byte) (n int, err error) {
-	for _, c := range p {
-		if w.bol {
-			var i int
-			i, err = w.w.Write(w.pre[w.sel][w.off:])
-			w.off += i
-			if err != nil {
-				return n, err
-			}
-		}
-		_, err = w.w.Write([]byte{c})
-		if err != nil {
-			return n, err
-		}
-		n++
-		w.bol = c == '\n'
-		if w.bol {
-			w.off = 0
-			if w.sel < len(w.pre)-1 {
-				w.sel++
-			}
-		}
-	}
-	return n, nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/indent_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/indent_test.go b/Godeps/_workspace/src/github.com/kr/text/indent_test.go
deleted file mode 100644
index 5c723ee..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/indent_test.go
+++ /dev/null
@@ -1,119 +0,0 @@
-package text
-
-import (
-	"bytes"
-	"testing"
-)
-
-type T struct {
-	inp, exp, pre string
-}
-
-var tests = []T{
-	{
-		"The quick brown fox\njumps over the lazy\ndog.\nBut not quickly.\n",
-		"xxxThe quick brown fox\nxxxjumps over the lazy\nxxxdog.\nxxxBut not quickly.\n",
-		"xxx",
-	},
-	{
-		"The quick brown fox\njumps over the lazy\ndog.\n\nBut not quickly.",
-		"xxxThe quick brown fox\nxxxjumps over the lazy\nxxxdog.\n\nxxxBut not quickly.",
-		"xxx",
-	},
-}
-
-func TestIndent(t *testing.T) {
-	for _, test := range tests {
-		got := Indent(test.inp, test.pre)
-		if got != test.exp {
-			t.Errorf("mismatch %q != %q", got, test.exp)
-		}
-	}
-}
-
-type IndentWriterTest struct {
-	inp, exp string
-	pre      []string
-}
-
-var ts = []IndentWriterTest{
-	{
-		`
-The quick brown fox
-jumps over the lazy
-dog.
-But not quickly.
-`[1:],
-		`
-xxxThe quick brown fox
-xxxjumps over the lazy
-xxxdog.
-xxxBut not quickly.
-`[1:],
-		[]string{"xxx"},
-	},
-	{
-		`
-The quick brown fox
-jumps over the lazy
-dog.
-But not quickly.
-`[1:],
-		`
-xxaThe quick brown fox
-xxxjumps over the lazy
-xxxdog.
-xxxBut not quickly.
-`[1:],
-		[]string{"xxa", "xxx"},
-	},
-	{
-		`
-The quick brown fox
-jumps over the lazy
-dog.
-But not quickly.
-`[1:],
-		`
-xxaThe quick brown fox
-xxbjumps over the lazy
-xxcdog.
-xxxBut not quickly.
-`[1:],
-		[]string{"xxa", "xxb", "xxc", "xxx"},
-	},
-	{
-		`
-The quick brown fox
-jumps over the lazy
-dog.
-
-But not quickly.`[1:],
-		`
-xxaThe quick brown fox
-xxxjumps over the lazy
-xxxdog.
-xxx
-xxxBut not quickly.`[1:],
-		[]string{"xxa", "xxx"},
-	},
-}
-
-func TestIndentWriter(t *testing.T) {
-	for _, test := range ts {
-		b := new(bytes.Buffer)
-		pre := make([][]byte, len(test.pre))
-		for i := range test.pre {
-			pre[i] = []byte(test.pre[i])
-		}
-		w := NewIndentWriter(b, pre...)
-		if _, err := w.Write([]byte(test.inp)); err != nil {
-			t.Error(err)
-		}
-		if got := b.String(); got != test.exp {
-			t.Errorf("mismatch %q != %q", got, test.exp)
-			t.Log(got)
-			t.Log(test.exp)
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/mc/Readme
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/mc/Readme b/Godeps/_workspace/src/github.com/kr/text/mc/Readme
deleted file mode 100644
index 519ddc0..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/mc/Readme
+++ /dev/null
@@ -1,9 +0,0 @@
-Command mc prints in multiple columns.
-
-  Usage: mc [-] [-N] [file...]
-
-Mc splits the input into as many columns as will fit in N
-print positions. If the output is a tty, the default N is
-the number of characters in a terminal line; otherwise the
-default N is 80. Under option - each input line ending in
-a colon ':' is printed separately.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/mc/mc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/mc/mc.go b/Godeps/_workspace/src/github.com/kr/text/mc/mc.go
deleted file mode 100644
index 00169a3..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/mc/mc.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Command mc prints in multiple columns.
-//
-//   Usage: mc [-] [-N] [file...]
-//
-// Mc splits the input into as many columns as will fit in N
-// print positions. If the output is a tty, the default N is
-// the number of characters in a terminal line; otherwise the
-// default N is 80. Under option - each input line ending in
-// a colon ':' is printed separately.
-package main
-
-import (
-	"github.com/kr/pty"
-	"github.com/kr/text/colwriter"
-	"io"
-	"log"
-	"os"
-	"strconv"
-)
-
-func main() {
-	var width int
-	var flag uint
-	args := os.Args[1:]
-	for len(args) > 0 && len(args[0]) > 0 && args[0][0] == '-' {
-		if len(args[0]) > 1 {
-			width, _ = strconv.Atoi(args[0][1:])
-		} else {
-			flag |= colwriter.BreakOnColon
-		}
-		args = args[1:]
-	}
-	if width < 1 {
-		_, width, _ = pty.Getsize(os.Stdout)
-	}
-	if width < 1 {
-		width = 80
-	}
-
-	w := colwriter.NewWriter(os.Stdout, width, flag)
-	if len(args) > 0 {
-		for _, s := range args {
-			if f, err := os.Open(s); err == nil {
-				copyin(w, f)
-				f.Close()
-			} else {
-				log.Println(err)
-			}
-		}
-	} else {
-		copyin(w, os.Stdin)
-	}
-}
-
-func copyin(w *colwriter.Writer, r io.Reader) {
-	if _, err := io.Copy(w, r); err != nil {
-		log.Println(err)
-	}
-	if err := w.Flush(); err != nil {
-		log.Println(err)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/wrap.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/wrap.go b/Godeps/_workspace/src/github.com/kr/text/wrap.go
deleted file mode 100644
index 1c85cd2..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/wrap.go
+++ /dev/null
@@ -1,86 +0,0 @@
-package text
-
-import (
-	"bytes"
-	"math"
-)
-
-var (
-	nl = []byte{'\n'}
-	sp = []byte{' '}
-)
-
-const defaultPenalty = 1e5
-
-// Wrap wraps s into a paragraph of lines of length lim, with minimal
-// raggedness.
-func Wrap(s string, lim int) string {
-	return string(WrapBytes([]byte(s), lim))
-}
-
-// WrapBytes wraps b into a paragraph of lines of length lim, with minimal
-// raggedness.
-func WrapBytes(b []byte, lim int) []byte {
-	words := bytes.Split(bytes.Replace(bytes.TrimSpace(b), nl, sp, -1), sp)
-	var lines [][]byte
-	for _, line := range WrapWords(words, 1, lim, defaultPenalty) {
-		lines = append(lines, bytes.Join(line, sp))
-	}
-	return bytes.Join(lines, nl)
-}
-
-// WrapWords is the low-level line-breaking algorithm, useful if you need more
-// control over the details of the text wrapping process. For most uses, either
-// Wrap or WrapBytes will be sufficient and more convenient.
-//
-// WrapWords splits a list of words into lines with minimal "raggedness",
-// treating each byte as one unit, accounting for spc units between adjacent
-// words on each line, and attempting to limit lines to lim units. Raggedness
-// is the total error over all lines, where error is the square of the
-// difference of the length of the line and lim. Too-long lines (which only
-// happen when a single word is longer than lim units) have pen penalty units
-// added to the error.
-func WrapWords(words [][]byte, spc, lim, pen int) [][][]byte {
-	n := len(words)
-
-	length := make([][]int, n)
-	for i := 0; i < n; i++ {
-		length[i] = make([]int, n)
-		length[i][i] = len(words[i])
-		for j := i + 1; j < n; j++ {
-			length[i][j] = length[i][j-1] + spc + len(words[j])
-		}
-	}
-
-	nbrk := make([]int, n)
-	cost := make([]int, n)
-	for i := range cost {
-		cost[i] = math.MaxInt32
-	}
-	for i := n - 1; i >= 0; i-- {
-		if length[i][n-1] <= lim {
-			cost[i] = 0
-			nbrk[i] = n
-		} else {
-			for j := i + 1; j < n; j++ {
-				d := lim - length[i][j-1]
-				c := d*d + cost[j]
-				if length[i][j-1] > lim {
-					c += pen // too-long lines get a worse penalty
-				}
-				if c < cost[i] {
-					cost[i] = c
-					nbrk[i] = j
-				}
-			}
-		}
-	}
-
-	var lines [][][]byte
-	i := 0
-	for i < n {
-		lines = append(lines, words[i:nbrk[i]])
-		i = nbrk[i]
-	}
-	return lines
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/kr/text/wrap_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/kr/text/wrap_test.go b/Godeps/_workspace/src/github.com/kr/text/wrap_test.go
deleted file mode 100644
index 90f065c..0000000
--- a/Godeps/_workspace/src/github.com/kr/text/wrap_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package text
-
-import (
-	"bytes"
-	"testing"
-)
-
-var text = "The quick brown fox jumps over the lazy dog."
-
-func TestWrap(t *testing.T) {
-	exp := [][]string{
-		{"The", "quick", "brown", "fox"},
-		{"jumps", "over", "the", "lazy", "dog."},
-	}
-	words := bytes.Split([]byte(text), sp)
-	got := WrapWords(words, 1, 24, defaultPenalty)
-	if len(exp) != len(got) {
-		t.Fail()
-	}
-	for i := range exp {
-		if len(exp[i]) != len(got[i]) {
-			t.Fail()
-		}
-		for j := range exp[i] {
-			if exp[i][j] != string(got[i][j]) {
-				t.Fatal(i, exp[i][j], got[i][j])
-			}
-		}
-	}
-}
-
-func TestWrapNarrow(t *testing.T) {
-	exp := "The\nquick\nbrown\nfox\njumps\nover\nthe\nlazy\ndog."
-	if Wrap(text, 5) != exp {
-		t.Fail()
-	}
-}
-
-func TestWrapOneLine(t *testing.T) {
-	exp := "The quick brown fox jumps over the lazy dog."
-	if Wrap(text, 500) != exp {
-		t.Fail()
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore b/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore
deleted file mode 100644
index 0e379c5..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.sublime-project
-*.sublime-workspace

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml b/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml
deleted file mode 100644
index 407127c..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: go
-go:
-    - release
-install: go get gopkg.in/check.v1
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE b/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE
deleted file mode 100644
index 7eab43b..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE
+++ /dev/null
@@ -1,25 +0,0 @@
-goproperties - properties file decoder for Go
-
-Copyright (c) 2013-2014 - Frank Schroeder
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/README.md b/Godeps/_workspace/src/github.com/magiconair/properties/README.md
deleted file mode 100644
index d05d86b..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/README.md
+++ /dev/null
@@ -1,121 +0,0 @@
-Overview [![Build Status](https://travis-ci.org/magiconair/properties.png?branch=master)](https://travis-ci.org/magiconair/properties)
-========
-
-properties is a Go library for reading and writing properties files.
-
-It supports reading from multiple files and Spring style recursive property
-expansion of expressions like `${key}` to their corresponding value.
-Value expressions can refer to other keys like in `${key}` or to
-environment variables like in `${USER}`.
-Filenames can also contain environment variables like in
-`/home/${USER}/myapp.properties`.
-
-Comments and the order of keys are preserved. Comments can be modified
-and can be written to the output.
-
-The properties library supports both ISO-8859-1 and UTF-8 encoded data.
-
-Starting from version 1.3.0 the behavior of the MustXXX() functions is
-configurable by providing a custom `ErrorHandler` function. The default has
-changed from `panic` to `log.Fatal` but this is configurable and custom
-error handling functions can be provided. See the package documentation for
-details.
-
-Getting Started
----------------
-
-```go
-import "github.com/magiconair/properties"
-
-func main() {
-	p := properties.MustLoadFile("${HOME}/config.properties", properties.UTF8)
-	host := p.MustGetString("host")
-	port := p.GetInt("port", 8080)
-}
-
-```
-
-Read the full documentation on [GoDoc](https://godoc.org/github.com/magiconair/properties)   [![GoDoc](https://godoc.org/github.com/magiconair/properties?status.png)](https://godoc.org/github.com/magiconair/properties)
-
-Installation and Upgrade
-------------------------
-
-```
-$ go get -u github.com/magiconair/properties
-```
-
-For testing and debugging you need the [go-check](https://github.com/go-check/check) library
-
-```
-$ go get -u gopkg.in/check.v1
-```
-
-History
--------
-
-v1.5.3, 02 Jun 2015
--------------------
- * [Issue #4](https://github.com/magiconair/properties/issues/4): Maintain key order in [Filter()](http://godoc.org/github.com/magiconair/properties#Properties.Filter), [FilterPrefix()](http://godoc.org/github.com/magiconair/properties#Properties.FilterPrefix) and [FilterRegexp()](http://godoc.org/github.com/magiconair/properties#Properties.FilterRegexp)
-
-v1.5.2, 10 Apr 2015
--------------------
- * [Issue #3](https://github.com/magiconair/properties/issues/3): Don't print comments in [WriteComment()](http://godoc.org/github.com/magiconair/properties#Properties.WriteComment) if they are all empty
- * Add clickable links to README
-
-v1.5.1, 08 Dec 2014
--------------------
- * Added [GetParsedDuration()](http://godoc.org/github.com/magiconair/properties#Properties.GetParsedDuration) and [MustGetParsedDuration()](http://godoc.org/github.com/magiconair/properties#Properties.MustGetParsedDuration) for values specified compatible with
-   [time.ParseDuration()](http://golang.org/pkg/time/#ParseDuration).
-
-v1.5.0, 18 Nov 2014
--------------------
- * Added support for single and multi-line comments (reading, writing and updating)
- * The order of keys is now preserved
- * Calling [Set()](http://godoc.org/github.com/magiconair/properties#Properties.Set) with an empty key now silently ignores the call and does not create a new entry
- * Added a [MustSet()](http://godoc.org/github.com/magiconair/properties#Properties.MustSet) method
- * Migrated test library from launchpad.net/gocheck to [gopkg.in/check.v1](http://gopkg.in/check.v1)
-
-v1.4.2, 15 Nov 2014
--------------------
- * [Issue #2](https://github.com/magiconair/properties/issues/2): Fixed goroutine leak in parser which created two lexers but cleaned up only one
-
-v1.4.1, 13 Nov 2014
--------------------
- * [Issue #1](https://github.com/magiconair/properties/issues/1): Fixed bug in Keys() method which returned an empty string
-
-v1.4.0, 23 Sep 2014
--------------------
- * Added [Keys()](http://godoc.org/github.com/magiconair/properties#Properties.Keys) to get the keys
- * Added [Filter()](http://godoc.org/github.com/magiconair/properties#Properties.Filter), [FilterRegexp()](http://godoc.org/github.com/magiconair/properties#Properties.FilterRegexp) and [FilterPrefix()](http://godoc.org/github.com/magiconair/properties#Properties.FilterPrefix) to get a subset of the properties
-
-v1.3.0, 18 Mar 2014
--------------------
-* Added support for time.Duration
-* Made MustXXX() failure behavior configurable (log.Fatal, panic, custom)
-* Changed default of MustXXX() failure from panic to log.Fatal
-
-v1.2.0, 05 Mar 2014
--------------------
-* Added MustGet... functions
-* Added support for int and uint with range checks on 32 bit platforms
-
-v1.1.0, 20 Jan 2014
--------------------
-* Renamed from goproperties to properties
-* Added support for expansion of environment vars in
-  filenames and value expressions
-* Fixed bug where value expressions were not at the
-  start of the string
-
-v1.0.0, 7 Jan 2014
-------------------
-* Initial release
-
-License
--------
-
-2 clause BSD license. See [LICENSE](https://github.com/magiconair/properties/blob/master/LICENSE) file for details.
-
-ToDo
-----
-* Dump contents with passwords and secrets obscured

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go b/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go
deleted file mode 100644
index b2019e1..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2013-2014 Frank Schroeder. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package properties
-
-import (
-	"fmt"
-	"testing"
-)
-
-// Benchmarks the decoder by creating a property file with 1000 key/value pairs.
-func BenchmarkLoad(b *testing.B) {
-	input := ""
-	for i := 0; i < 1000; i++ {
-		input += fmt.Sprintf("key%d=value%d\n", i, i)
-	}
-	b.ResetTimer()
-	for i := 0; i < b.N; i++ {
-		Load([]byte(input), ISO_8859_1)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/doc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/doc.go b/Godeps/_workspace/src/github.com/magiconair/properties/doc.go
deleted file mode 100644
index 69cf2e8..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/doc.go
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright 2013-2014 Frank Schroeder. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package properties provides functions for reading and writing
-// ISO-8859-1 and UTF-8 encoded .properties files and has
-// support for recursive property expansion.
-//
-// Java properties files are ISO-8859-1 encoded and use Unicode
-// literals for characters outside the ISO character set. Unicode
-// literals can be used in UTF-8 encoded properties files but
-// aren't necessary.
-//
-// To load a single properties file use MustLoadFile():
-//
-//   p := properties.MustLoadFile(filename, properties.UTF8)
-//
-// To load multiple properties files use MustLoadFiles()
-// which loads the files in the given order and merges the
-// result. Missing properties files can be ignored if the
-// 'ignoreMissing' flag is set to true.
-//
-// Filenames can contain environment variables which are expanded
-// before loading.
-//
-//   f1 := "/etc/myapp/myapp.conf"
-//   f2 := "/home/${USER}/myapp.conf"
-//   p := MustLoadFiles([]string{f1, f2}, properties.UTF8, true)
-//
-// All of the different key/value delimiters ' ', ':' and '=' are
-// supported as well as the comment characters '!' and '#' and
-// multi-line values.
-//
-//   ! this is a comment
-//   # and so is this
-//
-//   # the following expressions are equal
-//   key value
-//   key=value
-//   key:value
-//   key = value
-//   key : value
-//   key = val\
-//         ue
-//
-// Properties stores all comments preceding a key and provides
-// GetComments() and SetComments() methods to retrieve and
-// update them. The convenience functions GetComment() and
-// SetComment() allow access to the last comment. The
-// WriteComment() method writes properties files including
-// the comments and with the keys in the original order.
-// This can be used for sanitizing properties files.
-//
-// Property expansion is recursive and circular references
-// and malformed expressions are not allowed and cause an
-// error. Expansion of environment variables is supported.
-//
-//   # standard property
-//   key = value
-//
-//   # property expansion: key2 = value
-//   key2 = ${key}
-//
-//   # recursive expansion: key3 = value
-//   key3 = ${key2}
-//
-//   # circular reference (error)
-//   key = ${key}
-//
-//   # malformed expression (error)
-//   key = ${ke
-//
-//   # refers to the users' home dir
-//   home = ${HOME}
-//
-//   # local key takes precendence over env var: u = foo
-//   USER = foo
-//   u = ${USER}
-//
-// The default property expansion format is ${key} but can be
-// changed by setting different pre- and postfix values on the
-// Properties object.
-//
-//   p := properties.NewProperties()
-//   p.Prefix = "#["
-//   p.Postfix = "]#"
-//
-// Properties provides convenience functions for getting typed
-// values with default values if the key does not exist or the
-// type conversion failed.
-//
-//   # Returns true if the value is either "1", "on", "yes" or "true"
-//   # Returns false for every other value and the default value if
-//   # the key does not exist.
-//   v = p.GetBool("key", false)
-//
-//   # Returns the value if the key exists and the format conversion
-//   # was successful. Otherwise, the default value is returned.
-//   v = p.GetInt64("key", 999)
-//   v = p.GetUint64("key", 999)
-//   v = p.GetFloat64("key", 123.0)
-//   v = p.GetString("key", "def")
-//   v = p.GetDuration("key", 999)
-//
-// Properties provides several MustXXX() convenience functions
-// which will terminate the app if an error occurs. The behavior
-// of the failure is configurable and the default is to call
-// log.Fatal(err). To have the MustXXX() functions panic instead
-// of logging the error set a different ErrorHandler before
-// you use the Properties package.
-//
-//   properties.ErrorHandler = properties.PanicHandler
-//
-//   # Will panic instead of logging an error
-//   p := properties.MustLoadFile("config.properties")
-//
-// You can also provide your own ErrorHandler function. The only requirement
-// is that the error handler function must exit after handling the error.
-//
-//   properties.ErrorHandler = func(err error) {
-//	     fmt.Println(err)
-//       os.Exit(1)
-//   }
-//
-//   # Will write to stdout and then exit
-//   p := properties.MustLoadFile("config.properties")
-//
-// The following documents provide a description of the properties
-// file format.
-//
-// http://en.wikipedia.org/wiki/.properties
-//
-// http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#load%28java.io.Reader%29
-//
-package properties

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/example_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/example_test.go b/Godeps/_workspace/src/github.com/magiconair/properties/example_test.go
deleted file mode 100644
index 38bf04f..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/example_test.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2013-2014 Frank Schroeder. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package properties
-
-import (
-	"fmt"
-	"log"
-)
-
-func ExampleLoad_iso88591() {
-	buf := []byte("key = ISO-8859-1 value with unicode literal \\u2318 and umlaut \xE4") // 0xE4 == ä
-	p, _ := Load(buf, ISO_8859_1)
-	v, ok := p.Get("key")
-	fmt.Println(ok)
-	fmt.Println(v)
-	// Output:
-	// true
-	// ISO-8859-1 value with unicode literal ⌘ and umlaut ä
-}
-
-func ExampleLoad_utf8() {
-	p, _ := Load([]byte("key = UTF-8 value with unicode character ⌘ and umlaut ä"), UTF8)
-	v, ok := p.Get("key")
-	fmt.Println(ok)
-	fmt.Println(v)
-	// Output:
-	// true
-	// UTF-8 value with unicode character ⌘ and umlaut ä
-}
-
-func ExampleProperties_GetBool() {
-	var input = `
-	key=1
-	key2=On
-	key3=YES
-	key4=true`
-	p, _ := Load([]byte(input), ISO_8859_1)
-	fmt.Println(p.GetBool("key", false))
-	fmt.Println(p.GetBool("key2", false))
-	fmt.Println(p.GetBool("key3", false))
-	fmt.Println(p.GetBool("key4", false))
-	fmt.Println(p.GetBool("keyX", false))
-	// Output:
-	// true
-	// true
-	// true
-	// true
-	// false
-}
-
-func ExampleProperties_GetString() {
-	p, _ := Load([]byte("key=value"), ISO_8859_1)
-	v := p.GetString("another key", "default value")
-	fmt.Println(v)
-	// Output:
-	// default value
-}
-
-func Example() {
-	// Decode some key/value pairs with expressions
-	p, err := Load([]byte("key=value\nkey2=${key}"), ISO_8859_1)
-	if err != nil {
-		log.Fatal(err)
-	}
-
-	// Get a valid key
-	if v, ok := p.Get("key"); ok {
-		fmt.Println(v)
-	}
-
-	// Get an invalid key
-	if _, ok := p.Get("does not exist"); !ok {
-		fmt.Println("invalid key")
-	}
-
-	// Get a key with a default value
-	v := p.GetString("does not exist", "some value")
-	fmt.Println(v)
-
-	// Dump the expanded key/value pairs of the Properties
-	fmt.Println("Expanded key/value pairs")
-	fmt.Println(p)
-
-	// Output:
-	// value
-	// invalid key
-	// some value
-	// Expanded key/value pairs
-	// key = value
-	// key2 = value
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/lex.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/lex.go b/Godeps/_workspace/src/github.com/magiconair/properties/lex.go
deleted file mode 100644
index 1ae7a45..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/lex.go
+++ /dev/null
@@ -1,409 +0,0 @@
-// Copyright 2013-2014 Frank Schroeder. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-//
-// Parts of the lexer are from the template/text/parser package
-// For these parts the following applies:
-//
-// Copyright 2011 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 of the go 1.2
-// distribution.
-
-package properties
-
-import (
-	"fmt"
-	"strconv"
-	"strings"
-	"unicode/utf8"
-)
-
-// item represents a token or text string returned from the scanner.
-type item struct {
-	typ itemType // The type of this item.
-	pos int      // The starting position, in bytes, of this item in the input string.
-	val string   // The value of this item.
-}
-
-func (i item) String() string {
-	switch {
-	case i.typ == itemEOF:
-		return "EOF"
-	case i.typ == itemError:
-		return i.val
-	case len(i.val) > 10:
-		return fmt.Sprintf("%.10q...", i.val)
-	}
-	return fmt.Sprintf("%q", i.val)
-}
-
-// itemType identifies the type of lex items.
-type itemType int
-
-const (
-	itemError itemType = iota // error occurred; value is text of error
-	itemEOF
-	itemKey     // a key
-	itemValue   // a value
-	itemComment // a comment
-)
-
-// defines a constant for EOF
-const eof = -1
-
-// permitted whitespace characters space, FF and TAB
-const whitespace = " \f\t"
-
-// stateFn represents the state of the scanner as a function that returns the next state.
-type stateFn func(*lexer) stateFn
-
-// lexer holds the state of the scanner.
-type lexer struct {
-	input   string    // the string being scanned
-	state   stateFn   // the next lexing function to enter
-	pos     int       // current position in the input
-	start   int       // start position of this item
-	width   int       // width of last rune read from input
-	lastPos int       // position of most recent item returned by nextItem
-	runes   []rune    // scanned runes for this item
-	items   chan item // channel of scanned items
-}
-
-// next returns the next rune in the input.
-func (l *lexer) next() rune {
-	if int(l.pos) >= len(l.input) {
-		l.width = 0
-		return eof
-	}
-	r, w := utf8.DecodeRuneInString(l.input[l.pos:])
-	l.width = w
-	l.pos += l.width
-	return r
-}
-
-// peek returns but does not consume the next rune in the input.
-func (l *lexer) peek() rune {
-	r := l.next()
-	l.backup()
-	return r
-}
-
-// backup steps back one rune. Can only be called once per call of next.
-func (l *lexer) backup() {
-	l.pos -= l.width
-}
-
-// emit passes an item back to the client.
-func (l *lexer) emit(t itemType) {
-	item := item{t, l.start, string(l.runes)}
-	l.items <- item
-	l.start = l.pos
-	l.runes = l.runes[:0]
-}
-
-// ignore skips over the pending input before this point.
-func (l *lexer) ignore() {
-	l.start = l.pos
-}
-
-// appends the rune to the current value
-func (l *lexer) appendRune(r rune) {
-	l.runes = append(l.runes, r)
-}
-
-// accept consumes the next rune if it's from the valid set.
-func (l *lexer) accept(valid string) bool {
-	if strings.IndexRune(valid, l.next()) >= 0 {
-		return true
-	}
-	l.backup()
-	return false
-}
-
-// acceptRun consumes a run of runes from the valid set.
-func (l *lexer) acceptRun(valid string) {
-	for strings.IndexRune(valid, l.next()) >= 0 {
-	}
-	l.backup()
-}
-
-// acceptRunUntil consumes a run of runes up to a terminator.
-func (l *lexer) acceptRunUntil(term rune) {
-	for term != l.next() {
-	}
-	l.backup()
-}
-
-// hasText returns true if the current parsed text is not empty.
-func (l *lexer) isNotEmpty() bool {
-	return l.pos > l.start
-}
-
-// lineNumber reports which line we're on, based on the position of
-// the previous item returned by nextItem. Doing it this way
-// means we don't have to worry about peek double counting.
-func (l *lexer) lineNumber() int {
-	return 1 + strings.Count(l.input[:l.lastPos], "\n")
-}
-
-// errorf returns an error token and terminates the scan by passing
-// back a nil pointer that will be the next state, terminating l.nextItem.
-func (l *lexer) errorf(format string, args ...interface{}) stateFn {
-	l.items <- item{itemError, l.start, fmt.Sprintf(format, args...)}
-	return nil
-}
-
-// nextItem returns the next item from the input.
-func (l *lexer) nextItem() item {
-	item := <-l.items
-	l.lastPos = item.pos
-	return item
-}
-
-// lex creates a new scanner for the input string.
-func lex(input string) *lexer {
-	l := &lexer{
-		input: input,
-		items: make(chan item),
-		runes: make([]rune, 0, 32),
-	}
-	go l.run()
-	return l
-}
-
-// run runs the state machine for the lexer.
-func (l *lexer) run() {
-	for l.state = lexBeforeKey(l); l.state != nil; {
-		l.state = l.state(l)
-	}
-}
-
-// state functions
-
-// lexBeforeKey scans until a key begins.
-func lexBeforeKey(l *lexer) stateFn {
-	switch r := l.next(); {
-	case isEOF(r):
-		l.emit(itemEOF)
-		return nil
-
-	case isEOL(r):
-		l.ignore()
-		return lexBeforeKey
-
-	case isComment(r):
-		return lexComment
-
-	case isWhitespace(r):
-		l.acceptRun(whitespace)
-		l.ignore()
-		return lexKey
-
-	default:
-		l.backup()
-		return lexKey
-	}
-}
-
-// lexComment scans a comment line. The comment character has already been scanned.
-func lexComment(l *lexer) stateFn {
-	l.acceptRun(whitespace)
-	l.ignore()
-	for {
-		switch r := l.next(); {
-		case isEOF(r):
-			l.ignore()
-			l.emit(itemEOF)
-			return nil
-		case isEOL(r):
-			l.emit(itemComment)
-			return lexBeforeKey
-		default:
-			l.appendRune(r)
-		}
-	}
-}
-
-// lexKey scans the key up to a delimiter
-func lexKey(l *lexer) stateFn {
-	var r rune
-
-Loop:
-	for {
-		switch r = l.next(); {
-
-		case isEscape(r):
-			err := l.scanEscapeSequence()
-			if err != nil {
-				return l.errorf(err.Error())
-			}
-
-		case isEndOfKey(r):
-			l.backup()
-			break Loop
-
-		case isEOF(r):
-			break Loop
-
-		default:
-			l.appendRune(r)
-		}
-	}
-
-	if len(l.runes) > 0 {
-		l.emit(itemKey)
-	}
-
-	if isEOF(r) {
-		l.emit(itemEOF)
-		return nil
-	}
-
-	return lexBeforeValue
-}
-
-// lexBeforeValue scans the delimiter between key and value.
-// Leading and trailing whitespace is ignored.
-// We expect to be just after the key.
-func lexBeforeValue(l *lexer) stateFn {
-	l.acceptRun(whitespace)
-	l.accept(":=")
-	l.acceptRun(whitespace)
-	l.ignore()
-	return lexValue
-}
-
-// lexValue scans text until the end of the line. We expect to be just after the delimiter.
-func lexValue(l *lexer) stateFn {
-	for {
-		switch r := l.next(); {
-		case isEscape(r):
-			r := l.peek()
-			if isEOL(r) {
-				l.next()
-				l.acceptRun(whitespace)
-			} else {
-				err := l.scanEscapeSequence()
-				if err != nil {
-					return l.errorf(err.Error())
-				}
-			}
-
-		case isEOL(r):
-			l.emit(itemValue)
-			l.ignore()
-			return lexBeforeKey
-
-		case isEOF(r):
-			l.emit(itemValue)
-			l.emit(itemEOF)
-			return nil
-
-		default:
-			l.appendRune(r)
-		}
-	}
-}
-
-// scanEscapeSequence scans either one of the escaped characters
-// or a unicode literal. We expect to be after the escape character.
-func (l *lexer) scanEscapeSequence() error {
-	switch r := l.next(); {
-
-	case isEscapedCharacter(r):
-		l.appendRune(decodeEscapedCharacter(r))
-		return nil
-
-	case atUnicodeLiteral(r):
-		return l.scanUnicodeLiteral()
-
-	case isEOF(r):
-		return fmt.Errorf("premature EOF")
-
-	// silently drop the escape character and append the rune as is
-	default:
-		l.appendRune(r)
-		return nil
-	}
-}
-
-// scans a unicode literal in the form \uXXXX. We expect to be after the \u.
-func (l *lexer) scanUnicodeLiteral() error {
-	// scan the digits
-	d := make([]rune, 4)
-	for i := 0; i < 4; i++ {
-		d[i] = l.next()
-		if d[i] == eof || !strings.ContainsRune("0123456789abcdefABCDEF", d[i]) {
-			return fmt.Errorf("invalid unicode literal")
-		}
-	}
-
-	// decode the digits into a rune
-	r, err := strconv.ParseInt(string(d), 16, 0)
-	if err != nil {
-		return err
-	}
-
-	l.appendRune(rune(r))
-	return nil
-}
-
-// decodeEscapedCharacter returns the unescaped rune. We expect to be after the escape character.
-func decodeEscapedCharacter(r rune) rune {
-	switch r {
-	case 'f':
-		return '\f'
-	case 'n':
-		return '\n'
-	case 'r':
-		return '\r'
-	case 't':
-		return '\t'
-	default:
-		return r
-	}
-}
-
-// atUnicodeLiteral reports whether we are at a unicode literal.
-// The escape character has already been consumed.
-func atUnicodeLiteral(r rune) bool {
-	return r == 'u'
-}
-
-// isComment reports whether we are at the start of a comment.
-func isComment(r rune) bool {
-	return r == '#' || r == '!'
-}
-
-// isEndOfKey reports whether the rune terminates the current key.
-func isEndOfKey(r rune) bool {
-	return strings.ContainsRune(" \f\t\r\n:=", r)
-}
-
-// isEOF reports whether we are at EOF.
-func isEOF(r rune) bool {
-	return r == eof
-}
-
-// isEOL reports whether we are at a new line character.
-func isEOL(r rune) bool {
-	return r == '\n' || r == '\r'
-}
-
-// isEscape reports whether the rune is the escape character which
-// prefixes unicode literals and other escaped characters.
-func isEscape(r rune) bool {
-	return r == '\\'
-}
-
-// isEscapedCharacter reports whether we are at one of the characters that need escaping.
-// The escape character has already been consumed.
-func isEscapedCharacter(r rune) bool {
-	return strings.ContainsRune(" :=fnrt", r)
-}
-
-// isWhitespace reports whether the rune is a whitespace character.
-func isWhitespace(r rune) bool {
-	return strings.ContainsRune(whitespace, r)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/load.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/load.go b/Godeps/_workspace/src/github.com/magiconair/properties/load.go
deleted file mode 100644
index 431d462..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/load.go
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2013-2014 Frank Schroeder. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package properties
-
-import (
-	"fmt"
-	"io/ioutil"
-	"os"
-)
-
-// Encoding specifies encoding of the input data.
-type Encoding uint
-
-const (
-	// UTF8 interprets the input data as UTF-8.
-	UTF8 Encoding = 1 << iota
-
-	// ISO_8859_1 interprets the input data as ISO-8859-1.
-	ISO_8859_1
-)
-
-// Load reads a buffer into a Properties struct.
-func Load(buf []byte, enc Encoding) (*Properties, error) {
-	return loadBuf(buf, enc)
-}
-
-// LoadFile reads a file into a Properties struct.
-func LoadFile(filename string, enc Encoding) (*Properties, error) {
-	return loadFiles([]string{filename}, enc, false)
-}
-
-// LoadFiles reads multiple files in the given order into
-// a Properties struct. If 'ignoreMissing' is true then
-// non-existent files will not be reported as error.
-func LoadFiles(filenames []string, enc Encoding, ignoreMissing bool) (*Properties, error) {
-	return loadFiles(filenames, enc, ignoreMissing)
-}
-
-// MustLoadFile reads a file into a Properties struct and
-// panics on error.
-func MustLoadFile(filename string, enc Encoding) *Properties {
-	return mustLoadFiles([]string{filename}, enc, false)
-}
-
-// MustLoadFiles reads multiple files in the given order into
-// a Properties struct and panics on error. If 'ignoreMissing'
-// is true then non-existent files will not be reported as error.
-func MustLoadFiles(filenames []string, enc Encoding, ignoreMissing bool) *Properties {
-	return mustLoadFiles(filenames, enc, ignoreMissing)
-}
-
-// ----------------------------------------------------------------------------
-
-func loadBuf(buf []byte, enc Encoding) (*Properties, error) {
-	p, err := parse(convert(buf, enc))
-	if err != nil {
-		return nil, err
-	}
-
-	return p, p.check()
-}
-
-func loadFiles(filenames []string, enc Encoding, ignoreMissing bool) (*Properties, error) {
-	buff := make([]byte, 0, 4096)
-
-	for _, filename := range filenames {
-		f, err := expandFilename(filename)
-		if err != nil {
-			return nil, err
-		}
-
-		buf, err := ioutil.ReadFile(f)
-		if err != nil {
-			if ignoreMissing && os.IsNotExist(err) {
-				// TODO(frank): should we log that we are skipping the file?
-				continue
-			}
-			return nil, err
-		}
-
-		// concatenate the buffers and add a new line in case
-		// the previous file didn't end with a new line
-		buff = append(append(buff, buf...), '\n')
-	}
-
-	return loadBuf(buff, enc)
-}
-
-func mustLoadFiles(filenames []string, enc Encoding, ignoreMissing bool) *Properties {
-	p, err := loadFiles(filenames, enc, ignoreMissing)
-	if err != nil {
-		ErrorHandler(err)
-	}
-	return p
-}
-
-// expandFilename expands ${ENV_VAR} expressions in a filename.
-// If the environment variable does not exist then it will be replaced
-// with an empty string. Malformed expressions like "${ENV_VAR" will
-// be reported as error.
-func expandFilename(filename string) (string, error) {
-	return expand(filename, make(map[string]bool), "${", "}", make(map[string]string))
-}
-
-// Interprets a byte buffer either as an ISO-8859-1 or UTF-8 encoded string.
-// For ISO-8859-1 we can convert each byte straight into a rune since the
-// first 256 unicode code points cover ISO-8859-1.
-func convert(buf []byte, enc Encoding) string {
-	switch enc {
-	case UTF8:
-		return string(buf)
-	case ISO_8859_1:
-		runes := make([]rune, len(buf))
-		for i, b := range buf {
-			runes[i] = rune(b)
-		}
-		return string(runes)
-	default:
-		ErrorHandler(fmt.Errorf("unsupported encoding %v", enc))
-	}
-	panic("ErrorHandler should exit")
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/load_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/load_test.go b/Godeps/_workspace/src/github.com/magiconair/properties/load_test.go
deleted file mode 100644
index 9d1e3b6..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/load_test.go
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright 2013-2014 Frank Schroeder. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package properties
-
-import (
-	"fmt"
-	"io/ioutil"
-	"os"
-	"strings"
-
-	. "gopkg.in/check.v1"
-)
-
-type LoadSuite struct {
-	tempFiles []string
-}
-
-var (
-	_ = Suite(&LoadSuite{})
-)
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) TestLoadFailsWithNotExistingFile(c *C) {
-	_, err := LoadFile("doesnotexist.properties", ISO_8859_1)
-	c.Assert(err, NotNil)
-	c.Assert(err, ErrorMatches, "open.*no such file or directory")
-}
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) TestLoadFilesFailsOnNotExistingFile(c *C) {
-	_, err := LoadFiles([]string{"doesnotexist.properties"}, ISO_8859_1, false)
-	c.Assert(err, NotNil)
-	c.Assert(err, ErrorMatches, "open.*no such file or directory")
-}
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) TestLoadFilesDoesNotFailOnNotExistingFileAndIgnoreMissing(c *C) {
-	p, err := LoadFiles([]string{"doesnotexist.properties"}, ISO_8859_1, true)
-	c.Assert(err, IsNil)
-	c.Assert(p.Len(), Equals, 0)
-}
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) TestLoad(c *C) {
-	filename := s.makeFile(c, "key=value")
-	p := MustLoadFile(filename, ISO_8859_1)
-
-	c.Assert(p.Len(), Equals, 1)
-	assertKeyValues(c, "", p, "key", "value")
-}
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) TestLoadFiles(c *C) {
-	filename := s.makeFile(c, "key=value")
-	filename2 := s.makeFile(c, "key2=value2")
-	p := MustLoadFiles([]string{filename, filename2}, ISO_8859_1, false)
-	assertKeyValues(c, "", p, "key", "value", "key2", "value2")
-}
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) TestLoadExpandedFile(c *C) {
-	filename := s.makeFilePrefix(c, os.Getenv("USER"), "key=value")
-	filename = strings.Replace(filename, os.Getenv("USER"), "${USER}", -1)
-	p := MustLoadFile(filename, ISO_8859_1)
-	assertKeyValues(c, "", p, "key", "value")
-}
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) TestLoadFilesAndIgnoreMissing(c *C) {
-	filename := s.makeFile(c, "key=value")
-	filename2 := s.makeFile(c, "key2=value2")
-	p := MustLoadFiles([]string{filename, filename + "foo", filename2, filename2 + "foo"}, ISO_8859_1, true)
-	assertKeyValues(c, "", p, "key", "value", "key2", "value2")
-}
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) SetUpSuite(c *C) {
-	s.tempFiles = make([]string, 0)
-}
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) TearDownSuite(c *C) {
-	for _, path := range s.tempFiles {
-		err := os.Remove(path)
-		if err != nil {
-			fmt.Printf("os.Remove: %v", err)
-		}
-	}
-}
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) makeFile(c *C, data string) string {
-	return s.makeFilePrefix(c, "properties", data)
-}
-
-// ----------------------------------------------------------------------------
-
-func (s *LoadSuite) makeFilePrefix(c *C, prefix, data string) string {
-	f, err := ioutil.TempFile("", prefix)
-	if err != nil {
-		fmt.Printf("ioutil.TempFile: %v", err)
-		c.FailNow()
-	}
-
-	// remember the temp file so that we can remove it later
-	s.tempFiles = append(s.tempFiles, f.Name())
-
-	n, err := fmt.Fprint(f, data)
-	if err != nil {
-		fmt.Printf("fmt.Fprintln: %v", err)
-		c.FailNow()
-	}
-	if n != len(data) {
-		fmt.Printf("Data size mismatch. expected=%d wrote=%d\n", len(data), n)
-		c.FailNow()
-	}
-
-	err = f.Close()
-	if err != nil {
-		fmt.Printf("f.Close: %v", err)
-		c.FailNow()
-	}
-
-	return f.Name()
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/magiconair/properties/parser.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/magiconair/properties/parser.go b/Godeps/_workspace/src/github.com/magiconair/properties/parser.go
deleted file mode 100644
index bb71fb9..0000000
--- a/Godeps/_workspace/src/github.com/magiconair/properties/parser.go
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2013-2014 Frank Schroeder. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package properties
-
-import (
-	"fmt"
-	"runtime"
-)
-
-type parser struct {
-	lex *lexer
-}
-
-func parse(input string) (properties *Properties, err error) {
-	p := &parser{lex: lex(input)}
-	defer p.recover(&err)
-
-	properties = NewProperties()
-	key := ""
-	comments := []string{}
-
-	for {
-		token := p.expectOneOf(itemComment, itemKey, itemEOF)
-		switch token.typ {
-		case itemEOF:
-			goto done
-		case itemComment:
-			comments = append(comments, token.val)
-			continue
-		case itemKey:
-			key = token.val
-			if _, ok := properties.m[key]; !ok {
-				properties.k = append(properties.k, key)
-			}
-		}
-
-		token = p.expectOneOf(itemValue, itemEOF)
-		if len(comments) > 0 {
-			properties.c[key] = comments
-			comments = []string{}
-		}
-		switch token.typ {
-		case itemEOF:
-			properties.m[key] = ""
-			goto done
-		case itemValue:
-			properties.m[key] = token.val
-		}
-	}
-
-done:
-	return properties, nil
-}
-
-func (p *parser) errorf(format string, args ...interface{}) {
-	format = fmt.Sprintf("properties: Line %d: %s", p.lex.lineNumber(), format)
-	panic(fmt.Errorf(format, args...))
-}
-
-func (p *parser) expect(expected itemType) (token item) {
-	token = p.lex.nextItem()
-	if token.typ != expected {
-		p.unexpected(token)
-	}
-	return token
-}
-
-func (p *parser) expectOneOf(expected ...itemType) (token item) {
-	token = p.lex.nextItem()
-	for _, v := range expected {
-		if token.typ == v {
-			return token
-		}
-	}
-	p.unexpected(token)
-	panic("unexpected token")
-}
-
-func (p *parser) unexpected(token item) {
-	p.errorf(token.String())
-}
-
-// recover is the handler that turns panics into returns from the top level of Parse.
-func (p *parser) recover(errp *error) {
-	e := recover()
-	if e != nil {
-		if _, ok := e.(runtime.Error); ok {
-			panic(e)
-		}
-		*errp = e.(error)
-	}
-	return
-}



[03/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yaml.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yaml.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yaml.go
new file mode 100644
index 0000000..af4df8a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yaml.go
@@ -0,0 +1,344 @@
+// Package yaml implements YAML support for the Go language.
+//
+// Source code and other details for the project are available at GitHub:
+//
+//   https://github.com/go-yaml/yaml
+//
+package yaml
+
+import (
+	"errors"
+	"fmt"
+	"reflect"
+	"strings"
+	"sync"
+)
+
+// MapSlice encodes and decodes as a YAML map.
+// The order of keys is preserved when encoding and decoding.
+type MapSlice []MapItem
+
+// MapItem is an item in a MapSlice.
+type MapItem struct {
+	Key, Value interface{}
+}
+
+// The Unmarshaler interface may be implemented by types to customize their
+// behavior when being unmarshaled from a YAML document. The UnmarshalYAML
+// method receives a function that may be called to unmarshal the original
+// YAML value into a field or variable. It is safe to call the unmarshal
+// function parameter more than once if necessary.
+type Unmarshaler interface {
+	UnmarshalYAML(unmarshal func(interface{}) error) error
+}
+
+// The Marshaler interface may be implemented by types to customize their
+// behavior when being marshaled into a YAML document. The returned value
+// is marshaled in place of the original value implementing Marshaler.
+//
+// If an error is returned by MarshalYAML, the marshaling procedure stops
+// and returns with the provided error.
+type Marshaler interface {
+	MarshalYAML() (interface{}, error)
+}
+
+// Unmarshal decodes the first document found within the in byte slice
+// and assigns decoded values into the out value.
+//
+// Maps and pointers (to a struct, string, int, etc) are accepted as out
+// values. If an internal pointer within a struct is not initialized,
+// the yaml package will initialize it if necessary for unmarshalling
+// the provided data. The out parameter must not be nil.
+//
+// The type of the decoded values should be compatible with the respective
+// values in out. If one or more values cannot be decoded due to a type
+// mismatches, decoding continues partially until the end of the YAML
+// content, and a *yaml.TypeError is returned with details for all
+// missed values.
+//
+// Struct fields are only unmarshalled if they are exported (have an
+// upper case first letter), and are unmarshalled using the field name
+// lowercased as the default key. Custom keys may be defined via the
+// "yaml" name in the field tag: the content preceding the first comma
+// is used as the key, and the following comma-separated options are
+// used to tweak the marshalling process (see Marshal).
+// Conflicting names result in a runtime error.
+//
+// For example:
+//
+//     type T struct {
+//         F int `yaml:"a,omitempty"`
+//         B int
+//     }
+//     var t T
+//     yaml.Unmarshal([]byte("a: 1\nb: 2"), &t)
+//
+// See the documentation of Marshal for the format of tags and a list of
+// supported tag options.
+//
+func Unmarshal(in []byte, out interface{}) (err error) {
+	defer handleErr(&err)
+	d := newDecoder()
+	p := newParser(in)
+	defer p.destroy()
+	node := p.parse()
+	if node != nil {
+		v := reflect.ValueOf(out)
+		if v.Kind() == reflect.Ptr && !v.IsNil() {
+			v = v.Elem()
+		}
+		d.unmarshal(node, v)
+	}
+	if len(d.terrors) > 0 {
+		return &TypeError{d.terrors}
+	}
+	return nil
+}
+
+// Marshal serializes the value provided into a YAML document. The structure
+// of the generated document will reflect the structure of the value itself.
+// Maps and pointers (to struct, string, int, etc) are accepted as the in value.
+//
+// Struct fields are only unmarshalled if they are exported (have an upper case
+// first letter), and are unmarshalled using the field name lowercased as the
+// default key. Custom keys may be defined via the "yaml" name in the field
+// tag: the content preceding the first comma is used as the key, and the
+// following comma-separated options are used to tweak the marshalling process.
+// Conflicting names result in a runtime error.
+//
+// The field tag format accepted is:
+//
+//     `(...) yaml:"[<key>][,<flag1>[,<flag2>]]" (...)`
+//
+// The following flags are currently supported:
+//
+//     omitempty    Only include the field if it's not set to the zero
+//                  value for the type or to empty slices or maps.
+//                  Does not apply to zero valued structs.
+//
+//     flow         Marshal using a flow style (useful for structs,
+//                  sequences and maps).
+//
+//     inline       Inline the field, which must be a struct or a map,
+//                  causing all of its fields or keys to be processed as if
+//                  they were part of the outer struct. For maps, keys must
+//                  not conflict with the yaml keys of other struct fields.
+//
+// In addition, if the key is "-", the field is ignored.
+//
+// For example:
+//
+//     type T struct {
+//         F int "a,omitempty"
+//         B int
+//     }
+//     yaml.Marshal(&T{B: 2}) // Returns "b: 2\n"
+//     yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n"
+//
+func Marshal(in interface{}) (out []byte, err error) {
+	defer handleErr(&err)
+	e := newEncoder()
+	defer e.destroy()
+	e.marshal("", reflect.ValueOf(in))
+	e.finish()
+	out = e.out
+	return
+}
+
+func handleErr(err *error) {
+	if v := recover(); v != nil {
+		if e, ok := v.(yamlError); ok {
+			*err = e.err
+		} else {
+			panic(v)
+		}
+	}
+}
+
+type yamlError struct {
+	err error
+}
+
+func fail(err error) {
+	panic(yamlError{err})
+}
+
+func failf(format string, args ...interface{}) {
+	panic(yamlError{fmt.Errorf("yaml: "+format, args...)})
+}
+
+// A TypeError is returned by Unmarshal when one or more fields in
+// the YAML document cannot be properly decoded into the requested
+// types. When this error is returned, the value is still
+// unmarshaled partially.
+type TypeError struct {
+	Errors []string
+}
+
+func (e *TypeError) Error() string {
+	return fmt.Sprintf("yaml: unmarshal errors:\n  %s", strings.Join(e.Errors, "\n  "))
+}
+
+// --------------------------------------------------------------------------
+// Maintain a mapping of keys to structure field indexes
+
+// The code in this section was copied from mgo/bson.
+
+// structInfo holds details for the serialization of fields of
+// a given struct.
+type structInfo struct {
+	FieldsMap  map[string]fieldInfo
+	FieldsList []fieldInfo
+
+	// InlineMap is the number of the field in the struct that
+	// contains an ,inline map, or -1 if there's none.
+	InlineMap int
+}
+
+type fieldInfo struct {
+	Key       string
+	Num       int
+	OmitEmpty bool
+	Flow      bool
+
+	// Inline holds the field index if the field is part of an inlined struct.
+	Inline []int
+}
+
+var structMap = make(map[reflect.Type]*structInfo)
+var fieldMapMutex sync.RWMutex
+
+func getStructInfo(st reflect.Type) (*structInfo, error) {
+	fieldMapMutex.RLock()
+	sinfo, found := structMap[st]
+	fieldMapMutex.RUnlock()
+	if found {
+		return sinfo, nil
+	}
+
+	n := st.NumField()
+	fieldsMap := make(map[string]fieldInfo)
+	fieldsList := make([]fieldInfo, 0, n)
+	inlineMap := -1
+	for i := 0; i != n; i++ {
+		field := st.Field(i)
+		if field.PkgPath != "" {
+			continue // Private field
+		}
+
+		info := fieldInfo{Num: i}
+
+		tag := field.Tag.Get("yaml")
+		if tag == "" && strings.Index(string(field.Tag), ":") < 0 {
+			tag = string(field.Tag)
+		}
+		if tag == "-" {
+			continue
+		}
+
+		inline := false
+		fields := strings.Split(tag, ",")
+		if len(fields) > 1 {
+			for _, flag := range fields[1:] {
+				switch flag {
+				case "omitempty":
+					info.OmitEmpty = true
+				case "flow":
+					info.Flow = true
+				case "inline":
+					inline = true
+				default:
+					return nil, errors.New(fmt.Sprintf("Unsupported flag %q in tag %q of type %s", flag, tag, st))
+				}
+			}
+			tag = fields[0]
+		}
+
+		if inline {
+			switch field.Type.Kind() {
+			case reflect.Map:
+				if inlineMap >= 0 {
+					return nil, errors.New("Multiple ,inline maps in struct " + st.String())
+				}
+				if field.Type.Key() != reflect.TypeOf("") {
+					return nil, errors.New("Option ,inline needs a map with string keys in struct " + st.String())
+				}
+				inlineMap = info.Num
+			case reflect.Struct:
+				sinfo, err := getStructInfo(field.Type)
+				if err != nil {
+					return nil, err
+				}
+				for _, finfo := range sinfo.FieldsList {
+					if _, found := fieldsMap[finfo.Key]; found {
+						msg := "Duplicated key '" + finfo.Key + "' in struct " + st.String()
+						return nil, errors.New(msg)
+					}
+					if finfo.Inline == nil {
+						finfo.Inline = []int{i, finfo.Num}
+					} else {
+						finfo.Inline = append([]int{i}, finfo.Inline...)
+					}
+					fieldsMap[finfo.Key] = finfo
+					fieldsList = append(fieldsList, finfo)
+				}
+			default:
+				//return nil, errors.New("Option ,inline needs a struct value or map field")
+				return nil, errors.New("Option ,inline needs a struct value field")
+			}
+			continue
+		}
+
+		if tag != "" {
+			info.Key = tag
+		} else {
+			info.Key = strings.ToLower(field.Name)
+		}
+
+		if _, found = fieldsMap[info.Key]; found {
+			msg := "Duplicated key '" + info.Key + "' in struct " + st.String()
+			return nil, errors.New(msg)
+		}
+
+		fieldsList = append(fieldsList, info)
+		fieldsMap[info.Key] = info
+	}
+
+	sinfo = &structInfo{fieldsMap, fieldsList, inlineMap}
+
+	fieldMapMutex.Lock()
+	structMap[st] = sinfo
+	fieldMapMutex.Unlock()
+	return sinfo, nil
+}
+
+func isZero(v reflect.Value) bool {
+	switch v.Kind() {
+	case reflect.String:
+		return len(v.String()) == 0
+	case reflect.Interface, reflect.Ptr:
+		return v.IsNil()
+	case reflect.Slice:
+		return v.Len() == 0
+	case reflect.Map:
+		return v.Len() == 0
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		return v.Int() == 0
+	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+		return v.Uint() == 0
+	case reflect.Bool:
+		return !v.Bool()
+	case reflect.Struct:
+		vt := v.Type()
+		for i := v.NumField()-1; i >= 0; i-- {
+			if vt.Field(i).PkgPath != "" {
+				continue // Private field
+			}
+			if !isZero(v.Field(i)) {
+				return false
+			}
+		}
+		return true
+	}
+	return false
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlh.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlh.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlh.go
new file mode 100644
index 0000000..d60a6b6
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlh.go
@@ -0,0 +1,716 @@
+package yaml
+
+import (
+	"io"
+)
+
+// The version directive data.
+type yaml_version_directive_t struct {
+	major int8 // The major version number.
+	minor int8 // The minor version number.
+}
+
+// The tag directive data.
+type yaml_tag_directive_t struct {
+	handle []byte // The tag handle.
+	prefix []byte // The tag prefix.
+}
+
+type yaml_encoding_t int
+
+// The stream encoding.
+const (
+	// Let the parser choose the encoding.
+	yaml_ANY_ENCODING yaml_encoding_t = iota
+
+	yaml_UTF8_ENCODING    // The default UTF-8 encoding.
+	yaml_UTF16LE_ENCODING // The UTF-16-LE encoding with BOM.
+	yaml_UTF16BE_ENCODING // The UTF-16-BE encoding with BOM.
+)
+
+type yaml_break_t int
+
+// Line break types.
+const (
+	// Let the parser choose the break type.
+	yaml_ANY_BREAK yaml_break_t = iota
+
+	yaml_CR_BREAK   // Use CR for line breaks (Mac style).
+	yaml_LN_BREAK   // Use LN for line breaks (Unix style).
+	yaml_CRLN_BREAK // Use CR LN for line breaks (DOS style).
+)
+
+type yaml_error_type_t int
+
+// Many bad things could happen with the parser and emitter.
+const (
+	// No error is produced.
+	yaml_NO_ERROR yaml_error_type_t = iota
+
+	yaml_MEMORY_ERROR   // Cannot allocate or reallocate a block of memory.
+	yaml_READER_ERROR   // Cannot read or decode the input stream.
+	yaml_SCANNER_ERROR  // Cannot scan the input stream.
+	yaml_PARSER_ERROR   // Cannot parse the input stream.
+	yaml_COMPOSER_ERROR // Cannot compose a YAML document.
+	yaml_WRITER_ERROR   // Cannot write to the output stream.
+	yaml_EMITTER_ERROR  // Cannot emit a YAML stream.
+)
+
+// The pointer position.
+type yaml_mark_t struct {
+	index  int // The position index.
+	line   int // The position line.
+	column int // The position column.
+}
+
+// Node Styles
+
+type yaml_style_t int8
+
+type yaml_scalar_style_t yaml_style_t
+
+// Scalar styles.
+const (
+	// Let the emitter choose the style.
+	yaml_ANY_SCALAR_STYLE yaml_scalar_style_t = iota
+
+	yaml_PLAIN_SCALAR_STYLE         // The plain scalar style.
+	yaml_SINGLE_QUOTED_SCALAR_STYLE // The single-quoted scalar style.
+	yaml_DOUBLE_QUOTED_SCALAR_STYLE // The double-quoted scalar style.
+	yaml_LITERAL_SCALAR_STYLE       // The literal scalar style.
+	yaml_FOLDED_SCALAR_STYLE        // The folded scalar style.
+)
+
+type yaml_sequence_style_t yaml_style_t
+
+// Sequence styles.
+const (
+	// Let the emitter choose the style.
+	yaml_ANY_SEQUENCE_STYLE yaml_sequence_style_t = iota
+
+	yaml_BLOCK_SEQUENCE_STYLE // The block sequence style.
+	yaml_FLOW_SEQUENCE_STYLE  // The flow sequence style.
+)
+
+type yaml_mapping_style_t yaml_style_t
+
+// Mapping styles.
+const (
+	// Let the emitter choose the style.
+	yaml_ANY_MAPPING_STYLE yaml_mapping_style_t = iota
+
+	yaml_BLOCK_MAPPING_STYLE // The block mapping style.
+	yaml_FLOW_MAPPING_STYLE  // The flow mapping style.
+)
+
+// Tokens
+
+type yaml_token_type_t int
+
+// Token types.
+const (
+	// An empty token.
+	yaml_NO_TOKEN yaml_token_type_t = iota
+
+	yaml_STREAM_START_TOKEN // A STREAM-START token.
+	yaml_STREAM_END_TOKEN   // A STREAM-END token.
+
+	yaml_VERSION_DIRECTIVE_TOKEN // A VERSION-DIRECTIVE token.
+	yaml_TAG_DIRECTIVE_TOKEN     // A TAG-DIRECTIVE token.
+	yaml_DOCUMENT_START_TOKEN    // A DOCUMENT-START token.
+	yaml_DOCUMENT_END_TOKEN      // A DOCUMENT-END token.
+
+	yaml_BLOCK_SEQUENCE_START_TOKEN // A BLOCK-SEQUENCE-START token.
+	yaml_BLOCK_MAPPING_START_TOKEN  // A BLOCK-SEQUENCE-END token.
+	yaml_BLOCK_END_TOKEN            // A BLOCK-END token.
+
+	yaml_FLOW_SEQUENCE_START_TOKEN // A FLOW-SEQUENCE-START token.
+	yaml_FLOW_SEQUENCE_END_TOKEN   // A FLOW-SEQUENCE-END token.
+	yaml_FLOW_MAPPING_START_TOKEN  // A FLOW-MAPPING-START token.
+	yaml_FLOW_MAPPING_END_TOKEN    // A FLOW-MAPPING-END token.
+
+	yaml_BLOCK_ENTRY_TOKEN // A BLOCK-ENTRY token.
+	yaml_FLOW_ENTRY_TOKEN  // A FLOW-ENTRY token.
+	yaml_KEY_TOKEN         // A KEY token.
+	yaml_VALUE_TOKEN       // A VALUE token.
+
+	yaml_ALIAS_TOKEN  // An ALIAS token.
+	yaml_ANCHOR_TOKEN // An ANCHOR token.
+	yaml_TAG_TOKEN    // A TAG token.
+	yaml_SCALAR_TOKEN // A SCALAR token.
+)
+
+func (tt yaml_token_type_t) String() string {
+	switch tt {
+	case yaml_NO_TOKEN:
+		return "yaml_NO_TOKEN"
+	case yaml_STREAM_START_TOKEN:
+		return "yaml_STREAM_START_TOKEN"
+	case yaml_STREAM_END_TOKEN:
+		return "yaml_STREAM_END_TOKEN"
+	case yaml_VERSION_DIRECTIVE_TOKEN:
+		return "yaml_VERSION_DIRECTIVE_TOKEN"
+	case yaml_TAG_DIRECTIVE_TOKEN:
+		return "yaml_TAG_DIRECTIVE_TOKEN"
+	case yaml_DOCUMENT_START_TOKEN:
+		return "yaml_DOCUMENT_START_TOKEN"
+	case yaml_DOCUMENT_END_TOKEN:
+		return "yaml_DOCUMENT_END_TOKEN"
+	case yaml_BLOCK_SEQUENCE_START_TOKEN:
+		return "yaml_BLOCK_SEQUENCE_START_TOKEN"
+	case yaml_BLOCK_MAPPING_START_TOKEN:
+		return "yaml_BLOCK_MAPPING_START_TOKEN"
+	case yaml_BLOCK_END_TOKEN:
+		return "yaml_BLOCK_END_TOKEN"
+	case yaml_FLOW_SEQUENCE_START_TOKEN:
+		return "yaml_FLOW_SEQUENCE_START_TOKEN"
+	case yaml_FLOW_SEQUENCE_END_TOKEN:
+		return "yaml_FLOW_SEQUENCE_END_TOKEN"
+	case yaml_FLOW_MAPPING_START_TOKEN:
+		return "yaml_FLOW_MAPPING_START_TOKEN"
+	case yaml_FLOW_MAPPING_END_TOKEN:
+		return "yaml_FLOW_MAPPING_END_TOKEN"
+	case yaml_BLOCK_ENTRY_TOKEN:
+		return "yaml_BLOCK_ENTRY_TOKEN"
+	case yaml_FLOW_ENTRY_TOKEN:
+		return "yaml_FLOW_ENTRY_TOKEN"
+	case yaml_KEY_TOKEN:
+		return "yaml_KEY_TOKEN"
+	case yaml_VALUE_TOKEN:
+		return "yaml_VALUE_TOKEN"
+	case yaml_ALIAS_TOKEN:
+		return "yaml_ALIAS_TOKEN"
+	case yaml_ANCHOR_TOKEN:
+		return "yaml_ANCHOR_TOKEN"
+	case yaml_TAG_TOKEN:
+		return "yaml_TAG_TOKEN"
+	case yaml_SCALAR_TOKEN:
+		return "yaml_SCALAR_TOKEN"
+	}
+	return "<unknown token>"
+}
+
+// The token structure.
+type yaml_token_t struct {
+	// The token type.
+	typ yaml_token_type_t
+
+	// The start/end of the token.
+	start_mark, end_mark yaml_mark_t
+
+	// The stream encoding (for yaml_STREAM_START_TOKEN).
+	encoding yaml_encoding_t
+
+	// The alias/anchor/scalar value or tag/tag directive handle
+	// (for yaml_ALIAS_TOKEN, yaml_ANCHOR_TOKEN, yaml_SCALAR_TOKEN, yaml_TAG_TOKEN, yaml_TAG_DIRECTIVE_TOKEN).
+	value []byte
+
+	// The tag suffix (for yaml_TAG_TOKEN).
+	suffix []byte
+
+	// The tag directive prefix (for yaml_TAG_DIRECTIVE_TOKEN).
+	prefix []byte
+
+	// The scalar style (for yaml_SCALAR_TOKEN).
+	style yaml_scalar_style_t
+
+	// The version directive major/minor (for yaml_VERSION_DIRECTIVE_TOKEN).
+	major, minor int8
+}
+
+// Events
+
+type yaml_event_type_t int8
+
+// Event types.
+const (
+	// An empty event.
+	yaml_NO_EVENT yaml_event_type_t = iota
+
+	yaml_STREAM_START_EVENT   // A STREAM-START event.
+	yaml_STREAM_END_EVENT     // A STREAM-END event.
+	yaml_DOCUMENT_START_EVENT // A DOCUMENT-START event.
+	yaml_DOCUMENT_END_EVENT   // A DOCUMENT-END event.
+	yaml_ALIAS_EVENT          // An ALIAS event.
+	yaml_SCALAR_EVENT         // A SCALAR event.
+	yaml_SEQUENCE_START_EVENT // A SEQUENCE-START event.
+	yaml_SEQUENCE_END_EVENT   // A SEQUENCE-END event.
+	yaml_MAPPING_START_EVENT  // A MAPPING-START event.
+	yaml_MAPPING_END_EVENT    // A MAPPING-END event.
+)
+
+// The event structure.
+type yaml_event_t struct {
+
+	// The event type.
+	typ yaml_event_type_t
+
+	// The start and end of the event.
+	start_mark, end_mark yaml_mark_t
+
+	// The document encoding (for yaml_STREAM_START_EVENT).
+	encoding yaml_encoding_t
+
+	// The version directive (for yaml_DOCUMENT_START_EVENT).
+	version_directive *yaml_version_directive_t
+
+	// The list of tag directives (for yaml_DOCUMENT_START_EVENT).
+	tag_directives []yaml_tag_directive_t
+
+	// The anchor (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_ALIAS_EVENT).
+	anchor []byte
+
+	// The tag (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT).
+	tag []byte
+
+	// The scalar value (for yaml_SCALAR_EVENT).
+	value []byte
+
+	// Is the document start/end indicator implicit, or the tag optional?
+	// (for yaml_DOCUMENT_START_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_SCALAR_EVENT).
+	implicit bool
+
+	// Is the tag optional for any non-plain style? (for yaml_SCALAR_EVENT).
+	quoted_implicit bool
+
+	// The style (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT).
+	style yaml_style_t
+}
+
+func (e *yaml_event_t) scalar_style() yaml_scalar_style_t     { return yaml_scalar_style_t(e.style) }
+func (e *yaml_event_t) sequence_style() yaml_sequence_style_t { return yaml_sequence_style_t(e.style) }
+func (e *yaml_event_t) mapping_style() yaml_mapping_style_t   { return yaml_mapping_style_t(e.style) }
+
+// Nodes
+
+const (
+	yaml_NULL_TAG      = "tag:yaml.org,2002:null"      // The tag !!null with the only possible value: null.
+	yaml_BOOL_TAG      = "tag:yaml.org,2002:bool"      // The tag !!bool with the values: true and false.
+	yaml_STR_TAG       = "tag:yaml.org,2002:str"       // The tag !!str for string values.
+	yaml_INT_TAG       = "tag:yaml.org,2002:int"       // The tag !!int for integer values.
+	yaml_FLOAT_TAG     = "tag:yaml.org,2002:float"     // The tag !!float for float values.
+	yaml_TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp" // The tag !!timestamp for date and time values.
+
+	yaml_SEQ_TAG = "tag:yaml.org,2002:seq" // The tag !!seq is used to denote sequences.
+	yaml_MAP_TAG = "tag:yaml.org,2002:map" // The tag !!map is used to denote mapping.
+
+	// Not in original libyaml.
+	yaml_BINARY_TAG = "tag:yaml.org,2002:binary"
+	yaml_MERGE_TAG  = "tag:yaml.org,2002:merge"
+
+	yaml_DEFAULT_SCALAR_TAG   = yaml_STR_TAG // The default scalar tag is !!str.
+	yaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG // The default sequence tag is !!seq.
+	yaml_DEFAULT_MAPPING_TAG  = yaml_MAP_TAG // The default mapping tag is !!map.
+)
+
+type yaml_node_type_t int
+
+// Node types.
+const (
+	// An empty node.
+	yaml_NO_NODE yaml_node_type_t = iota
+
+	yaml_SCALAR_NODE   // A scalar node.
+	yaml_SEQUENCE_NODE // A sequence node.
+	yaml_MAPPING_NODE  // A mapping node.
+)
+
+// An element of a sequence node.
+type yaml_node_item_t int
+
+// An element of a mapping node.
+type yaml_node_pair_t struct {
+	key   int // The key of the element.
+	value int // The value of the element.
+}
+
+// The node structure.
+type yaml_node_t struct {
+	typ yaml_node_type_t // The node type.
+	tag []byte           // The node tag.
+
+	// The node data.
+
+	// The scalar parameters (for yaml_SCALAR_NODE).
+	scalar struct {
+		value  []byte              // The scalar value.
+		length int                 // The length of the scalar value.
+		style  yaml_scalar_style_t // The scalar style.
+	}
+
+	// The sequence parameters (for YAML_SEQUENCE_NODE).
+	sequence struct {
+		items_data []yaml_node_item_t    // The stack of sequence items.
+		style      yaml_sequence_style_t // The sequence style.
+	}
+
+	// The mapping parameters (for yaml_MAPPING_NODE).
+	mapping struct {
+		pairs_data  []yaml_node_pair_t   // The stack of mapping pairs (key, value).
+		pairs_start *yaml_node_pair_t    // The beginning of the stack.
+		pairs_end   *yaml_node_pair_t    // The end of the stack.
+		pairs_top   *yaml_node_pair_t    // The top of the stack.
+		style       yaml_mapping_style_t // The mapping style.
+	}
+
+	start_mark yaml_mark_t // The beginning of the node.
+	end_mark   yaml_mark_t // The end of the node.
+
+}
+
+// The document structure.
+type yaml_document_t struct {
+
+	// The document nodes.
+	nodes []yaml_node_t
+
+	// The version directive.
+	version_directive *yaml_version_directive_t
+
+	// The list of tag directives.
+	tag_directives_data  []yaml_tag_directive_t
+	tag_directives_start int // The beginning of the tag directives list.
+	tag_directives_end   int // The end of the tag directives list.
+
+	start_implicit int // Is the document start indicator implicit?
+	end_implicit   int // Is the document end indicator implicit?
+
+	// The start/end of the document.
+	start_mark, end_mark yaml_mark_t
+}
+
+// The prototype of a read handler.
+//
+// The read handler is called when the parser needs to read more bytes from the
+// source. The handler should write not more than size bytes to the buffer.
+// The number of written bytes should be set to the size_read variable.
+//
+// [in,out]   data        A pointer to an application data specified by
+//                        yaml_parser_set_input().
+// [out]      buffer      The buffer to write the data from the source.
+// [in]       size        The size of the buffer.
+// [out]      size_read   The actual number of bytes read from the source.
+//
+// On success, the handler should return 1.  If the handler failed,
+// the returned value should be 0. On EOF, the handler should set the
+// size_read to 0 and return 1.
+type yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error)
+
+// This structure holds information about a potential simple key.
+type yaml_simple_key_t struct {
+	possible     bool        // Is a simple key possible?
+	required     bool        // Is a simple key required?
+	token_number int         // The number of the token.
+	mark         yaml_mark_t // The position mark.
+}
+
+// The states of the parser.
+type yaml_parser_state_t int
+
+const (
+	yaml_PARSE_STREAM_START_STATE yaml_parser_state_t = iota
+
+	yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE           // Expect the beginning of an implicit document.
+	yaml_PARSE_DOCUMENT_START_STATE                    // Expect DOCUMENT-START.
+	yaml_PARSE_DOCUMENT_CONTENT_STATE                  // Expect the content of a document.
+	yaml_PARSE_DOCUMENT_END_STATE                      // Expect DOCUMENT-END.
+	yaml_PARSE_BLOCK_NODE_STATE                        // Expect a block node.
+	yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE // Expect a block node or indentless sequence.
+	yaml_PARSE_FLOW_NODE_STATE                         // Expect a flow node.
+	yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE        // Expect the first entry of a block sequence.
+	yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE              // Expect an entry of a block sequence.
+	yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE         // Expect an entry of an indentless sequence.
+	yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE           // Expect the first key of a block mapping.
+	yaml_PARSE_BLOCK_MAPPING_KEY_STATE                 // Expect a block mapping key.
+	yaml_PARSE_BLOCK_MAPPING_VALUE_STATE               // Expect a block mapping value.
+	yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE         // Expect the first entry of a flow sequence.
+	yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE               // Expect an entry of a flow sequence.
+	yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE   // Expect a key of an ordered mapping.
+	yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE // Expect a value of an ordered mapping.
+	yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE   // Expect the and of an ordered mapping entry.
+	yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE            // Expect the first key of a flow mapping.
+	yaml_PARSE_FLOW_MAPPING_KEY_STATE                  // Expect a key of a flow mapping.
+	yaml_PARSE_FLOW_MAPPING_VALUE_STATE                // Expect a value of a flow mapping.
+	yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE          // Expect an empty value of a flow mapping.
+	yaml_PARSE_END_STATE                               // Expect nothing.
+)
+
+func (ps yaml_parser_state_t) String() string {
+	switch ps {
+	case yaml_PARSE_STREAM_START_STATE:
+		return "yaml_PARSE_STREAM_START_STATE"
+	case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE:
+		return "yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE"
+	case yaml_PARSE_DOCUMENT_START_STATE:
+		return "yaml_PARSE_DOCUMENT_START_STATE"
+	case yaml_PARSE_DOCUMENT_CONTENT_STATE:
+		return "yaml_PARSE_DOCUMENT_CONTENT_STATE"
+	case yaml_PARSE_DOCUMENT_END_STATE:
+		return "yaml_PARSE_DOCUMENT_END_STATE"
+	case yaml_PARSE_BLOCK_NODE_STATE:
+		return "yaml_PARSE_BLOCK_NODE_STATE"
+	case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:
+		return "yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE"
+	case yaml_PARSE_FLOW_NODE_STATE:
+		return "yaml_PARSE_FLOW_NODE_STATE"
+	case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:
+		return "yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE"
+	case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:
+		return "yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE"
+	case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:
+		return "yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE"
+	case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:
+		return "yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE"
+	case yaml_PARSE_BLOCK_MAPPING_KEY_STATE:
+		return "yaml_PARSE_BLOCK_MAPPING_KEY_STATE"
+	case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE:
+		return "yaml_PARSE_BLOCK_MAPPING_VALUE_STATE"
+	case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:
+		return "yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE"
+	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE:
+		return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE"
+	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:
+		return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE"
+	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:
+		return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE"
+	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:
+		return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE"
+	case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:
+		return "yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE"
+	case yaml_PARSE_FLOW_MAPPING_KEY_STATE:
+		return "yaml_PARSE_FLOW_MAPPING_KEY_STATE"
+	case yaml_PARSE_FLOW_MAPPING_VALUE_STATE:
+		return "yaml_PARSE_FLOW_MAPPING_VALUE_STATE"
+	case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:
+		return "yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE"
+	case yaml_PARSE_END_STATE:
+		return "yaml_PARSE_END_STATE"
+	}
+	return "<unknown parser state>"
+}
+
+// This structure holds aliases data.
+type yaml_alias_data_t struct {
+	anchor []byte      // The anchor.
+	index  int         // The node id.
+	mark   yaml_mark_t // The anchor mark.
+}
+
+// The parser structure.
+//
+// All members are internal. Manage the structure using the
+// yaml_parser_ family of functions.
+type yaml_parser_t struct {
+
+	// Error handling
+
+	error yaml_error_type_t // Error type.
+
+	problem string // Error description.
+
+	// The byte about which the problem occured.
+	problem_offset int
+	problem_value  int
+	problem_mark   yaml_mark_t
+
+	// The error context.
+	context      string
+	context_mark yaml_mark_t
+
+	// Reader stuff
+
+	read_handler yaml_read_handler_t // Read handler.
+
+	input_file io.Reader // File input data.
+	input      []byte    // String input data.
+	input_pos  int
+
+	eof bool // EOF flag
+
+	buffer     []byte // The working buffer.
+	buffer_pos int    // The current position of the buffer.
+
+	unread int // The number of unread characters in the buffer.
+
+	raw_buffer     []byte // The raw buffer.
+	raw_buffer_pos int    // The current position of the buffer.
+
+	encoding yaml_encoding_t // The input encoding.
+
+	offset int         // The offset of the current position (in bytes).
+	mark   yaml_mark_t // The mark of the current position.
+
+	// Scanner stuff
+
+	stream_start_produced bool // Have we started to scan the input stream?
+	stream_end_produced   bool // Have we reached the end of the input stream?
+
+	flow_level int // The number of unclosed '[' and '{' indicators.
+
+	tokens          []yaml_token_t // The tokens queue.
+	tokens_head     int            // The head of the tokens queue.
+	tokens_parsed   int            // The number of tokens fetched from the queue.
+	token_available bool           // Does the tokens queue contain a token ready for dequeueing.
+
+	indent  int   // The current indentation level.
+	indents []int // The indentation levels stack.
+
+	simple_key_allowed bool                // May a simple key occur at the current position?
+	simple_keys        []yaml_simple_key_t // The stack of simple keys.
+
+	// Parser stuff
+
+	state          yaml_parser_state_t    // The current parser state.
+	states         []yaml_parser_state_t  // The parser states stack.
+	marks          []yaml_mark_t          // The stack of marks.
+	tag_directives []yaml_tag_directive_t // The list of TAG directives.
+
+	// Dumper stuff
+
+	aliases []yaml_alias_data_t // The alias data.
+
+	document *yaml_document_t // The currently parsed document.
+}
+
+// Emitter Definitions
+
+// The prototype of a write handler.
+//
+// The write handler is called when the emitter needs to flush the accumulated
+// characters to the output.  The handler should write @a size bytes of the
+// @a buffer to the output.
+//
+// @param[in,out]   data        A pointer to an application data specified by
+//                              yaml_emitter_set_output().
+// @param[in]       buffer      The buffer with bytes to be written.
+// @param[in]       size        The size of the buffer.
+//
+// @returns On success, the handler should return @c 1.  If the handler failed,
+// the returned value should be @c 0.
+//
+type yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error
+
+type yaml_emitter_state_t int
+
+// The emitter states.
+const (
+	// Expect STREAM-START.
+	yaml_EMIT_STREAM_START_STATE yaml_emitter_state_t = iota
+
+	yaml_EMIT_FIRST_DOCUMENT_START_STATE       // Expect the first DOCUMENT-START or STREAM-END.
+	yaml_EMIT_DOCUMENT_START_STATE             // Expect DOCUMENT-START or STREAM-END.
+	yaml_EMIT_DOCUMENT_CONTENT_STATE           // Expect the content of a document.
+	yaml_EMIT_DOCUMENT_END_STATE               // Expect DOCUMENT-END.
+	yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE   // Expect the first item of a flow sequence.
+	yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE         // Expect an item of a flow sequence.
+	yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE     // Expect the first key of a flow mapping.
+	yaml_EMIT_FLOW_MAPPING_KEY_STATE           // Expect a key of a flow mapping.
+	yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE  // Expect a value for a simple key of a flow mapping.
+	yaml_EMIT_FLOW_MAPPING_VALUE_STATE         // Expect a value of a flow mapping.
+	yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE  // Expect the first item of a block sequence.
+	yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE        // Expect an item of a block sequence.
+	yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE    // Expect the first key of a block mapping.
+	yaml_EMIT_BLOCK_MAPPING_KEY_STATE          // Expect the key of a block mapping.
+	yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a block mapping.
+	yaml_EMIT_BLOCK_MAPPING_VALUE_STATE        // Expect a value of a block mapping.
+	yaml_EMIT_END_STATE                        // Expect nothing.
+)
+
+// The emitter structure.
+//
+// All members are internal.  Manage the structure using the @c yaml_emitter_
+// family of functions.
+type yaml_emitter_t struct {
+
+	// Error handling
+
+	error   yaml_error_type_t // Error type.
+	problem string            // Error description.
+
+	// Writer stuff
+
+	write_handler yaml_write_handler_t // Write handler.
+
+	output_buffer *[]byte   // String output data.
+	output_file   io.Writer // File output data.
+
+	buffer     []byte // The working buffer.
+	buffer_pos int    // The current position of the buffer.
+
+	raw_buffer     []byte // The raw buffer.
+	raw_buffer_pos int    // The current position of the buffer.
+
+	encoding yaml_encoding_t // The stream encoding.
+
+	// Emitter stuff
+
+	canonical   bool         // If the output is in the canonical style?
+	best_indent int          // The number of indentation spaces.
+	best_width  int          // The preferred width of the output lines.
+	unicode     bool         // Allow unescaped non-ASCII characters?
+	line_break  yaml_break_t // The preferred line break.
+
+	state  yaml_emitter_state_t   // The current emitter state.
+	states []yaml_emitter_state_t // The stack of states.
+
+	events      []yaml_event_t // The event queue.
+	events_head int            // The head of the event queue.
+
+	indents []int // The stack of indentation levels.
+
+	tag_directives []yaml_tag_directive_t // The list of tag directives.
+
+	indent int // The current indentation level.
+
+	flow_level int // The current flow level.
+
+	root_context       bool // Is it the document root context?
+	sequence_context   bool // Is it a sequence context?
+	mapping_context    bool // Is it a mapping context?
+	simple_key_context bool // Is it a simple mapping key context?
+
+	line       int  // The current line.
+	column     int  // The current column.
+	whitespace bool // If the last character was a whitespace?
+	indention  bool // If the last character was an indentation character (' ', '-', '?', ':')?
+	open_ended bool // If an explicit document end is required?
+
+	// Anchor analysis.
+	anchor_data struct {
+		anchor []byte // The anchor value.
+		alias  bool   // Is it an alias?
+	}
+
+	// Tag analysis.
+	tag_data struct {
+		handle []byte // The tag handle.
+		suffix []byte // The tag suffix.
+	}
+
+	// Scalar analysis.
+	scalar_data struct {
+		value                 []byte              // The scalar value.
+		multiline             bool                // Does the scalar contain line breaks?
+		flow_plain_allowed    bool                // Can the scalar be expessed in the flow plain style?
+		block_plain_allowed   bool                // Can the scalar be expressed in the block plain style?
+		single_quoted_allowed bool                // Can the scalar be expressed in the single quoted style?
+		block_allowed         bool                // Can the scalar be expressed in the literal or folded styles?
+		style                 yaml_scalar_style_t // The output style.
+	}
+
+	// Dumper stuff
+
+	opened bool // If the stream was already opened?
+	closed bool // If the stream was already closed?
+
+	// The information associated with the document nodes.
+	anchors *struct {
+		references int  // The number of references.
+		anchor     int  // The anchor id.
+		serialized bool // If the node has been emitted?
+	}
+
+	last_anchor_id int // The last assigned anchor id.
+
+	document *yaml_document_t // The currently emitted document.
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlprivateh.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlprivateh.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlprivateh.go
new file mode 100644
index 0000000..8110ce3
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/yamlprivateh.go
@@ -0,0 +1,173 @@
+package yaml
+
+const (
+	// The size of the input raw buffer.
+	input_raw_buffer_size = 512
+
+	// The size of the input buffer.
+	// It should be possible to decode the whole raw buffer.
+	input_buffer_size = input_raw_buffer_size * 3
+
+	// The size of the output buffer.
+	output_buffer_size = 128
+
+	// The size of the output raw buffer.
+	// It should be possible to encode the whole output buffer.
+	output_raw_buffer_size = (output_buffer_size*2 + 2)
+
+	// The size of other stacks and queues.
+	initial_stack_size  = 16
+	initial_queue_size  = 16
+	initial_string_size = 16
+)
+
+// Check if the character at the specified position is an alphabetical
+// character, a digit, '_', or '-'.
+func is_alpha(b []byte, i int) bool {
+	return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-'
+}
+
+// Check if the character at the specified position is a digit.
+func is_digit(b []byte, i int) bool {
+	return b[i] >= '0' && b[i] <= '9'
+}
+
+// Get the value of a digit.
+func as_digit(b []byte, i int) int {
+	return int(b[i]) - '0'
+}
+
+// Check if the character at the specified position is a hex-digit.
+func is_hex(b []byte, i int) bool {
+	return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || b[i] >= 'a' && b[i] <= 'f'
+}
+
+// Get the value of a hex-digit.
+func as_hex(b []byte, i int) int {
+	bi := b[i]
+	if bi >= 'A' && bi <= 'F' {
+		return int(bi) - 'A' + 10
+	}
+	if bi >= 'a' && bi <= 'f' {
+		return int(bi) - 'a' + 10
+	}
+	return int(bi) - '0'
+}
+
+// Check if the character is ASCII.
+func is_ascii(b []byte, i int) bool {
+	return b[i] <= 0x7F
+}
+
+// Check if the character at the start of the buffer can be printed unescaped.
+func is_printable(b []byte, i int) bool {
+	return ((b[i] == 0x0A) || // . == #x0A
+		(b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E
+		(b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF
+		(b[i] > 0xC2 && b[i] < 0xED) ||
+		(b[i] == 0xED && b[i+1] < 0xA0) ||
+		(b[i] == 0xEE) ||
+		(b[i] == 0xEF && // #xE000 <= . <= #xFFFD
+			!(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF
+			!(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF))))
+}
+
+// Check if the character at the specified position is NUL.
+func is_z(b []byte, i int) bool {
+	return b[i] == 0x00
+}
+
+// Check if the beginning of the buffer is a BOM.
+func is_bom(b []byte, i int) bool {
+	return b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF
+}
+
+// Check if the character at the specified position is space.
+func is_space(b []byte, i int) bool {
+	return b[i] == ' '
+}
+
+// Check if the character at the specified position is tab.
+func is_tab(b []byte, i int) bool {
+	return b[i] == '\t'
+}
+
+// Check if the character at the specified position is blank (space or tab).
+func is_blank(b []byte, i int) bool {
+	//return is_space(b, i) || is_tab(b, i)
+	return b[i] == ' ' || b[i] == '\t'
+}
+
+// Check if the character at the specified position is a line break.
+func is_break(b []byte, i int) bool {
+	return (b[i] == '\r' || // CR (#xD)
+		b[i] == '\n' || // LF (#xA)
+		b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
+		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
+		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029)
+}
+
+func is_crlf(b []byte, i int) bool {
+	return b[i] == '\r' && b[i+1] == '\n'
+}
+
+// Check if the character is a line break or NUL.
+func is_breakz(b []byte, i int) bool {
+	//return is_break(b, i) || is_z(b, i)
+	return (        // is_break:
+	b[i] == '\r' || // CR (#xD)
+		b[i] == '\n' || // LF (#xA)
+		b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
+		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
+		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)
+		// is_z:
+		b[i] == 0)
+}
+
+// Check if the character is a line break, space, or NUL.
+func is_spacez(b []byte, i int) bool {
+	//return is_space(b, i) || is_breakz(b, i)
+	return ( // is_space:
+	b[i] == ' ' ||
+		// is_breakz:
+		b[i] == '\r' || // CR (#xD)
+		b[i] == '\n' || // LF (#xA)
+		b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
+		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
+		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)
+		b[i] == 0)
+}
+
+// Check if the character is a line break, space, tab, or NUL.
+func is_blankz(b []byte, i int) bool {
+	//return is_blank(b, i) || is_breakz(b, i)
+	return ( // is_blank:
+	b[i] == ' ' || b[i] == '\t' ||
+		// is_breakz:
+		b[i] == '\r' || // CR (#xD)
+		b[i] == '\n' || // LF (#xA)
+		b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
+		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
+		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)
+		b[i] == 0)
+}
+
+// Determine the width of the character.
+func width(b byte) int {
+	// Don't replace these by a switch without first
+	// confirming that it is being inlined.
+	if b&0x80 == 0x00 {
+		return 1
+	}
+	if b&0xE0 == 0xC0 {
+		return 2
+	}
+	if b&0xF0 == 0xE0 {
+		return 3
+	}
+	if b&0xF8 == 0xF0 {
+		return 4
+	}
+	return 0
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/LICENSE
----------------------------------------------------------------------
diff --git a/newt/LICENSE b/newt/LICENSE
new file mode 100644
index 0000000..8f71f43
--- /dev/null
+++ b/newt/LICENSE
@@ -0,0 +1,202 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/README.md
----------------------------------------------------------------------
diff --git a/newt/README.md b/newt/README.md
new file mode 100644
index 0000000..2e46929
--- /dev/null
+++ b/newt/README.md
@@ -0,0 +1,3 @@
+# Newt OS 
+
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/build.go
----------------------------------------------------------------------
diff --git a/newt/cli/build.go b/newt/cli/build.go
new file mode 100644
index 0000000..9e52ddf
--- /dev/null
+++ b/newt/cli/build.go
@@ -0,0 +1,222 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cli
+
+import (
+	"os"
+)
+
+// Recursively iterates through an egg's dependencies, adding each egg
+// encountered to the supplied set.
+func collectDepsAux(clutch *Clutch, egg *Egg, set *map[*Egg]bool) error {
+	if (*set)[egg] {
+		return nil
+	}
+
+	(*set)[egg] = true
+
+	for _, dep := range egg.Deps {
+		if dep.Name == "" {
+			break
+		}
+
+		// Get egg structure
+		degg, err := clutch.ResolveEggName(dep.Name)
+		if err != nil {
+			return err
+		}
+
+		collectDepsAux(clutch, degg, set)
+	}
+
+	return nil
+}
+
+// Recursively iterates through an egg's dependencies.  The resulting array
+// contains a pointer to each encountered egg.
+func collectDeps(clutch *Clutch, egg *Egg) ([]*Egg, error) {
+	set := map[*Egg]bool{}
+
+	err := collectDepsAux(clutch, egg, &set)
+	if err != nil {
+		return nil, err
+	}
+
+	arr := []*Egg{}
+	for p, _ := range set {
+		arr = append(arr, p)
+	}
+
+	return arr, nil
+}
+
+// Calculates the include paths exported by the specified egg and all of
+// its recursive dependencies.
+func recursiveIncludePaths(clutch *Clutch, egg *Egg,
+	t *Target) ([]string, error) {
+
+	deps, err := collectDeps(clutch, egg)
+	if err != nil {
+		return nil, err
+	}
+
+	incls := []string{}
+	for _, p := range deps {
+		eggIncls, err := p.GetIncludes(t)
+		if err != nil {
+			return nil, err
+		}
+		incls = append(incls, eggIncls...)
+	}
+
+	return incls, nil
+}
+
+// Calculates the include paths exported by the specified target's BSP and all
+// of its recursive dependencies.
+func BspIncludePaths(clutch *Clutch, t *Target) ([]string, error) {
+	if t.Bsp == "" {
+		return nil, NewNewtError("Expected a BSP")
+	}
+
+	bspEgg, err := clutch.ResolveEggName(t.Bsp)
+	if err != nil {
+		return nil, NewNewtError("No BSP egg for " + t.Bsp + " exists")
+	}
+
+	return recursiveIncludePaths(clutch, bspEgg, t)
+}
+
+func buildBsp(t *Target, clutch *Clutch, incls *[]string,
+	libs *[]string, capEggs map[string]string) (string, error) {
+
+	if t.Bsp == "" {
+		return "", NewNewtError("Expected a BSP")
+	}
+
+	bspEgg, err := clutch.ResolveEggName(t.Bsp)
+	if err != nil {
+		return "", NewNewtError("No BSP egg for " + t.Bsp + " exists")
+	}
+
+	if err = clutch.Build(t, t.Bsp, *incls, libs); err != nil {
+		return "", err
+	}
+
+	// A BSP doesn't have to contain source; don't fail if no library was
+	// built.
+	if lib := clutch.GetEggLib(t, bspEgg); NodeExist(lib) {
+		*libs = append(*libs, lib)
+	}
+
+	var linkerScript string
+	if bspEgg.LinkerScript != "" {
+		linkerScript = bspEgg.BasePath + "/" + bspEgg.LinkerScript
+	} else {
+		linkerScript = ""
+	}
+
+	return linkerScript, nil
+}
+
+// Creates the set of compiler flags that should be specified when building a
+// particular target-entity pair.  The "entity" is what is being built; either
+// an egg or a project.
+func CreateCflags(clutch *Clutch, c *Compiler, t *Target,
+	entityCflags string) string {
+
+	cflags := c.Cflags + " " + entityCflags + " " + t.Cflags
+
+	// The 'test' identity causes the TEST symbol to be defined.  This allows
+	// egg code to behave differently in test builds.
+	if t.HasIdentity("test") {
+		cflags += " -DTEST"
+	}
+
+	cflags += " -DARCH_" + t.Arch
+
+	// If a non-BSP egg is being built, add the BSP's C flags to the list.
+	// The BSP's compiler flags get exported to all eggs.
+	bspEgg, err := clutch.ResolveEggName(t.Bsp)
+	if err == nil && bspEgg.Cflags != entityCflags {
+		cflags += " " + bspEgg.Cflags
+	}
+
+	return cflags
+}
+
+func EggIncludeDirs(egg *Egg, t *Target) []string {
+	srcDir := egg.BasePath + "/src/"
+
+	incls := egg.Includes
+	incls = append(incls, srcDir)
+	incls = append(incls, srcDir+"/arch/"+t.Arch)
+
+	if t.HasIdentity("test") {
+		testSrcDir := srcDir + "/test"
+		incls = append(incls, testSrcDir)
+		incls = append(incls, testSrcDir+"/arch/"+t.Arch)
+	}
+
+	return incls
+}
+
+// Recursively compiles all the .c and .s files in the specified directory.
+// Architecture-specific files are also compiled.
+func BuildDir(srcDir string, c *Compiler, t *Target, ignDirs []string) error {
+	var err error
+
+	StatusMessage(VERBOSITY_VERBOSE, "compiling src in base directory: %s\n",
+		srcDir)
+
+	// First change into the egg src directory, and build all the objects
+	// there
+	os.Chdir(srcDir)
+
+	// Don't recurse into destination directories.
+	ignDirs = append(ignDirs, "obj")
+	ignDirs = append(ignDirs, "bin")
+
+	// Ignore architecture-specific source files for now.  Use a temporary
+	// string array here so that the "arch" directory is not ignored in the
+	// subsequent architecture-specific compile phase.
+	baseIgnDirs := append(ignDirs, "arch")
+
+	if err = c.RecursiveCompile("*.c", 0, baseIgnDirs); err != nil {
+		return err
+	}
+
+	archDir := srcDir + "/arch/" + t.Arch + "/"
+	StatusMessage(VERBOSITY_VERBOSE,
+		"compiling architecture specific src eggs in directory: %s\n",
+		archDir)
+
+	if NodeExist(archDir) {
+		if err := os.Chdir(archDir); err != nil {
+			return NewNewtError(err.Error())
+		}
+		if err := c.RecursiveCompile("*.c", 0, ignDirs); err != nil {
+			return err
+		}
+
+		// compile assembly sources in recursive compile as well
+		if err = c.RecursiveCompile("*.s", 1, ignDirs); err != nil {
+			return err
+		}
+	}
+
+	return nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/clutch.go
----------------------------------------------------------------------
diff --git a/newt/cli/clutch.go b/newt/cli/clutch.go
new file mode 100644
index 0000000..3d59fc3
--- /dev/null
+++ b/newt/cli/clutch.go
@@ -0,0 +1,1002 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cli
+
+import (
+	"bytes"
+	"fmt"
+	"github.com/spf13/viper"
+	"io/ioutil"
+	"log"
+	"os"
+	"path/filepath"
+	"strings"
+)
+
+type Clutch struct {
+	// Nestsitory associated with the Eggs
+	Nest *Nest
+
+	// List of packages for Nest
+	Eggs map[string]*Egg
+
+	EggShells map[string]*EggShell
+
+	Name string
+
+	LarvaFile string
+
+	RemoteUrl string
+
+	Branch string
+}
+
+// Allocate a new package manager structure, and initialize it.
+func NewClutch(nest *Nest) (*Clutch, error) {
+	clutch := &Clutch{
+		Nest: nest,
+	}
+	err := clutch.Init()
+
+	return clutch, err
+}
+
+func (clutch *Clutch) LoadConfigs(t *Target, force bool) error {
+	for _, egg := range clutch.Eggs {
+		if err := egg.LoadConfig(t, force); err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+func (clutch *Clutch) CheckEggDeps(egg *Egg,
+	deps map[string]*DependencyRequirement,
+	reqcap map[string]*DependencyRequirement,
+	caps map[string]*DependencyRequirement,
+	capEggs map[string]string) error {
+
+	for _, depReq := range egg.Deps {
+		// don't process this package if we've already processed it
+		if _, ok := deps[depReq.String()]; ok {
+			continue
+		}
+
+		eggName := egg.Name
+		StatusMessage(VERBOSITY_VERBOSE,
+			"Checking dependency %s for package %s\n", depReq.Name, eggName)
+		egg, ok := clutch.Eggs[depReq.Name]
+		if !ok {
+			return NewNewtError(
+				fmt.Sprintf("No package dependency %s found for %s",
+					depReq.Name, eggName))
+		}
+
+		if ok := depReq.SatisfiesDependency(egg); !ok {
+			return NewNewtError(fmt.Sprintf("Egg %s doesn't satisfy dependency %s",
+				egg.Name, depReq))
+		}
+
+		// We've checked this dependency requirement, all is gute!
+		deps[depReq.String()] = depReq
+	}
+
+	for _, reqCap := range egg.ReqCapabilities {
+		reqcap[reqCap.String()] = reqCap
+	}
+
+	for _, cap := range egg.Capabilities {
+		if caps[cap.String()] != nil && capEggs[cap.String()] != egg.FullName {
+			return NewNewtError(fmt.Sprintf("Multiple eggs with capability %s",
+				cap.String()))
+		}
+		caps[cap.String()] = cap
+		if capEggs != nil {
+			capEggs[cap.String()] = egg.FullName
+		}
+	}
+
+	// Now go through and recurse through the sub-package dependencies
+	for _, depReq := range egg.Deps {
+		if _, ok := deps[depReq.String()]; ok {
+			continue
+		}
+
+		if err := clutch.CheckEggDeps(clutch.Eggs[depReq.Name], deps,
+			reqcap, caps, capEggs); err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (clutch *Clutch) VerifyCaps(reqcaps map[string]*DependencyRequirement,
+	caps map[string]*DependencyRequirement) error {
+
+	for name, rcap := range reqcaps {
+		capability, ok := caps[name]
+		if !ok {
+			return NewNewtError(fmt.Sprintf("Required capability %s not found",
+				name))
+		}
+
+		if err := rcap.SatisfiesCapability(capability); err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (clutch *Clutch) CheckDeps() error {
+	// Go through all the packages and check that their dependencies are satisfied
+	for _, egg := range clutch.Eggs {
+		deps := map[string]*DependencyRequirement{}
+		reqcap := map[string]*DependencyRequirement{}
+		caps := map[string]*DependencyRequirement{}
+
+		if err := clutch.CheckEggDeps(egg, deps, reqcap, caps, nil); err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+// Load an individual package specified by eggName into the package list for
+// this repository
+func (clutch *Clutch) loadEgg(eggDir string, eggPrefix string,
+	eggName string) error {
+	StatusMessage(VERBOSITY_VERBOSE, "Loading Egg "+eggDir+"...\n")
+
+	if clutch.Eggs == nil {
+		clutch.Eggs = make(map[string]*Egg)
+	}
+
+	egg, err := NewEgg(clutch.Nest, eggDir)
+	if err != nil {
+		return nil
+	}
+
+	clutch.Eggs[eggPrefix+eggName] = egg
+
+	return nil
+}
+
+func (clutch *Clutch) String() string {
+	str := ""
+	for eggName, _ := range clutch.Eggs {
+		str += eggName + " "
+	}
+	return str
+}
+
+// Recursively load a package.  Given the baseDir of the packages (e.g. egg/ or
+// hw/bsp), and the base package name.
+func (clutch *Clutch) loadEggDir(baseDir string, eggPrefix string,
+	eggName string) error {
+	log.Printf("[DEBUG] Loading eggs in %s, starting with egg %s",
+		baseDir, eggName)
+
+	// first recurse and load subpackages
+	list, err := ioutil.ReadDir(baseDir + "/" + eggName)
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	for _, ent := range list {
+		if !ent.IsDir() {
+			continue
+		}
+
+		name := ent.Name()
+
+		if name == "src" || name == "include" || strings.HasPrefix(name, ".") ||
+			name == "bin" {
+			continue
+		} else {
+			if err := clutch.loadEggDir(baseDir, eggPrefix,
+				eggName+"/"+name); err != nil {
+				return err
+			}
+		}
+	}
+
+	if NodeNotExist(baseDir + "/" + eggName + "/egg.yml") {
+		return nil
+	}
+
+	return clutch.loadEgg(baseDir+"/"+eggName, eggPrefix, eggName)
+}
+
+// Load all the packages in the repository into the package structure
+func (clutch *Clutch) loadEggs() error {
+	nest := clutch.Nest
+
+	// Multiple package directories to be searched
+	searchDirs := []string{
+		"compiler/",
+		"libs/",
+		"net/",
+		"hw/bsp/",
+		"hw/mcu/",
+		"hw/mcu/stm",
+		"hw/drivers/",
+		"hw/",
+		"project/",
+	}
+
+	for _, eggDir := range searchDirs {
+		eggBaseDir := nest.BasePath + "/" + eggDir
+
+		if NodeNotExist(eggBaseDir) {
+			continue
+		}
+
+		eggList, err := ioutil.ReadDir(eggBaseDir)
+		if err != nil {
+			return NewNewtError(err.Error())
+		}
+
+		for _, subEggDir := range eggList {
+			name := subEggDir.Name()
+			if filepath.HasPrefix(name, ".") || filepath.HasPrefix(name, "..") {
+				continue
+			}
+
+			if !subEggDir.IsDir() {
+				continue
+			}
+
+			if err = clutch.loadEggDir(eggBaseDir, eggDir, name); err != nil {
+				return err
+			}
+		}
+	}
+
+	return nil
+}
+
+// Initialize the package manager
+func (clutch *Clutch) Init() error {
+	if err := clutch.loadEggs(); err != nil {
+		return err
+	}
+
+	clutch.EggShells = map[string]*EggShell{}
+
+	return nil
+}
+
+// Resolve the package specified by eggName into a package structure.
+func (clutch *Clutch) ResolveEggName(eggName string) (*Egg, error) {
+	egg, ok := clutch.Eggs[eggName]
+	if !ok {
+		return nil, NewNewtError(fmt.Sprintf("Invalid egg '%s' specified "+
+			"(eggs = %s)", eggName, clutch))
+	}
+	return egg, nil
+}
+
+func (clutch *Clutch) ResolveEggShellName(eggName string) (*EggShell, error) {
+	eggShell, ok := clutch.EggShells[eggName]
+	if !ok {
+		return nil, NewNewtError(fmt.Sprintf("Invalid egg '%s' specified "+
+			"(eggs = %s)", eggName, clutch))
+	}
+	return eggShell, nil
+}
+
+func (clutch *Clutch) ResolveEggDir(eggDir string) (*Egg, error) {
+	eggDir = filepath.Clean(eggDir)
+	for name, egg := range clutch.Eggs {
+		if filepath.Clean(egg.BasePath) == eggDir {
+			return clutch.Eggs[name], nil
+		}
+	}
+	return nil, NewNewtError(fmt.Sprintf("Cannot resolve package dir %s in "+
+		"package manager", eggDir))
+}
+
+// Clean the build for the package specified by eggName.   if cleanAll is
+// specified, all architectures are cleaned.
+func (clutch *Clutch) BuildClean(t *Target, eggName string, cleanAll bool) error {
+	egg, err := clutch.ResolveEggName(eggName)
+	if err != nil {
+		return err
+	}
+
+	if err := egg.LoadConfig(t, false); err != nil {
+		return err
+	}
+
+	tName := t.Name + "/"
+	if cleanAll {
+		tName = ""
+	}
+
+	if egg.Clean {
+		return nil
+	}
+	egg.Clean = true
+
+	for _, dep := range egg.Deps {
+		if err := clutch.BuildClean(t, dep.Name, cleanAll); err != nil {
+			return err
+		}
+	}
+
+	c, err := NewCompiler(t.GetCompiler(), t.Cdef, t.Name, []string{})
+	if err != nil {
+		return err
+	}
+
+	if NodeExist(egg.BasePath + "/src/") {
+		if err := c.RecursiveClean(egg.BasePath+"/src/", tName); err != nil {
+			return err
+		}
+
+		if err := os.RemoveAll(egg.BasePath + "/bin/" + tName); err != nil {
+			return NewNewtError(err.Error())
+		}
+	}
+
+	egg.Clean = true
+
+	return nil
+}
+
+func (clutch *Clutch) GetEggLib(t *Target, egg *Egg) string {
+	libDir := egg.BasePath + "/bin/" + t.Name + "/" +
+		"lib" + filepath.Base(egg.Name) + ".a"
+	return libDir
+}
+
+// @param incls                 Extra include paths that get specified during
+//                                  build; not modified by this function.
+// @param libs                  List of libraries that have been built so far;
+//                                  This function appends entries to this list.
+func (clutch *Clutch) buildDeps(egg *Egg, t *Target, incls *[]string,
+	libs *[]string) error {
+
+	StatusMessage(VERBOSITY_VERBOSE,
+		"Building egg dependencies for %s, target %s\n", egg.Name, t.Name)
+
+	var err error
+
+	if egg.Includes, err = egg.GetIncludes(t); err != nil {
+		return err
+	}
+
+	if incls == nil {
+		incls = &[]string{}
+	}
+	if libs == nil {
+		libs = &[]string{}
+	}
+
+	for _, dep := range egg.Deps {
+		if dep.Name == "" {
+			break
+		}
+
+		log.Printf("[DEBUG] Loading package dependency: %s", dep.Name)
+		// Get package structure
+		degg, err := clutch.ResolveEggName(dep.Name)
+		if err != nil {
+			return err
+		}
+
+		// Build the package
+		if err = clutch.Build(t, dep.Name, *incls, libs); err != nil {
+			return err
+		}
+
+		// After build, get dependency package includes.  Build function
+		// generates all the package includes
+		egg.Includes = append(egg.Includes, degg.Includes...)
+		if lib := clutch.GetEggLib(t, degg); NodeExist(lib) {
+			*libs = append(*libs, lib)
+		}
+	}
+
+	// Add on dependency includes to package includes
+	log.Printf("[DEBUG] Egg dependencies for %s built, incls = %s",
+		egg.Name, egg.Includes)
+
+	return nil
+}
+
+// Build the package specified by eggName
+//
+// @param incls            Extra include paths that get specified during
+//                             build.  Note: passed by value.
+// @param lib              List of libraries that have been built so far;
+//                             This function appends entries to this list.
+func (clutch *Clutch) Build(t *Target, eggName string, incls []string,
+	libs *[]string) error {
+
+	// Look up package structure
+	egg, err := clutch.ResolveEggName(eggName)
+	if err != nil {
+		return err
+	}
+
+	if err := egg.LoadConfig(t, false); err != nil {
+		return err
+	}
+
+	// already built the package, no need to rebuild.  This is to handle
+	// recursive calls to Build()
+	if egg.Built {
+		return nil
+	}
+	egg.Built = true
+
+	if err := clutch.buildDeps(egg, t, &incls, libs); err != nil {
+		return err
+	}
+
+	StatusMessage(VERBOSITY_VERBOSE, "Building egg %s for arch %s\n",
+		eggName, t.Arch)
+
+	// NOTE: this assignment must happen after the call to buildDeps(), as
+	// buildDeps() fills in the package includes.
+	incls = append(incls, EggIncludeDirs(egg, t)...)
+	log.Printf("[DEBUG] Egg includes for %s are %s", eggName, incls)
+
+	srcDir := egg.BasePath + "/src/"
+	if NodeNotExist(srcDir) {
+		// nothing to compile, return true!
+		return nil
+	}
+
+	// Build the package designated by eggName
+	// Initialize a compiler
+	c, err := NewCompiler(t.GetCompiler(), t.Cdef, t.Name, incls)
+	if err != nil {
+		return err
+	}
+	// setup Cflags, Lflags and Aflags
+	c.Cflags = CreateCflags(clutch, c, t, egg.Cflags)
+	c.Lflags += " " + egg.Lflags + " " + t.Lflags
+	c.Aflags += " " + egg.Aflags + " " + t.Aflags
+
+	log.Printf("[DEBUG] compiling src eggs in base egg directory: %s", srcDir)
+
+	// For now, ignore test code.  Tests get built later if the test identity
+	// is in effect.
+	ignDirs := []string{"test"}
+
+	if err = BuildDir(srcDir, c, t, ignDirs); err != nil {
+		return err
+	}
+
+	// Now build the test code if requested.
+	if t.HasIdentity("test") {
+		testSrcDir := srcDir + "/test"
+		if err = BuildDir(testSrcDir, c, t, ignDirs); err != nil {
+			return err
+		}
+	}
+
+	// Archive everything into a static library, which can be linked with a
+	// main program
+	if err := os.Chdir(egg.BasePath + "/"); err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	binDir := egg.BasePath + "/bin/" + t.Name + "/"
+
+	if NodeNotExist(binDir) {
+		if err := os.MkdirAll(binDir, 0755); err != nil {
+			return NewNewtError(err.Error())
+		}
+	}
+
+	if err = c.CompileArchive(clutch.GetEggLib(t, egg), []string{}); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Check the include directories for the package, to make sure there are
+// no conflicts in include paths for source code
+func (clutch *Clutch) checkIncludes(egg *Egg) error {
+	incls, err := filepath.Glob(egg.BasePath + "/include/*")
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	// Append all the architecture specific directories
+	archDir := egg.BasePath + "/include/" + egg.Name + "/arch/"
+	dirs, err := ioutil.ReadDir(archDir)
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	for _, dir := range dirs {
+		if !dir.IsDir() {
+			return NewNewtError(fmt.Sprintf(
+				"Only directories are allowed in architecture dir: %s",
+				archDir+dir.Name()))
+		}
+
+		incls2, err := filepath.Glob(archDir + dir.Name() + "/*")
+		if err != nil {
+			return NewNewtError(err.Error())
+		}
+
+		incls = append(incls, incls2...)
+	}
+
+	for _, incl := range incls {
+		finfo, err := os.Stat(incl)
+		if err != nil {
+			return NewNewtError(err.Error())
+		}
+
+		bad := false
+		if !finfo.IsDir() {
+			bad = true
+		}
+
+		if filepath.Base(incl) != egg.Name {
+			if egg.IsBsp && filepath.Base(incl) != "bsp" {
+				bad = true
+			}
+		}
+
+		if bad {
+			return NewNewtError(fmt.Sprintf("File %s should not exist"+
+				"in include directory, only file allowed in include "+
+				"directory is a directory with the package name %s",
+				incl, egg.Name))
+		}
+	}
+
+	return nil
+}
+
+// Clean the tests in the tests parameter, for the package identified by
+// eggName.  If cleanAll is set to true, all architectures will be removed.
+func (clutch *Clutch) TestClean(t *Target, eggName string,
+	cleanAll bool) error {
+	egg, err := clutch.ResolveEggName(eggName)
+	if err != nil {
+		return err
+	}
+
+	if err := egg.LoadConfig(t, false); err != nil {
+		return err
+	}
+
+	tName := t.Name + "/"
+	if cleanAll {
+		tName = ""
+	}
+
+	if err := os.RemoveAll(egg.BasePath + "/src/test/bin/" + tName); err != nil {
+		return NewNewtError(err.Error())
+	}
+	if err := os.RemoveAll(egg.BasePath + "/src/test/obj/" + tName); err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	return nil
+}
+
+// Compile tests specified by the tests parameter.  The tests are linked
+// to the package specified by the egg parameter
+func (clutch *Clutch) linkTests(t *Target, egg *Egg,
+	incls []string, libs *[]string) error {
+
+	c, err := NewCompiler(t.GetCompiler(), t.Cdef, t.Name, incls)
+	if err != nil {
+		return err
+	}
+
+	// Configure Lflags.  Since we are only linking, Cflags and Aflags are
+	// unnecessary.
+	c.Lflags += " " + egg.Lflags + " " + t.Lflags
+
+	testBinDir := egg.BasePath + "/src/test/bin/" + t.Name + "/"
+	binFile := testBinDir + egg.TestBinName()
+	options := map[string]bool{}
+
+	// Determine if the test executable is already up to date.
+	linkRequired, err := c.depTracker.LinkRequired(binFile, options, *libs)
+	if err != nil {
+		return err
+	}
+
+	// Build the test executable if necessary.
+	if linkRequired {
+		if NodeNotExist(testBinDir) {
+			if err := os.MkdirAll(testBinDir, 0755); err != nil {
+				return NewNewtError(err.Error())
+			}
+		}
+
+		err = c.CompileBinary(binFile, options, *libs)
+		if err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+// Run all the tests in the tests parameter.  egg is the package to check for
+// the tests.  exitOnFailure specifies whether to exit immediately when a
+// test fails, or continue executing all tests.
+func (clutch *Clutch) runTests(t *Target, egg *Egg, exitOnFailure bool) error {
+	StatusMessage(VERBOSITY_DEFAULT, "Testing egg %s for arch %s\n",
+		egg.Name, t.Arch)
+
+	if err := os.Chdir(egg.BasePath + "/src/test/bin/" + t.Name +
+		"/"); err != nil {
+		return err
+	}
+
+	o, err := ShellCommand("./" + egg.TestBinName())
+	if err != nil {
+		StatusMessage(VERBOSITY_DEFAULT, "%s", string(o))
+
+		// Always terminate on test failure since only one test is being run.
+		return NewtErrorNoTrace(fmt.Sprintf("Test %s failed",
+			egg.TestBinName()))
+	} else {
+		StatusMessage(VERBOSITY_VERBOSE, "%s", string(o))
+		StatusMessage(VERBOSITY_DEFAULT, "Test %s ok!\n", egg.TestBinName())
+		return nil
+	}
+}
+
+// Check to ensure tests exist.  Go through the array of tests specified by
+// the tests parameter.  egg is the package to check for these tests.
+func (clutch *Clutch) testsExist(egg *Egg) error {
+	dirName := egg.BasePath + "/src/test/"
+	if NodeNotExist(dirName) {
+		return NewNewtError("No test exists for package " + egg.Name)
+	}
+
+	return nil
+}
+
+// Test the package identified by eggName, by executing the tests specified.
+// exitOnFailure signifies whether to stop the test program when one of them
+// fails.
+func (clutch *Clutch) Test(t *Target, eggName string,
+	exitOnFailure bool) error {
+
+	// A few identities are implicitly exported when the test command is used:
+	// *    test:       ensures that the test code gets compiled.
+	// *    selftest:   indicates that there is no project
+	t.Identities["test"] = "test"
+	t.Identities["selftest"] = "selftest"
+
+	egg, err := clutch.ResolveEggName(eggName)
+	if err != nil {
+		return err
+	}
+
+	if err := egg.LoadConfig(t, false); err != nil {
+		return err
+	}
+
+	// Make sure the test directories exist
+	if err := clutch.testsExist(egg); err != nil {
+		return err
+	}
+
+	// The egg under test must be compiled with the PKG_TEST symbol defined so
+	// that the appropriate main function gets built.
+	egg.Cflags += " -DPKG_TEST"
+
+	incls := []string{}
+	libs := []string{}
+
+	// If there is a BSP:
+	//     1. Calculate the include paths that it and its dependencies export.
+	//        This set of include paths is accessible during all subsequent
+	//        builds.
+	//     2. Build the BSP package.
+	if t.Bsp != "" {
+		incls, err = BspIncludePaths(clutch, t)
+		if err != nil {
+			return err
+		}
+		_, err = buildBsp(t, clutch, &incls, &libs, nil)
+		if err != nil {
+			return err
+		}
+	}
+
+	// Build the package under test.
+	if err := clutch.Build(t, eggName, incls, &libs); err != nil {
+		return err
+	}
+	lib := clutch.GetEggLib(t, egg)
+	if !NodeExist(lib) {
+		return NewNewtError("Egg " + eggName + " did not produce binary")
+	}
+	libs = append(libs, lib)
+
+	// Compile the package's test code.
+	if err := clutch.linkTests(t, egg, incls, &libs); err != nil {
+		return err
+	}
+
+	// Run the tests.
+	if err := clutch.runTests(t, egg, exitOnFailure); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (cl *Clutch) LoadFromClutch(local *Clutch) error {
+	var err error
+	for _, egg := range local.Eggs {
+		if err := egg.LoadConfig(nil, false); err != nil {
+			return err
+		}
+
+		log.Printf("[DEBUG] Egg %s loaded, putting it into clutch %s",
+			egg.FullName, local.Name)
+
+		eggShell := &EggShell{}
+		eggShell.FullName = egg.FullName
+		eggShell.Deps = egg.Deps
+		eggShell.Caps = egg.Capabilities
+		eggShell.ReqCaps = egg.ReqCapabilities
+		eggShell.Version = egg.Version
+		eggShell.Hash, err = egg.GetHash()
+		if err != nil {
+			return err
+		}
+
+		cl.EggShells[eggShell.FullName] = eggShell
+	}
+
+	return nil
+}
+
+func (cl *Clutch) Serialize() (string, error) {
+	clStr := "name: " + cl.Name + "\n"
+	clStr = clStr + "url: " + cl.RemoteUrl + "\n"
+	clStr = clStr + "eggs:\n"
+
+	buf := bytes.Buffer{}
+
+	indent := "    "
+	for _, eggShell := range cl.EggShells {
+		buf.WriteString(eggShell.Serialize(indent))
+	}
+
+	return clStr + buf.String(), nil
+}
+
+func (cl *Clutch) strSliceToDr(list []string) ([]*DependencyRequirement, error) {
+	drList := []*DependencyRequirement{}
+
+	for _, name := range list {
+		req, err := NewDependencyRequirementParseString(name)
+		if err != nil {
+			return nil, err
+		}
+		drList = append(drList, req)
+	}
+
+	if len(drList) == 0 {
+		return nil, nil
+	} else {
+		return drList, nil
+	}
+}
+
+func (cl *Clutch) fileToEggList(cfg *viper.Viper) (map[string]*EggShell,
+	error) {
+	eggMap := cfg.GetStringMap("eggs")
+
+	eggList := map[string]*EggShell{}
+
+	for name, _ := range eggMap {
+		eggShell, err := NewEggShell(cl)
+		if err != nil {
+			return nil, err
+		}
+		eggShell.FullName = name
+
+		eggDef := cfg.GetStringMap("eggs." + name)
+		eggShell.Version, err = NewVersParseString(eggDef["vers"].(string))
+		if err != nil {
+			return nil, err
+		}
+
+		eggShell.Deps, err = cl.strSliceToDr(
+			cfg.GetStringSlice("eggs." + name + ".deps"))
+		if err != nil {
+			return nil, err
+		}
+
+		eggShell.Caps, err = cl.strSliceToDr(
+			cfg.GetStringSlice("eggs." + name + ".caps"))
+		if err != nil {
+			return nil, err
+		}
+
+		eggShell.ReqCaps, err = cl.strSliceToDr(
+			cfg.GetStringSlice("eggs." + name + ".req_caps"))
+		if err != nil {
+			return nil, err
+		}
+
+		eggList[name] = eggShell
+	}
+
+	return eggList, nil
+}
+
+// Create the manifest file name, it's the manifest dir + manifest name +
+// branch and a.yml extension
+func (clutch *Clutch) GetClutchFile(name string, branch string) string {
+	return name + "@" + branch
+}
+
+func (clutch *Clutch) GetClutchFullFile(name string, branch string) string {
+	return clutch.Nest.ClutchPath + clutch.GetClutchFile(name, branch) + ".yml"
+}
+
+func (clutch *Clutch) Load(name string) error {
+	cfg, err := ReadConfig(clutch.Nest.ClutchPath, name)
+	if err != nil {
+		return err
+	}
+
+	clutchName := name
+	branchName := "master"
+
+	parts := strings.Split(name, "@")
+	if len(parts) == 2 {
+		clutchName = parts[0]
+		branchName = parts[1]
+	}
+
+	if cfg.GetString("name") != clutchName {
+		return NewNewtError(
+			fmt.Sprintf("Wrong name %s in remote larva file (expected %s)",
+				cfg.GetString("name"), clutchName))
+	}
+
+	clutch.Name = cfg.GetString("name")
+	clutch.Branch = branchName
+	clutch.RemoteUrl = cfg.GetString("url")
+
+	clutch.EggShells, err = clutch.fileToEggList(cfg)
+	if err != nil {
+		return err
+	}
+
+	clutch.Nest.Clutches[name] = clutch
+
+	return nil
+}
+
+func (cl *Clutch) Install(name string, url string, branch string) error {
+	clutchFile := cl.GetClutchFullFile(name, branch)
+
+	// XXX: Should warn if file already exists, and require force option
+	os.Remove(clutchFile)
+
+	// Download the manifest
+	dl, err := NewDownloader()
+	if err != nil {
+		return err
+	}
+
+	StatusMessage(VERBOSITY_DEFAULT, "Downloading clutch.yml from %s/"+
+		"%s...", url, branch)
+
+	if err := dl.DownloadFile(url, branch, "clutch.yml",
+		clutchFile); err != nil {
+		return err
+	}
+
+	StatusMessage(VERBOSITY_DEFAULT, OK_STRING)
+
+	// Load the manifest, and ensure that it is in the correct format
+	StatusMessage(VERBOSITY_DEFAULT, "Verifying clutch.yml format...\n")
+	if err := cl.Load(cl.GetClutchFile(name, branch)); err != nil {
+		os.Remove(clutchFile)
+		return err
+	}
+	StatusMessage(VERBOSITY_DEFAULT, OK_STRING)
+
+	return nil
+}
+
+func (clutch *Clutch) InstallEgg(eggName string, branch string,
+	downloaded []*RemoteNest) ([]*RemoteNest, error) {
+	log.Print("[VERBOSE] Looking for ", eggName)
+	egg, err := clutch.ResolveEggName(eggName)
+	if err == nil {
+		log.Printf("[VERBOSE] ", eggName, " installed already")
+		return downloaded, nil
+	}
+	nest := clutch.Nest
+	for _, remoteNest := range downloaded {
+		egg, err = remoteNest.ResolveEggName(eggName)
+		if err == nil {
+			log.Print("[VERBOSE] ", eggName, " present in downloaded clutch ",
+				remoteNest.Name)
+
+			err = remoteNest.fetchEgg(eggName, nest.BasePath)
+			if err != nil {
+				return downloaded, err
+			}
+
+			// update local clutch
+			err = clutch.loadEggDir(nest.BasePath, "", eggName)
+			if err != nil {
+				return downloaded, err
+			}
+
+			deps, err := egg.GetDependencies()
+			if err != nil {
+				return downloaded, err
+			}
+			for _, dep := range deps {
+				log.Print("[VERBOSE] ", eggName, " checking dependency ",
+					dep.Name)
+				depBranch := dep.BranchName()
+				downloaded, err = clutch.InstallEgg(dep.Name, depBranch,
+					downloaded)
+				if err != nil {
+					return downloaded, err
+				}
+			}
+			return downloaded, nil
+		}
+	}
+
+	// Not in downloaded clutches
+	clutches, err := nest.GetClutches()
+	if err != nil {
+		return downloaded, err
+	}
+	for _, remoteClutch := range clutches {
+		eggShell, err := remoteClutch.ResolveEggShellName(eggName)
+		if err == nil {
+			log.Print("[VERBOSE] ", eggName, " present in remote clutch ",
+				remoteClutch.Name, remoteClutch.Branch)
+			if branch == "" {
+				branch = remoteClutch.Branch
+			}
+			remoteNest, err := NewRemoteNest(remoteClutch, branch)
+			if err != nil {
+				return downloaded, err
+			}
+			downloaded = append(downloaded, remoteNest)
+			return clutch.InstallEgg(eggShell.FullName, branch, downloaded)
+		}
+	}
+
+	return downloaded, NewNewtError(fmt.Sprintf("No package %s found\n", eggName))
+}


[32/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/.gitignore b/Godeps/_workspace/src/github.com/spf13/cobra/.gitignore
deleted file mode 100644
index 36d1a84..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/.gitignore
+++ /dev/null
@@ -1,24 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-
-cobra.test

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/.travis.yml
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/.travis.yml b/Godeps/_workspace/src/github.com/spf13/cobra/.travis.yml
deleted file mode 100644
index dc43afd..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/.travis.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-language: go
-go:
-  - 1.3
-  - 1.4.2
-  - tip
-script:
-  - go test ./...
-  - go build

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt b/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt
deleted file mode 100644
index 298f0e2..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt
+++ /dev/null
@@ -1,174 +0,0 @@
-                                Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/README.md b/Godeps/_workspace/src/github.com/spf13/cobra/README.md
deleted file mode 100644
index b1fb088..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/README.md
+++ /dev/null
@@ -1,485 +0,0 @@
-# Cobra
-
-A Commander for modern go CLI interactions
-
-[![Build Status](https://travis-ci.org/spf13/cobra.svg)](https://travis-ci.org/spf13/cobra)
-
-## Overview
-
-Cobra is a commander providing a simple interface to create powerful modern CLI
-interfaces similar to git & go tools. In addition to providing an interface, Cobra
-simultaneously provides a controller to organize your application code.
-
-Inspired by go, go-Commander, gh and subcommand, Cobra improves on these by
-providing **fully posix compliant flags** (including short & long versions),
-**nesting commands**, and the ability to **define your own help and usage** for any or
-all commands.
-
-Cobra has an exceptionally clean interface and simple design without needless
-constructors or initialization methods.
-
-Applications built with Cobra commands are designed to be as user friendly as
-possible. Flags can be placed before or after the command (as long as a
-confusing space isn’t provided). Both short and long flags can be used. A
-command need not even be fully typed. The shortest unambiguous string will
-suffice. Help is automatically generated and available for the application or
-for a specific command using either the help command or the --help flag.
-
-## Concepts
-
-Cobra is built on a structure of commands & flags.
-
-**Commands** represent actions and **Flags** are modifiers for those actions.
-
-In the following example 'server' is a command and 'port' is a flag.
-
-    hugo server --port=1313
-
-### Commands
-
-Command is the central point of the application. Each interaction that
-the application supports will be contained in a Command. A command can
-have children commands and optionally run an action.
-
-In the example above 'server' is the command
-
-A Command has the following structure:
-
-    type Command struct {
-        Use string // The one-line usage message.
-        Short string // The short description shown in the 'help' output.
-        Long string // The long message shown in the 'help <this-command>' output.
-        Run func(cmd *Command, args []string) // Run runs the command.
-    }
-
-### Flags
-
-A Flag is a way to modify the behavior of an command. Cobra supports
-fully posix compliant flags as well as the go flag package. 
-A Cobra command can define flags that persist through to children commands
-and flags that are only available to that command.
-
-In the example above 'port' is the flag.
-
-Flag functionality is provided by the [pflag
-library](https://github.com/ogier/pflag), a fork of the flag standard library
-which maintains the same interface while adding posix compliance.
-
-## Usage
-
-Cobra works by creating a set of commands and then organizing them into a tree.
-The tree defines the structure of the application.
-
-Once each command is defined with it's corresponding flags, then the
-tree is assigned to the commander which is finally executed.
-
-### Installing
-Using Cobra is easy. First use go get to install the latest version
-of the library.
-
-    $ go get github.com/spf13/cobra
-
-Next include cobra in your application.
-
-    import "github.com/spf13/cobra"
-
-### Create the root command
-
-The root command represents your binary itself.
-
-Cobra doesn't require any special constructors. Simply create your commands.
-
-    var HugoCmd = &cobra.Command{
-        Use:   "hugo",
-        Short: "Hugo is a very fast static site generator",
-        Long: `A Fast and Flexible Static Site Generator built with
-                love by spf13 and friends in Go.
-                Complete documentation is available at http://hugo.spf13.com`,
-        Run: func(cmd *cobra.Command, args []string) {
-            // Do Stuff Here
-        },
-    }
-
-### Create additional commands
-
-Additional commands can be defined.
-
-    var versionCmd = &cobra.Command{
-        Use:   "version",
-        Short: "Print the version number of Hugo",
-        Long:  `All software has versions. This is Hugo's`,
-        Run: func(cmd *cobra.Command, args []string) {
-            fmt.Println("Hugo Static Site Generator v0.9 -- HEAD")
-        },
-    }
-
-### Attach command to its parent
-In this example we are attaching it to the root, but commands can be attached at any level.
-
-	HugoCmd.AddCommand(versionCmd)
-
-### Assign flags to a command
-
-Since the flags are defined and used in different locations, we need to
-define a variable outside with the correct scope to assign the flag to
-work with.
-
-    var Verbose bool
-    var Source string
-
-There are two different approaches to assign a flag.
-
-#### Persistent Flags
-
-A flag can be 'persistent' meaning that this flag will be available to the
-command it's assigned to as well as every command under that command. For
-global flags assign a flag as a persistent flag on the root.
-
-	HugoCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output")
-
-#### Local Flags
-
-A flag can also be assigned locally which will only apply to that specific command.
-
-	HugoCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from")
-
-### Remove a command from its parent
-
-Removing a command is not a common action in simple programs but it allows 3rd parties to customize an existing command tree.
-
-In this example, we remove the existing `VersionCmd` command of an existing root command, and we replace it by our own version.
-
-	mainlib.RootCmd.RemoveCommand(mainlib.VersionCmd)
-	mainlib.RootCmd.AddCommand(versionCmd)
-
-### Once all commands and flags are defined, Execute the commands
-
-Execute should be run on the root for clarity, though it can be called on any command.
-
-    HugoCmd.Execute()
-
-## Example
-
-In the example below we have defined three commands. Two are at the top level
-and one (cmdTimes) is a child of one of the top commands. In this case the root
-is not executable meaning that a subcommand is required. This is accomplished
-by not providing a 'Run' for the 'rootCmd'.
-
-We have only defined one flag for a single command.
-
-More documentation about flags is available at https://github.com/spf13/pflag
-
-    import(
-        "github.com/spf13/cobra"
-        "fmt"
-        "strings"
-    )
-
-    func main() {
-
-        var echoTimes int
-
-        var cmdPrint = &cobra.Command{
-            Use:   "print [string to print]",
-            Short: "Print anything to the screen",
-            Long:  `print is for printing anything back to the screen.
-            For many years people have printed back to the screen.
-            `,
-            Run: func(cmd *cobra.Command, args []string) {
-                fmt.Println("Print: " + strings.Join(args, " "))
-            },
-        }
-
-        var cmdEcho = &cobra.Command{
-            Use:   "echo [string to echo]",
-            Short: "Echo anything to the screen",
-            Long:  `echo is for echoing anything back.
-            Echo works a lot like print, except it has a child command.
-            `,
-            Run: func(cmd *cobra.Command, args []string) {
-                fmt.Println("Print: " + strings.Join(args, " "))
-            },
-        }
-
-        var cmdTimes = &cobra.Command{
-            Use:   "times [# times] [string to echo]",
-            Short: "Echo anything to the screen more times",
-            Long:  `echo things multiple times back to the user by providing
-            a count and a string.`,
-            Run: func(cmd *cobra.Command, args []string) {
-                for i:=0; i < echoTimes; i++ {
-                    fmt.Println("Echo: " + strings.Join(args, " "))
-                }
-            },
-        }
-
-        cmdTimes.Flags().IntVarP(&echoTimes, "times", "t", 1, "times to echo the input")
-
-        var rootCmd = &cobra.Command{Use: "app"}
-        rootCmd.AddCommand(cmdPrint, cmdEcho)
-        cmdEcho.AddCommand(cmdTimes)
-        rootCmd.Execute()
-    }
-
-For a more complete example of a larger application, please checkout [Hugo](http://hugo.spf13.com)
-
-## The Help Command
-
-Cobra automatically adds a help command to your application when you have subcommands.
-This will be called when a user runs 'app help'. Additionally help will also
-support all other commands as input. Say for instance you have a command called
-'create' without any additional configuration cobra will work when 'app help
-create' is called.  Every command will automatically have the '--help' flag added.
-
-### Example
-
-The following output is automatically generated by cobra. Nothing beyond the
-command and flag definitions are needed.
-
-    > hugo help
-
-    A Fast and Flexible Static Site Generator built with
-    love by spf13 and friends in Go.
-
-    Complete documentation is available at http://hugo.spf13.com
-
-    Usage:
-      hugo [flags]
-      hugo [command]
-
-    Available Commands:
-      server          :: Hugo runs it's own a webserver to render the files
-      version         :: Print the version number of Hugo
-      check           :: Check content in the source directory
-      benchmark       :: Benchmark hugo by building a site a number of times
-      help [command]  :: Help about any command
-
-     Available Flags:
-      -b, --base-url="": hostname (and path) to the root eg. http://spf13.com/
-      -D, --build-drafts=false: include content marked as draft
-          --config="": config file (default is path/config.yaml|json|toml)
-      -d, --destination="": filesystem path to write files to
-      -s, --source="": filesystem path to read files relative from
-          --stepAnalysis=false: display memory and timing of different steps of the program
-          --uglyurls=false: if true, use /filename.html instead of /filename/
-      -v, --verbose=false: verbose output
-      -w, --watch=false: watch filesystem for changes and recreate as needed
-
-    Use "hugo help [command]" for more information about that command.
-
-
-
-Help is just a command like any other. There is no special logic or behavior
-around it. In fact you can provide your own if you want.
-
-### Defining your own help
-
-You can provide your own Help command or you own template for the default command to use.
-
-The default help command is 
-
-    func (c *Command) initHelp() {
-        if c.helpCommand == nil {
-            c.helpCommand = &Command{
-                Use:   "help [command]",
-                Short: "Help about any command",
-                Long: `Help provides help for any command in the application.
-        Simply type ` + c.Name() + ` help [path to command] for full details.`,
-                Run: c.HelpFunc(),
-            }
-        }
-        c.AddCommand(c.helpCommand)
-    }
-
-You can provide your own command, function or template through the following methods.
-
-    command.SetHelpCommand(cmd *Command)
-
-    command.SetHelpFunc(f func(*Command, []string))
-
-    command.SetHelpTemplate(s string)
-
-The latter two will also apply to any children commands.
-
-## Usage
-
-When the user provides an invalid flag or invalid command Cobra responds by
-showing the user the 'usage'
-
-### Example
-You may recognize this from the help above. That's because the default help
-embeds the usage as part of it's output.
-
-    Usage:
-      hugo [flags]
-      hugo [command]
-
-    Available Commands:
-      server          Hugo runs it's own a webserver to render the files
-      version         Print the version number of Hugo
-      check           Check content in the source directory
-      benchmark       Benchmark hugo by building a site a number of times
-      help [command]  Help about any command
-
-     Available Flags:
-      -b, --base-url="": hostname (and path) to the root eg. http://spf13.com/
-      -D, --build-drafts=false: include content marked as draft
-          --config="": config file (default is path/config.yaml|json|toml)
-      -d, --destination="": filesystem path to write files to
-      -s, --source="": filesystem path to read files relative from
-          --stepAnalysis=false: display memory and timing of different steps of the program
-          --uglyurls=false: if true, use /filename.html instead of /filename/
-      -v, --verbose=false: verbose output
-      -w, --watch=false: watch filesystem for changes and recreate as needed
-
-### Defining your own usage
-You can provide your own usage function or template for cobra to use.
-
-The default usage function is
-
-		return func(c *Command) error {
-			err := tmpl(c.Out(), c.UsageTemplate(), c)
-			return err
-		}
-
-Like help the function and template are over ridable through public methods.
-
-    command.SetUsageFunc(f func(*Command) error)
-
-    command.SetUsageTemplate(s string)
-
-## PreRun or PostRun Hooks
-
-It is possible to run functions before or after the main `Run` function of your command. The `PersistentPreRun` and `PreRun` functions will be executed before `Run`. `PersistendPostRun` and `PostRun` will be executed after `Run`.  The `Persistent*Run` functions will be inherrited by children if they do not declare their own.  These function are run in the following order:
-
-- `PersistentPreRun`
-- `PreRun`
-- `Run`
-- `PostRun`
-- `PersistenPostRun`
-
-And example of two commands which use all of these features is below.  When the subcommand in executed it will run the root command's `PersistentPreRun` but not the root command's `PersistentPostRun`
-
-```go
-package main
-
-import (
-	"fmt"
-
-	"github.com/spf13/cobra"
-)
-
-func main() {
-
-	var rootCmd = &cobra.Command{
-		Use:   "root [sub]",
-		Short: "My root command",
-		PersistentPreRun: func(cmd *cobra.Command, args []string) {
-			fmt.Printf("Inside rootCmd PersistentPreRun with args: %v\n", args)
-		},
-		PreRun: func(cmd *cobra.Command, args []string) {
-			fmt.Printf("Inside rootCmd PreRun with args: %v\n", args)
-		},
-		Run: func(cmd *cobra.Command, args []string) {
-			fmt.Printf("Inside rootCmd Run with args: %v\n", args)
-		},
-		PostRun: func(cmd *cobra.Command, args []string) {
-			fmt.Printf("Inside rootCmd PostRun with args: %v\n", args)
-		},
-		PersistentPostRun: func(cmd *cobra.Command, args []string) {
-			fmt.Printf("Inside rootCmd PersistentPostRun with args: %v\n", args)
-		},
-	}
-
-	var subCmd = &cobra.Command{
-		Use:   "sub [no options!]",
-		Short: "My sub command",
-		PreRun: func(cmd *cobra.Command, args []string) {
-			fmt.Printf("Inside subCmd PreRun with args: %v\n", args)
-		},
-		Run: func(cmd *cobra.Command, args []string) {
-			fmt.Printf("Inside subCmd Run with args: %v\n", args)
-		},
-		PostRun: func(cmd *cobra.Command, args []string) {
-			fmt.Printf("Inside subCmd PostRun with args: %v\n", args)
-		},
-		PersistentPostRun: func(cmd *cobra.Command, args []string) {
-			fmt.Printf("Inside subCmd PersistentPostRun with args: %v\n", args)
-		},
-	}
-
-	rootCmd.AddCommand(subCmd)
-
-	rootCmd.SetArgs([]string{""})
-	_ = rootCmd.Execute()
-	fmt.Print("\n")
-	rootCmd.SetArgs([]string{"sub", "arg1", "arg2"})
-	_ = rootCmd.Execute()
-}
-```
-
-## Generating markdown formatted documentation for your command
-
-Cobra can generate a markdown formatted document based on the subcommands, flags, etc. A simple example of how to do this for your command can be found in [Markdown Docs](md_docs.md)
-
-## Generating bash completions for your command
-
-Cobra can generate a bash completions file. If you add more information to your command these completions can be amazingly powerful and flexible.  Read more about [Bash Completions](bash_completions.md)
-
-## Debugging
-
-Cobra provides a ‘DebugFlags’ method on a command which when called will print
-out everything Cobra knows about the flags for each command
-
-### Example
-
-    command.DebugFlags()
-
-## Release Notes
-* **0.9.0** June 17, 2014
-  * flags can appears anywhere in the args (provided they are unambiguous)
-  * --help prints usage screen for app or command
-  * Prefix matching for commands
-  * Cleaner looking help and usage output
-  * Extensive test suite
-* **0.8.0** Nov 5, 2013
-  * Reworked interface to remove commander completely
-  * Command now primary structure
-  * No initialization needed
-  * Usage & Help templates & functions definable at any level
-  * Updated Readme
-* **0.7.0** Sept 24, 2013
-  * Needs more eyes
-  * Test suite
-  * Support for automatic error messages
-  * Support for help command
-  * Support for printing to any io.Writer instead of os.Stderr
-  * Support for persistent flags which cascade down tree
-  * Ready for integration into Hugo
-* **0.1.0** Sept 3, 2013
-  * Implement first draft
-
-## ToDo
-* Launch proper documentation site
-
-## Contributing
-
-1. Fork it
-2. Create your feature branch (`git checkout -b my-new-feature`)
-3. Commit your changes (`git commit -am 'Add some feature'`)
-4. Push to the branch (`git push origin my-new-feature`)
-5. Create new Pull Request
-
-## Contributors
-
-Names in no particular order:
-
-* [spf13](https://github.com/spf13)
-
-## License
-
-Cobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt)
-
-
-[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/spf13/cobra/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go b/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go
deleted file mode 100644
index 3a421bc..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go
+++ /dev/null
@@ -1,370 +0,0 @@
-package cobra
-
-import (
-	"bytes"
-	"fmt"
-	"os"
-	"sort"
-	"strings"
-
-	"github.com/spf13/pflag"
-)
-
-const (
-	BashCompFilenameExt     = "cobra_annotation_bash_completion_filename_extentions"
-	BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required_flag"
-)
-
-func preamble(out *bytes.Buffer) {
-	fmt.Fprintf(out, `#!/bin/bash
-
-
-__debug()
-{
-    if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
-        echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
-    fi
-}
-
-__index_of_word()
-{
-    local w word=$1
-    shift
-    index=0
-    for w in "$@"; do
-        [[ $w = "$word" ]] && return
-        index=$((index+1))
-    done
-    index=-1
-}
-
-__contains_word()
-{
-    local w word=$1; shift
-    for w in "$@"; do
-        [[ $w = "$word" ]] && return
-    done
-    return 1
-}
-
-__handle_reply()
-{
-    __debug "${FUNCNAME}"
-    case $cur in
-        -*)
-            compopt -o nospace
-            local allflags
-            if [ ${#must_have_one_flag[@]} -ne 0 ]; then
-                allflags=("${must_have_one_flag[@]}")
-            else
-                allflags=("${flags[*]} ${two_word_flags[*]}")
-            fi
-            COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") )
-            [[ $COMPREPLY == *= ]] || compopt +o nospace
-            return 0;
-            ;;
-    esac
-
-    # check if we are handling a flag with special work handling
-    local index
-    __index_of_word "${prev}" "${flags_with_completion[@]}"
-    if [[ ${index} -ge 0 ]]; then
-        ${flags_completion[${index}]}
-        return
-    fi
-
-    # we are parsing a flag and don't have a special handler, no completion
-    if [[ ${cur} != "${words[cword]}" ]]; then
-        return
-    fi
-
-    local completions
-    if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
-        completions=("${must_have_one_flag[@]}")
-    elif [[ ${#must_have_one_noun[@]} -ne 0 ]]; then
-        completions=("${must_have_one_noun[@]}")
-    else
-        completions=("${commands[@]}")
-    fi
-    COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") )
-
-    if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
-        declare -F __custom_func >/dev/null && __custom_func
-    fi
-}
-
-# The arguments should be in the form "ext1|ext2|extn"
-__handle_filename_extension_flag()
-{
-    local ext="$1"
-    _filedir "@(${ext})"
-}
-
-__handle_flag()
-{
-    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
-
-    # if a command required a flag, and we found it, unset must_have_one_flag()
-    local flagname=${words[c]}
-    # if the word contained an =
-    if [[ ${words[c]} == *"="* ]]; then
-        flagname=${flagname%%=*} # strip everything after the =
-        flagname="${flagname}=" # but put the = back
-    fi
-    __debug "${FUNCNAME}: looking for ${flagname}"
-    if __contains_word "${flagname}" "${must_have_one_flag[@]}"; then
-        must_have_one_flag=()
-    fi
-
-    # skip the argument to a two word flag
-    if __contains_word "${words[c]}" "${two_word_flags[@]}"; then
-        c=$((c+1))
-        # if we are looking for a flags value, don't show commands
-        if [[ $c -eq $cword ]]; then
-            commands=()
-        fi
-    fi
-
-    # skip the flag itself
-    c=$((c+1))
-
-}
-
-__handle_noun()
-{
-    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
-
-    if __contains_word "${words[c]}" "${must_have_one_noun[@]}"; then
-        must_have_one_noun=()
-    fi
-
-    nouns+=("${words[c]}")
-    c=$((c+1))
-}
-
-__handle_command()
-{
-    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
-
-    local next_command
-    if [[ -n ${last_command} ]]; then
-        next_command="_${last_command}_${words[c]}"
-    else
-        next_command="_${words[c]}"
-    fi
-    c=$((c+1))
-    __debug "${FUNCNAME}: looking for ${next_command}"
-    declare -F $next_command >/dev/null && $next_command
-}
-
-__handle_word()
-{
-    if [[ $c -ge $cword ]]; then
-        __handle_reply
-	return
-    fi
-    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
-    if [[ "${words[c]}" == -* ]]; then
-	__handle_flag
-    elif __contains_word "${words[c]}" "${commands[@]}"; then
-        __handle_command
-    else
-        __handle_noun
-    fi
-    __handle_word
-}
-
-`)
-}
-
-func postscript(out *bytes.Buffer, name string) {
-	fmt.Fprintf(out, "__start_%s()\n", name)
-	fmt.Fprintf(out, `{
-    local cur prev words cword
-    _init_completion -s || return
-
-    local c=0
-    local flags=()
-    local two_word_flags=()
-    local flags_with_completion=()
-    local flags_completion=()
-    local commands=("%s")
-    local must_have_one_flag=()
-    local must_have_one_noun=()
-    local last_command
-    local nouns=()
-
-    __handle_word
-}
-
-`, name)
-	fmt.Fprintf(out, "complete -F __start_%s %s\n", name, name)
-	fmt.Fprintf(out, "# ex: ts=4 sw=4 et filetype=sh\n")
-}
-
-func writeCommands(cmd *Command, out *bytes.Buffer) {
-	fmt.Fprintf(out, "    commands=()\n")
-	for _, c := range cmd.Commands() {
-		if len(c.Deprecated) > 0 {
-			continue
-		}
-		fmt.Fprintf(out, "    commands+=(%q)\n", c.Name())
-	}
-	fmt.Fprintf(out, "\n")
-}
-
-func writeFlagHandler(name string, annotations map[string][]string, out *bytes.Buffer) {
-	for key, value := range annotations {
-		switch key {
-		case BashCompFilenameExt:
-			fmt.Fprintf(out, "    flags_with_completion+=(%q)\n", name)
-
-			if len(value) > 0 {
-				ext := "__handle_filename_extension_flag " + strings.Join(value, "|")
-				fmt.Fprintf(out, "    flags_completion+=(%q)\n", ext)
-			} else {
-				ext := "_filedir"
-				fmt.Fprintf(out, "    flags_completion+=(%q)\n", ext)
-			}
-		}
-	}
-}
-
-func writeShortFlag(flag *pflag.Flag, out *bytes.Buffer) {
-	b := (flag.Value.Type() == "bool")
-	name := flag.Shorthand
-	format := "    "
-	if !b {
-		format += "two_word_"
-	}
-	format += "flags+=(\"-%s\")\n"
-	fmt.Fprintf(out, format, name)
-	writeFlagHandler("-"+name, flag.Annotations, out)
-}
-
-func writeFlag(flag *pflag.Flag, out *bytes.Buffer) {
-	b := (flag.Value.Type() == "bool")
-	name := flag.Name
-	format := "    flags+=(\"--%s"
-	if !b {
-		format += "="
-	}
-	format += "\")\n"
-	fmt.Fprintf(out, format, name)
-	writeFlagHandler("--"+name, flag.Annotations, out)
-}
-
-func writeFlags(cmd *Command, out *bytes.Buffer) {
-	fmt.Fprintf(out, `    flags=()
-    two_word_flags=()
-    flags_with_completion=()
-    flags_completion=()
-
-`)
-	cmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) {
-		writeFlag(flag, out)
-		if len(flag.Shorthand) > 0 {
-			writeShortFlag(flag, out)
-		}
-	})
-
-	fmt.Fprintf(out, "\n")
-}
-
-func writeRequiredFlag(cmd *Command, out *bytes.Buffer) {
-	fmt.Fprintf(out, "    must_have_one_flag=()\n")
-	flags := cmd.NonInheritedFlags()
-	flags.VisitAll(func(flag *pflag.Flag) {
-		for key, _ := range flag.Annotations {
-			switch key {
-			case BashCompOneRequiredFlag:
-				format := "    must_have_one_flag+=(\"--%s"
-				b := (flag.Value.Type() == "bool")
-				if !b {
-					format += "="
-				}
-				format += "\")\n"
-				fmt.Fprintf(out, format, flag.Name)
-
-				if len(flag.Shorthand) > 0 {
-					fmt.Fprintf(out, "    must_have_one_flag+=(\"-%s\")\n", flag.Shorthand)
-				}
-			}
-		}
-	})
-}
-
-func writeRequiredNoun(cmd *Command, out *bytes.Buffer) {
-	fmt.Fprintf(out, "    must_have_one_noun=()\n")
-	sort.Sort(sort.StringSlice(cmd.ValidArgs))
-	for _, value := range cmd.ValidArgs {
-		fmt.Fprintf(out, "    must_have_one_noun+=(%q)\n", value)
-	}
-}
-
-func gen(cmd *Command, out *bytes.Buffer) {
-	for _, c := range cmd.Commands() {
-		if len(c.Deprecated) > 0 {
-			continue
-		}
-		gen(c, out)
-	}
-	commandName := cmd.CommandPath()
-	commandName = strings.Replace(commandName, " ", "_", -1)
-	fmt.Fprintf(out, "_%s()\n{\n", commandName)
-	fmt.Fprintf(out, "    last_command=%q\n", commandName)
-	writeCommands(cmd, out)
-	writeFlags(cmd, out)
-	writeRequiredFlag(cmd, out)
-	writeRequiredNoun(cmd, out)
-	fmt.Fprintf(out, "}\n\n")
-}
-
-func (cmd *Command) GenBashCompletion(out *bytes.Buffer) {
-	preamble(out)
-	if len(cmd.BashCompletionFunction) > 0 {
-		fmt.Fprintf(out, "%s\n", cmd.BashCompletionFunction)
-	}
-	gen(cmd, out)
-	postscript(out, cmd.Name())
-}
-
-func (cmd *Command) GenBashCompletionFile(filename string) error {
-	out := new(bytes.Buffer)
-
-	cmd.GenBashCompletion(out)
-
-	outFile, err := os.Create(filename)
-	if err != nil {
-		return err
-	}
-	defer outFile.Close()
-
-	_, err = outFile.Write(out.Bytes())
-	if err != nil {
-		return err
-	}
-	return nil
-}
-
-// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag, if it exists.
-func (cmd *Command) MarkFlagRequired(name string) error {
-	return MarkFlagRequired(cmd.Flags(), name)
-}
-
-// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag in the flag set, if it exists.
-func MarkFlagRequired(flags *pflag.FlagSet, name string) error {
-	return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"})
-}
-
-// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists.
-// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided.
-func (cmd *Command) MarkFlagFilename(name string, extensions ...string) error {
-	return MarkFlagFilename(cmd.Flags(), name, extensions...)
-}
-
-// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag in the flag set, if it exists.
-// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided.
-func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error {
-	return flags.SetAnnotation(name, BashCompFilenameExt, extensions)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md b/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md
deleted file mode 100644
index 204704e..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md
+++ /dev/null
@@ -1,149 +0,0 @@
-# Generating Bash Completions For Your Own cobra.Command
-
-Generating bash completions from a cobra command is incredibly easy. An actual program which does so for the kubernetes kubectl binary is as follows:
-
-```go
-package main
-
-import (
-        "io/ioutil"
-        "os"
-
-        "github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd"
-)
-
-func main() {
-        kubectl := cmd.NewFactory(nil).NewKubectlCommand(os.Stdin, ioutil.Discard, ioutil.Discard)
-        kubectl.GenBashCompletionFile("out.sh")
-}
-```
-
-That will get you completions of subcommands and flags. If you make additional annotations to your code, you can get even more intelligent and flexible behavior.
-
-## Creating your own custom functions
-
-Some more actual code that works in kubernetes:
-
-```bash
-const (
-        bash_completion_func = `__kubectl_parse_get()
-{
-    local kubectl_output out
-    if kubectl_output=$(kubectl get --no-headers "$1" 2>/dev/null); then
-        out=($(echo "${kubectl_output}" | awk '{print $1}'))
-        COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) )
-    fi
-}
-
-__kubectl_get_resource()
-{
-    if [[ ${#nouns[@]} -eq 0 ]]; then
-        return 1
-    fi
-    __kubectl_parse_get ${nouns[${#nouns[@]} -1]}
-    if [[ $? -eq 0 ]]; then
-        return 0
-    fi
-}
-
-__custom_func() {
-    case ${last_command} in
-        kubectl_get | kubectl_describe | kubectl_delete | kubectl_stop)
-            __kubectl_get_resource
-            return
-            ;;
-        *)
-            ;;
-    esac
-}
-`)
-```
-
-And then I set that in my command definition:
-
-```go
-cmds := &cobra.Command{
-	Use:   "kubectl",
-	Short: "kubectl controls the Kubernetes cluster manager",
-	Long: `kubectl controls the Kubernetes cluster manager.
-
-Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,
-	Run: runHelp,
-	BashCompletionFunction: bash_completion_func,
-}
-```
-
-The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__custom_func()` to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`.  `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`.  So it will call `__kubectl_parse_get pod`.  `__kubectl_parse_get` will actually call out to kubernetes and get any pods.  It will then set `COMPREPLY` to valid pods!
-
-## Have the completions code complete your 'nouns'
-
-In the above example "pod" was assumed to already be typed. But if you want `kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them. Simplified code from `kubectl get` looks like:
-
-```go
-validArgs []string = { "pods", "nodes", "services", "replicationControllers" }
-
-cmd := &cobra.Command{
-	Use:     "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)",
-	Short:   "Display one or many resources",
-	Long:    get_long,
-	Example: get_example,
-	Run: func(cmd *cobra.Command, args []string) {
-		err := RunGet(f, out, cmd, args)
-		util.CheckErr(err)
-	},
-	ValidArgs: validArgs,
-}
-```
-
-Notice we put the "ValidArgs" on the "get" subcommand. Doing so will give results like
-
-```bash
-# kubectl get [tab][tab]
-nodes                 pods                    replicationControllers  services
-```
-
-## Mark flags as required
-
-Most of the time completions will only show subcommands. But if a flag is required to make a subcommand work, you probably want it to show up when the user types [tab][tab].  Marking a flag as 'Required' is incredibly easy.
-
-```go
-cmd.MarkFlagRequired("pod")
-cmd.MarkFlagRequired("container")
-```
-
-and you'll get something like
-
-```bash
-# kubectl exec [tab][tab][tab]
--c            --container=  -p            --pod=  
-```
-
-# Specify valid filename extensions for flags that take a filename
-
-In this example we use --filename= and expect to get a json or yaml file as the argument. To make this easier we annotate the --filename flag with valid filename extensions.
-
-```go
-	annotations := []string{"json", "yaml", "yml"}
-	annotation := make(map[string][]string)
-	annotation[cobra.BashCompFilenameExt] = annotations
-
-	flag := &pflag.Flag{
-		Name:        "filename",
-		Shorthand:   "f",
-		Usage:       usage,
-		Value:       value,
-		DefValue:    value.String(),
-		Annotations: annotation,
-	}
-	cmd.Flags().AddFlag(flag)
-```
-
-Now when you run a command with this filename flag you'll get something like
-
-```bash
-# kubectl create -f 
-test/                         example/                      rpmbuild/
-hello.yml                     test.json
-```
-
-So while there are many other files in the CWD it only shows me subdirs and those with valid extensions.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go b/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go
deleted file mode 100644
index acb6d81..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go
+++ /dev/null
@@ -1,80 +0,0 @@
-package cobra
-
-import (
-	"bytes"
-	"fmt"
-	"os"
-	"strings"
-	"testing"
-)
-
-var _ = fmt.Println
-var _ = os.Stderr
-
-func checkOmit(t *testing.T, found, unexpected string) {
-	if strings.Contains(found, unexpected) {
-		t.Errorf("Unexpected response.\nGot: %q\nBut should not have!\n", unexpected)
-	}
-}
-
-func check(t *testing.T, found, expected string) {
-	if !strings.Contains(found, expected) {
-		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
-	}
-}
-
-// World worst custom function, just keep telling you to enter hello!
-const (
-	bash_completion_func = `__custom_func() {
-COMPREPLY=( "hello" )
-}
-`
-)
-
-func TestBashCompletions(t *testing.T) {
-	c := initializeWithRootCmd()
-	cmdEcho.AddCommand(cmdTimes)
-	c.AddCommand(cmdEcho, cmdPrint, cmdDeprecated)
-
-	// custom completion function
-	c.BashCompletionFunction = bash_completion_func
-
-	// required flag
-	c.MarkFlagRequired("introot")
-
-	// valid nouns
-	validArgs := []string{"pods", "nodes", "services", "replicationControllers"}
-	c.ValidArgs = validArgs
-
-	// filename
-	var flagval string
-	c.Flags().StringVar(&flagval, "filename", "", "Enter a filename")
-	c.MarkFlagFilename("filename", "json", "yaml", "yml")
-
-	// filename extensions
-	var flagvalExt string
-	c.Flags().StringVar(&flagvalExt, "filename-ext", "", "Enter a filename (extension limited)")
-	c.MarkFlagFilename("filename-ext")
-
-	out := new(bytes.Buffer)
-	c.GenBashCompletion(out)
-	str := out.String()
-
-	check(t, str, "_cobra-test")
-	check(t, str, "_cobra-test_echo")
-	check(t, str, "_cobra-test_echo_times")
-	check(t, str, "_cobra-test_print")
-
-	// check for required flags
-	check(t, str, `must_have_one_flag+=("--introot=")`)
-	// check for custom completion function
-	check(t, str, `COMPREPLY=( "hello" )`)
-	// check for required nouns
-	check(t, str, `must_have_one_noun+=("pods")`)
-	// check for filename extension flags
-	check(t, str, `flags_completion+=("_filedir")`)
-	// check for filename extension flags
-	check(t, str, `flags_completion+=("__handle_filename_extension_flag json|yaml|yml")`)
-
-	checkOmit(t, str, cmdDeprecated.Name())
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go b/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go
deleted file mode 100644
index 78b92b0..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright © 2013 Steve Francia <sp...@spf13.com>.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Commands similar to git, go tools and other modern CLI tools
-// inspired by go, go-Commander, gh and subcommand
-
-package cobra
-
-import (
-	"fmt"
-	"io"
-	"reflect"
-	"strconv"
-	"strings"
-	"text/template"
-)
-
-var initializers []func()
-
-// automatic prefix matching can be a dangerous thing to automatically enable in CLI tools.
-// Set this to true to enable it
-var EnablePrefixMatching bool = false
-
-// enables an information splash screen on Windows if the CLI is started from explorer.exe.
-var EnableWindowsMouseTrap bool = true
-
-var MousetrapHelpText string = `This is a command line tool
-
-You need to open cmd.exe and run it from there.
-`
-
-//OnInitialize takes a series of func() arguments and appends them to a slice of func().
-func OnInitialize(y ...func()) {
-	for _, x := range y {
-		initializers = append(initializers, x)
-	}
-}
-
-//Gt takes two types and checks whether the first type is greater than the second. In case of types Arrays, Chans,
-//Maps and Slices, Gt will compare their lengths. Ints are compared directly while strings are first parsed as
-//ints and then compared.
-func Gt(a interface{}, b interface{}) bool {
-	var left, right int64
-	av := reflect.ValueOf(a)
-
-	switch av.Kind() {
-	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
-		left = int64(av.Len())
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		left = av.Int()
-	case reflect.String:
-		left, _ = strconv.ParseInt(av.String(), 10, 64)
-	}
-
-	bv := reflect.ValueOf(b)
-
-	switch bv.Kind() {
-	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
-		right = int64(bv.Len())
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		right = bv.Int()
-	case reflect.String:
-		right, _ = strconv.ParseInt(bv.String(), 10, 64)
-	}
-
-	return left > right
-}
-
-//Eq takes two types and checks whether they are equal. Supported types are int and string. Unsupported types will panic.
-func Eq(a interface{}, b interface{}) bool {
-	av := reflect.ValueOf(a)
-	bv := reflect.ValueOf(b)
-
-	switch av.Kind() {
-	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
-		panic("Eq called on unsupported type")
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		return av.Int() == bv.Int()
-	case reflect.String:
-		return av.String() == bv.String()
-	}
-	return false
-}
-
-//rpad adds padding to the right of a string
-func rpad(s string, padding int) string {
-	template := fmt.Sprintf("%%-%ds", padding)
-	return fmt.Sprintf(template, s)
-}
-
-// tmpl executes the given template text on data, writing the result to w.
-func tmpl(w io.Writer, text string, data interface{}) error {
-	t := template.New("top")
-	t.Funcs(template.FuncMap{
-		"trim": strings.TrimSpace,
-		"rpad": rpad,
-		"gt":   Gt,
-		"eq":   Eq,
-	})
-	template.Must(t.Parse(text))
-	return t.Execute(w, data)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go b/Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go
deleted file mode 100644
index f181a07..0000000
--- a/Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go
+++ /dev/null
@@ -1,965 +0,0 @@
-package cobra
-
-import (
-	"bytes"
-	"fmt"
-	"os"
-	"reflect"
-	"runtime"
-	"strings"
-	"testing"
-
-	"github.com/spf13/pflag"
-)
-
-var _ = fmt.Println
-var _ = os.Stderr
-
-var tp, te, tt, t1, tr []string
-var rootPersPre, echoPre, echoPersPre, timesPersPre []string
-var flagb1, flagb2, flagb3, flagbr, flagbp bool
-var flags1, flags2a, flags2b, flags3 string
-var flagi1, flagi2, flagi3, flagir int
-var globalFlag1 bool
-var flagEcho, rootcalled bool
-var versionUsed int
-
-const strtwoParentHelp = "help message for parent flag strtwo"
-const strtwoChildHelp = "help message for child flag strtwo"
-
-var cmdPrint = &Command{
-	Use:   "print [string to print]",
-	Short: "Print anything to the screen",
-	Long:  `an absolutely utterly useless command for testing.`,
-	Run: func(cmd *Command, args []string) {
-		tp = args
-	},
-}
-
-var cmdEcho = &Command{
-	Use:     "echo [string to echo]",
-	Aliases: []string{"say"},
-	Short:   "Echo anything to the screen",
-	Long:    `an utterly useless command for testing.`,
-	Example: "Just run cobra-test echo",
-	PersistentPreRun: func(cmd *Command, args []string) {
-		echoPersPre = args
-	},
-	PreRun: func(cmd *Command, args []string) {
-		echoPre = args
-	},
-	Run: func(cmd *Command, args []string) {
-		te = args
-	},
-}
-
-var cmdEchoSub = &Command{
-	Use:   "echosub [string to print]",
-	Short: "second sub command for echo",
-	Long:  `an absolutely utterly useless command for testing gendocs!.`,
-	Run: func(cmd *Command, args []string) {
-	},
-}
-
-var cmdDeprecated = &Command{
-	Use:        "deprecated [can't do anything here]",
-	Short:      "A command which is deprecated",
-	Long:       `an absolutely utterly useless command for testing deprecation!.`,
-	Deprecated: "Please use echo instead",
-	Run: func(cmd *Command, args []string) {
-	},
-}
-
-var cmdTimes = &Command{
-	Use:   "times [# times] [string to echo]",
-	Short: "Echo anything to the screen more times",
-	Long:  `a slightly useless command for testing.`,
-	PersistentPreRun: func(cmd *Command, args []string) {
-		timesPersPre = args
-	},
-	Run: func(cmd *Command, args []string) {
-		tt = args
-	},
-}
-
-var cmdRootNoRun = &Command{
-	Use:   "cobra-test",
-	Short: "The root can run it's own function",
-	Long:  "The root description for help",
-	PersistentPreRun: func(cmd *Command, args []string) {
-		rootPersPre = args
-	},
-}
-
-var cmdRootSameName = &Command{
-	Use:   "print",
-	Short: "Root with the same name as a subcommand",
-	Long:  "The root description for help",
-}
-
-var cmdRootWithRun = &Command{
-	Use:   "cobra-test",
-	Short: "The root can run it's own function",
-	Long:  "The root description for help",
-	Run: func(cmd *Command, args []string) {
-		tr = args
-		rootcalled = true
-	},
-}
-
-var cmdSubNoRun = &Command{
-	Use:   "subnorun",
-	Short: "A subcommand without a Run function",
-	Long:  "A long output about a subcommand without a Run function",
-}
-
-var cmdVersion1 = &Command{
-	Use:   "version",
-	Short: "Print the version number",
-	Long:  `First version of the version command`,
-	Run: func(cmd *Command, args []string) {
-		versionUsed = 1
-	},
-}
-
-var cmdVersion2 = &Command{
-	Use:   "version",
-	Short: "Print the version number",
-	Long:  `Second version of the version command`,
-	Run: func(cmd *Command, args []string) {
-		versionUsed = 2
-	},
-}
-
-func flagInit() {
-	cmdEcho.ResetFlags()
-	cmdPrint.ResetFlags()
-	cmdTimes.ResetFlags()
-	cmdRootNoRun.ResetFlags()
-	cmdRootSameName.ResetFlags()
-	cmdRootWithRun.ResetFlags()
-	cmdSubNoRun.ResetFlags()
-	cmdRootNoRun.PersistentFlags().StringVarP(&flags2a, "strtwo", "t", "two", strtwoParentHelp)
-	cmdEcho.Flags().IntVarP(&flagi1, "intone", "i", 123, "help message for flag intone")
-	cmdTimes.Flags().IntVarP(&flagi2, "inttwo", "j", 234, "help message for flag inttwo")
-	cmdPrint.Flags().IntVarP(&flagi3, "intthree", "i", 345, "help message for flag intthree")
-	cmdEcho.PersistentFlags().StringVarP(&flags1, "strone", "s", "one", "help message for flag strone")
-	cmdEcho.PersistentFlags().BoolVarP(&flagbp, "persistentbool", "p", false, "help message for flag persistentbool")
-	cmdTimes.PersistentFlags().StringVarP(&flags2b, "strtwo", "t", "2", strtwoChildHelp)
-	cmdPrint.PersistentFlags().StringVarP(&flags3, "strthree", "s", "three", "help message for flag strthree")
-	cmdEcho.Flags().BoolVarP(&flagb1, "boolone", "b", true, "help message for flag boolone")
-	cmdTimes.Flags().BoolVarP(&flagb2, "booltwo", "c", false, "help message for flag booltwo")
-	cmdPrint.Flags().BoolVarP(&flagb3, "boolthree", "b", true, "help message for flag boolthree")
-	cmdVersion1.ResetFlags()
-	cmdVersion2.ResetFlags()
-}
-
-func commandInit() {
-	cmdEcho.ResetCommands()
-	cmdPrint.ResetCommands()
-	cmdTimes.ResetCommands()
-	cmdRootNoRun.ResetCommands()
-	cmdRootSameName.ResetCommands()
-	cmdRootWithRun.ResetCommands()
-	cmdSubNoRun.ResetCommands()
-}
-
-func initialize() *Command {
-	tt, tp, te = nil, nil, nil
-	rootPersPre, echoPre, echoPersPre, timesPersPre = nil, nil, nil, nil
-
-	var c = cmdRootNoRun
-	flagInit()
-	commandInit()
-	return c
-}
-
-func initializeWithSameName() *Command {
-	tt, tp, te = nil, nil, nil
-	rootPersPre, echoPre, echoPersPre, timesPersPre = nil, nil, nil, nil
-	var c = cmdRootSameName
-	flagInit()
-	commandInit()
-	return c
-}
-
-func initializeWithRootCmd() *Command {
-	cmdRootWithRun.ResetCommands()
-	tt, tp, te, tr, rootcalled = nil, nil, nil, nil, false
-	flagInit()
-	cmdRootWithRun.Flags().BoolVarP(&flagbr, "boolroot", "b", false, "help message for flag boolroot")
-	cmdRootWithRun.Flags().IntVarP(&flagir, "introot", "i", 321, "help message for flag introot")
-	commandInit()
-	return cmdRootWithRun
-}
-
-type resulter struct {
-	Error   error
-	Output  string
-	Command *Command
-}
-
-func fullSetupTest(input string) resulter {
-	c := initializeWithRootCmd()
-
-	return fullTester(c, input)
-}
-
-func noRRSetupTest(input string) resulter {
-	c := initialize()
-
-	return fullTester(c, input)
-}
-
-func rootOnlySetupTest(input string) resulter {
-	c := initializeWithRootCmd()
-
-	return simpleTester(c, input)
-}
-
-func simpleTester(c *Command, input string) resulter {
-	buf := new(bytes.Buffer)
-	// Testing flag with invalid input
-	c.SetOutput(buf)
-	c.SetArgs(strings.Split(input, " "))
-
-	err := c.Execute()
-	output := buf.String()
-
-	return resulter{err, output, c}
-}
-
-func fullTester(c *Command, input string) resulter {
-	buf := new(bytes.Buffer)
-	// Testing flag with invalid input
-	c.SetOutput(buf)
-	cmdEcho.AddCommand(cmdTimes)
-	c.AddCommand(cmdPrint, cmdEcho, cmdSubNoRun, cmdDeprecated)
-	c.SetArgs(strings.Split(input, " "))
-
-	err := c.Execute()
-	output := buf.String()
-
-	return resulter{err, output, c}
-}
-
-func logErr(t *testing.T, found, expected string) {
-	out := new(bytes.Buffer)
-
-	_, _, line, ok := runtime.Caller(2)
-	if ok {
-		fmt.Fprintf(out, "Line: %d ", line)
-	}
-	fmt.Fprintf(out, "Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
-	t.Errorf(out.String())
-}
-
-func checkResultContains(t *testing.T, x resulter, check string) {
-	if !strings.Contains(x.Output, check) {
-		logErr(t, x.Output, check)
-	}
-}
-
-func checkResultOmits(t *testing.T, x resulter, check string) {
-	if strings.Contains(x.Output, check) {
-		logErr(t, x.Output, check)
-	}
-}
-
-func checkOutputContains(t *testing.T, c *Command, check string) {
-	buf := new(bytes.Buffer)
-	c.SetOutput(buf)
-	c.Execute()
-
-	if !strings.Contains(buf.String(), check) {
-		logErr(t, buf.String(), check)
-	}
-}
-
-func TestSingleCommand(t *testing.T) {
-	noRRSetupTest("print one two")
-
-	if te != nil || tt != nil {
-		t.Error("Wrong command called")
-	}
-	if tp == nil {
-		t.Error("Wrong command called")
-	}
-	if strings.Join(tp, " ") != "one two" {
-		t.Error("Command didn't parse correctly")
-	}
-}
-
-func TestChildCommand(t *testing.T) {
-	noRRSetupTest("echo times one two")
-
-	if te != nil || tp != nil {
-		t.Error("Wrong command called")
-	}
-	if tt == nil {
-		t.Error("Wrong command called")
-	}
-	if strings.Join(tt, " ") != "one two" {
-		t.Error("Command didn't parse correctly")
-	}
-}
-
-func TestCommandAlias(t *testing.T) {
-	noRRSetupTest("say times one two")
-
-	if te != nil || tp != nil {
-		t.Error("Wrong command called")
-	}
-	if tt == nil {
-		t.Error("Wrong command called")
-	}
-	if strings.Join(tt, " ") != "one two" {
-		t.Error("Command didn't parse correctly")
-	}
-}
-
-func TestPrefixMatching(t *testing.T) {
-	EnablePrefixMatching = true
-	noRRSetupTest("ech times one two")
-
-	if te != nil || tp != nil {
-		t.Error("Wrong command called")
-	}
-	if tt == nil {
-		t.Error("Wrong command called")
-	}
-	if strings.Join(tt, " ") != "one two" {
-		t.Error("Command didn't parse correctly")
-	}
-
-	EnablePrefixMatching = false
-}
-
-func TestNoPrefixMatching(t *testing.T) {
-	EnablePrefixMatching = false
-
-	noRRSetupTest("ech times one two")
-
-	if !(tt == nil && te == nil && tp == nil) {
-		t.Error("Wrong command called")
-	}
-}
-
-func TestAliasPrefixMatching(t *testing.T) {
-	EnablePrefixMatching = true
-	noRRSetupTest("sa times one two")
-
-	if te != nil || tp != nil {
-		t.Error("Wrong command called")
-	}
-	if tt == nil {
-		t.Error("Wrong command called")
-	}
-	if strings.Join(tt, " ") != "one two" {
-		t.Error("Command didn't parse correctly")
-	}
-	EnablePrefixMatching = false
-}
-
-func TestChildSameName(t *testing.T) {
-	c := initializeWithSameName()
-	c.AddCommand(cmdPrint, cmdEcho)
-	c.SetArgs(strings.Split("print one two", " "))
-	c.Execute()
-
-	if te != nil || tt != nil {
-		t.Error("Wrong command called")
-	}
-	if tp == nil {
-		t.Error("Wrong command called")
-	}
-	if strings.Join(tp, " ") != "one two" {
-		t.Error("Command didn't parse correctly")
-	}
-}
-
-func TestGrandChildSameName(t *testing.T) {
-	c := initializeWithSameName()
-	cmdTimes.AddCommand(cmdPrint)
-	c.AddCommand(cmdTimes)
-	c.SetArgs(strings.Split("times print one two", " "))
-	c.Execute()
-
-	if te != nil || tt != nil {
-		t.Error("Wrong command called")
-	}
-	if tp == nil {
-		t.Error("Wrong command called")
-	}
-	if strings.Join(tp, " ") != "one two" {
-		t.Error("Command didn't parse correctly")
-	}
-}
-
-func TestFlagLong(t *testing.T) {
-	noRRSetupTest("echo --intone=13 something here")
-
-	if strings.Join(te, " ") != "something here" {
-		t.Errorf("flags didn't leave proper args remaining..%s given", te)
-	}
-	if flagi1 != 13 {
-		t.Errorf("int flag didn't get correct value, had %d", flagi1)
-	}
-	if flagi2 != 234 {
-		t.Errorf("default flag value changed, 234 expected, %d given", flagi2)
-	}
-}
-
-func TestFlagShort(t *testing.T) {
-	noRRSetupTest("echo -i13 something here")
-
-	if strings.Join(te, " ") != "something here" {
-		t.Errorf("flags didn't leave proper args remaining..%s given", te)
-	}
-	if flagi1 != 13 {
-		t.Errorf("int flag didn't get correct value, had %d", flagi1)
-	}
-	if flagi2 != 234 {
-		t.Errorf("default flag value changed, 234 expected, %d given", flagi2)
-	}
-
-	noRRSetupTest("echo -i 13 something here")
-
-	if strings.Join(te, " ") != "something here" {
-		t.Errorf("flags didn't leave proper args remaining..%s given", te)
-	}
-	if flagi1 != 13 {
-		t.Errorf("int flag didn't get correct value, had %d", flagi1)
-	}
-	if flagi2 != 234 {
-		t.Errorf("default flag value changed, 234 expected, %d given", flagi2)
-	}
-
-	noRRSetupTest("print -i99 one two")
-
-	if strings.Join(tp, " ") != "one two" {
-		t.Errorf("flags didn't leave proper args remaining..%s given", tp)
-	}
-	if flagi3 != 99 {
-		t.Errorf("int flag didn't get correct value, had %d", flagi3)
-	}
-	if flagi1 != 123 {
-		t.Errorf("default flag value changed on different command with same shortname, 234 expected, %d given", flagi2)
-	}
-}
-
-func TestChildCommandFlags(t *testing.T) {
-	noRRSetupTest("echo times -j 99 one two")
-
-	if strings.Join(tt, " ") != "one two" {
-		t.Errorf("flags didn't leave proper args remaining..%s given", tt)
-	}
-
-	// Testing with flag that shouldn't be persistent
-	r := noRRSetupTest("echo times -j 99 -i77 one two")
-
-	if r.Error == nil {
-		t.Errorf("invalid flag should generate error")
-	}
-
-	if !strings.Contains(r.Output, "unknown shorthand") {
-		t.Errorf("Wrong error message displayed, \n %s", r.Output)
-	}
-
-	if flagi2 != 99 {
-		t.Errorf("flag value should be 99, %d given", flagi2)
-	}
-
-	if flagi1 != 123 {
-		t.Errorf("unset flag should have default value, expecting 123, given %d", flagi1)
-	}
-
-	// Testing with flag only existing on child
-	r = noRRSetupTest("echo -j 99 -i77 one two")
-
-	if r.Error == nil {
-		t.Errorf("invalid flag should generate error")
-	}
-
-	if !strings.Contains(r.Output, "unknown shorthand flag") {
-		t.Errorf("Wrong error message displayed, \n %s", r.Output)
-	}
-
-	// Testing with persistent flag overwritten by child
-	noRRSetupTest("echo times --strtwo=child one two")
-
-	if flags2b != "child" {
-		t.Errorf("flag value should be child, %s given", flags2b)
-	}
-
-	if flags2a != "two" {
-		t.Errorf("unset flag should have default value, expecting two, given %s", flags2a)
-	}
-
-	// Testing flag with invalid input
-	r = noRRSetupTest("echo -i10E")
-
-	if r.Error == nil {
-		t.Errorf("invalid input should generate error")
-	}
-
-	if !strings.Contains(r.Output, "invalid argument \"10E\" for i10E") {
-		t.Errorf("Wrong error message displayed, \n %s", r.Output)
-	}
-}
-
-func TestTrailingCommandFlags(t *testing.T) {
-	x := fullSetupTest("echo two -x")
-
-	if x.Error == nil {
-		t.Errorf("invalid flag should generate error")
-	}
-}
-
-func TestInvalidSubcommandFlags(t *testing.T) {
-	cmd := initializeWithRootCmd()
-	cmd.AddCommand(cmdTimes)
-
-	result := simpleTester(cmd, "times --inttwo=2 --badflag=bar")
-
-	checkResultContains(t, result, "unknown flag: --badflag")
-
-	if strings.Contains(result.Output, "unknown flag: --inttwo") {
-		t.Errorf("invalid --badflag flag shouldn't fail on 'unknown' --inttwo flag")
-	}
-
-}
-
-func TestSubcommandArgEvaluation(t *testing.T) {
-	cmd := initializeWithRootCmd()
-
-	first := &Command{
-		Use: "first",
-		Run: func(cmd *Command, args []string) {
-		},
-	}
-	cmd.AddCommand(first)
-
-	second := &Command{
-		Use: "second",
-		Run: func(cmd *Command, args []string) {
-			fmt.Fprintf(cmd.Out(), "%v", args)
-		},
-	}
-	first.AddCommand(second)
-
-	result := simpleTester(cmd, "first second first third")
-
-	expectedOutput := fmt.Sprintf("%v", []string{"first third"})
-	if result.Output != expectedOutput {
-		t.Errorf("exptected %v, got %v", expectedOutput, result.Output)
-	}
-}
-
-func TestPersistentFlags(t *testing.T) {
-	fullSetupTest("echo -s something -p more here")
-
-	// persistentFlag should act like normal flag on it's own command
-	if strings.Join(te, " ") != "more here" {
-		t.Errorf("flags didn't leave proper args remaining..%s given", te)
-	}
-	if flags1 != "something" {
-		t.Errorf("string flag didn't get correct value, had %v", flags1)
-	}
-	if !flagbp {
-		t.Errorf("persistent bool flag not parsed correctly. Expected true, had %v", flagbp)
-	}
-
-	// persistentFlag should act like normal flag on it's own command
-	fullSetupTest("echo times -s again -c -p test here")
-
-	if strings.Join(tt, " ") != "test here" {
-		t.Errorf("flags didn't leave proper args remaining..%s given", tt)
-	}
-
-	if flags1 != "again" {
-		t.Errorf("string flag didn't get correct value, had %v", flags1)
-	}
-
-	if !flagb2 {
-		t.Errorf("local flag not parsed correctly. Expected true, had %v", flagb2)
-	}
-	if !flagbp {
-		t.Errorf("persistent bool flag not parsed correctly. Expected true, had %v", flagbp)
-	}
-}
-
-func TestHelpCommand(t *testing.T) {
-	x := fullSetupTest("help")
-	checkResultContains(t, x, cmdRootWithRun.Long)
-
-	x = fullSetupTest("help echo")
-	checkResultContains(t, x, cmdEcho.Long)
-
-	x = fullSetupTest("help echo times")
-	checkResultContains(t, x, cmdTimes.Long)
-}
-
-func TestChildCommandHelp(t *testing.T) {
-	c := noRRSetupTest("print --help")
-	checkResultContains(t, c, strtwoParentHelp)
-	r := noRRSetupTest("echo times --help")
-	checkResultContains(t, r, strtwoChildHelp)
-}
-
-func TestNonRunChildHelp(t *testing.T) {
-	x := noRRSetupTest("subnorun")
-	checkResultContains(t, x, cmdSubNoRun.Long)
-}
-
-func TestRunnableRootCommand(t *testing.T) {
-	fullSetupTest("")
-
-	if rootcalled != true {
-		t.Errorf("Root Function was not called")
-	}
-}
-
-func TestRunnableRootCommandNilInput(t *testing.T) {
-	empty_arg := make([]string, 0)
-	c := initializeWithRootCmd()
-
-	buf := new(bytes.Buffer)
-	// Testing flag with invalid input
-	c.SetOutput(buf)
-	cmdEcho.AddCommand(cmdTimes)
-	c.AddCommand(cmdPrint, cmdEcho)
-	c.SetArgs(empty_arg)
-
-	c.Execute()
-
-	if rootcalled != true {
-		t.Errorf("Root Function was not called")
-	}
-}
-
-func TestRunnableRootCommandEmptyInput(t *testing.T) {
-	args := make([]string, 3)
-	args[0] = ""
-	args[1] = "--introot=12"
-	args[2] = ""
-	c := initializeWithRootCmd()
-
-	buf := new(bytes.Buffer)
-	// Testing flag with invalid input
-	c.SetOutput(buf)
-	cmdEcho.AddCommand(cmdTimes)
-	c.AddCommand(cmdPrint, cmdEcho)
-	c.SetArgs(args)
-
-	c.Execute()
-
-	if rootcalled != true {
-		t.Errorf("Root Function was not called.\n\nOutput was:\n\n%s\n", buf)
-	}
-}
-
-func TestInvalidSubcommandWhenArgsAllowed(t *testing.T) {
-	fullSetupTest("echo invalid-sub")
-
-	if te[0] != "invalid-sub" {
-		t.Errorf("Subcommand didn't work...")
-	}
-}
-
-func TestRootFlags(t *testing.T) {
-	fullSetupTest("-i 17 -b")
-
-	if flagbr != true {
-		t.Errorf("flag value should be true, %v given", flagbr)
-	}
-
-	if flagir != 17 {
-		t.Errorf("flag value should be 17, %d given", flagir)
-	}
-}
-
-func TestRootHelp(t *testing.T) {
-	x := fullSetupTest("--help")
-
-	checkResultContains(t, x, "Available Commands:")
-	checkResultContains(t, x, "for more information about a command")
-
-	if strings.Contains(x.Output, "unknown flag: --help") {
-		t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
-	}
-
-	if strings.Contains(x.Output, cmdEcho.Use) {
-		t.Errorf("--help shouldn't display subcommand's usage, Got: \n %s", x.Output)
-	}
-
-	x = fullSetupTest("echo --help")
-
-	if strings.Contains(x.Output, cmdTimes.Use) {
-		t.Errorf("--help shouldn't display subsubcommand's usage, Got: \n %s", x.Output)
-	}
-
-	checkResultContains(t, x, "Available Commands:")
-	checkResultContains(t, x, "for more information about a command")
-
-	if strings.Contains(x.Output, "unknown flag: --help") {
-		t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
-	}
-
-}
-
-func TestFlagAccess(t *testing.T) {
-	initialize()
-
-	local := cmdTimes.LocalFlags()
-	inherited := cmdTimes.InheritedFlags()
-
-	for _, f := range []string{"inttwo", "strtwo", "booltwo"} {
-		if local.Lookup(f) == nil {
-			t.Errorf("LocalFlags expected to contain %s, Got: nil", f)
-		}
-	}
-	if inherited.Lookup("strone") == nil {
-		t.Errorf("InheritedFlags expected to contain strone, Got: nil")
-	}
-	if inherited.Lookup("strtwo") != nil {
-		t.Errorf("InheritedFlags shouldn not contain overwritten flag strtwo")
-
-	}
-}
-
-func TestNoNRunnableRootCommandNilInput(t *testing.T) {
-	args := make([]string, 0)
-	c := initialize()
-
-	buf := new(bytes.Buffer)
-	// Testing flag with invalid input
-	c.SetOutput(buf)
-	cmdEcho.AddCommand(cmdTimes)
-	c.AddCommand(cmdPrint, cmdEcho)
-	c.SetArgs(args)
-
-	c.Execute()
-
-	if !strings.Contains(buf.String(), cmdRootNoRun.Long) {
-		t.Errorf("Expected to get help output, Got: \n %s", buf)
-	}
-}
-
-func TestRootNoCommandHelp(t *testing.T) {
-	x := rootOnlySetupTest("--help")
-
-	checkResultOmits(t, x, "Available Commands:")
-	checkResultOmits(t, x, "for more information about a command")
-
-	if strings.Contains(x.Output, "unknown flag: --help") {
-		t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
-	}
-
-	x = rootOnlySetupTest("echo --help")
-
-	checkResultOmits(t, x, "Available Commands:")
-	checkResultOmits(t, x, "for more information about a command")
-
-	if strings.Contains(x.Output, "unknown flag: --help") {
-		t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
-	}
-}
-
-func TestRootUnknownCommand(t *testing.T) {
-	r := noRRSetupTest("bogus")
-	s := "Error: unknown command \"bogus\"\nRun 'cobra-test help' for usage.\n"
-
-	if r.Output != s {
-		t.Errorf("Unexpected response.\nExpecting to be:\n %q\nGot:\n %q\n", s, r.Output)
-	}
-
-	r = noRRSetupTest("--strtwo=a bogus")
-	if r.Output != s {
-		t.Errorf("Unexpected response.\nExpecting to be:\n %q\nGot:\n %q\n", s, r.Output)
-	}
-}
-
-func TestFlagsBeforeCommand(t *testing.T) {
-	// short without space
-	x := fullSetupTest("-i10 echo")
-	if x.Error != nil {
-		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
-	}
-
-	// short (int) with equals
-	// It appears that pflags doesn't support this...
-	// Commenting out until support can be added
-
-	//x = noRRSetupTest("echo -i=10")
-	//if x.Error != nil {
-	//t.Errorf("Valid Input shouldn't have errors, got:\n %s", x.Error)
-	//}
-
-	// long with equals
-	x = noRRSetupTest("--intone=123 echo one two")
-	if x.Error != nil {
-		t.Errorf("Valid Input shouldn't have errors, got:\n %s", x.Error)
-	}
-
-	// With parsing error properly reported
-	x = fullSetupTest("-i10E echo")
-	if !strings.Contains(x.Output, "invalid argument \"10E\" for i10E") {
-		t.Errorf("Wrong error message displayed, \n %s", x.Output)
-	}
-
-	//With quotes
-	x = fullSetupTest("-s=\"walking\" echo")
-	if x.Error != nil {
-		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
-	}
-
-	//With quotes and space
-	x = fullSetupTest("-s=\"walking fast\" echo")
-	if x.Error != nil {
-		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
-	}
-
-	//With inner quote
-	x = fullSetupTest("-s=\"walking \\\"Inner Quote\\\" fast\" echo")
-	if x.Error != nil {
-		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
-	}
-
-	//With quotes and space
-	x = fullSetupTest("-s=\"walking \\\"Inner Quote\\\" fast\" echo")
-	if x.Error != nil {
-		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
-	}
-
-}
-
-func TestRemoveCommand(t *testing.T) {
-	versionUsed = 0
-	c := initializeWithRootCmd()
-	c.AddCommand(cmdVersion1)
-	c.RemoveCommand(cmdVersion1)
-	x := fullTester(c, "version")
-	if x.Error == nil {
-		t.Errorf("Removed command should not have been called\n")
-		return
-	}
-}
-
-func TestCommandWithoutSubcommands(t *testing.T) {
-	c := initializeWithRootCmd()
-
-	x := simpleTester(c, "")
-	if x.Error != nil {
-		t.Errorf("Calling command without subcommands should not have error: %v", x.Error)
-		return
-	}
-}
-
-func TestCommandWithoutSubcommandsWithArg(t *testing.T) {
-	c := initializeWithRootCmd()
-	expectedArgs := []string{"arg"}
-
-	x := simpleTester(c, "arg")
-	if x.Error != nil {
-		t.Errorf("Calling command without subcommands but with arg should not have error: %v", x.Error)
-		return
-	}
-	if !reflect.DeepEqual(expectedArgs, tr) {
-		t.Errorf("Calling command without subcommands but with arg has wrong args: expected: %v, actual: %v", expectedArgs, tr)
-		return
-	}
-}
-
-func TestReplaceCommandWithRemove(t *testing.T) {
-	versionUsed = 0
-	c := initializeWithRootCmd()
-	c.AddCommand(cmdVersion1)
-	c.RemoveCommand(cmdVersion1)
-	c.AddCommand(cmdVersion2)
-	x := fullTester(c, "version")
-	if x.Error != nil {
-		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
-		return
-	}
-	if versionUsed == 1 {
-		t.Errorf("Removed command shouldn't be called\n")
-	}
-	if versionUsed != 2 {
-		t.Errorf("Replacing command should have been called but didn't\n")
-	}
-}
-
-func TestDeprecatedSub(t *testing.T) {
-	c := fullSetupTest("deprecated")
-
-	checkResultContains(t, c, cmdDeprecated.Deprecated)
-}
-
-func TestPreRun(t *testing.T) {
-	noRRSetupTest("echo one two")
-	if echoPre == nil || echoPersPre == nil {
-		t.Error("PreRun or PersistentPreRun not called")
-	}
-	if rootPersPre != nil || timesPersPre != nil {
-		t.Error("Wrong *Pre functions called!")
-	}
-
-	noRRSetupTest("echo times one two")
-	if timesPersPre == nil {
-		t.Error("PreRun or PersistentPreRun not called")
-	}
-	if echoPre != nil || echoPersPre != nil || rootPersPre != nil {
-		t.Error("Wrong *Pre functions called!")
-	}
-
-	noRRSetupTest("print one two")
-	if rootPersPre == nil {
-		t.Error("Parent PersistentPreRun not called but should not have been")
-	}
-	if echoPre != nil || echoPersPre != nil || timesPersPre != nil {
-		t.Error("Wrong *Pre functions called!")
-	}
-}
-
-// Check if cmdEchoSub gets PersistentPreRun from rootCmd even if is added last
-func TestPeristentPreRunPropagation(t *testing.T) {
-	rootCmd := initialize()
-
-	// First add the cmdEchoSub to cmdPrint
-	cmdPrint.AddCommand(cmdEchoSub)
-	// Now add cmdPrint to rootCmd
-	rootCmd.AddCommand(cmdPrint)
-
-	rootCmd.SetArgs(strings.Split("print echosub lala", " "))
-	rootCmd.Execute()
-
-	if rootPersPre == nil || len(rootPersPre) == 0 || rootPersPre[0] != "lala" {
-		t.Error("RootCmd PersistentPreRun not called but should have been")
-	}
-}
-
-func TestGlobalNormFuncPropagation(t *testing.T) {
-	normFunc := func(f *pflag.FlagSet, name string) pflag.NormalizedName {
-		return pflag.NormalizedName(name)
-	}
-
-	rootCmd := initialize()
-	rootCmd.SetGlobalNormalizationFunc(normFunc)
-	if reflect.ValueOf(normFunc) != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()) {
-		t.Error("rootCmd seems to have a wrong normalization function")
-	}
-
-	// First add the cmdEchoSub to cmdPrint
-	cmdPrint.AddCommand(cmdEchoSub)
-	if cmdPrint.GlobalNormalizationFunc() != nil && cmdEchoSub.GlobalNormalizationFunc() != nil {
-		t.Error("cmdPrint and cmdEchoSub should had no normalization functions")
-	}
-
-	// Now add cmdPrint to rootCmd
-	rootCmd.AddCommand(cmdPrint)
-	if reflect.ValueOf(cmdPrint.GlobalNormalizationFunc()).Pointer() != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()).Pointer() ||
-		reflect.ValueOf(cmdEchoSub.GlobalNormalizationFunc()).Pointer() != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()).Pointer() {
-		t.Error("cmdPrint and cmdEchoSub should had the normalization function of rootCmd")
-	}
-}


[28/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE b/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE
deleted file mode 100644
index a68e67f..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE
+++ /dev/null
@@ -1,188 +0,0 @@
-
-Copyright (c) 2011-2014 - Canonical Inc.
-
-This software is licensed under the LGPLv3, included below.
-
-As a special exception to the GNU Lesser General Public License version 3
-("LGPL3"), the copyright holders of this Library give you permission to
-convey to a third party a Combined Work that links statically or dynamically
-to this Library without providing any Minimal Corresponding Source or
-Minimal Application Code as set out in 4d or providing the installation
-information set out in section 4e, provided that you comply with the other
-provisions of LGPL3 and provided that you meet, for the Application the
-terms and conditions of the license(s) which apply to the Application.
-
-Except as stated in this special exception, the provisions of LGPL3 will
-continue to comply in full to this Library. If you modify this Library, you
-may apply this exception to your version of this Library, but you are not
-obliged to do so. If you do not wish to do so, delete this exception
-statement from your version. This exception does not (and cannot) modify any
-license terms which apply to the Application, with which you must still
-comply.
-
-
-                   GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-  This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-  0. Additional Definitions.
-
-  As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
-  "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
-  An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
-  A "Combined Work" is a work produced by combining or linking an
-Application with the Library.  The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
-  The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
-  The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-  1. Exception to Section 3 of the GNU GPL.
-
-  You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-  2. Conveying Modified Versions.
-
-  If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
-   a) under this License, provided that you make a good faith effort to
-   ensure that, in the event an Application does not supply the
-   function or data, the facility still operates, and performs
-   whatever part of its purpose remains meaningful, or
-
-   b) under the GNU GPL, with none of the additional permissions of
-   this License applicable to that copy.
-
-  3. Object Code Incorporating Material from Library Header Files.
-
-  The object code form of an Application may incorporate material from
-a header file that is part of the Library.  You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
-   a) Give prominent notice with each copy of the object code that the
-   Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the object code with a copy of the GNU GPL and this license
-   document.
-
-  4. Combined Works.
-
-  You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
-   a) Give prominent notice with each copy of the Combined Work that
-   the Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the Combined Work with a copy of the GNU GPL and this license
-   document.
-
-   c) For a Combined Work that displays copyright notices during
-   execution, include the copyright notice for the Library among
-   these notices, as well as a reference directing the user to the
-   copies of the GNU GPL and this license document.
-
-   d) Do one of the following:
-
-       0) Convey the Minimal Corresponding Source under the terms of this
-       License, and the Corresponding Application Code in a form
-       suitable for, and under terms that permit, the user to
-       recombine or relink the Application with a modified version of
-       the Linked Version to produce a modified Combined Work, in the
-       manner specified by section 6 of the GNU GPL for conveying
-       Corresponding Source.
-
-       1) Use a suitable shared library mechanism for linking with the
-       Library.  A suitable mechanism is one that (a) uses at run time
-       a copy of the Library already present on the user's computer
-       system, and (b) will operate properly with a modified version
-       of the Library that is interface-compatible with the Linked
-       Version.
-
-   e) Provide Installation Information, but only if you would otherwise
-   be required to provide such information under section 6 of the
-   GNU GPL, and only to the extent that such information is
-   necessary to install and execute a modified version of the
-   Combined Work produced by recombining or relinking the
-   Application with a modified version of the Linked Version. (If
-   you use option 4d0, the Installation Information must accompany
-   the Minimal Corresponding Source and Corresponding Application
-   Code. If you use option 4d1, you must provide the Installation
-   Information in the manner specified by section 6 of the GNU GPL
-   for conveying Corresponding Source.)
-
-  5. Combined Libraries.
-
-  You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
-   a) Accompany the combined library with a copy of the same work based
-   on the Library, uncombined with any other library facilities,
-   conveyed under the terms of this License.
-
-   b) Give prominent notice with the combined library that part of it
-   is a work based on the Library, and explaining where to find the
-   accompanying uncombined form of the same work.
-
-  6. Revised Versions of the GNU Lesser General Public License.
-
-  The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-  Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
-  If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml b/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml
deleted file mode 100644
index 8da58fb..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml
+++ /dev/null
@@ -1,31 +0,0 @@
-The following files were ported to Go from C files of libyaml, and thus
-are still covered by their original copyright and license:
-
-    apic.go
-    emitterc.go
-    parserc.go
-    readerc.go
-    scannerc.go
-    writerc.go
-    yamlh.go
-    yamlprivateh.go
-
-Copyright (c) 2006 Kirill Simonov
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/README.md b/Godeps/_workspace/src/gopkg.in/yaml.v2/README.md
deleted file mode 100644
index d6c919e..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/README.md
+++ /dev/null
@@ -1,128 +0,0 @@
-# YAML support for the Go language
-
-Introduction
-------------
-
-The yaml package enables Go programs to comfortably encode and decode YAML
-values. It was developed within [Canonical](https://www.canonical.com) as
-part of the [juju](https://juju.ubuntu.com) project, and is based on a
-pure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML)
-C library to parse and generate YAML data quickly and reliably.
-
-Compatibility
--------------
-
-The yaml package supports most of YAML 1.1 and 1.2, including support for
-anchors, tags, map merging, etc. Multi-document unmarshalling is not yet
-implemented, and base-60 floats from YAML 1.1 are purposefully not
-supported since they're a poor design and are gone in YAML 1.2.
-
-Installation and usage
-----------------------
-
-The import path for the package is *gopkg.in/yaml.v2*.
-
-To install it, run:
-
-    go get gopkg.in/yaml.v2
-
-API documentation
------------------
-
-If opened in a browser, the import path itself leads to the API documentation:
-
-  * [https://gopkg.in/yaml.v2](https://gopkg.in/yaml.v2)
-
-API stability
--------------
-
-The package API for yaml v2 will remain stable as described in [gopkg.in](https://gopkg.in).
-
-
-License
--------
-
-The yaml package is licensed under the LGPL with an exception that allows it to be linked statically. Please see the LICENSE file for details.
-
-
-Example
--------
-
-```Go
-package main
-
-import (
-        "fmt"
-        "log"
-
-        "gopkg.in/yaml.v2"
-)
-
-var data = `
-a: Easy!
-b:
-  c: 2
-  d: [3, 4]
-`
-
-type T struct {
-        A string
-        B struct{C int; D []int ",flow"}
-}
-
-func main() {
-        t := T{}
-    
-        err := yaml.Unmarshal([]byte(data), &t)
-        if err != nil {
-                log.Fatalf("error: %v", err)
-        }
-        fmt.Printf("--- t:\n%v\n\n", t)
-    
-        d, err := yaml.Marshal(&t)
-        if err != nil {
-                log.Fatalf("error: %v", err)
-        }
-        fmt.Printf("--- t dump:\n%s\n\n", string(d))
-    
-        m := make(map[interface{}]interface{})
-    
-        err = yaml.Unmarshal([]byte(data), &m)
-        if err != nil {
-                log.Fatalf("error: %v", err)
-        }
-        fmt.Printf("--- m:\n%v\n\n", m)
-    
-        d, err = yaml.Marshal(&m)
-        if err != nil {
-                log.Fatalf("error: %v", err)
-        }
-        fmt.Printf("--- m dump:\n%s\n\n", string(d))
-}
-```
-
-This example will generate the following output:
-
-```
---- t:
-{Easy! {2 [3 4]}}
-
---- t dump:
-a: Easy!
-b:
-  c: 2
-  d: [3, 4]
-
-
---- m:
-map[a:Easy! b:map[c:2 d:[3 4]]]
-
---- m dump:
-a: Easy!
-b:
-  c: 2
-  d:
-  - 3
-  - 4
-```
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/apic.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/apic.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/apic.go
deleted file mode 100644
index 95ec014..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/apic.go
+++ /dev/null
@@ -1,742 +0,0 @@
-package yaml
-
-import (
-	"io"
-	"os"
-)
-
-func yaml_insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) {
-	//fmt.Println("yaml_insert_token", "pos:", pos, "typ:", token.typ, "head:", parser.tokens_head, "len:", len(parser.tokens))
-
-	// Check if we can move the queue at the beginning of the buffer.
-	if parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) {
-		if parser.tokens_head != len(parser.tokens) {
-			copy(parser.tokens, parser.tokens[parser.tokens_head:])
-		}
-		parser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head]
-		parser.tokens_head = 0
-	}
-	parser.tokens = append(parser.tokens, *token)
-	if pos < 0 {
-		return
-	}
-	copy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:])
-	parser.tokens[parser.tokens_head+pos] = *token
-}
-
-// Create a new parser object.
-func yaml_parser_initialize(parser *yaml_parser_t) bool {
-	*parser = yaml_parser_t{
-		raw_buffer: make([]byte, 0, input_raw_buffer_size),
-		buffer:     make([]byte, 0, input_buffer_size),
-	}
-	return true
-}
-
-// Destroy a parser object.
-func yaml_parser_delete(parser *yaml_parser_t) {
-	*parser = yaml_parser_t{}
-}
-
-// String read handler.
-func yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) {
-	if parser.input_pos == len(parser.input) {
-		return 0, io.EOF
-	}
-	n = copy(buffer, parser.input[parser.input_pos:])
-	parser.input_pos += n
-	return n, nil
-}
-
-// File read handler.
-func yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) {
-	return parser.input_file.Read(buffer)
-}
-
-// Set a string input.
-func yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) {
-	if parser.read_handler != nil {
-		panic("must set the input source only once")
-	}
-	parser.read_handler = yaml_string_read_handler
-	parser.input = input
-	parser.input_pos = 0
-}
-
-// Set a file input.
-func yaml_parser_set_input_file(parser *yaml_parser_t, file *os.File) {
-	if parser.read_handler != nil {
-		panic("must set the input source only once")
-	}
-	parser.read_handler = yaml_file_read_handler
-	parser.input_file = file
-}
-
-// Set the source encoding.
-func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) {
-	if parser.encoding != yaml_ANY_ENCODING {
-		panic("must set the encoding only once")
-	}
-	parser.encoding = encoding
-}
-
-// Create a new emitter object.
-func yaml_emitter_initialize(emitter *yaml_emitter_t) bool {
-	*emitter = yaml_emitter_t{
-		buffer:     make([]byte, output_buffer_size),
-		raw_buffer: make([]byte, 0, output_raw_buffer_size),
-		states:     make([]yaml_emitter_state_t, 0, initial_stack_size),
-		events:     make([]yaml_event_t, 0, initial_queue_size),
-	}
-	return true
-}
-
-// Destroy an emitter object.
-func yaml_emitter_delete(emitter *yaml_emitter_t) {
-	*emitter = yaml_emitter_t{}
-}
-
-// String write handler.
-func yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) error {
-	*emitter.output_buffer = append(*emitter.output_buffer, buffer...)
-	return nil
-}
-
-// File write handler.
-func yaml_file_write_handler(emitter *yaml_emitter_t, buffer []byte) error {
-	_, err := emitter.output_file.Write(buffer)
-	return err
-}
-
-// Set a string output.
-func yaml_emitter_set_output_string(emitter *yaml_emitter_t, output_buffer *[]byte) {
-	if emitter.write_handler != nil {
-		panic("must set the output target only once")
-	}
-	emitter.write_handler = yaml_string_write_handler
-	emitter.output_buffer = output_buffer
-}
-
-// Set a file output.
-func yaml_emitter_set_output_file(emitter *yaml_emitter_t, file io.Writer) {
-	if emitter.write_handler != nil {
-		panic("must set the output target only once")
-	}
-	emitter.write_handler = yaml_file_write_handler
-	emitter.output_file = file
-}
-
-// Set the output encoding.
-func yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_encoding_t) {
-	if emitter.encoding != yaml_ANY_ENCODING {
-		panic("must set the output encoding only once")
-	}
-	emitter.encoding = encoding
-}
-
-// Set the canonical output style.
-func yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) {
-	emitter.canonical = canonical
-}
-
-//// Set the indentation increment.
-func yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) {
-	if indent < 2 || indent > 9 {
-		indent = 2
-	}
-	emitter.best_indent = indent
-}
-
-// Set the preferred line width.
-func yaml_emitter_set_width(emitter *yaml_emitter_t, width int) {
-	if width < 0 {
-		width = -1
-	}
-	emitter.best_width = width
-}
-
-// Set if unescaped non-ASCII characters are allowed.
-func yaml_emitter_set_unicode(emitter *yaml_emitter_t, unicode bool) {
-	emitter.unicode = unicode
-}
-
-// Set the preferred line break character.
-func yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_break_t) {
-	emitter.line_break = line_break
-}
-
-///*
-// * Destroy a token object.
-// */
-//
-//YAML_DECLARE(void)
-//yaml_token_delete(yaml_token_t *token)
-//{
-//    assert(token);  // Non-NULL token object expected.
-//
-//    switch (token.type)
-//    {
-//        case YAML_TAG_DIRECTIVE_TOKEN:
-//            yaml_free(token.data.tag_directive.handle);
-//            yaml_free(token.data.tag_directive.prefix);
-//            break;
-//
-//        case YAML_ALIAS_TOKEN:
-//            yaml_free(token.data.alias.value);
-//            break;
-//
-//        case YAML_ANCHOR_TOKEN:
-//            yaml_free(token.data.anchor.value);
-//            break;
-//
-//        case YAML_TAG_TOKEN:
-//            yaml_free(token.data.tag.handle);
-//            yaml_free(token.data.tag.suffix);
-//            break;
-//
-//        case YAML_SCALAR_TOKEN:
-//            yaml_free(token.data.scalar.value);
-//            break;
-//
-//        default:
-//            break;
-//    }
-//
-//    memset(token, 0, sizeof(yaml_token_t));
-//}
-//
-///*
-// * Check if a string is a valid UTF-8 sequence.
-// *
-// * Check 'reader.c' for more details on UTF-8 encoding.
-// */
-//
-//static int
-//yaml_check_utf8(yaml_char_t *start, size_t length)
-//{
-//    yaml_char_t *end = start+length;
-//    yaml_char_t *pointer = start;
-//
-//    while (pointer < end) {
-//        unsigned char octet;
-//        unsigned int width;
-//        unsigned int value;
-//        size_t k;
-//
-//        octet = pointer[0];
-//        width = (octet & 0x80) == 0x00 ? 1 :
-//                (octet & 0xE0) == 0xC0 ? 2 :
-//                (octet & 0xF0) == 0xE0 ? 3 :
-//                (octet & 0xF8) == 0xF0 ? 4 : 0;
-//        value = (octet & 0x80) == 0x00 ? octet & 0x7F :
-//                (octet & 0xE0) == 0xC0 ? octet & 0x1F :
-//                (octet & 0xF0) == 0xE0 ? octet & 0x0F :
-//                (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;
-//        if (!width) return 0;
-//        if (pointer+width > end) return 0;
-//        for (k = 1; k < width; k ++) {
-//            octet = pointer[k];
-//            if ((octet & 0xC0) != 0x80) return 0;
-//            value = (value << 6) + (octet & 0x3F);
-//        }
-//        if (!((width == 1) ||
-//            (width == 2 && value >= 0x80) ||
-//            (width == 3 && value >= 0x800) ||
-//            (width == 4 && value >= 0x10000))) return 0;
-//
-//        pointer += width;
-//    }
-//
-//    return 1;
-//}
-//
-
-// Create STREAM-START.
-func yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) bool {
-	*event = yaml_event_t{
-		typ:      yaml_STREAM_START_EVENT,
-		encoding: encoding,
-	}
-	return true
-}
-
-// Create STREAM-END.
-func yaml_stream_end_event_initialize(event *yaml_event_t) bool {
-	*event = yaml_event_t{
-		typ: yaml_STREAM_END_EVENT,
-	}
-	return true
-}
-
-// Create DOCUMENT-START.
-func yaml_document_start_event_initialize(event *yaml_event_t, version_directive *yaml_version_directive_t,
-	tag_directives []yaml_tag_directive_t, implicit bool) bool {
-	*event = yaml_event_t{
-		typ:               yaml_DOCUMENT_START_EVENT,
-		version_directive: version_directive,
-		tag_directives:    tag_directives,
-		implicit:          implicit,
-	}
-	return true
-}
-
-// Create DOCUMENT-END.
-func yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) bool {
-	*event = yaml_event_t{
-		typ:      yaml_DOCUMENT_END_EVENT,
-		implicit: implicit,
-	}
-	return true
-}
-
-///*
-// * Create ALIAS.
-// */
-//
-//YAML_DECLARE(int)
-//yaml_alias_event_initialize(event *yaml_event_t, anchor *yaml_char_t)
-//{
-//    mark yaml_mark_t = { 0, 0, 0 }
-//    anchor_copy *yaml_char_t = NULL
-//
-//    assert(event) // Non-NULL event object is expected.
-//    assert(anchor) // Non-NULL anchor is expected.
-//
-//    if (!yaml_check_utf8(anchor, strlen((char *)anchor))) return 0
-//
-//    anchor_copy = yaml_strdup(anchor)
-//    if (!anchor_copy)
-//        return 0
-//
-//    ALIAS_EVENT_INIT(*event, anchor_copy, mark, mark)
-//
-//    return 1
-//}
-
-// Create SCALAR.
-func yaml_scalar_event_initialize(event *yaml_event_t, anchor, tag, value []byte, plain_implicit, quoted_implicit bool, style yaml_scalar_style_t) bool {
-	*event = yaml_event_t{
-		typ:             yaml_SCALAR_EVENT,
-		anchor:          anchor,
-		tag:             tag,
-		value:           value,
-		implicit:        plain_implicit,
-		quoted_implicit: quoted_implicit,
-		style:           yaml_style_t(style),
-	}
-	return true
-}
-
-// Create SEQUENCE-START.
-func yaml_sequence_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_sequence_style_t) bool {
-	*event = yaml_event_t{
-		typ:      yaml_SEQUENCE_START_EVENT,
-		anchor:   anchor,
-		tag:      tag,
-		implicit: implicit,
-		style:    yaml_style_t(style),
-	}
-	return true
-}
-
-// Create SEQUENCE-END.
-func yaml_sequence_end_event_initialize(event *yaml_event_t) bool {
-	*event = yaml_event_t{
-		typ: yaml_SEQUENCE_END_EVENT,
-	}
-	return true
-}
-
-// Create MAPPING-START.
-func yaml_mapping_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_mapping_style_t) bool {
-	*event = yaml_event_t{
-		typ:      yaml_MAPPING_START_EVENT,
-		anchor:   anchor,
-		tag:      tag,
-		implicit: implicit,
-		style:    yaml_style_t(style),
-	}
-	return true
-}
-
-// Create MAPPING-END.
-func yaml_mapping_end_event_initialize(event *yaml_event_t) bool {
-	*event = yaml_event_t{
-		typ: yaml_MAPPING_END_EVENT,
-	}
-	return true
-}
-
-// Destroy an event object.
-func yaml_event_delete(event *yaml_event_t) {
-	*event = yaml_event_t{}
-}
-
-///*
-// * Create a document object.
-// */
-//
-//YAML_DECLARE(int)
-//yaml_document_initialize(document *yaml_document_t,
-//        version_directive *yaml_version_directive_t,
-//        tag_directives_start *yaml_tag_directive_t,
-//        tag_directives_end *yaml_tag_directive_t,
-//        start_implicit int, end_implicit int)
-//{
-//    struct {
-//        error yaml_error_type_t
-//    } context
-//    struct {
-//        start *yaml_node_t
-//        end *yaml_node_t
-//        top *yaml_node_t
-//    } nodes = { NULL, NULL, NULL }
-//    version_directive_copy *yaml_version_directive_t = NULL
-//    struct {
-//        start *yaml_tag_directive_t
-//        end *yaml_tag_directive_t
-//        top *yaml_tag_directive_t
-//    } tag_directives_copy = { NULL, NULL, NULL }
-//    value yaml_tag_directive_t = { NULL, NULL }
-//    mark yaml_mark_t = { 0, 0, 0 }
-//
-//    assert(document) // Non-NULL document object is expected.
-//    assert((tag_directives_start && tag_directives_end) ||
-//            (tag_directives_start == tag_directives_end))
-//                            // Valid tag directives are expected.
-//
-//    if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error
-//
-//    if (version_directive) {
-//        version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t))
-//        if (!version_directive_copy) goto error
-//        version_directive_copy.major = version_directive.major
-//        version_directive_copy.minor = version_directive.minor
-//    }
-//
-//    if (tag_directives_start != tag_directives_end) {
-//        tag_directive *yaml_tag_directive_t
-//        if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE))
-//            goto error
-//        for (tag_directive = tag_directives_start
-//                tag_directive != tag_directives_end; tag_directive ++) {
-//            assert(tag_directive.handle)
-//            assert(tag_directive.prefix)
-//            if (!yaml_check_utf8(tag_directive.handle,
-//                        strlen((char *)tag_directive.handle)))
-//                goto error
-//            if (!yaml_check_utf8(tag_directive.prefix,
-//                        strlen((char *)tag_directive.prefix)))
-//                goto error
-//            value.handle = yaml_strdup(tag_directive.handle)
-//            value.prefix = yaml_strdup(tag_directive.prefix)
-//            if (!value.handle || !value.prefix) goto error
-//            if (!PUSH(&context, tag_directives_copy, value))
-//                goto error
-//            value.handle = NULL
-//            value.prefix = NULL
-//        }
-//    }
-//
-//    DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy,
-//            tag_directives_copy.start, tag_directives_copy.top,
-//            start_implicit, end_implicit, mark, mark)
-//
-//    return 1
-//
-//error:
-//    STACK_DEL(&context, nodes)
-//    yaml_free(version_directive_copy)
-//    while (!STACK_EMPTY(&context, tag_directives_copy)) {
-//        value yaml_tag_directive_t = POP(&context, tag_directives_copy)
-//        yaml_free(value.handle)
-//        yaml_free(value.prefix)
-//    }
-//    STACK_DEL(&context, tag_directives_copy)
-//    yaml_free(value.handle)
-//    yaml_free(value.prefix)
-//
-//    return 0
-//}
-//
-///*
-// * Destroy a document object.
-// */
-//
-//YAML_DECLARE(void)
-//yaml_document_delete(document *yaml_document_t)
-//{
-//    struct {
-//        error yaml_error_type_t
-//    } context
-//    tag_directive *yaml_tag_directive_t
-//
-//    context.error = YAML_NO_ERROR // Eliminate a compliler warning.
-//
-//    assert(document) // Non-NULL document object is expected.
-//
-//    while (!STACK_EMPTY(&context, document.nodes)) {
-//        node yaml_node_t = POP(&context, document.nodes)
-//        yaml_free(node.tag)
-//        switch (node.type) {
-//            case YAML_SCALAR_NODE:
-//                yaml_free(node.data.scalar.value)
-//                break
-//            case YAML_SEQUENCE_NODE:
-//                STACK_DEL(&context, node.data.sequence.items)
-//                break
-//            case YAML_MAPPING_NODE:
-//                STACK_DEL(&context, node.data.mapping.pairs)
-//                break
-//            default:
-//                assert(0) // Should not happen.
-//        }
-//    }
-//    STACK_DEL(&context, document.nodes)
-//
-//    yaml_free(document.version_directive)
-//    for (tag_directive = document.tag_directives.start
-//            tag_directive != document.tag_directives.end
-//            tag_directive++) {
-//        yaml_free(tag_directive.handle)
-//        yaml_free(tag_directive.prefix)
-//    }
-//    yaml_free(document.tag_directives.start)
-//
-//    memset(document, 0, sizeof(yaml_document_t))
-//}
-//
-///**
-// * Get a document node.
-// */
-//
-//YAML_DECLARE(yaml_node_t *)
-//yaml_document_get_node(document *yaml_document_t, index int)
-//{
-//    assert(document) // Non-NULL document object is expected.
-//
-//    if (index > 0 && document.nodes.start + index <= document.nodes.top) {
-//        return document.nodes.start + index - 1
-//    }
-//    return NULL
-//}
-//
-///**
-// * Get the root object.
-// */
-//
-//YAML_DECLARE(yaml_node_t *)
-//yaml_document_get_root_node(document *yaml_document_t)
-//{
-//    assert(document) // Non-NULL document object is expected.
-//
-//    if (document.nodes.top != document.nodes.start) {
-//        return document.nodes.start
-//    }
-//    return NULL
-//}
-//
-///*
-// * Add a scalar node to a document.
-// */
-//
-//YAML_DECLARE(int)
-//yaml_document_add_scalar(document *yaml_document_t,
-//        tag *yaml_char_t, value *yaml_char_t, length int,
-//        style yaml_scalar_style_t)
-//{
-//    struct {
-//        error yaml_error_type_t
-//    } context
-//    mark yaml_mark_t = { 0, 0, 0 }
-//    tag_copy *yaml_char_t = NULL
-//    value_copy *yaml_char_t = NULL
-//    node yaml_node_t
-//
-//    assert(document) // Non-NULL document object is expected.
-//    assert(value) // Non-NULL value is expected.
-//
-//    if (!tag) {
-//        tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG
-//    }
-//
-//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error
-//    tag_copy = yaml_strdup(tag)
-//    if (!tag_copy) goto error
-//
-//    if (length < 0) {
-//        length = strlen((char *)value)
-//    }
-//
-//    if (!yaml_check_utf8(value, length)) goto error
-//    value_copy = yaml_malloc(length+1)
-//    if (!value_copy) goto error
-//    memcpy(value_copy, value, length)
-//    value_copy[length] = '\0'
-//
-//    SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark)
-//    if (!PUSH(&context, document.nodes, node)) goto error
-//
-//    return document.nodes.top - document.nodes.start
-//
-//error:
-//    yaml_free(tag_copy)
-//    yaml_free(value_copy)
-//
-//    return 0
-//}
-//
-///*
-// * Add a sequence node to a document.
-// */
-//
-//YAML_DECLARE(int)
-//yaml_document_add_sequence(document *yaml_document_t,
-//        tag *yaml_char_t, style yaml_sequence_style_t)
-//{
-//    struct {
-//        error yaml_error_type_t
-//    } context
-//    mark yaml_mark_t = { 0, 0, 0 }
-//    tag_copy *yaml_char_t = NULL
-//    struct {
-//        start *yaml_node_item_t
-//        end *yaml_node_item_t
-//        top *yaml_node_item_t
-//    } items = { NULL, NULL, NULL }
-//    node yaml_node_t
-//
-//    assert(document) // Non-NULL document object is expected.
-//
-//    if (!tag) {
-//        tag = (yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG
-//    }
-//
-//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error
-//    tag_copy = yaml_strdup(tag)
-//    if (!tag_copy) goto error
-//
-//    if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error
-//
-//    SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end,
-//            style, mark, mark)
-//    if (!PUSH(&context, document.nodes, node)) goto error
-//
-//    return document.nodes.top - document.nodes.start
-//
-//error:
-//    STACK_DEL(&context, items)
-//    yaml_free(tag_copy)
-//
-//    return 0
-//}
-//
-///*
-// * Add a mapping node to a document.
-// */
-//
-//YAML_DECLARE(int)
-//yaml_document_add_mapping(document *yaml_document_t,
-//        tag *yaml_char_t, style yaml_mapping_style_t)
-//{
-//    struct {
-//        error yaml_error_type_t
-//    } context
-//    mark yaml_mark_t = { 0, 0, 0 }
-//    tag_copy *yaml_char_t = NULL
-//    struct {
-//        start *yaml_node_pair_t
-//        end *yaml_node_pair_t
-//        top *yaml_node_pair_t
-//    } pairs = { NULL, NULL, NULL }
-//    node yaml_node_t
-//
-//    assert(document) // Non-NULL document object is expected.
-//
-//    if (!tag) {
-//        tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG
-//    }
-//
-//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error
-//    tag_copy = yaml_strdup(tag)
-//    if (!tag_copy) goto error
-//
-//    if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error
-//
-//    MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end,
-//            style, mark, mark)
-//    if (!PUSH(&context, document.nodes, node)) goto error
-//
-//    return document.nodes.top - document.nodes.start
-//
-//error:
-//    STACK_DEL(&context, pairs)
-//    yaml_free(tag_copy)
-//
-//    return 0
-//}
-//
-///*
-// * Append an item to a sequence node.
-// */
-//
-//YAML_DECLARE(int)
-//yaml_document_append_sequence_item(document *yaml_document_t,
-//        sequence int, item int)
-//{
-//    struct {
-//        error yaml_error_type_t
-//    } context
-//
-//    assert(document) // Non-NULL document is required.
-//    assert(sequence > 0
-//            && document.nodes.start + sequence <= document.nodes.top)
-//                            // Valid sequence id is required.
-//    assert(document.nodes.start[sequence-1].type == YAML_SEQUENCE_NODE)
-//                            // A sequence node is required.
-//    assert(item > 0 && document.nodes.start + item <= document.nodes.top)
-//                            // Valid item id is required.
-//
-//    if (!PUSH(&context,
-//                document.nodes.start[sequence-1].data.sequence.items, item))
-//        return 0
-//
-//    return 1
-//}
-//
-///*
-// * Append a pair of a key and a value to a mapping node.
-// */
-//
-//YAML_DECLARE(int)
-//yaml_document_append_mapping_pair(document *yaml_document_t,
-//        mapping int, key int, value int)
-//{
-//    struct {
-//        error yaml_error_type_t
-//    } context
-//
-//    pair yaml_node_pair_t
-//
-//    assert(document) // Non-NULL document is required.
-//    assert(mapping > 0
-//            && document.nodes.start + mapping <= document.nodes.top)
-//                            // Valid mapping id is required.
-//    assert(document.nodes.start[mapping-1].type == YAML_MAPPING_NODE)
-//                            // A mapping node is required.
-//    assert(key > 0 && document.nodes.start + key <= document.nodes.top)
-//                            // Valid key id is required.
-//    assert(value > 0 && document.nodes.start + value <= document.nodes.top)
-//                            // Valid value id is required.
-//
-//    pair.key = key
-//    pair.value = value
-//
-//    if (!PUSH(&context,
-//                document.nodes.start[mapping-1].data.mapping.pairs, pair))
-//        return 0
-//
-//    return 1
-//}
-//
-//

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/decode.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/decode.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/decode.go
deleted file mode 100644
index 085cddc..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/decode.go
+++ /dev/null
@@ -1,683 +0,0 @@
-package yaml
-
-import (
-	"encoding"
-	"encoding/base64"
-	"fmt"
-	"math"
-	"reflect"
-	"strconv"
-	"time"
-)
-
-const (
-	documentNode = 1 << iota
-	mappingNode
-	sequenceNode
-	scalarNode
-	aliasNode
-)
-
-type node struct {
-	kind         int
-	line, column int
-	tag          string
-	value        string
-	implicit     bool
-	children     []*node
-	anchors      map[string]*node
-}
-
-// ----------------------------------------------------------------------------
-// Parser, produces a node tree out of a libyaml event stream.
-
-type parser struct {
-	parser yaml_parser_t
-	event  yaml_event_t
-	doc    *node
-}
-
-func newParser(b []byte) *parser {
-	p := parser{}
-	if !yaml_parser_initialize(&p.parser) {
-		panic("failed to initialize YAML emitter")
-	}
-
-	if len(b) == 0 {
-		b = []byte{'\n'}
-	}
-
-	yaml_parser_set_input_string(&p.parser, b)
-
-	p.skip()
-	if p.event.typ != yaml_STREAM_START_EVENT {
-		panic("expected stream start event, got " + strconv.Itoa(int(p.event.typ)))
-	}
-	p.skip()
-	return &p
-}
-
-func (p *parser) destroy() {
-	if p.event.typ != yaml_NO_EVENT {
-		yaml_event_delete(&p.event)
-	}
-	yaml_parser_delete(&p.parser)
-}
-
-func (p *parser) skip() {
-	if p.event.typ != yaml_NO_EVENT {
-		if p.event.typ == yaml_STREAM_END_EVENT {
-			failf("attempted to go past the end of stream; corrupted value?")
-		}
-		yaml_event_delete(&p.event)
-	}
-	if !yaml_parser_parse(&p.parser, &p.event) {
-		p.fail()
-	}
-}
-
-func (p *parser) fail() {
-	var where string
-	var line int
-	if p.parser.problem_mark.line != 0 {
-		line = p.parser.problem_mark.line
-	} else if p.parser.context_mark.line != 0 {
-		line = p.parser.context_mark.line
-	}
-	if line != 0 {
-		where = "line " + strconv.Itoa(line) + ": "
-	}
-	var msg string
-	if len(p.parser.problem) > 0 {
-		msg = p.parser.problem
-	} else {
-		msg = "unknown problem parsing YAML content"
-	}
-	failf("%s%s", where, msg)
-}
-
-func (p *parser) anchor(n *node, anchor []byte) {
-	if anchor != nil {
-		p.doc.anchors[string(anchor)] = n
-	}
-}
-
-func (p *parser) parse() *node {
-	switch p.event.typ {
-	case yaml_SCALAR_EVENT:
-		return p.scalar()
-	case yaml_ALIAS_EVENT:
-		return p.alias()
-	case yaml_MAPPING_START_EVENT:
-		return p.mapping()
-	case yaml_SEQUENCE_START_EVENT:
-		return p.sequence()
-	case yaml_DOCUMENT_START_EVENT:
-		return p.document()
-	case yaml_STREAM_END_EVENT:
-		// Happens when attempting to decode an empty buffer.
-		return nil
-	default:
-		panic("attempted to parse unknown event: " + strconv.Itoa(int(p.event.typ)))
-	}
-	panic("unreachable")
-}
-
-func (p *parser) node(kind int) *node {
-	return &node{
-		kind:   kind,
-		line:   p.event.start_mark.line,
-		column: p.event.start_mark.column,
-	}
-}
-
-func (p *parser) document() *node {
-	n := p.node(documentNode)
-	n.anchors = make(map[string]*node)
-	p.doc = n
-	p.skip()
-	n.children = append(n.children, p.parse())
-	if p.event.typ != yaml_DOCUMENT_END_EVENT {
-		panic("expected end of document event but got " + strconv.Itoa(int(p.event.typ)))
-	}
-	p.skip()
-	return n
-}
-
-func (p *parser) alias() *node {
-	n := p.node(aliasNode)
-	n.value = string(p.event.anchor)
-	p.skip()
-	return n
-}
-
-func (p *parser) scalar() *node {
-	n := p.node(scalarNode)
-	n.value = string(p.event.value)
-	n.tag = string(p.event.tag)
-	n.implicit = p.event.implicit
-	p.anchor(n, p.event.anchor)
-	p.skip()
-	return n
-}
-
-func (p *parser) sequence() *node {
-	n := p.node(sequenceNode)
-	p.anchor(n, p.event.anchor)
-	p.skip()
-	for p.event.typ != yaml_SEQUENCE_END_EVENT {
-		n.children = append(n.children, p.parse())
-	}
-	p.skip()
-	return n
-}
-
-func (p *parser) mapping() *node {
-	n := p.node(mappingNode)
-	p.anchor(n, p.event.anchor)
-	p.skip()
-	for p.event.typ != yaml_MAPPING_END_EVENT {
-		n.children = append(n.children, p.parse(), p.parse())
-	}
-	p.skip()
-	return n
-}
-
-// ----------------------------------------------------------------------------
-// Decoder, unmarshals a node into a provided value.
-
-type decoder struct {
-	doc     *node
-	aliases map[string]bool
-	mapType reflect.Type
-	terrors []string
-}
-
-var (
-	mapItemType    = reflect.TypeOf(MapItem{})
-	durationType   = reflect.TypeOf(time.Duration(0))
-	defaultMapType = reflect.TypeOf(map[interface{}]interface{}{})
-	ifaceType      = defaultMapType.Elem()
-)
-
-func newDecoder() *decoder {
-	d := &decoder{mapType: defaultMapType}
-	d.aliases = make(map[string]bool)
-	return d
-}
-
-func (d *decoder) terror(n *node, tag string, out reflect.Value) {
-	if n.tag != "" {
-		tag = n.tag
-	}
-	value := n.value
-	if tag != yaml_SEQ_TAG && tag != yaml_MAP_TAG {
-		if len(value) > 10 {
-			value = " `" + value[:7] + "...`"
-		} else {
-			value = " `" + value + "`"
-		}
-	}
-	d.terrors = append(d.terrors, fmt.Sprintf("line %d: cannot unmarshal %s%s into %s", n.line+1, shortTag(tag), value, out.Type()))
-}
-
-func (d *decoder) callUnmarshaler(n *node, u Unmarshaler) (good bool) {
-	terrlen := len(d.terrors)
-	err := u.UnmarshalYAML(func(v interface{}) (err error) {
-		defer handleErr(&err)
-		d.unmarshal(n, reflect.ValueOf(v))
-		if len(d.terrors) > terrlen {
-			issues := d.terrors[terrlen:]
-			d.terrors = d.terrors[:terrlen]
-			return &TypeError{issues}
-		}
-		return nil
-	})
-	if e, ok := err.(*TypeError); ok {
-		d.terrors = append(d.terrors, e.Errors...)
-		return false
-	}
-	if err != nil {
-		fail(err)
-	}
-	return true
-}
-
-// d.prepare initializes and dereferences pointers and calls UnmarshalYAML
-// if a value is found to implement it.
-// It returns the initialized and dereferenced out value, whether
-// unmarshalling was already done by UnmarshalYAML, and if so whether
-// its types unmarshalled appropriately.
-//
-// If n holds a null value, prepare returns before doing anything.
-func (d *decoder) prepare(n *node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) {
-	if n.tag == yaml_NULL_TAG || n.kind == scalarNode && n.tag == "" && (n.value == "null" || n.value == "") {
-		return out, false, false
-	}
-	again := true
-	for again {
-		again = false
-		if out.Kind() == reflect.Ptr {
-			if out.IsNil() {
-				out.Set(reflect.New(out.Type().Elem()))
-			}
-			out = out.Elem()
-			again = true
-		}
-		if out.CanAddr() {
-			if u, ok := out.Addr().Interface().(Unmarshaler); ok {
-				good = d.callUnmarshaler(n, u)
-				return out, true, good
-			}
-		}
-	}
-	return out, false, false
-}
-
-func (d *decoder) unmarshal(n *node, out reflect.Value) (good bool) {
-	switch n.kind {
-	case documentNode:
-		return d.document(n, out)
-	case aliasNode:
-		return d.alias(n, out)
-	}
-	out, unmarshaled, good := d.prepare(n, out)
-	if unmarshaled {
-		return good
-	}
-	switch n.kind {
-	case scalarNode:
-		good = d.scalar(n, out)
-	case mappingNode:
-		good = d.mapping(n, out)
-	case sequenceNode:
-		good = d.sequence(n, out)
-	default:
-		panic("internal error: unknown node kind: " + strconv.Itoa(n.kind))
-	}
-	return good
-}
-
-func (d *decoder) document(n *node, out reflect.Value) (good bool) {
-	if len(n.children) == 1 {
-		d.doc = n
-		d.unmarshal(n.children[0], out)
-		return true
-	}
-	return false
-}
-
-func (d *decoder) alias(n *node, out reflect.Value) (good bool) {
-	an, ok := d.doc.anchors[n.value]
-	if !ok {
-		failf("unknown anchor '%s' referenced", n.value)
-	}
-	if d.aliases[n.value] {
-		failf("anchor '%s' value contains itself", n.value)
-	}
-	d.aliases[n.value] = true
-	good = d.unmarshal(an, out)
-	delete(d.aliases, n.value)
-	return good
-}
-
-var zeroValue reflect.Value
-
-func resetMap(out reflect.Value) {
-	for _, k := range out.MapKeys() {
-		out.SetMapIndex(k, zeroValue)
-	}
-}
-
-func (d *decoder) scalar(n *node, out reflect.Value) (good bool) {
-	var tag string
-	var resolved interface{}
-	if n.tag == "" && !n.implicit {
-		tag = yaml_STR_TAG
-		resolved = n.value
-	} else {
-		tag, resolved = resolve(n.tag, n.value)
-		if tag == yaml_BINARY_TAG {
-			data, err := base64.StdEncoding.DecodeString(resolved.(string))
-			if err != nil {
-				failf("!!binary value contains invalid base64 data")
-			}
-			resolved = string(data)
-		}
-	}
-	if resolved == nil {
-		if out.Kind() == reflect.Map && !out.CanAddr() {
-			resetMap(out)
-		} else {
-			out.Set(reflect.Zero(out.Type()))
-		}
-		return true
-	}
-	if s, ok := resolved.(string); ok && out.CanAddr() {
-		if u, ok := out.Addr().Interface().(encoding.TextUnmarshaler); ok {
-			err := u.UnmarshalText([]byte(s))
-			if err != nil {
-				fail(err)
-			}
-			return true
-		}
-	}
-	switch out.Kind() {
-	case reflect.String:
-		if tag == yaml_BINARY_TAG {
-			out.SetString(resolved.(string))
-			good = true
-		} else if resolved != nil {
-			out.SetString(n.value)
-			good = true
-		}
-	case reflect.Interface:
-		if resolved == nil {
-			out.Set(reflect.Zero(out.Type()))
-		} else {
-			out.Set(reflect.ValueOf(resolved))
-		}
-		good = true
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		switch resolved := resolved.(type) {
-		case int:
-			if !out.OverflowInt(int64(resolved)) {
-				out.SetInt(int64(resolved))
-				good = true
-			}
-		case int64:
-			if !out.OverflowInt(resolved) {
-				out.SetInt(resolved)
-				good = true
-			}
-		case uint64:
-			if resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) {
-				out.SetInt(int64(resolved))
-				good = true
-			}
-		case float64:
-			if resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) {
-				out.SetInt(int64(resolved))
-				good = true
-			}
-		case string:
-			if out.Type() == durationType {
-				d, err := time.ParseDuration(resolved)
-				if err == nil {
-					out.SetInt(int64(d))
-					good = true
-				}
-			}
-		}
-	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
-		switch resolved := resolved.(type) {
-		case int:
-			if resolved >= 0 && !out.OverflowUint(uint64(resolved)) {
-				out.SetUint(uint64(resolved))
-				good = true
-			}
-		case int64:
-			if resolved >= 0 && !out.OverflowUint(uint64(resolved)) {
-				out.SetUint(uint64(resolved))
-				good = true
-			}
-		case uint64:
-			if !out.OverflowUint(uint64(resolved)) {
-				out.SetUint(uint64(resolved))
-				good = true
-			}
-		case float64:
-			if resolved <= math.MaxUint64 && !out.OverflowUint(uint64(resolved)) {
-				out.SetUint(uint64(resolved))
-				good = true
-			}
-		}
-	case reflect.Bool:
-		switch resolved := resolved.(type) {
-		case bool:
-			out.SetBool(resolved)
-			good = true
-		}
-	case reflect.Float32, reflect.Float64:
-		switch resolved := resolved.(type) {
-		case int:
-			out.SetFloat(float64(resolved))
-			good = true
-		case int64:
-			out.SetFloat(float64(resolved))
-			good = true
-		case uint64:
-			out.SetFloat(float64(resolved))
-			good = true
-		case float64:
-			out.SetFloat(resolved)
-			good = true
-		}
-	case reflect.Ptr:
-		if out.Type().Elem() == reflect.TypeOf(resolved) {
-			// TODO DOes this make sense? When is out a Ptr except when decoding a nil value?
-			elem := reflect.New(out.Type().Elem())
-			elem.Elem().Set(reflect.ValueOf(resolved))
-			out.Set(elem)
-			good = true
-		}
-	}
-	if !good {
-		d.terror(n, tag, out)
-	}
-	return good
-}
-
-func settableValueOf(i interface{}) reflect.Value {
-	v := reflect.ValueOf(i)
-	sv := reflect.New(v.Type()).Elem()
-	sv.Set(v)
-	return sv
-}
-
-func (d *decoder) sequence(n *node, out reflect.Value) (good bool) {
-	l := len(n.children)
-
-	var iface reflect.Value
-	switch out.Kind() {
-	case reflect.Slice:
-		out.Set(reflect.MakeSlice(out.Type(), l, l))
-	case reflect.Interface:
-		// No type hints. Will have to use a generic sequence.
-		iface = out
-		out = settableValueOf(make([]interface{}, l))
-	default:
-		d.terror(n, yaml_SEQ_TAG, out)
-		return false
-	}
-	et := out.Type().Elem()
-
-	j := 0
-	for i := 0; i < l; i++ {
-		e := reflect.New(et).Elem()
-		if ok := d.unmarshal(n.children[i], e); ok {
-			out.Index(j).Set(e)
-			j++
-		}
-	}
-	out.Set(out.Slice(0, j))
-	if iface.IsValid() {
-		iface.Set(out)
-	}
-	return true
-}
-
-func (d *decoder) mapping(n *node, out reflect.Value) (good bool) {
-	switch out.Kind() {
-	case reflect.Struct:
-		return d.mappingStruct(n, out)
-	case reflect.Slice:
-		return d.mappingSlice(n, out)
-	case reflect.Map:
-		// okay
-	case reflect.Interface:
-		if d.mapType.Kind() == reflect.Map {
-			iface := out
-			out = reflect.MakeMap(d.mapType)
-			iface.Set(out)
-		} else {
-			slicev := reflect.New(d.mapType).Elem()
-			if !d.mappingSlice(n, slicev) {
-				return false
-			}
-			out.Set(slicev)
-			return true
-		}
-	default:
-		d.terror(n, yaml_MAP_TAG, out)
-		return false
-	}
-	outt := out.Type()
-	kt := outt.Key()
-	et := outt.Elem()
-
-	mapType := d.mapType
-	if outt.Key() == ifaceType && outt.Elem() == ifaceType {
-		d.mapType = outt
-	}
-
-	if out.IsNil() {
-		out.Set(reflect.MakeMap(outt))
-	}
-	l := len(n.children)
-	for i := 0; i < l; i += 2 {
-		if isMerge(n.children[i]) {
-			d.merge(n.children[i+1], out)
-			continue
-		}
-		k := reflect.New(kt).Elem()
-		if d.unmarshal(n.children[i], k) {
-			kkind := k.Kind()
-			if kkind == reflect.Interface {
-				kkind = k.Elem().Kind()
-			}
-			if kkind == reflect.Map || kkind == reflect.Slice {
-				failf("invalid map key: %#v", k.Interface())
-			}
-			e := reflect.New(et).Elem()
-			if d.unmarshal(n.children[i+1], e) {
-				out.SetMapIndex(k, e)
-			}
-		}
-	}
-	d.mapType = mapType
-	return true
-}
-
-func (d *decoder) mappingSlice(n *node, out reflect.Value) (good bool) {
-	outt := out.Type()
-	if outt.Elem() != mapItemType {
-		d.terror(n, yaml_MAP_TAG, out)
-		return false
-	}
-
-	mapType := d.mapType
-	d.mapType = outt
-
-	var slice []MapItem
-	var l = len(n.children)
-	for i := 0; i < l; i += 2 {
-		if isMerge(n.children[i]) {
-			d.merge(n.children[i+1], out)
-			continue
-		}
-		item := MapItem{}
-		k := reflect.ValueOf(&item.Key).Elem()
-		if d.unmarshal(n.children[i], k) {
-			v := reflect.ValueOf(&item.Value).Elem()
-			if d.unmarshal(n.children[i+1], v) {
-				slice = append(slice, item)
-			}
-		}
-	}
-	out.Set(reflect.ValueOf(slice))
-	d.mapType = mapType
-	return true
-}
-
-func (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) {
-	sinfo, err := getStructInfo(out.Type())
-	if err != nil {
-		panic(err)
-	}
-	name := settableValueOf("")
-	l := len(n.children)
-
-	var inlineMap reflect.Value
-	var elemType reflect.Type
-	if sinfo.InlineMap != -1 {
-		inlineMap = out.Field(sinfo.InlineMap)
-		inlineMap.Set(reflect.New(inlineMap.Type()).Elem())
-		elemType = inlineMap.Type().Elem()
-	}
-
-	for i := 0; i < l; i += 2 {
-		ni := n.children[i]
-		if isMerge(ni) {
-			d.merge(n.children[i+1], out)
-			continue
-		}
-		if !d.unmarshal(ni, name) {
-			continue
-		}
-		if info, ok := sinfo.FieldsMap[name.String()]; ok {
-			var field reflect.Value
-			if info.Inline == nil {
-				field = out.Field(info.Num)
-			} else {
-				field = out.FieldByIndex(info.Inline)
-			}
-			d.unmarshal(n.children[i+1], field)
-		} else if sinfo.InlineMap != -1 {
-			if inlineMap.IsNil() {
-				inlineMap.Set(reflect.MakeMap(inlineMap.Type()))
-			}
-			value := reflect.New(elemType).Elem()
-			d.unmarshal(n.children[i+1], value)
-			inlineMap.SetMapIndex(name, value)
-		}
-	}
-	return true
-}
-
-func failWantMap() {
-	failf("map merge requires map or sequence of maps as the value")
-}
-
-func (d *decoder) merge(n *node, out reflect.Value) {
-	switch n.kind {
-	case mappingNode:
-		d.unmarshal(n, out)
-	case aliasNode:
-		an, ok := d.doc.anchors[n.value]
-		if ok && an.kind != mappingNode {
-			failWantMap()
-		}
-		d.unmarshal(n, out)
-	case sequenceNode:
-		// Step backwards as earlier nodes take precedence.
-		for i := len(n.children) - 1; i >= 0; i-- {
-			ni := n.children[i]
-			if ni.kind == aliasNode {
-				an, ok := d.doc.anchors[ni.value]
-				if ok && an.kind != mappingNode {
-					failWantMap()
-				}
-			} else if ni.kind != mappingNode {
-				failWantMap()
-			}
-			d.unmarshal(ni, out)
-		}
-	default:
-		failWantMap()
-	}
-}
-
-func isMerge(n *node) bool {
-	return n.kind == scalarNode && n.value == "<<" && (n.implicit == true || n.tag == yaml_MERGE_TAG)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/decode_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/decode_test.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/decode_test.go
deleted file mode 100644
index 04fdd9e..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/decode_test.go
+++ /dev/null
@@ -1,966 +0,0 @@
-package yaml_test
-
-import (
-	"errors"
-	. "gopkg.in/check.v1"
-	"gopkg.in/yaml.v2"
-	"math"
-	"net"
-	"reflect"
-	"strings"
-	"time"
-)
-
-var unmarshalIntTest = 123
-
-var unmarshalTests = []struct {
-	data  string
-	value interface{}
-}{
-	{
-		"",
-		&struct{}{},
-	}, {
-		"{}", &struct{}{},
-	}, {
-		"v: hi",
-		map[string]string{"v": "hi"},
-	}, {
-		"v: hi", map[string]interface{}{"v": "hi"},
-	}, {
-		"v: true",
-		map[string]string{"v": "true"},
-	}, {
-		"v: true",
-		map[string]interface{}{"v": true},
-	}, {
-		"v: 10",
-		map[string]interface{}{"v": 10},
-	}, {
-		"v: 0b10",
-		map[string]interface{}{"v": 2},
-	}, {
-		"v: 0xA",
-		map[string]interface{}{"v": 10},
-	}, {
-		"v: 4294967296",
-		map[string]int64{"v": 4294967296},
-	}, {
-		"v: 0.1",
-		map[string]interface{}{"v": 0.1},
-	}, {
-		"v: .1",
-		map[string]interface{}{"v": 0.1},
-	}, {
-		"v: .Inf",
-		map[string]interface{}{"v": math.Inf(+1)},
-	}, {
-		"v: -.Inf",
-		map[string]interface{}{"v": math.Inf(-1)},
-	}, {
-		"v: -10",
-		map[string]interface{}{"v": -10},
-	}, {
-		"v: -.1",
-		map[string]interface{}{"v": -0.1},
-	},
-
-	// Simple values.
-	{
-		"123",
-		&unmarshalIntTest,
-	},
-
-	// Floats from spec
-	{
-		"canonical: 6.8523e+5",
-		map[string]interface{}{"canonical": 6.8523e+5},
-	}, {
-		"expo: 685.230_15e+03",
-		map[string]interface{}{"expo": 685.23015e+03},
-	}, {
-		"fixed: 685_230.15",
-		map[string]interface{}{"fixed": 685230.15},
-	}, {
-		"neginf: -.inf",
-		map[string]interface{}{"neginf": math.Inf(-1)},
-	}, {
-		"fixed: 685_230.15",
-		map[string]float64{"fixed": 685230.15},
-	},
-	//{"sexa: 190:20:30.15", map[string]interface{}{"sexa": 0}}, // Unsupported
-	//{"notanum: .NaN", map[string]interface{}{"notanum": math.NaN()}}, // Equality of NaN fails.
-
-	// Bools from spec
-	{
-		"canonical: y",
-		map[string]interface{}{"canonical": true},
-	}, {
-		"answer: NO",
-		map[string]interface{}{"answer": false},
-	}, {
-		"logical: True",
-		map[string]interface{}{"logical": true},
-	}, {
-		"option: on",
-		map[string]interface{}{"option": true},
-	}, {
-		"option: on",
-		map[string]bool{"option": true},
-	},
-	// Ints from spec
-	{
-		"canonical: 685230",
-		map[string]interface{}{"canonical": 685230},
-	}, {
-		"decimal: +685_230",
-		map[string]interface{}{"decimal": 685230},
-	}, {
-		"octal: 02472256",
-		map[string]interface{}{"octal": 685230},
-	}, {
-		"hexa: 0x_0A_74_AE",
-		map[string]interface{}{"hexa": 685230},
-	}, {
-		"bin: 0b1010_0111_0100_1010_1110",
-		map[string]interface{}{"bin": 685230},
-	}, {
-		"bin: -0b101010",
-		map[string]interface{}{"bin": -42},
-	}, {
-		"decimal: +685_230",
-		map[string]int{"decimal": 685230},
-	},
-
-	//{"sexa: 190:20:30", map[string]interface{}{"sexa": 0}}, // Unsupported
-
-	// Nulls from spec
-	{
-		"empty:",
-		map[string]interface{}{"empty": nil},
-	}, {
-		"canonical: ~",
-		map[string]interface{}{"canonical": nil},
-	}, {
-		"english: null",
-		map[string]interface{}{"english": nil},
-	}, {
-		"~: null key",
-		map[interface{}]string{nil: "null key"},
-	}, {
-		"empty:",
-		map[string]*bool{"empty": nil},
-	},
-
-	// Flow sequence
-	{
-		"seq: [A,B]",
-		map[string]interface{}{"seq": []interface{}{"A", "B"}},
-	}, {
-		"seq: [A,B,C,]",
-		map[string][]string{"seq": []string{"A", "B", "C"}},
-	}, {
-		"seq: [A,1,C]",
-		map[string][]string{"seq": []string{"A", "1", "C"}},
-	}, {
-		"seq: [A,1,C]",
-		map[string][]int{"seq": []int{1}},
-	}, {
-		"seq: [A,1,C]",
-		map[string]interface{}{"seq": []interface{}{"A", 1, "C"}},
-	},
-	// Block sequence
-	{
-		"seq:\n - A\n - B",
-		map[string]interface{}{"seq": []interface{}{"A", "B"}},
-	}, {
-		"seq:\n - A\n - B\n - C",
-		map[string][]string{"seq": []string{"A", "B", "C"}},
-	}, {
-		"seq:\n - A\n - 1\n - C",
-		map[string][]string{"seq": []string{"A", "1", "C"}},
-	}, {
-		"seq:\n - A\n - 1\n - C",
-		map[string][]int{"seq": []int{1}},
-	}, {
-		"seq:\n - A\n - 1\n - C",
-		map[string]interface{}{"seq": []interface{}{"A", 1, "C"}},
-	},
-
-	// Literal block scalar
-	{
-		"scalar: | # Comment\n\n literal\n\n \ttext\n\n",
-		map[string]string{"scalar": "\nliteral\n\n\ttext\n"},
-	},
-
-	// Folded block scalar
-	{
-		"scalar: > # Comment\n\n folded\n line\n \n next\n line\n  * one\n  * two\n\n last\n line\n\n",
-		map[string]string{"scalar": "\nfolded line\nnext line\n * one\n * two\n\nlast line\n"},
-	},
-
-	// Map inside interface with no type hints.
-	{
-		"a: {b: c}",
-		map[interface{}]interface{}{"a": map[interface{}]interface{}{"b": "c"}},
-	},
-
-	// Structs and type conversions.
-	{
-		"hello: world",
-		&struct{ Hello string }{"world"},
-	}, {
-		"a: {b: c}",
-		&struct{ A struct{ B string } }{struct{ B string }{"c"}},
-	}, {
-		"a: {b: c}",
-		&struct{ A *struct{ B string } }{&struct{ B string }{"c"}},
-	}, {
-		"a: {b: c}",
-		&struct{ A map[string]string }{map[string]string{"b": "c"}},
-	}, {
-		"a: {b: c}",
-		&struct{ A *map[string]string }{&map[string]string{"b": "c"}},
-	}, {
-		"a:",
-		&struct{ A map[string]string }{},
-	}, {
-		"a: 1",
-		&struct{ A int }{1},
-	}, {
-		"a: 1",
-		&struct{ A float64 }{1},
-	}, {
-		"a: 1.0",
-		&struct{ A int }{1},
-	}, {
-		"a: 1.0",
-		&struct{ A uint }{1},
-	}, {
-		"a: [1, 2]",
-		&struct{ A []int }{[]int{1, 2}},
-	}, {
-		"a: 1",
-		&struct{ B int }{0},
-	}, {
-		"a: 1",
-		&struct {
-			B int "a"
-		}{1},
-	}, {
-		"a: y",
-		&struct{ A bool }{true},
-	},
-
-	// Some cross type conversions
-	{
-		"v: 42",
-		map[string]uint{"v": 42},
-	}, {
-		"v: -42",
-		map[string]uint{},
-	}, {
-		"v: 4294967296",
-		map[string]uint64{"v": 4294967296},
-	}, {
-		"v: -4294967296",
-		map[string]uint64{},
-	},
-
-	// int
-	{
-		"int_max: 2147483647",
-		map[string]int{"int_max": math.MaxInt32},
-	},
-	{
-		"int_min: -2147483648",
-		map[string]int{"int_min": math.MinInt32},
-	},
-	{
-		"int_overflow: 9223372036854775808", // math.MaxInt64 + 1
-		map[string]int{},
-	},
-
-	// int64
-	{
-		"int64_max: 9223372036854775807",
-		map[string]int64{"int64_max": math.MaxInt64},
-	},
-	{
-		"int64_max_base2: 0b111111111111111111111111111111111111111111111111111111111111111",
-		map[string]int64{"int64_max_base2": math.MaxInt64},
-	},
-	{
-		"int64_min: -9223372036854775808",
-		map[string]int64{"int64_min": math.MinInt64},
-	},
-	{
-		"int64_neg_base2: -0b111111111111111111111111111111111111111111111111111111111111111",
-		map[string]int64{"int64_neg_base2": -math.MaxInt64},
-	},
-	{
-		"int64_overflow: 9223372036854775808", // math.MaxInt64 + 1
-		map[string]int64{},
-	},
-
-	// uint
-	{
-		"uint_min: 0",
-		map[string]uint{"uint_min": 0},
-	},
-	{
-		"uint_max: 4294967295",
-		map[string]uint{"uint_max": math.MaxUint32},
-	},
-	{
-		"uint_underflow: -1",
-		map[string]uint{},
-	},
-
-	// uint64
-	{
-		"uint64_min: 0",
-		map[string]uint{"uint64_min": 0},
-	},
-	{
-		"uint64_max: 18446744073709551615",
-		map[string]uint64{"uint64_max": math.MaxUint64},
-	},
-	{
-		"uint64_max_base2: 0b1111111111111111111111111111111111111111111111111111111111111111",
-		map[string]uint64{"uint64_max_base2": math.MaxUint64},
-	},
-	{
-		"uint64_maxint64: 9223372036854775807",
-		map[string]uint64{"uint64_maxint64": math.MaxInt64},
-	},
-	{
-		"uint64_underflow: -1",
-		map[string]uint64{},
-	},
-
-	// float32
-	{
-		"float32_max: 3.40282346638528859811704183484516925440e+38",
-		map[string]float32{"float32_max": math.MaxFloat32},
-	},
-	{
-		"float32_nonzero: 1.401298464324817070923729583289916131280e-45",
-		map[string]float32{"float32_nonzero": math.SmallestNonzeroFloat32},
-	},
-	{
-		"float32_maxuint64: 18446744073709551615",
-		map[string]float32{"float32_maxuint64": float32(math.MaxUint64)},
-	},
-	{
-		"float32_maxuint64+1: 18446744073709551616",
-		map[string]float32{"float32_maxuint64+1": float32(math.MaxUint64 + 1)},
-	},
-
-	// float64
-	{
-		"float64_max: 1.797693134862315708145274237317043567981e+308",
-		map[string]float64{"float64_max": math.MaxFloat64},
-	},
-	{
-		"float64_nonzero: 4.940656458412465441765687928682213723651e-324",
-		map[string]float64{"float64_nonzero": math.SmallestNonzeroFloat64},
-	},
-	{
-		"float64_maxuint64: 18446744073709551615",
-		map[string]float64{"float64_maxuint64": float64(math.MaxUint64)},
-	},
-	{
-		"float64_maxuint64+1: 18446744073709551616",
-		map[string]float64{"float64_maxuint64+1": float64(math.MaxUint64 + 1)},
-	},
-
-	// Overflow cases.
-	{
-		"v: 4294967297",
-		map[string]int32{},
-	}, {
-		"v: 128",
-		map[string]int8{},
-	},
-
-	// Quoted values.
-	{
-		"'1': '\"2\"'",
-		map[interface{}]interface{}{"1": "\"2\""},
-	}, {
-		"v:\n- A\n- 'B\n\n  C'\n",
-		map[string][]string{"v": []string{"A", "B\nC"}},
-	},
-
-	// Explicit tags.
-	{
-		"v: !!float '1.1'",
-		map[string]interface{}{"v": 1.1},
-	}, {
-		"v: !!null ''",
-		map[string]interface{}{"v": nil},
-	}, {
-		"%TAG !y! tag:yaml.org,2002:\n---\nv: !y!int '1'",
-		map[string]interface{}{"v": 1},
-	},
-
-	// Anchors and aliases.
-	{
-		"a: &x 1\nb: &y 2\nc: *x\nd: *y\n",
-		&struct{ A, B, C, D int }{1, 2, 1, 2},
-	}, {
-		"a: &a {c: 1}\nb: *a",
-		&struct {
-			A, B struct {
-				C int
-			}
-		}{struct{ C int }{1}, struct{ C int }{1}},
-	}, {
-		"a: &a [1, 2]\nb: *a",
-		&struct{ B []int }{[]int{1, 2}},
-	}, {
-		"b: *a\na: &a {c: 1}",
-		&struct {
-			A, B struct {
-				C int
-			}
-		}{struct{ C int }{1}, struct{ C int }{1}},
-	},
-
-	// Bug #1133337
-	{
-		"foo: ''",
-		map[string]*string{"foo": new(string)},
-	}, {
-		"foo: null",
-		map[string]string{"foo": ""},
-	}, {
-		"foo: null",
-		map[string]interface{}{"foo": nil},
-	},
-
-	// Ignored field
-	{
-		"a: 1\nb: 2\n",
-		&struct {
-			A int
-			B int "-"
-		}{1, 0},
-	},
-
-	// Bug #1191981
-	{
-		"" +
-			"%YAML 1.1\n" +
-			"--- !!str\n" +
-			`"Generic line break (no glyph)\n\` + "\n" +
-			` Generic line break (glyphed)\n\` + "\n" +
-			` Line separator\u2028\` + "\n" +
-			` Paragraph separator\u2029"` + "\n",
-		"" +
-			"Generic line break (no glyph)\n" +
-			"Generic line break (glyphed)\n" +
-			"Line separator\u2028Paragraph separator\u2029",
-	},
-
-	// Struct inlining
-	{
-		"a: 1\nb: 2\nc: 3\n",
-		&struct {
-			A int
-			C inlineB `yaml:",inline"`
-		}{1, inlineB{2, inlineC{3}}},
-	},
-
-	// Map inlining
-	{
-		"a: 1\nb: 2\nc: 3\n",
-		&struct {
-			A int
-			C map[string]int `yaml:",inline"`
-		}{1, map[string]int{"b": 2, "c": 3}},
-	},
-
-	// bug 1243827
-	{
-		"a: -b_c",
-		map[string]interface{}{"a": "-b_c"},
-	},
-	{
-		"a: +b_c",
-		map[string]interface{}{"a": "+b_c"},
-	},
-	{
-		"a: 50cent_of_dollar",
-		map[string]interface{}{"a": "50cent_of_dollar"},
-	},
-
-	// Duration
-	{
-		"a: 3s",
-		map[string]time.Duration{"a": 3 * time.Second},
-	},
-
-	// Issue #24.
-	{
-		"a: <foo>",
-		map[string]string{"a": "<foo>"},
-	},
-
-	// Base 60 floats are obsolete and unsupported.
-	{
-		"a: 1:1\n",
-		map[string]string{"a": "1:1"},
-	},
-
-	// Binary data.
-	{
-		"a: !!binary gIGC\n",
-		map[string]string{"a": "\x80\x81\x82"},
-	}, {
-		"a: !!binary |\n  " + strings.Repeat("kJCQ", 17) + "kJ\n  CQ\n",
-		map[string]string{"a": strings.Repeat("\x90", 54)},
-	}, {
-		"a: !!binary |\n  " + strings.Repeat("A", 70) + "\n  ==\n",
-		map[string]string{"a": strings.Repeat("\x00", 52)},
-	},
-
-	// Ordered maps.
-	{
-		"{b: 2, a: 1, d: 4, c: 3, sub: {e: 5}}",
-		&yaml.MapSlice{{"b", 2}, {"a", 1}, {"d", 4}, {"c", 3}, {"sub", yaml.MapSlice{{"e", 5}}}},
-	},
-
-	// Issue #39.
-	{
-		"a:\n b:\n  c: d\n",
-		map[string]struct{ B interface{} }{"a": {map[interface{}]interface{}{"c": "d"}}},
-	},
-
-	// Custom map type.
-	{
-		"a: {b: c}",
-		M{"a": M{"b": "c"}},
-	},
-
-	// Support encoding.TextUnmarshaler.
-	{
-		"a: 1.2.3.4\n",
-		map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)},
-	},
-	{
-		"a: 2015-02-24T18:19:39Z\n",
-		map[string]time.Time{"a": time.Unix(1424801979, 0)},
-	},
-
-	// Encode empty lists as zero-length slices.
-	{
-		"a: []",
-		&struct{ A []int }{[]int{}},
-	},
-}
-
-type M map[interface{}]interface{}
-
-type inlineB struct {
-	B       int
-	inlineC `yaml:",inline"`
-}
-
-type inlineC struct {
-	C int
-}
-
-func (s *S) TestUnmarshal(c *C) {
-	for _, item := range unmarshalTests {
-		t := reflect.ValueOf(item.value).Type()
-		var value interface{}
-		switch t.Kind() {
-		case reflect.Map:
-			value = reflect.MakeMap(t).Interface()
-		case reflect.String:
-			value = reflect.New(t).Interface()
-		case reflect.Ptr:
-			value = reflect.New(t.Elem()).Interface()
-		default:
-			c.Fatalf("missing case for %s", t)
-		}
-		err := yaml.Unmarshal([]byte(item.data), value)
-		if _, ok := err.(*yaml.TypeError); !ok {
-			c.Assert(err, IsNil)
-		}
-		if t.Kind() == reflect.String {
-			c.Assert(*value.(*string), Equals, item.value)
-		} else {
-			c.Assert(value, DeepEquals, item.value)
-		}
-	}
-}
-
-func (s *S) TestUnmarshalNaN(c *C) {
-	value := map[string]interface{}{}
-	err := yaml.Unmarshal([]byte("notanum: .NaN"), &value)
-	c.Assert(err, IsNil)
-	c.Assert(math.IsNaN(value["notanum"].(float64)), Equals, true)
-}
-
-var unmarshalErrorTests = []struct {
-	data, error string
-}{
-	{"v: !!float 'error'", "yaml: cannot decode !!str `error` as a !!float"},
-	{"v: [A,", "yaml: line 1: did not find expected node content"},
-	{"v:\n- [A,", "yaml: line 2: did not find expected node content"},
-	{"a: *b\n", "yaml: unknown anchor 'b' referenced"},
-	{"a: &a\n  b: *a\n", "yaml: anchor 'a' value contains itself"},
-	{"value: -", "yaml: block sequence entries are not allowed in this context"},
-	{"a: !!binary ==", "yaml: !!binary value contains invalid base64 data"},
-	{"{[.]}", `yaml: invalid map key: \[\]interface \{\}\{"\."\}`},
-	{"{{.}}", `yaml: invalid map key: map\[interface\ \{\}\]interface \{\}\{".":interface \{\}\(nil\)\}`},
-}
-
-func (s *S) TestUnmarshalErrors(c *C) {
-	for _, item := range unmarshalErrorTests {
-		var value interface{}
-		err := yaml.Unmarshal([]byte(item.data), &value)
-		c.Assert(err, ErrorMatches, item.error, Commentf("Partial unmarshal: %#v", value))
-	}
-}
-
-var unmarshalerTests = []struct {
-	data, tag string
-	value     interface{}
-}{
-	{"_: {hi: there}", "!!map", map[interface{}]interface{}{"hi": "there"}},
-	{"_: [1,A]", "!!seq", []interface{}{1, "A"}},
-	{"_: 10", "!!int", 10},
-	{"_: null", "!!null", nil},
-	{`_: BAR!`, "!!str", "BAR!"},
-	{`_: "BAR!"`, "!!str", "BAR!"},
-	{"_: !!foo 'BAR!'", "!!foo", "BAR!"},
-}
-
-var unmarshalerResult = map[int]error{}
-
-type unmarshalerType struct {
-	value interface{}
-}
-
-func (o *unmarshalerType) UnmarshalYAML(unmarshal func(v interface{}) error) error {
-	if err := unmarshal(&o.value); err != nil {
-		return err
-	}
-	if i, ok := o.value.(int); ok {
-		if result, ok := unmarshalerResult[i]; ok {
-			return result
-		}
-	}
-	return nil
-}
-
-type unmarshalerPointer struct {
-	Field *unmarshalerType "_"
-}
-
-type unmarshalerValue struct {
-	Field unmarshalerType "_"
-}
-
-func (s *S) TestUnmarshalerPointerField(c *C) {
-	for _, item := range unmarshalerTests {
-		obj := &unmarshalerPointer{}
-		err := yaml.Unmarshal([]byte(item.data), obj)
-		c.Assert(err, IsNil)
-		if item.value == nil {
-			c.Assert(obj.Field, IsNil)
-		} else {
-			c.Assert(obj.Field, NotNil, Commentf("Pointer not initialized (%#v)", item.value))
-			c.Assert(obj.Field.value, DeepEquals, item.value)
-		}
-	}
-}
-
-func (s *S) TestUnmarshalerValueField(c *C) {
-	for _, item := range unmarshalerTests {
-		obj := &unmarshalerValue{}
-		err := yaml.Unmarshal([]byte(item.data), obj)
-		c.Assert(err, IsNil)
-		c.Assert(obj.Field, NotNil, Commentf("Pointer not initialized (%#v)", item.value))
-		c.Assert(obj.Field.value, DeepEquals, item.value)
-	}
-}
-
-func (s *S) TestUnmarshalerWholeDocument(c *C) {
-	obj := &unmarshalerType{}
-	err := yaml.Unmarshal([]byte(unmarshalerTests[0].data), obj)
-	c.Assert(err, IsNil)
-	value, ok := obj.value.(map[interface{}]interface{})
-	c.Assert(ok, Equals, true, Commentf("value: %#v", obj.value))
-	c.Assert(value["_"], DeepEquals, unmarshalerTests[0].value)
-}
-
-func (s *S) TestUnmarshalerTypeError(c *C) {
-	unmarshalerResult[2] = &yaml.TypeError{[]string{"foo"}}
-	unmarshalerResult[4] = &yaml.TypeError{[]string{"bar"}}
-	defer func() {
-		delete(unmarshalerResult, 2)
-		delete(unmarshalerResult, 4)
-	}()
-
-	type T struct {
-		Before int
-		After  int
-		M      map[string]*unmarshalerType
-	}
-	var v T
-	data := `{before: A, m: {abc: 1, def: 2, ghi: 3, jkl: 4}, after: B}`
-	err := yaml.Unmarshal([]byte(data), &v)
-	c.Assert(err, ErrorMatches, ""+
-		"yaml: unmarshal errors:\n"+
-		"  line 1: cannot unmarshal !!str `A` into int\n"+
-		"  foo\n"+
-		"  bar\n"+
-		"  line 1: cannot unmarshal !!str `B` into int")
-	c.Assert(v.M["abc"], NotNil)
-	c.Assert(v.M["def"], IsNil)
-	c.Assert(v.M["ghi"], NotNil)
-	c.Assert(v.M["jkl"], IsNil)
-
-	c.Assert(v.M["abc"].value, Equals, 1)
-	c.Assert(v.M["ghi"].value, Equals, 3)
-}
-
-type proxyTypeError struct{}
-
-func (v *proxyTypeError) UnmarshalYAML(unmarshal func(interface{}) error) error {
-	var s string
-	var a int32
-	var b int64
-	if err := unmarshal(&s); err != nil {
-		panic(err)
-	}
-	if s == "a" {
-		if err := unmarshal(&b); err == nil {
-			panic("should have failed")
-		}
-		return unmarshal(&a)
-	}
-	if err := unmarshal(&a); err == nil {
-		panic("should have failed")
-	}
-	return unmarshal(&b)
-}
-
-func (s *S) TestUnmarshalerTypeErrorProxying(c *C) {
-	type T struct {
-		Before int
-		After  int
-		M      map[string]*proxyTypeError
-	}
-	var v T
-	data := `{before: A, m: {abc: a, def: b}, after: B}`
-	err := yaml.Unmarshal([]byte(data), &v)
-	c.Assert(err, ErrorMatches, ""+
-		"yaml: unmarshal errors:\n"+
-		"  line 1: cannot unmarshal !!str `A` into int\n"+
-		"  line 1: cannot unmarshal !!str `a` into int32\n"+
-		"  line 1: cannot unmarshal !!str `b` into int64\n"+
-		"  line 1: cannot unmarshal !!str `B` into int")
-}
-
-type failingUnmarshaler struct{}
-
-var failingErr = errors.New("failingErr")
-
-func (ft *failingUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error {
-	return failingErr
-}
-
-func (s *S) TestUnmarshalerError(c *C) {
-	err := yaml.Unmarshal([]byte("a: b"), &failingUnmarshaler{})
-	c.Assert(err, Equals, failingErr)
-}
-
-type sliceUnmarshaler []int
-
-func (su *sliceUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error {
-	var slice []int
-	err := unmarshal(&slice)
-	if err == nil {
-		*su = slice
-		return nil
-	}
-
-	var intVal int
-	err = unmarshal(&intVal)
-	if err == nil {
-		*su = []int{intVal}
-		return nil
-	}
-
-	return err
-}
-
-func (s *S) TestUnmarshalerRetry(c *C) {
-	var su sliceUnmarshaler
-	err := yaml.Unmarshal([]byte("[1, 2, 3]"), &su)
-	c.Assert(err, IsNil)
-	c.Assert(su, DeepEquals, sliceUnmarshaler([]int{1, 2, 3}))
-
-	err = yaml.Unmarshal([]byte("1"), &su)
-	c.Assert(err, IsNil)
-	c.Assert(su, DeepEquals, sliceUnmarshaler([]int{1}))
-}
-
-// From http://yaml.org/type/merge.html
-var mergeTests = `
-anchors:
-  list:
-    - &CENTER { "x": 1, "y": 2 }
-    - &LEFT   { "x": 0, "y": 2 }
-    - &BIG    { "r": 10 }
-    - &SMALL  { "r": 1 }
-
-# All the following maps are equal:
-
-plain:
-  # Explicit keys
-  "x": 1
-  "y": 2
-  "r": 10
-  label: center/big
-
-mergeOne:
-  # Merge one map
-  << : *CENTER
-  "r": 10
-  label: center/big
-
-mergeMultiple:
-  # Merge multiple maps
-  << : [ *CENTER, *BIG ]
-  label: center/big
-
-override:
-  # Override
-  << : [ *BIG, *LEFT, *SMALL ]
-  "x": 1
-  label: center/big
-
-shortTag:
-  # Explicit short merge tag
-  !!merge "<<" : [ *CENTER, *BIG ]
-  label: center/big
-
-longTag:
-  # Explicit merge long tag
-  !<tag:yaml.org,2002:merge> "<<" : [ *CENTER, *BIG ]
-  label: center/big
-
-inlineMap:
-  # Inlined map 
-  << : {"x": 1, "y": 2, "r": 10}
-  label: center/big
-
-inlineSequenceMap:
-  # Inlined map in sequence
-  << : [ *CENTER, {"r": 10} ]
-  label: center/big
-`
-
-func (s *S) TestMerge(c *C) {
-	var want = map[interface{}]interface{}{
-		"x":     1,
-		"y":     2,
-		"r":     10,
-		"label": "center/big",
-	}
-
-	var m map[interface{}]interface{}
-	err := yaml.Unmarshal([]byte(mergeTests), &m)
-	c.Assert(err, IsNil)
-	for name, test := range m {
-		if name == "anchors" {
-			continue
-		}
-		c.Assert(test, DeepEquals, want, Commentf("test %q failed", name))
-	}
-}
-
-func (s *S) TestMergeStruct(c *C) {
-	type Data struct {
-		X, Y, R int
-		Label   string
-	}
-	want := Data{1, 2, 10, "center/big"}
-
-	var m map[string]Data
-	err := yaml.Unmarshal([]byte(mergeTests), &m)
-	c.Assert(err, IsNil)
-	for name, test := range m {
-		if name == "anchors" {
-			continue
-		}
-		c.Assert(test, Equals, want, Commentf("test %q failed", name))
-	}
-}
-
-var unmarshalNullTests = []func() interface{}{
-	func() interface{} { var v interface{}; v = "v"; return &v },
-	func() interface{} { var s = "s"; return &s },
-	func() interface{} { var s = "s"; sptr := &s; return &sptr },
-	func() interface{} { var i = 1; return &i },
-	func() interface{} { var i = 1; iptr := &i; return &iptr },
-	func() interface{} { m := map[string]int{"s": 1}; return &m },
-	func() interface{} { m := map[string]int{"s": 1}; return m },
-}
-
-func (s *S) TestUnmarshalNull(c *C) {
-	for _, test := range unmarshalNullTests {
-		item := test()
-		zero := reflect.Zero(reflect.TypeOf(item).Elem()).Interface()
-		err := yaml.Unmarshal([]byte("null"), item)
-		c.Assert(err, IsNil)
-		if reflect.TypeOf(item).Kind() == reflect.Map {
-			c.Assert(reflect.ValueOf(item).Interface(), DeepEquals, reflect.MakeMap(reflect.TypeOf(item)).Interface())
-		} else {
-			c.Assert(reflect.ValueOf(item).Elem().Interface(), DeepEquals, zero)
-		}
-	}
-}
-
-func (s *S) TestUnmarshalSliceOnPreset(c *C) {
-	// Issue #48.
-	v := struct{ A []int }{[]int{1}}
-	yaml.Unmarshal([]byte("a: [2]"), &v)
-	c.Assert(v.A, DeepEquals, []int{2})
-}
-
-//var data []byte
-//func init() {
-//	var err error
-//	data, err = ioutil.ReadFile("/tmp/file.yaml")
-//	if err != nil {
-//		panic(err)
-//	}
-//}
-//
-//func (s *S) BenchmarkUnmarshal(c *C) {
-//	var err error
-//	for i := 0; i < c.N; i++ {
-//		var v map[string]interface{}
-//		err = yaml.Unmarshal(data, &v)
-//	}
-//	if err != nil {
-//		panic(err)
-//	}
-//}
-//
-//func (s *S) BenchmarkMarshal(c *C) {
-//	var v map[string]interface{}
-//	yaml.Unmarshal(data, &v)
-//	c.ResetTimer()
-//	for i := 0; i < c.N; i++ {
-//		yaml.Marshal(&v)
-//	}
-//}


[15/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.c
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.c b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.c
new file mode 100644
index 0000000..9228d24
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3-binding.c
@@ -0,0 +1,147782 @@
+/******************************************************************************
+** This file is an amalgamation of many separate C source files from SQLite
+** version 3.8.5.  By combining all the individual C code files into this 
+** single large file, the entire code can be compiled as a single translation
+** unit.  This allows many compilers to do optimizations that would not be
+** possible if the files were compiled separately.  Performance improvements
+** of 5% or more are commonly seen when SQLite is compiled as a single
+** translation unit.
+**
+** This file is all you need to compile SQLite.  To use SQLite in other
+** programs, you need this file and the "sqlite3.h" header file that defines
+** the programming interface to the SQLite library.  (If you do not have 
+** the "sqlite3.h" header file at hand, you will find a copy embedded within
+** the text of this file.  Search for "Begin file sqlite3.h" to find the start
+** of the embedded sqlite3.h header file.) Additional code files may be needed
+** if you want a wrapper to interface SQLite with your choice of programming
+** language. The code for the "sqlite3" command-line shell is also in a
+** separate file. This file contains only code for the core SQLite library.
+*/
+#define SQLITE_CORE 1
+#define SQLITE_AMALGAMATION 1
+#ifndef SQLITE_PRIVATE
+# define SQLITE_PRIVATE static
+#endif
+#ifndef SQLITE_API
+# define SQLITE_API
+#endif
+/************** Begin file sqliteInt.h ***************************************/
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code.  In place of
+** a legal notice, here is a blessing:
+**
+**    May you do good and not evil.
+**    May you find forgiveness for yourself and forgive others.
+**    May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Internal interface definitions for SQLite.
+**
+*/
+#ifndef _SQLITEINT_H_
+#define _SQLITEINT_H_
+
+/*
+** These #defines should enable >2GB file support on POSIX if the
+** underlying operating system supports it.  If the OS lacks
+** large file support, or if the OS is windows, these should be no-ops.
+**
+** Ticket #2739:  The _LARGEFILE_SOURCE macro must appear before any
+** system #includes.  Hence, this block of code must be the very first
+** code in all source files.
+**
+** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
+** on the compiler command line.  This is necessary if you are compiling
+** on a recent machine (ex: Red Hat 7.2) but you want your code to work
+** on an older machine (ex: Red Hat 6.0).  If you compile on Red Hat 7.2
+** without this option, LFS is enable.  But LFS does not exist in the kernel
+** in Red Hat 6.0, so the code won't work.  Hence, for maximum binary
+** portability you should omit LFS.
+**
+** The previous paragraph was written in 2005.  (This paragraph is written
+** on 2008-11-28.) These days, all Linux kernels support large files, so
+** you should probably leave LFS enabled.  But some embedded platforms might
+** lack LFS in which case the SQLITE_DISABLE_LFS macro might still be useful.
+**
+** Similar is true for Mac OS X.  LFS is only supported on Mac OS X 9 and later.
+*/
+#ifndef SQLITE_DISABLE_LFS
+# define _LARGE_FILE       1
+# ifndef _FILE_OFFSET_BITS
+#   define _FILE_OFFSET_BITS 64
+# endif
+# define _LARGEFILE_SOURCE 1
+#endif
+
+/*
+** For MinGW, check to see if we can include the header file containing its
+** version information, among other things.  Normally, this internal MinGW
+** header file would [only] be included automatically by other MinGW header
+** files; however, the contained version information is now required by this
+** header file to work around binary compatibility issues (see below) and
+** this is the only known way to reliably obtain it.  This entire #if block
+** would be completely unnecessary if there was any other way of detecting
+** MinGW via their preprocessor (e.g. if they customized their GCC to define
+** some MinGW-specific macros).  When compiling for MinGW, either the
+** _HAVE_MINGW_H or _HAVE__MINGW_H (note the extra underscore) macro must be
+** defined; otherwise, detection of conditions specific to MinGW will be
+** disabled.
+*/
+#if defined(_HAVE_MINGW_H)
+# include "mingw.h"
+#elif defined(_HAVE__MINGW_H)
+# include "_mingw.h"
+#endif
+
+/*
+** For MinGW version 4.x (and higher), check to see if the _USE_32BIT_TIME_T
+** define is required to maintain binary compatibility with the MSVC runtime
+** library in use (e.g. for Windows XP).
+*/
+#if !defined(_USE_32BIT_TIME_T) && !defined(_USE_64BIT_TIME_T) && \
+    defined(_WIN32) && !defined(_WIN64) && \
+    defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION >= 4 && \
+    defined(__MSVCRT__)
+# define _USE_32BIT_TIME_T
+#endif
+
+/* The public SQLite interface.  The _FILE_OFFSET_BITS macro must appear
+** first in QNX.  Also, the _USE_32BIT_TIME_T macro must appear first for
+** MinGW.
+*/
+/************** Include sqlite3.h in the middle of sqliteInt.h ***************/
+/************** Begin file sqlite3.h *****************************************/
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code.  In place of
+** a legal notice, here is a blessing:
+**
+**    May you do good and not evil.
+**    May you find forgiveness for yourself and forgive others.
+**    May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This header file defines the interface that the SQLite library
+** presents to client programs.  If a C-function, structure, datatype,
+** or constant definition does not appear in this file, then it is
+** not a published API of SQLite, is subject to change without
+** notice, and should not be referenced by programs that use SQLite.
+**
+** Some of the definitions that are in this file are marked as
+** "experimental".  Experimental interfaces are normally new
+** features recently added to SQLite.  We do not anticipate changes
+** to experimental interfaces but reserve the right to make minor changes
+** if experience from use "in the wild" suggest such changes are prudent.
+**
+** The official C-language API documentation for SQLite is derived
+** from comments in this file.  This file is the authoritative source
+** on how SQLite interfaces are suppose to operate.
+**
+** The name of this file under configuration management is "sqlite.h.in".
+** The makefile makes some minor changes to this file (such as inserting
+** the version number) and changes its name to "sqlite3.h" as
+** part of the build process.
+*/
+#ifndef _SQLITE3_H_
+#define _SQLITE3_H_
+#include <stdarg.h>     /* Needed for the definition of va_list */
+
+/*
+** Make sure we can call this stuff from C++.
+*/
+#if 0
+extern "C" {
+#endif
+
+
+/*
+** Add the ability to override 'extern'
+*/
+#ifndef SQLITE_EXTERN
+# define SQLITE_EXTERN extern
+#endif
+
+#ifndef SQLITE_API
+# define SQLITE_API
+#endif
+
+
+/*
+** These no-op macros are used in front of interfaces to mark those
+** interfaces as either deprecated or experimental.  New applications
+** should not use deprecated interfaces - they are support for backwards
+** compatibility only.  Application writers should be aware that
+** experimental interfaces are subject to change in point releases.
+**
+** These macros used to resolve to various kinds of compiler magic that
+** would generate warning messages when they were used.  But that
+** compiler magic ended up generating such a flurry of bug reports
+** that we have taken it all out and gone back to using simple
+** noop macros.
+*/
+#define SQLITE_DEPRECATED
+#define SQLITE_EXPERIMENTAL
+
+/*
+** Ensure these symbols were not defined by some previous header file.
+*/
+#ifdef SQLITE_VERSION
+# undef SQLITE_VERSION
+#endif
+#ifdef SQLITE_VERSION_NUMBER
+# undef SQLITE_VERSION_NUMBER
+#endif
+
+/*
+** CAPI3REF: Compile-Time Library Version Numbers
+**
+** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header
+** evaluates to a string literal that is the SQLite version in the
+** format "X.Y.Z" where X is the major version number (always 3 for
+** SQLite3) and Y is the minor version number and Z is the release number.)^
+** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer
+** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same
+** numbers used in [SQLITE_VERSION].)^
+** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
+** be larger than the release from which it is derived.  Either Y will
+** be held constant and Z will be incremented or else Y will be incremented
+** and Z will be reset to zero.
+**
+** Since version 3.6.18, SQLite source code has been stored in the
+** <a href="http://www.fossil-scm.org/">Fossil configuration management
+** system</a>.  ^The SQLITE_SOURCE_ID macro evaluates to
+** a string which identifies a particular check-in of SQLite
+** within its configuration management system.  ^The SQLITE_SOURCE_ID
+** string contains the date and time of the check-in (UTC) and an SHA1
+** hash of the entire source tree.
+**
+** See also: [sqlite3_libversion()],
+** [sqlite3_libversion_number()], [sqlite3_sourceid()],
+** [sqlite_version()] and [sqlite_source_id()].
+*/
+#define SQLITE_VERSION        "3.8.5"
+#define SQLITE_VERSION_NUMBER 3008005
+#define SQLITE_SOURCE_ID      "2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212"
+
+/*
+** CAPI3REF: Run-Time Library Version Numbers
+** KEYWORDS: sqlite3_version, sqlite3_sourceid
+**
+** These interfaces provide the same information as the [SQLITE_VERSION],
+** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
+** but are associated with the library instead of the header file.  ^(Cautious
+** programmers might include assert() statements in their application to
+** verify that values returned by these interfaces match the macros in
+** the header, and thus insure that the application is
+** compiled with matching library and header files.
+**
+** <blockquote><pre>
+** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
+** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
+** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
+** </pre></blockquote>)^
+**
+** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
+** macro.  ^The sqlite3_libversion() function returns a pointer to the
+** to the sqlite3_version[] string constant.  The sqlite3_libversion()
+** function is provided for use in DLLs since DLL users usually do not have
+** direct access to string constants within the DLL.  ^The
+** sqlite3_libversion_number() function returns an integer equal to
+** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns 
+** a pointer to a string constant whose value is the same as the 
+** [SQLITE_SOURCE_ID] C preprocessor macro.
+**
+** See also: [sqlite_version()] and [sqlite_source_id()].
+*/
+SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
+SQLITE_API const char *sqlite3_libversion(void);
+SQLITE_API const char *sqlite3_sourceid(void);
+SQLITE_API int sqlite3_libversion_number(void);
+
+/*
+** CAPI3REF: Run-Time Library Compilation Options Diagnostics
+**
+** ^The sqlite3_compileoption_used() function returns 0 or 1 
+** indicating whether the specified option was defined at 
+** compile time.  ^The SQLITE_ prefix may be omitted from the 
+** option name passed to sqlite3_compileoption_used().  
+**
+** ^The sqlite3_compileoption_get() function allows iterating
+** over the list of options that were defined at compile time by
+** returning the N-th compile time option string.  ^If N is out of range,
+** sqlite3_compileoption_get() returns a NULL pointer.  ^The SQLITE_ 
+** prefix is omitted from any strings returned by 
+** sqlite3_compileoption_get().
+**
+** ^Support for the diagnostic functions sqlite3_compileoption_used()
+** and sqlite3_compileoption_get() may be omitted by specifying the 
+** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
+**
+** See also: SQL functions [sqlite_compileoption_used()] and
+** [sqlite_compileoption_get()] and the [compile_options pragma].
+*/
+#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
+SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
+SQLITE_API const char *sqlite3_compileoption_get(int N);
+#endif
+
+/*
+** CAPI3REF: Test To See If The Library Is Threadsafe
+**
+** ^The sqlite3_threadsafe() function returns zero if and only if
+** SQLite was compiled with mutexing code omitted due to the
+** [SQLITE_THREADSAFE] compile-time option being set to 0.
+**
+** SQLite can be compiled with or without mutexes.  When
+** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes
+** are enabled and SQLite is threadsafe.  When the
+** [SQLITE_THREADSAFE] macro is 0, 
+** the mutexes are omitted.  Without the mutexes, it is not safe
+** to use SQLite concurrently from more than one thread.
+**
+** Enabling mutexes incurs a measurable performance penalty.
+** So if speed is of utmost importance, it makes sense to disable
+** the mutexes.  But for maximum safety, mutexes should be enabled.
+** ^The default behavior is for mutexes to be enabled.
+**
+** This interface can be used by an application to make sure that the
+** version of SQLite that it is linking against was compiled with
+** the desired setting of the [SQLITE_THREADSAFE] macro.
+**
+** This interface only reports on the compile-time mutex setting
+** of the [SQLITE_THREADSAFE] flag.  If SQLite is compiled with
+** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but
+** can be fully or partially disabled using a call to [sqlite3_config()]
+** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],
+** or [SQLITE_CONFIG_MUTEX].  ^(The return value of the
+** sqlite3_threadsafe() function shows only the compile-time setting of
+** thread safety, not any run-time changes to that setting made by
+** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
+** is unchanged by calls to sqlite3_config().)^
+**
+** See the [threading mode] documentation for additional information.
+*/
+SQLITE_API int sqlite3_threadsafe(void);
+
+/*
+** CAPI3REF: Database Connection Handle
+** KEYWORDS: {database connection} {database connections}
+**
+** Each open SQLite database is represented by a pointer to an instance of
+** the opaque structure named "sqlite3".  It is useful to think of an sqlite3
+** pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and
+** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
+** and [sqlite3_close_v2()] are its destructors.  There are many other
+** interfaces (such as
+** [sqlite3_prepare_v2()], [sqlite3_create_function()], and
+** [sqlite3_busy_timeout()] to name but three) that are methods on an
+** sqlite3 object.
+*/
+typedef struct sqlite3 sqlite3;
+
+/*
+** CAPI3REF: 64-Bit Integer Types
+** KEYWORDS: sqlite_int64 sqlite_uint64
+**
+** Because there is no cross-platform way to specify 64-bit integer types
+** SQLite includes typedefs for 64-bit signed and unsigned integers.
+**
+** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
+** The sqlite_int64 and sqlite_uint64 types are supported for backwards
+** compatibility only.
+**
+** ^The sqlite3_int64 and sqlite_int64 types can store integer values
+** between -9223372036854775808 and +9223372036854775807 inclusive.  ^The
+** sqlite3_uint64 and sqlite_uint64 types can store integer values 
+** between 0 and +18446744073709551615 inclusive.
+*/
+#ifdef SQLITE_INT64_TYPE
+  typedef SQLITE_INT64_TYPE sqlite_int64;
+  typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
+#elif defined(_MSC_VER) || defined(__BORLANDC__)
+  typedef __int64 sqlite_int64;
+  typedef unsigned __int64 sqlite_uint64;
+#else
+  typedef long long int sqlite_int64;
+  typedef unsigned long long int sqlite_uint64;
+#endif
+typedef sqlite_int64 sqlite3_int64;
+typedef sqlite_uint64 sqlite3_uint64;
+
+/*
+** If compiling for a processor that lacks floating point support,
+** substitute integer for floating-point.
+*/
+#ifdef SQLITE_OMIT_FLOATING_POINT
+# define double sqlite3_int64
+#endif
+
+/*
+** CAPI3REF: Closing A Database Connection
+**
+** ^The sqlite3_close() and sqlite3_close_v2() routines are destructors
+** for the [sqlite3] object.
+** ^Calls to sqlite3_close() and sqlite3_close_v2() return SQLITE_OK if
+** the [sqlite3] object is successfully destroyed and all associated
+** resources are deallocated.
+**
+** ^If the database connection is associated with unfinalized prepared
+** statements or unfinished sqlite3_backup objects then sqlite3_close()
+** will leave the database connection open and return [SQLITE_BUSY].
+** ^If sqlite3_close_v2() is called with unfinalized prepared statements
+** and unfinished sqlite3_backups, then the database connection becomes
+** an unusable "zombie" which will automatically be deallocated when the
+** last prepared statement is finalized or the last sqlite3_backup is
+** finished.  The sqlite3_close_v2() interface is intended for use with
+** host languages that are garbage collected, and where the order in which
+** destructors are called is arbitrary.
+**
+** Applications should [sqlite3_finalize | finalize] all [prepared statements],
+** [sqlite3_blob_close | close] all [BLOB handles], and 
+** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
+** with the [sqlite3] object prior to attempting to close the object.  ^If
+** sqlite3_close_v2() is called on a [database connection] that still has
+** outstanding [prepared statements], [BLOB handles], and/or
+** [sqlite3_backup] objects then it returns SQLITE_OK but the deallocation
+** of resources is deferred until all [prepared statements], [BLOB handles],
+** and [sqlite3_backup] objects are also destroyed.
+**
+** ^If an [sqlite3] object is destroyed while a transaction is open,
+** the transaction is automatically rolled back.
+**
+** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
+** must be either a NULL
+** pointer or an [sqlite3] object pointer obtained
+** from [sqlite3_open()], [sqlite3_open16()], or
+** [sqlite3_open_v2()], and not previously closed.
+** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
+** argument is a harmless no-op.
+*/
+SQLITE_API int sqlite3_close(sqlite3*);
+SQLITE_API int sqlite3_close_v2(sqlite3*);
+
+/*
+** The type for a callback function.
+** This is legacy and deprecated.  It is included for historical
+** compatibility and is not documented.
+*/
+typedef int (*sqlite3_callback)(void*,int,char**, char**);
+
+/*
+** CAPI3REF: One-Step Query Execution Interface
+**
+** The sqlite3_exec() interface is a convenience wrapper around
+** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
+** that allows an application to run multiple statements of SQL
+** without having to use a lot of C code. 
+**
+** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
+** semicolon-separate SQL statements passed into its 2nd argument,
+** in the context of the [database connection] passed in as its 1st
+** argument.  ^If the callback function of the 3rd argument to
+** sqlite3_exec() is not NULL, then it is invoked for each result row
+** coming out of the evaluated SQL statements.  ^The 4th argument to
+** sqlite3_exec() is relayed through to the 1st argument of each
+** callback invocation.  ^If the callback pointer to sqlite3_exec()
+** is NULL, then no callback is ever invoked and result rows are
+** ignored.
+**
+** ^If an error occurs while evaluating the SQL statements passed into
+** sqlite3_exec(), then execution of the current statement stops and
+** subsequent statements are skipped.  ^If the 5th parameter to sqlite3_exec()
+** is not NULL then any error message is written into memory obtained
+** from [sqlite3_malloc()] and passed back through the 5th parameter.
+** To avoid memory leaks, the application should invoke [sqlite3_free()]
+** on error message strings returned through the 5th parameter of
+** of sqlite3_exec() after the error message string is no longer needed.
+** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
+** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
+** NULL before returning.
+**
+** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
+** routine returns SQLITE_ABORT without invoking the callback again and
+** without running any subsequent SQL statements.
+**
+** ^The 2nd argument to the sqlite3_exec() callback function is the
+** number of columns in the result.  ^The 3rd argument to the sqlite3_exec()
+** callback is an array of pointers to strings obtained as if from
+** [sqlite3_column_text()], one for each column.  ^If an element of a
+** result row is NULL then the corresponding string pointer for the
+** sqlite3_exec() callback is a NULL pointer.  ^The 4th argument to the
+** sqlite3_exec() callback is an array of pointers to strings where each
+** entry represents the name of corresponding result column as obtained
+** from [sqlite3_column_name()].
+**
+** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
+** to an empty string, or a pointer that contains only whitespace and/or 
+** SQL comments, then no SQL statements are evaluated and the database
+** is not changed.
+**
+** Restrictions:
+**
+** <ul>
+** <li> The application must insure that the 1st parameter to sqlite3_exec()
+**      is a valid and open [database connection].
+** <li> The application must not close the [database connection] specified by
+**      the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
+** <li> The application must not modify the SQL statement text passed into
+**      the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
+** </ul>
+*/
+SQLITE_API int sqlite3_exec(
+  sqlite3*,                                  /* An open database */
+  const char *sql,                           /* SQL to be evaluated */
+  int (*callback)(void*,int,char**,char**),  /* Callback function */
+  void *,                                    /* 1st argument to callback */
+  char **errmsg                              /* Error msg written here */
+);
+
+/*
+** CAPI3REF: Result Codes
+** KEYWORDS: SQLITE_OK {error code} {error codes}
+** KEYWORDS: {result code} {result codes}
+**
+** Many SQLite functions return an integer result code from the set shown
+** here in order to indicate success or failure.
+**
+** New error codes may be added in future versions of SQLite.
+**
+** See also: [SQLITE_IOERR_READ | extended result codes],
+** [sqlite3_vtab_on_conflict()] [SQLITE_ROLLBACK | result codes].
+*/
+#define SQLITE_OK           0   /* Successful result */
+/* beginning-of-error-codes */
+#define SQLITE_ERROR        1   /* SQL error or missing database */
+#define SQLITE_INTERNAL     2   /* Internal logic error in SQLite */
+#define SQLITE_PERM         3   /* Access permission denied */
+#define SQLITE_ABORT        4   /* Callback routine requested an abort */
+#define SQLITE_BUSY         5   /* The database file is locked */
+#define SQLITE_LOCKED       6   /* A table in the database is locked */
+#define SQLITE_NOMEM        7   /* A malloc() failed */
+#define SQLITE_READONLY     8   /* Attempt to write a readonly database */
+#define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite3_interrupt()*/
+#define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
+#define SQLITE_CORRUPT     11   /* The database disk image is malformed */
+#define SQLITE_NOTFOUND    12   /* Unknown opcode in sqlite3_file_control() */
+#define SQLITE_FULL        13   /* Insertion failed because database is full */
+#define SQLITE_CANTOPEN    14   /* Unable to open the database file */
+#define SQLITE_PROTOCOL    15   /* Database lock protocol error */
+#define SQLITE_EMPTY       16   /* Database is empty */
+#define SQLITE_SCHEMA      17   /* The database schema changed */
+#define SQLITE_TOOBIG      18   /* String or BLOB exceeds size limit */
+#define SQLITE_CONSTRAINT  19   /* Abort due to constraint violation */
+#define SQLITE_MISMATCH    20   /* Data type mismatch */
+#define SQLITE_MISUSE      21   /* Library used incorrectly */
+#define SQLITE_NOLFS       22   /* Uses OS features not supported on host */
+#define SQLITE_AUTH        23   /* Authorization denied */
+#define SQLITE_FORMAT      24   /* Auxiliary database format error */
+#define SQLITE_RANGE       25   /* 2nd parameter to sqlite3_bind out of range */
+#define SQLITE_NOTADB      26   /* File opened that is not a database file */
+#define SQLITE_NOTICE      27   /* Notifications from sqlite3_log() */
+#define SQLITE_WARNING     28   /* Warnings from sqlite3_log() */
+#define SQLITE_ROW         100  /* sqlite3_step() has another row ready */
+#define SQLITE_DONE        101  /* sqlite3_step() has finished executing */
+/* end-of-error-codes */
+
+/*
+** CAPI3REF: Extended Result Codes
+** KEYWORDS: {extended error code} {extended error codes}
+** KEYWORDS: {extended result code} {extended result codes}
+**
+** In its default configuration, SQLite API routines return one of 26 integer
+** [SQLITE_OK | result codes].  However, experience has shown that many of
+** these result codes are too coarse-grained.  They do not provide as
+** much information about problems as programmers might like.  In an effort to
+** address this, newer versions of SQLite (version 3.3.8 and later) include
+** support for additional result codes that provide more detailed information
+** about errors. The extended result codes are enabled or disabled
+** on a per database connection basis using the
+** [sqlite3_extended_result_codes()] API.
+**
+** Some of the available extended result codes are listed here.
+** One may expect the number of extended result codes will increase
+** over time.  Software that uses extended result codes should expect
+** to see new result codes in future releases of SQLite.
+**
+** The SQLITE_OK result code will never be extended.  It will always
+** be exactly zero.
+*/
+#define SQLITE_IOERR_READ              (SQLITE_IOERR | (1<<8))
+#define SQLITE_IOERR_SHORT_READ        (SQLITE_IOERR | (2<<8))
+#define SQLITE_IOERR_WRITE             (SQLITE_IOERR | (3<<8))
+#define SQLITE_IOERR_FSYNC             (SQLITE_IOERR | (4<<8))
+#define SQLITE_IOERR_DIR_FSYNC         (SQLITE_IOERR | (5<<8))
+#define SQLITE_IOERR_TRUNCATE          (SQLITE_IOERR | (6<<8))
+#define SQLITE_IOERR_FSTAT             (SQLITE_IOERR | (7<<8))
+#define SQLITE_IOERR_UNLOCK            (SQLITE_IOERR | (8<<8))
+#define SQLITE_IOERR_RDLOCK            (SQLITE_IOERR | (9<<8))
+#define SQLITE_IOERR_DELETE            (SQLITE_IOERR | (10<<8))
+#define SQLITE_IOERR_BLOCKED           (SQLITE_IOERR | (11<<8))
+#define SQLITE_IOERR_NOMEM             (SQLITE_IOERR | (12<<8))
+#define SQLITE_IOERR_ACCESS            (SQLITE_IOERR | (13<<8))
+#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8))
+#define SQLITE_IOERR_LOCK              (SQLITE_IOERR | (15<<8))
+#define SQLITE_IOERR_CLOSE             (SQLITE_IOERR | (16<<8))
+#define SQLITE_IOERR_DIR_CLOSE         (SQLITE_IOERR | (17<<8))
+#define SQLITE_IOERR_SHMOPEN           (SQLITE_IOERR | (18<<8))
+#define SQLITE_IOERR_SHMSIZE           (SQLITE_IOERR | (19<<8))
+#define SQLITE_IOERR_SHMLOCK           (SQLITE_IOERR | (20<<8))
+#define SQLITE_IOERR_SHMMAP            (SQLITE_IOERR | (21<<8))
+#define SQLITE_IOERR_SEEK              (SQLITE_IOERR | (22<<8))
+#define SQLITE_IOERR_DELETE_NOENT      (SQLITE_IOERR | (23<<8))
+#define SQLITE_IOERR_MMAP              (SQLITE_IOERR | (24<<8))
+#define SQLITE_IOERR_GETTEMPPATH       (SQLITE_IOERR | (25<<8))
+#define SQLITE_IOERR_CONVPATH          (SQLITE_IOERR | (26<<8))
+#define SQLITE_LOCKED_SHAREDCACHE      (SQLITE_LOCKED |  (1<<8))
+#define SQLITE_BUSY_RECOVERY           (SQLITE_BUSY   |  (1<<8))
+#define SQLITE_BUSY_SNAPSHOT           (SQLITE_BUSY   |  (2<<8))
+#define SQLITE_CANTOPEN_NOTEMPDIR      (SQLITE_CANTOPEN | (1<<8))
+#define SQLITE_CANTOPEN_ISDIR          (SQLITE_CANTOPEN | (2<<8))
+#define SQLITE_CANTOPEN_FULLPATH       (SQLITE_CANTOPEN | (3<<8))
+#define SQLITE_CANTOPEN_CONVPATH       (SQLITE_CANTOPEN | (4<<8))
+#define SQLITE_CORRUPT_VTAB            (SQLITE_CORRUPT | (1<<8))
+#define SQLITE_READONLY_RECOVERY       (SQLITE_READONLY | (1<<8))
+#define SQLITE_READONLY_CANTLOCK       (SQLITE_READONLY | (2<<8))
+#define SQLITE_READONLY_ROLLBACK       (SQLITE_READONLY | (3<<8))
+#define SQLITE_READONLY_DBMOVED        (SQLITE_READONLY | (4<<8))
+#define SQLITE_ABORT_ROLLBACK          (SQLITE_ABORT | (2<<8))
+#define SQLITE_CONSTRAINT_CHECK        (SQLITE_CONSTRAINT | (1<<8))
+#define SQLITE_CONSTRAINT_COMMITHOOK   (SQLITE_CONSTRAINT | (2<<8))
+#define SQLITE_CONSTRAINT_FOREIGNKEY   (SQLITE_CONSTRAINT | (3<<8))
+#define SQLITE_CONSTRAINT_FUNCTION     (SQLITE_CONSTRAINT | (4<<8))
+#define SQLITE_CONSTRAINT_NOTNULL      (SQLITE_CONSTRAINT | (5<<8))
+#define SQLITE_CONSTRAINT_PRIMARYKEY   (SQLITE_CONSTRAINT | (6<<8))
+#define SQLITE_CONSTRAINT_TRIGGER      (SQLITE_CONSTRAINT | (7<<8))
+#define SQLITE_CONSTRAINT_UNIQUE       (SQLITE_CONSTRAINT | (8<<8))
+#define SQLITE_CONSTRAINT_VTAB         (SQLITE_CONSTRAINT | (9<<8))
+#define SQLITE_CONSTRAINT_ROWID        (SQLITE_CONSTRAINT |(10<<8))
+#define SQLITE_NOTICE_RECOVER_WAL      (SQLITE_NOTICE | (1<<8))
+#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
+#define SQLITE_WARNING_AUTOINDEX       (SQLITE_WARNING | (1<<8))
+
+/*
+** CAPI3REF: Flags For File Open Operations
+**
+** These bit values are intended for use in the
+** 3rd parameter to the [sqlite3_open_v2()] interface and
+** in the 4th parameter to the [sqlite3_vfs.xOpen] method.
+*/
+#define SQLITE_OPEN_READONLY         0x00000001  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_READWRITE        0x00000002  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_CREATE           0x00000004  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_DELETEONCLOSE    0x00000008  /* VFS only */
+#define SQLITE_OPEN_EXCLUSIVE        0x00000010  /* VFS only */
+#define SQLITE_OPEN_AUTOPROXY        0x00000020  /* VFS only */
+#define SQLITE_OPEN_URI              0x00000040  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_MEMORY           0x00000080  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_MAIN_DB          0x00000100  /* VFS only */
+#define SQLITE_OPEN_TEMP_DB          0x00000200  /* VFS only */
+#define SQLITE_OPEN_TRANSIENT_DB     0x00000400  /* VFS only */
+#define SQLITE_OPEN_MAIN_JOURNAL     0x00000800  /* VFS only */
+#define SQLITE_OPEN_TEMP_JOURNAL     0x00001000  /* VFS only */
+#define SQLITE_OPEN_SUBJOURNAL       0x00002000  /* VFS only */
+#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000  /* VFS only */
+#define SQLITE_OPEN_NOMUTEX          0x00008000  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_FULLMUTEX        0x00010000  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_SHAREDCACHE      0x00020000  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_PRIVATECACHE     0x00040000  /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_WAL              0x00080000  /* VFS only */
+
+/* Reserved:                         0x00F00000 */
+
+/*
+** CAPI3REF: Device Characteristics
+**
+** The xDeviceCharacteristics method of the [sqlite3_io_methods]
+** object returns an integer which is a vector of these
+** bit values expressing I/O characteristics of the mass storage
+** device that holds the file that the [sqlite3_io_methods]
+** refers to.
+**
+** The SQLITE_IOCAP_ATOMIC property means that all writes of
+** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
+** mean that writes of blocks that are nnn bytes in size and
+** are aligned to an address which is an integer multiple of
+** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
+** that when data is appended to a file, the data is appended
+** first then the size of the file is extended, never the other
+** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
+** information is written to disk in the same order as calls
+** to xWrite().  The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
+** after reboot following a crash or power loss, the only bytes in a
+** file that were written at the application level might have changed
+** and that adjacent bytes, even bytes within the same sector are
+** guaranteed to be unchanged.  The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
+** flag indicate that a file cannot be deleted when open.  The
+** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
+** read-only media and cannot be changed even by processes with
+** elevated privileges.
+*/
+#define SQLITE_IOCAP_ATOMIC                 0x00000001
+#define SQLITE_IOCAP_ATOMIC512              0x00000002
+#define SQLITE_IOCAP_ATOMIC1K               0x00000004
+#define SQLITE_IOCAP_ATOMIC2K               0x00000008
+#define SQLITE_IOCAP_ATOMIC4K               0x00000010
+#define SQLITE_IOCAP_ATOMIC8K               0x00000020
+#define SQLITE_IOCAP_ATOMIC16K              0x00000040
+#define SQLITE_IOCAP_ATOMIC32K              0x00000080
+#define SQLITE_IOCAP_ATOMIC64K              0x00000100
+#define SQLITE_IOCAP_SAFE_APPEND            0x00000200
+#define SQLITE_IOCAP_SEQUENTIAL             0x00000400
+#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN  0x00000800
+#define SQLITE_IOCAP_POWERSAFE_OVERWRITE    0x00001000
+#define SQLITE_IOCAP_IMMUTABLE              0x00002000
+
+/*
+** CAPI3REF: File Locking Levels
+**
+** SQLite uses one of these integer values as the second
+** argument to calls it makes to the xLock() and xUnlock() methods
+** of an [sqlite3_io_methods] object.
+*/
+#define SQLITE_LOCK_NONE          0
+#define SQLITE_LOCK_SHARED        1
+#define SQLITE_LOCK_RESERVED      2
+#define SQLITE_LOCK_PENDING       3
+#define SQLITE_LOCK_EXCLUSIVE     4
+
+/*
+** CAPI3REF: Synchronization Type Flags
+**
+** When SQLite invokes the xSync() method of an
+** [sqlite3_io_methods] object it uses a combination of
+** these integer values as the second argument.
+**
+** When the SQLITE_SYNC_DATAONLY flag is used, it means that the
+** sync operation only needs to flush data to mass storage.  Inode
+** information need not be flushed. If the lower four bits of the flag
+** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
+** If the lower four bits equal SQLITE_SYNC_FULL, that means
+** to use Mac OS X style fullsync instead of fsync().
+**
+** Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
+** with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
+** settings.  The [synchronous pragma] determines when calls to the
+** xSync VFS method occur and applies uniformly across all platforms.
+** The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
+** energetic or rigorous or forceful the sync operations are and
+** only make a difference on Mac OSX for the default SQLite code.
+** (Third-party VFS implementations might also make the distinction
+** between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
+** operating systems natively supported by SQLite, only Mac OSX
+** cares about the difference.)
+*/
+#define SQLITE_SYNC_NORMAL        0x00002
+#define SQLITE_SYNC_FULL          0x00003
+#define SQLITE_SYNC_DATAONLY      0x00010
+
+/*
+** CAPI3REF: OS Interface Open File Handle
+**
+** An [sqlite3_file] object represents an open file in the 
+** [sqlite3_vfs | OS interface layer].  Individual OS interface
+** implementations will
+** want to subclass this object by appending additional fields
+** for their own use.  The pMethods entry is a pointer to an
+** [sqlite3_io_methods] object that defines methods for performing
+** I/O operations on the open file.
+*/
+typedef struct sqlite3_file sqlite3_file;
+struct sqlite3_file {
+  const struct sqlite3_io_methods *pMethods;  /* Methods for an open file */
+};
+
+/*
+** CAPI3REF: OS Interface File Virtual Methods Object
+**
+** Every file opened by the [sqlite3_vfs.xOpen] method populates an
+** [sqlite3_file] object (or, more commonly, a subclass of the
+** [sqlite3_file] object) with a pointer to an instance of this object.
+** This object defines the methods used to perform various operations
+** against the open file represented by the [sqlite3_file] object.
+**
+** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element 
+** to a non-NULL pointer, then the sqlite3_io_methods.xClose method
+** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed.  The
+** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen]
+** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
+** to NULL.
+**
+** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or
+** [SQLITE_SYNC_FULL].  The first choice is the normal fsync().
+** The second choice is a Mac OS X style fullsync.  The [SQLITE_SYNC_DATAONLY]
+** flag may be ORed in to indicate that only the data of the file
+** and not its inode needs to be synced.
+**
+** The integer values to xLock() and xUnlock() are one of
+** <ul>
+** <li> [SQLITE_LOCK_NONE],
+** <li> [SQLITE_LOCK_SHARED],
+** <li> [SQLITE_LOCK_RESERVED],
+** <li> [SQLITE_LOCK_PENDING], or
+** <li> [SQLITE_LOCK_EXCLUSIVE].
+** </ul>
+** xLock() increases the lock. xUnlock() decreases the lock.
+** The xCheckReservedLock() method checks whether any database connection,
+** either in this process or in some other process, is holding a RESERVED,
+** PENDING, or EXCLUSIVE lock on the file.  It returns true
+** if such a lock exists and false otherwise.
+**
+** The xFileControl() method is a generic interface that allows custom
+** VFS implementations to directly control an open file using the
+** [sqlite3_file_control()] interface.  The second "op" argument is an
+** integer opcode.  The third argument is a generic pointer intended to
+** point to a structure that may contain arguments or space in which to
+** write return values.  Potential uses for xFileControl() might be
+** functions to enable blocking locks with timeouts, to change the
+** locking strategy (for example to use dot-file locks), to inquire
+** about the status of a lock, or to break stale locks.  The SQLite
+** core reserves all opcodes less than 100 for its own use.
+** A [SQLITE_FCNTL_LOCKSTATE | list of opcodes] less than 100 is available.
+** Applications that define a custom xFileControl method should use opcodes
+** greater than 100 to avoid conflicts.  VFS implementations should
+** return [SQLITE_NOTFOUND] for file control opcodes that they do not
+** recognize.
+**
+** The xSectorSize() method returns the sector size of the
+** device that underlies the file.  The sector size is the
+** minimum write that can be performed without disturbing
+** other bytes in the file.  The xDeviceCharacteristics()
+** method returns a bit vector describing behaviors of the
+** underlying device:
+**
+** <ul>
+** <li> [SQLITE_IOCAP_ATOMIC]
+** <li> [SQLITE_IOCAP_ATOMIC512]
+** <li> [SQLITE_IOCAP_ATOMIC1K]
+** <li> [SQLITE_IOCAP_ATOMIC2K]
+** <li> [SQLITE_IOCAP_ATOMIC4K]
+** <li> [SQLITE_IOCAP_ATOMIC8K]
+** <li> [SQLITE_IOCAP_ATOMIC16K]
+** <li> [SQLITE_IOCAP_ATOMIC32K]
+** <li> [SQLITE_IOCAP_ATOMIC64K]
+** <li> [SQLITE_IOCAP_SAFE_APPEND]
+** <li> [SQLITE_IOCAP_SEQUENTIAL]
+** </ul>
+**
+** The SQLITE_IOCAP_ATOMIC property means that all writes of
+** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
+** mean that writes of blocks that are nnn bytes in size and
+** are aligned to an address which is an integer multiple of
+** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
+** that when data is appended to a file, the data is appended
+** first then the size of the file is extended, never the other
+** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
+** information is written to disk in the same order as calls
+** to xWrite().
+**
+** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
+** in the unread portions of the buffer with zeros.  A VFS that
+** fails to zero-fill short reads might seem to work.  However,
+** failure to zero-fill short reads will eventually lead to
+** database corruption.
+*/
+typedef struct sqlite3_io_methods sqlite3_io_methods;
+struct sqlite3_io_methods {
+  int iVersion;
+  int (*xClose)(sqlite3_file*);
+  int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
+  int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
+  int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
+  int (*xSync)(sqlite3_file*, int flags);
+  int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
+  int (*xLock)(sqlite3_file*, int);
+  int (*xUnlock)(sqlite3_file*, int);
+  int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
+  int (*xFileControl)(sqlite3_file*, int op, void *pArg);
+  int (*xSectorSize)(sqlite3_file*);
+  int (*xDeviceCharacteristics)(sqlite3_file*);
+  /* Methods above are valid for version 1 */
+  int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
+  int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
+  void (*xShmBarrier)(sqlite3_file*);
+  int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
+  /* Methods above are valid for version 2 */
+  int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
+  int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
+  /* Methods above are valid for version 3 */
+  /* Additional methods may be added in future releases */
+};
+
+/*
+** CAPI3REF: Standard File Control Opcodes
+**
+** These integer constants are opcodes for the xFileControl method
+** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()]
+** interface.
+**
+** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging.  This
+** opcode causes the xFileControl method to write the current state of
+** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],
+** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])
+** into an integer that the pArg argument points to. This capability
+** is used during testing and only needs to be supported when SQLITE_TEST
+** is defined.
+** <ul>
+** <li>[[SQLITE_FCNTL_SIZE_HINT]]
+** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
+** layer a hint of how large the database file will grow to be during the
+** current transaction.  This hint is not guaranteed to be accurate but it
+** is often close.  The underlying VFS might choose to preallocate database
+** file space based on this hint in order to help writes to the database
+** file run faster.
+**
+** <li>[[SQLITE_FCNTL_CHUNK_SIZE]]
+** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS
+** extends and truncates the database file in chunks of a size specified
+** by the user. The fourth argument to [sqlite3_file_control()] should 
+** point to an integer (type int) containing the new chunk-size to use
+** for the nominated database. Allocating database file space in large
+** chunks (say 1MB at a time), may reduce file-system fragmentation and
+** improve performance on some systems.
+**
+** <li>[[SQLITE_FCNTL_FILE_POINTER]]
+** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer
+** to the [sqlite3_file] object associated with a particular database
+** connection.  See the [sqlite3_file_control()] documentation for
+** additional information.
+**
+** <li>[[SQLITE_FCNTL_SYNC_OMITTED]]
+** No longer in use.
+**
+** <li>[[SQLITE_FCNTL_SYNC]]
+** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and
+** sent to the VFS immediately before the xSync method is invoked on a
+** database file descriptor. Or, if the xSync method is not invoked 
+** because the user has configured SQLite with 
+** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place 
+** of the xSync method. In most cases, the pointer argument passed with
+** this file-control is NULL. However, if the database file is being synced
+** as part of a multi-database commit, the argument points to a nul-terminated
+** string containing the transactions master-journal file name. VFSes that 
+** do not need this signal should silently ignore this opcode. Applications 
+** should not call [sqlite3_file_control()] with this opcode as doing so may 
+** disrupt the operation of the specialized VFSes that do require it.  
+**
+** <li>[[SQLITE_FCNTL_COMMIT_PHASETWO]]
+** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite
+** and sent to the VFS after a transaction has been committed immediately
+** but before the database is unlocked. VFSes that do not need this signal
+** should silently ignore this opcode. Applications should not call
+** [sqlite3_file_control()] with this opcode as doing so may disrupt the 
+** operation of the specialized VFSes that do require it.  
+**
+** <li>[[SQLITE_FCNTL_WIN32_AV_RETRY]]
+** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic
+** retry counts and intervals for certain disk I/O operations for the
+** windows [VFS] in order to provide robustness in the presence of
+** anti-virus programs.  By default, the windows VFS will retry file read,
+** file write, and file delete operations up to 10 times, with a delay
+** of 25 milliseconds before the first retry and with the delay increasing
+** by an additional 25 milliseconds with each subsequent retry.  This
+** opcode allows these two values (10 retries and 25 milliseconds of delay)
+** to be adjusted.  The values are changed for all database connections
+** within the same process.  The argument is a pointer to an array of two
+** integers where the first integer i the new retry count and the second
+** integer is the delay.  If either integer is negative, then the setting
+** is not changed but instead the prior value of that setting is written
+** into the array entry, allowing the current retry settings to be
+** interrogated.  The zDbName parameter is ignored.
+**
+** <li>[[SQLITE_FCNTL_PERSIST_WAL]]
+** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the
+** persistent [WAL | Write Ahead Log] setting.  By default, the auxiliary
+** write ahead log and shared memory files used for transaction control
+** are automatically deleted when the latest connection to the database
+** closes.  Setting persistent WAL mode causes those files to persist after
+** close.  Persisting the files is useful when other processes that do not
+** have write permission on the directory containing the database file want
+** to read the database file, as the WAL and shared memory files must exist
+** in order for the database to be readable.  The fourth parameter to
+** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
+** That integer is 0 to disable persistent WAL mode or 1 to enable persistent
+** WAL mode.  If the integer is -1, then it is overwritten with the current
+** WAL persistence setting.
+**
+** <li>[[SQLITE_FCNTL_POWERSAFE_OVERWRITE]]
+** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the
+** persistent "powersafe-overwrite" or "PSOW" setting.  The PSOW setting
+** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the
+** xDeviceCharacteristics methods. The fourth parameter to
+** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
+** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage
+** mode.  If the integer is -1, then it is overwritten with the current
+** zero-damage mode setting.
+**
+** <li>[[SQLITE_FCNTL_OVERWRITE]]
+** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening
+** a write transaction to indicate that, unless it is rolled back for some
+** reason, the entire database file will be overwritten by the current 
+** transaction. This is used by VACUUM operations.
+**
+** <li>[[SQLITE_FCNTL_VFSNAME]]
+** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
+** all [VFSes] in the VFS stack.  The names are of all VFS shims and the
+** final bottom-level VFS are written into memory obtained from 
+** [sqlite3_malloc()] and the result is stored in the char* variable
+** that the fourth parameter of [sqlite3_file_control()] points to.
+** The caller is responsible for freeing the memory when done.  As with
+** all file-control actions, there is no guarantee that this will actually
+** do anything.  Callers should initialize the char* variable to a NULL
+** pointer in case this file-control is not implemented.  This file-control
+** is intended for diagnostic use only.
+**
+** <li>[[SQLITE_FCNTL_PRAGMA]]
+** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] 
+** file control is sent to the open [sqlite3_file] object corresponding
+** to the database file to which the pragma statement refers. ^The argument
+** to the [SQLITE_FCNTL_PRAGMA] file control is an array of
+** pointers to strings (char**) in which the second element of the array
+** is the name of the pragma and the third element is the argument to the
+** pragma or NULL if the pragma has no argument.  ^The handler for an
+** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element
+** of the char** argument point to a string obtained from [sqlite3_mprintf()]
+** or the equivalent and that string will become the result of the pragma or
+** the error message if the pragma fails. ^If the
+** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal 
+** [PRAGMA] processing continues.  ^If the [SQLITE_FCNTL_PRAGMA]
+** file control returns [SQLITE_OK], then the parser assumes that the
+** VFS has handled the PRAGMA itself and the parser generates a no-op
+** prepared statement.  ^If the [SQLITE_FCNTL_PRAGMA] file control returns
+** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means
+** that the VFS encountered an error while handling the [PRAGMA] and the
+** compilation of the PRAGMA fails with an error.  ^The [SQLITE_FCNTL_PRAGMA]
+** file control occurs at the beginning of pragma statement analysis and so
+** it is able to override built-in [PRAGMA] statements.
+**
+** <li>[[SQLITE_FCNTL_BUSYHANDLER]]
+** ^The [SQLITE_FCNTL_BUSYHANDLER]
+** file-control may be invoked by SQLite on the database file handle
+** shortly after it is opened in order to provide a custom VFS with access
+** to the connections busy-handler callback. The argument is of type (void **)
+** - an array of two (void *) values. The first (void *) actually points
+** to a function of type (int (*)(void *)). In order to invoke the connections
+** busy-handler, this function should be invoked with the second (void *) in
+** the array as the only argument. If it returns non-zero, then the operation
+** should be retried. If it returns zero, the custom VFS should abandon the
+** current operation.
+**
+** <li>[[SQLITE_FCNTL_TEMPFILENAME]]
+** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control
+** to have SQLite generate a
+** temporary filename using the same algorithm that is followed to generate
+** temporary filenames for TEMP tables and other internal uses.  The
+** argument should be a char** which will be filled with the filename
+** written into memory obtained from [sqlite3_malloc()].  The caller should
+** invoke [sqlite3_free()] on the result to avoid a memory leak.
+**
+** <li>[[SQLITE_FCNTL_MMAP_SIZE]]
+** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the
+** maximum number of bytes that will be used for memory-mapped I/O.
+** The argument is a pointer to a value of type sqlite3_int64 that
+** is an advisory maximum number of bytes in the file to memory map.  The
+** pointer is overwritten with the old value.  The limit is not changed if
+** the value originally pointed to is negative, and so the current limit 
+** can be queried by passing in a pointer to a negative number.  This
+** file-control is used internally to implement [PRAGMA mmap_size].
+**
+** <li>[[SQLITE_FCNTL_TRACE]]
+** The [SQLITE_FCNTL_TRACE] file control provides advisory information
+** to the VFS about what the higher layers of the SQLite stack are doing.
+** This file control is used by some VFS activity tracing [shims].
+** The argument is a zero-terminated string.  Higher layers in the
+** SQLite stack may generate instances of this file control if
+** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled.
+**
+** <li>[[SQLITE_FCNTL_HAS_MOVED]]
+** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a
+** pointer to an integer and it writes a boolean into that integer depending
+** on whether or not the file has been renamed, moved, or deleted since it
+** was first opened.
+**
+** <li>[[SQLITE_FCNTL_WIN32_SET_HANDLE]]
+** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging.  This
+** opcode causes the xFileControl method to swap the file handle with the one
+** pointed to by the pArg argument.  This capability is used during testing
+** and only needs to be supported when SQLITE_TEST is defined.
+**
+** </ul>
+*/
+#define SQLITE_FCNTL_LOCKSTATE               1
+#define SQLITE_GET_LOCKPROXYFILE             2
+#define SQLITE_SET_LOCKPROXYFILE             3
+#define SQLITE_LAST_ERRNO                    4
+#define SQLITE_FCNTL_SIZE_HINT               5
+#define SQLITE_FCNTL_CHUNK_SIZE              6
+#define SQLITE_FCNTL_FILE_POINTER            7
+#define SQLITE_FCNTL_SYNC_OMITTED            8
+#define SQLITE_FCNTL_WIN32_AV_RETRY          9
+#define SQLITE_FCNTL_PERSIST_WAL            10
+#define SQLITE_FCNTL_OVERWRITE              11
+#define SQLITE_FCNTL_VFSNAME                12
+#define SQLITE_FCNTL_POWERSAFE_OVERWRITE    13
+#define SQLITE_FCNTL_PRAGMA                 14
+#define SQLITE_FCNTL_BUSYHANDLER            15
+#define SQLITE_FCNTL_TEMPFILENAME           16
+#define SQLITE_FCNTL_MMAP_SIZE              18
+#define SQLITE_FCNTL_TRACE                  19
+#define SQLITE_FCNTL_HAS_MOVED              20
+#define SQLITE_FCNTL_SYNC                   21
+#define SQLITE_FCNTL_COMMIT_PHASETWO        22
+#define SQLITE_FCNTL_WIN32_SET_HANDLE       23
+
+/*
+** CAPI3REF: Mutex Handle
+**
+** The mutex module within SQLite defines [sqlite3_mutex] to be an
+** abstract type for a mutex object.  The SQLite core never looks
+** at the internal representation of an [sqlite3_mutex].  It only
+** deals with pointers to the [sqlite3_mutex] object.
+**
+** Mutexes are created using [sqlite3_mutex_alloc()].
+*/
+typedef struct sqlite3_mutex sqlite3_mutex;
+
+/*
+** CAPI3REF: OS Interface Object
+**
+** An instance of the sqlite3_vfs object defines the interface between
+** the SQLite core and the underlying operating system.  The "vfs"
+** in the name of the object stands for "virtual file system".  See
+** the [VFS | VFS documentation] for further information.
+**
+** The value of the iVersion field is initially 1 but may be larger in
+** future versions of SQLite.  Additional fields may be appended to this
+** object when the iVersion value is increased.  Note that the structure
+** of the sqlite3_vfs object changes in the transaction between
+** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not
+** modified.
+**
+** The szOsFile field is the size of the subclassed [sqlite3_file]
+** structure used by this VFS.  mxPathname is the maximum length of
+** a pathname in this VFS.
+**
+** Registered sqlite3_vfs objects are kept on a linked list formed by
+** the pNext pointer.  The [sqlite3_vfs_register()]
+** and [sqlite3_vfs_unregister()] interfaces manage this list
+** in a thread-safe way.  The [sqlite3_vfs_find()] interface
+** searches the list.  Neither the application code nor the VFS
+** implementation should use the pNext pointer.
+**
+** The pNext field is the only field in the sqlite3_vfs
+** structure that SQLite will ever modify.  SQLite will only access
+** or modify this field while holding a particular static mutex.
+** The application should never modify anything within the sqlite3_vfs
+** object once the object has been registered.
+**
+** The zName field holds the name of the VFS module.  The name must
+** be unique across all VFS modules.
+**
+** [[sqlite3_vfs.xOpen]]
+** ^SQLite guarantees that the zFilename parameter to xOpen
+** is either a NULL pointer or string obtained
+** from xFullPathname() with an optional suffix added.
+** ^If a suffix is added to the zFilename parameter, it will
+** consist of a single "-" character followed by no more than
+** 11 alphanumeric and/or "-" characters.
+** ^SQLite further guarantees that
+** the string will be valid and unchanged until xClose() is
+** called. Because of the previous sentence,
+** the [sqlite3_file] can safely store a pointer to the
+** filename if it needs to remember the filename for some reason.
+** If the zFilename parameter to xOpen is a NULL pointer then xOpen
+** must invent its own temporary name for the file.  ^Whenever the 
+** xFilename parameter is NULL it will also be the case that the
+** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
+**
+** The flags argument to xOpen() includes all bits set in
+** the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]
+** or [sqlite3_open16()] is used, then flags includes at least
+** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. 
+** If xOpen() opens a file read-only then it sets *pOutFlags to
+** include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.
+**
+** ^(SQLite will also add one of the following flags to the xOpen()
+** call, depending on the object being opened:
+**
+** <ul>
+** <li>  [SQLITE_OPEN_MAIN_DB]
+** <li>  [SQLITE_OPEN_MAIN_JOURNAL]
+** <li>  [SQLITE_OPEN_TEMP_DB]
+** <li>  [SQLITE_OPEN_TEMP_JOURNAL]
+** <li>  [SQLITE_OPEN_TRANSIENT_DB]
+** <li>  [SQLITE_OPEN_SUBJOURNAL]
+** <li>  [SQLITE_OPEN_MASTER_JOURNAL]
+** <li>  [SQLITE_OPEN_WAL]
+** </ul>)^
+**
+** The file I/O implementation can use the object type flags to
+** change the way it deals with files.  For example, an application
+** that does not care about crash recovery or rollback might make
+** the open of a journal file a no-op.  Writes to this journal would
+** also be no-ops, and any attempt to read the journal would return
+** SQLITE_IOERR.  Or the implementation might recognize that a database
+** file will be doing page-aligned sector reads and writes in a random
+** order and set up its I/O subsystem accordingly.
+**
+** SQLite might also add one of the following flags to the xOpen method:
+**
+** <ul>
+** <li> [SQLITE_OPEN_DELETEONCLOSE]
+** <li> [SQLITE_OPEN_EXCLUSIVE]
+** </ul>
+**
+** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
+** deleted when it is closed.  ^The [SQLITE_OPEN_DELETEONCLOSE]
+** will be set for TEMP databases and their journals, transient
+** databases, and subjournals.
+**
+** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction
+** with the [SQLITE_OPEN_CREATE] flag, which are both directly
+** analogous to the O_EXCL and O_CREAT flags of the POSIX open()
+** API.  The SQLITE_OPEN_EXCLUSIVE flag, when paired with the 
+** SQLITE_OPEN_CREATE, is used to indicate that file should always
+** be created, and that it is an error if it already exists.
+** It is <i>not</i> used to indicate the file should be opened 
+** for exclusive access.
+**
+** ^At least szOsFile bytes of memory are allocated by SQLite
+** to hold the  [sqlite3_file] structure passed as the third
+** argument to xOpen.  The xOpen method does not have to
+** allocate the structure; it should just fill it in.  Note that
+** the xOpen method must set the sqlite3_file.pMethods to either
+** a valid [sqlite3_io_methods] object or to NULL.  xOpen must do
+** this even if the open fails.  SQLite expects that the sqlite3_file.pMethods
+** element will be valid after xOpen returns regardless of the success
+** or failure of the xOpen call.
+**
+** [[sqlite3_vfs.xAccess]]
+** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
+** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
+** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
+** to test whether a file is at least readable.   The file can be a
+** directory.
+**
+** ^SQLite will always allocate at least mxPathname+1 bytes for the
+** output buffer xFullPathname.  The exact size of the output buffer
+** is also passed as a parameter to both  methods. If the output buffer
+** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
+** handled as a fatal error by SQLite, vfs implementations should endeavor
+** to prevent this by setting mxPathname to a sufficiently large value.
+**
+** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
+** interfaces are not strictly a part of the filesystem, but they are
+** included in the VFS structure for completeness.
+** The xRandomness() function attempts to return nBytes bytes
+** of good-quality randomness into zOut.  The return value is
+** the actual number of bytes of randomness obtained.
+** The xSleep() method causes the calling thread to sleep for at
+** least the number of microseconds given.  ^The xCurrentTime()
+** method returns a Julian Day Number for the current date and time as
+** a floating point value.
+** ^The xCurrentTimeInt64() method returns, as an integer, the Julian
+** Day Number multiplied by 86400000 (the number of milliseconds in 
+** a 24-hour day).  
+** ^SQLite will use the xCurrentTimeInt64() method to get the current
+** date and time if that method is available (if iVersion is 2 or 
+** greater and the function pointer is not NULL) and will fall back
+** to xCurrentTime() if xCurrentTimeInt64() is unavailable.
+**
+** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces
+** are not used by the SQLite core.  These optional interfaces are provided
+** by some VFSes to facilitate testing of the VFS code. By overriding 
+** system calls with functions under its control, a test program can
+** simulate faults and error conditions that would otherwise be difficult
+** or impossible to induce.  The set of system calls that can be overridden
+** varies from one VFS to another, and from one version of the same VFS to the
+** next.  Applications that use these interfaces must be prepared for any
+** or all of these interfaces to be NULL or for their behavior to change
+** from one release to the next.  Applications must not attempt to access
+** any of these methods if the iVersion of the VFS is less than 3.
+*/
+typedef struct sqlite3_vfs sqlite3_vfs;
+typedef void (*sqlite3_syscall_ptr)(void);
+struct sqlite3_vfs {
+  int iVersion;            /* Structure version number (currently 3) */
+  int szOsFile;            /* Size of subclassed sqlite3_file */
+  int mxPathname;          /* Maximum file pathname length */
+  sqlite3_vfs *pNext;      /* Next registered VFS */
+  const char *zName;       /* Name of this virtual file system */
+  void *pAppData;          /* Pointer to application-specific data */
+  int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
+               int flags, int *pOutFlags);
+  int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
+  int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
+  int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
+  void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
+  void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
+  void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
+  void (*xDlClose)(sqlite3_vfs*, void*);
+  int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
+  int (*xSleep)(sqlite3_vfs*, int microseconds);
+  int (*xCurrentTime)(sqlite3_vfs*, double*);
+  int (*xGetLastError)(sqlite3_vfs*, int, char *);
+  /*
+  ** The methods above are in version 1 of the sqlite_vfs object
+  ** definition.  Those that follow are added in version 2 or later
+  */
+  int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
+  /*
+  ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
+  ** Those below are for version 3 and greater.
+  */
+  int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
+  sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
+  const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
+  /*
+  ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
+  ** New fields may be appended in figure versions.  The iVersion
+  ** value will increment whenever this happens. 
+  */
+};
+
+/*
+** CAPI3REF: Flags for the xAccess VFS method
+**
+** These integer constants can be used as the third parameter to
+** the xAccess method of an [sqlite3_vfs] object.  They determine
+** what kind of permissions the xAccess method is looking for.
+** With SQLITE_ACCESS_EXISTS, the xAccess method
+** simply checks whether the file exists.
+** With SQLITE_ACCESS_READWRITE, the xAccess method
+** checks whether the named directory is both readable and writable
+** (in other words, if files can be added, removed, and renamed within
+** the directory).
+** The SQLITE_ACCESS_READWRITE constant is currently used only by the
+** [temp_store_directory pragma], though this could change in a future
+** release of SQLite.
+** With SQLITE_ACCESS_READ, the xAccess method
+** checks whether the file is readable.  The SQLITE_ACCESS_READ constant is
+** currently unused, though it might be used in a future release of
+** SQLite.
+*/
+#define SQLITE_ACCESS_EXISTS    0
+#define SQLITE_ACCESS_READWRITE 1   /* Used by PRAGMA temp_store_directory */
+#define SQLITE_ACCESS_READ      2   /* Unused */
+
+/*
+** CAPI3REF: Flags for the xShmLock VFS method
+**
+** These integer constants define the various locking operations
+** allowed by the xShmLock method of [sqlite3_io_methods].  The
+** following are the only legal combinations of flags to the
+** xShmLock method:
+**
+** <ul>
+** <li>  SQLITE_SHM_LOCK | SQLITE_SHM_SHARED
+** <li>  SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE
+** <li>  SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED
+** <li>  SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE
+** </ul>
+**
+** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as
+** was given no the corresponding lock.  
+**
+** The xShmLock method can transition between unlocked and SHARED or
+** between unlocked and EXCLUSIVE.  It cannot transition between SHARED
+** and EXCLUSIVE.
+*/
+#define SQLITE_SHM_UNLOCK       1
+#define SQLITE_SHM_LOCK         2
+#define SQLITE_SHM_SHARED       4
+#define SQLITE_SHM_EXCLUSIVE    8
+
+/*
+** CAPI3REF: Maximum xShmLock index
+**
+** The xShmLock method on [sqlite3_io_methods] may use values
+** between 0 and this upper bound as its "offset" argument.
+** The SQLite core will never attempt to acquire or release a
+** lock outside of this range
+*/
+#define SQLITE_SHM_NLOCK        8
+
+
+/*
+** CAPI3REF: Initialize The SQLite Library
+**
+** ^The sqlite3_initialize() routine initializes the
+** SQLite library.  ^The sqlite3_shutdown() routine
+** deallocates any resources that were allocated by sqlite3_initialize().
+** These routines are designed to aid in process initialization and
+** shutdown on embedded systems.  Workstation applications using
+** SQLite normally do not need to invoke either of these routines.
+**
+** A call to sqlite3_initialize() is an "effective" call if it is
+** the first time sqlite3_initialize() is invoked during the lifetime of
+** the process, or if it is the first time sqlite3_initialize() is invoked
+** following a call to sqlite3_shutdown().  ^(Only an effective call
+** of sqlite3_initialize() does any initialization.  All other calls
+** are harmless no-ops.)^
+**
+** A call to sqlite3_shutdown() is an "effective" call if it is the first
+** call to sqlite3_shutdown() since the last sqlite3_initialize().  ^(Only
+** an effective call to sqlite3_shutdown() does any deinitialization.
+** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^
+**
+** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown()
+** is not.  The sqlite3_shutdown() interface must only be called from a
+** single thread.  All open [database connections] must be closed and all
+** other SQLite resources must be deallocated prior to invoking
+** sqlite3_shutdown().
+**
+** Among other things, ^sqlite3_initialize() will invoke
+** sqlite3_os_init().  Similarly, ^sqlite3_shutdown()
+** will invoke sqlite3_os_end().
+**
+** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success.
+** ^If for some reason, sqlite3_initialize() is unable to initialize
+** the library (perhaps it is unable to allocate a needed resource such
+** as a mutex) it returns an [error code] other than [SQLITE_OK].
+**
+** ^The sqlite3_initialize() routine is called internally by many other
+** SQLite interfaces so that an application usually does not need to
+** invoke sqlite3_initialize() directly.  For example, [sqlite3_open()]
+** calls sqlite3_initialize() so the SQLite library will be automatically
+** initialized when [sqlite3_open()] is called if it has not be initialized
+** already.  ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
+** compile-time option, then the automatic calls to sqlite3_initialize()
+** are omitted and the application must call sqlite3_initialize() directly
+** prior to using any other SQLite interface.  For maximum portability,
+** it is recommended that applications always invoke sqlite3_initialize()
+** directly prior to using any other SQLite interface.  Future releases
+** of SQLite may require this.  In other words, the behavior exhibited
+** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the
+** default behavior in some future release of SQLite.
+**
+** The sqlite3_os_init() routine does operating-system specific
+** initialization of the SQLite library.  The sqlite3_os_end()
+** routine undoes the effect of sqlite3_os_init().  Typical tasks
+** performed by these routines include allocation or deallocation
+** of static resources, initialization of global variables,
+** setting up a default [sqlite3_vfs] module, or setting up
+** a default configuration using [sqlite3_config()].
+**
+** The application should never invoke either sqlite3_os_init()
+** or sqlite3_os_end() directly.  The application should only invoke
+** sqlite3_initialize() and sqlite3_shutdown().  The sqlite3_os_init()
+** interface is called automatically by sqlite3_initialize() and
+** sqlite3_os_end() is called by sqlite3_shutdown().  Appropriate
+** implementations for sqlite3_os_init() and sqlite3_os_end()
+** are built into SQLite when it is compiled for Unix, Windows, or OS/2.
+** When [custom builds | built for other platforms]
+** (using the [SQLITE_OS_OTHER=1] compile-time
+** option) the application must supply a suitable implementation for
+** sqlite3_os_init() and sqlite3_os_end().  An application-supplied
+** implementation of sqlite3_os_init() or sqlite3_os_end()
+** must return [SQLITE_OK] on success and some other [error code] upon
+** failure.
+*/
+SQLITE_API int sqlite3_initialize(void);
+SQLITE_API int sqlite3_shutdown(void);
+SQLITE_API int sqlite3_os_init(void);
+SQLITE_API int sqlite3_os_end(void);
+
+/*
+** CAPI3REF: Configuring The SQLite Library
+**
+** The sqlite3_config() interface is used to make global configuration
+** changes to SQLite in order to tune SQLite to the specific needs of
+** the application.  The default configuration is recommended for most
+** applications and so this routine is usually not necessary.  It is
+** provided to support rare applications with unusual needs.
+**
+** The sqlite3_config() interface is not threadsafe.  The application
+** must insure that no other SQLite interfaces are invoked by other
+** threads while sqlite3_config() is running.  Furthermore, sqlite3_config()
+** may only be invoked prior to library initialization using
+** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()].
+** ^If sqlite3_config() is called after [sqlite3_initialize()] and before
+** [sqlite3_shutdown()] then it will return SQLITE_MISUSE.
+** Note, however, that ^sqlite3_config() can be called as part of the
+** implementation of an application-defined [sqlite3_os_init()].
+**
+** The first argument to sqlite3_config() is an integer
+** [configuration option] that determines
+** what property of SQLite is to be configured.  Subsequent arguments
+** vary depending on the [configuration option]
+** in the first argument.
+**
+** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
+** ^If the option is unknown or SQLite is unable to set the option
+** then this routine returns a non-zero [error code].
+*/
+SQLITE_API int sqlite3_config(int, ...);
+
+/*
+** CAPI3REF: Configure database connections
+**
+** The sqlite3_db_config() interface is used to make configuration
+** changes to a [database connection].  The interface is similar to
+** [sqlite3_config()] except that the changes apply to a single
+** [database connection] (specified in the first argument).
+**
+** The second argument to sqlite3_db_config(D,V,...)  is the
+** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code 
+** that indicates what aspect of the [database connection] is being configured.
+** Subsequent arguments vary depending on the configuration verb.
+**
+** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
+** the call is considered successful.
+*/
+SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
+
+/*
+** CAPI3REF: Memory Allocation Routines
+**
+** An instance of this object defines the interface between SQLite
+** and low-level memory allocation routines.
+**
+** This object is used in only one place in the SQLite interface.
+** A pointer to an instance of this object is the argument to
+** [sqlite3_config()] when the configuration option is
+** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].  
+** By creating an instance of this object
+** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])
+** during configuration, an application can specify an alternative
+** memory allocation subsystem for SQLite to use for all of its
+** dynamic memory needs.
+**
+** Note that SQLite comes with several [built-in memory allocators]
+** that are perfectly adequate for the overwhelming majority of applications
+** and that this object is only useful to a tiny minority of applications
+** with specialized memory allocation requirements.  This object is
+** also used during testing of SQLite in order to specify an alternative
+** memory allocator that simulates memory out-of-memory conditions in
+** order to verify that SQLite recovers gracefully from such
+** conditions.
+**
+** The xMalloc, xRealloc, and xFree methods must work like the
+** malloc(), realloc() and free() functions from the standard C library.
+** ^SQLite guarantees that the second argument to
+** xRealloc is always a value returned by a prior call to xRoundup.
+**
+** xSize should return the allocated size of a memory allocation
+** previously obtained from xMalloc or xRealloc.  The allocated size
+** is always at least as big as the requested size but may be larger.
+**
+** The xRoundup method returns what would be the allocated size of
+** a memory allocation given a particular requested size.  Most memory
+** allocators round up memory allocations at least to the next multiple
+** of 8.  Some allocators round up to a larger multiple or to a power of 2.
+** Every memory allocation request coming in through [sqlite3_malloc()]
+** or [sqlite3_realloc()] first calls xRoundup.  If xRoundup returns 0, 
+** that causes the corresponding memory allocation to fail.
+**
+** The xInit method initializes the memory allocator.  For example,
+** it might allocate any require mutexes or initialize internal data
+** structures.  The xShutdown method is invoked (indirectly) by
+** [sqlite3_shutdown()] and should deallocate any resources acquired
+** by xInit.  The pAppData pointer is used as the only parameter to
+** xInit and xShutdown.
+**
+** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+** the xInit method, so the xInit method need not be threadsafe.  The
+** xShutdown method is only called from [sqlite3_shutdown()] so it does
+** not need to be threadsafe either.  For all other methods, SQLite
+** holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
+** [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which
+** it is by default) and so the methods are automatically serialized.
+** However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other
+** methods must be threadsafe or else make their own arrangements for
+** serialization.
+**
+** SQLite will never invoke xInit() more than once without an intervening
+** call to xShutdown().
+*/
+typedef struct sqlite3_mem_methods sqlite3_mem_methods;
+struct sqlite3_mem_methods {
+  void *(*xMalloc)(int);         /* Memory allocation function */
+  void (*xFree)(void*);          /* Free a prior allocation */
+  void *(*xRealloc)(void*,int);  /* Resize an allocation */
+  int (*xSize)(void*);           /* Return the size of an allocation */
+  int (*xRoundup)(int);          /* Round up request size to allocation size */
+  int (*xInit)(void*);           /* Initialize the memory allocator */
+  void (*xShutdown)(void*);      /* Deinitialize the memory allocator */
+  void *pAppData;                /* Argument to xInit() and xShutdown() */
+};
+
+/*
+** CAPI3REF: Configuration Options
+** KEYWORDS: {configuration option}
+**
+** These constants are the available integer configuration options that
+** can be passed as the first argument to the [sqlite3_config()] interface.
+**
+** New configuration options may be added in future releases of SQLite.
+** Existing configuration options might be discontinued.  Applications
+** should check the return code from [sqlite3_config()] to make sure that
+** the call worked.  The [sqlite3_config()] interface will return a
+** non-zero [error code] if a discontinued or unsupported configuration option
+** is invoked.
+**
+** <dl>
+** [[SQLITE_CONFIG_SINGLETHREAD]] <dt>SQLITE_CONFIG_SINGLETHREAD</dt>
+** <dd>There are no arguments to this option.  ^This option sets the
+** [threading mode] to Single-thread.  In other words, it disables
+** all mutexing and puts SQLite into a mode where it can only be used
+** by a single thread.   ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** it is not possible to change the [threading mode] from its default
+** value of Single-thread and so [sqlite3_config()] will return 
+** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD
+** configuration option.</dd>
+**
+** [[SQLITE_CONFIG_MULTITHREAD]] <dt>SQLITE_CONFIG_MULTITHREAD</dt>
+** <dd>There are no arguments to this option.  ^This option sets the
+** [threading mode] to Multi-thread.  In other words, it disables
+** mutexing on [database connection] and [prepared statement] objects.
+** The application is responsible for serializing access to
+** [database connections] and [prepared statements].  But other mutexes
+** are enabled so that SQLite will be safe to use in a multi-threaded
+** environment as long as no two threads attempt to use the same
+** [database connection] at the same time.  ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** it is not possible to set the Multi-thread [threading mode] and
+** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
+** SQLITE_CONFIG_MULTITHREAD configuration option.</dd>
+**
+** [[SQLITE_CONFIG_SERIALIZED]] <dt>SQLITE_CONFIG_SERIALIZED</dt>
+** <dd>There are no arguments to this option.  ^This option sets the
+** [threading mode] to Serialized. In other words, this option enables
+** all mutexes including the recursive
+** mutexes on [database connection] and [prepared statement] objects.
+** In this mode (which is the default when SQLite is compiled with
+** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
+** to [database connections] and [prepared statements] so that the
+** application is free to use the same [database connection] or the
+** same [prepared statement] in different threads at the same time.
+** ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** it is not possible to set the Serialized [threading mode] and
+** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
+** SQLITE_CONFIG_SERIALIZED configuration option.</dd>
+**
+** [[SQLITE_CONFIG_MALLOC]] <dt>SQLITE_CONFIG_MALLOC</dt>
+** <dd> ^(This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mem_methods] structure.  The argument specifies
+** alternative low-level memory allocation routines to be used in place of
+** the memory allocation routines built into SQLite.)^ ^SQLite makes
+** its own private copy of the content of the [sqlite3_mem_methods] structure
+** before the [sqlite3_config()] call returns.</dd>
+**
+** [[SQLITE_CONFIG_GETMALLOC]] <dt>SQLITE_CONFIG_GETMALLOC</dt>
+** <dd> ^(This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mem_methods] structure.  The [sqlite3_mem_methods]
+** structure is filled with the currently defined memory allocation routines.)^
+** This option can be used to overload the default memory allocation
+** routines with a wrapper that simulations memory allocation failure or
+** tracks memory usage, for example. </dd>
+**
+** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
+** <dd> ^This option takes single argument of type int, interpreted as a 
+** boolean, which enables or disables the collection of memory allocation 
+** statistics. ^(When memory allocation statistics are disabled, the 
+** following SQLite interfaces become non-operational:
+**   <ul>
+**   <li> [sqlite3_memory_used()]
+**   <li> [sqlite3_memory_highwater()]
+**   <li> [sqlite3_soft_heap_limit64()]
+**   <li> [sqlite3_status()]
+**   </ul>)^
+** ^Memory allocation statistics are enabled by default unless SQLite is
+** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory
+** allocation statistics are disabled by default.
+** </dd>
+**
+** [[SQLITE_CONFIG_SCRATCH]] <dt>SQLITE_CONFIG_SCRATCH</dt>
+** <dd> ^This option specifies a static memory buffer that SQLite can use for
+** scratch memory.  There are three arguments:  A pointer an 8-byte
+** aligned memory buffer from which the scratch allocations will be
+** drawn, the size of each scratch allocation (sz),
+** and the maximum number of scratch allocations (N).  The sz
+** argument must be a multiple of 16.
+** The first argument must be a pointer to an 8-byte aligned buffer
+** of at least sz*N bytes of memory.
+** ^SQLite will use no more than two scratch buffers per thread.  So
+** N should be set to twice the expected maximum number of threads.
+** ^SQLite will never require a scratch buffer that is more than 6
+** times the database page size. ^If SQLite needs needs additional
+** scratch memory beyond what is provided by this configuration option, then 
+** [sqlite3_malloc()] will be used to obtain the memory needed.</dd>
+**
+** [[SQLITE_CONFIG_PAGECACHE]] <dt>SQLITE_CONFIG_PAGECACHE</dt>
+** <dd> ^This option specifies a static memory buffer that SQLite can use for
+** the database page cache with the default page cache implementation.  
+** This configuration should not be used if an application-define page
+** cache implementation is loaded using the SQLITE_CONFIG_PCACHE2 option.
+** There are three arguments to this option: A pointer to 8-byte aligned
+** memory, the size of each page buffer (sz), and the number of pages (N).
+** The sz argument should be the size of the largest database page
+** (a power of two between 512 and 32768) plus a little extra for each
+** page header.  ^The page header size is 20 to 40 bytes depending on
+** the host architecture.  ^It is harmless, apart from the wasted memory,
+** to make sz a little too large.  The first
+** argument should point to an allocation of at least sz*N bytes of memory.
+** ^SQLite will use the memory provided by the first argument to satisfy its
+** memory needs for the first N pages that it adds to cache.  ^If additional
+** page cache memory is needed beyond what is provided by this option, then
+** SQLite goes to [sqlite3_malloc()] for the additional storage space.
+** The pointer in the first argument must
+** be aligned to an 8-byte boundary or subsequent behavior of SQLite
+** will be undefined.</dd>
+**
+** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
+** <dd> ^This option specifies a static memory buffer that SQLite will use
+** for all of its dynamic memory allocation needs beyond those provided
+** for by [SQLITE_CONFIG_SCRATCH] and [SQLITE_CONFIG_PAGECACHE].
+** There are three arguments: An 8-byte aligned pointer to the memory,
+** the number of bytes in the memory buffer, and the minimum allocation size.
+** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts
+** to using its default memory allocator (the system malloc() implementation),
+** undoing any prior invocation of [SQLITE_CONFIG_MALLOC].  ^If the
+** memory pointer is not NULL and either [SQLITE_ENABLE_MEMSYS3] or
+** [SQLITE_ENABLE_MEMSYS5] are defined, then the alternative memory
+** allocator is engaged to handle all of SQLites memory allocation needs.
+** The first pointer (the memory pointer) must be aligned to an 8-byte
+** boundary or subsequent behavior of SQLite will be undefined.
+** The minimum allocation size is capped at 2**12. Reasonable values
+** for the minimum allocation size are 2**5 through 2**8.</dd>
+**
+** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
+** <dd> ^(This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mutex_methods] structure.  The argument specifies
+** alternative low-level mutex routines to be used in place
+** the mutex routines built into SQLite.)^  ^SQLite makes a copy of the
+** content of the [sqlite3_mutex_methods] structure before the call to
+** [sqlite3_config()] returns. ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** the entire mutexing subsystem is omitted from the build and hence calls to
+** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
+** return [SQLITE_ERROR].</dd>
+**
+** [[SQLITE_CONFIG_GETMUTEX]] <dt>SQLITE_CONFIG_GETMUTEX</dt>
+** <dd> ^(This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mutex_methods] structure.  The
+** [sqlite3_mutex_methods]
+** structure is filled with the currently defined mutex routines.)^
+** This option can be used to overload the default mutex allocation
+** routines with a wrapper used to track mutex usage for performance
+** profiling or testing, for example.   ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** the entire mutexing subsystem is omitted from the build and hence calls to
+** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will
+** return [SQLITE_ERROR].</dd>
+**
+** [[SQLITE_CONFIG_LOOKASIDE]] <dt>SQLITE_CONFIG_LOOKASIDE</dt>
+** <dd> ^(This option takes two arguments that determine the default
+** memory allocation for the lookaside memory allocator on each
+** [database connection].  The first argument is the
+** size of each lookaside buffer slot and the second is the number of
+** slots allocated to each database connection.)^  ^(This option sets the
+** <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]
+** verb to [sqlite3_db_config()] can be used to change the lookaside
+** configuration on individual connections.)^ </dd>
+**
+** [[SQLITE_CONFIG_PCACHE2]] <dt>SQLITE_CONFIG_PCACHE2</dt>
+** <dd> ^(This option takes a single argument which is a pointer to
+** an [sqlite3_pcache_methods2] object.  This object specifies the interface
+** to a custom page cache implementation.)^  ^SQLite makes a copy of the
+** object and uses it for page cache memory allocations.</dd>
+**
+** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
+** <dd> ^(This option takes a single argument which is a pointer to an
+** [sqlite3_pcache_methods2] object.  SQLite copies of the current
+** page cache implementation into that object.)^ </dd>
+**
+** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
+** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
+** g

<TRUNCATED>


[04/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/scannerc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/scannerc.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/scannerc.go
new file mode 100644
index 0000000..fe93b19
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/scannerc.go
@@ -0,0 +1,2710 @@
+package yaml
+
+import (
+	"bytes"
+	"fmt"
+)
+
+// Introduction
+// ************
+//
+// The following notes assume that you are familiar with the YAML specification
+// (http://yaml.org/spec/cvs/current.html).  We mostly follow it, although in
+// some cases we are less restrictive that it requires.
+//
+// The process of transforming a YAML stream into a sequence of events is
+// divided on two steps: Scanning and Parsing.
+//
+// The Scanner transforms the input stream into a sequence of tokens, while the
+// parser transform the sequence of tokens produced by the Scanner into a
+// sequence of parsing events.
+//
+// The Scanner is rather clever and complicated. The Parser, on the contrary,
+// is a straightforward implementation of a recursive-descendant parser (or,
+// LL(1) parser, as it is usually called).
+//
+// Actually there are two issues of Scanning that might be called "clever", the
+// rest is quite straightforward.  The issues are "block collection start" and
+// "simple keys".  Both issues are explained below in details.
+//
+// Here the Scanning step is explained and implemented.  We start with the list
+// of all the tokens produced by the Scanner together with short descriptions.
+//
+// Now, tokens:
+//
+//      STREAM-START(encoding)          # The stream start.
+//      STREAM-END                      # The stream end.
+//      VERSION-DIRECTIVE(major,minor)  # The '%YAML' directive.
+//      TAG-DIRECTIVE(handle,prefix)    # The '%TAG' directive.
+//      DOCUMENT-START                  # '---'
+//      DOCUMENT-END                    # '...'
+//      BLOCK-SEQUENCE-START            # Indentation increase denoting a block
+//      BLOCK-MAPPING-START             # sequence or a block mapping.
+//      BLOCK-END                       # Indentation decrease.
+//      FLOW-SEQUENCE-START             # '['
+//      FLOW-SEQUENCE-END               # ']'
+//      BLOCK-SEQUENCE-START            # '{'
+//      BLOCK-SEQUENCE-END              # '}'
+//      BLOCK-ENTRY                     # '-'
+//      FLOW-ENTRY                      # ','
+//      KEY                             # '?' or nothing (simple keys).
+//      VALUE                           # ':'
+//      ALIAS(anchor)                   # '*anchor'
+//      ANCHOR(anchor)                  # '&anchor'
+//      TAG(handle,suffix)              # '!handle!suffix'
+//      SCALAR(value,style)             # A scalar.
+//
+// The following two tokens are "virtual" tokens denoting the beginning and the
+// end of the stream:
+//
+//      STREAM-START(encoding)
+//      STREAM-END
+//
+// We pass the information about the input stream encoding with the
+// STREAM-START token.
+//
+// The next two tokens are responsible for tags:
+//
+//      VERSION-DIRECTIVE(major,minor)
+//      TAG-DIRECTIVE(handle,prefix)
+//
+// Example:
+//
+//      %YAML   1.1
+//      %TAG    !   !foo
+//      %TAG    !yaml!  tag:yaml.org,2002:
+//      ---
+//
+// The correspoding sequence of tokens:
+//
+//      STREAM-START(utf-8)
+//      VERSION-DIRECTIVE(1,1)
+//      TAG-DIRECTIVE("!","!foo")
+//      TAG-DIRECTIVE("!yaml","tag:yaml.org,2002:")
+//      DOCUMENT-START
+//      STREAM-END
+//
+// Note that the VERSION-DIRECTIVE and TAG-DIRECTIVE tokens occupy a whole
+// line.
+//
+// The document start and end indicators are represented by:
+//
+//      DOCUMENT-START
+//      DOCUMENT-END
+//
+// Note that if a YAML stream contains an implicit document (without '---'
+// and '...' indicators), no DOCUMENT-START and DOCUMENT-END tokens will be
+// produced.
+//
+// In the following examples, we present whole documents together with the
+// produced tokens.
+//
+//      1. An implicit document:
+//
+//          'a scalar'
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          SCALAR("a scalar",single-quoted)
+//          STREAM-END
+//
+//      2. An explicit document:
+//
+//          ---
+//          'a scalar'
+//          ...
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          DOCUMENT-START
+//          SCALAR("a scalar",single-quoted)
+//          DOCUMENT-END
+//          STREAM-END
+//
+//      3. Several documents in a stream:
+//
+//          'a scalar'
+//          ---
+//          'another scalar'
+//          ---
+//          'yet another scalar'
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          SCALAR("a scalar",single-quoted)
+//          DOCUMENT-START
+//          SCALAR("another scalar",single-quoted)
+//          DOCUMENT-START
+//          SCALAR("yet another scalar",single-quoted)
+//          STREAM-END
+//
+// We have already introduced the SCALAR token above.  The following tokens are
+// used to describe aliases, anchors, tag, and scalars:
+//
+//      ALIAS(anchor)
+//      ANCHOR(anchor)
+//      TAG(handle,suffix)
+//      SCALAR(value,style)
+//
+// The following series of examples illustrate the usage of these tokens:
+//
+//      1. A recursive sequence:
+//
+//          &A [ *A ]
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          ANCHOR("A")
+//          FLOW-SEQUENCE-START
+//          ALIAS("A")
+//          FLOW-SEQUENCE-END
+//          STREAM-END
+//
+//      2. A tagged scalar:
+//
+//          !!float "3.14"  # A good approximation.
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          TAG("!!","float")
+//          SCALAR("3.14",double-quoted)
+//          STREAM-END
+//
+//      3. Various scalar styles:
+//
+//          --- # Implicit empty plain scalars do not produce tokens.
+//          --- a plain scalar
+//          --- 'a single-quoted scalar'
+//          --- "a double-quoted scalar"
+//          --- |-
+//            a literal scalar
+//          --- >-
+//            a folded
+//            scalar
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          DOCUMENT-START
+//          DOCUMENT-START
+//          SCALAR("a plain scalar",plain)
+//          DOCUMENT-START
+//          SCALAR("a single-quoted scalar",single-quoted)
+//          DOCUMENT-START
+//          SCALAR("a double-quoted scalar",double-quoted)
+//          DOCUMENT-START
+//          SCALAR("a literal scalar",literal)
+//          DOCUMENT-START
+//          SCALAR("a folded scalar",folded)
+//          STREAM-END
+//
+// Now it's time to review collection-related tokens. We will start with
+// flow collections:
+//
+//      FLOW-SEQUENCE-START
+//      FLOW-SEQUENCE-END
+//      FLOW-MAPPING-START
+//      FLOW-MAPPING-END
+//      FLOW-ENTRY
+//      KEY
+//      VALUE
+//
+// The tokens FLOW-SEQUENCE-START, FLOW-SEQUENCE-END, FLOW-MAPPING-START, and
+// FLOW-MAPPING-END represent the indicators '[', ']', '{', and '}'
+// correspondingly.  FLOW-ENTRY represent the ',' indicator.  Finally the
+// indicators '?' and ':', which are used for denoting mapping keys and values,
+// are represented by the KEY and VALUE tokens.
+//
+// The following examples show flow collections:
+//
+//      1. A flow sequence:
+//
+//          [item 1, item 2, item 3]
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          FLOW-SEQUENCE-START
+//          SCALAR("item 1",plain)
+//          FLOW-ENTRY
+//          SCALAR("item 2",plain)
+//          FLOW-ENTRY
+//          SCALAR("item 3",plain)
+//          FLOW-SEQUENCE-END
+//          STREAM-END
+//
+//      2. A flow mapping:
+//
+//          {
+//              a simple key: a value,  # Note that the KEY token is produced.
+//              ? a complex key: another value,
+//          }
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          FLOW-MAPPING-START
+//          KEY
+//          SCALAR("a simple key",plain)
+//          VALUE
+//          SCALAR("a value",plain)
+//          FLOW-ENTRY
+//          KEY
+//          SCALAR("a complex key",plain)
+//          VALUE
+//          SCALAR("another value",plain)
+//          FLOW-ENTRY
+//          FLOW-MAPPING-END
+//          STREAM-END
+//
+// A simple key is a key which is not denoted by the '?' indicator.  Note that
+// the Scanner still produce the KEY token whenever it encounters a simple key.
+//
+// For scanning block collections, the following tokens are used (note that we
+// repeat KEY and VALUE here):
+//
+//      BLOCK-SEQUENCE-START
+//      BLOCK-MAPPING-START
+//      BLOCK-END
+//      BLOCK-ENTRY
+//      KEY
+//      VALUE
+//
+// The tokens BLOCK-SEQUENCE-START and BLOCK-MAPPING-START denote indentation
+// increase that precedes a block collection (cf. the INDENT token in Python).
+// The token BLOCK-END denote indentation decrease that ends a block collection
+// (cf. the DEDENT token in Python).  However YAML has some syntax pecularities
+// that makes detections of these tokens more complex.
+//
+// The tokens BLOCK-ENTRY, KEY, and VALUE are used to represent the indicators
+// '-', '?', and ':' correspondingly.
+//
+// The following examples show how the tokens BLOCK-SEQUENCE-START,
+// BLOCK-MAPPING-START, and BLOCK-END are emitted by the Scanner:
+//
+//      1. Block sequences:
+//
+//          - item 1
+//          - item 2
+//          -
+//            - item 3.1
+//            - item 3.2
+//          -
+//            key 1: value 1
+//            key 2: value 2
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          BLOCK-SEQUENCE-START
+//          BLOCK-ENTRY
+//          SCALAR("item 1",plain)
+//          BLOCK-ENTRY
+//          SCALAR("item 2",plain)
+//          BLOCK-ENTRY
+//          BLOCK-SEQUENCE-START
+//          BLOCK-ENTRY
+//          SCALAR("item 3.1",plain)
+//          BLOCK-ENTRY
+//          SCALAR("item 3.2",plain)
+//          BLOCK-END
+//          BLOCK-ENTRY
+//          BLOCK-MAPPING-START
+//          KEY
+//          SCALAR("key 1",plain)
+//          VALUE
+//          SCALAR("value 1",plain)
+//          KEY
+//          SCALAR("key 2",plain)
+//          VALUE
+//          SCALAR("value 2",plain)
+//          BLOCK-END
+//          BLOCK-END
+//          STREAM-END
+//
+//      2. Block mappings:
+//
+//          a simple key: a value   # The KEY token is produced here.
+//          ? a complex key
+//          : another value
+//          a mapping:
+//            key 1: value 1
+//            key 2: value 2
+//          a sequence:
+//            - item 1
+//            - item 2
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          BLOCK-MAPPING-START
+//          KEY
+//          SCALAR("a simple key",plain)
+//          VALUE
+//          SCALAR("a value",plain)
+//          KEY
+//          SCALAR("a complex key",plain)
+//          VALUE
+//          SCALAR("another value",plain)
+//          KEY
+//          SCALAR("a mapping",plain)
+//          BLOCK-MAPPING-START
+//          KEY
+//          SCALAR("key 1",plain)
+//          VALUE
+//          SCALAR("value 1",plain)
+//          KEY
+//          SCALAR("key 2",plain)
+//          VALUE
+//          SCALAR("value 2",plain)
+//          BLOCK-END
+//          KEY
+//          SCALAR("a sequence",plain)
+//          VALUE
+//          BLOCK-SEQUENCE-START
+//          BLOCK-ENTRY
+//          SCALAR("item 1",plain)
+//          BLOCK-ENTRY
+//          SCALAR("item 2",plain)
+//          BLOCK-END
+//          BLOCK-END
+//          STREAM-END
+//
+// YAML does not always require to start a new block collection from a new
+// line.  If the current line contains only '-', '?', and ':' indicators, a new
+// block collection may start at the current line.  The following examples
+// illustrate this case:
+//
+//      1. Collections in a sequence:
+//
+//          - - item 1
+//            - item 2
+//          - key 1: value 1
+//            key 2: value 2
+//          - ? complex key
+//            : complex value
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          BLOCK-SEQUENCE-START
+//          BLOCK-ENTRY
+//          BLOCK-SEQUENCE-START
+//          BLOCK-ENTRY
+//          SCALAR("item 1",plain)
+//          BLOCK-ENTRY
+//          SCALAR("item 2",plain)
+//          BLOCK-END
+//          BLOCK-ENTRY
+//          BLOCK-MAPPING-START
+//          KEY
+//          SCALAR("key 1",plain)
+//          VALUE
+//          SCALAR("value 1",plain)
+//          KEY
+//          SCALAR("key 2",plain)
+//          VALUE
+//          SCALAR("value 2",plain)
+//          BLOCK-END
+//          BLOCK-ENTRY
+//          BLOCK-MAPPING-START
+//          KEY
+//          SCALAR("complex key")
+//          VALUE
+//          SCALAR("complex value")
+//          BLOCK-END
+//          BLOCK-END
+//          STREAM-END
+//
+//      2. Collections in a mapping:
+//
+//          ? a sequence
+//          : - item 1
+//            - item 2
+//          ? a mapping
+//          : key 1: value 1
+//            key 2: value 2
+//
+//      Tokens:
+//
+//          STREAM-START(utf-8)
+//          BLOCK-MAPPING-START
+//          KEY
+//          SCALAR("a sequence",plain)
+//          VALUE
+//          BLOCK-SEQUENCE-START
+//          BLOCK-ENTRY
+//          SCALAR("item 1",plain)
+//          BLOCK-ENTRY
+//          SCALAR("item 2",plain)
+//          BLOCK-END
+//          KEY
+//          SCALAR("a mapping",plain)
+//          VALUE
+//          BLOCK-MAPPING-START
+//          KEY
+//          SCALAR("key 1",plain)
+//          VALUE
+//          SCALAR("value 1",plain)
+//          KEY
+//          SCALAR("key 2",plain)
+//          VALUE
+//          SCALAR("value 2",plain)
+//          BLOCK-END
+//          BLOCK-END
+//          STREAM-END
+//
+// YAML also permits non-indented sequences if they are included into a block
+// mapping.  In this case, the token BLOCK-SEQUENCE-START is not produced:
+//
+//      key:
+//      - item 1    # BLOCK-SEQUENCE-START is NOT produced here.
+//      - item 2
+//
+// Tokens:
+//
+//      STREAM-START(utf-8)
+//      BLOCK-MAPPING-START
+//      KEY
+//      SCALAR("key",plain)
+//      VALUE
+//      BLOCK-ENTRY
+//      SCALAR("item 1",plain)
+//      BLOCK-ENTRY
+//      SCALAR("item 2",plain)
+//      BLOCK-END
+//
+
+// Ensure that the buffer contains the required number of characters.
+// Return true on success, false on failure (reader error or memory error).
+func cache(parser *yaml_parser_t, length int) bool {
+	// [Go] This was inlined: !cache(A, B) -> unread < B && !update(A, B)
+	return parser.unread >= length || yaml_parser_update_buffer(parser, length)
+}
+
+// Advance the buffer pointer.
+func skip(parser *yaml_parser_t) {
+	parser.mark.index++
+	parser.mark.column++
+	parser.unread--
+	parser.buffer_pos += width(parser.buffer[parser.buffer_pos])
+}
+
+func skip_line(parser *yaml_parser_t) {
+	if is_crlf(parser.buffer, parser.buffer_pos) {
+		parser.mark.index += 2
+		parser.mark.column = 0
+		parser.mark.line++
+		parser.unread -= 2
+		parser.buffer_pos += 2
+	} else if is_break(parser.buffer, parser.buffer_pos) {
+		parser.mark.index++
+		parser.mark.column = 0
+		parser.mark.line++
+		parser.unread--
+		parser.buffer_pos += width(parser.buffer[parser.buffer_pos])
+	}
+}
+
+// Copy a character to a string buffer and advance pointers.
+func read(parser *yaml_parser_t, s []byte) []byte {
+	w := width(parser.buffer[parser.buffer_pos])
+	if w == 0 {
+		panic("invalid character sequence")
+	}
+	if len(s) == 0 {
+		s = make([]byte, 0, 32)
+	}
+	if w == 1 && len(s)+w <= cap(s) {
+		s = s[:len(s)+1]
+		s[len(s)-1] = parser.buffer[parser.buffer_pos]
+		parser.buffer_pos++
+	} else {
+		s = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...)
+		parser.buffer_pos += w
+	}
+	parser.mark.index++
+	parser.mark.column++
+	parser.unread--
+	return s
+}
+
+// Copy a line break character to a string buffer and advance pointers.
+func read_line(parser *yaml_parser_t, s []byte) []byte {
+	buf := parser.buffer
+	pos := parser.buffer_pos
+	switch {
+	case buf[pos] == '\r' && buf[pos+1] == '\n':
+		// CR LF . LF
+		s = append(s, '\n')
+		parser.buffer_pos += 2
+		parser.mark.index++
+		parser.unread--
+	case buf[pos] == '\r' || buf[pos] == '\n':
+		// CR|LF . LF
+		s = append(s, '\n')
+		parser.buffer_pos += 1
+	case buf[pos] == '\xC2' && buf[pos+1] == '\x85':
+		// NEL . LF
+		s = append(s, '\n')
+		parser.buffer_pos += 2
+	case buf[pos] == '\xE2' && buf[pos+1] == '\x80' && (buf[pos+2] == '\xA8' || buf[pos+2] == '\xA9'):
+		// LS|PS . LS|PS
+		s = append(s, buf[parser.buffer_pos:pos+3]...)
+		parser.buffer_pos += 3
+	default:
+		return s
+	}
+	parser.mark.index++
+	parser.mark.column = 0
+	parser.mark.line++
+	parser.unread--
+	return s
+}
+
+// Get the next token.
+func yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool {
+	// Erase the token object.
+	*token = yaml_token_t{} // [Go] Is this necessary?
+
+	// No tokens after STREAM-END or error.
+	if parser.stream_end_produced || parser.error != yaml_NO_ERROR {
+		return true
+	}
+
+	// Ensure that the tokens queue contains enough tokens.
+	if !parser.token_available {
+		if !yaml_parser_fetch_more_tokens(parser) {
+			return false
+		}
+	}
+
+	// Fetch the next token from the queue.
+	*token = parser.tokens[parser.tokens_head]
+	parser.tokens_head++
+	parser.tokens_parsed++
+	parser.token_available = false
+
+	if token.typ == yaml_STREAM_END_TOKEN {
+		parser.stream_end_produced = true
+	}
+	return true
+}
+
+// Set the scanner error and return false.
+func yaml_parser_set_scanner_error(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string) bool {
+	parser.error = yaml_SCANNER_ERROR
+	parser.context = context
+	parser.context_mark = context_mark
+	parser.problem = problem
+	parser.problem_mark = parser.mark
+	return false
+}
+
+func yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive bool, context_mark yaml_mark_t, problem string) bool {
+	context := "while parsing a tag"
+	if directive {
+		context = "while parsing a %TAG directive"
+	}
+	return yaml_parser_set_scanner_error(parser, context, context_mark, "did not find URI escaped octet")
+}
+
+func trace(args ...interface{}) func() {
+	pargs := append([]interface{}{"+++"}, args...)
+	fmt.Println(pargs...)
+	pargs = append([]interface{}{"---"}, args...)
+	return func() { fmt.Println(pargs...) }
+}
+
+// Ensure that the tokens queue contains at least one token which can be
+// returned to the Parser.
+func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool {
+	// While we need more tokens to fetch, do it.
+	for {
+		// Check if we really need to fetch more tokens.
+		need_more_tokens := false
+
+		if parser.tokens_head == len(parser.tokens) {
+			// Queue is empty.
+			need_more_tokens = true
+		} else {
+			// Check if any potential simple key may occupy the head position.
+			if !yaml_parser_stale_simple_keys(parser) {
+				return false
+			}
+
+			for i := range parser.simple_keys {
+				simple_key := &parser.simple_keys[i]
+				if simple_key.possible && simple_key.token_number == parser.tokens_parsed {
+					need_more_tokens = true
+					break
+				}
+			}
+		}
+
+		// We are finished.
+		if !need_more_tokens {
+			break
+		}
+		// Fetch the next token.
+		if !yaml_parser_fetch_next_token(parser) {
+			return false
+		}
+	}
+
+	parser.token_available = true
+	return true
+}
+
+// The dispatcher for token fetchers.
+func yaml_parser_fetch_next_token(parser *yaml_parser_t) bool {
+	// Ensure that the buffer is initialized.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+
+	// Check if we just started scanning.  Fetch STREAM-START then.
+	if !parser.stream_start_produced {
+		return yaml_parser_fetch_stream_start(parser)
+	}
+
+	// Eat whitespaces and comments until we reach the next token.
+	if !yaml_parser_scan_to_next_token(parser) {
+		return false
+	}
+
+	// Remove obsolete potential simple keys.
+	if !yaml_parser_stale_simple_keys(parser) {
+		return false
+	}
+
+	// Check the indentation level against the current column.
+	if !yaml_parser_unroll_indent(parser, parser.mark.column) {
+		return false
+	}
+
+	// Ensure that the buffer contains at least 4 characters.  4 is the length
+	// of the longest indicators ('--- ' and '... ').
+	if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {
+		return false
+	}
+
+	// Is it the end of the stream?
+	if is_z(parser.buffer, parser.buffer_pos) {
+		return yaml_parser_fetch_stream_end(parser)
+	}
+
+	// Is it a directive?
+	if parser.mark.column == 0 && parser.buffer[parser.buffer_pos] == '%' {
+		return yaml_parser_fetch_directive(parser)
+	}
+
+	buf := parser.buffer
+	pos := parser.buffer_pos
+
+	// Is it the document start indicator?
+	if parser.mark.column == 0 && buf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' && is_blankz(buf, pos+3) {
+		return yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_START_TOKEN)
+	}
+
+	// Is it the document end indicator?
+	if parser.mark.column == 0 && buf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' && is_blankz(buf, pos+3) {
+		return yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_END_TOKEN)
+	}
+
+	// Is it the flow sequence start indicator?
+	if buf[pos] == '[' {
+		return yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_SEQUENCE_START_TOKEN)
+	}
+
+	// Is it the flow mapping start indicator?
+	if parser.buffer[parser.buffer_pos] == '{' {
+		return yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_MAPPING_START_TOKEN)
+	}
+
+	// Is it the flow sequence end indicator?
+	if parser.buffer[parser.buffer_pos] == ']' {
+		return yaml_parser_fetch_flow_collection_end(parser,
+			yaml_FLOW_SEQUENCE_END_TOKEN)
+	}
+
+	// Is it the flow mapping end indicator?
+	if parser.buffer[parser.buffer_pos] == '}' {
+		return yaml_parser_fetch_flow_collection_end(parser,
+			yaml_FLOW_MAPPING_END_TOKEN)
+	}
+
+	// Is it the flow entry indicator?
+	if parser.buffer[parser.buffer_pos] == ',' {
+		return yaml_parser_fetch_flow_entry(parser)
+	}
+
+	// Is it the block entry indicator?
+	if parser.buffer[parser.buffer_pos] == '-' && is_blankz(parser.buffer, parser.buffer_pos+1) {
+		return yaml_parser_fetch_block_entry(parser)
+	}
+
+	// Is it the key indicator?
+	if parser.buffer[parser.buffer_pos] == '?' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) {
+		return yaml_parser_fetch_key(parser)
+	}
+
+	// Is it the value indicator?
+	if parser.buffer[parser.buffer_pos] == ':' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) {
+		return yaml_parser_fetch_value(parser)
+	}
+
+	// Is it an alias?
+	if parser.buffer[parser.buffer_pos] == '*' {
+		return yaml_parser_fetch_anchor(parser, yaml_ALIAS_TOKEN)
+	}
+
+	// Is it an anchor?
+	if parser.buffer[parser.buffer_pos] == '&' {
+		return yaml_parser_fetch_anchor(parser, yaml_ANCHOR_TOKEN)
+	}
+
+	// Is it a tag?
+	if parser.buffer[parser.buffer_pos] == '!' {
+		return yaml_parser_fetch_tag(parser)
+	}
+
+	// Is it a literal scalar?
+	if parser.buffer[parser.buffer_pos] == '|' && parser.flow_level == 0 {
+		return yaml_parser_fetch_block_scalar(parser, true)
+	}
+
+	// Is it a folded scalar?
+	if parser.buffer[parser.buffer_pos] == '>' && parser.flow_level == 0 {
+		return yaml_parser_fetch_block_scalar(parser, false)
+	}
+
+	// Is it a single-quoted scalar?
+	if parser.buffer[parser.buffer_pos] == '\'' {
+		return yaml_parser_fetch_flow_scalar(parser, true)
+	}
+
+	// Is it a double-quoted scalar?
+	if parser.buffer[parser.buffer_pos] == '"' {
+		return yaml_parser_fetch_flow_scalar(parser, false)
+	}
+
+	// Is it a plain scalar?
+	//
+	// A plain scalar may start with any non-blank characters except
+	//
+	//      '-', '?', ':', ',', '[', ']', '{', '}',
+	//      '#', '&', '*', '!', '|', '>', '\'', '\"',
+	//      '%', '@', '`'.
+	//
+	// In the block context (and, for the '-' indicator, in the flow context
+	// too), it may also start with the characters
+	//
+	//      '-', '?', ':'
+	//
+	// if it is followed by a non-space character.
+	//
+	// The last rule is more restrictive than the specification requires.
+	// [Go] Make this logic more reasonable.
+	//switch parser.buffer[parser.buffer_pos] {
+	//case '-', '?', ':', ',', '?', '-', ',', ':', ']', '[', '}', '{', '&', '#', '!', '*', '>', '|', '"', '\'', '@', '%', '-', '`':
+	//}
+	if !(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '-' ||
+		parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':' ||
+		parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '[' ||
+		parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' ||
+		parser.buffer[parser.buffer_pos] == '}' || parser.buffer[parser.buffer_pos] == '#' ||
+		parser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '*' ||
+		parser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '|' ||
+		parser.buffer[parser.buffer_pos] == '>' || parser.buffer[parser.buffer_pos] == '\'' ||
+		parser.buffer[parser.buffer_pos] == '"' || parser.buffer[parser.buffer_pos] == '%' ||
+		parser.buffer[parser.buffer_pos] == '@' || parser.buffer[parser.buffer_pos] == '`') ||
+		(parser.buffer[parser.buffer_pos] == '-' && !is_blank(parser.buffer, parser.buffer_pos+1)) ||
+		(parser.flow_level == 0 &&
+			(parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':') &&
+			!is_blankz(parser.buffer, parser.buffer_pos+1)) {
+		return yaml_parser_fetch_plain_scalar(parser)
+	}
+
+	// If we don't determine the token type so far, it is an error.
+	return yaml_parser_set_scanner_error(parser,
+		"while scanning for the next token", parser.mark,
+		"found character that cannot start any token")
+}
+
+// Check the list of potential simple keys and remove the positions that
+// cannot contain simple keys anymore.
+func yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool {
+	// Check for a potential simple key for each flow level.
+	for i := range parser.simple_keys {
+		simple_key := &parser.simple_keys[i]
+
+		// The specification requires that a simple key
+		//
+		//  - is limited to a single line,
+		//  - is shorter than 1024 characters.
+		if simple_key.possible && (simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index) {
+
+			// Check if the potential simple key to be removed is required.
+			if simple_key.required {
+				return yaml_parser_set_scanner_error(parser,
+					"while scanning a simple key", simple_key.mark,
+					"could not find expected ':'")
+			}
+			simple_key.possible = false
+		}
+	}
+	return true
+}
+
+// Check if a simple key may start at the current position and add it if
+// needed.
+func yaml_parser_save_simple_key(parser *yaml_parser_t) bool {
+	// A simple key is required at the current position if the scanner is in
+	// the block context and the current column coincides with the indentation
+	// level.
+
+	required := parser.flow_level == 0 && parser.indent == parser.mark.column
+
+	// A simple key is required only when it is the first token in the current
+	// line.  Therefore it is always allowed.  But we add a check anyway.
+	if required && !parser.simple_key_allowed {
+		panic("should not happen")
+	}
+
+	//
+	// If the current position may start a simple key, save it.
+	//
+	if parser.simple_key_allowed {
+		simple_key := yaml_simple_key_t{
+			possible:     true,
+			required:     required,
+			token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),
+		}
+		simple_key.mark = parser.mark
+
+		if !yaml_parser_remove_simple_key(parser) {
+			return false
+		}
+		parser.simple_keys[len(parser.simple_keys)-1] = simple_key
+	}
+	return true
+}
+
+// Remove a potential simple key at the current flow level.
+func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool {
+	i := len(parser.simple_keys) - 1
+	if parser.simple_keys[i].possible {
+		// If the key is required, it is an error.
+		if parser.simple_keys[i].required {
+			return yaml_parser_set_scanner_error(parser,
+				"while scanning a simple key", parser.simple_keys[i].mark,
+				"could not find expected ':'")
+		}
+	}
+	// Remove the key from the stack.
+	parser.simple_keys[i].possible = false
+	return true
+}
+
+// Increase the flow level and resize the simple key list if needed.
+func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
+	// Reset the simple key on the next level.
+	parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})
+
+	// Increase the flow level.
+	parser.flow_level++
+	return true
+}
+
+// Decrease the flow level.
+func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {
+	if parser.flow_level > 0 {
+		parser.flow_level--
+		parser.simple_keys = parser.simple_keys[:len(parser.simple_keys)-1]
+	}
+	return true
+}
+
+// Push the current indentation level to the stack and set the new level
+// the current column is greater than the indentation level.  In this case,
+// append or insert the specified token into the token queue.
+func yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml_token_type_t, mark yaml_mark_t) bool {
+	// In the flow context, do nothing.
+	if parser.flow_level > 0 {
+		return true
+	}
+
+	if parser.indent < column {
+		// Push the current indentation level to the stack and set the new
+		// indentation level.
+		parser.indents = append(parser.indents, parser.indent)
+		parser.indent = column
+
+		// Create a token and insert it into the queue.
+		token := yaml_token_t{
+			typ:        typ,
+			start_mark: mark,
+			end_mark:   mark,
+		}
+		if number > -1 {
+			number -= parser.tokens_parsed
+		}
+		yaml_insert_token(parser, number, &token)
+	}
+	return true
+}
+
+// Pop indentation levels from the indents stack until the current level
+// becomes less or equal to the column.  For each intendation level, append
+// the BLOCK-END token.
+func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool {
+	// In the flow context, do nothing.
+	if parser.flow_level > 0 {
+		return true
+	}
+
+	// Loop through the intendation levels in the stack.
+	for parser.indent > column {
+		// Create a token and append it to the queue.
+		token := yaml_token_t{
+			typ:        yaml_BLOCK_END_TOKEN,
+			start_mark: parser.mark,
+			end_mark:   parser.mark,
+		}
+		yaml_insert_token(parser, -1, &token)
+
+		// Pop the indentation level.
+		parser.indent = parser.indents[len(parser.indents)-1]
+		parser.indents = parser.indents[:len(parser.indents)-1]
+	}
+	return true
+}
+
+// Initialize the scanner and produce the STREAM-START token.
+func yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool {
+
+	// Set the initial indentation.
+	parser.indent = -1
+
+	// Initialize the simple key stack.
+	parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})
+
+	// A simple key is allowed at the beginning of the stream.
+	parser.simple_key_allowed = true
+
+	// We have started.
+	parser.stream_start_produced = true
+
+	// Create the STREAM-START token and append it to the queue.
+	token := yaml_token_t{
+		typ:        yaml_STREAM_START_TOKEN,
+		start_mark: parser.mark,
+		end_mark:   parser.mark,
+		encoding:   parser.encoding,
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the STREAM-END token and shut down the scanner.
+func yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool {
+
+	// Force new line.
+	if parser.mark.column != 0 {
+		parser.mark.column = 0
+		parser.mark.line++
+	}
+
+	// Reset the indentation level.
+	if !yaml_parser_unroll_indent(parser, -1) {
+		return false
+	}
+
+	// Reset simple keys.
+	if !yaml_parser_remove_simple_key(parser) {
+		return false
+	}
+
+	parser.simple_key_allowed = false
+
+	// Create the STREAM-END token and append it to the queue.
+	token := yaml_token_t{
+		typ:        yaml_STREAM_END_TOKEN,
+		start_mark: parser.mark,
+		end_mark:   parser.mark,
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token.
+func yaml_parser_fetch_directive(parser *yaml_parser_t) bool {
+	// Reset the indentation level.
+	if !yaml_parser_unroll_indent(parser, -1) {
+		return false
+	}
+
+	// Reset simple keys.
+	if !yaml_parser_remove_simple_key(parser) {
+		return false
+	}
+
+	parser.simple_key_allowed = false
+
+	// Create the YAML-DIRECTIVE or TAG-DIRECTIVE token.
+	token := yaml_token_t{}
+	if !yaml_parser_scan_directive(parser, &token) {
+		return false
+	}
+	// Append the token to the queue.
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the DOCUMENT-START or DOCUMENT-END token.
+func yaml_parser_fetch_document_indicator(parser *yaml_parser_t, typ yaml_token_type_t) bool {
+	// Reset the indentation level.
+	if !yaml_parser_unroll_indent(parser, -1) {
+		return false
+	}
+
+	// Reset simple keys.
+	if !yaml_parser_remove_simple_key(parser) {
+		return false
+	}
+
+	parser.simple_key_allowed = false
+
+	// Consume the token.
+	start_mark := parser.mark
+
+	skip(parser)
+	skip(parser)
+	skip(parser)
+
+	end_mark := parser.mark
+
+	// Create the DOCUMENT-START or DOCUMENT-END token.
+	token := yaml_token_t{
+		typ:        typ,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+	}
+	// Append the token to the queue.
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token.
+func yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t, typ yaml_token_type_t) bool {
+	// The indicators '[' and '{' may start a simple key.
+	if !yaml_parser_save_simple_key(parser) {
+		return false
+	}
+
+	// Increase the flow level.
+	if !yaml_parser_increase_flow_level(parser) {
+		return false
+	}
+
+	// A simple key may follow the indicators '[' and '{'.
+	parser.simple_key_allowed = true
+
+	// Consume the token.
+	start_mark := parser.mark
+	skip(parser)
+	end_mark := parser.mark
+
+	// Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token.
+	token := yaml_token_t{
+		typ:        typ,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+	}
+	// Append the token to the queue.
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token.
+func yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t, typ yaml_token_type_t) bool {
+	// Reset any potential simple key on the current flow level.
+	if !yaml_parser_remove_simple_key(parser) {
+		return false
+	}
+
+	// Decrease the flow level.
+	if !yaml_parser_decrease_flow_level(parser) {
+		return false
+	}
+
+	// No simple keys after the indicators ']' and '}'.
+	parser.simple_key_allowed = false
+
+	// Consume the token.
+
+	start_mark := parser.mark
+	skip(parser)
+	end_mark := parser.mark
+
+	// Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token.
+	token := yaml_token_t{
+		typ:        typ,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+	}
+	// Append the token to the queue.
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the FLOW-ENTRY token.
+func yaml_parser_fetch_flow_entry(parser *yaml_parser_t) bool {
+	// Reset any potential simple keys on the current flow level.
+	if !yaml_parser_remove_simple_key(parser) {
+		return false
+	}
+
+	// Simple keys are allowed after ','.
+	parser.simple_key_allowed = true
+
+	// Consume the token.
+	start_mark := parser.mark
+	skip(parser)
+	end_mark := parser.mark
+
+	// Create the FLOW-ENTRY token and append it to the queue.
+	token := yaml_token_t{
+		typ:        yaml_FLOW_ENTRY_TOKEN,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the BLOCK-ENTRY token.
+func yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool {
+	// Check if the scanner is in the block context.
+	if parser.flow_level == 0 {
+		// Check if we are allowed to start a new entry.
+		if !parser.simple_key_allowed {
+			return yaml_parser_set_scanner_error(parser, "", parser.mark,
+				"block sequence entries are not allowed in this context")
+		}
+		// Add the BLOCK-SEQUENCE-START token if needed.
+		if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_SEQUENCE_START_TOKEN, parser.mark) {
+			return false
+		}
+	} else {
+		// It is an error for the '-' indicator to occur in the flow context,
+		// but we let the Parser detect and report about it because the Parser
+		// is able to point to the context.
+	}
+
+	// Reset any potential simple keys on the current flow level.
+	if !yaml_parser_remove_simple_key(parser) {
+		return false
+	}
+
+	// Simple keys are allowed after '-'.
+	parser.simple_key_allowed = true
+
+	// Consume the token.
+	start_mark := parser.mark
+	skip(parser)
+	end_mark := parser.mark
+
+	// Create the BLOCK-ENTRY token and append it to the queue.
+	token := yaml_token_t{
+		typ:        yaml_BLOCK_ENTRY_TOKEN,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the KEY token.
+func yaml_parser_fetch_key(parser *yaml_parser_t) bool {
+
+	// In the block context, additional checks are required.
+	if parser.flow_level == 0 {
+		// Check if we are allowed to start a new key (not nessesary simple).
+		if !parser.simple_key_allowed {
+			return yaml_parser_set_scanner_error(parser, "", parser.mark,
+				"mapping keys are not allowed in this context")
+		}
+		// Add the BLOCK-MAPPING-START token if needed.
+		if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) {
+			return false
+		}
+	}
+
+	// Reset any potential simple keys on the current flow level.
+	if !yaml_parser_remove_simple_key(parser) {
+		return false
+	}
+
+	// Simple keys are allowed after '?' in the block context.
+	parser.simple_key_allowed = parser.flow_level == 0
+
+	// Consume the token.
+	start_mark := parser.mark
+	skip(parser)
+	end_mark := parser.mark
+
+	// Create the KEY token and append it to the queue.
+	token := yaml_token_t{
+		typ:        yaml_KEY_TOKEN,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the VALUE token.
+func yaml_parser_fetch_value(parser *yaml_parser_t) bool {
+
+	simple_key := &parser.simple_keys[len(parser.simple_keys)-1]
+
+	// Have we found a simple key?
+	if simple_key.possible {
+		// Create the KEY token and insert it into the queue.
+		token := yaml_token_t{
+			typ:        yaml_KEY_TOKEN,
+			start_mark: simple_key.mark,
+			end_mark:   simple_key.mark,
+		}
+		yaml_insert_token(parser, simple_key.token_number-parser.tokens_parsed, &token)
+
+		// In the block context, we may need to add the BLOCK-MAPPING-START token.
+		if !yaml_parser_roll_indent(parser, simple_key.mark.column,
+			simple_key.token_number,
+			yaml_BLOCK_MAPPING_START_TOKEN, simple_key.mark) {
+			return false
+		}
+
+		// Remove the simple key.
+		simple_key.possible = false
+
+		// A simple key cannot follow another simple key.
+		parser.simple_key_allowed = false
+
+	} else {
+		// The ':' indicator follows a complex key.
+
+		// In the block context, extra checks are required.
+		if parser.flow_level == 0 {
+
+			// Check if we are allowed to start a complex value.
+			if !parser.simple_key_allowed {
+				return yaml_parser_set_scanner_error(parser, "", parser.mark,
+					"mapping values are not allowed in this context")
+			}
+
+			// Add the BLOCK-MAPPING-START token if needed.
+			if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) {
+				return false
+			}
+		}
+
+		// Simple keys after ':' are allowed in the block context.
+		parser.simple_key_allowed = parser.flow_level == 0
+	}
+
+	// Consume the token.
+	start_mark := parser.mark
+	skip(parser)
+	end_mark := parser.mark
+
+	// Create the VALUE token and append it to the queue.
+	token := yaml_token_t{
+		typ:        yaml_VALUE_TOKEN,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the ALIAS or ANCHOR token.
+func yaml_parser_fetch_anchor(parser *yaml_parser_t, typ yaml_token_type_t) bool {
+	// An anchor or an alias could be a simple key.
+	if !yaml_parser_save_simple_key(parser) {
+		return false
+	}
+
+	// A simple key cannot follow an anchor or an alias.
+	parser.simple_key_allowed = false
+
+	// Create the ALIAS or ANCHOR token and append it to the queue.
+	var token yaml_token_t
+	if !yaml_parser_scan_anchor(parser, &token, typ) {
+		return false
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the TAG token.
+func yaml_parser_fetch_tag(parser *yaml_parser_t) bool {
+	// A tag could be a simple key.
+	if !yaml_parser_save_simple_key(parser) {
+		return false
+	}
+
+	// A simple key cannot follow a tag.
+	parser.simple_key_allowed = false
+
+	// Create the TAG token and append it to the queue.
+	var token yaml_token_t
+	if !yaml_parser_scan_tag(parser, &token) {
+		return false
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens.
+func yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool) bool {
+	// Remove any potential simple keys.
+	if !yaml_parser_remove_simple_key(parser) {
+		return false
+	}
+
+	// A simple key may follow a block scalar.
+	parser.simple_key_allowed = true
+
+	// Create the SCALAR token and append it to the queue.
+	var token yaml_token_t
+	if !yaml_parser_scan_block_scalar(parser, &token, literal) {
+		return false
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens.
+func yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) bool {
+	// A plain scalar could be a simple key.
+	if !yaml_parser_save_simple_key(parser) {
+		return false
+	}
+
+	// A simple key cannot follow a flow scalar.
+	parser.simple_key_allowed = false
+
+	// Create the SCALAR token and append it to the queue.
+	var token yaml_token_t
+	if !yaml_parser_scan_flow_scalar(parser, &token, single) {
+		return false
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Produce the SCALAR(...,plain) token.
+func yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool {
+	// A plain scalar could be a simple key.
+	if !yaml_parser_save_simple_key(parser) {
+		return false
+	}
+
+	// A simple key cannot follow a flow scalar.
+	parser.simple_key_allowed = false
+
+	// Create the SCALAR token and append it to the queue.
+	var token yaml_token_t
+	if !yaml_parser_scan_plain_scalar(parser, &token) {
+		return false
+	}
+	yaml_insert_token(parser, -1, &token)
+	return true
+}
+
+// Eat whitespaces and comments until the next token is found.
+func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool {
+
+	// Until the next token is not found.
+	for {
+		// Allow the BOM mark to start a line.
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+		if parser.mark.column == 0 && is_bom(parser.buffer, parser.buffer_pos) {
+			skip(parser)
+		}
+
+		// Eat whitespaces.
+		// Tabs are allowed:
+		//  - in the flow context
+		//  - in the block context, but not at the beginning of the line or
+		//  after '-', '?', or ':' (complex value).
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+
+		for parser.buffer[parser.buffer_pos] == ' ' || ((parser.flow_level > 0 || !parser.simple_key_allowed) && parser.buffer[parser.buffer_pos] == '\t') {
+			skip(parser)
+			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+				return false
+			}
+		}
+
+		// Eat a comment until a line break.
+		if parser.buffer[parser.buffer_pos] == '#' {
+			for !is_breakz(parser.buffer, parser.buffer_pos) {
+				skip(parser)
+				if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+					return false
+				}
+			}
+		}
+
+		// If it is a line break, eat it.
+		if is_break(parser.buffer, parser.buffer_pos) {
+			if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
+				return false
+			}
+			skip_line(parser)
+
+			// In the block context, a new line may start a simple key.
+			if parser.flow_level == 0 {
+				parser.simple_key_allowed = true
+			}
+		} else {
+			break // We have found a token.
+		}
+	}
+
+	return true
+}
+
+// Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token.
+//
+// Scope:
+//      %YAML    1.1    # a comment \n
+//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//      %TAG    !yaml!  tag:yaml.org,2002:  \n
+//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//
+func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool {
+	// Eat '%'.
+	start_mark := parser.mark
+	skip(parser)
+
+	// Scan the directive name.
+	var name []byte
+	if !yaml_parser_scan_directive_name(parser, start_mark, &name) {
+		return false
+	}
+
+	// Is it a YAML directive?
+	if bytes.Equal(name, []byte("YAML")) {
+		// Scan the VERSION directive value.
+		var major, minor int8
+		if !yaml_parser_scan_version_directive_value(parser, start_mark, &major, &minor) {
+			return false
+		}
+		end_mark := parser.mark
+
+		// Create a VERSION-DIRECTIVE token.
+		*token = yaml_token_t{
+			typ:        yaml_VERSION_DIRECTIVE_TOKEN,
+			start_mark: start_mark,
+			end_mark:   end_mark,
+			major:      major,
+			minor:      minor,
+		}
+
+		// Is it a TAG directive?
+	} else if bytes.Equal(name, []byte("TAG")) {
+		// Scan the TAG directive value.
+		var handle, prefix []byte
+		if !yaml_parser_scan_tag_directive_value(parser, start_mark, &handle, &prefix) {
+			return false
+		}
+		end_mark := parser.mark
+
+		// Create a TAG-DIRECTIVE token.
+		*token = yaml_token_t{
+			typ:        yaml_TAG_DIRECTIVE_TOKEN,
+			start_mark: start_mark,
+			end_mark:   end_mark,
+			value:      handle,
+			prefix:     prefix,
+		}
+
+		// Unknown directive.
+	} else {
+		yaml_parser_set_scanner_error(parser, "while scanning a directive",
+			start_mark, "found uknown directive name")
+		return false
+	}
+
+	// Eat the rest of the line including any comments.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+
+	for is_blank(parser.buffer, parser.buffer_pos) {
+		skip(parser)
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+	}
+
+	if parser.buffer[parser.buffer_pos] == '#' {
+		for !is_breakz(parser.buffer, parser.buffer_pos) {
+			skip(parser)
+			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+				return false
+			}
+		}
+	}
+
+	// Check if we are at the end of the line.
+	if !is_breakz(parser.buffer, parser.buffer_pos) {
+		yaml_parser_set_scanner_error(parser, "while scanning a directive",
+			start_mark, "did not find expected comment or line break")
+		return false
+	}
+
+	// Eat a line break.
+	if is_break(parser.buffer, parser.buffer_pos) {
+		if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
+			return false
+		}
+		skip_line(parser)
+	}
+
+	return true
+}
+
+// Scan the directive name.
+//
+// Scope:
+//      %YAML   1.1     # a comment \n
+//       ^^^^
+//      %TAG    !yaml!  tag:yaml.org,2002:  \n
+//       ^^^
+//
+func yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark_t, name *[]byte) bool {
+	// Consume the directive name.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+
+	var s []byte
+	for is_alpha(parser.buffer, parser.buffer_pos) {
+		s = read(parser, s)
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+	}
+
+	// Check if the name is empty.
+	if len(s) == 0 {
+		yaml_parser_set_scanner_error(parser, "while scanning a directive",
+			start_mark, "could not find expected directive name")
+		return false
+	}
+
+	// Check for an blank character after the name.
+	if !is_blankz(parser.buffer, parser.buffer_pos) {
+		yaml_parser_set_scanner_error(parser, "while scanning a directive",
+			start_mark, "found unexpected non-alphabetical character")
+		return false
+	}
+	*name = s
+	return true
+}
+
+// Scan the value of VERSION-DIRECTIVE.
+//
+// Scope:
+//      %YAML   1.1     # a comment \n
+//           ^^^^^^
+func yaml_parser_scan_version_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, major, minor *int8) bool {
+	// Eat whitespaces.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+	for is_blank(parser.buffer, parser.buffer_pos) {
+		skip(parser)
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+	}
+
+	// Consume the major version number.
+	if !yaml_parser_scan_version_directive_number(parser, start_mark, major) {
+		return false
+	}
+
+	// Eat '.'.
+	if parser.buffer[parser.buffer_pos] != '.' {
+		return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive",
+			start_mark, "did not find expected digit or '.' character")
+	}
+
+	skip(parser)
+
+	// Consume the minor version number.
+	if !yaml_parser_scan_version_directive_number(parser, start_mark, minor) {
+		return false
+	}
+	return true
+}
+
+const max_number_length = 2
+
+// Scan the version number of VERSION-DIRECTIVE.
+//
+// Scope:
+//      %YAML   1.1     # a comment \n
+//              ^
+//      %YAML   1.1     # a comment \n
+//                ^
+func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark yaml_mark_t, number *int8) bool {
+
+	// Repeat while the next character is digit.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+	var value, length int8
+	for is_digit(parser.buffer, parser.buffer_pos) {
+		// Check if the number is too long.
+		length++
+		if length > max_number_length {
+			return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive",
+				start_mark, "found extremely long version number")
+		}
+		value = value*10 + int8(as_digit(parser.buffer, parser.buffer_pos))
+		skip(parser)
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+	}
+
+	// Check if the number was present.
+	if length == 0 {
+		return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive",
+			start_mark, "did not find expected version number")
+	}
+	*number = value
+	return true
+}
+
+// Scan the value of a TAG-DIRECTIVE token.
+//
+// Scope:
+//      %TAG    !yaml!  tag:yaml.org,2002:  \n
+//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//
+func yaml_parser_scan_tag_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, handle, prefix *[]byte) bool {
+	var handle_value, prefix_value []byte
+
+	// Eat whitespaces.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+
+	for is_blank(parser.buffer, parser.buffer_pos) {
+		skip(parser)
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+	}
+
+	// Scan a handle.
+	if !yaml_parser_scan_tag_handle(parser, true, start_mark, &handle_value) {
+		return false
+	}
+
+	// Expect a whitespace.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+	if !is_blank(parser.buffer, parser.buffer_pos) {
+		yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive",
+			start_mark, "did not find expected whitespace")
+		return false
+	}
+
+	// Eat whitespaces.
+	for is_blank(parser.buffer, parser.buffer_pos) {
+		skip(parser)
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+	}
+
+	// Scan a prefix.
+	if !yaml_parser_scan_tag_uri(parser, true, nil, start_mark, &prefix_value) {
+		return false
+	}
+
+	// Expect a whitespace or line break.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+	if !is_blankz(parser.buffer, parser.buffer_pos) {
+		yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive",
+			start_mark, "did not find expected whitespace or line break")
+		return false
+	}
+
+	*handle = handle_value
+	*prefix = prefix_value
+	return true
+}
+
+func yaml_parser_scan_anchor(parser *yaml_parser_t, token *yaml_token_t, typ yaml_token_type_t) bool {
+	var s []byte
+
+	// Eat the indicator character.
+	start_mark := parser.mark
+	skip(parser)
+
+	// Consume the value.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+
+	for is_alpha(parser.buffer, parser.buffer_pos) {
+		s = read(parser, s)
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+	}
+
+	end_mark := parser.mark
+
+	/*
+	 * Check if length of the anchor is greater than 0 and it is followed by
+	 * a whitespace character or one of the indicators:
+	 *
+	 *      '?', ':', ',', ']', '}', '%', '@', '`'.
+	 */
+
+	if len(s) == 0 ||
+		!(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '?' ||
+			parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == ',' ||
+			parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '}' ||
+			parser.buffer[parser.buffer_pos] == '%' || parser.buffer[parser.buffer_pos] == '@' ||
+			parser.buffer[parser.buffer_pos] == '`') {
+		context := "while scanning an alias"
+		if typ == yaml_ANCHOR_TOKEN {
+			context = "while scanning an anchor"
+		}
+		yaml_parser_set_scanner_error(parser, context, start_mark,
+			"did not find expected alphabetic or numeric character")
+		return false
+	}
+
+	// Create a token.
+	*token = yaml_token_t{
+		typ:        typ,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+		value:      s,
+	}
+
+	return true
+}
+
+/*
+ * Scan a TAG token.
+ */
+
+func yaml_parser_scan_tag(parser *yaml_parser_t, token *yaml_token_t) bool {
+	var handle, suffix []byte
+
+	start_mark := parser.mark
+
+	// Check if the tag is in the canonical form.
+	if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
+		return false
+	}
+
+	if parser.buffer[parser.buffer_pos+1] == '<' {
+		// Keep the handle as ''
+
+		// Eat '!<'
+		skip(parser)
+		skip(parser)
+
+		// Consume the tag value.
+		if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) {
+			return false
+		}
+
+		// Check for '>' and eat it.
+		if parser.buffer[parser.buffer_pos] != '>' {
+			yaml_parser_set_scanner_error(parser, "while scanning a tag",
+				start_mark, "did not find the expected '>'")
+			return false
+		}
+
+		skip(parser)
+	} else {
+		// The tag has either the '!suffix' or the '!handle!suffix' form.
+
+		// First, try to scan a handle.
+		if !yaml_parser_scan_tag_handle(parser, false, start_mark, &handle) {
+			return false
+		}
+
+		// Check if it is, indeed, handle.
+		if handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' {
+			// Scan the suffix now.
+			if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) {
+				return false
+			}
+		} else {
+			// It wasn't a handle after all.  Scan the rest of the tag.
+			if !yaml_parser_scan_tag_uri(parser, false, handle, start_mark, &suffix) {
+				return false
+			}
+
+			// Set the handle to '!'.
+			handle = []byte{'!'}
+
+			// A special case: the '!' tag.  Set the handle to '' and the
+			// suffix to '!'.
+			if len(suffix) == 0 {
+				handle, suffix = suffix, handle
+			}
+		}
+	}
+
+	// Check the character which ends the tag.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+	if !is_blankz(parser.buffer, parser.buffer_pos) {
+		yaml_parser_set_scanner_error(parser, "while scanning a tag",
+			start_mark, "did not find expected whitespace or line break")
+		return false
+	}
+
+	end_mark := parser.mark
+
+	// Create a token.
+	*token = yaml_token_t{
+		typ:        yaml_TAG_TOKEN,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+		value:      handle,
+		suffix:     suffix,
+	}
+	return true
+}
+
+// Scan a tag handle.
+func yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, handle *[]byte) bool {
+	// Check the initial '!' character.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+	if parser.buffer[parser.buffer_pos] != '!' {
+		yaml_parser_set_scanner_tag_error(parser, directive,
+			start_mark, "did not find expected '!'")
+		return false
+	}
+
+	var s []byte
+
+	// Copy the '!' character.
+	s = read(parser, s)
+
+	// Copy all subsequent alphabetical and numerical characters.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+	for is_alpha(parser.buffer, parser.buffer_pos) {
+		s = read(parser, s)
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+	}
+
+	// Check if the trailing character is '!' and copy it.
+	if parser.buffer[parser.buffer_pos] == '!' {
+		s = read(parser, s)
+	} else {
+		// It's either the '!' tag or not really a tag handle.  If it's a %TAG
+		// directive, it's an error.  If it's a tag token, it must be a part of URI.
+		if directive && !(s[0] == '!' && s[1] == 0) {
+			yaml_parser_set_scanner_tag_error(parser, directive,
+				start_mark, "did not find expected '!'")
+			return false
+		}
+	}
+
+	*handle = s
+	return true
+}
+
+// Scan a tag.
+func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte, start_mark yaml_mark_t, uri *[]byte) bool {
+	//size_t length = head ? strlen((char *)head) : 0
+	var s []byte
+
+	// Copy the head if needed.
+	//
+	// Note that we don't copy the leading '!' character.
+	if len(head) > 1 {
+		s = append(s, head[1:]...)
+	}
+
+	// Scan the tag.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+
+	// The set of characters that may appear in URI is as follows:
+	//
+	//      '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&',
+	//      '=', '+', '$', ',', '.', '!', '~', '*', '\'', '(', ')', '[', ']',
+	//      '%'.
+	// [Go] Convert this into more reasonable logic.
+	for is_alpha(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == ';' ||
+		parser.buffer[parser.buffer_pos] == '/' || parser.buffer[parser.buffer_pos] == '?' ||
+		parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == '@' ||
+		parser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '=' ||
+		parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '$' ||
+		parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '.' ||
+		parser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '~' ||
+		parser.buffer[parser.buffer_pos] == '*' || parser.buffer[parser.buffer_pos] == '\'' ||
+		parser.buffer[parser.buffer_pos] == '(' || parser.buffer[parser.buffer_pos] == ')' ||
+		parser.buffer[parser.buffer_pos] == '[' || parser.buffer[parser.buffer_pos] == ']' ||
+		parser.buffer[parser.buffer_pos] == '%' {
+		// Check if it is a URI-escape sequence.
+		if parser.buffer[parser.buffer_pos] == '%' {
+			if !yaml_parser_scan_uri_escapes(parser, directive, start_mark, &s) {
+				return false
+			}
+		} else {
+			s = read(parser, s)
+		}
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+	}
+
+	// Check if the tag is non-empty.
+	if len(s) == 0 {
+		yaml_parser_set_scanner_tag_error(parser, directive,
+			start_mark, "did not find expected tag URI")
+		return false
+	}
+	*uri = s
+	return true
+}
+
+// Decode an URI-escape sequence corresponding to a single UTF-8 character.
+func yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, s *[]byte) bool {
+
+	// Decode the required number of characters.
+	w := 1024
+	for w > 0 {
+		// Check for a URI-escaped octet.
+		if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) {
+			return false
+		}
+
+		if !(parser.buffer[parser.buffer_pos] == '%' &&
+			is_hex(parser.buffer, parser.buffer_pos+1) &&
+			is_hex(parser.buffer, parser.buffer_pos+2)) {
+			return yaml_parser_set_scanner_tag_error(parser, directive,
+				start_mark, "did not find URI escaped octet")
+		}
+
+		// Get the octet.
+		octet := byte((as_hex(parser.buffer, parser.buffer_pos+1) << 4) + as_hex(parser.buffer, parser.buffer_pos+2))
+
+		// If it is the leading octet, determine the length of the UTF-8 sequence.
+		if w == 1024 {
+			w = width(octet)
+			if w == 0 {
+				return yaml_parser_set_scanner_tag_error(parser, directive,
+					start_mark, "found an incorrect leading UTF-8 octet")
+			}
+		} else {
+			// Check if the trailing octet is correct.
+			if octet&0xC0 != 0x80 {
+				return yaml_parser_set_scanner_tag_error(parser, directive,
+					start_mark, "found an incorrect trailing UTF-8 octet")
+			}
+		}
+
+		// Copy the octet and move the pointers.
+		*s = append(*s, octet)
+		skip(parser)
+		skip(parser)
+		skip(parser)
+		w--
+	}
+	return true
+}
+
+// Scan a block scalar.
+func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, literal bool) bool {
+	// Eat the indicator '|' or '>'.
+	start_mark := parser.mark
+	skip(parser)
+
+	// Scan the additional block scalar indicators.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+
+	// Check for a chomping indicator.
+	var chomping, increment int
+	if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' {
+		// Set the chomping method and eat the indicator.
+		if parser.buffer[parser.buffer_pos] == '+' {
+			chomping = +1
+		} else {
+			chomping = -1
+		}
+		skip(parser)
+
+		// Check for an indentation indicator.
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+		if is_digit(parser.buffer, parser.buffer_pos) {
+			// Check that the intendation is greater than 0.
+			if parser.buffer[parser.buffer_pos] == '0' {
+				yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
+					start_mark, "found an intendation indicator equal to 0")
+				return false
+			}
+
+			// Get the intendation level and eat the indicator.
+			increment = as_digit(parser.buffer, parser.buffer_pos)
+			skip(parser)
+		}
+
+	} else if is_digit(parser.buffer, parser.buffer_pos) {
+		// Do the same as above, but in the opposite order.
+
+		if parser.buffer[parser.buffer_pos] == '0' {
+			yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
+				start_mark, "found an intendation indicator equal to 0")
+			return false
+		}
+		increment = as_digit(parser.buffer, parser.buffer_pos)
+		skip(parser)
+
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+		if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' {
+			if parser.buffer[parser.buffer_pos] == '+' {
+				chomping = +1
+			} else {
+				chomping = -1
+			}
+			skip(parser)
+		}
+	}
+
+	// Eat whitespaces and comments to the end of the line.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+	for is_blank(parser.buffer, parser.buffer_pos) {
+		skip(parser)
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+	}
+	if parser.buffer[parser.buffer_pos] == '#' {
+		for !is_breakz(parser.buffer, parser.buffer_pos) {
+			skip(parser)
+			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+				return false
+			}
+		}
+	}
+
+	// Check if we are at the end of the line.
+	if !is_breakz(parser.buffer, parser.buffer_pos) {
+		yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
+			start_mark, "did not find expected comment or line break")
+		return false
+	}
+
+	// Eat a line break.
+	if is_break(parser.buffer, parser.buffer_pos) {
+		if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
+			return false
+		}
+		skip_line(parser)
+	}
+
+	end_mark := parser.mark
+
+	// Set the intendation level if it was specified.
+	var indent int
+	if increment > 0 {
+		if parser.indent >= 0 {
+			indent = parser.indent + increment
+		} else {
+			indent = increment
+		}
+	}
+
+	// Scan the leading line breaks and determine the indentation level if needed.
+	var s, leading_break, trailing_breaks []byte
+	if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) {
+		return false
+	}
+
+	// Scan the block scalar content.
+	if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+		return false
+	}
+	var leading_blank, trailing_blank bool
+	for parser.mark.column == indent && !is_z(parser.buffer, parser.buffer_pos) {
+		// We are at the beginning of a non-empty line.
+
+		// Is it a trailing whitespace?
+		trailing_blank = is_blank(parser.buffer, parser.buffer_pos)
+
+		// Check if we need to fold the leading line break.
+		if !literal && !leading_blank && !trailing_blank && len(leading_break) > 0 && leading_break[0] == '\n' {
+			// Do we need to join the lines by space?
+			if len(trailing_breaks) == 0 {
+				s = append(s, ' ')
+			}
+		} else {
+			s = append(s, leading_break...)
+		}
+		leading_break = leading_break[:0]
+
+		// Append the remaining line breaks.
+		s = append(s, trailing_breaks...)
+		trailing_breaks = trailing_breaks[:0]
+
+		// Is it a leading whitespace?
+		leading_blank = is_blank(parser.buffer, parser.buffer_pos)
+
+		// Consume the current line.
+		for !is_breakz(parser.buffer, parser.buffer_pos) {
+			s = read(parser, s)
+			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+				return false
+			}
+		}
+
+		// Consume the line break.
+		if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
+			return false
+		}
+
+		leading_break = read_line(parser, leading_break)
+
+		// Eat the following intendation spaces and line breaks.
+		if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) {
+			return false
+		}
+	}
+
+	// Chomp the tail.
+	if chomping != -1 {
+		s = append(s, leading_break...)
+	}
+	if chomping == 1 {
+		s = append(s, trailing_breaks...)
+	}
+
+	// Create a token.
+	*token = yaml_token_t{
+		typ:        yaml_SCALAR_TOKEN,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+		value:      s,
+		style:      yaml_LITERAL_SCALAR_STYLE,
+	}
+	if !literal {
+		token.style = yaml_FOLDED_SCALAR_STYLE
+	}
+	return true
+}
+
+// Scan intendation spaces and line breaks for a block scalar.  Determine the
+// intendation level if needed.
+func yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, indent *int, breaks *[]byte, start_mark yaml_mark_t, end_mark *yaml_mark_t) bool {
+	*end_mark = parser.mark
+
+	// Eat the intendation spaces and line breaks.
+	max_indent := 0
+	for {
+		// Eat the intendation spaces.
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+		for (*indent == 0 || parser.mark.column < *indent) && is_space(parser.buffer, parser.buffer_pos) {
+			skip(parser)
+			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+				return false
+			}
+		}
+		if parser.mark.column > max_indent {
+			max_indent = parser.mark.column
+		}
+
+		// Check for a tab character messing the intendation.
+		if (*indent == 0 || parser.mark.column < *indent) && is_tab(parser.buffer, parser.buffer_pos) {
+			return yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
+				start_mark, "found a tab character where an intendation space is expected")
+		}
+
+		// Have we found a non-empty line?
+		if !is_break(parser.buffer, parser.buffer_pos) {
+			break
+		}
+
+		// Consume the line break.
+		if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
+			return false
+		}
+		// [Go] Should really be returning breaks instead.
+		*breaks = read_line(parser, *breaks)
+		*end_mark = parser.mark
+	}
+
+	// Determine the indentation level if needed.
+	if *indent == 0 {
+		*indent = max_indent
+		if *indent < parser.indent+1 {
+			*indent = parser.indent + 1
+		}
+		if *indent < 1 {
+			*indent = 1
+		}
+	}
+	return true
+}
+
+// Scan a quoted scalar.
+func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, single bool) bool {
+	// Eat the left quote.
+	start_mark := parser.mark
+	skip(parser)
+
+	// Consume the content of the quoted scalar.
+	var s, leading_break, trailing_breaks, whitespaces []byte
+	for {
+		// Check that there are no document indicators at the beginning of the line.
+		if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {
+			return false
+		}
+
+		if parser.mark.column == 0 &&
+			((parser.buffer[parser.buffer_pos+0] == '-' &&
+				parser.buffer[parser.buffer_pos+1] == '-' &&
+				parser.buffer[parser.buffer_pos+2] == '-') ||
+				(parser.buffer[parser.buffer_pos+0] == '.' &&
+					parser.buffer[parser.buffer_pos+1] == '.' &&
+					parser.buffer[parser.buffer_pos+2] == '.')) &&
+			is_blankz(parser.buffer, parser.buffer_pos+3) {
+			yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar",
+				start_mark, "found unexpected document indicator")
+			return false
+		}
+
+		// Check for EOF.
+		if is_z(parser.buffer, parser.buffer_pos) {
+			yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar",
+				start_mark, "found unexpected end of stream")
+			return false
+		}
+
+		// Consume non-blank characters.
+		leading_blanks := false
+		for !is_blankz(parser.buffer, parser.buffer_pos) {
+			if single && parser.buffer[parser.buffer_pos] == '\'' && parser.buffer[parser.buffer_pos+1] == '\'' {
+				// Is is an escaped single quote.
+				s = append(s, '\'')
+				skip(parser)
+				skip(parser)
+
+			} else if single && parser.buffer[parser.buffer_pos] == '\'' {
+				// It is a right single quote.
+				break
+			} else if !single && parser.buffer[parser.buffer_pos] == '"' {
+				// It is a right double quote.
+				break
+
+			} else if !single && parser.buffer[parser.buffer_pos] == '\\' && is_break(parser.buffer, parser.buffer_pos+1) {
+				// It is an escaped line break.
+				if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) {
+					return false
+				}
+				skip(parser)
+				skip_line(parser)
+				leading_blanks = true
+				break
+
+			} else if !single && parser.buffer[parser.buffer_pos] == '\\' {
+				// It is an escape sequence.
+				code_length := 0
+
+				// Check the escape character.
+				switch parser.buffer[parser.buffer_pos+1] {
+				case '0':
+					s = append(s, 0)
+				case 'a':
+					s = append(s, '\x07')
+				case 'b':
+					s = append(s, '\x08')
+				case 't', '\t':
+					s = append(s, '\x09')
+				case 'n':
+					s = append(s, '\x0A')
+				case 'v':
+					s = append(s, '\x0B')
+				case 'f':
+					s = append(s, '\x0C')
+				case 'r':
+					s = append(s, '\x0D')
+				case 'e':
+					s = append(s, '\x1B')
+				case ' ':
+					s = append(s, '\x20')
+				case '"':
+					s = append(s, '"')
+				case '\'':
+					s = append(s, '\'')
+				case '\\':
+					s = append(s, '\\')
+				case 'N': // NEL (#x85)
+					s = append(s, '\xC2')
+					s = append(s, '\x85')
+				case '_': // #xA0
+					s = append(s, '\xC2')
+					s = append(s, '\xA0')
+				case 'L': // LS (#x2028)
+					s = append(s, '\xE2')
+					s = append(s, '\x80')
+					s = append(s, '\xA8')
+				case 'P': // PS (#x2029)
+					s = append(s, '\xE2')
+					s = append(s, '\x80')
+					s = append(s, '\xA9')
+				case 'x':
+					code_length = 2
+				case 'u':
+					code_length = 4
+				case 'U':
+					code_length = 8
+				default:
+					yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar",
+						start_mark, "found unknown escape character")
+					return false
+				}
+
+				skip(parser)
+				skip(parser)
+
+				// Consume an arbitrary escape code.
+				if code_length > 0 {
+					var value int
+
+					// Scan the character value.
+					if parser.unread < code_length && !yaml_parser_update_buffer(parser, code_length) {
+						return false
+					}
+					for k := 0; k < code_length; k++ {
+						if !is_hex(parser.buffer, parser.buffer_pos+k) {
+							yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar",
+								start_mark, "did not find expected hexdecimal number")
+							return false
+						}
+						value = (value << 4) + as_hex(parser.buffer, parser.buffer_pos+k)
+					}
+
+					// Check the value and write the character.
+					if (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF {
+						yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar",
+							start_mark, "found invalid Unicode character escape code")
+						return false
+					}
+					if value <= 0x7F {
+						s = append(s, byte(value))
+					} else if value <= 0x7FF {
+						s = append(s, byte(0xC0+(value>>6)))
+						s = append(s, byte(0x80+(value&0x3F)))
+					} else if value <= 0xFFFF {
+						s = append(s, byte(0xE0+(value>>12)))
+						s = append(s, byte(0x80+((value>>6)&0x3F)))
+						s = append(s, byte(0x80+(value&0x3F)))
+					} else {
+						s = append(s, byte(0xF0+(value>>18)))
+						s = append(s, byte(0x80+((value>>12)&0x3F)))
+						s = append(s, byte(0x80+((value>>6)&0x3F)))
+						s = append(s, byte(0x80+(value&0x3F)))
+					}
+
+					// Advance the pointer.
+					for k := 0; k < code_length; k++ {
+						skip(parser)
+					}
+				}
+			} else {
+				// It is a non-escaped non-blank character.
+				s = read(parser, s)
+			}
+			if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
+				return false
+			}
+		}
+
+		// Check if we are at the end of the scalar.
+		if single {
+			if parser.buffer[parser.buffer_pos] == '\'' {
+				break
+			}
+		} else {
+			if parser.buffer[parser.buffer_pos] == '"' {
+				break
+			}
+		}
+
+		// Consume blank characters.
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+
+		for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) {
+			if is_blank(parser.buffer, parser.buffer_pos) {
+				// Consume a space or a tab character.
+				if !leading_blanks {
+					whitespaces = read(parser, whitespaces)
+				} else {
+					skip(parser)
+				}
+			} else {
+				if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
+					return false
+				}
+
+				// Check if it is a first line break.
+				if !leading_blanks {
+					whitespaces = whitespaces[:0]
+					leading_break = read_line(parser, leading_break)
+					leading_blanks = true
+				} else {
+					trailing_breaks = read_line(parser, trailing_breaks)
+				}
+			}
+			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+				return false
+			}
+		}
+
+		// Join the whitespaces or fold line breaks.
+		if leading_blanks {
+			// Do we need to fold line breaks?
+			if len(leading_break) > 0 && leading_break[0] == '\n' {
+				if len(trailing_breaks) == 0 {
+					s = append(s, ' ')
+				} else {
+					s = append(s, trailing_breaks...)
+				}
+			} else {
+				s = append(s, leading_break...)
+				s = append(s, trailing_breaks...)
+			}
+			trailing_breaks = trailing_breaks[:0]
+			leading_break = leading_break[:0]
+		} else {
+			s = append(s, whitespaces...)
+			whitespaces = whitespaces[:0]
+		}
+	}
+
+	// Eat the right quote.
+	skip(parser)
+	end_mark := parser.mark
+
+	// Create a token.
+	*token = yaml_token_t{
+		typ:        yaml_SCALAR_TOKEN,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+		value:      s,
+		style:      yaml_SINGLE_QUOTED_SCALAR_STYLE,
+	}
+	if !single {
+		token.style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
+	}
+	return true
+}
+
+// Scan a plain scalar.
+func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) bool {
+
+	var s, leading_break, trailing_breaks, whitespaces []byte
+	var leading_blanks bool
+	var indent = parser.indent + 1
+
+	start_mark := parser.mark
+	end_mark := parser.mark
+
+	// Consume the content of the plain scalar.
+	for {
+		// Check for a document indicator.
+		if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {
+			return false
+		}
+		if parser.mark.column == 0 &&
+			((parser.buffer[parser.buffer_pos+0] == '-' &&
+				parser.buffer[parser.buffer_pos+1] == '-' &&
+				parser.buffer[parser.buffer_pos+2] == '-') ||
+				(parser.buffer[parser.buffer_pos+0] == '.' &&
+					parser.buffer[parser.buffer_pos+1] == '.' &&
+					parser.buffer[parser.buffer_pos+2] == '.')) &&
+			is_blankz(parser.buffer, parser.buffer_pos+3) {
+			break
+		}
+
+		// Check for a comment.
+		if parser.buffer[parser.buffer_pos] == '#' {
+			break
+		}
+
+		// Consume non-blank characters.
+		for !is_blankz(parser.buffer, parser.buffer_pos) {
+
+			// Check for 'x:x' in the flow context. TODO: Fix the test "spec-08-13".
+			if parser.flow_level > 0 &&
+				parser.buffer[parser.buffer_pos] == ':' &&
+				!is_blankz(parser.buffer, parser.buffer_pos+1) {
+				yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
+					start_mark, "found unexpected ':'")
+				return false
+			}
+
+			// Check for indicators that may end a plain scalar.
+			if (parser.buffer[parser.buffer_pos] == ':' && is_blankz(parser.buffer, parser.buffer_pos+1)) ||
+				(parser.flow_level > 0 &&
+					(parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == ':' ||
+						parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == '[' ||
+						parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' ||
+						parser.buffer[parser.buffer_pos] == '}')) {
+				break
+			}
+
+			// Check if we need to join whitespaces and breaks.
+			if leading_blanks || len(whitespaces) > 0 {
+				if leading_blanks {
+					// Do we need to fold line breaks?
+					if leading_break[0] == '\n' {
+						if len(trailing_breaks) == 0 {
+							s = append(s, ' ')
+						} else {
+							s = append(s, trailing_breaks...)
+						}
+					} else {
+						s = append(s, leading_break...)
+						s = append(s, trailing_breaks...)
+					}
+					trailing_breaks = trailing_breaks[:0]
+					leading_break = leading_break[:0]
+					leading_blanks = false
+				} else {
+					s = append(s, whitespaces...)
+					whitespaces = whitespaces[:0]
+				}
+			}
+
+			// Copy the character.
+			s = read(parser, s)
+
+			end_mark = parser.mark
+			if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
+				return false
+			}
+		}
+
+		// Is it the end?
+		if !(is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos)) {
+			break
+		}
+
+		// Consume blank characters.
+		if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+			return false
+		}
+
+		for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) {
+			if is_blank(parser.buffer, parser.buffer_pos) {
+
+				// Check for tab character that abuse intendation.
+				if leading_blanks && parser.mark.column < indent && is_tab(parser.buffer, parser.buffer_pos) {
+					yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
+						start_mark, "found a tab character that violate intendation")
+					return false
+				}
+
+				// Consume a space or a tab character.
+				if !leading_blanks {
+					whitespaces = read(parser, whitespaces)
+				} else {
+					skip(parser)
+				}
+			} else {
+				if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {
+					return false
+				}
+
+				// Check if it is a first line break.
+				if !leading_blanks {
+					whitespaces = whitespaces[:0]
+					leading_break = read_line(parser, leading_break)
+					leading_blanks = true
+				} else {
+					trailing_breaks = read_line(parser, trailing_breaks)
+				}
+			}
+			if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
+				return false
+			}
+		}
+
+		// Check intendation level.
+		if parser.flow_level == 0 && parser.mark.column < indent {
+			break
+		}
+	}
+
+	// Create a token.
+	*token = yaml_token_t{
+		typ:        yaml_SCALAR_TOKEN,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+		value:      s,
+		style:      yaml_PLAIN_SCALAR_STYLE,
+	}
+
+	// Note that we change the 'simple_key_allowed' flag.
+	if leading_blanks {
+		parser.simple_key_allowed = true
+	}
+	return true
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/sorter.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/sorter.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/sorter.go
new file mode 100644
index 0000000..5958822
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/sorter.go
@@ -0,0 +1,104 @@
+package yaml
+
+import (
+	"reflect"
+	"unicode"
+)
+
+type keyList []reflect.Value
+
+func (l keyList) Len() int      { return len(l) }
+func (l keyList) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
+func (l keyList) Less(i, j int) bool {
+	a := l[i]
+	b := l[j]
+	ak := a.Kind()
+	bk := b.Kind()
+	for (ak == reflect.Interface || ak == reflect.Ptr) && !a.IsNil() {
+		a = a.Elem()
+		ak = a.Kind()
+	}
+	for (bk == reflect.Interface || bk == reflect.Ptr) && !b.IsNil() {
+		b = b.Elem()
+		bk = b.Kind()
+	}
+	af, aok := keyFloat(a)
+	bf, bok := keyFloat(b)
+	if aok && bok {
+		if af != bf {
+			return af < bf
+		}
+		if ak != bk {
+			return ak < bk
+		}
+		return numLess(a, b)
+	}
+	if ak != reflect.String || bk != reflect.String {
+		return ak < bk
+	}
+	ar, br := []rune(a.String()), []rune(b.String())
+	for i := 0; i < len(ar) && i < len(br); i++ {
+		if ar[i] == br[i] {
+			continue
+		}
+		al := unicode.IsLetter(ar[i])
+		bl := unicode.IsLetter(br[i])
+		if al && bl {
+			return ar[i] < br[i]
+		}
+		if al || bl {
+			return bl
+		}
+		var ai, bi int
+		var an, bn int64
+		for ai = i; ai < len(ar) && unicode.IsDigit(ar[ai]); ai++ {
+			an = an*10 + int64(ar[ai]-'0')
+		}
+		for bi = i; bi < len(br) && unicode.IsDigit(br[bi]); bi++ {
+			bn = bn*10 + int64(br[bi]-'0')
+		}
+		if an != bn {
+			return an < bn
+		}
+		if ai != bi {
+			return ai < bi
+		}
+		return ar[i] < br[i]
+	}
+	return len(ar) < len(br)
+}
+
+// keyFloat returns a float value for v if it is a number/bool
+// and whether it is a number/bool or not.
+func keyFloat(v reflect.Value) (f float64, ok bool) {
+	switch v.Kind() {
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		return float64(v.Int()), true
+	case reflect.Float32, reflect.Float64:
+		return v.Float(), true
+	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+		return float64(v.Uint()), true
+	case reflect.Bool:
+		if v.Bool() {
+			return 1, true
+		}
+		return 0, true
+	}
+	return 0, false
+}
+
+// numLess returns whether a < b.
+// a and b must necessarily have the same kind.
+func numLess(a, b reflect.Value) bool {
+	switch a.Kind() {
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		return a.Int() < b.Int()
+	case reflect.Float32, reflect.Float64:
+		return a.Float() < b.Float()
+	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+		return a.Uint() < b.Uint()
+	case reflect.Bool:
+		return !a.Bool() && b.Bool()
+	}
+	panic("not a number")
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/suite_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/suite_test.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/suite_test.go
new file mode 100644
index 0000000..c5cf1ed
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/suite_test.go
@@ -0,0 +1,12 @@
+package yaml_test
+
+import (
+	. "gopkg.in/check.v1"
+	"testing"
+)
+
+func Test(t *testing.T) { TestingT(t) }
+
+type S struct{}
+
+var _ = Suite(&S{})

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/writerc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/writerc.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/writerc.go
new file mode 100644
index 0000000..190362f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/writerc.go
@@ -0,0 +1,89 @@
+package yaml
+
+// Set the writer error and return false.
+func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool {
+	emitter.error = yaml_WRITER_ERROR
+	emitter.problem = problem
+	return false
+}
+
+// Flush the output buffer.
+func yaml_emitter_flush(emitter *yaml_emitter_t) bool {
+	if emitter.write_handler == nil {
+		panic("write handler not set")
+	}
+
+	// Check if the buffer is empty.
+	if emitter.buffer_pos == 0 {
+		return true
+	}
+
+	// If the output encoding is UTF-8, we don't need to recode the buffer.
+	if emitter.encoding == yaml_UTF8_ENCODING {
+		if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil {
+			return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error())
+		}
+		emitter.buffer_pos = 0
+		return true
+	}
+
+	// Recode the buffer into the raw buffer.
+	var low, high int
+	if emitter.encoding == yaml_UTF16LE_ENCODING {
+		low, high = 0, 1
+	} else {
+		high, low = 1, 0
+	}
+
+	pos := 0
+	for pos < emitter.buffer_pos {
+		// See the "reader.c" code for more details on UTF-8 encoding.  Note
+		// that we assume that the buffer contains a valid UTF-8 sequence.
+
+		// Read the next UTF-8 character.
+		octet := emitter.buffer[pos]
+
+		var w int
+		var value rune
+		switch {
+		case octet&0x80 == 0x00:
+			w, value = 1, rune(octet&0x7F)
+		case octet&0xE0 == 0xC0:
+			w, value = 2, rune(octet&0x1F)
+		case octet&0xF0 == 0xE0:
+			w, value = 3, rune(octet&0x0F)
+		case octet&0xF8 == 0xF0:
+			w, value = 4, rune(octet&0x07)
+		}
+		for k := 1; k < w; k++ {
+			octet = emitter.buffer[pos+k]
+			value = (value << 6) + (rune(octet) & 0x3F)
+		}
+		pos += w
+
+		// Write the character.
+		if value < 0x10000 {
+			var b [2]byte
+			b[high] = byte(value >> 8)
+			b[low] = byte(value & 0xFF)
+			emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1])
+		} else {
+			// Write the character using a surrogate pair (check "reader.c").
+			var b [4]byte
+			value -= 0x10000
+			b[high] = byte(0xD8 + (value >> 18))
+			b[low] = byte((value >> 10) & 0xFF)
+			b[high+2] = byte(0xDC + ((value >> 8) & 0xFF))
+			b[low+2] = byte(value & 0xFF)
+			emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3])
+		}
+	}
+
+	// Write the raw buffer.
+	if err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil {
+		return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error())
+	}
+	emitter.buffer_pos = 0
+	emitter.raw_buffer = emitter.raw_buffer[:0]
+	return true
+}


[22/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/target.go
----------------------------------------------------------------------
diff --git a/cli/target.go b/cli/target.go
deleted file mode 100644
index 789c0d6..0000000
--- a/cli/target.go
+++ /dev/null
@@ -1,806 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cli
-
-import (
-	"bufio"
-	"fmt"
-	"log"
-	"os"
-	"path/filepath"
-	"sort"
-	"strconv"
-	"strings"
-)
-
-const TARGET_SECT_PREFIX = "_target_"
-
-type Target struct {
-	Vars map[string]string
-
-	Identities map[string]string
-
-	Capabilities []string
-
-	Dependencies []string
-
-	Cflags string
-	Lflags string
-	Aflags string
-
-	Name string
-
-	Arch string
-	Cdef string
-
-	Bsp string
-
-	Nest *Nest
-}
-
-// Check if the target specified by name exists for the Nest specified by
-// r
-func TargetExists(nest *Nest, name string) bool {
-	_, err := nest.GetConfig(TARGET_SECT_PREFIX+name, "name")
-	if err == nil {
-		return true
-	} else {
-		return false
-	}
-}
-
-func parseTargetStringSlice(str string) ([]string, error) {
-	slice := strings.Split(str, " ")
-	return slice, nil
-}
-
-func (t *Target) SetDefaults() error {
-	var err error
-
-	t.Name = t.Vars["name"]
-
-	// Must have an architecture set, default to sim.
-	if t.Vars["arch"] == "" {
-		t.Vars["arch"] = "sim"
-		t.Arch = "sim"
-	} else {
-		t.Arch = t.Vars["arch"]
-	}
-
-	t.Cdef = t.Vars["compiler_def"]
-	if t.Cdef == "" {
-		t.Cdef = "default"
-	}
-
-	t.Bsp = t.Vars["bsp"]
-	t.Cflags = t.Vars["cflags"]
-	t.Lflags = t.Vars["lflags"]
-
-	identities, err := parseTargetStringSlice(t.Vars["identities"])
-	if err != nil {
-		return err
-	}
-	t.Identities = map[string]string{}
-	for _, ident := range identities {
-	StatusMessage(VERBOSITY_VERBOSE, "  set default ident %s\n", ident)
-		t.Identities[ident] = t.Name
-	}
-	t.Capabilities, err = parseTargetStringSlice(t.Vars["capabilities"])
-	if err != nil {
-		return err
-	}
-
-	t.Dependencies, err = parseTargetStringSlice(t.Vars["dependencies"])
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (t *Target) HasIdentity(identity string) bool {
-	for cur, _ := range t.Identities {
-		if cur == identity {
-			return true
-		}
-	}
-
-	return false
-}
-
-// Load the target specified by name for the repository specified by r
-func LoadTarget(nest *Nest, name string) (*Target, error) {
-	t := &Target{
-		Nest: nest,
-	}
-
-	var err error
-
-	t.Vars, err = nest.GetConfigSect(TARGET_SECT_PREFIX + name)
-	if err != nil {
-		return nil, err
-	}
-
-	// Cannot have both a project and package set
-	err = t.SetDefaults()
-	if err != nil {
-		return nil, err
-	}
-
-	return t, nil
-}
-
-// Export a target, or all targets.  If exportAll is true, then all targets are exported, if false,
-// then only the target represented by targetName is exported
-func ExportTargets(nest *Nest, name string, exportAll bool, fp *os.File) error {
-	targets, err := GetTargets(nest)
-	if err != nil {
-		return err
-	}
-
-	for _, target := range targets {
-		log.Printf("[DEBUG] Exporting target %s", target.Name)
-
-		if !exportAll && target.Name != name {
-			continue
-		}
-
-		fmt.Fprintf(fp, "@target=%s\n", target.Name)
-
-		for k, v := range target.GetVars() {
-			fmt.Fprintf(fp, "%s=%s\n", k, v)
-		}
-	}
-	fmt.Fprintf(fp, "@endtargets\n")
-
-	return nil
-}
-
-func ImportTargets(nest *Nest, name string, importAll bool, fp *os.File) error {
-	s := bufio.NewScanner(fp)
-
-	var currentTarget *Target = nil
-
-	targets := make([]*Target, 0, 10)
-
-	if importAll {
-		StatusMessage(VERBOSITY_VERBOSE, "Importing all targets from %s",
-			fp.Name())
-	} else {
-		StatusMessage(VERBOSITY_VERBOSE, "Importing target %s from %s",
-			name, fp.Name())
-	}
-
-	for s.Scan() {
-		line := s.Text()
-
-		// scan lines
-		// lines defining a target start with @
-		if idx := strings.Index(line, "@"); idx == 0 {
-			// save existing target if it exists
-			if currentTarget != nil {
-				targets = append(targets, currentTarget)
-				currentTarget = nil
-			}
-
-			// look either for an end of target definitions, or a new target definition
-			if line == "@endtargets" {
-				break
-			} else {
-				elements := strings.SplitN(line, "=", 2)
-				// name is elements[0], and value is elements[1]
-
-				if importAll || elements[1] == name {
-					// create a current target
-					currentTarget = &Target{
-						Nest: nest,
-					}
-
-					var err error
-					currentTarget.Vars = map[string]string{}
-					if err != nil {
-						return err
-					}
-
-					currentTarget.Vars["name"] = elements[1]
-				}
-			}
-		} else {
-			if currentTarget != nil {
-				// target variables, set these on the current target
-				elements := strings.SplitN(line, "=", 2)
-				currentTarget.Vars[elements[0]] = elements[1]
-			}
-		}
-	}
-
-	if err := s.Err(); err != nil {
-		return err
-	}
-
-	for _, target := range targets {
-		if err := target.SetDefaults(); err != nil {
-			return err
-		}
-
-		if err := target.Save(); err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-// Get a list of targets for the repository specified by r
-func GetTargets(nest *Nest) ([]*Target, error) {
-	targets := []*Target{}
-	for sect, _ := range nest.Config {
-		if strings.HasPrefix(sect, TARGET_SECT_PREFIX) {
-			target, err := LoadTarget(nest, sect[len(TARGET_SECT_PREFIX):len(sect)])
-			if err != nil {
-				return nil, err
-			}
-
-			targets = append(targets, target)
-		}
-	}
-	return targets, nil
-}
-
-// Get a map[] of variables for this target
-func (t *Target) GetVars() map[string]string {
-	return t.Vars
-}
-
-// Return the compiler definition file for this target
-func (t *Target) GetCompiler() string {
-	path := t.Nest.BasePath + "/compiler/"
-	if t.Vars["compiler"] != "" {
-		path += t.Vars["compiler"]
-	} else {
-		path += t.Arch
-	}
-	path += "/"
-
-	return path
-}
-
-// Build the target
-func (t *Target) Build() error {
-	if t.Vars["project"] != "" {
-		StatusMessage(VERBOSITY_DEFAULT, "Building target %s (project = %s)\n",
-			t.Name, t.Vars["project"])
-		// Now load and build the project.
-		p, err := LoadProject(t.Nest, t, t.Vars["project"])
-		if err != nil {
-			return err
-		}
-		// The project is the target, and builds itself.
-		if err = p.Build(); err != nil {
-			return err
-		}
-	} else if t.Vars["egg"] != "" {
-		clutch, err := NewClutch(t.Nest)
-		if err != nil {
-			return err
-		}
-
-		err = clutch.Build(t, t.Vars["egg"], nil, nil)
-		if err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-func (t *Target) BuildClean(cleanAll bool) error {
-	if t.Vars["project"] != "" {
-		p, err := LoadProject(t.Nest, t, t.Vars["project"])
-		if err != nil {
-			return err
-		}
-
-		// The project is the target, and build cleans itself.
-		if err = p.BuildClean(cleanAll); err != nil {
-			return err
-		}
-	} else if t.Vars["egg"] != "" {
-		clutch, err := NewClutch(t.Nest)
-		if err != nil {
-			return err
-		}
-		err = clutch.BuildClean(t, t.Vars["egg"], cleanAll)
-		if err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-func (t *Target) Test(cmd string, flag bool) error {
-	clutch, err := NewClutch(t.Nest)
-	if err != nil {
-		return err
-	}
-
-	switch cmd {
-	case "test":
-		err = clutch.Test(t, t.Vars["egg"], flag)
-	case "testclean":
-		err = clutch.TestClean(t, t.Vars["egg"], flag)
-	default:
-		err = NewNewtError("Unknown command to Test() " + cmd)
-	}
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (t *Target) DeleteVar(name string) error {
-	targetCfgSect := TARGET_SECT_PREFIX + t.Vars["name"]
-
-	if err := t.Nest.DelConfig(targetCfgSect, name); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// Save the target's configuration elements
-func (t *Target) Save() error {
-	nest := t.Nest
-
-	if _, ok := t.Vars["name"]; !ok {
-		return NewNewtError("Cannot save a target without a name")
-	}
-
-	targetCfg := TARGET_SECT_PREFIX + t.Vars["name"]
-
-	for k, v := range t.Vars {
-		if err := nest.SetConfig(targetCfg, k, v); err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-func (t *Target) Remove() error {
-	nest := t.Nest
-
-	if _, ok := t.Vars["name"]; !ok {
-		return NewNewtError("Cannot remove a target without a name")
-	}
-
-	cfgSect := TARGET_SECT_PREFIX + t.Vars["name"]
-
-	for k, _ := range t.Vars {
-		if err := nest.DelConfig(cfgSect, k); err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-func (t *Target) Download() error {
-	clutch, err := NewClutch(t.Nest)
-	if err != nil {
-		return err
-	}
-
-	egg, err := clutch.ResolveEggName(t.Bsp)
-	if err != nil {
-		return err
-	}
-
-	err = egg.LoadConfig(t, false)
-	if err != nil {
-		return err
-	}
-	if egg.DownloadScript == "" {
-		return NewNewtError(fmt.Sprintf("No egg.downloadscript defined for %s",
-			egg.FullName))
-	}
-	downloadScript := filepath.Join(egg.BasePath, egg.DownloadScript)
-
-	if t.Vars["project"] == "" {
-		return NewNewtError(fmt.Sprintf("No project associated with target %s",
-			t.Name))
-	}
-	p, err := LoadProject(t.Nest, t, t.Vars["project"])
-	if err != nil {
-		return err
-	}
-
-	os.Chdir(t.Nest.BasePath)
-
-	identString := ""
-	for ident, _ := range t.Identities {
-		identString = identString + ident
-	}
-
-	StatusMessage(VERBOSITY_DEFAULT, "Downloading with %s\n", downloadScript)
-	rsp, err := ShellCommand(fmt.Sprintf("%s %s %s", downloadScript,
-		filepath.Join(p.BinPath(), p.Name), identString))
-	if err != nil {
-		StatusMessage(VERBOSITY_DEFAULT, "%s", rsp);
-		return err
-	}
-
-	return nil
-}
-
-func (t *Target) Debug() error {
-	clutch, err := NewClutch(t.Nest)
-	if err != nil {
-		return err
-	}
-
-	egg, err := clutch.ResolveEggName(t.Bsp)
-	if err != nil {
-		return err
-	}
-
-	err = egg.LoadConfig(t, false)
-	if err != nil {
-		return err
-	}
-	if egg.DebugScript == "" {
-		return NewNewtError(fmt.Sprintf("No egg.debugscript defined for %s",
-			egg.FullName))
-	}
-	debugScript := filepath.Join(egg.BasePath, egg.DebugScript)
-
-	if t.Vars["project"] == "" {
-		return NewNewtError(fmt.Sprintf("No project associated with target %s",
-			t.Name))
-	}
-	p, err := LoadProject(t.Nest, t, t.Vars["project"])
-	if err != nil {
-		return err
-	}
-
-	os.Chdir(t.Nest.BasePath)
-
-	identString := ""
-	for ident, _ := range t.Identities {
-		identString = identString + ident
-	}
-
-	StatusMessage(VERBOSITY_DEFAULT, "Debugging with %s %s\n", debugScript, p.Name)
-
-	cmdLine := []string{debugScript, filepath.Join(p.BinPath(), p.Name)}
-	cmdLine = append(cmdLine, identString)
-	err = ShellInteractiveCommand(cmdLine)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-type MemSection struct {
-	Name   string
-	Offset uint64
-	EndOff uint64
-}
-type MemSectionArray []*MemSection
-
-func (array MemSectionArray) Len() int {
-	return len(array)
-}
-
-func (array MemSectionArray) Less(i, j int) bool {
-	return array[i].Offset < array[j].Offset
-}
-
-func (array MemSectionArray) Swap(i, j int) {
-	array[i], array[j] = array[j], array[i]
-}
-
-func MakeMemSection(name string, off uint64, size uint64) *MemSection {
-	memsection := &MemSection{
-		Name:   name,
-		Offset: off,
-		EndOff: off + size,
-	}
-	return memsection
-}
-
-func (m *MemSection) PartOf(addr uint64) bool {
-	if addr >= m.Offset && addr < m.EndOff {
-		return true
-	} else {
-		return false
-	}
-}
-
-/*
- * We accumulate the size of libraries to elements in this.
- */
-type EggSize struct {
-	Name  string
-	Sizes map[string]uint32 /* Sizes indexed by mem section name */
-}
-
-type EggSizeArray []*EggSize
-
-func (array EggSizeArray) Len() int {
-	return len(array)
-}
-
-func (array EggSizeArray) Less(i, j int) bool {
-	return array[i].Name < array[j].Name
-}
-
-func (array EggSizeArray) Swap(i, j int) {
-	array[i], array[j] = array[j], array[i]
-}
-
-func MakeEggSize(name string, memSections map[string]*MemSection) *EggSize {
-	eggSize := &EggSize{
-		Name: name,
-	}
-	eggSize.Sizes = make(map[string]uint32)
-	for secName, _ := range memSections {
-		eggSize.Sizes[secName] = 0
-	}
-	return eggSize
-}
-
-/*
- * Go through GCC generated mapfile, and collect info about symbol sizes
- */
-func ParseMapFileSizes(fileName string) (map[string]*EggSize, map[string]*MemSection,
-	error) {
-	var state int = 0
-
-	file, err := os.Open(fileName)
-	if err != nil {
-		return nil, nil, err
-	}
-
-	memSections := make(map[string]*MemSection)
-	eggSizes := make(map[string]*EggSize)
-
-	scanner := bufio.NewScanner(file)
-	for scanner.Scan() {
-		switch state {
-		case 0:
-			if strings.Contains(scanner.Text(), "Memory Configuration") {
-				state = 1
-			}
-		case 1:
-			if strings.Contains(scanner.Text(), "Origin") {
-				state = 2
-			}
-		case 2:
-			if strings.Contains(scanner.Text(), "*default*") {
-				state = 3
-				continue
-			}
-			array := strings.Fields(scanner.Text())
-			offset, err := strconv.ParseUint(array[1], 0, 64)
-			if err != nil {
-				return nil, nil, NewNewtError("Can't parse mem info")
-			}
-			size, err := strconv.ParseUint(array[2], 0, 64)
-			if err != nil {
-				return nil, nil, NewNewtError("Can't parse mem info")
-			}
-			memSections[array[0]] = MakeMemSection(array[0], offset,
-				size)
-		case 3:
-			if strings.Contains(scanner.Text(),
-				"Linker script and memory map") {
-				state = 4
-			}
-		case 4:
-			var addrStr string = ""
-			var sizeStr string = ""
-			var srcFile string = ""
-
-			if strings.Contains(scanner.Text(), "/DISCARD/") ||
-				strings.HasPrefix(scanner.Text(), "OUTPUT(") {
-				/*
-				 * After this there is only discarded symbols
-				 */
-				state = 5
-				continue
-			}
-
-			array := strings.Fields(scanner.Text())
-			switch len(array) {
-			case 1:
-				/*
-				 * section name on it's own, e.g.
-				 * *(.text*)
-				 *
-				 * section name + symbol name, e.g.
-				 * .text.Reset_Handler
-				 *
-				 * ignore these for now
-				 */
-				continue
-			case 2:
-				/*
-				 * Either stuff from beginning to first useful data e.g.
-				 * END GROUP
-				 *
-				 * or address of symbol + symbol name, e.g.
-				 * 0x00000000080002c8                SystemInit
-				 *
-				 * or section names with multiple input things, e.g.
-				 * *(.ARM.extab* .gnu.linkonce.armextab.*)
-				 *
-				 * or space set aside in linker script e.g.
-				 * 0x0000000020002e80      0x400
-				 * (that's the initial stack)
-				 *
-				 * ignore these for now
-				 */
-				continue
-			case 3:
-				/*
-				 * address, size, and name of file, e.g.
-				 * 0x000000000800bb04     0x1050 /Users/marko/foo/tadpole/hw//mcu/stm/stm32f3xx/bin/blinky_f3/libstm32f3xx.a(stm32f30x_syscfg.o)
-				 *
-				 * padding, or empty areas defined in linker script:
-				 * *fill*         0x000000000800cb71        0x3
-				 *
-				 * output section name, location, size, e.g.:
-				 * .bss            0x0000000020000ab0     0x23d0
-				 */
-				/*
-				 * Record addr, size and name to find library.
-				 */
-				if array[0] == "*fill*" {
-					addrStr = array[1]
-					sizeStr = array[2]
-					srcFile = array[0]
-				} else {
-					addrStr = array[0]
-					sizeStr = array[1]
-					srcFile = array[2]
-				}
-			case 4:
-				/*
-				 * section, address, size, name of file, e.g.
-				 * COMMON         0x0000000020002d28        0x8 /Users/marko/foo/tadpole/libs//os/bin/blinky_f3/libos.a(os_arch_arm.o)
-				 *
-				 * linker script symbol definitions:
-				 * 0x0000000020002e80                _ebss = .
-				 *
-				 * crud, e.g.:
-				 * 0x8 (size before relaxing)
-				 */
-				addrStr = array[1]
-				sizeStr = array[2]
-				srcFile = array[3]
-			default:
-				continue
-			}
-			addr, err := strconv.ParseUint(addrStr, 0, 64)
-			if err != nil {
-				continue
-			}
-			size, err := strconv.ParseUint(sizeStr, 0, 64)
-			if err != nil {
-				continue
-			}
-			if size == 0 {
-				continue
-			}
-			tmpStrArr := strings.Split(srcFile, "(")
-			srcLib := filepath.Base(tmpStrArr[0])
-			for name, section := range memSections {
-				if section.PartOf(addr) {
-					eggSize := eggSizes[srcLib]
-					if eggSize == nil {
-						eggSize =
-							MakeEggSize(srcLib, memSections)
-						eggSizes[srcLib] = eggSize
-					}
-					eggSize.Sizes[name] += uint32(size)
-					break
-				}
-			}
-		default:
-		}
-	}
-	file.Close()
-	for name, section := range memSections {
-		StatusMessage(VERBOSITY_VERBOSE, "Mem %s: 0x%x-0x%x\n",
-			name, section.Offset, section.EndOff)
-	}
-
-	return eggSizes, memSections, nil
-}
-
-/*
- * Return a printable string containing size data for the libraries
- */
-func PrintSizes(libs map[string]*EggSize,
-	sectMap map[string]*MemSection) (string, error) {
-	ret := ""
-
-	/*
-	 * Order sections by offset, and display lib sizes in that order.
-	 */
-	memSections := make(MemSectionArray, len(sectMap))
-	var i int = 0
-	for _, sec := range sectMap {
-		memSections[i] = sec
-		i++
-	}
-	sort.Sort(memSections)
-
-	/*
-	 * Order libraries by name, and display them in that order.
-	 */
-	eggSizes := make(EggSizeArray, len(libs))
-	i = 0
-	for _, es := range libs {
-		eggSizes[i] = es
-		i++
-	}
-	sort.Sort(eggSizes)
-
-	for _, sec := range memSections {
-		ret += fmt.Sprintf("%7s ", sec.Name)
-	}
-	ret += "\n"
-	for _, es := range eggSizes {
-		for i := 0; i < len(memSections); i++ {
-			ret += fmt.Sprintf("%7d ", es.Sizes[memSections[i].Name])
-		}
-		ret += fmt.Sprintf("%s\n", es.Name)
-	}
-	return ret, nil
-}
-
-func (t *Target) GetSize() (string, error) {
-	if t.Vars["project"] != "" {
-		StatusMessage(VERBOSITY_DEFAULT, "Inspecting target %s (project = %s)\n",
-			t.Name, t.Vars["project"])
-		// Now load the project, mapfile settings
-		p, err := LoadProject(t.Nest, t, t.Vars["project"])
-		if err != nil {
-			return "", err
-		}
-
-		c, err := NewCompiler(t.GetCompiler(), t.Cdef, t.Name, []string{})
-		if err != nil {
-			return "", err
-		}
-		if c.ldMapFile != true {
-			return "", NewNewtError("Build does not generate mapfile")
-		}
-		mapFile := p.BinPath() + p.Name + ".elf.map"
-
-		eggSizes, memSections, err := ParseMapFileSizes(mapFile)
-		if err != nil {
-			return "", err
-		}
-		return PrintSizes(eggSizes, memSections)
-	}
-	return "", NewNewtError("Target needs a project")
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/util.go
----------------------------------------------------------------------
diff --git a/cli/util.go b/cli/util.go
deleted file mode 100644
index a938bf1..0000000
--- a/cli/util.go
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cli
-
-import (
-	"bufio"
-	"bytes"
-	"fmt"
-	"github.com/hashicorp/logutils"
-	"github.com/spf13/viper"
-	"io/ioutil"
-	"log"
-	"os"
-	"os/exec"
-	"os/signal"
-	"path/filepath"
-	"runtime"
-	"strings"
-	"syscall"
-	"time"
-)
-
-type NewtError struct {
-	Text       string
-	StackTrace []byte
-}
-
-var Logger *log.Logger
-var Verbosity int
-var OK_STRING = " ok!\n"
-
-const (
-	VERBOSITY_SILENT  = 0
-	VERBOSITY_QUIET   = 1
-	VERBOSITY_DEFAULT = 2
-	VERBOSITY_VERBOSE = 3
-)
-
-func (se *NewtError) Error() string {
-	return se.Text + "\n" + string(se.StackTrace)
-}
-
-func NewNewtError(msg string) *NewtError {
-	err := &NewtError{
-		Text:       msg,
-		StackTrace: make([]byte, 1<<16),
-	}
-
-	runtime.Stack(err.StackTrace, true)
-
-	return err
-}
-
-func NewtErrorNoTrace(msg string) *NewtError {
-	return &NewtError{
-		Text:       msg,
-		StackTrace: nil,
-	}
-}
-
-// Initialize the CLI module
-func Init(level string, silent bool, quiet bool, verbose bool) {
-	if level == "" {
-		level = "WARN"
-	}
-
-	filter := &logutils.LevelFilter{
-		Levels: []logutils.LogLevel{"DEBUG", "VERBOSE", "INFO",
-			"WARN", "ERROR"},
-		MinLevel: logutils.LogLevel(level),
-		Writer:   os.Stderr,
-	}
-
-	log.SetOutput(filter)
-
-	if silent {
-		Verbosity = VERBOSITY_SILENT
-	} else if quiet {
-		Verbosity = VERBOSITY_QUIET
-	} else if verbose {
-		Verbosity = VERBOSITY_VERBOSE
-	} else {
-		Verbosity = VERBOSITY_DEFAULT
-	}
-}
-
-func checkBoolMap(mapVar map[string]bool, item string) bool {
-	v, ok := mapVar[item]
-	return v && ok
-}
-
-// Read in the configuration file specified by name, in path
-// return a new viper config object if successful, and error if not
-func ReadConfig(path string, name string) (*viper.Viper, error) {
-	v := viper.New()
-	v.SetConfigType("yaml")
-	v.SetConfigName(name)
-	v.AddConfigPath(path)
-
-	err := v.ReadInConfig()
-	if err != nil {
-		return nil, NewNewtError(err.Error())
-	} else {
-		return v, nil
-	}
-}
-
-func GetStringIdentities(v *viper.Viper, idents map[string]string, key string) string {
-	val := v.GetString(key)
-
-	for ident, _ := range idents {
-		overwriteVal := v.GetString(key + "." + ident + ".OVERWRITE")
-		if overwriteVal != "" {
-			val = strings.Trim(overwriteVal, "\n")
-			break
-		}
-
-		appendVal := v.GetString(key + "." + ident)
-		if appendVal != "" {
-			val += " " + strings.Trim(appendVal, "\n")
-		}
-	}
-	return strings.TrimSpace(val)
-}
-
-func GetStringSliceIdentities(v *viper.Viper, idents map[string]string,
-	key string) []string {
-
-	val := v.GetStringSlice(key)
-
-	// string empty items
-	result := []string{}
-	for _, item := range val {
-		if item == "" || item == " " {
-			continue
-		}
-		result = append(result, item)
-	}
-
-	for item, _ := range idents {
-		result = append(result, v.GetStringSlice(key+"."+item)...)
-	}
-
-	return result
-}
-
-func NodeExist(path string) bool {
-	if _, err := os.Stat(path); err == nil {
-		return true
-	} else {
-		return false
-	}
-}
-
-// Check whether the node (either dir or file) specified by path exists
-func NodeNotExist(path string) bool {
-	if _, err := os.Stat(path); os.IsNotExist(err) {
-		return true
-	} else {
-		return false
-	}
-}
-
-func FileModificationTime(path string) (time.Time, error) {
-	fileInfo, err := os.Stat(path)
-	if err != nil {
-		epoch := time.Unix(0, 0)
-		if os.IsNotExist(err) {
-			return epoch, nil
-		} else {
-			return epoch, NewNewtError(err.Error())
-		}
-	}
-
-	return fileInfo.ModTime(), nil
-}
-
-// Execute the command specified by cmdStr on the shell and return results
-func ShellCommand(cmdStr string) ([]byte, error) {
-	log.Print("[VERBOSE] " + cmdStr)
-	cmd := exec.Command("sh", "-c", cmdStr)
-
-	o, err := cmd.CombinedOutput()
-	log.Print("[VERBOSE] o=" + string(o))
-	if err != nil {
-		return o, NewNewtError(err.Error())
-	} else {
-		return o, nil
-	}
-}
-
-// Run interactive shell command
-func ShellInteractiveCommand(cmdStr []string) error {
-	log.Print("[VERBOSE] " + cmdStr[0])
-
-	//
-	// Block SIGINT, at least.
-	// Otherwise Ctrl-C meant for gdb would kill newt.
-	//
-	c := make(chan os.Signal, 1)
-	signal.Notify(c, os.Interrupt)
-	signal.Notify(c, syscall.SIGTERM)
-	go func(){
-		<-c
-	}()
-
-	// Transfer stdin, stdout, and stderr to the new process
-	// and also set target directory for the shell to start in.
-	pa := os.ProcAttr {
-		Files: []*os.File{os.Stdin, os.Stdout, os.Stderr},
-	}
-
-	// Start up a new shell.
-	proc, err := os.StartProcess(cmdStr[0], cmdStr, &pa)
-	if err != nil {
-		signal.Stop(c)
-		return NewNewtError(err.Error())
-	}
-
-	// Release and exit
-	_, err = proc.Wait()
-	if err != nil {
-		signal.Stop(c)
-		return NewNewtError(err.Error())
-	}
-	signal.Stop(c)
-	return nil
-}
-
-func CopyFile(srcFile string, destFile string) error {
-	_, err := ShellCommand(fmt.Sprintf("mkdir -p %s", filepath.Dir(destFile)))
-	if err != nil {
-		return err
-	}
-	if _, err := ShellCommand(fmt.Sprintf("cp -Rf %s %s", srcFile,
-		destFile)); err != nil {
-		return err
-	}
-	return nil
-}
-
-func CopyDir(srcDir, destDir string) error {
-	return CopyFile(srcDir, destDir)
-}
-
-// Print Silent, Quiet and Verbose aware status messages
-func StatusMessage(level int, message string, args ...interface{}) {
-	if Verbosity >= level {
-		fmt.Printf(message, args...)
-	}
-}
-
-// Reads each line from the specified text file into an array of strings.  If a
-// line ends with a backslash, it is concatenated with the following line.
-func ReadLines(path string) ([]string, error) {
-	file, err := os.Open(path)
-	if err != nil {
-		return nil, NewNewtError(err.Error())
-	}
-	defer file.Close()
-
-	lines := []string{}
-	scanner := bufio.NewScanner(file)
-
-	for scanner.Scan() {
-		line := scanner.Text()
-		concatted := false
-
-		if len(lines) != 0 {
-			prevLine := lines[len(lines)-1]
-			if len(prevLine) > 0 && prevLine[len(prevLine)-1:] == "\\" {
-				prevLine = prevLine[:len(prevLine)-1]
-				prevLine += line
-				lines[len(lines)-1] = prevLine
-
-				concatted = true
-			}
-		}
-
-		if !concatted {
-			lines = append(lines, line)
-		}
-	}
-
-	if scanner.Err() != nil {
-		return lines, NewNewtError(scanner.Err().Error())
-	}
-
-	return lines, nil
-}
-
-// Determines if a file was previously built with a command line invocation
-// different from the one specified.
-//
-// @param dstFile               The output file whose build invocation is being
-//                                  tested.
-// @param cmd                   The command that would be used to generate the
-//                                  specified destination file.
-//
-// @return                      true if the command has changed or if the
-//                                  destination file was never built;
-//                              false otherwise.
-func CommandHasChanged(dstFile string, cmd string) bool {
-	cmdFile := dstFile + ".cmd"
-	prevCmd, err := ioutil.ReadFile(cmdFile)
-	if err != nil {
-		return true
-	}
-
-	return bytes.Compare(prevCmd, []byte(cmd)) != 0
-}
-
-// Writes a file containing the command-line invocation used to generate the
-// specified file.  The file that this function writes can be used later to
-// determine if the set of compiler options has changed.
-//
-// @param dstFile               The output file whose build invocation is being
-//                                  recorded.
-// @param cmd                   The command to write.
-func WriteCommandFile(dstFile string, cmd string) error {
-	cmdPath := dstFile + ".cmd"
-	err := ioutil.WriteFile(cmdPath, []byte(cmd), 0644)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// Removes all duplicate strings from the specified array, while preserving
-// order.
-func UniqueStrings(elems []string) []string {
-	set := make(map[string]bool)
-	result := make([]string, 0)
-
-	for _, elem := range elems {
-		if !set[elem] {
-			result = append(result, elem)
-			set[elem] = true
-		}
-	}
-
-	return result
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/coding_style.txt
----------------------------------------------------------------------
diff --git a/coding_style.txt b/coding_style.txt
deleted file mode 100644
index 0fb9a12..0000000
--- a/coding_style.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-Newt Coding Style 
--- 
-
-- Line length is fixed to no more than 90 characters
-
-- At least every function should have documentation above it in godoc format.
-Err on the side of more comments rather than fewer.
-
-- Where possible, the form: 
-
-    if err := func(); err != nil {
-        return err
-    }
-
-Is the preferred method of doing error checking.  Note that "err" should be 
-assigned using the := operator to avoid conflicting with enclosing scope. 
-
-- In cases where it is infeasible to create an error variable, i.e. when 
-using multiple assignments on structure properties, the err variable should 
-be defined at the top of the function scope.  i.e.: 
-
-    func (inst *Installer) SetName(name string) {
-        // declaration at the top of the function 
-        var err error 
-
-        // ...some code here...
-        inst.Name, err = inst.ParseString(name)
-        if err != nil {
-            return err
-        }
-    }
-        
-
-- Every object which requires allocation, shall follow this pattern:
-    - The object itself has an Init() function which accesses to initialize
-      the object.  e.g.: 
-
-        func (inst *Installer) Init() error {
-            // Initialization functions here
-        }
-
-    - There shall be a New<Object Name> function which allocates a new
-    object of <Object Name> type, and calls the init function prior to 
-    allocating the new object.  e.g.: 
-
-        func NewInstaller() (*Installer, error) {
-            inst := &Installer{}
-            if err := inst.Init(); err != nil {
-                return nil, err
-            }
-            return inst, nil
-        }
-
-- Accessors are for object properties SHOULD ALWAYS be provided when setting
-class properties.  For reading object properties, accessor functions are 
-should be provided where it makes sense (i.e. to provide an implementation 
-contract.) 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/design.txt
----------------------------------------------------------------------
diff --git a/design.txt b/design.txt
deleted file mode 100644
index 83a374e..0000000
--- a/design.txt
+++ /dev/null
@@ -1,370 +0,0 @@
-                          Design of Newt System
-
-
-
-1. Introduction 
-
-
-The newt tool allows for building and distributing embedded projects.  It's 
-goal is to make it simple for developers to create a source project and 
-manage that project, with an embedded twist.  In embedded systems, the core 
-operating system is often built and distributed along with system libraries
-and applications.  Additionally, there is a fair amount of complexity in 
-managing driver interfaces, board support packages, and both development and 
-production builds.  Right now, all of this is done for every project, and 
-everybody does it in a different way.
-
-Newt introduces the following core concepts: 
-
-Repository
-    The base directory of your embedded software.  A repository can contain 
-    multiple projects, and reflect multiple end products.  It is meant to be 
-    a logical collection of your source code.
-
-Project
-    Projects represent the individual build configurations of your embedded 
-    system.  The project files are what dictate the resulting binary that is 
-    generated.
-
-Package 
-    Packages represent libraries that are distributed.  Packages have multiple
-    types (e.g. "bsp", "library", "os") that represent their function within 
-    the newt system.
-
-
-In order to bring sanity to your embedded life (lonelieness and cat obsession
-left as an exercise for the user), Newt allows you to: 
-
-Build architecture specific binaries 
-    Newt contains the ability to manage and build for multiple different CPU
-    architectures, project definitions and board support packages. 
-
-Manage your drivers, board support and libraries 
-    Newt provides an infrastructure that helps you manage board capabilities, 
-    and drivers based upon what low-level features your libraries and projects 
-    use. 
-
-Distribute Binaries 
-    Newt provides the ability to generate signed firmware images, suitable for
-    booting with n-boot.  Flash can also take n-boot images + project images 
-    and create a full flash map.  
-
-Distribute Source 
-    Newt makes it easy to distribute and download libraries.  By providing a
-    clear interface to the lower layer drivers, and dependency checking across
-    both architecture and board support package: newt makes it easy to 
-    develop reusable software components across embedded projects. 
-
-Test 
-    Newt provides a test framework that allows you to easily define regression
-    and unit tests, and have them run automatically.  
-
-
-2. Usage 
-
-To get started with newt, first create a new repository: 
-
-    $ newt create repo <fw> 
-
-This creates a new repository in the directory specified by <fw>. 
-
-The repository has the following contents: 
-    $ newt repo create test_repo_1
-    Repo test_repo_1 successfully created!
-    $ cd test_repo_1/
-    $ tree
-    .
-    ├── compiler
-    ├── hw
-    │   └── bsp
-    ├── libs
-    ├── project
-    └── repo.yml
-
-
-The arch/ directory contains the architecture specific information for the 
-new repository.  By default, the sim architecture and compiler is installed: 
-which allows you to build new projects and software on your native OS and 
-try it out.  
-
-The newt tool also creates a directory .<fw> -- this contains the
-environment and configuration information for the current project.  More 
-information about this directory is contained in Appendix A. 
-
-Once you have a repo, you can enter that repo, and begin composing your 
-project.
-
-The first step to composing a project is to setup a build environment and 
-board support package for that product.  There are a set of board support 
-packages and architectures available at the following URL: 
-http://www.github.com/XXX. 
-
-Let's start with the board support package for the STM32-E407, which is a 
-test board for the ARM Cortex-M4, provided by Olimex 
-(https://www.olimex.com/Products/ARM/ST/STM32-E407/open-source-hardware). 
-To install the Olimex board support package, cd into the <fw> directory 
-and type: 
-
-    $ newt install bsp http://www.github.com/XXX/STM32-E407 
-    Downloading Board Support Definition from 
-        http://www.github.com/XXX/STM32-E407 ... ok
-    Board Support Definition STM32-E407 requires ARM architecture to be 
-        installed (http://www.github.com/XXX/ARM), is that OK? [Y/n] y
-    Downloading ARM architecture support    ... ok
-    Successfully installed BSP for STM32-E407! 
-    $ 
-
-The "install bsp" command goes out and installs the board support package 
-defined by the URL provided in the link.  In this case, the bsp is defined 
-on github.  Once the newt tool downloads the BSP, it notices that the BSP 
-requires the ARM architecture to be installed, and its currently not in the 
-workspace.  Newt will then download the definiton from the github URL, and 
-install the necessary architecture information.   
-
-After the dependency to the compiler has been fufilled, the bsp support 
-packages are installed into the working directory.  After the command 
-has finished, the following directory structure should exist: 
-
-    $ tree 
-    .
-    └── arch/
-        └── sim/
-            └── compiler/
-                └── compiler.yml 
-        └── arm/
-            └── compiler/
-                └── arm-gcc
-                    └── bin 
-                        └── arm-gcc 
-                        └── arm-as  
-                        └── .. <snip> .. 
-                └── compiler.yml
-            └── include/
-                └── rt_CMSIS.h
-            └── mcu/
-                └── stm32/
-                    └── arch_gpio.c 
-                    └── arch_gpio.h 
-                    └── .. <snip> .. 
-    └── bsp
-        └── stm32-e407
-            └── layout 
-                └── debug 
-                    └── stm32-e407.lds  
-                └── prod  
-                    └── stm32-e407.lds  
-            └── stm32-e407.yml 
-            └── bsp_flash_layout.h 
-            └── bsp_boot.s 
-            └── .. <snip> .. 
-    └── .<fw>
-        └── <fw>.yml 
-        └── <fw>.db 
-
-
-As you can see, a couple of new directories were created: 
-
-arch/arm
-    Definition files specific to the ARM architecture.   This is directory 
-    contains generic definition files across multiple MCU architectures. 
-
-arch/arm/mcu/stm32
-    This directory contains definition files specific to the 
-    STM32 MCU.  This includes things like SPI and UART definitions.  
-
-arch/arm/compiler
-    The compiler for the ARM architecture definition.  This includes an 
-    up-to-date, tested version of the arm-gcc compiler.  By default Newt uses
-    this compiler, however it can be overridden to use a system compiler as 
-    well. 
-
-bsp/stm32-e407 
-    This directory contains the board support files specific to the 
-    STM32-E407 development board. 
-
-bsp/stm32-e407/layout
-    This contains the memory layouts for build layouts, which can often be 
-    different for debug and production builds (e.g. run out of SRAM for debug
-    and Flash for prod.) 
-
-
-The next step is to create a project that will build on the test board.  Let's 
-say the first project is "blink_leds" a project that will load onto the 
-STM32-E407 and blink LED1. 
-
-To create the project, in the main directory enter: 
-
-    $ newt create project blink_leds
-    Creating project blink_leds in project/ ... ok 
-    Creating project scaffolding for blink_leds ... ok
-    $ 
-
-This will create the following directory structure: 
-
-    $ tree 
-    ..<snip>.. (same as previous step) 
-    └── project
-        └── blink_leds
-            └── blink_leds.yml 
-            └── blink_leds.c
-    $ 
-
-The file blink_leds.c will contain base scaffolding in order to build: 
-
-    #include <newt/core.h> 
-
-    int 
-    main(int argc, char **argv)
-    {
-        while (1) { /* your code here */ }
-        return (0);
-    }
-
-
-In order to blink LEDs, the next step is to install the LED package.   The LED
-package contains a standard API definition for controlling board LEDs, and 
-the architecture and board specific definitions for LEDs. 
-
-    $ newt install driver http://www.github.com/XXX/led-driver
-    Downloading driver ... ok
-    Checking for necessary bsp support, bsps found: sim, STM32-E407 ... ok 
-    Installing driver ... ok 
-    $ 
-
-Installing the driver will create the following directories in the root 
-directory of your project: 
-
-    $ tree 
-    ..<snip>.. (same as previous step) 
-    └── drivers
-        └── led-driver 
-            └── led-driver.yml 
-            └── src
-                └── led-driver.c 
-            └── include 
-                └── led-driver.h 
-            └── bsp 
-                └── stm32-e407  
-                    └── stm32-e407.c  
-                    └── stm32-e407.h 
-
-This driver will then be accessible in your project.  The next step is to
-enable it in your project definition, in order to do that, enter: 
-
-    $ newt project blink_leds use driver led-driver
-    Enabling led-driver in blink_leds project.
-
-Now edit project/blink_leds/blink_leds.c, and write the following code: 
-
-    #include <newt/core.h> 
-    #include <led_driver/led_driver.h> 
-
-    int 
-    main(int argc, char **argv)
-    {
-        int toggle = 0; 
-
-        while (1) {
-            if ((toggle++ % 2) == 0) {
-                led_off(LED_DRIVER_LED1);
-            } else {
-                led_on(LED_DRIVER_LED1);
-            }
-        }
-
-        return (0);
-    }
-
-Once this file is edited, you can now build your project.  In order to 
-build an image that can be loaded on the board, create a build definition: 
-
-    $ newt build_def create blink_leds_arm_build 
-    $ newt build_def edit blink_leds_arm_build set bsp=stm32-e407 
-    $ newt build_def edit blink_leds_arm_build set project=blink_leds 
-    $ newt build_def edit blink_leds_arm_build set layout=debug 
-
-This build definition is stored in the project build definition, and can now
-be referenced with the newt build command: 
-
-    $ newt build blink_leds_arm_build  
-    Building project blink_leds with bsp stm32-e407, layout debug ... ok 
-    $ 
-
-In order to see the output of the build, check the bin/ directory in the base 
-directory of your repo: 
-
-    $ cd bin; tree 
-    └── bin
-        └── blink_leds 
-            └── stm32-e407 
-                └── blink_leds.elf  
-                └── blink_leds.map 
-
-
-In order to load these files onto your board using GDB, please see the 
-Debugger Support section of this document. 
-
-3. Packages 
-
-Newt distributes libraries in the form of source packages, making it easy to 
-bundle and reuse source code across multiple repositories and projects.  
-Outside of the core architecture & board specific setup, all source code in 
-a newt project should be encapsulated within a package.
-
-A package has the following directory structure: 
-
-    $ cd pkg/os; tree 
-    └── os
-        └── os.yml 
-        └── include
-            └── arch 
-                └── sim 
-                    └── os_arch.h 
-                └── arm 
-                    └── os_arch.h 
-            └── os 
-                └── os_mutex.h
-                └── os_sem.h 
-            └── os.h 
-        └── src
-            └── arch 
-                └── sim
-                    └── os_arch_sim.c 
-                └── arm
-                    └── os_arch_arm.c 
-            └── os_mutex.c 
-            └── os_sched.c  
-        └── test 
-            └── os_mutex_test 
-                └── os_mutex_test.c 
-
-Building a Package
-
-In order to build a package, either: 
-
-    a) Include it in a project definition, in which case it will be built as a 
-    library and linked with the main application. 
-
-    b) Build it with target "test" in which case the specified regression test 
-    will be executed.  If no regression test is specified, all regression tests
-    will be run. 
-
-
-Running a Package's Unit Tests 
-
-To run a package's unit tests, cd into the package directory and run newt build
-test: 
-
-    $ cd pkg/os
-    $ newt build test 
-    Building regression tests in OS
-    Building OS ... ok 
-    Building Regression Tests ... ok 
-    Running test os_mutex_test ... ok
-    $
-
-Including a Package in a Project file 
-
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt.go
----------------------------------------------------------------------
diff --git a/newt.go b/newt.go
deleted file mode 100644
index 02b32a5..0000000
--- a/newt.go
+++ /dev/null
@@ -1,1395 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package main
-
-import (
-	"fmt"
-	"git-wip-us.apache.org/repos/asf/incubator-mynewt-newt.git/cli"
-	"github.com/spf13/cobra"
-	"log"
-	"os"
-	"path/filepath"
-	"regexp"
-	"sort"
-	"strings"
-)
-
-var ExitOnFailure bool = false
-var ExportAll bool = false
-var ImportAll bool = false
-var NewtVersion string = "0.1"
-var NewtLogLevel string = ""
-var NewtNest *cli.Nest
-var newtSilent bool
-var newtQuiet bool
-var newtVerbose bool
-var NewtBranchClutch string
-var NewtBranchEgg string
-
-func NewtUsage(cmd *cobra.Command, err error) {
-	if err != nil {
-		sErr := err.(*cli.NewtError)
-		log.Printf("[DEBUG] %s", sErr.StackTrace)
-		fmt.Fprintf(os.Stderr, "Error: %s\n", sErr.Text)
-	}
-
-	if cmd != nil {
-		cmd.Help()
-	}
-	os.Exit(1)
-}
-
-// Display help text with a max line width of 79 characters
-func formatHelp(text string) string {
-	// first compress all new lines and extra spaces
-	words := regexp.MustCompile("\\s+").Split(text, -1)
-	linelen := 0
-	fmtText := ""
-	for _, word := range words {
-		word = strings.Trim(word, "\n ") + " "
-		tmplen := linelen + len(word)
-		if tmplen >= 80 {
-			fmtText += "\n"
-			linelen = 0
-		}
-		fmtText += word
-		linelen += len(word)
-	}
-	return fmtText
-}
-
-// Extracts "<key>=<value>" strings from the supplied slice and inserts them
-// into the specified target's variable map.
-func extractTargetVars(args []string, t *cli.Target) error {
-	for i := 0; i < len(args); i++ {
-		pair := strings.SplitN(args[i], "=", 2)
-		if len(pair) != 2 {
-			return cli.NewNewtError("invalid argument: " + args[i])
-		}
-
-		t.Vars[pair[0]] = pair[1]
-	}
-
-	return nil
-}
-
-func targetSetCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify two arguments (sect & k=v) to set"))
-	}
-
-	t, err := cli.LoadTarget(NewtNest, args[0])
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	ar := strings.Split(args[1], "=")
-
-	t.Vars[ar[0]] = ar[1]
-
-	if err := t.Save(); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Target %s successfully set %s to %s\n", args[0], ar[0], ar[1])
-}
-
-func targetUnsetCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify two arguments (sect & k) to unset"))
-	}
-
-	t, err := cli.LoadTarget(NewtNest, args[0])
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := t.DeleteVar(args[1]); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Target %s successfully unset %s\n", args[0], args[1])
-}
-
-// Type for sorting an array of target pointers alphabetically by name.
-type ByName []*cli.Target
-
-func (a ByName) Len() int           { return len(a) }
-func (a ByName) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
-func (a ByName) Less(i, j int) bool { return a[i].Vars["name"] < a[j].Vars["name"] }
-
-func targetShowCmd(cmd *cobra.Command, args []string) {
-	dispSect := ""
-	if len(args) == 1 {
-		dispSect = args[0]
-	}
-
-	targets, err := cli.GetTargets(NewtNest)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	sort.Sort(ByName(targets))
-
-	for _, target := range targets {
-		if dispSect == "" || dispSect == target.Vars["name"] {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, target.Vars["name"]+"\n")
-
-			vars := target.GetVars()
-			var keys []string
-			for k := range vars {
-				keys = append(keys, k)
-			}
-
-			sort.Strings(keys)
-			for _, k := range keys {
-				cli.StatusMessage(cli.VERBOSITY_QUIET, "	%s: %s\n", k, vars[k])
-			}
-		}
-	}
-}
-
-func targetCreateCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 1 {
-		NewtUsage(cmd, cli.NewNewtError("Wrong number of args to create cmd."))
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Creating target "+args[0]+"\n")
-
-	if cli.TargetExists(NewtNest, args[0]) {
-		NewtUsage(cmd, cli.NewNewtError(
-			"Target already exists, cannot create target with same name."))
-	}
-
-	target := &cli.Target{
-		Nest: NewtNest,
-		Vars: map[string]string{},
-	}
-	target.Vars["name"] = args[0]
-
-	err := target.Save()
-	if err != nil {
-		NewtUsage(nil, err)
-	} else {
-		cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-			"Target %s successfully created!\n", args[0])
-	}
-}
-
-func targetBuildCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target to build"))
-	}
-
-	t, err := cli.LoadTarget(NewtNest, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	if len(args) > 1 && args[1] == "clean" {
-		if len(args) > 2 && args[2] == "all" {
-			err = t.BuildClean(true)
-		} else {
-			err = t.BuildClean(false)
-		}
-		if err != nil {
-			NewtUsage(nil, err)
-		}
-	} else {
-		// Parse any remaining key-value pairs and insert them into the target.
-		err = extractTargetVars(args[1:], t)
-		if err != nil {
-			NewtUsage(nil, err)
-		}
-
-		err = t.Build()
-		if err != nil {
-			NewtUsage(nil, err)
-		}
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Successfully run!\n")
-}
-
-func targetDelCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target to delete"))
-	}
-
-	t, err := cli.LoadTarget(NewtNest, args[0])
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	// Clean target prior to deletion; ignore errors during clean.
-	t.BuildClean(false)
-
-	if err := t.Remove(); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Target %s successfully removed\n", args[0])
-}
-
-func targetTestCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target to build"))
-	}
-
-	t, err := cli.LoadTarget(NewtNest, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	if len(args) > 1 && args[1] == "clean" {
-		if len(args) > 2 && args[2] == "all" {
-			err = t.Test("testclean", true)
-		} else {
-			err = t.Test("testclean", false)
-		}
-		if err != nil {
-			NewtUsage(nil, err)
-		}
-	} else {
-		// Parse any remaining key-value pairs and insert them into the target.
-		err = extractTargetVars(args[1:], t)
-		if err != nil {
-			NewtUsage(cmd, err)
-		}
-
-		err = t.Test("test", ExitOnFailure)
-		if err != nil {
-			NewtUsage(nil, err)
-		}
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Successfully run!\n")
-}
-
-func targetSizeCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target for sizing"))
-	}
-
-	t, err := cli.LoadTarget(NewtNest, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	txt, err := t.GetSize()
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "%s", txt)
-}
-
-func targetDownloadCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target to download"))
-	}
-
-	t, err := cli.LoadTarget(NewtNest, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	err = t.Download()
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-}
-
-func targetDebugCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target for debug"))
-	}
-
-	t, err := cli.LoadTarget(NewtNest, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	err = t.Debug()
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-}
-
-func targetExportCmd(cmd *cobra.Command, args []string) {
-	var targetName string
-	if ExportAll {
-		targetName = ""
-	} else {
-		if len(args) < 1 {
-			NewtUsage(cmd, cli.NewNewtError("Must either specify -a flag or name of "+
-				"target to export"))
-		}
-		targetName = args[0]
-	}
-
-	err := cli.ExportTargets(NewtNest, targetName, ExportAll, os.Stdout)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-}
-
-func targetImportCmd(cmd *cobra.Command, args []string) {
-	var targetName string
-	if ImportAll {
-		targetName = ""
-	} else {
-		if len(args) < 1 {
-			NewtUsage(cmd, cli.NewNewtError("Must either specify -a flag or name of "+
-				"target to import"))
-		}
-
-		targetName = args[0]
-	}
-
-	err := cli.ImportTargets(NewtNest, targetName, ImportAll, os.Stdin)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Target(s) successfully imported!\n")
-}
-
-func targetAddCmds(base *cobra.Command) {
-	targetHelpText := formatHelp(`Targets tell the newt tool how to build the source
-		code within a given nest.`)
-	targetHelpEx := "  newt target create <target-name>\n"
-	targetHelpEx += "  newt target set <target-name> <var-name>=<value>\n"
-	targetHelpEx += "  newt target unset <target-name> <var-name>\n"
-	targetHelpEx += "  newt target show <target-name>\n"
-	targetHelpEx += "  newt target delete <target-name>\n"
-	targetHelpEx += "  newt target build <target-name> [clean[ all]]\n"
-	targetHelpEx += "  newt target test <target-name> [clean[ all]]\n"
-	targetHelpEx += "  newt target size <target-name>\n"
-	targetHelpEx += "  newt target download <target-name>\n"
-	targetHelpEx += "  newt target debug <target-name>\n"
-	targetHelpEx += "  newt target export [-a -export-all] [<target-name>]\n"
-	targetHelpEx += "  newt target import [-a -import-all] [<target-name>]"
-
-	targetCmd := &cobra.Command{
-		Use:     "target",
-		Short:   "Set and view target information",
-		Long:    targetHelpText,
-		Example: targetHelpEx,
-		PersistentPreRun: func(cmd *cobra.Command, args []string) {
-			cli.Init(NewtLogLevel, newtSilent, newtQuiet, newtVerbose)
-
-			var err error
-			NewtNest, err = cli.NewNest()
-			if err != nil {
-				NewtUsage(nil, err)
-			}
-		},
-		Run: func(cmd *cobra.Command, args []string) {
-			cmd.Usage()
-		},
-	}
-
-	setHelpText := formatHelp(`Set a target variable (<var-name>) on target 
-		<target-name> to value <value>.`)
-	setHelpEx := "  newt target set <target-name> <var-name>=<value>\n"
-	setHelpEx += "  newt target set my_target1 var_name=value\n"
-	setHelpEx += "  newt target set my_target1 arch=cortex_m4"
-
-	setCmd := &cobra.Command{
-		Use:     "set",
-		Short:   "Set target configuration variable",
-		Long:    setHelpText,
-		Example: setHelpEx,
-		Run:     targetSetCmd,
-	}
-
-	targetCmd.AddCommand(setCmd)
-
-	unsetHelpText := formatHelp(`Unset a target variable (<var-name>) on target
-		<target-name>.`)
-	unsetHelpEx := "  newt target unset <target-name> <var-name>\n"
-	unsetHelpEx += "  newt target unset my_target1 var_name"
-
-	unsetCmd := &cobra.Command{
-		Use:     "unset",
-		Short:   "Unset target configuration variable",
-		Long:    unsetHelpText,
-		Example: unsetHelpEx,
-		Run:     targetUnsetCmd,
-	}
-
-	targetCmd.AddCommand(unsetCmd)
-
-	delHelpText := formatHelp(`Delete the target specified by <target-name>.`)
-	delHelpEx := "  newt target delete <target-name>\n"
-	delHelpEx += "  newt target delete my_target1"
-
-	delCmd := &cobra.Command{
-		Use:     "delete",
-		Short:   "Delete target",
-		Long:    delHelpText,
-		Example: delHelpEx,
-		Run:     targetDelCmd,
-	}
-
-	targetCmd.AddCommand(delCmd)
-
-	createHelpText := formatHelp(`Create a target specified by <target-name>.`)
-	createHelpEx := "  newt target create <target-name>\n"
-	createHelpEx += "  newt target create my_target1"
-
-	createCmd := &cobra.Command{
-		Use:     "create",
-		Short:   "Create a target",
-		Long:    createHelpText,
-		Example: createHelpEx,
-		Run:     targetCreateCmd,
-	}
-
-	targetCmd.AddCommand(createCmd)
-
-	showHelpText := formatHelp(`Show all the variables for the target specified 
-		by <target-name>.`)
-	showHelpEx := "  newt target show <target-name>\n"
-	showHelpEx += "  newt target show my_target1"
-
-	showCmd := &cobra.Command{
-		Use:     "show",
-		Short:   "View target configuration variables",
-		Long:    showHelpText,
-		Example: showHelpEx,
-		Run:     targetShowCmd,
-	}
-
-	targetCmd.AddCommand(showCmd)
-
-	buildHelpText := formatHelp(`Build the target specified by <target-name>.  
-		If clean is specified, then all the binaries and object files for this 
-		target will be removed.  If the all option is specified, all binaries 
-		and object files for all targets will be removed.`)
-	buildHelpEx := "  newt target build <target-name> [clean[ all]]\n"
-	buildHelpEx += "  newt target build my_target1\n"
-	buildHelpEx += "  newt target build my_target1 clean\n"
-	buildHelpEx += "  newt target build my_target1 clean all\n"
-
-	buildCmd := &cobra.Command{
-		Use:     "build",
-		Short:   "Build target",
-		Long:    buildHelpText,
-		Example: buildHelpEx,
-		Run:     targetBuildCmd,
-	}
-
-	targetCmd.AddCommand(buildCmd)
-
-	testHelpText := formatHelp(`Test the target specified by <target-name>.  If
-		clean is specified, then all the test binaries and object files for this 
-		target will be removed.  If the all option is specified, all test 
-		binaries and object files for all targets will be removed.`)
-	testHelpEx := "  newt target test <target-name> [clean, [all]]\n"
-	testHelpEx += "  newt target test mytarget1\n"
-	testHelpEx += "  newt target test mytarget1 clean\n"
-	testHelpEx += "  newt target test mytarget1 clean all"
-
-	testCmd := &cobra.Command{
-		Use:     "test",
-		Short:   "Test target",
-		Long:    testHelpText,
-		Example: testHelpEx,
-		Run:     targetTestCmd,
-	}
-
-	targetCmd.AddCommand(testCmd)
-
-	sizeHelpText := formatHelp(`Calculate the size of target components specified by
-		<target-name>.`)
-	sizeHelpEx := "  newt target size <target-name>\n"
-
-	sizeCmd := &cobra.Command{
-		Use:     "size",
-		Short:   "Size of the target",
-		Long:    sizeHelpText,
-		Example: sizeHelpEx,
-		Run:     targetSizeCmd,
-	}
-
-	targetCmd.AddCommand(sizeCmd)
-
-	downloadHelpText := formatHelp(`Download project image to target for
-		<target-name>.`)
-	downloadHelpEx := "  newt target download <target-name>\n"
-
-	downloadCmd := &cobra.Command{
-		Use:     "download",
-		Short:   "Download project to target",
-		Long:    downloadHelpText,
-		Example: downloadHelpEx,
-		Run:     targetDownloadCmd,
-	}
-	targetCmd.AddCommand(downloadCmd)
-
-	debugHelpText := formatHelp(`Download project image to target for
-		<target-name>.`)
-	debugHelpEx := "  newt target download <target-name>\n"
-
-	debugCmd := &cobra.Command{
-		Use:     "debug",
-		Short:   "Open debugger session to target",
-		Long:    debugHelpText,
-		Example: debugHelpEx,
-		Run:     targetDebugCmd,
-	}
-	targetCmd.AddCommand(debugCmd)
-
-	exportHelpText := formatHelp(`Export build targets from the current nest, and 
-		print them to standard output.  If the -a (or -export-all) option is 
-		specified, then all targets will be exported.  Otherwise, <target-name> 
-		must be specified, and only that target will be exported.`)
-	exportHelpEx := "  newt target export [-a -export-all] [<target-name>]\n"
-	exportHelpEx += "  newt target export -a > my_exports.txt\n"
-	exportHelpEx += "  newt target export my_target > my_target_export.txt"
-
-	exportCmd := &cobra.Command{
-		Use:     "export",
-		Short:   "Export target",
-		Long:    exportHelpText,
-		Example: exportHelpEx,
-		Run:     targetExportCmd,
-	}
-
-	exportCmd.PersistentFlags().BoolVarP(&ExportAll, "export-all", "a", false,
-		"If present, export all targets")
-
-	targetCmd.AddCommand(exportCmd)
-
-	importHelpText := formatHelp(`Import build targets from standard input.  If 
-		the -a (or -import-all) option is specified, then all targets will be 
-		imported.  Otherwise, a <target-name> must be specified, and only that 
-		target will be imported.`)
-	importHelpEx := "  newt target import [-a -import-all] [<target-name>]\n"
-	importHelpEx += "  newt target import -a < exported_targets.txt\n"
-	importHelpEx += "  newt target import ex_tgt_1 < exported_targets.txt"
-
-	importCmd := &cobra.Command{
-		Use:     "import",
-		Short:   "Import target",
-		Long:    importHelpText,
-		Example: importHelpEx,
-		Run:     targetImportCmd,
-	}
-
-	importCmd.PersistentFlags().BoolVarP(&ImportAll, "import-all", "a", false,
-		"If present, import all targets")
-
-	targetCmd.AddCommand(importCmd)
-
-	base.AddCommand(targetCmd)
-}
-
-func dispEgg(egg *cli.Egg) error {
-	cli.StatusMessage(cli.VERBOSITY_QUIET, "Egg %s, version %s\n",
-		egg.FullName, egg.Version)
-	cli.StatusMessage(cli.VERBOSITY_QUIET, "  path: %s\n",
-		filepath.Clean(egg.BasePath))
-	if egg.Capabilities != nil {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  capabilities: ")
-		caps, err := egg.GetCapabilities()
-		if err != nil {
-			return err
-		}
-		for _, capability := range caps {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-	if egg.ReqCapabilities != nil {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  required capabilities: ")
-		caps, err := egg.GetReqCapabilities()
-		if err != nil {
-			return err
-		}
-		for _, capability := range caps {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-	if len(egg.Deps) > 0 {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  deps: ")
-		for _, dep := range egg.Deps {
-			if dep == nil {
-				continue
-			}
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", dep)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-
-	if egg.LinkerScript != "" {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  linkerscript: %s\n",
-			egg.LinkerScript)
-	}
-	return nil
-}
-
-func dispEggShell(eggShell *cli.EggShell) error {
-	cli.StatusMessage(cli.VERBOSITY_QUIET, "Egg %s from clutch %s, version %s\n",
-		eggShell.FullName, eggShell.Clutch.Name, eggShell.Version)
-
-	if eggShell.Caps != nil {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  capabilities: ")
-		caps, err := eggShell.GetCapabilities()
-		if err != nil {
-			return err
-		}
-		for _, capability := range caps {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-	if eggShell.ReqCaps != nil {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  required capabilities: ")
-		caps, err := eggShell.GetReqCapabilities()
-		if err != nil {
-			return err
-		}
-		for _, capability := range caps {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-	if len(eggShell.Deps) > 0 {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  deps: ")
-		for _, dep := range eggShell.Deps {
-			if dep == nil {
-				continue
-			}
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", dep)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-
-	return nil
-}
-
-func eggListCmd(cmd *cobra.Command, args []string) {
-	eggMgr, err := cli.NewClutch(NewtNest)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	if err := eggMgr.LoadConfigs(nil, false); err != nil {
-		NewtUsage(cmd, err)
-	}
-	for _, egg := range eggMgr.Eggs {
-		if err := dispEgg(egg); err != nil {
-			NewtUsage(cmd, err)
-		}
-	}
-}
-
-func eggCheckDepsCmd(cmd *cobra.Command, args []string) {
-	eggMgr, err := cli.NewClutch(NewtNest)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := eggMgr.LoadConfigs(nil, false); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := eggMgr.CheckDeps(); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Dependencies successfully resolved!\n")
-}
-
-func eggHuntCmd(cmd *cobra.Command, args []string) {
-	var err error
-
-	if len(args) != 1 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify string to hunt for"))
-	}
-
-	/*
-	 * First check local.
-	 */
-	eggMgr, err := cli.NewClutch(NewtNest)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	if err := eggMgr.LoadConfigs(nil, false); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	found := false
-	for _, egg := range eggMgr.Eggs {
-		contains := strings.Contains(egg.FullName, args[0])
-		if contains == true {
-			cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Installed egg %s@%s\n",
-				egg.FullName, egg.Version)
-			found = true
-		}
-	}
-
-	/*
-	 * Then check remote clutches.
-	 */
-	clutches, err := NewtNest.GetClutches()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	for _, clutch := range clutches {
-		for _, eggShell := range clutch.EggShells {
-			contains := strings.Contains(eggShell.FullName, args[0])
-			if contains == true {
-				cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-					"Clutch %s has egg %s@%s\n",
-					clutch.Name, eggShell.FullName,
-					eggShell.Version)
-				found = true
-			}
-		}
-	}
-
-	if found == false {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "No egg found!\n")
-	}
-}
-
-func eggShowCmd(cmd *cobra.Command, args []string) {
-	var eggName string
-	var clutchName string = ""
-
-	if len(args) < 1 || len(args) > 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify full name of the egg"))
-	}
-
-	if len(args) == 1 {
-		eggName = args[0]
-	} else {
-		clutchName = args[0]
-		eggName = args[1]
-	}
-
-	eggMgr, err := cli.NewClutch(NewtNest)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	if err := eggMgr.LoadConfigs(nil, false); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	egg, err := eggMgr.ResolveEggName(eggName)
-	if err == nil {
-		egg.LoadConfig(nil, false)
-		dispEgg(egg)
-	}
-
-	clutches, err := NewtNest.GetClutches()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	for _, clutch := range clutches {
-		if clutchName == "" || clutch.Name == clutchName {
-			eggShell, err := clutch.ResolveEggShellName(eggName)
-			if err == nil {
-				dispEggShell(eggShell)
-			}
-		}
-	}
-}
-
-func eggShellInstall(eggShell *cli.EggShell) error {
-	eggMgr, err := cli.NewClutch(NewtNest)
-	if err != nil {
-		return err
-	}
-
-	if err := eggMgr.LoadConfigs(nil, false); err != nil {
-		return err
-	}
-
-	_, err = eggMgr.ResolveEggName(eggShell.FullName)
-	if err == nil {
-		return cli.NewNewtError(fmt.Sprintf("Egg %s already installed!",
-			eggShell.FullName))
-	}
-	err = eggShell.Install(eggMgr, NewtBranchEgg)
-	if err != nil {
-		return err
-	}
-	return nil
-}
-
-func eggInstallCmd(cmd *cobra.Command, args []string) {
-	var eggName string
-	var clutchName string = ""
-	var clutch *cli.Clutch
-	var eggShell *cli.EggShell
-
-	if len(args) < 1 || len(args) > 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify full name of the egg"))
-	}
-
-	if len(args) == 1 {
-		eggName = args[0]
-	} else {
-		clutchName = args[0]
-		eggName = args[1]
-	}
-
-	/*
-	 * Find the eggShell to install.
-	 */
-	clutches, err := NewtNest.GetClutches()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if clutchName != "" {
-		clutch = clutches[clutchName]
-	}
-	if clutch != nil {
-		eggShell, err := clutch.ResolveEggShellName(eggName)
-		if err != nil {
-			NewtUsage(cmd, err)
-		}
-		err = eggShellInstall(eggShell)
-		if err != nil {
-			NewtUsage(cmd, err)
-		}
-		cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Installation was a success!\n")
-		return
-	}
-	eggShell = nil
-	for _, tmpClutch := range clutches {
-		if clutchName == "" || tmpClutch.Name == clutchName {
-			tmpEggShell, err := tmpClutch.ResolveEggShellName(eggName)
-			if err != nil && eggShell != nil {
-				NewtUsage(cmd,
-					cli.NewNewtError(fmt.Sprintf("Ambiguous source "+
-						"egg %s in clutches %s and %s",
-						eggName, clutch.Name, tmpClutch.Name)))
-			} else {
-				eggShell = tmpEggShell
-				clutch = tmpClutch
-			}
-		}
-	}
-
-	if eggShell == nil {
-		NewtUsage(cmd,
-			cli.NewNewtError(fmt.Sprintf("Can't find egg with name %s",
-				eggName)))
-	}
-
-	err = eggShellInstall(eggShell)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Installation was a success!\n")
-}
-
-func eggRemoveCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 || len(args) > 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify full name of the egg"))
-	}
-
-	eggName := args[0]
-
-	eggMgr, err := cli.NewClutch(NewtNest)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	if err := eggMgr.LoadConfigs(nil, false); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	egg, err := eggMgr.ResolveEggName(eggName)
-	if err != nil {
-		NewtUsage(cmd,
-			cli.NewNewtError(fmt.Sprintf("Egg %s has not been installed",
-				eggName)))
-	}
-	err = egg.Remove()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Removed successfully!\n")
-}
-
-func eggAddCmds(baseCmd *cobra.Command) {
-	eggHelpText := formatHelp(`Commands to search, display and install eggs
-		in the current nest.  Eggs are newt's version of packages, and are 
-		the fundamental building blocks of nests.`)
-	eggHelpEx := "  newt egg list\n"
-	eggHelpEx += "  newt egg checkdeps\n"
-	eggHelpEx += "  newt egg hunt <egg-name>\n"
-	eggHelpEx += "  newt egg show [<clutch-name> ] <egg-name>\n"
-	eggHelpEx += "  newt egg install [<clutch-name> ] <egg-name>\n"
-	eggHelpEx += "  newt egg remove [<clutch-name> ] <egg-name>"
-
-	eggCmd := &cobra.Command{
-		Use:     "egg",
-		Short:   "Commands to list and inspect eggs on a nest",
-		Long:    eggHelpText,
-		Example: eggHelpEx,
-		PersistentPreRun: func(cmd *cobra.Command, args []string) {
-			cli.Init(NewtLogLevel, newtSilent, newtQuiet, newtVerbose)
-
-			var err error
-			NewtNest, err = cli.NewNest()
-			if err != nil {
-				NewtUsage(nil, err)
-			}
-		},
-		Run: func(cmd *cobra.Command, args []string) {
-			NewtUsage(cmd, nil)
-		},
-	}
-
-	listHelpText := formatHelp(`List all of the eggs in the current nest.`)
-	listHelpEx := "  newt egg list"
-
-	listCmd := &cobra.Command{
-		Use:     "list",
-		Short:   "List eggs in the current nest",
-		Long:    listHelpText,
-		Example: listHelpEx,
-		Run:     eggListCmd,
-	}
-
-	eggCmd.AddCommand(listCmd)
-
-	checkDepsHelpText := formatHelp(`Resolve all dependencies in the local 
-		nest.  This command goes through all eggs currently installed, checks
-		their dependencies, and prints any unresolved dependencies between 
-		eggs.`)
-	checkDepsHelpEx := "  newt egg checkdeps"
-
-	checkDepsCmd := &cobra.Command{
-		Use:     "checkdeps",
-		Short:   "Check egg dependencies",
-		Long:    checkDepsHelpText,
-		Example: checkDepsHelpEx,
-		Run:     eggCheckDepsCmd,
-	}
-
-	eggCmd.AddCommand(checkDepsCmd)
-
-	huntHelpText := formatHelp(`Hunt for an egg, specified by <egg-name>.  
-		The local nest, along with all remote nests (clutches) are 
-		searched.  All matched eggs are shown.`)
-	huntHelpEx := "  newt egg hunt <egg-name>"
-
-	huntCmd := &cobra.Command{
-		Use:     "hunt",
-		Short:   "Search for egg from clutches",
-		Long:    huntHelpText,
-		Example: huntHelpEx,
-		Run:     eggHuntCmd,
-	}
-
-	eggCmd.AddCommand(huntCmd)
-
-	showHelpText := formatHelp(`Show the contents of the egg, specified by 
-		<egg-name>.  <egg-name> is resolved using all the clutches installed
-		in the current nest or, if <clutch-name> is specified, only 
-		<clutch-name> will be searched.`)
-	showHelpEx := "  newt egg show [<clutch-name> ] <egg-name>"
-
-	showCmd := &cobra.Command{
-		Use:     "show",
-		Short:   "Show the contents of an egg.",
-		Long:    showHelpText,
-		Example: showHelpEx,
-		Run:     eggShowCmd,
-	}
-
-	eggCmd.AddCommand(showCmd)
-
-	installHelpText := formatHelp(`Install the egg specified by <egg-name> to 
-		the local nest. <egg-name> is searched for throughout the clutches in 
-		the local nest.  If <clutch-name> is specified, then only <clutch-name>
-		is searched for <egg-name>.`)
-	installHelpEx := "  newt egg install [<clutch-name> ] <egg-name>"
-
-	installCmd := &cobra.Command{
-		Use:     "install",
-		Short:   "Install an egg",
-		Long:    installHelpText,
-		Example: installHelpEx,
-		Run:     eggInstallCmd,
-	}
-
-	installCmd.Flags().StringVarP(&NewtBranchEgg, "branch", "b", "",
-		"Branch (or tag) of the clutch to install from.")
-
-	eggCmd.AddCommand(installCmd)
-
-	removeHelpText := formatHelp(`Remove the egg, specified by <egg-name> from 
-		the local nest.  If present the egg is taking only from the clutch 
-		specified by <clutch-name>.`)
-	removeHelpEx := "  newt egg remove [<clutch-name> ] <egg-name>"
-
-	removeCmd := &cobra.Command{
-		Use:     "remove",
-		Short:   "Remove an egg",
-		Long:    removeHelpText,
-		Example: removeHelpEx,
-		Run:     eggRemoveCmd,
-	}
-
-	eggCmd.AddCommand(removeCmd)
-
-	baseCmd.AddCommand(eggCmd)
-}
-
-func nestGenerateClutchCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify name and URL to lay clutch file"))
-	}
-
-	clutchName := args[0]
-	clutchUrl := args[1]
-
-	clutch, err := cli.NewClutch(NewtNest)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	clutch.Name = clutchName
-	clutch.RemoteUrl = clutchUrl
-
-	local, err := cli.NewClutch(NewtNest)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := clutch.LoadFromClutch(local); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	clutchStr, err := clutch.Serialize()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "%s", clutchStr)
-}
-
-func nestAddClutchCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify both name and URL to "+
-				"larva install command"))
-	}
-
-	name := args[0]
-	url := args[1]
-
-	clutch, err := cli.NewClutch(NewtNest)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := clutch.Install(name, url, NewtBranchClutch); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Clutch "+name+" successfully installed to Nest.\n")
-}
-
-func nestListClutchesCmd(cmd *cobra.Command, args []string) {
-	clutches, err := NewtNest.GetClutches()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	for name, clutch := range clutches {
-		cli.StatusMessage(cli.VERBOSITY_QUIET,
-			"Remote clutch %s (eggshells: %d)\n", name, len(clutch.EggShells))
-	}
-}
-
-func nestCreateCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify a nest name to create"))
-	}
-
-	wd, err := os.Getwd()
-	if err != nil {
-		NewtUsage(cmd, cli.NewNewtError(err.Error()))
-	}
-
-	nestDir := wd + "/" + args[0]
-	if len(args) > 1 {
-		nestDir = args[1]
-	}
-
-	tadpoleUrl := ""
-	if len(args) > 2 {
-		tadpoleUrl = args[2]
-	}
-
-	if err := cli.CreateNest(args[0], nestDir, tadpoleUrl); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Nest %s successfully created in %s\n", args[0], nestDir)
-}
-
-func nestShowClutchCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 1 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify a clutch name to show-clutch command"))
-	}
-
-	clutch, err := cli.NewClutch(NewtNest)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := clutch.Load(args[0]); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	// Clutch loaded, now print out clutch information
-	cli.StatusMessage(cli.VERBOSITY_QUIET, "Clutch Name: %s\n", clutch.Name)
-	cli.StatusMessage(cli.VERBOSITY_QUIET, "Clutch URL: %s\n",
-		clutch.RemoteUrl)
-
-	i := 0
-	for _, eggShell := range clutch.EggShells {
-		i++
-		cli.StatusMessage(cli.VERBOSITY_QUIET, " %s@%s", eggShell.FullName,
-			eggShell.Version)
-		if i%4 == 0 {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-		}
-	}
-	if i%4 != 0 {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-}
-
-func nestAddCmds(baseCmd *cobra.Command) {
-	var nestCmd *cobra.Command
-	var createCmd *cobra.Command
-
-	nestHelpText := formatHelp(`The nest commands help manage the local nest.
-		A nest represents the workspace for one or more projects, each project being a
-                collection of eggs (packages.)  In addition to containing eggs, a local nest contains the 
-		target (build) definitions, and a list of clutches (snapshots of remote nests 
-		which contain eggs that can be installed into the current nest.)`)
-	nestHelpEx := "  newt nest create <nest-name> [, <nest-skele-url>]\n"
-	nestHelpEx += "  newt nest list-clutches\n"
-	nestHelpEx += "  newt nest show-clutch <clutch-name>\n"
-	nestHelpEx += "  newt nest add-clutch <clutch-name> <clutch-url>\n"
-	nestHelpEx += "  newt nest generate-clutch <clutch-name> <clutch-url>"
-
-	nestCmd = &cobra.Command{
-		Use:     "nest",
-		Short:   "Commands to manage nests & clutches (remote egg repositories)",
-		Long:    nestHelpText,
-		Example: nestHelpEx,
-		PersistentPreRun: func(cmd *cobra.Command, args []string) {
-			cli.Init(NewtLogLevel, newtSilent, newtQuiet, newtVerbose)
-
-			var err error
-
-			if cmd != nestCmd && cmd != createCmd {
-				NewtNest, err = cli.NewNest()
-				if err != nil {
-					NewtUsage(cmd, err)
-				}
-			}
-		},
-		Run: func(cmd *cobra.Command, args []string) {
-			NewtUsage(cmd, nil)
-		},
-	}
-
-	createHelpText := formatHelp(`Create a new nest, specified by <nest-name>. 
-		If the optional <nest-url> parameter is specified, then download the 
-		skeleton of the nest file from that URL, instead of using the default.`)
-
-	createHelpEx := "  newt nest create <nest-name> [, <nest-url>]\n"
-	createHelpEx += "  newt nest create mynest"
-
-	createCmd = &cobra.Command{
-		Use:     "create",
-		Short:   "Create a new nest",
-		Long:    createHelpText,
-		Example: createHelpEx,
-		Run:     nestCreateCmd,
-	}
-
-	nestCmd.AddCommand(createCmd)
-
-	generateHelpText := formatHelp(`Generate a clutch file from a snapshot 
-	    of the eggs in the current directory.  generate-clutch takes two 
-		arguments, the name of the current nest and the URL at which 
-		the nest is located.`)
-
-	generateHelpEx := "  newt nest generate-clutch <name> <url>\n"
-	generateHelpEx += "  newt nest generate-clutch larva " +
-		"https://www.github.com/mynewt/larva"
-
-	generateCmd := &cobra.Command{
-		Use:     "generate-clutch",
-		Short:   "Generate a clutch file from the eggs in the current directory",
-		Long:    generateHelpText,
-		Example: generateHelpEx,
-		Run:     nestGenerateClutchCmd,
-	}
-
-	nestCmd.AddCommand(generateCmd)
-
-	addClutchHelpText := formatHelp(`Add a remote clutch to the current nest.
-	    When search for eggs to install, the clutch specified by clutch-name
-		and clutch-url will be searched for eggs that match the search.  This
-		includes both direct searches with newt egg hunt, as well as resolving
-		dependencies in egg.yml files.`)
-
-	addClutchHelpEx := "  newt nest add-clutch <clutch-name> <clutch-url>\n"
-	addClutchHelpEx += "  newt nest add-clutch larva " +
-		"https://www.github.com/mynewt/larva"
-
-	addClutchCmd := &cobra.Command{
-		Use:     "add-clutch",
-		Short:   "Add a remote clutch, and put it in the current nest",
-		Long:    addClutchHelpText,
-		Example: addClutchHelpEx,
-		Run:     nestAddClutchCmd,
-	}
-
-	addClutchCmd.Flags().StringVarP(&NewtBranchClutch, "branch", "b", "master",
-		"Branch (or tag) of the clutch to install from.")
-
-	nestCmd.AddCommand(addClutchCmd)
-
-	listClutchesHelpText := formatHelp(`List the clutches installed in the current
-		nest.  A clutch represents a collection of eggs in a nest.  List clutches
-		includes the current nest, along with any remote clutches that have been 
-		added using the add-clutch command.`)
-
-	listClutchesHelpEx := "  newt nest list-clutches"
-
-	listClutchesCmd := &cobra.Command{
-		Use:     "list-clutches",
-		Short:   "List the clutches installed in the current nest",
-		Long:    listClutchesHelpText,
-		Example: listClutchesHelpEx,
-		Run:     nestListClutchesCmd,
-	}
-
-	nestCmd.AddCommand(listClutchesCmd)
-
-	showClutchHelpText := formatHelp(`Show information about a clutch, given by the 
-		<clutch-name> parameter.  Displays the clutch name, URL and packages 
-		associated with a given clutch.`)
-
-	showClutchHelpEx := "  newt nest show-clutch <clutch-name>\n"
-	showClutchHelpEx += "  newt nest show-clutch larva"
-
-	showClutchCmd := &cobra.Command{
-		Use:     "show-clutch",
-		Short:   "Show an individual clutch in the current nest",
-		Long:    showClutchHelpText,
-		Example: showClutchHelpEx,
-		Run:     nestShowClutchCmd,
-	}
-
-	nestCmd.AddCommand(showClutchCmd)
-
-	baseCmd.AddCommand(nestCmd)
-}
-
-func parseCmds() *cobra.Command {
-	newtHelpText := formatHelp(`Newt allows you to create your own embedded 
-		project based on the Mynewt operating system.  Newt provides both 
-		build and package management in a single tool, which allows you to 
-		compose an embedded workspace, and set of projects, and then build
-		the necessary artifacts from those projects.  For more information 
-		on the Mynewt operating system, please visit 
-		https://www.github.com/mynewt/documentation.`)
-	newtHelpText += "\n\n" + formatHelp(`Please use the newt help command, 
-		and specify the name of the command you want help for, for help on 
-		how to use a specific command`)
-	newtHelpEx := "  newt\n"
-	newtHelpEx += "  newt help [<command-name>]\n"
-	newtHelpEx += "    For help on <command-name>.  If not specified, " +
-		"print this message."
-
-	newtCmd := &cobra.Command{
-		Use:     "newt",
-		Short:   "Newt is a tool to help you compose and build your own OS",
-		Long:    newtHelpText,
-		Example: newtHelpEx,
-		Run: func(cmd *cobra.Command, args []string) {
-			cmd.Help()
-		},
-	}
-
-	newtCmd.PersistentFlags().BoolVarP(&newtVerbose, "verbose", "v", false,
-		"Enable verbose output when executing commands.")
-	newtCmd.PersistentFlags().BoolVarP(&newtQuiet, "quiet", "q", false,
-		"Be quiet; only display error output.")
-	newtCmd.PersistentFlags().BoolVarP(&newtSilent, "silent", "s", false,
-		"Be silent; don't output anything.")
-	newtCmd.PersistentFlags().StringVarP(&NewtLogLevel, "loglevel", "l",
-		"WARN", "Log level, defaults to WARN.")
-
-	versHelpText := formatHelp(`Display the Newt version number.`)
-	versHelpEx := "  newt version"
-	versCmd := &cobra.Command{
-		Use:     "version",
-		Short:   "Display the Newt version number.",
-		Long:    versHelpText,
-		Example: versHelpEx,
-		Run: func(cmd *cobra.Command, args []string) {
-			fmt.Printf("Newt version: %s\n", NewtVersion)
-		},
-	}
-
-	newtCmd.AddCommand(versCmd)
-
-	targetAddCmds(newtCmd)
-	eggAddCmds(newtCmd)
-	nestAddCmds(newtCmd)
-
-	return newtCmd
-}
-
-func main() {
-	cmd := parseCmds()
-	cmd.Execute()
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/Godeps.json
----------------------------------------------------------------------
diff --git a/newt/Godeps/Godeps.json b/newt/Godeps/Godeps.json
new file mode 100644
index 0000000..ff5e92a
--- /dev/null
+++ b/newt/Godeps/Godeps.json
@@ -0,0 +1,70 @@
+{
+	"ImportPath": "github.com/mynewt/newt",
+	"GoVersion": "go1.4.2",
+	"Deps": [
+		{
+			"ImportPath": "github.com/BurntSushi/toml",
+			"Comment": "v0.1.0-21-g056c9bc",
+			"Rev": "056c9bc7be7190eaa7715723883caffa5f8fa3e4"
+		},
+		{
+			"ImportPath": "github.com/andelf/go-curl",
+			"Comment": "compatible-with-go-release.r60-63-gc965868",
+			"Rev": "c965868dde67fef2abe524c33f1661d9ad233fac"
+		},
+		{
+			"ImportPath": "github.com/hashicorp/logutils",
+			"Rev": "0dc08b1671f34c4250ce212759ebd880f743d883"
+		},
+		{
+			"ImportPath": "github.com/inconshreveable/mousetrap",
+			"Rev": "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
+		},
+		{
+			"ImportPath": "github.com/kr/pretty",
+			"Comment": "go.weekly.2011-12-22-27-ge6ac2fc",
+			"Rev": "e6ac2fc51e89a3249e82157fa0bb7a18ef9dd5bb"
+		},
+		{
+			"ImportPath": "github.com/kr/text",
+			"Rev": "e373e137fafd8abd480af49182dea0513914adb4"
+		},
+		{
+			"ImportPath": "github.com/magiconair/properties",
+			"Comment": "v1.5.3",
+			"Rev": "624009598839a9432bd97bb75552389422357723"
+		},
+		{
+			"ImportPath": "github.com/mattn/go-sqlite3",
+			"Rev": "542ae647f8601bafd96233961b150cae198e0295"
+		},
+		{
+			"ImportPath": "github.com/mitchellh/mapstructure",
+			"Rev": "2caf8efc93669b6c43e0441cdc6aed17546c96f3"
+		},
+		{
+			"ImportPath": "github.com/spf13/cast",
+			"Rev": "4d07383ffe94b5e5a6fa3af9211374a4507a0184"
+		},
+		{
+			"ImportPath": "github.com/spf13/cobra",
+			"Rev": "66816bcd0378e248c613e3c443c020f544c28804"
+		},
+		{
+			"ImportPath": "github.com/spf13/jwalterweatherman",
+			"Rev": "3d60171a64319ef63c78bd45bd60e6eab1e75f8b"
+		},
+		{
+			"ImportPath": "github.com/spf13/pflag",
+			"Rev": "67cbc198fd11dab704b214c1e629a97af392c085"
+		},
+		{
+			"ImportPath": "github.com/spf13/viper",
+			"Rev": "db7ff930a189b98d602179d9001d33345f42b8c7"
+		},
+		{
+			"ImportPath": "gopkg.in/yaml.v2",
+			"Rev": "c1cd2254a6dd314c9d73c338c12688c9325d85c6"
+		}
+	]
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/Readme
----------------------------------------------------------------------
diff --git a/newt/Godeps/Readme b/newt/Godeps/Readme
new file mode 100644
index 0000000..4cdaa53
--- /dev/null
+++ b/newt/Godeps/Readme
@@ -0,0 +1,5 @@
+This directory tree is generated automatically by godep.
+
+Please do not edit.
+
+See https://github.com/tools/godep for more information.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/.gitignore b/newt/Godeps/_workspace/.gitignore
new file mode 100644
index 0000000..f037d68
--- /dev/null
+++ b/newt/Godeps/_workspace/.gitignore
@@ -0,0 +1,2 @@
+/pkg
+/bin

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/.gitignore b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/.gitignore
new file mode 100644
index 0000000..0cd3800
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/.gitignore
@@ -0,0 +1,5 @@
+TAGS
+tags
+.*.swp
+tomlcheck/tomlcheck
+toml.test

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/.travis.yml
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/.travis.yml b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/.travis.yml
new file mode 100644
index 0000000..43caf6d
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/.travis.yml
@@ -0,0 +1,12 @@
+language: go
+go:
+  - 1.1
+  - 1.2
+  - tip
+install:
+  - go install ./...
+  - go get github.com/BurntSushi/toml-test
+script:
+  - export PATH="$PATH:$HOME/gopath/bin"
+  - make test
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/COMPATIBLE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/COMPATIBLE b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/COMPATIBLE
new file mode 100644
index 0000000..21e0938
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/COMPATIBLE
@@ -0,0 +1,3 @@
+Compatible with TOML version
+[v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md)
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/COPYING
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/COPYING b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/COPYING
new file mode 100644
index 0000000..5a8e332
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/COPYING
@@ -0,0 +1,14 @@
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+                    Version 2, December 2004
+
+ Copyright (C) 2004 Sam Hocevar <sa...@hocevar.net>
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. You just DO WHAT THE FUCK YOU WANT TO.
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/Makefile
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/Makefile b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/Makefile
new file mode 100644
index 0000000..3600848
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/Makefile
@@ -0,0 +1,19 @@
+install:
+	go install ./...
+
+test: install
+	go test -v
+	toml-test toml-test-decoder
+	toml-test -encoder toml-test-encoder
+
+fmt:
+	gofmt -w *.go */*.go
+	colcheck *.go */*.go
+
+tags:
+	find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS
+
+push:
+	git push origin master
+	git push github master
+



[26/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/parserc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/parserc.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/parserc.go
deleted file mode 100644
index 0a7037a..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/parserc.go
+++ /dev/null
@@ -1,1096 +0,0 @@
-package yaml
-
-import (
-	"bytes"
-)
-
-// The parser implements the following grammar:
-//
-// stream               ::= STREAM-START implicit_document? explicit_document* STREAM-END
-// implicit_document    ::= block_node DOCUMENT-END*
-// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
-// block_node_or_indentless_sequence    ::=
-//                          ALIAS
-//                          | properties (block_content | indentless_block_sequence)?
-//                          | block_content
-//                          | indentless_block_sequence
-// block_node           ::= ALIAS
-//                          | properties block_content?
-//                          | block_content
-// flow_node            ::= ALIAS
-//                          | properties flow_content?
-//                          | flow_content
-// properties           ::= TAG ANCHOR? | ANCHOR TAG?
-// block_content        ::= block_collection | flow_collection | SCALAR
-// flow_content         ::= flow_collection | SCALAR
-// block_collection     ::= block_sequence | block_mapping
-// flow_collection      ::= flow_sequence | flow_mapping
-// block_sequence       ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
-// indentless_sequence  ::= (BLOCK-ENTRY block_node?)+
-// block_mapping        ::= BLOCK-MAPPING_START
-//                          ((KEY block_node_or_indentless_sequence?)?
-//                          (VALUE block_node_or_indentless_sequence?)?)*
-//                          BLOCK-END
-// flow_sequence        ::= FLOW-SEQUENCE-START
-//                          (flow_sequence_entry FLOW-ENTRY)*
-//                          flow_sequence_entry?
-//                          FLOW-SEQUENCE-END
-// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-// flow_mapping         ::= FLOW-MAPPING-START
-//                          (flow_mapping_entry FLOW-ENTRY)*
-//                          flow_mapping_entry?
-//                          FLOW-MAPPING-END
-// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-
-// Peek the next token in the token queue.
-func peek_token(parser *yaml_parser_t) *yaml_token_t {
-	if parser.token_available || yaml_parser_fetch_more_tokens(parser) {
-		return &parser.tokens[parser.tokens_head]
-	}
-	return nil
-}
-
-// Remove the next token from the queue (must be called after peek_token).
-func skip_token(parser *yaml_parser_t) {
-	parser.token_available = false
-	parser.tokens_parsed++
-	parser.stream_end_produced = parser.tokens[parser.tokens_head].typ == yaml_STREAM_END_TOKEN
-	parser.tokens_head++
-}
-
-// Get the next event.
-func yaml_parser_parse(parser *yaml_parser_t, event *yaml_event_t) bool {
-	// Erase the event object.
-	*event = yaml_event_t{}
-
-	// No events after the end of the stream or error.
-	if parser.stream_end_produced || parser.error != yaml_NO_ERROR || parser.state == yaml_PARSE_END_STATE {
-		return true
-	}
-
-	// Generate the next event.
-	return yaml_parser_state_machine(parser, event)
-}
-
-// Set parser error.
-func yaml_parser_set_parser_error(parser *yaml_parser_t, problem string, problem_mark yaml_mark_t) bool {
-	parser.error = yaml_PARSER_ERROR
-	parser.problem = problem
-	parser.problem_mark = problem_mark
-	return false
-}
-
-func yaml_parser_set_parser_error_context(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string, problem_mark yaml_mark_t) bool {
-	parser.error = yaml_PARSER_ERROR
-	parser.context = context
-	parser.context_mark = context_mark
-	parser.problem = problem
-	parser.problem_mark = problem_mark
-	return false
-}
-
-// State dispatcher.
-func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool {
-	//trace("yaml_parser_state_machine", "state:", parser.state.String())
-
-	switch parser.state {
-	case yaml_PARSE_STREAM_START_STATE:
-		return yaml_parser_parse_stream_start(parser, event)
-
-	case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE:
-		return yaml_parser_parse_document_start(parser, event, true)
-
-	case yaml_PARSE_DOCUMENT_START_STATE:
-		return yaml_parser_parse_document_start(parser, event, false)
-
-	case yaml_PARSE_DOCUMENT_CONTENT_STATE:
-		return yaml_parser_parse_document_content(parser, event)
-
-	case yaml_PARSE_DOCUMENT_END_STATE:
-		return yaml_parser_parse_document_end(parser, event)
-
-	case yaml_PARSE_BLOCK_NODE_STATE:
-		return yaml_parser_parse_node(parser, event, true, false)
-
-	case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:
-		return yaml_parser_parse_node(parser, event, true, true)
-
-	case yaml_PARSE_FLOW_NODE_STATE:
-		return yaml_parser_parse_node(parser, event, false, false)
-
-	case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:
-		return yaml_parser_parse_block_sequence_entry(parser, event, true)
-
-	case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:
-		return yaml_parser_parse_block_sequence_entry(parser, event, false)
-
-	case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:
-		return yaml_parser_parse_indentless_sequence_entry(parser, event)
-
-	case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:
-		return yaml_parser_parse_block_mapping_key(parser, event, true)
-
-	case yaml_PARSE_BLOCK_MAPPING_KEY_STATE:
-		return yaml_parser_parse_block_mapping_key(parser, event, false)
-
-	case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE:
-		return yaml_parser_parse_block_mapping_value(parser, event)
-
-	case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:
-		return yaml_parser_parse_flow_sequence_entry(parser, event, true)
-
-	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE:
-		return yaml_parser_parse_flow_sequence_entry(parser, event, false)
-
-	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:
-		return yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event)
-
-	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:
-		return yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event)
-
-	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:
-		return yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event)
-
-	case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:
-		return yaml_parser_parse_flow_mapping_key(parser, event, true)
-
-	case yaml_PARSE_FLOW_MAPPING_KEY_STATE:
-		return yaml_parser_parse_flow_mapping_key(parser, event, false)
-
-	case yaml_PARSE_FLOW_MAPPING_VALUE_STATE:
-		return yaml_parser_parse_flow_mapping_value(parser, event, false)
-
-	case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:
-		return yaml_parser_parse_flow_mapping_value(parser, event, true)
-
-	default:
-		panic("invalid parser state")
-	}
-	return false
-}
-
-// Parse the production:
-// stream   ::= STREAM-START implicit_document? explicit_document* STREAM-END
-//              ************
-func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool {
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-	if token.typ != yaml_STREAM_START_TOKEN {
-		return yaml_parser_set_parser_error(parser, "did not find expected <stream-start>", token.start_mark)
-	}
-	parser.state = yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE
-	*event = yaml_event_t{
-		typ:        yaml_STREAM_START_EVENT,
-		start_mark: token.start_mark,
-		end_mark:   token.end_mark,
-		encoding:   token.encoding,
-	}
-	skip_token(parser)
-	return true
-}
-
-// Parse the productions:
-// implicit_document    ::= block_node DOCUMENT-END*
-//                          *
-// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
-//                          *************************
-func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool {
-
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-
-	// Parse extra document end indicators.
-	if !implicit {
-		for token.typ == yaml_DOCUMENT_END_TOKEN {
-			skip_token(parser)
-			token = peek_token(parser)
-			if token == nil {
-				return false
-			}
-		}
-	}
-
-	if implicit && token.typ != yaml_VERSION_DIRECTIVE_TOKEN &&
-		token.typ != yaml_TAG_DIRECTIVE_TOKEN &&
-		token.typ != yaml_DOCUMENT_START_TOKEN &&
-		token.typ != yaml_STREAM_END_TOKEN {
-		// Parse an implicit document.
-		if !yaml_parser_process_directives(parser, nil, nil) {
-			return false
-		}
-		parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE)
-		parser.state = yaml_PARSE_BLOCK_NODE_STATE
-
-		*event = yaml_event_t{
-			typ:        yaml_DOCUMENT_START_EVENT,
-			start_mark: token.start_mark,
-			end_mark:   token.end_mark,
-		}
-
-	} else if token.typ != yaml_STREAM_END_TOKEN {
-		// Parse an explicit document.
-		var version_directive *yaml_version_directive_t
-		var tag_directives []yaml_tag_directive_t
-		start_mark := token.start_mark
-		if !yaml_parser_process_directives(parser, &version_directive, &tag_directives) {
-			return false
-		}
-		token = peek_token(parser)
-		if token == nil {
-			return false
-		}
-		if token.typ != yaml_DOCUMENT_START_TOKEN {
-			yaml_parser_set_parser_error(parser,
-				"did not find expected <document start>", token.start_mark)
-			return false
-		}
-		parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE)
-		parser.state = yaml_PARSE_DOCUMENT_CONTENT_STATE
-		end_mark := token.end_mark
-
-		*event = yaml_event_t{
-			typ:               yaml_DOCUMENT_START_EVENT,
-			start_mark:        start_mark,
-			end_mark:          end_mark,
-			version_directive: version_directive,
-			tag_directives:    tag_directives,
-			implicit:          false,
-		}
-		skip_token(parser)
-
-	} else {
-		// Parse the stream end.
-		parser.state = yaml_PARSE_END_STATE
-		*event = yaml_event_t{
-			typ:        yaml_STREAM_END_EVENT,
-			start_mark: token.start_mark,
-			end_mark:   token.end_mark,
-		}
-		skip_token(parser)
-	}
-
-	return true
-}
-
-// Parse the productions:
-// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
-//                                                    ***********
-//
-func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool {
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-	if token.typ == yaml_VERSION_DIRECTIVE_TOKEN ||
-		token.typ == yaml_TAG_DIRECTIVE_TOKEN ||
-		token.typ == yaml_DOCUMENT_START_TOKEN ||
-		token.typ == yaml_DOCUMENT_END_TOKEN ||
-		token.typ == yaml_STREAM_END_TOKEN {
-		parser.state = parser.states[len(parser.states)-1]
-		parser.states = parser.states[:len(parser.states)-1]
-		return yaml_parser_process_empty_scalar(parser, event,
-			token.start_mark)
-	}
-	return yaml_parser_parse_node(parser, event, true, false)
-}
-
-// Parse the productions:
-// implicit_document    ::= block_node DOCUMENT-END*
-//                                     *************
-// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
-//
-func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool {
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-
-	start_mark := token.start_mark
-	end_mark := token.start_mark
-
-	implicit := true
-	if token.typ == yaml_DOCUMENT_END_TOKEN {
-		end_mark = token.end_mark
-		skip_token(parser)
-		implicit = false
-	}
-
-	parser.tag_directives = parser.tag_directives[:0]
-
-	parser.state = yaml_PARSE_DOCUMENT_START_STATE
-	*event = yaml_event_t{
-		typ:        yaml_DOCUMENT_END_EVENT,
-		start_mark: start_mark,
-		end_mark:   end_mark,
-		implicit:   implicit,
-	}
-	return true
-}
-
-// Parse the productions:
-// block_node_or_indentless_sequence    ::=
-//                          ALIAS
-//                          *****
-//                          | properties (block_content | indentless_block_sequence)?
-//                            **********  *
-//                          | block_content | indentless_block_sequence
-//                            *
-// block_node           ::= ALIAS
-//                          *****
-//                          | properties block_content?
-//                            ********** *
-//                          | block_content
-//                            *
-// flow_node            ::= ALIAS
-//                          *****
-//                          | properties flow_content?
-//                            ********** *
-//                          | flow_content
-//                            *
-// properties           ::= TAG ANCHOR? | ANCHOR TAG?
-//                          *************************
-// block_content        ::= block_collection | flow_collection | SCALAR
-//                                                               ******
-// flow_content         ::= flow_collection | SCALAR
-//                                            ******
-func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool {
-	//defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)()
-
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-
-	if token.typ == yaml_ALIAS_TOKEN {
-		parser.state = parser.states[len(parser.states)-1]
-		parser.states = parser.states[:len(parser.states)-1]
-		*event = yaml_event_t{
-			typ:        yaml_ALIAS_EVENT,
-			start_mark: token.start_mark,
-			end_mark:   token.end_mark,
-			anchor:     token.value,
-		}
-		skip_token(parser)
-		return true
-	}
-
-	start_mark := token.start_mark
-	end_mark := token.start_mark
-
-	var tag_token bool
-	var tag_handle, tag_suffix, anchor []byte
-	var tag_mark yaml_mark_t
-	if token.typ == yaml_ANCHOR_TOKEN {
-		anchor = token.value
-		start_mark = token.start_mark
-		end_mark = token.end_mark
-		skip_token(parser)
-		token = peek_token(parser)
-		if token == nil {
-			return false
-		}
-		if token.typ == yaml_TAG_TOKEN {
-			tag_token = true
-			tag_handle = token.value
-			tag_suffix = token.suffix
-			tag_mark = token.start_mark
-			end_mark = token.end_mark
-			skip_token(parser)
-			token = peek_token(parser)
-			if token == nil {
-				return false
-			}
-		}
-	} else if token.typ == yaml_TAG_TOKEN {
-		tag_token = true
-		tag_handle = token.value
-		tag_suffix = token.suffix
-		start_mark = token.start_mark
-		tag_mark = token.start_mark
-		end_mark = token.end_mark
-		skip_token(parser)
-		token = peek_token(parser)
-		if token == nil {
-			return false
-		}
-		if token.typ == yaml_ANCHOR_TOKEN {
-			anchor = token.value
-			end_mark = token.end_mark
-			skip_token(parser)
-			token = peek_token(parser)
-			if token == nil {
-				return false
-			}
-		}
-	}
-
-	var tag []byte
-	if tag_token {
-		if len(tag_handle) == 0 {
-			tag = tag_suffix
-			tag_suffix = nil
-		} else {
-			for i := range parser.tag_directives {
-				if bytes.Equal(parser.tag_directives[i].handle, tag_handle) {
-					tag = append([]byte(nil), parser.tag_directives[i].prefix...)
-					tag = append(tag, tag_suffix...)
-					break
-				}
-			}
-			if len(tag) == 0 {
-				yaml_parser_set_parser_error_context(parser,
-					"while parsing a node", start_mark,
-					"found undefined tag handle", tag_mark)
-				return false
-			}
-		}
-	}
-
-	implicit := len(tag) == 0
-	if indentless_sequence && token.typ == yaml_BLOCK_ENTRY_TOKEN {
-		end_mark = token.end_mark
-		parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE
-		*event = yaml_event_t{
-			typ:        yaml_SEQUENCE_START_EVENT,
-			start_mark: start_mark,
-			end_mark:   end_mark,
-			anchor:     anchor,
-			tag:        tag,
-			implicit:   implicit,
-			style:      yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE),
-		}
-		return true
-	}
-	if token.typ == yaml_SCALAR_TOKEN {
-		var plain_implicit, quoted_implicit bool
-		end_mark = token.end_mark
-		if (len(tag) == 0 && token.style == yaml_PLAIN_SCALAR_STYLE) || (len(tag) == 1 && tag[0] == '!') {
-			plain_implicit = true
-		} else if len(tag) == 0 {
-			quoted_implicit = true
-		}
-		parser.state = parser.states[len(parser.states)-1]
-		parser.states = parser.states[:len(parser.states)-1]
-
-		*event = yaml_event_t{
-			typ:             yaml_SCALAR_EVENT,
-			start_mark:      start_mark,
-			end_mark:        end_mark,
-			anchor:          anchor,
-			tag:             tag,
-			value:           token.value,
-			implicit:        plain_implicit,
-			quoted_implicit: quoted_implicit,
-			style:           yaml_style_t(token.style),
-		}
-		skip_token(parser)
-		return true
-	}
-	if token.typ == yaml_FLOW_SEQUENCE_START_TOKEN {
-		// [Go] Some of the events below can be merged as they differ only on style.
-		end_mark = token.end_mark
-		parser.state = yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE
-		*event = yaml_event_t{
-			typ:        yaml_SEQUENCE_START_EVENT,
-			start_mark: start_mark,
-			end_mark:   end_mark,
-			anchor:     anchor,
-			tag:        tag,
-			implicit:   implicit,
-			style:      yaml_style_t(yaml_FLOW_SEQUENCE_STYLE),
-		}
-		return true
-	}
-	if token.typ == yaml_FLOW_MAPPING_START_TOKEN {
-		end_mark = token.end_mark
-		parser.state = yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE
-		*event = yaml_event_t{
-			typ:        yaml_MAPPING_START_EVENT,
-			start_mark: start_mark,
-			end_mark:   end_mark,
-			anchor:     anchor,
-			tag:        tag,
-			implicit:   implicit,
-			style:      yaml_style_t(yaml_FLOW_MAPPING_STYLE),
-		}
-		return true
-	}
-	if block && token.typ == yaml_BLOCK_SEQUENCE_START_TOKEN {
-		end_mark = token.end_mark
-		parser.state = yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE
-		*event = yaml_event_t{
-			typ:        yaml_SEQUENCE_START_EVENT,
-			start_mark: start_mark,
-			end_mark:   end_mark,
-			anchor:     anchor,
-			tag:        tag,
-			implicit:   implicit,
-			style:      yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE),
-		}
-		return true
-	}
-	if block && token.typ == yaml_BLOCK_MAPPING_START_TOKEN {
-		end_mark = token.end_mark
-		parser.state = yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE
-		*event = yaml_event_t{
-			typ:        yaml_MAPPING_START_EVENT,
-			start_mark: start_mark,
-			end_mark:   end_mark,
-			anchor:     anchor,
-			tag:        tag,
-			implicit:   implicit,
-			style:      yaml_style_t(yaml_BLOCK_MAPPING_STYLE),
-		}
-		return true
-	}
-	if len(anchor) > 0 || len(tag) > 0 {
-		parser.state = parser.states[len(parser.states)-1]
-		parser.states = parser.states[:len(parser.states)-1]
-
-		*event = yaml_event_t{
-			typ:             yaml_SCALAR_EVENT,
-			start_mark:      start_mark,
-			end_mark:        end_mark,
-			anchor:          anchor,
-			tag:             tag,
-			implicit:        implicit,
-			quoted_implicit: false,
-			style:           yaml_style_t(yaml_PLAIN_SCALAR_STYLE),
-		}
-		return true
-	}
-
-	context := "while parsing a flow node"
-	if block {
-		context = "while parsing a block node"
-	}
-	yaml_parser_set_parser_error_context(parser, context, start_mark,
-		"did not find expected node content", token.start_mark)
-	return false
-}
-
-// Parse the productions:
-// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
-//                    ********************  *********** *             *********
-//
-func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
-	if first {
-		token := peek_token(parser)
-		parser.marks = append(parser.marks, token.start_mark)
-		skip_token(parser)
-	}
-
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-
-	if token.typ == yaml_BLOCK_ENTRY_TOKEN {
-		mark := token.end_mark
-		skip_token(parser)
-		token = peek_token(parser)
-		if token == nil {
-			return false
-		}
-		if token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_BLOCK_END_TOKEN {
-			parser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE)
-			return yaml_parser_parse_node(parser, event, true, false)
-		} else {
-			parser.state = yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE
-			return yaml_parser_process_empty_scalar(parser, event, mark)
-		}
-	}
-	if token.typ == yaml_BLOCK_END_TOKEN {
-		parser.state = parser.states[len(parser.states)-1]
-		parser.states = parser.states[:len(parser.states)-1]
-		parser.marks = parser.marks[:len(parser.marks)-1]
-
-		*event = yaml_event_t{
-			typ:        yaml_SEQUENCE_END_EVENT,
-			start_mark: token.start_mark,
-			end_mark:   token.end_mark,
-		}
-
-		skip_token(parser)
-		return true
-	}
-
-	context_mark := parser.marks[len(parser.marks)-1]
-	parser.marks = parser.marks[:len(parser.marks)-1]
-	return yaml_parser_set_parser_error_context(parser,
-		"while parsing a block collection", context_mark,
-		"did not find expected '-' indicator", token.start_mark)
-}
-
-// Parse the productions:
-// indentless_sequence  ::= (BLOCK-ENTRY block_node?)+
-//                           *********** *
-func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool {
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-
-	if token.typ == yaml_BLOCK_ENTRY_TOKEN {
-		mark := token.end_mark
-		skip_token(parser)
-		token = peek_token(parser)
-		if token == nil {
-			return false
-		}
-		if token.typ != yaml_BLOCK_ENTRY_TOKEN &&
-			token.typ != yaml_KEY_TOKEN &&
-			token.typ != yaml_VALUE_TOKEN &&
-			token.typ != yaml_BLOCK_END_TOKEN {
-			parser.states = append(parser.states, yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE)
-			return yaml_parser_parse_node(parser, event, true, false)
-		}
-		parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE
-		return yaml_parser_process_empty_scalar(parser, event, mark)
-	}
-	parser.state = parser.states[len(parser.states)-1]
-	parser.states = parser.states[:len(parser.states)-1]
-
-	*event = yaml_event_t{
-		typ:        yaml_SEQUENCE_END_EVENT,
-		start_mark: token.start_mark,
-		end_mark:   token.start_mark, // [Go] Shouldn't this be token.end_mark?
-	}
-	return true
-}
-
-// Parse the productions:
-// block_mapping        ::= BLOCK-MAPPING_START
-//                          *******************
-//                          ((KEY block_node_or_indentless_sequence?)?
-//                            *** *
-//                          (VALUE block_node_or_indentless_sequence?)?)*
-//
-//                          BLOCK-END
-//                          *********
-//
-func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
-	if first {
-		token := peek_token(parser)
-		parser.marks = append(parser.marks, token.start_mark)
-		skip_token(parser)
-	}
-
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-
-	if token.typ == yaml_KEY_TOKEN {
-		mark := token.end_mark
-		skip_token(parser)
-		token = peek_token(parser)
-		if token == nil {
-			return false
-		}
-		if token.typ != yaml_KEY_TOKEN &&
-			token.typ != yaml_VALUE_TOKEN &&
-			token.typ != yaml_BLOCK_END_TOKEN {
-			parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_VALUE_STATE)
-			return yaml_parser_parse_node(parser, event, true, true)
-		} else {
-			parser.state = yaml_PARSE_BLOCK_MAPPING_VALUE_STATE
-			return yaml_parser_process_empty_scalar(parser, event, mark)
-		}
-	} else if token.typ == yaml_BLOCK_END_TOKEN {
-		parser.state = parser.states[len(parser.states)-1]
-		parser.states = parser.states[:len(parser.states)-1]
-		parser.marks = parser.marks[:len(parser.marks)-1]
-		*event = yaml_event_t{
-			typ:        yaml_MAPPING_END_EVENT,
-			start_mark: token.start_mark,
-			end_mark:   token.end_mark,
-		}
-		skip_token(parser)
-		return true
-	}
-
-	context_mark := parser.marks[len(parser.marks)-1]
-	parser.marks = parser.marks[:len(parser.marks)-1]
-	return yaml_parser_set_parser_error_context(parser,
-		"while parsing a block mapping", context_mark,
-		"did not find expected key", token.start_mark)
-}
-
-// Parse the productions:
-// block_mapping        ::= BLOCK-MAPPING_START
-//
-//                          ((KEY block_node_or_indentless_sequence?)?
-//
-//                          (VALUE block_node_or_indentless_sequence?)?)*
-//                           ***** *
-//                          BLOCK-END
-//
-//
-func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool {
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-	if token.typ == yaml_VALUE_TOKEN {
-		mark := token.end_mark
-		skip_token(parser)
-		token = peek_token(parser)
-		if token == nil {
-			return false
-		}
-		if token.typ != yaml_KEY_TOKEN &&
-			token.typ != yaml_VALUE_TOKEN &&
-			token.typ != yaml_BLOCK_END_TOKEN {
-			parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_KEY_STATE)
-			return yaml_parser_parse_node(parser, event, true, true)
-		}
-		parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE
-		return yaml_parser_process_empty_scalar(parser, event, mark)
-	}
-	parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE
-	return yaml_parser_process_empty_scalar(parser, event, token.start_mark)
-}
-
-// Parse the productions:
-// flow_sequence        ::= FLOW-SEQUENCE-START
-//                          *******************
-//                          (flow_sequence_entry FLOW-ENTRY)*
-//                           *                   **********
-//                          flow_sequence_entry?
-//                          *
-//                          FLOW-SEQUENCE-END
-//                          *****************
-// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-//                          *
-//
-func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
-	if first {
-		token := peek_token(parser)
-		parser.marks = append(parser.marks, token.start_mark)
-		skip_token(parser)
-	}
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-	if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {
-		if !first {
-			if token.typ == yaml_FLOW_ENTRY_TOKEN {
-				skip_token(parser)
-				token = peek_token(parser)
-				if token == nil {
-					return false
-				}
-			} else {
-				context_mark := parser.marks[len(parser.marks)-1]
-				parser.marks = parser.marks[:len(parser.marks)-1]
-				return yaml_parser_set_parser_error_context(parser,
-					"while parsing a flow sequence", context_mark,
-					"did not find expected ',' or ']'", token.start_mark)
-			}
-		}
-
-		if token.typ == yaml_KEY_TOKEN {
-			parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE
-			*event = yaml_event_t{
-				typ:        yaml_MAPPING_START_EVENT,
-				start_mark: token.start_mark,
-				end_mark:   token.end_mark,
-				implicit:   true,
-				style:      yaml_style_t(yaml_FLOW_MAPPING_STYLE),
-			}
-			skip_token(parser)
-			return true
-		} else if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {
-			parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE)
-			return yaml_parser_parse_node(parser, event, false, false)
-		}
-	}
-
-	parser.state = parser.states[len(parser.states)-1]
-	parser.states = parser.states[:len(parser.states)-1]
-	parser.marks = parser.marks[:len(parser.marks)-1]
-
-	*event = yaml_event_t{
-		typ:        yaml_SEQUENCE_END_EVENT,
-		start_mark: token.start_mark,
-		end_mark:   token.end_mark,
-	}
-
-	skip_token(parser)
-	return true
-}
-
-//
-// Parse the productions:
-// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-//                                      *** *
-//
-func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool {
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-	if token.typ != yaml_VALUE_TOKEN &&
-		token.typ != yaml_FLOW_ENTRY_TOKEN &&
-		token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {
-		parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE)
-		return yaml_parser_parse_node(parser, event, false, false)
-	}
-	mark := token.end_mark
-	skip_token(parser)
-	parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE
-	return yaml_parser_process_empty_scalar(parser, event, mark)
-}
-
-// Parse the productions:
-// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-//                                                      ***** *
-//
-func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool {
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-	if token.typ == yaml_VALUE_TOKEN {
-		skip_token(parser)
-		token := peek_token(parser)
-		if token == nil {
-			return false
-		}
-		if token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {
-			parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE)
-			return yaml_parser_parse_node(parser, event, false, false)
-		}
-	}
-	parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE
-	return yaml_parser_process_empty_scalar(parser, event, token.start_mark)
-}
-
-// Parse the productions:
-// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-//                                                                      *
-//
-func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool {
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-	parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE
-	*event = yaml_event_t{
-		typ:        yaml_MAPPING_END_EVENT,
-		start_mark: token.start_mark,
-		end_mark:   token.start_mark, // [Go] Shouldn't this be end_mark?
-	}
-	return true
-}
-
-// Parse the productions:
-// flow_mapping         ::= FLOW-MAPPING-START
-//                          ******************
-//                          (flow_mapping_entry FLOW-ENTRY)*
-//                           *                  **********
-//                          flow_mapping_entry?
-//                          ******************
-//                          FLOW-MAPPING-END
-//                          ****************
-// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-//                          *           *** *
-//
-func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
-	if first {
-		token := peek_token(parser)
-		parser.marks = append(parser.marks, token.start_mark)
-		skip_token(parser)
-	}
-
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-
-	if token.typ != yaml_FLOW_MAPPING_END_TOKEN {
-		if !first {
-			if token.typ == yaml_FLOW_ENTRY_TOKEN {
-				skip_token(parser)
-				token = peek_token(parser)
-				if token == nil {
-					return false
-				}
-			} else {
-				context_mark := parser.marks[len(parser.marks)-1]
-				parser.marks = parser.marks[:len(parser.marks)-1]
-				return yaml_parser_set_parser_error_context(parser,
-					"while parsing a flow mapping", context_mark,
-					"did not find expected ',' or '}'", token.start_mark)
-			}
-		}
-
-		if token.typ == yaml_KEY_TOKEN {
-			skip_token(parser)
-			token = peek_token(parser)
-			if token == nil {
-				return false
-			}
-			if token.typ != yaml_VALUE_TOKEN &&
-				token.typ != yaml_FLOW_ENTRY_TOKEN &&
-				token.typ != yaml_FLOW_MAPPING_END_TOKEN {
-				parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_VALUE_STATE)
-				return yaml_parser_parse_node(parser, event, false, false)
-			} else {
-				parser.state = yaml_PARSE_FLOW_MAPPING_VALUE_STATE
-				return yaml_parser_process_empty_scalar(parser, event, token.start_mark)
-			}
-		} else if token.typ != yaml_FLOW_MAPPING_END_TOKEN {
-			parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE)
-			return yaml_parser_parse_node(parser, event, false, false)
-		}
-	}
-
-	parser.state = parser.states[len(parser.states)-1]
-	parser.states = parser.states[:len(parser.states)-1]
-	parser.marks = parser.marks[:len(parser.marks)-1]
-	*event = yaml_event_t{
-		typ:        yaml_MAPPING_END_EVENT,
-		start_mark: token.start_mark,
-		end_mark:   token.end_mark,
-	}
-	skip_token(parser)
-	return true
-}
-
-// Parse the productions:
-// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-//                                   *                  ***** *
-//
-func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool {
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-	if empty {
-		parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE
-		return yaml_parser_process_empty_scalar(parser, event, token.start_mark)
-	}
-	if token.typ == yaml_VALUE_TOKEN {
-		skip_token(parser)
-		token = peek_token(parser)
-		if token == nil {
-			return false
-		}
-		if token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_MAPPING_END_TOKEN {
-			parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_KEY_STATE)
-			return yaml_parser_parse_node(parser, event, false, false)
-		}
-	}
-	parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE
-	return yaml_parser_process_empty_scalar(parser, event, token.start_mark)
-}
-
-// Generate an empty scalar event.
-func yaml_parser_process_empty_scalar(parser *yaml_parser_t, event *yaml_event_t, mark yaml_mark_t) bool {
-	*event = yaml_event_t{
-		typ:        yaml_SCALAR_EVENT,
-		start_mark: mark,
-		end_mark:   mark,
-		value:      nil, // Empty
-		implicit:   true,
-		style:      yaml_style_t(yaml_PLAIN_SCALAR_STYLE),
-	}
-	return true
-}
-
-var default_tag_directives = []yaml_tag_directive_t{
-	{[]byte("!"), []byte("!")},
-	{[]byte("!!"), []byte("tag:yaml.org,2002:")},
-}
-
-// Parse directives.
-func yaml_parser_process_directives(parser *yaml_parser_t,
-	version_directive_ref **yaml_version_directive_t,
-	tag_directives_ref *[]yaml_tag_directive_t) bool {
-
-	var version_directive *yaml_version_directive_t
-	var tag_directives []yaml_tag_directive_t
-
-	token := peek_token(parser)
-	if token == nil {
-		return false
-	}
-
-	for token.typ == yaml_VERSION_DIRECTIVE_TOKEN || token.typ == yaml_TAG_DIRECTIVE_TOKEN {
-		if token.typ == yaml_VERSION_DIRECTIVE_TOKEN {
-			if version_directive != nil {
-				yaml_parser_set_parser_error(parser,
-					"found duplicate %YAML directive", token.start_mark)
-				return false
-			}
-			if token.major != 1 || token.minor != 1 {
-				yaml_parser_set_parser_error(parser,
-					"found incompatible YAML document", token.start_mark)
-				return false
-			}
-			version_directive = &yaml_version_directive_t{
-				major: token.major,
-				minor: token.minor,
-			}
-		} else if token.typ == yaml_TAG_DIRECTIVE_TOKEN {
-			value := yaml_tag_directive_t{
-				handle: token.value,
-				prefix: token.prefix,
-			}
-			if !yaml_parser_append_tag_directive(parser, value, false, token.start_mark) {
-				return false
-			}
-			tag_directives = append(tag_directives, value)
-		}
-
-		skip_token(parser)
-		token = peek_token(parser)
-		if token == nil {
-			return false
-		}
-	}
-
-	for i := range default_tag_directives {
-		if !yaml_parser_append_tag_directive(parser, default_tag_directives[i], true, token.start_mark) {
-			return false
-		}
-	}
-
-	if version_directive_ref != nil {
-		*version_directive_ref = version_directive
-	}
-	if tag_directives_ref != nil {
-		*tag_directives_ref = tag_directives
-	}
-	return true
-}
-
-// Append a tag directive to the directives stack.
-func yaml_parser_append_tag_directive(parser *yaml_parser_t, value yaml_tag_directive_t, allow_duplicates bool, mark yaml_mark_t) bool {
-	for i := range parser.tag_directives {
-		if bytes.Equal(value.handle, parser.tag_directives[i].handle) {
-			if allow_duplicates {
-				return true
-			}
-			return yaml_parser_set_parser_error(parser, "found duplicate %TAG directive", mark)
-		}
-	}
-
-	// [Go] I suspect the copy is unnecessary. This was likely done
-	// because there was no way to track ownership of the data.
-	value_copy := yaml_tag_directive_t{
-		handle: make([]byte, len(value.handle)),
-		prefix: make([]byte, len(value.prefix)),
-	}
-	copy(value_copy.handle, value.handle)
-	copy(value_copy.prefix, value.prefix)
-	parser.tag_directives = append(parser.tag_directives, value_copy)
-	return true
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/readerc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/readerc.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/readerc.go
deleted file mode 100644
index d5fb097..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/readerc.go
+++ /dev/null
@@ -1,391 +0,0 @@
-package yaml
-
-import (
-	"io"
-)
-
-// Set the reader error and return 0.
-func yaml_parser_set_reader_error(parser *yaml_parser_t, problem string, offset int, value int) bool {
-	parser.error = yaml_READER_ERROR
-	parser.problem = problem
-	parser.problem_offset = offset
-	parser.problem_value = value
-	return false
-}
-
-// Byte order marks.
-const (
-	bom_UTF8    = "\xef\xbb\xbf"
-	bom_UTF16LE = "\xff\xfe"
-	bom_UTF16BE = "\xfe\xff"
-)
-
-// Determine the input stream encoding by checking the BOM symbol. If no BOM is
-// found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure.
-func yaml_parser_determine_encoding(parser *yaml_parser_t) bool {
-	// Ensure that we had enough bytes in the raw buffer.
-	for !parser.eof && len(parser.raw_buffer)-parser.raw_buffer_pos < 3 {
-		if !yaml_parser_update_raw_buffer(parser) {
-			return false
-		}
-	}
-
-	// Determine the encoding.
-	buf := parser.raw_buffer
-	pos := parser.raw_buffer_pos
-	avail := len(buf) - pos
-	if avail >= 2 && buf[pos] == bom_UTF16LE[0] && buf[pos+1] == bom_UTF16LE[1] {
-		parser.encoding = yaml_UTF16LE_ENCODING
-		parser.raw_buffer_pos += 2
-		parser.offset += 2
-	} else if avail >= 2 && buf[pos] == bom_UTF16BE[0] && buf[pos+1] == bom_UTF16BE[1] {
-		parser.encoding = yaml_UTF16BE_ENCODING
-		parser.raw_buffer_pos += 2
-		parser.offset += 2
-	} else if avail >= 3 && buf[pos] == bom_UTF8[0] && buf[pos+1] == bom_UTF8[1] && buf[pos+2] == bom_UTF8[2] {
-		parser.encoding = yaml_UTF8_ENCODING
-		parser.raw_buffer_pos += 3
-		parser.offset += 3
-	} else {
-		parser.encoding = yaml_UTF8_ENCODING
-	}
-	return true
-}
-
-// Update the raw buffer.
-func yaml_parser_update_raw_buffer(parser *yaml_parser_t) bool {
-	size_read := 0
-
-	// Return if the raw buffer is full.
-	if parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) {
-		return true
-	}
-
-	// Return on EOF.
-	if parser.eof {
-		return true
-	}
-
-	// Move the remaining bytes in the raw buffer to the beginning.
-	if parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) {
-		copy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:])
-	}
-	parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos]
-	parser.raw_buffer_pos = 0
-
-	// Call the read handler to fill the buffer.
-	size_read, err := parser.read_handler(parser, parser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)])
-	parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read]
-	if err == io.EOF {
-		parser.eof = true
-	} else if err != nil {
-		return yaml_parser_set_reader_error(parser, "input error: "+err.Error(), parser.offset, -1)
-	}
-	return true
-}
-
-// Ensure that the buffer contains at least `length` characters.
-// Return true on success, false on failure.
-//
-// The length is supposed to be significantly less that the buffer size.
-func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool {
-	if parser.read_handler == nil {
-		panic("read handler must be set")
-	}
-
-	// If the EOF flag is set and the raw buffer is empty, do nothing.
-	if parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) {
-		return true
-	}
-
-	// Return if the buffer contains enough characters.
-	if parser.unread >= length {
-		return true
-	}
-
-	// Determine the input encoding if it is not known yet.
-	if parser.encoding == yaml_ANY_ENCODING {
-		if !yaml_parser_determine_encoding(parser) {
-			return false
-		}
-	}
-
-	// Move the unread characters to the beginning of the buffer.
-	buffer_len := len(parser.buffer)
-	if parser.buffer_pos > 0 && parser.buffer_pos < buffer_len {
-		copy(parser.buffer, parser.buffer[parser.buffer_pos:])
-		buffer_len -= parser.buffer_pos
-		parser.buffer_pos = 0
-	} else if parser.buffer_pos == buffer_len {
-		buffer_len = 0
-		parser.buffer_pos = 0
-	}
-
-	// Open the whole buffer for writing, and cut it before returning.
-	parser.buffer = parser.buffer[:cap(parser.buffer)]
-
-	// Fill the buffer until it has enough characters.
-	first := true
-	for parser.unread < length {
-
-		// Fill the raw buffer if necessary.
-		if !first || parser.raw_buffer_pos == len(parser.raw_buffer) {
-			if !yaml_parser_update_raw_buffer(parser) {
-				parser.buffer = parser.buffer[:buffer_len]
-				return false
-			}
-		}
-		first = false
-
-		// Decode the raw buffer.
-	inner:
-		for parser.raw_buffer_pos != len(parser.raw_buffer) {
-			var value rune
-			var width int
-
-			raw_unread := len(parser.raw_buffer) - parser.raw_buffer_pos
-
-			// Decode the next character.
-			switch parser.encoding {
-			case yaml_UTF8_ENCODING:
-				// Decode a UTF-8 character.  Check RFC 3629
-				// (http://www.ietf.org/rfc/rfc3629.txt) for more details.
-				//
-				// The following table (taken from the RFC) is used for
-				// decoding.
-				//
-				//    Char. number range |        UTF-8 octet sequence
-				//      (hexadecimal)    |              (binary)
-				//   --------------------+------------------------------------
-				//   0000 0000-0000 007F | 0xxxxxxx
-				//   0000 0080-0000 07FF | 110xxxxx 10xxxxxx
-				//   0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
-				//   0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
-				//
-				// Additionally, the characters in the range 0xD800-0xDFFF
-				// are prohibited as they are reserved for use with UTF-16
-				// surrogate pairs.
-
-				// Determine the length of the UTF-8 sequence.
-				octet := parser.raw_buffer[parser.raw_buffer_pos]
-				switch {
-				case octet&0x80 == 0x00:
-					width = 1
-				case octet&0xE0 == 0xC0:
-					width = 2
-				case octet&0xF0 == 0xE0:
-					width = 3
-				case octet&0xF8 == 0xF0:
-					width = 4
-				default:
-					// The leading octet is invalid.
-					return yaml_parser_set_reader_error(parser,
-						"invalid leading UTF-8 octet",
-						parser.offset, int(octet))
-				}
-
-				// Check if the raw buffer contains an incomplete character.
-				if width > raw_unread {
-					if parser.eof {
-						return yaml_parser_set_reader_error(parser,
-							"incomplete UTF-8 octet sequence",
-							parser.offset, -1)
-					}
-					break inner
-				}
-
-				// Decode the leading octet.
-				switch {
-				case octet&0x80 == 0x00:
-					value = rune(octet & 0x7F)
-				case octet&0xE0 == 0xC0:
-					value = rune(octet & 0x1F)
-				case octet&0xF0 == 0xE0:
-					value = rune(octet & 0x0F)
-				case octet&0xF8 == 0xF0:
-					value = rune(octet & 0x07)
-				default:
-					value = 0
-				}
-
-				// Check and decode the trailing octets.
-				for k := 1; k < width; k++ {
-					octet = parser.raw_buffer[parser.raw_buffer_pos+k]
-
-					// Check if the octet is valid.
-					if (octet & 0xC0) != 0x80 {
-						return yaml_parser_set_reader_error(parser,
-							"invalid trailing UTF-8 octet",
-							parser.offset+k, int(octet))
-					}
-
-					// Decode the octet.
-					value = (value << 6) + rune(octet&0x3F)
-				}
-
-				// Check the length of the sequence against the value.
-				switch {
-				case width == 1:
-				case width == 2 && value >= 0x80:
-				case width == 3 && value >= 0x800:
-				case width == 4 && value >= 0x10000:
-				default:
-					return yaml_parser_set_reader_error(parser,
-						"invalid length of a UTF-8 sequence",
-						parser.offset, -1)
-				}
-
-				// Check the range of the value.
-				if value >= 0xD800 && value <= 0xDFFF || value > 0x10FFFF {
-					return yaml_parser_set_reader_error(parser,
-						"invalid Unicode character",
-						parser.offset, int(value))
-				}
-
-			case yaml_UTF16LE_ENCODING, yaml_UTF16BE_ENCODING:
-				var low, high int
-				if parser.encoding == yaml_UTF16LE_ENCODING {
-					low, high = 0, 1
-				} else {
-					high, low = 1, 0
-				}
-
-				// The UTF-16 encoding is not as simple as one might
-				// naively think.  Check RFC 2781
-				// (http://www.ietf.org/rfc/rfc2781.txt).
-				//
-				// Normally, two subsequent bytes describe a Unicode
-				// character.  However a special technique (called a
-				// surrogate pair) is used for specifying character
-				// values larger than 0xFFFF.
-				//
-				// A surrogate pair consists of two pseudo-characters:
-				//      high surrogate area (0xD800-0xDBFF)
-				//      low surrogate area (0xDC00-0xDFFF)
-				//
-				// The following formulas are used for decoding
-				// and encoding characters using surrogate pairs:
-				//
-				//  U  = U' + 0x10000   (0x01 00 00 <= U <= 0x10 FF FF)
-				//  U' = yyyyyyyyyyxxxxxxxxxx   (0 <= U' <= 0x0F FF FF)
-				//  W1 = 110110yyyyyyyyyy
-				//  W2 = 110111xxxxxxxxxx
-				//
-				// where U is the character value, W1 is the high surrogate
-				// area, W2 is the low surrogate area.
-
-				// Check for incomplete UTF-16 character.
-				if raw_unread < 2 {
-					if parser.eof {
-						return yaml_parser_set_reader_error(parser,
-							"incomplete UTF-16 character",
-							parser.offset, -1)
-					}
-					break inner
-				}
-
-				// Get the character.
-				value = rune(parser.raw_buffer[parser.raw_buffer_pos+low]) +
-					(rune(parser.raw_buffer[parser.raw_buffer_pos+high]) << 8)
-
-				// Check for unexpected low surrogate area.
-				if value&0xFC00 == 0xDC00 {
-					return yaml_parser_set_reader_error(parser,
-						"unexpected low surrogate area",
-						parser.offset, int(value))
-				}
-
-				// Check for a high surrogate area.
-				if value&0xFC00 == 0xD800 {
-					width = 4
-
-					// Check for incomplete surrogate pair.
-					if raw_unread < 4 {
-						if parser.eof {
-							return yaml_parser_set_reader_error(parser,
-								"incomplete UTF-16 surrogate pair",
-								parser.offset, -1)
-						}
-						break inner
-					}
-
-					// Get the next character.
-					value2 := rune(parser.raw_buffer[parser.raw_buffer_pos+low+2]) +
-						(rune(parser.raw_buffer[parser.raw_buffer_pos+high+2]) << 8)
-
-					// Check for a low surrogate area.
-					if value2&0xFC00 != 0xDC00 {
-						return yaml_parser_set_reader_error(parser,
-							"expected low surrogate area",
-							parser.offset+2, int(value2))
-					}
-
-					// Generate the value of the surrogate pair.
-					value = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF)
-				} else {
-					width = 2
-				}
-
-			default:
-				panic("impossible")
-			}
-
-			// Check if the character is in the allowed range:
-			//      #x9 | #xA | #xD | [#x20-#x7E]               (8 bit)
-			//      | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD]    (16 bit)
-			//      | [#x10000-#x10FFFF]                        (32 bit)
-			switch {
-			case value == 0x09:
-			case value == 0x0A:
-			case value == 0x0D:
-			case value >= 0x20 && value <= 0x7E:
-			case value == 0x85:
-			case value >= 0xA0 && value <= 0xD7FF:
-			case value >= 0xE000 && value <= 0xFFFD:
-			case value >= 0x10000 && value <= 0x10FFFF:
-			default:
-				return yaml_parser_set_reader_error(parser,
-					"control characters are not allowed",
-					parser.offset, int(value))
-			}
-
-			// Move the raw pointers.
-			parser.raw_buffer_pos += width
-			parser.offset += width
-
-			// Finally put the character into the buffer.
-			if value <= 0x7F {
-				// 0000 0000-0000 007F . 0xxxxxxx
-				parser.buffer[buffer_len+0] = byte(value)
-			} else if value <= 0x7FF {
-				// 0000 0080-0000 07FF . 110xxxxx 10xxxxxx
-				parser.buffer[buffer_len+0] = byte(0xC0 + (value >> 6))
-				parser.buffer[buffer_len+1] = byte(0x80 + (value & 0x3F))
-			} else if value <= 0xFFFF {
-				// 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx
-				parser.buffer[buffer_len+0] = byte(0xE0 + (value >> 12))
-				parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 6) & 0x3F))
-				parser.buffer[buffer_len+2] = byte(0x80 + (value & 0x3F))
-			} else {
-				// 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
-				parser.buffer[buffer_len+0] = byte(0xF0 + (value >> 18))
-				parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 12) & 0x3F))
-				parser.buffer[buffer_len+2] = byte(0x80 + ((value >> 6) & 0x3F))
-				parser.buffer[buffer_len+3] = byte(0x80 + (value & 0x3F))
-			}
-			buffer_len += width
-
-			parser.unread++
-		}
-
-		// On EOF, put NUL into the buffer and return.
-		if parser.eof {
-			parser.buffer[buffer_len] = 0
-			buffer_len++
-			parser.unread++
-			break
-		}
-	}
-	parser.buffer = parser.buffer[:buffer_len]
-	return true
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/gopkg.in/yaml.v2/resolve.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/gopkg.in/yaml.v2/resolve.go b/Godeps/_workspace/src/gopkg.in/yaml.v2/resolve.go
deleted file mode 100644
index 93a8632..0000000
--- a/Godeps/_workspace/src/gopkg.in/yaml.v2/resolve.go
+++ /dev/null
@@ -1,203 +0,0 @@
-package yaml
-
-import (
-	"encoding/base64"
-	"math"
-	"strconv"
-	"strings"
-	"unicode/utf8"
-)
-
-type resolveMapItem struct {
-	value interface{}
-	tag   string
-}
-
-var resolveTable = make([]byte, 256)
-var resolveMap = make(map[string]resolveMapItem)
-
-func init() {
-	t := resolveTable
-	t[int('+')] = 'S' // Sign
-	t[int('-')] = 'S'
-	for _, c := range "0123456789" {
-		t[int(c)] = 'D' // Digit
-	}
-	for _, c := range "yYnNtTfFoO~" {
-		t[int(c)] = 'M' // In map
-	}
-	t[int('.')] = '.' // Float (potentially in map)
-
-	var resolveMapList = []struct {
-		v   interface{}
-		tag string
-		l   []string
-	}{
-		{true, yaml_BOOL_TAG, []string{"y", "Y", "yes", "Yes", "YES"}},
-		{true, yaml_BOOL_TAG, []string{"true", "True", "TRUE"}},
-		{true, yaml_BOOL_TAG, []string{"on", "On", "ON"}},
-		{false, yaml_BOOL_TAG, []string{"n", "N", "no", "No", "NO"}},
-		{false, yaml_BOOL_TAG, []string{"false", "False", "FALSE"}},
-		{false, yaml_BOOL_TAG, []string{"off", "Off", "OFF"}},
-		{nil, yaml_NULL_TAG, []string{"", "~", "null", "Null", "NULL"}},
-		{math.NaN(), yaml_FLOAT_TAG, []string{".nan", ".NaN", ".NAN"}},
-		{math.Inf(+1), yaml_FLOAT_TAG, []string{".inf", ".Inf", ".INF"}},
-		{math.Inf(+1), yaml_FLOAT_TAG, []string{"+.inf", "+.Inf", "+.INF"}},
-		{math.Inf(-1), yaml_FLOAT_TAG, []string{"-.inf", "-.Inf", "-.INF"}},
-		{"<<", yaml_MERGE_TAG, []string{"<<"}},
-	}
-
-	m := resolveMap
-	for _, item := range resolveMapList {
-		for _, s := range item.l {
-			m[s] = resolveMapItem{item.v, item.tag}
-		}
-	}
-}
-
-const longTagPrefix = "tag:yaml.org,2002:"
-
-func shortTag(tag string) string {
-	// TODO This can easily be made faster and produce less garbage.
-	if strings.HasPrefix(tag, longTagPrefix) {
-		return "!!" + tag[len(longTagPrefix):]
-	}
-	return tag
-}
-
-func longTag(tag string) string {
-	if strings.HasPrefix(tag, "!!") {
-		return longTagPrefix + tag[2:]
-	}
-	return tag
-}
-
-func resolvableTag(tag string) bool {
-	switch tag {
-	case "", yaml_STR_TAG, yaml_BOOL_TAG, yaml_INT_TAG, yaml_FLOAT_TAG, yaml_NULL_TAG:
-		return true
-	}
-	return false
-}
-
-func resolve(tag string, in string) (rtag string, out interface{}) {
-	if !resolvableTag(tag) {
-		return tag, in
-	}
-
-	defer func() {
-		switch tag {
-		case "", rtag, yaml_STR_TAG, yaml_BINARY_TAG:
-			return
-		}
-		failf("cannot decode %s `%s` as a %s", shortTag(rtag), in, shortTag(tag))
-	}()
-
-	// Any data is accepted as a !!str or !!binary.
-	// Otherwise, the prefix is enough of a hint about what it might be.
-	hint := byte('N')
-	if in != "" {
-		hint = resolveTable[in[0]]
-	}
-	if hint != 0 && tag != yaml_STR_TAG && tag != yaml_BINARY_TAG {
-		// Handle things we can lookup in a map.
-		if item, ok := resolveMap[in]; ok {
-			return item.tag, item.value
-		}
-
-		// Base 60 floats are a bad idea, were dropped in YAML 1.2, and
-		// are purposefully unsupported here. They're still quoted on
-		// the way out for compatibility with other parser, though.
-
-		switch hint {
-		case 'M':
-			// We've already checked the map above.
-
-		case '.':
-			// Not in the map, so maybe a normal float.
-			floatv, err := strconv.ParseFloat(in, 64)
-			if err == nil {
-				return yaml_FLOAT_TAG, floatv
-			}
-
-		case 'D', 'S':
-			// Int, float, or timestamp.
-			plain := strings.Replace(in, "_", "", -1)
-			intv, err := strconv.ParseInt(plain, 0, 64)
-			if err == nil {
-				if intv == int64(int(intv)) {
-					return yaml_INT_TAG, int(intv)
-				} else {
-					return yaml_INT_TAG, intv
-				}
-			}
-			uintv, err := strconv.ParseUint(plain, 0, 64)
-			if err == nil {
-				return yaml_INT_TAG, uintv
-			}
-			floatv, err := strconv.ParseFloat(plain, 64)
-			if err == nil {
-				return yaml_FLOAT_TAG, floatv
-			}
-			if strings.HasPrefix(plain, "0b") {
-				intv, err := strconv.ParseInt(plain[2:], 2, 64)
-				if err == nil {
-					if intv == int64(int(intv)) {
-						return yaml_INT_TAG, int(intv)
-					} else {
-						return yaml_INT_TAG, intv
-					}
-				}
-				uintv, err := strconv.ParseUint(plain[2:], 2, 64)
-				if err == nil {
-					return yaml_INT_TAG, uintv
-				}
-			} else if strings.HasPrefix(plain, "-0b") {
-				intv, err := strconv.ParseInt(plain[3:], 2, 64)
-				if err == nil {
-					if intv == int64(int(intv)) {
-						return yaml_INT_TAG, -int(intv)
-					} else {
-						return yaml_INT_TAG, -intv
-					}
-				}
-			}
-			// XXX Handle timestamps here.
-
-		default:
-			panic("resolveTable item not yet handled: " + string(rune(hint)) + " (with " + in + ")")
-		}
-	}
-	if tag == yaml_BINARY_TAG {
-		return yaml_BINARY_TAG, in
-	}
-	if utf8.ValidString(in) {
-		return yaml_STR_TAG, in
-	}
-	return yaml_BINARY_TAG, encodeBase64(in)
-}
-
-// encodeBase64 encodes s as base64 that is broken up into multiple lines
-// as appropriate for the resulting length.
-func encodeBase64(s string) string {
-	const lineLen = 70
-	encLen := base64.StdEncoding.EncodedLen(len(s))
-	lines := encLen/lineLen + 1
-	buf := make([]byte, encLen*2+lines)
-	in := buf[0:encLen]
-	out := buf[encLen:]
-	base64.StdEncoding.Encode(in, []byte(s))
-	k := 0
-	for i := 0; i < len(in); i += lineLen {
-		j := i + lineLen
-		if j > len(in) {
-			j = len(in)
-		}
-		k += copy(out[k:], in[i:j])
-		if lines > 1 {
-			out[k] = '\n'
-			k++
-		}
-	}
-	return string(out[:k])
-}


[13/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3.go b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3.go
new file mode 100644
index 0000000..233e7e9
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3.go
@@ -0,0 +1,675 @@
+// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package sqlite3
+
+/*
+#cgo CFLAGS: -std=gnu99
+#cgo CFLAGS: -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE
+#cgo CFLAGS: -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
+#include <sqlite3-binding.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef __CYGWIN__
+# include <errno.h>
+#endif
+
+#ifndef SQLITE_OPEN_READWRITE
+# define SQLITE_OPEN_READWRITE 0
+#endif
+
+#ifndef SQLITE_OPEN_FULLMUTEX
+# define SQLITE_OPEN_FULLMUTEX 0
+#endif
+
+static int
+_sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs) {
+#ifdef SQLITE_OPEN_URI
+  return sqlite3_open_v2(filename, ppDb, flags | SQLITE_OPEN_URI, zVfs);
+#else
+  return sqlite3_open_v2(filename, ppDb, flags, zVfs);
+#endif
+}
+
+static int
+_sqlite3_bind_text(sqlite3_stmt *stmt, int n, char *p, int np) {
+  return sqlite3_bind_text(stmt, n, p, np, SQLITE_TRANSIENT);
+}
+
+static int
+_sqlite3_bind_blob(sqlite3_stmt *stmt, int n, void *p, int np) {
+  return sqlite3_bind_blob(stmt, n, p, np, SQLITE_TRANSIENT);
+}
+
+#include <stdio.h>
+#include <stdint.h>
+
+static int
+_sqlite3_exec(sqlite3* db, const char* pcmd, long* rowid, long* changes)
+{
+  int rv = sqlite3_exec(db, pcmd, 0, 0, 0);
+  *rowid = (long) sqlite3_last_insert_rowid(db);
+  *changes = (long) sqlite3_changes(db);
+  return rv;
+}
+
+static int
+_sqlite3_step(sqlite3_stmt* stmt, long* rowid, long* changes)
+{
+  int rv = sqlite3_step(stmt);
+  sqlite3* db = sqlite3_db_handle(stmt);
+  *rowid = (long) sqlite3_last_insert_rowid(db);
+  *changes = (long) sqlite3_changes(db);
+  return rv;
+}
+
+*/
+import "C"
+import (
+	"database/sql"
+	"database/sql/driver"
+	"errors"
+	"fmt"
+	"io"
+	"net/url"
+	"runtime"
+	"strconv"
+	"strings"
+	"time"
+	"unsafe"
+)
+
+// Timestamp formats understood by both this module and SQLite.
+// The first format in the slice will be used when saving time values
+// into the database. When parsing a string from a timestamp or
+// datetime column, the formats are tried in order.
+var SQLiteTimestampFormats = []string{
+	"2006-01-02 15:04:05.999999999",
+	"2006-01-02T15:04:05.999999999",
+	"2006-01-02 15:04:05",
+	"2006-01-02T15:04:05",
+	"2006-01-02 15:04",
+	"2006-01-02T15:04",
+	"2006-01-02",
+	"2006-01-02 15:04:05-07:00",
+}
+
+func init() {
+	sql.Register("sqlite3", &SQLiteDriver{})
+}
+
+// Return SQLite library Version information.
+func Version() (libVersion string, libVersionNumber int, sourceId string) {
+	libVersion = C.GoString(C.sqlite3_libversion())
+	libVersionNumber = int(C.sqlite3_libversion_number())
+	sourceId = C.GoString(C.sqlite3_sourceid())
+	return libVersion, libVersionNumber, sourceId
+}
+
+// Driver struct.
+type SQLiteDriver struct {
+	Extensions  []string
+	ConnectHook func(*SQLiteConn) error
+}
+
+// Conn struct.
+type SQLiteConn struct {
+	db     *C.sqlite3
+	loc    *time.Location
+	txlock string
+}
+
+// Tx struct.
+type SQLiteTx struct {
+	c *SQLiteConn
+}
+
+// Stmt struct.
+type SQLiteStmt struct {
+	c      *SQLiteConn
+	s      *C.sqlite3_stmt
+	nv     int
+	nn     []string
+	t      string
+	closed bool
+	cls    bool
+}
+
+// Result struct.
+type SQLiteResult struct {
+	id      int64
+	changes int64
+}
+
+// Rows struct.
+type SQLiteRows struct {
+	s        *SQLiteStmt
+	nc       int
+	cols     []string
+	decltype []string
+	cls      bool
+}
+
+// Commit transaction.
+func (tx *SQLiteTx) Commit() error {
+	_, err := tx.c.exec("COMMIT")
+	return err
+}
+
+// Rollback transaction.
+func (tx *SQLiteTx) Rollback() error {
+	_, err := tx.c.exec("ROLLBACK")
+	return err
+}
+
+// AutoCommit return which currently auto commit or not.
+func (c *SQLiteConn) AutoCommit() bool {
+	return int(C.sqlite3_get_autocommit(c.db)) != 0
+}
+
+func (c *SQLiteConn) lastError() Error {
+	return Error{
+		Code:         ErrNo(C.sqlite3_errcode(c.db)),
+		ExtendedCode: ErrNoExtended(C.sqlite3_extended_errcode(c.db)),
+		err:          C.GoString(C.sqlite3_errmsg(c.db)),
+	}
+}
+
+// Implements Execer
+func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, error) {
+	if len(args) == 0 {
+		return c.exec(query)
+	}
+
+	for {
+		s, err := c.Prepare(query)
+		if err != nil {
+			return nil, err
+		}
+		var res driver.Result
+		if s.(*SQLiteStmt).s != nil {
+			na := s.NumInput()
+			if len(args) < na {
+				return nil, fmt.Errorf("Not enough args to execute query. Expected %d, got %d.", na, len(args))
+			}
+			res, err = s.Exec(args[:na])
+			if err != nil && err != driver.ErrSkip {
+				s.Close()
+				return nil, err
+			}
+			args = args[na:]
+		}
+		tail := s.(*SQLiteStmt).t
+		s.Close()
+		if tail == "" {
+			return res, nil
+		}
+		query = tail
+	}
+}
+
+// Implements Queryer
+func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, error) {
+	for {
+		s, err := c.Prepare(query)
+		if err != nil {
+			return nil, err
+		}
+		s.(*SQLiteStmt).cls = true
+		na := s.NumInput()
+		if len(args) < na {
+			return nil, fmt.Errorf("Not enough args to execute query. Expected %d, got %d.", na, len(args))
+		}
+		rows, err := s.Query(args[:na])
+		if err != nil && err != driver.ErrSkip {
+			s.Close()
+			return nil, err
+		}
+		args = args[na:]
+		tail := s.(*SQLiteStmt).t
+		if tail == "" {
+			return rows, nil
+		}
+		rows.Close()
+		s.Close()
+		query = tail
+	}
+}
+
+func (c *SQLiteConn) exec(cmd string) (driver.Result, error) {
+	pcmd := C.CString(cmd)
+	defer C.free(unsafe.Pointer(pcmd))
+
+	var rowid, changes C.long
+	rv := C._sqlite3_exec(c.db, pcmd, &rowid, &changes)
+	if rv != C.SQLITE_OK {
+		return nil, c.lastError()
+	}
+	return &SQLiteResult{int64(rowid), int64(changes)}, nil
+}
+
+// Begin transaction.
+func (c *SQLiteConn) Begin() (driver.Tx, error) {
+	if _, err := c.exec(c.txlock); err != nil {
+		return nil, err
+	}
+	return &SQLiteTx{c}, nil
+}
+
+func errorString(err Error) string {
+	return C.GoString(C.sqlite3_errstr(C.int(err.Code)))
+}
+
+// Open database and return a new connection.
+// You can specify DSN string with URI filename.
+//   test.db
+//   file:test.db?cache=shared&mode=memory
+//   :memory:
+//   file::memory:
+// go-sqlite handle especially query parameters.
+//   _loc=XXX
+//     Specify location of time format. It's possible to specify "auto".
+//   _busy_timeout=XXX
+//     Specify value for sqlite3_busy_timeout.
+//   _txlock=XXX
+//     Specify locking behavior for transactions.  XXX can be "immediate",
+//     "deferred", "exclusive".
+func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
+	if C.sqlite3_threadsafe() == 0 {
+		return nil, errors.New("sqlite library was not compiled for thread-safe operation")
+	}
+
+	var loc *time.Location
+	txlock := "BEGIN"
+	busy_timeout := 5000
+	pos := strings.IndexRune(dsn, '?')
+	if pos >= 1 {
+		params, err := url.ParseQuery(dsn[pos+1:])
+		if err != nil {
+			return nil, err
+		}
+
+		// _loc
+		if val := params.Get("_loc"); val != "" {
+			if val == "auto" {
+				loc = time.Local
+			} else {
+				loc, err = time.LoadLocation(val)
+				if err != nil {
+					return nil, fmt.Errorf("Invalid _loc: %v: %v", val, err)
+				}
+			}
+		}
+
+		// _busy_timeout
+		if val := params.Get("_busy_timeout"); val != "" {
+			iv, err := strconv.ParseInt(val, 10, 64)
+			if err != nil {
+				return nil, fmt.Errorf("Invalid _busy_timeout: %v: %v", val, err)
+			}
+			busy_timeout = int(iv)
+		}
+
+		// _txlock
+		if val := params.Get("_txlock"); val != "" {
+			switch val {
+			case "immediate":
+				txlock = "BEGIN IMMEDIATE"
+			case "exclusive":
+				txlock = "BEGIN EXCLUSIVE"
+			case "deferred":
+				txlock = "BEGIN"
+			default:
+				return nil, fmt.Errorf("Invalid _txlock: %v", val)
+			}
+		}
+
+		if !strings.HasPrefix(dsn, "file:") {
+			dsn = dsn[:pos]
+		}
+	}
+
+	var db *C.sqlite3
+	name := C.CString(dsn)
+	defer C.free(unsafe.Pointer(name))
+	rv := C._sqlite3_open_v2(name, &db,
+		C.SQLITE_OPEN_FULLMUTEX|
+			C.SQLITE_OPEN_READWRITE|
+			C.SQLITE_OPEN_CREATE,
+		nil)
+	if rv != 0 {
+		return nil, Error{Code: ErrNo(rv)}
+	}
+	if db == nil {
+		return nil, errors.New("sqlite succeeded without returning a database")
+	}
+
+	rv = C.sqlite3_busy_timeout(db, C.int(busy_timeout))
+	if rv != C.SQLITE_OK {
+		return nil, Error{Code: ErrNo(rv)}
+	}
+
+	conn := &SQLiteConn{db: db, loc: loc, txlock: txlock}
+
+	if len(d.Extensions) > 0 {
+		rv = C.sqlite3_enable_load_extension(db, 1)
+		if rv != C.SQLITE_OK {
+			return nil, errors.New(C.GoString(C.sqlite3_errmsg(db)))
+		}
+
+		for _, extension := range d.Extensions {
+			cext := C.CString(extension)
+			defer C.free(unsafe.Pointer(cext))
+			rv = C.sqlite3_load_extension(db, cext, nil, nil)
+			if rv != C.SQLITE_OK {
+				return nil, errors.New(C.GoString(C.sqlite3_errmsg(db)))
+			}
+		}
+
+		rv = C.sqlite3_enable_load_extension(db, 0)
+		if rv != C.SQLITE_OK {
+			return nil, errors.New(C.GoString(C.sqlite3_errmsg(db)))
+		}
+	}
+
+	if d.ConnectHook != nil {
+		if err := d.ConnectHook(conn); err != nil {
+			return nil, err
+		}
+	}
+	runtime.SetFinalizer(conn, (*SQLiteConn).Close)
+	return conn, nil
+}
+
+// Close the connection.
+func (c *SQLiteConn) Close() error {
+	rv := C.sqlite3_close_v2(c.db)
+	if rv != C.SQLITE_OK {
+		return c.lastError()
+	}
+	c.db = nil
+	runtime.SetFinalizer(c, nil)
+	return nil
+}
+
+// Prepare query string. Return a new statement.
+func (c *SQLiteConn) Prepare(query string) (driver.Stmt, error) {
+	pquery := C.CString(query)
+	defer C.free(unsafe.Pointer(pquery))
+	var s *C.sqlite3_stmt
+	var tail *C.char
+	rv := C.sqlite3_prepare_v2(c.db, pquery, -1, &s, &tail)
+	if rv != C.SQLITE_OK {
+		return nil, c.lastError()
+	}
+	var t string
+	if tail != nil && *tail != '\000' {
+		t = strings.TrimSpace(C.GoString(tail))
+	}
+	nv := int(C.sqlite3_bind_parameter_count(s))
+	var nn []string
+	for i := 0; i < nv; i++ {
+		pn := C.GoString(C.sqlite3_bind_parameter_name(s, C.int(i+1)))
+		if len(pn) > 1 && pn[0] == '$' && 48 <= pn[1] && pn[1] <= 57 {
+			nn = append(nn, C.GoString(C.sqlite3_bind_parameter_name(s, C.int(i+1))))
+		}
+	}
+	ss := &SQLiteStmt{c: c, s: s, nv: nv, nn: nn, t: t}
+	runtime.SetFinalizer(ss, (*SQLiteStmt).Close)
+	return ss, nil
+}
+
+// Close the statement.
+func (s *SQLiteStmt) Close() error {
+	if s.closed {
+		return nil
+	}
+	s.closed = true
+	if s.c == nil || s.c.db == nil {
+		return errors.New("sqlite statement with already closed database connection")
+	}
+	rv := C.sqlite3_finalize(s.s)
+	if rv != C.SQLITE_OK {
+		return s.c.lastError()
+	}
+	runtime.SetFinalizer(s, nil)
+	return nil
+}
+
+// Return a number of parameters.
+func (s *SQLiteStmt) NumInput() int {
+	return s.nv
+}
+
+type bindArg struct {
+	n int
+	v driver.Value
+}
+
+func (s *SQLiteStmt) bind(args []driver.Value) error {
+	rv := C.sqlite3_reset(s.s)
+	if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE {
+		return s.c.lastError()
+	}
+
+	var vargs []bindArg
+	narg := len(args)
+	vargs = make([]bindArg, narg)
+	if len(s.nn) > 0 {
+		for i, v := range s.nn {
+			if pi, err := strconv.Atoi(v[1:]); err == nil {
+				vargs[i] = bindArg{pi, args[i]}
+			}
+		}
+	} else {
+		for i, v := range args {
+			vargs[i] = bindArg{i + 1, v}
+		}
+	}
+
+	for _, varg := range vargs {
+		n := C.int(varg.n)
+		v := varg.v
+		switch v := v.(type) {
+		case nil:
+			rv = C.sqlite3_bind_null(s.s, n)
+		case string:
+			if len(v) == 0 {
+				b := []byte{0}
+				rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(0))
+			} else {
+				b := []byte(v)
+				rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b)))
+			}
+		case int64:
+			rv = C.sqlite3_bind_int64(s.s, n, C.sqlite3_int64(v))
+		case bool:
+			if bool(v) {
+				rv = C.sqlite3_bind_int(s.s, n, 1)
+			} else {
+				rv = C.sqlite3_bind_int(s.s, n, 0)
+			}
+		case float64:
+			rv = C.sqlite3_bind_double(s.s, n, C.double(v))
+		case []byte:
+			var p *byte
+			if len(v) > 0 {
+				p = &v[0]
+			}
+			rv = C._sqlite3_bind_blob(s.s, n, unsafe.Pointer(p), C.int(len(v)))
+		case time.Time:
+			b := []byte(v.UTC().Format(SQLiteTimestampFormats[0]))
+			rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b)))
+		}
+		if rv != C.SQLITE_OK {
+			return s.c.lastError()
+		}
+	}
+	return nil
+}
+
+// Query the statement with arguments. Return records.
+func (s *SQLiteStmt) Query(args []driver.Value) (driver.Rows, error) {
+	if err := s.bind(args); err != nil {
+		return nil, err
+	}
+	return &SQLiteRows{s, int(C.sqlite3_column_count(s.s)), nil, nil, s.cls}, nil
+}
+
+// Return last inserted ID.
+func (r *SQLiteResult) LastInsertId() (int64, error) {
+	return r.id, nil
+}
+
+// Return how many rows affected.
+func (r *SQLiteResult) RowsAffected() (int64, error) {
+	return r.changes, nil
+}
+
+// Execute the statement with arguments. Return result object.
+func (s *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error) {
+	if err := s.bind(args); err != nil {
+		C.sqlite3_reset(s.s)
+		C.sqlite3_clear_bindings(s.s)
+		return nil, err
+	}
+	var rowid, changes C.long
+	rv := C._sqlite3_step(s.s, &rowid, &changes)
+	if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE {
+		err := s.c.lastError()
+		C.sqlite3_reset(s.s)
+		C.sqlite3_clear_bindings(s.s)
+		return nil, err
+	}
+	return &SQLiteResult{int64(rowid), int64(changes)}, nil
+}
+
+// Close the rows.
+func (rc *SQLiteRows) Close() error {
+	if rc.s.closed {
+		return nil
+	}
+	if rc.cls {
+		return rc.s.Close()
+	}
+	rv := C.sqlite3_reset(rc.s.s)
+	if rv != C.SQLITE_OK {
+		return rc.s.c.lastError()
+	}
+	return nil
+}
+
+// Return column names.
+func (rc *SQLiteRows) Columns() []string {
+	if rc.nc != len(rc.cols) {
+		rc.cols = make([]string, rc.nc)
+		for i := 0; i < rc.nc; i++ {
+			rc.cols[i] = C.GoString(C.sqlite3_column_name(rc.s.s, C.int(i)))
+		}
+	}
+	return rc.cols
+}
+
+// Move cursor to next.
+func (rc *SQLiteRows) Next(dest []driver.Value) error {
+	rv := C.sqlite3_step(rc.s.s)
+	if rv == C.SQLITE_DONE {
+		return io.EOF
+	}
+	if rv != C.SQLITE_ROW {
+		rv = C.sqlite3_reset(rc.s.s)
+		if rv != C.SQLITE_OK {
+			return rc.s.c.lastError()
+		}
+		return nil
+	}
+
+	if rc.decltype == nil {
+		rc.decltype = make([]string, rc.nc)
+		for i := 0; i < rc.nc; i++ {
+			rc.decltype[i] = strings.ToLower(C.GoString(C.sqlite3_column_decltype(rc.s.s, C.int(i))))
+		}
+	}
+
+	for i := range dest {
+		switch C.sqlite3_column_type(rc.s.s, C.int(i)) {
+		case C.SQLITE_INTEGER:
+			val := int64(C.sqlite3_column_int64(rc.s.s, C.int(i)))
+			switch rc.decltype[i] {
+			case "timestamp", "datetime", "date":
+				unixTimestamp := strconv.FormatInt(val, 10)
+				var t time.Time
+				if len(unixTimestamp) == 13 {
+					duration, err := time.ParseDuration(unixTimestamp + "ms")
+					if err != nil {
+						return fmt.Errorf("error parsing %s value %d, %s", rc.decltype[i], val, err)
+					}
+					epoch := time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC)
+					t = epoch.Add(duration)
+				} else {
+					t = time.Unix(val, 0)
+				}
+				if rc.s.c.loc != nil {
+					t = t.In(rc.s.c.loc)
+				}
+				dest[i] = t
+			case "boolean":
+				dest[i] = val > 0
+			default:
+				dest[i] = val
+			}
+		case C.SQLITE_FLOAT:
+			dest[i] = float64(C.sqlite3_column_double(rc.s.s, C.int(i)))
+		case C.SQLITE_BLOB:
+			p := C.sqlite3_column_blob(rc.s.s, C.int(i))
+			if p == nil {
+				dest[i] = nil
+				continue
+			}
+			n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
+			switch dest[i].(type) {
+			case sql.RawBytes:
+				dest[i] = (*[1 << 30]byte)(unsafe.Pointer(p))[0:n]
+			default:
+				slice := make([]byte, n)
+				copy(slice[:], (*[1 << 30]byte)(unsafe.Pointer(p))[0:n])
+				dest[i] = slice
+			}
+		case C.SQLITE_NULL:
+			dest[i] = nil
+		case C.SQLITE_TEXT:
+			var err error
+			var timeVal time.Time
+
+			n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
+			s := C.GoStringN((*C.char)(unsafe.Pointer(C.sqlite3_column_text(rc.s.s, C.int(i)))), C.int(n))
+
+			switch rc.decltype[i] {
+			case "timestamp", "datetime", "date":
+				var t time.Time
+				s = strings.TrimSuffix(s, "Z")
+				for _, format := range SQLiteTimestampFormats {
+					if timeVal, err = time.ParseInLocation(format, s, time.UTC); err == nil {
+						t = timeVal
+						break
+					}
+				}
+				if err != nil {
+					// The column is a time value, so return the zero time on parse failure.
+					t = time.Time{}
+				}
+				if rc.s.c.loc != nil {
+					t = t.In(rc.s.c.loc)
+				}
+				dest[i] = t
+			default:
+				dest[i] = []byte(s)
+			}
+
+		}
+	}
+	return nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_fts3_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_fts3_test.go b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_fts3_test.go
new file mode 100644
index 0000000..a1cd217
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_fts3_test.go
@@ -0,0 +1,83 @@
+// Copyright (C) 2015 Yasuhiro Matsumoto <ma...@gmail.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package sqlite3
+
+import (
+	"database/sql"
+	"os"
+	"testing"
+)
+
+func TestFTS3(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec("DROP TABLE foo")
+	_, err = db.Exec("CREATE VIRTUAL TABLE foo USING fts3(id INTEGER PRIMARY KEY, value TEXT)")
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+
+	_, err = db.Exec("INSERT INTO foo(id, value) VALUES(?, ?)", 1, `今日の 晩御飯は 天麩羅よ`)
+	if err != nil {
+		t.Fatal("Failed to insert value:", err)
+	}
+
+	_, err = db.Exec("INSERT INTO foo(id, value) VALUES(?, ?)", 2, `今日は いい 天気だ`)
+	if err != nil {
+		t.Fatal("Failed to insert value:", err)
+	}
+
+	rows, err := db.Query("SELECT id, value FROM foo WHERE value MATCH '今日* 天*'")
+	if err != nil {
+		t.Fatal("Unable to query foo table:", err)
+	}
+	defer rows.Close()
+
+	for rows.Next() {
+		var id int
+		var value string
+
+		if err := rows.Scan(&id, &value); err != nil {
+			t.Error("Unable to scan results:", err)
+			continue
+		}
+
+		if id == 1 && value != `今日の 晩御飯は 天麩羅よ` {
+			t.Error("Value for id 1 should be `今日の 晩御飯は 天麩羅よ`, but:", value)
+		} else if id == 2 && value != `今日は いい 天気だ` {
+			t.Error("Value for id 2 should be `今日は いい 天気だ`, but:", value)
+		}
+	}
+
+	rows, err = db.Query("SELECT value FROM foo WHERE value MATCH '今日* 天麩羅*'")
+	if err != nil {
+		t.Fatal("Unable to query foo table:", err)
+	}
+	defer rows.Close()
+
+	var value string
+	if !rows.Next() {
+		t.Fatal("Result should be only one")
+	}
+
+	if err := rows.Scan(&value); err != nil {
+		t.Fatal("Unable to scan results:", err)
+	}
+
+	if value != `今日の 晩御飯は 天麩羅よ` {
+		t.Fatal("Value should be `今日の 晩御飯は 天麩羅よ`, but:", value)
+	}
+
+	if rows.Next() {
+		t.Fatal("Result should be only one")
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_other.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_other.go b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_other.go
new file mode 100644
index 0000000..a20d02c
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_other.go
@@ -0,0 +1,13 @@
+// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+// +build !windows
+
+package sqlite3
+
+/*
+#cgo CFLAGS: -I.
+#cgo linux LDFLAGS: -ldl
+*/
+import "C"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test.go b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test.go
new file mode 100644
index 0000000..423f30e
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test.go
@@ -0,0 +1,1058 @@
+// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package sqlite3
+
+import (
+	"crypto/rand"
+	"database/sql"
+	"database/sql/driver"
+	"encoding/hex"
+	"errors"
+	"fmt"
+	"net/url"
+	"os"
+	"path/filepath"
+	"strings"
+	"testing"
+	"time"
+
+	"github.com/mattn/go-sqlite3/sqlite3_test"
+)
+
+func TempFilename() string {
+	randBytes := make([]byte, 16)
+	rand.Read(randBytes)
+	return filepath.Join(os.TempDir(), "foo"+hex.EncodeToString(randBytes)+".db")
+}
+
+func doTestOpen(t *testing.T, option string) (string, error) {
+	var url string
+	tempFilename := TempFilename()
+	if option != "" {
+		url = tempFilename + option
+	} else {
+		url = tempFilename
+	}
+	db, err := sql.Open("sqlite3", url)
+	if err != nil {
+		return "Failed to open database:", err
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec("drop table foo")
+	_, err = db.Exec("create table foo (id integer)")
+	if err != nil {
+		return "Failed to create table:", err
+	}
+
+	if stat, err := os.Stat(tempFilename); err != nil || stat.IsDir() {
+		return "Failed to create ./foo.db", nil
+	}
+
+	return "", nil
+}
+
+func TestOpen(t *testing.T) {
+	cases := map[string]bool{
+		"":                   true,
+		"?_txlock=immediate": true,
+		"?_txlock=deferred":  true,
+		"?_txlock=exclusive": true,
+		"?_txlock=bogus":     false,
+	}
+	for option, expectedPass := range cases {
+		result, err := doTestOpen(t, option)
+		if result == "" {
+			if !expectedPass {
+				errmsg := fmt.Sprintf("_txlock error not caught at dbOpen with option: %s", option)
+				t.Fatal(errmsg)
+			}
+		} else if expectedPass {
+			if err == nil {
+				t.Fatal(result)
+			} else {
+				t.Fatal(result, err)
+			}
+		}
+	}
+}
+
+func TestClose(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+
+	_, err = db.Exec("drop table foo")
+	_, err = db.Exec("create table foo (id integer)")
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+
+	stmt, err := db.Prepare("select id from foo where id = ?")
+	if err != nil {
+		t.Fatal("Failed to select records:", err)
+	}
+
+	db.Close()
+	_, err = stmt.Exec(1)
+	if err == nil {
+		t.Fatal("Failed to operate closed statement")
+	}
+}
+
+func TestInsert(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec("drop table foo")
+	_, err = db.Exec("create table foo (id integer)")
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+
+	res, err := db.Exec("insert into foo(id) values(123)")
+	if err != nil {
+		t.Fatal("Failed to insert record:", err)
+	}
+	affected, _ := res.RowsAffected()
+	if affected != 1 {
+		t.Fatalf("Expected %d for affected rows, but %d:", 1, affected)
+	}
+
+	rows, err := db.Query("select id from foo")
+	if err != nil {
+		t.Fatal("Failed to select records:", err)
+	}
+	defer rows.Close()
+
+	rows.Next()
+
+	var result int
+	rows.Scan(&result)
+	if result != 123 {
+		t.Errorf("Fetched %q; expected %q", 123, result)
+	}
+}
+
+func TestUpdate(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec("drop table foo")
+	_, err = db.Exec("create table foo (id integer)")
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+
+	res, err := db.Exec("insert into foo(id) values(123)")
+	if err != nil {
+		t.Fatal("Failed to insert record:", err)
+	}
+	expected, err := res.LastInsertId()
+	if err != nil {
+		t.Fatal("Failed to get LastInsertId:", err)
+	}
+	affected, _ := res.RowsAffected()
+	if err != nil {
+		t.Fatal("Failed to get RowsAffected:", err)
+	}
+	if affected != 1 {
+		t.Fatalf("Expected %d for affected rows, but %d:", 1, affected)
+	}
+
+	res, err = db.Exec("update foo set id = 234")
+	if err != nil {
+		t.Fatal("Failed to update record:", err)
+	}
+	lastId, err := res.LastInsertId()
+	if err != nil {
+		t.Fatal("Failed to get LastInsertId:", err)
+	}
+	if expected != lastId {
+		t.Errorf("Expected %q for last Id, but %q:", expected, lastId)
+	}
+	affected, _ = res.RowsAffected()
+	if err != nil {
+		t.Fatal("Failed to get RowsAffected:", err)
+	}
+	if affected != 1 {
+		t.Fatalf("Expected %d for affected rows, but %d:", 1, affected)
+	}
+
+	rows, err := db.Query("select id from foo")
+	if err != nil {
+		t.Fatal("Failed to select records:", err)
+	}
+	defer rows.Close()
+
+	rows.Next()
+
+	var result int
+	rows.Scan(&result)
+	if result != 234 {
+		t.Errorf("Fetched %q; expected %q", 234, result)
+	}
+}
+
+func TestDelete(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec("drop table foo")
+	_, err = db.Exec("create table foo (id integer)")
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+
+	res, err := db.Exec("insert into foo(id) values(123)")
+	if err != nil {
+		t.Fatal("Failed to insert record:", err)
+	}
+	expected, err := res.LastInsertId()
+	if err != nil {
+		t.Fatal("Failed to get LastInsertId:", err)
+	}
+	affected, err := res.RowsAffected()
+	if err != nil {
+		t.Fatal("Failed to get RowsAffected:", err)
+	}
+	if affected != 1 {
+		t.Errorf("Expected %d for cout of affected rows, but %q:", 1, affected)
+	}
+
+	res, err = db.Exec("delete from foo where id = 123")
+	if err != nil {
+		t.Fatal("Failed to delete record:", err)
+	}
+	lastId, err := res.LastInsertId()
+	if err != nil {
+		t.Fatal("Failed to get LastInsertId:", err)
+	}
+	if expected != lastId {
+		t.Errorf("Expected %q for last Id, but %q:", expected, lastId)
+	}
+	affected, err = res.RowsAffected()
+	if err != nil {
+		t.Fatal("Failed to get RowsAffected:", err)
+	}
+	if affected != 1 {
+		t.Errorf("Expected %d for cout of affected rows, but %q:", 1, affected)
+	}
+
+	rows, err := db.Query("select id from foo")
+	if err != nil {
+		t.Fatal("Failed to select records:", err)
+	}
+	defer rows.Close()
+
+	if rows.Next() {
+		t.Error("Fetched row but expected not rows")
+	}
+}
+
+func TestBooleanRoundtrip(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec("DROP TABLE foo")
+	_, err = db.Exec("CREATE TABLE foo(id INTEGER, value BOOL)")
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+
+	_, err = db.Exec("INSERT INTO foo(id, value) VALUES(1, ?)", true)
+	if err != nil {
+		t.Fatal("Failed to insert true value:", err)
+	}
+
+	_, err = db.Exec("INSERT INTO foo(id, value) VALUES(2, ?)", false)
+	if err != nil {
+		t.Fatal("Failed to insert false value:", err)
+	}
+
+	rows, err := db.Query("SELECT id, value FROM foo")
+	if err != nil {
+		t.Fatal("Unable to query foo table:", err)
+	}
+	defer rows.Close()
+
+	for rows.Next() {
+		var id int
+		var value bool
+
+		if err := rows.Scan(&id, &value); err != nil {
+			t.Error("Unable to scan results:", err)
+			continue
+		}
+
+		if id == 1 && !value {
+			t.Error("Value for id 1 should be true, not false")
+
+		} else if id == 2 && value {
+			t.Error("Value for id 2 should be false, not true")
+		}
+	}
+}
+
+func TestTimestamp(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec("DROP TABLE foo")
+	_, err = db.Exec("CREATE TABLE foo(id INTEGER, ts timeSTAMP, dt DATETIME)")
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+
+	timestamp1 := time.Date(2012, time.April, 6, 22, 50, 0, 0, time.UTC)
+	timestamp2 := time.Date(2006, time.January, 2, 15, 4, 5, 123456789, time.UTC)
+	timestamp3 := time.Date(2012, time.November, 4, 0, 0, 0, 0, time.UTC)
+	tests := []struct {
+		value    interface{}
+		expected time.Time
+	}{
+		{"nonsense", time.Time{}},
+		{"0000-00-00 00:00:00", time.Time{}},
+		{timestamp1, timestamp1},
+		{timestamp1.Unix(), timestamp1},
+		{timestamp1.UnixNano() / int64(time.Millisecond), timestamp1},
+		{timestamp1.In(time.FixedZone("TEST", -7*3600)), timestamp1},
+		{timestamp1.Format("2006-01-02 15:04:05.000"), timestamp1},
+		{timestamp1.Format("2006-01-02T15:04:05.000"), timestamp1},
+		{timestamp1.Format("2006-01-02 15:04:05"), timestamp1},
+		{timestamp1.Format("2006-01-02T15:04:05"), timestamp1},
+		{timestamp2, timestamp2},
+		{"2006-01-02 15:04:05.123456789", timestamp2},
+		{"2006-01-02T15:04:05.123456789", timestamp2},
+		{"2012-11-04", timestamp3},
+		{"2012-11-04 00:00", timestamp3},
+		{"2012-11-04 00:00:00", timestamp3},
+		{"2012-11-04 00:00:00.000", timestamp3},
+		{"2012-11-04T00:00", timestamp3},
+		{"2012-11-04T00:00:00", timestamp3},
+		{"2012-11-04T00:00:00.000", timestamp3},
+	}
+	for i := range tests {
+		_, err = db.Exec("INSERT INTO foo(id, ts, dt) VALUES(?, ?, ?)", i, tests[i].value, tests[i].value)
+		if err != nil {
+			t.Fatal("Failed to insert timestamp:", err)
+		}
+	}
+
+	rows, err := db.Query("SELECT id, ts, dt FROM foo ORDER BY id ASC")
+	if err != nil {
+		t.Fatal("Unable to query foo table:", err)
+	}
+	defer rows.Close()
+
+	seen := 0
+	for rows.Next() {
+		var id int
+		var ts, dt time.Time
+
+		if err := rows.Scan(&id, &ts, &dt); err != nil {
+			t.Error("Unable to scan results:", err)
+			continue
+		}
+		if id < 0 || id >= len(tests) {
+			t.Error("Bad row id: ", id)
+			continue
+		}
+		seen++
+		if !tests[id].expected.Equal(ts) {
+			t.Errorf("Timestamp value for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected, dt)
+		}
+		if !tests[id].expected.Equal(dt) {
+			t.Errorf("Datetime value for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected, dt)
+		}
+	}
+
+	if seen != len(tests) {
+		t.Errorf("Expected to see %d rows", len(tests))
+	}
+}
+
+func TestBoolean(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec("CREATE TABLE foo(id INTEGER, fbool BOOLEAN)")
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+
+	bool1 := true
+	_, err = db.Exec("INSERT INTO foo(id, fbool) VALUES(1, ?)", bool1)
+	if err != nil {
+		t.Fatal("Failed to insert boolean:", err)
+	}
+
+	bool2 := false
+	_, err = db.Exec("INSERT INTO foo(id, fbool) VALUES(2, ?)", bool2)
+	if err != nil {
+		t.Fatal("Failed to insert boolean:", err)
+	}
+
+	bool3 := "nonsense"
+	_, err = db.Exec("INSERT INTO foo(id, fbool) VALUES(3, ?)", bool3)
+	if err != nil {
+		t.Fatal("Failed to insert nonsense:", err)
+	}
+
+	rows, err := db.Query("SELECT id, fbool FROM foo where fbool = ?", bool1)
+	if err != nil {
+		t.Fatal("Unable to query foo table:", err)
+	}
+	counter := 0
+
+	var id int
+	var fbool bool
+
+	for rows.Next() {
+		if err := rows.Scan(&id, &fbool); err != nil {
+			t.Fatal("Unable to scan results:", err)
+		}
+		counter++
+	}
+
+	if counter != 1 {
+		t.Fatalf("Expected 1 row but %v", counter)
+	}
+
+	if id != 1 && fbool != true {
+		t.Fatalf("Value for id 1 should be %v, not %v", bool1, fbool)
+	}
+
+	rows, err = db.Query("SELECT id, fbool FROM foo where fbool = ?", bool2)
+	if err != nil {
+		t.Fatal("Unable to query foo table:", err)
+	}
+
+	counter = 0
+
+	for rows.Next() {
+		if err := rows.Scan(&id, &fbool); err != nil {
+			t.Fatal("Unable to scan results:", err)
+		}
+		counter++
+	}
+
+	if counter != 1 {
+		t.Fatalf("Expected 1 row but %v", counter)
+	}
+
+	if id != 2 && fbool != false {
+		t.Fatalf("Value for id 2 should be %v, not %v", bool2, fbool)
+	}
+
+	// make sure "nonsense" triggered an error
+	rows, err = db.Query("SELECT id, fbool FROM foo where id=?;", 3)
+	if err != nil {
+		t.Fatal("Unable to query foo table:", err)
+	}
+
+	rows.Next()
+	err = rows.Scan(&id, &fbool)
+	if err == nil {
+		t.Error("Expected error from \"nonsense\" bool")
+	}
+}
+
+func TestFloat32(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec("CREATE TABLE foo(id INTEGER)")
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+
+	_, err = db.Exec("INSERT INTO foo(id) VALUES(null)")
+	if err != nil {
+		t.Fatal("Failed to insert null:", err)
+	}
+
+	rows, err := db.Query("SELECT id FROM foo")
+	if err != nil {
+		t.Fatal("Unable to query foo table:", err)
+	}
+
+	if !rows.Next() {
+		t.Fatal("Unable to query results:", err)
+	}
+
+	var id interface{}
+	if err := rows.Scan(&id); err != nil {
+		t.Fatal("Unable to scan results:", err)
+	}
+	if id != nil {
+		t.Error("Expected nil but not")
+	}
+}
+
+func TestNull(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	rows, err := db.Query("SELECT 3.141592")
+	if err != nil {
+		t.Fatal("Unable to query foo table:", err)
+	}
+
+	if !rows.Next() {
+		t.Fatal("Unable to query results:", err)
+	}
+
+	var v interface{}
+	if err := rows.Scan(&v); err != nil {
+		t.Fatal("Unable to scan results:", err)
+	}
+	f, ok := v.(float64)
+	if !ok {
+		t.Error("Expected float but not")
+	}
+	if f != 3.141592 {
+		t.Error("Expected 3.141592 but not")
+	}
+}
+
+func TestTransaction(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec("CREATE TABLE foo(id INTEGER)")
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+
+	tx, err := db.Begin()
+	if err != nil {
+		t.Fatal("Failed to begin transaction:", err)
+	}
+
+	_, err = tx.Exec("INSERT INTO foo(id) VALUES(1)")
+	if err != nil {
+		t.Fatal("Failed to insert null:", err)
+	}
+
+	rows, err := tx.Query("SELECT id from foo")
+	if err != nil {
+		t.Fatal("Unable to query foo table:", err)
+	}
+
+	err = tx.Rollback()
+	if err != nil {
+		t.Fatal("Failed to rollback transaction:", err)
+	}
+
+	if rows.Next() {
+		t.Fatal("Unable to query results:", err)
+	}
+
+	tx, err = db.Begin()
+	if err != nil {
+		t.Fatal("Failed to begin transaction:", err)
+	}
+
+	_, err = tx.Exec("INSERT INTO foo(id) VALUES(1)")
+	if err != nil {
+		t.Fatal("Failed to insert null:", err)
+	}
+
+	err = tx.Commit()
+	if err != nil {
+		t.Fatal("Failed to commit transaction:", err)
+	}
+
+	rows, err = tx.Query("SELECT id from foo")
+	if err == nil {
+		t.Fatal("Expected failure to query")
+	}
+}
+
+func TestWAL(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+
+	defer os.Remove(tempFilename)
+	defer db.Close()
+	if _, err = db.Exec("PRAGMA journal_mode=WAL;"); err != nil {
+		t.Fatal("Failed to Exec PRAGMA journal_mode:", err)
+	}
+	if _, err = db.Exec("PRAGMA locking_mode=EXCLUSIVE;"); err != nil {
+		t.Fatal("Failed to Exec PRAGMA locking_mode:", err)
+	}
+	if _, err = db.Exec("CREATE TABLE test (id SERIAL, user TEXT NOT NULL, name TEXT NOT NULL);"); err != nil {
+		t.Fatal("Failed to Exec CREATE TABLE:", err)
+	}
+	if _, err = db.Exec("INSERT INTO test (user, name) VALUES ('user','name');"); err != nil {
+		t.Fatal("Failed to Exec INSERT:", err)
+	}
+
+	trans, err := db.Begin()
+	if err != nil {
+		t.Fatal("Failed to Begin:", err)
+	}
+	s, err := trans.Prepare("INSERT INTO test (user, name) VALUES (?, ?);")
+	if err != nil {
+		t.Fatal("Failed to Prepare:", err)
+	}
+
+	var count int
+	if err = trans.QueryRow("SELECT count(user) FROM test;").Scan(&count); err != nil {
+		t.Fatal("Failed to QueryRow:", err)
+	}
+	if _, err = s.Exec("bbbb", "aaaa"); err != nil {
+		t.Fatal("Failed to Exec prepared statement:", err)
+	}
+	if err = s.Close(); err != nil {
+		t.Fatal("Failed to Close prepared statement:", err)
+	}
+	if err = trans.Commit(); err != nil {
+		t.Fatal("Failed to Commit:", err)
+	}
+}
+
+func TestTimezoneConversion(t *testing.T) {
+	zones := []string{"UTC", "US/Central", "US/Pacific", "Local"}
+	for _, tz := range zones {
+		tempFilename := TempFilename()
+		db, err := sql.Open("sqlite3", tempFilename+"?_loc="+url.QueryEscape(tz))
+		if err != nil {
+			t.Fatal("Failed to open database:", err)
+		}
+		defer os.Remove(tempFilename)
+		defer db.Close()
+
+		_, err = db.Exec("DROP TABLE foo")
+		_, err = db.Exec("CREATE TABLE foo(id INTEGER, ts TIMESTAMP, dt DATETIME)")
+		if err != nil {
+			t.Fatal("Failed to create table:", err)
+		}
+
+		loc, err := time.LoadLocation(tz)
+		if err != nil {
+			t.Fatal("Failed to load location:", err)
+		}
+
+		timestamp1 := time.Date(2012, time.April, 6, 22, 50, 0, 0, time.UTC)
+		timestamp2 := time.Date(2006, time.January, 2, 15, 4, 5, 123456789, time.UTC)
+		timestamp3 := time.Date(2012, time.November, 4, 0, 0, 0, 0, time.UTC)
+		tests := []struct {
+			value    interface{}
+			expected time.Time
+		}{
+			{"nonsense", time.Time{}.In(loc)},
+			{"0000-00-00 00:00:00", time.Time{}.In(loc)},
+			{timestamp1, timestamp1.In(loc)},
+			{timestamp1.Unix(), timestamp1.In(loc)},
+			{timestamp1.In(time.FixedZone("TEST", -7*3600)), timestamp1.In(loc)},
+			{timestamp1.Format("2006-01-02 15:04:05.000"), timestamp1.In(loc)},
+			{timestamp1.Format("2006-01-02T15:04:05.000"), timestamp1.In(loc)},
+			{timestamp1.Format("2006-01-02 15:04:05"), timestamp1.In(loc)},
+			{timestamp1.Format("2006-01-02T15:04:05"), timestamp1.In(loc)},
+			{timestamp2, timestamp2.In(loc)},
+			{"2006-01-02 15:04:05.123456789", timestamp2.In(loc)},
+			{"2006-01-02T15:04:05.123456789", timestamp2.In(loc)},
+			{"2012-11-04", timestamp3.In(loc)},
+			{"2012-11-04 00:00", timestamp3.In(loc)},
+			{"2012-11-04 00:00:00", timestamp3.In(loc)},
+			{"2012-11-04 00:00:00.000", timestamp3.In(loc)},
+			{"2012-11-04T00:00", timestamp3.In(loc)},
+			{"2012-11-04T00:00:00", timestamp3.In(loc)},
+			{"2012-11-04T00:00:00.000", timestamp3.In(loc)},
+		}
+		for i := range tests {
+			_, err = db.Exec("INSERT INTO foo(id, ts, dt) VALUES(?, ?, ?)", i, tests[i].value, tests[i].value)
+			if err != nil {
+				t.Fatal("Failed to insert timestamp:", err)
+			}
+		}
+
+		rows, err := db.Query("SELECT id, ts, dt FROM foo ORDER BY id ASC")
+		if err != nil {
+			t.Fatal("Unable to query foo table:", err)
+		}
+		defer rows.Close()
+
+		seen := 0
+		for rows.Next() {
+			var id int
+			var ts, dt time.Time
+
+			if err := rows.Scan(&id, &ts, &dt); err != nil {
+				t.Error("Unable to scan results:", err)
+				continue
+			}
+			if id < 0 || id >= len(tests) {
+				t.Error("Bad row id: ", id)
+				continue
+			}
+			seen++
+			if !tests[id].expected.Equal(ts) {
+				t.Errorf("Timestamp value for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected, ts)
+			}
+			if !tests[id].expected.Equal(dt) {
+				t.Errorf("Datetime value for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected, dt)
+			}
+			if tests[id].expected.Location().String() != ts.Location().String() {
+				t.Errorf("Location for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected.Location().String(), ts.Location().String())
+			}
+			if tests[id].expected.Location().String() != dt.Location().String() {
+				t.Errorf("Location for id %v (%v) should be %v, not %v", id, tests[id].value, tests[id].expected.Location().String(), dt.Location().String())
+			}
+		}
+
+		if seen != len(tests) {
+			t.Errorf("Expected to see %d rows", len(tests))
+		}
+	}
+}
+
+func TestSuite(t *testing.T) {
+	db, err := sql.Open("sqlite3", ":memory:")
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer db.Close()
+
+	sqlite3_test.RunTests(t, db, sqlite3_test.SQLITE)
+}
+
+// TODO: Execer & Queryer currently disabled
+// https://github.com/mattn/go-sqlite3/issues/82
+func TestExecer(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec(`
+       create table foo (id integer); -- one comment
+       insert into foo(id) values(?);
+       insert into foo(id) values(?);
+       insert into foo(id) values(?); -- another comment
+       `, 1, 2, 3)
+	if err != nil {
+		t.Error("Failed to call db.Exec:", err)
+	}
+}
+
+func TestQueryer(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec(`
+	create table foo (id integer);
+	`)
+	if err != nil {
+		t.Error("Failed to call db.Query:", err)
+	}
+
+	rows, err := db.Query(`
+	insert into foo(id) values(?);
+	insert into foo(id) values(?);
+	insert into foo(id) values(?);
+	select id from foo order by id;
+	`, 3, 2, 1)
+	if err != nil {
+		t.Error("Failed to call db.Query:", err)
+	}
+	defer rows.Close()
+	n := 1
+	if rows != nil {
+		for rows.Next() {
+			var id int
+			err = rows.Scan(&id)
+			if err != nil {
+				t.Error("Failed to db.Query:", err)
+			}
+			if id != n {
+				t.Error("Failed to db.Query: not matched results")
+			}
+		}
+	}
+}
+
+func TestStress(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	db.Exec("CREATE TABLE foo (id int);")
+	db.Exec("INSERT INTO foo VALUES(1);")
+	db.Exec("INSERT INTO foo VALUES(2);")
+	db.Close()
+
+	for i := 0; i < 10000; i++ {
+		db, err := sql.Open("sqlite3", tempFilename)
+		if err != nil {
+			t.Fatal("Failed to open database:", err)
+		}
+
+		for j := 0; j < 3; j++ {
+			rows, err := db.Query("select * from foo where id=1;")
+			if err != nil {
+				t.Error("Failed to call db.Query:", err)
+			}
+			for rows.Next() {
+				var i int
+				if err := rows.Scan(&i); err != nil {
+					t.Errorf("Scan failed: %v\n", err)
+				}
+			}
+			if err := rows.Err(); err != nil {
+				t.Errorf("Post-scan failed: %v\n", err)
+			}
+			rows.Close()
+		}
+		db.Close()
+	}
+}
+
+func TestDateTimeLocal(t *testing.T) {
+	zone := "Asia/Tokyo"
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename+"?_loc="+zone)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	db.Exec("CREATE TABLE foo (dt datetime);")
+	db.Exec("INSERT INTO foo VALUES('2015-03-05 15:16:17');")
+
+	row := db.QueryRow("select * from foo")
+	var d time.Time
+	err = row.Scan(&d)
+	if err != nil {
+		t.Fatal("Failed to scan datetime:", err)
+	}
+	if d.Hour() == 15 || !strings.Contains(d.String(), "JST") {
+		t.Fatal("Result should have timezone", d)
+	}
+	db.Close()
+
+	db, err = sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+
+	row = db.QueryRow("select * from foo")
+	err = row.Scan(&d)
+	if err != nil {
+		t.Fatal("Failed to scan datetime:", err)
+	}
+	if d.UTC().Hour() != 15 || !strings.Contains(d.String(), "UTC") {
+		t.Fatalf("Result should not have timezone %v %v", zone, d.String())
+	}
+
+	_, err = db.Exec("DELETE FROM foo")
+	if err != nil {
+		t.Fatal("Failed to delete table:", err)
+	}
+	dt, err := time.Parse("2006/1/2 15/4/5 -0700 MST", "2015/3/5 15/16/17 +0900 JST")
+	if err != nil {
+		t.Fatal("Failed to parse datetime:", err)
+	}
+	db.Exec("INSERT INTO foo VALUES(?);", dt)
+
+	db.Close()
+	db, err = sql.Open("sqlite3", tempFilename+"?_loc="+zone)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+
+	row = db.QueryRow("select * from foo")
+	err = row.Scan(&d)
+	if err != nil {
+		t.Fatal("Failed to scan datetime:", err)
+	}
+	if d.Hour() != 15 || !strings.Contains(d.String(), "JST") {
+		t.Fatalf("Result should have timezone %v %v", zone, d.String())
+	}
+}
+
+func TestVersion(t *testing.T) {
+	s, n, id := Version()
+	if s == "" || n == 0 || id == "" {
+		t.Errorf("Version failed %q, %d, %q\n", s, n, id)
+	}
+}
+
+func TestNumberNamedParams(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec(`
+	create table foo (id integer, name text, extra text);
+	`)
+	if err != nil {
+		t.Error("Failed to call db.Query:", err)
+	}
+
+	_, err = db.Exec(`insert into foo(id, name, extra) values($1, $2, $2)`, 1, "foo")
+	if err != nil {
+		t.Error("Failed to call db.Exec:", err)
+	}
+
+	row := db.QueryRow(`select id, extra from foo where id = $1 and extra = $2`, 1, "foo")
+	if row == nil {
+		t.Error("Failed to call db.QueryRow")
+	}
+	var id int
+	var extra string
+	err = row.Scan(&id, &extra)
+	if err != nil {
+		t.Error("Failed to db.Scan:", err)
+	}
+	if id != 1 || extra != "foo" {
+		t.Error("Failed to db.QueryRow: not matched results")
+	}
+}
+
+func TestStringContainingZero(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer os.Remove(tempFilename)
+	defer db.Close()
+
+	_, err = db.Exec(`
+	create table foo (id integer, name, extra text);
+	`)
+	if err != nil {
+		t.Error("Failed to call db.Query:", err)
+	}
+
+	const text = "foo\x00bar"
+
+	_, err = db.Exec(`insert into foo(id, name, extra) values($1, $2, $2)`, 1, text)
+	if err != nil {
+		t.Error("Failed to call db.Exec:", err)
+	}
+
+	row := db.QueryRow(`select id, extra from foo where id = $1 and extra = $2`, 1, text)
+	if row == nil {
+		t.Error("Failed to call db.QueryRow")
+	}
+
+	var id int
+	var extra string
+	err = row.Scan(&id, &extra)
+	if err != nil {
+		t.Error("Failed to db.Scan:", err)
+	}
+	if id != 1 || extra != text {
+		t.Error("Failed to db.QueryRow: not matched results")
+	}
+}
+
+const CurrentTimeStamp = "2006-01-02 15:04:05"
+
+type TimeStamp struct{ *time.Time }
+
+func (t TimeStamp) Scan(value interface{}) error {
+	var err error
+	switch v := value.(type) {
+	case string:
+		*t.Time, err = time.Parse(CurrentTimeStamp, v)
+	case []byte:
+		*t.Time, err = time.Parse(CurrentTimeStamp, string(v))
+	default:
+		err = errors.New("invalid type for current_timestamp")
+	}
+	return err
+}
+
+func (t TimeStamp) Value() (driver.Value, error) {
+	return t.Time.Format(CurrentTimeStamp), nil
+}
+
+func TestDateTimeNow(t *testing.T) {
+	tempFilename := TempFilename()
+	db, err := sql.Open("sqlite3", tempFilename)
+	if err != nil {
+		t.Fatal("Failed to open database:", err)
+	}
+	defer db.Close()
+
+	var d time.Time
+	err = db.QueryRow("SELECT datetime('now')").Scan(TimeStamp{&d})
+	if err != nil {
+		t.Fatal("Failed to scan datetime:", err)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test/sqltest.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test/sqltest.go b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test/sqltest.go
new file mode 100644
index 0000000..fc82782
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_test/sqltest.go
@@ -0,0 +1,412 @@
+package sqlite3_test
+
+import (
+	"database/sql"
+	"fmt"
+	"math/rand"
+	"regexp"
+	"strconv"
+	"sync"
+	"testing"
+	"time"
+)
+
+type Dialect int
+
+const (
+	SQLITE Dialect = iota
+	POSTGRESQL
+	MYSQL
+)
+
+type DB struct {
+	*testing.T
+	*sql.DB
+	dialect Dialect
+	once    sync.Once
+}
+
+var db *DB
+
+// the following tables will be created and dropped during the test
+var testTables = []string{"foo", "bar", "t", "bench"}
+
+var tests = []testing.InternalTest{
+	{"TestBlobs", TestBlobs},
+	{"TestManyQueryRow", TestManyQueryRow},
+	{"TestTxQuery", TestTxQuery},
+	{"TestPreparedStmt", TestPreparedStmt},
+}
+
+var benchmarks = []testing.InternalBenchmark{
+	{"BenchmarkExec", BenchmarkExec},
+	{"BenchmarkQuery", BenchmarkQuery},
+	{"BenchmarkParams", BenchmarkParams},
+	{"BenchmarkStmt", BenchmarkStmt},
+	{"BenchmarkRows", BenchmarkRows},
+	{"BenchmarkStmtRows", BenchmarkStmtRows},
+}
+
+// RunTests runs the SQL test suite
+func RunTests(t *testing.T, d *sql.DB, dialect Dialect) {
+	db = &DB{t, d, dialect, sync.Once{}}
+	testing.RunTests(func(string, string) (bool, error) { return true, nil }, tests)
+
+	if !testing.Short() {
+		for _, b := range benchmarks {
+			fmt.Printf("%-20s", b.Name)
+			r := testing.Benchmark(b.F)
+			fmt.Printf("%10d %10.0f req/s\n", r.N, float64(r.N)/r.T.Seconds())
+		}
+	}
+	db.tearDown()
+}
+
+func (db *DB) mustExec(sql string, args ...interface{}) sql.Result {
+	res, err := db.Exec(sql, args...)
+	if err != nil {
+		db.Fatalf("Error running %q: %v", sql, err)
+	}
+	return res
+}
+
+func (db *DB) tearDown() {
+	for _, tbl := range testTables {
+		switch db.dialect {
+		case SQLITE:
+			db.mustExec("drop table if exists " + tbl)
+		case MYSQL, POSTGRESQL:
+			db.mustExec("drop table if exists " + tbl)
+		default:
+			db.Fatal("unkown dialect")
+		}
+	}
+}
+
+// q replaces ? parameters if needed
+func (db *DB) q(sql string) string {
+	switch db.dialect {
+	case POSTGRESQL: // repace with $1, $2, ..
+		qrx := regexp.MustCompile(`\?`)
+		n := 0
+		return qrx.ReplaceAllStringFunc(sql, func(string) string {
+			n++
+			return "$" + strconv.Itoa(n)
+		})
+	}
+	return sql
+}
+
+func (db *DB) blobType(size int) string {
+	switch db.dialect {
+	case SQLITE:
+		return fmt.Sprintf("blob[%d]", size)
+	case POSTGRESQL:
+		return "bytea"
+	case MYSQL:
+		return fmt.Sprintf("VARBINARY(%d)", size)
+	}
+	panic("unkown dialect")
+}
+
+func (db *DB) serialPK() string {
+	switch db.dialect {
+	case SQLITE:
+		return "integer primary key autoincrement"
+	case POSTGRESQL:
+		return "serial primary key"
+	case MYSQL:
+		return "integer primary key auto_increment"
+	}
+	panic("unkown dialect")
+}
+
+func (db *DB) now() string {
+	switch db.dialect {
+	case SQLITE:
+		return "datetime('now')"
+	case POSTGRESQL:
+		return "now()"
+	case MYSQL:
+		return "now()"
+	}
+	panic("unkown dialect")
+}
+
+func makeBench() {
+	if _, err := db.Exec("create table bench (n varchar(32), i integer, d double, s varchar(32), t datetime)"); err != nil {
+		panic(err)
+	}
+	st, err := db.Prepare("insert into bench values (?, ?, ?, ?, ?)")
+	if err != nil {
+		panic(err)
+	}
+	defer st.Close()
+	for i := 0; i < 100; i++ {
+		if _, err = st.Exec(nil, i, float64(i), fmt.Sprintf("%d", i), time.Now()); err != nil {
+			panic(err)
+		}
+	}
+}
+
+func TestResult(t *testing.T) {
+	db.tearDown()
+	db.mustExec("create temporary table test (id " + db.serialPK() + ", name varchar(10))")
+
+	for i := 1; i < 3; i++ {
+		r := db.mustExec(db.q("insert into test (name) values (?)"), fmt.Sprintf("row %d", i))
+		n, err := r.RowsAffected()
+		if err != nil {
+			t.Fatal(err)
+		}
+		if n != 1 {
+			t.Errorf("got %v, want %v", n, 1)
+		}
+		n, err = r.LastInsertId()
+		if err != nil {
+			t.Fatal(err)
+		}
+		if n != int64(i) {
+			t.Errorf("got %v, want %v", n, i)
+		}
+	}
+	if _, err := db.Exec("error!"); err == nil {
+		t.Fatalf("expected error")
+	}
+}
+
+func TestBlobs(t *testing.T) {
+	db.tearDown()
+	var blob = []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
+	db.mustExec("create table foo (id integer primary key, bar " + db.blobType(16) + ")")
+	db.mustExec(db.q("insert into foo (id, bar) values(?,?)"), 0, blob)
+
+	want := fmt.Sprintf("%x", blob)
+
+	b := make([]byte, 16)
+	err := db.QueryRow(db.q("select bar from foo where id = ?"), 0).Scan(&b)
+	got := fmt.Sprintf("%x", b)
+	if err != nil {
+		t.Errorf("[]byte scan: %v", err)
+	} else if got != want {
+		t.Errorf("for []byte, got %q; want %q", got, want)
+	}
+
+	err = db.QueryRow(db.q("select bar from foo where id = ?"), 0).Scan(&got)
+	want = string(blob)
+	if err != nil {
+		t.Errorf("string scan: %v", err)
+	} else if got != want {
+		t.Errorf("for string, got %q; want %q", got, want)
+	}
+}
+
+func TestManyQueryRow(t *testing.T) {
+	if testing.Short() {
+		t.Log("skipping in short mode")
+		return
+	}
+	db.tearDown()
+	db.mustExec("create table foo (id integer primary key, name varchar(50))")
+	db.mustExec(db.q("insert into foo (id, name) values(?,?)"), 1, "bob")
+	var name string
+	for i := 0; i < 10000; i++ {
+		err := db.QueryRow(db.q("select name from foo where id = ?"), 1).Scan(&name)
+		if err != nil || name != "bob" {
+			t.Fatalf("on query %d: err=%v, name=%q", i, err, name)
+		}
+	}
+}
+
+func TestTxQuery(t *testing.T) {
+	db.tearDown()
+	tx, err := db.Begin()
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer tx.Rollback()
+
+	_, err = tx.Exec("create table foo (id integer primary key, name varchar(50))")
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	_, err = tx.Exec(db.q("insert into foo (id, name) values(?,?)"), 1, "bob")
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	r, err := tx.Query(db.q("select name from foo where id = ?"), 1)
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer r.Close()
+
+	if !r.Next() {
+		if r.Err() != nil {
+			t.Fatal(err)
+		}
+		t.Fatal("expected one rows")
+	}
+
+	var name string
+	err = r.Scan(&name)
+	if err != nil {
+		t.Fatal(err)
+	}
+}
+
+func TestPreparedStmt(t *testing.T) {
+	db.tearDown()
+	db.mustExec("CREATE TABLE t (count INT)")
+	sel, err := db.Prepare("SELECT count FROM t ORDER BY count DESC")
+	if err != nil {
+		t.Fatalf("prepare 1: %v", err)
+	}
+	ins, err := db.Prepare(db.q("INSERT INTO t (count) VALUES (?)"))
+	if err != nil {
+		t.Fatalf("prepare 2: %v", err)
+	}
+
+	for n := 1; n <= 3; n++ {
+		if _, err := ins.Exec(n); err != nil {
+			t.Fatalf("insert(%d) = %v", n, err)
+		}
+	}
+
+	const nRuns = 10
+	ch := make(chan bool)
+	for i := 0; i < nRuns; i++ {
+		go func() {
+			defer func() {
+				ch <- true
+			}()
+			for j := 0; j < 10; j++ {
+				count := 0
+				if err := sel.QueryRow().Scan(&count); err != nil && err != sql.ErrNoRows {
+					t.Errorf("Query: %v", err)
+					return
+				}
+				if _, err := ins.Exec(rand.Intn(100)); err != nil {
+					t.Errorf("Insert: %v", err)
+					return
+				}
+			}
+		}()
+	}
+	for i := 0; i < nRuns; i++ {
+		<-ch
+	}
+}
+
+// Benchmarks need to use panic() since b.Error errors are lost when
+// running via testing.Benchmark() I would like to run these via go
+// test -bench but calling Benchmark() from a benchmark test
+// currently hangs go.
+
+func BenchmarkExec(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		if _, err := db.Exec("select 1"); err != nil {
+			panic(err)
+		}
+	}
+}
+
+func BenchmarkQuery(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		var n sql.NullString
+		var i int
+		var f float64
+		var s string
+//		var t time.Time
+		if err := db.QueryRow("select null, 1, 1.1, 'foo'").Scan(&n, &i, &f, &s); err != nil {
+			panic(err)
+		}
+	}
+}
+
+func BenchmarkParams(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		var n sql.NullString
+		var i int
+		var f float64
+		var s string
+//		var t time.Time
+		if err := db.QueryRow("select ?, ?, ?, ?", nil, 1, 1.1, "foo").Scan(&n, &i, &f, &s); err != nil {
+			panic(err)
+		}
+	}
+}
+
+func BenchmarkStmt(b *testing.B) {
+	st, err := db.Prepare("select ?, ?, ?, ?")
+	if err != nil {
+		panic(err)
+	}
+	defer st.Close()
+
+	for n := 0; n < b.N; n++ {
+		var n sql.NullString
+		var i int
+		var f float64
+		var s string
+//		var t time.Time
+		if err := st.QueryRow(nil, 1, 1.1, "foo").Scan(&n, &i, &f, &s); err != nil {
+			panic(err)
+		}
+	}
+}
+
+func BenchmarkRows(b *testing.B) {
+	db.once.Do(makeBench)
+
+	for n := 0; n < b.N; n++ {
+		var n sql.NullString
+		var i int
+		var f float64
+		var s string
+		var t time.Time
+		r, err := db.Query("select * from bench")
+		if err != nil {
+			panic(err)
+		}
+		for r.Next() {
+			if err = r.Scan(&n, &i, &f, &s, &t); err != nil {
+				panic(err)
+			}
+		}
+		if err = r.Err(); err != nil {
+			panic(err)
+		}
+	}
+}
+
+func BenchmarkStmtRows(b *testing.B) {
+	db.once.Do(makeBench)
+
+	st, err := db.Prepare("select * from bench")
+	if err != nil {
+		panic(err)
+	}
+	defer st.Close()
+
+	for n := 0; n < b.N; n++ {
+		var n sql.NullString
+		var i int
+		var f float64
+		var s string
+		var t time.Time
+		r, err := st.Query()
+		if err != nil {
+			panic(err)
+		}
+		for r.Next() {
+			if err = r.Scan(&n, &i, &f, &s, &t); err != nil {
+				panic(err)
+			}
+		}
+		if err = r.Err(); err != nil {
+			panic(err)
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_windows.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_windows.go b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_windows.go
new file mode 100644
index 0000000..abc8384
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3_windows.go
@@ -0,0 +1,14 @@
+// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+// +build windows
+
+package sqlite3
+
+/*
+#cgo CFLAGS: -I. -fno-stack-check -fno-stack-protector -mno-stack-arg-probe
+#cgo windows,386 CFLAGS: -D_localtime32=localtime
+#cgo LDFLAGS: -lmingwex -lmingw32
+*/
+import "C"

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3ext.h
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3ext.h b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3ext.h
new file mode 100644
index 0000000..7cc58b6
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/sqlite3ext.h
@@ -0,0 +1,487 @@
+/*
+** 2006 June 7
+**
+** The author disclaims copyright to this source code.  In place of
+** a legal notice, here is a blessing:
+**
+**    May you do good and not evil.
+**    May you find forgiveness for yourself and forgive others.
+**    May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This header file defines the SQLite interface for use by
+** shared libraries that want to be imported as extensions into
+** an SQLite instance.  Shared libraries that intend to be loaded
+** as extensions by SQLite should #include this file instead of 
+** sqlite3.h.
+*/
+#ifndef _SQLITE3EXT_H_
+#define _SQLITE3EXT_H_
+#include "sqlite3-binding.h"
+
+typedef struct sqlite3_api_routines sqlite3_api_routines;
+
+/*
+** The following structure holds pointers to all of the SQLite API
+** routines.
+**
+** WARNING:  In order to maintain backwards compatibility, add new
+** interfaces to the end of this structure only.  If you insert new
+** interfaces in the middle of this structure, then older different
+** versions of SQLite will not be able to load each others' shared
+** libraries!
+*/
+struct sqlite3_api_routines {
+  void * (*aggregate_context)(sqlite3_context*,int nBytes);
+  int  (*aggregate_count)(sqlite3_context*);
+  int  (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));
+  int  (*bind_double)(sqlite3_stmt*,int,double);
+  int  (*bind_int)(sqlite3_stmt*,int,int);
+  int  (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);
+  int  (*bind_null)(sqlite3_stmt*,int);
+  int  (*bind_parameter_count)(sqlite3_stmt*);
+  int  (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
+  const char * (*bind_parameter_name)(sqlite3_stmt*,int);
+  int  (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
+  int  (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));
+  int  (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);
+  int  (*busy_handler)(sqlite3*,int(*)(void*,int),void*);
+  int  (*busy_timeout)(sqlite3*,int ms);
+  int  (*changes)(sqlite3*);
+  int  (*close)(sqlite3*);
+  int  (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,
+                           int eTextRep,const char*));
+  int  (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,
+                             int eTextRep,const void*));
+  const void * (*column_blob)(sqlite3_stmt*,int iCol);
+  int  (*column_bytes)(sqlite3_stmt*,int iCol);
+  int  (*column_bytes16)(sqlite3_stmt*,int iCol);
+  int  (*column_count)(sqlite3_stmt*pStmt);
+  const char * (*column_database_name)(sqlite3_stmt*,int);
+  const void * (*column_database_name16)(sqlite3_stmt*,int);
+  const char * (*column_decltype)(sqlite3_stmt*,int i);
+  const void * (*column_decltype16)(sqlite3_stmt*,int);
+  double  (*column_double)(sqlite3_stmt*,int iCol);
+  int  (*column_int)(sqlite3_stmt*,int iCol);
+  sqlite_int64  (*column_int64)(sqlite3_stmt*,int iCol);
+  const char * (*column_name)(sqlite3_stmt*,int);
+  const void * (*column_name16)(sqlite3_stmt*,int);
+  const char * (*column_origin_name)(sqlite3_stmt*,int);
+  const void * (*column_origin_name16)(sqlite3_stmt*,int);
+  const char * (*column_table_name)(sqlite3_stmt*,int);
+  const void * (*column_table_name16)(sqlite3_stmt*,int);
+  const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
+  const void * (*column_text16)(sqlite3_stmt*,int iCol);
+  int  (*column_type)(sqlite3_stmt*,int iCol);
+  sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
+  void * (*commit_hook)(sqlite3*,int(*)(void*),void*);
+  int  (*complete)(const char*sql);
+  int  (*complete16)(const void*sql);
+  int  (*create_collation)(sqlite3*,const char*,int,void*,
+                           int(*)(void*,int,const void*,int,const void*));
+  int  (*create_collation16)(sqlite3*,const void*,int,void*,
+                             int(*)(void*,int,const void*,int,const void*));
+  int  (*create_function)(sqlite3*,const char*,int,int,void*,
+                          void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
+                          void (*xStep)(sqlite3_context*,int,sqlite3_value**),
+                          void (*xFinal)(sqlite3_context*));
+  int  (*create_function16)(sqlite3*,const void*,int,int,void*,
+                            void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
+                            void (*xStep)(sqlite3_context*,int,sqlite3_value**),
+                            void (*xFinal)(sqlite3_context*));
+  int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
+  int  (*data_count)(sqlite3_stmt*pStmt);
+  sqlite3 * (*db_handle)(sqlite3_stmt*);
+  int (*declare_vtab)(sqlite3*,const char*);
+  int  (*enable_shared_cache)(int);
+  int  (*errcode)(sqlite3*db);
+  const char * (*errmsg)(sqlite3*);
+  const void * (*errmsg16)(sqlite3*);
+  int  (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
+  int  (*expired)(sqlite3_stmt*);
+  int  (*finalize)(sqlite3_stmt*pStmt);
+  void  (*free)(void*);
+  void  (*free_table)(char**result);
+  int  (*get_autocommit)(sqlite3*);
+  void * (*get_auxdata)(sqlite3_context*,int);
+  int  (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
+  int  (*global_recover)(void);
+  void  (*interruptx)(sqlite3*);
+  sqlite_int64  (*last_insert_rowid)(sqlite3*);
+  const char * (*libversion)(void);
+  int  (*libversion_number)(void);
+  void *(*malloc)(int);
+  char * (*mprintf)(const char*,...);
+  int  (*open)(const char*,sqlite3**);
+  int  (*open16)(const void*,sqlite3**);
+  int  (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
+  int  (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
+  void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
+  void  (*progress_handler)(sqlite3*,int,int(*)(void*),void*);
+  void *(*realloc)(void*,int);
+  int  (*reset)(sqlite3_stmt*pStmt);
+  void  (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));
+  void  (*result_double)(sqlite3_context*,double);
+  void  (*result_error)(sqlite3_context*,const char*,int);
+  void  (*result_error16)(sqlite3_context*,const void*,int);
+  void  (*result_int)(sqlite3_context*,int);
+  void  (*result_int64)(sqlite3_context*,sqlite_int64);
+  void  (*result_null)(sqlite3_context*);
+  void  (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
+  void  (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));
+  void  (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));
+  void  (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));
+  void  (*result_value)(sqlite3_context*,sqlite3_value*);
+  void * (*rollback_hook)(sqlite3*,void(*)(void*),void*);
+  int  (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,
+                         const char*,const char*),void*);
+  void  (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));
+  char * (*snprintf)(int,char*,const char*,...);
+  int  (*step)(sqlite3_stmt*);
+  int  (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,
+                                char const**,char const**,int*,int*,int*);
+  void  (*thread_cleanup)(void);
+  int  (*total_changes)(sqlite3*);
+  void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
+  int  (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
+  void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,
+                                         sqlite_int64),void*);
+  void * (*user_data)(sqlite3_context*);
+  const void * (*value_blob)(sqlite3_value*);
+  int  (*value_bytes)(sqlite3_value*);
+  int  (*value_bytes16)(sqlite3_value*);
+  double  (*value_double)(sqlite3_value*);
+  int  (*value_int)(sqlite3_value*);
+  sqlite_int64  (*value_int64)(sqlite3_value*);
+  int  (*value_numeric_type)(sqlite3_value*);
+  const unsigned char * (*value_text)(sqlite3_value*);
+  const void * (*value_text16)(sqlite3_value*);
+  const void * (*value_text16be)(sqlite3_value*);
+  const void * (*value_text16le)(sqlite3_value*);
+  int  (*value_type)(sqlite3_value*);
+  char *(*vmprintf)(const char*,va_list);
+  /* Added ??? */
+  int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
+  /* Added by 3.3.13 */
+  int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
+  int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
+  int (*clear_bindings)(sqlite3_stmt*);
+  /* Added by 3.4.1 */
+  int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,
+                          void (*xDestroy)(void *));
+  /* Added by 3.5.0 */
+  int (*bind_zeroblob)(sqlite3_stmt*,int,int);
+  int (*blob_bytes)(sqlite3_blob*);
+  int (*blob_close)(sqlite3_blob*);
+  int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,
+                   int,sqlite3_blob**);
+  int (*blob_read)(sqlite3_blob*,void*,int,int);
+  int (*blob_write)(sqlite3_blob*,const void*,int,int);
+  int (*create_collation_v2)(sqlite3*,const char*,int,void*,
+                             int(*)(void*,int,const void*,int,const void*),
+                             void(*)(void*));
+  int (*file_control)(sqlite3*,const char*,int,void*);
+  sqlite3_int64 (*memory_highwater)(int);
+  sqlite3_int64 (*memory_used)(void);
+  sqlite3_mutex *(*mutex_alloc)(int);
+  void (*mutex_enter)(sqlite3_mutex*);
+  void (*mutex_free)(sqlite3_mutex*);
+  void (*mutex_leave)(sqlite3_mutex*);
+  int (*mutex_try)(sqlite3_mutex*);
+  int (*open_v2)(const char*,sqlite3**,int,const char*);
+  int (*release_memory)(int);
+  void (*result_error_nomem)(sqlite3_context*);
+  void (*result_error_toobig)(sqlite3_context*);
+  int (*sleep)(int);
+  void (*soft_heap_limit)(int);
+  sqlite3_vfs *(*vfs_find)(const char*);
+  int (*vfs_register)(sqlite3_vfs*,int);
+  int (*vfs_unregister)(sqlite3_vfs*);
+  int (*xthreadsafe)(void);
+  void (*result_zeroblob)(sqlite3_context*,int);
+  void (*result_error_code)(sqlite3_context*,int);
+  int (*test_control)(int, ...);
+  void (*randomness)(int,void*);
+  sqlite3 *(*context_db_handle)(sqlite3_context*);
+  int (*extended_result_codes)(sqlite3*,int);
+  int (*limit)(sqlite3*,int,int);
+  sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
+  const char *(*sql)(sqlite3_stmt*);
+  int (*status)(int,int*,int*,int);
+  int (*backup_finish)(sqlite3_backup*);
+  sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*);
+  int (*backup_pagecount)(sqlite3_backup*);
+  int (*backup_remaining)(sqlite3_backup*);
+  int (*backup_step)(sqlite3_backup*,int);
+  const char *(*compileoption_get)(int);
+  int (*compileoption_used)(const char*);
+  int (*create_function_v2)(sqlite3*,const char*,int,int,void*,
+                            void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
+                            void (*xStep)(sqlite3_context*,int,sqlite3_value**),
+                            void (*xFinal)(sqlite3_context*),
+                            void(*xDestroy)(void*));
+  int (*db_config)(sqlite3*,int,...);
+  sqlite3_mutex *(*db_mutex)(sqlite3*);
+  int (*db_status)(sqlite3*,int,int*,int*,int);
+  int (*extended_errcode)(sqlite3*);
+  void (*log)(int,const char*,...);
+  sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64);
+  const char *(*sourceid)(void);
+  int (*stmt_status)(sqlite3_stmt*,int,int);
+  int (*strnicmp)(const char*,const char*,int);
+  int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*);
+  int (*wal_autocheckpoint)(sqlite3*,int);
+  int (*wal_checkpoint)(sqlite3*,const char*);
+  void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*);
+  int (*blob_reopen)(sqlite3_blob*,sqlite3_int64);
+  int (*vtab_config)(sqlite3*,int op,...);
+  int (*vtab_on_conflict)(sqlite3*);
+  /* Version 3.7.16 and later */
+  int (*close_v2)(sqlite3*);
+  const char *(*db_filename)(sqlite3*,const char*);
+  int (*db_readonly)(sqlite3*,const char*);
+  int (*db_release_memory)(sqlite3*);
+  const char *(*errstr)(int);
+  int (*stmt_busy)(sqlite3_stmt*);
+  int (*stmt_readonly)(sqlite3_stmt*);
+  int (*stricmp)(const char*,const char*);
+  int (*uri_boolean)(const char*,const char*,int);
+  sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
+  const char *(*uri_parameter)(const char*,const char*);
+  char *(*vsnprintf)(int,char*,const char*,va_list);
+  int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
+};
+
+/*
+** The following macros redefine the API routines so that they are
+** redirected throught the global sqlite3_api structure.
+**
+** This header file is also used by the loadext.c source file
+** (part of the main SQLite library - not an extension) so that
+** it can get access to the sqlite3_api_routines structure
+** definition.  But the main library does not want to redefine
+** the API.  So the redefinition macros are only valid if the
+** SQLITE_CORE macros is undefined.
+*/
+#ifndef SQLITE_CORE
+#define sqlite3_aggregate_context      sqlite3_api->aggregate_context
+#ifndef SQLITE_OMIT_DEPRECATED
+#define sqlite3_aggregate_count        sqlite3_api->aggregate_count
+#endif
+#define sqlite3_bind_blob              sqlite3_api->bind_blob
+#define sqlite3_bind_double            sqlite3_api->bind_double
+#define sqlite3_bind_int               sqlite3_api->bind_int
+#define sqlite3_bind_int64             sqlite3_api->bind_int64
+#define sqlite3_bind_null              sqlite3_api->bind_null
+#define sqlite3_bind_parameter_count   sqlite3_api->bind_parameter_count
+#define sqlite3_bind_parameter_index   sqlite3_api->bind_parameter_index
+#define sqlite3_bind_parameter_name    sqlite3_api->bind_parameter_name
+#define sqlite3_bind_text              sqlite3_api->bind_text
+#define sqlite3_bind_text16            sqlite3_api->bind_text16
+#define sqlite3_bind_value             sqlite3_api->bind_value
+#define sqlite3_busy_handler           sqlite3_api->busy_handler
+#define sqlite3_busy_timeout           sqlite3_api->busy_timeout
+#define sqlite3_changes                sqlite3_api->changes
+#define sqlite3_close                  sqlite3_api->close
+#define sqlite3_collation_needed       sqlite3_api->collation_needed
+#define sqlite3_collation_needed16     sqlite3_api->collation_needed16
+#define sqlite3_column_blob            sqlite3_api->column_blob
+#define sqlite3_column_bytes           sqlite3_api->column_bytes
+#define sqlite3_column_bytes16         sqlite3_api->column_bytes16
+#define sqlite3_column_count           sqlite3_api->column_count
+#define sqlite3_column_database_name   sqlite3_api->column_database_name
+#define sqlite3_column_database_name16 sqlite3_api->column_database_name16
+#define sqlite3_column_decltype        sqlite3_api->column_decltype
+#define sqlite3_column_decltype16      sqlite3_api->column_decltype16
+#define sqlite3_column_double          sqlite3_api->column_double
+#define sqlite3_column_int             sqlite3_api->column_int
+#define sqlite3_column_int64           sqlite3_api->column_int64
+#define sqlite3_column_name            sqlite3_api->column_name
+#define sqlite3_column_name16          sqlite3_api->column_name16
+#define sqlite3_column_origin_name     sqlite3_api->column_origin_name
+#define sqlite3_column_origin_name16   sqlite3_api->column_origin_name16
+#define sqlite3_column_table_name      sqlite3_api->column_table_name
+#define sqlite3_column_table_name16    sqlite3_api->column_table_name16
+#define sqlite3_column_text            sqlite3_api->column_text
+#define sqlite3_column_text16          sqlite3_api->column_text16
+#define sqlite3_column_type            sqlite3_api->column_type
+#define sqlite3_column_value           sqlite3_api->column_value
+#define sqlite3_commit_hook            sqlite3_api->commit_hook
+#define sqlite3_complete               sqlite3_api->complete
+#define sqlite3_complete16             sqlite3_api->complete16
+#define sqlite3_create_collation       sqlite3_api->create_collation
+#define sqlite3_create_collation16     sqlite3_api->create_collation16
+#define sqlite3_create_function        sqlite3_api->create_function
+#define sqlite3_create_function16      sqlite3_api->create_function16
+#define sqlite3_create_module          sqlite3_api->create_module
+#define sqlite3_create_module_v2       sqlite3_api->create_module_v2
+#define sqlite3_data_count             sqlite3_api->data_count
+#define sqlite3_db_handle              sqlite3_api->db_handle
+#define sqlite3_declare_vtab           sqlite3_api->declare_vtab
+#define sqlite3_enable_shared_cache    sqlite3_api->enable_shared_cache
+#define sqlite3_errcode                sqlite3_api->errcode
+#define sqlite3_errmsg                 sqlite3_api->errmsg
+#define sqlite3_errmsg16               sqlite3_api->errmsg16
+#define sqlite3_exec                   sqlite3_api->exec
+#ifndef SQLITE_OMIT_DEPRECATED
+#define sqlite3_expired                sqlite3_api->expired
+#endif
+#define sqlite3_finalize               sqlite3_api->finalize
+#define sqlite3_free                   sqlite3_api->free
+#define sqlite3_free_table             sqlite3_api->free_table
+#define sqlite3_get_autocommit         sqlite3_api->get_autocommit
+#define sqlite3_get_auxdata            sqlite3_api->get_auxdata
+#define sqlite3_get_table              sqlite3_api->get_table
+#ifndef SQLITE_OMIT_DEPRECATED
+#define sqlite3_global_recover         sqlite3_api->global_recover
+#endif
+#define sqlite3_interrupt              sqlite3_api->interruptx
+#define sqlite3_last_insert_rowid      sqlite3_api->last_insert_rowid
+#define sqlite3_libversion             sqlite3_api->libversion
+#define sqlite3_libversion_number      sqlite3_api->libversion_number
+#define sqlite3_malloc                 sqlite3_api->malloc
+#define sqlite3_mprintf                sqlite3_api->mprintf
+#define sqlite3_open                   sqlite3_api->open
+#define sqlite3_open16                 sqlite3_api->open16
+#define sqlite3_prepare                sqlite3_api->prepare
+#define sqlite3_prepare16              sqlite3_api->prepare16
+#define sqlite3_prepare_v2             sqlite3_api->prepare_v2
+#define sqlite3_prepare16_v2           sqlite3_api->prepare16_v2
+#define sqlite3_profile                sqlite3_api->profile
+#define sqlite3_progress_handler       sqlite3_api->progress_handler
+#define sqlite3_realloc                sqlite3_api->realloc
+#define sqlite3_reset                  sqlite3_api->reset
+#define sqlite3_result_blob            sqlite3_api->result_blob
+#define sqlite3_result_double          sqlite3_api->result_double
+#define sqlite3_result_error           sqlite3_api->result_error
+#define sqlite3_result_error16         sqlite3_api->result_error16
+#define sqlite3_result_int             sqlite3_api->result_int
+#define sqlite3_result_int64           sqlite3_api->result_int64
+#define sqlite3_result_null            sqlite3_api->result_null
+#define sqlite3_result_text            sqlite3_api->result_text
+#define sqlite3_result_text16          sqlite3_api->result_text16
+#define sqlite3_result_text16be        sqlite3_api->result_text16be
+#define sqlite3_result_text16le        sqlite3_api->result_text16le
+#define sqlite3_result_value           sqlite3_api->result_value
+#define sqlite3_rollback_hook          sqlite3_api->rollback_hook
+#define sqlite3_set_authorizer         sqlite3_api->set_authorizer
+#define sqlite3_set_auxdata            sqlite3_api->set_auxdata
+#define sqlite3_snprintf               sqlite3_api->snprintf
+#define sqlite3_step                   sqlite3_api->step
+#define sqlite3_table_column_metadata  sqlite3_api->table_column_metadata
+#define sqlite3_thread_cleanup         sqlite3_api->thread_cleanup
+#define sqlite3_total_changes          sqlite3_api->total_changes
+#define sqlite3_trace                  sqlite3_api->trace
+#ifndef SQLITE_OMIT_DEPRECATED
+#define sqlite3_transfer_bindings      sqlite3_api->transfer_bindings
+#endif
+#define sqlite3_update_hook            sqlite3_api->update_hook
+#define sqlite3_user_data              sqlite3_api->user_data
+#define sqlite3_value_blob             sqlite3_api->value_blob
+#define sqlite3_value_bytes            sqlite3_api->value_bytes
+#define sqlite3_value_bytes16          sqlite3_api->value_bytes16
+#define sqlite3_value_double           sqlite3_api->value_double
+#define sqlite3_value_int              sqlite3_api->value_int
+#define sqlite3_value_int64            sqlite3_api->value_int64
+#define sqlite3_value_numeric_type     sqlite3_api->value_numeric_type
+#define sqlite3_value_text             sqlite3_api->value_text
+#define sqlite3_value_text16           sqlite3_api->value_text16
+#define sqlite3_value_text16be         sqlite3_api->value_text16be
+#define sqlite3_value_text16le         sqlite3_api->value_text16le
+#define sqlite3_value_type             sqlite3_api->value_type
+#define sqlite3_vmprintf               sqlite3_api->vmprintf
+#define sqlite3_overload_function      sqlite3_api->overload_function
+#define sqlite3_prepare_v2             sqlite3_api->prepare_v2
+#define sqlite3_prepare16_v2           sqlite3_api->prepare16_v2
+#define sqlite3_clear_bindings         sqlite3_api->clear_bindings
+#define sqlite3_bind_zeroblob          sqlite3_api->bind_zeroblob
+#define sqlite3_blob_bytes             sqlite3_api->blob_bytes
+#define sqlite3_blob_close             sqlite3_api->blob_close
+#define sqlite3_blob_open              sqlite3_api->blob_open
+#define sqlite3_blob_read              sqlite3_api->blob_read
+#define sqlite3_blob_write             sqlite3_api->blob_write
+#define sqlite3_create_collation_v2    sqlite3_api->create_collation_v2
+#define sqlite3_file_control           sqlite3_api->file_control
+#define sqlite3_memory_highwater       sqlite3_api->memory_highwater
+#define sqlite3_memory_used            sqlite3_api->memory_used
+#define sqlite3_mutex_alloc            sqlite3_api->mutex_alloc
+#define sqlite3_mutex_enter            sqlite3_api->mutex_enter
+#define sqlite3_mutex_free             sqlite3_api->mutex_free
+#define sqlite3_mutex_leave            sqlite3_api->mutex_leave
+#define sqlite3_mutex_try              sqlite3_api->mutex_try
+#define sqlite3_open_v2                sqlite3_api->open_v2
+#define sqlite3_release_memory         sqlite3_api->release_memory
+#define sqlite3_result_error_nomem     sqlite3_api->result_error_nomem
+#define sqlite3_result_error_toobig    sqlite3_api->result_error_toobig
+#define sqlite3_sleep                  sqlite3_api->sleep
+#define sqlite3_soft_heap_limit        sqlite3_api->soft_heap_limit
+#define sqlite3_vfs_find               sqlite3_api->vfs_find
+#define sqlite3_vfs_register           sqlite3_api->vfs_register
+#define sqlite3_vfs_unregister         sqlite3_api->vfs_unregister
+#define sqlite3_threadsafe             sqlite3_api->xthreadsafe
+#define sqlite3_result_zeroblob        sqlite3_api->result_zeroblob
+#define sqlite3_result_error_code      sqlite3_api->result_error_code
+#define sqlite3_test_control           sqlite3_api->test_control
+#define sqlite3_randomness             sqlite3_api->randomness
+#define sqlite3_context_db_handle      sqlite3_api->context_db_handle
+#define sqlite3_extended_result_codes  sqlite3_api->extended_result_codes
+#define sqlite3_limit                  sqlite3_api->limit
+#define sqlite3_next_stmt              sqlite3_api->next_stmt
+#define sqlite3_sql                    sqlite3_api->sql
+#define sqlite3_status                 sqlite3_api->status
+#define sqlite3_backup_finish          sqlite3_api->backup_finish
+#define sqlite3_backup_init            sqlite3_api->backup_init
+#define sqlite3_backup_pagecount       sqlite3_api->backup_pagecount
+#define sqlite3_backup_remaining       sqlite3_api->backup_remaining
+#define sqlite3_backup_step            sqlite3_api->backup_step
+#define sqlite3_compileoption_get      sqlite3_api->compileoption_get
+#define sqlite3_compileoption_used     sqlite3_api->compileoption_used
+#define sqlite3_create_function_v2     sqlite3_api->create_function_v2
+#define sqlite3_db_config              sqlite3_api->db_config
+#define sqlite3_db_mutex               sqlite3_api->db_mutex
+#define sqlite3_db_status              sqlite3_api->db_status
+#define sqlite3_extended_errcode       sqlite3_api->extended_errcode
+#define sqlite3_log                    sqlite3_api->log
+#define sqlite3_soft_heap_limit64      sqlite3_api->soft_heap_limit64
+#define sqlite3_sourceid               sqlite3_api->sourceid
+#define sqlite3_stmt_status            sqlite3_api->stmt_status
+#define sqlite3_strnicmp               sqlite3_api->strnicmp
+#define sqlite3_unlock_notify          sqlite3_api->unlock_notify
+#define sqlite3_wal_autocheckpoint     sqlite3_api->wal_autocheckpoint
+#define sqlite3_wal_checkpoint         sqlite3_api->wal_checkpoint
+#define sqlite3_wal_hook               sqlite3_api->wal_hook
+#define sqlite3_blob_reopen            sqlite3_api->blob_reopen
+#define sqlite3_vtab_config            sqlite3_api->vtab_config
+#define sqlite3_vtab_on_conflict       sqlite3_api->vtab_on_conflict
+/* Version 3.7.16 and later */
+#define sqlite3_close_v2               sqlite3_api->close_v2
+#define sqlite3_db_filename            sqlite3_api->db_filename
+#define sqlite3_db_readonly            sqlite3_api->db_readonly
+#define sqlite3_db_release_memory      sqlite3_api->db_release_memory
+#define sqlite3_errstr                 sqlite3_api->errstr
+#define sqlite3_stmt_busy              sqlite3_api->stmt_busy
+#define sqlite3_stmt_readonly          sqlite3_api->stmt_readonly
+#define sqlite3_stricmp                sqlite3_api->stricmp
+#define sqlite3_uri_boolean            sqlite3_api->uri_boolean
+#define sqlite3_uri_int64              sqlite3_api->uri_int64
+#define sqlite3_uri_parameter          sqlite3_api->uri_parameter
+#define sqlite3_uri_vsnprintf          sqlite3_api->vsnprintf
+#define sqlite3_wal_checkpoint_v2      sqlite3_api->wal_checkpoint_v2
+#endif /* SQLITE_CORE */
+
+#ifndef SQLITE_CORE
+  /* This case when the file really is being compiled as a loadable 
+  ** extension */
+# define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api=0;
+# define SQLITE_EXTENSION_INIT2(v)  sqlite3_api=v;
+# define SQLITE_EXTENSION_INIT3     \
+    extern const sqlite3_api_routines *sqlite3_api;
+#else
+  /* This case when the file is being statically linked into the 
+  ** application */
+# define SQLITE_EXTENSION_INIT1     /*no-op*/
+# define SQLITE_EXTENSION_INIT2(v)  (void)v; /* unused parameter */
+# define SQLITE_EXTENSION_INIT3     /*no-op*/
+#endif
+
+#endif /* _SQLITE3EXT_H_ */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/.travis.yml
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/.travis.yml b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/.travis.yml
new file mode 100644
index 0000000..7f3fe9a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/.travis.yml
@@ -0,0 +1,7 @@
+language: go 
+
+go: 
+  - 1.4
+  
+script:
+  - go test 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE
new file mode 100644
index 0000000..f9c841a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Mitchell Hashimoto
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.



[20/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encode_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encode_test.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encode_test.go
new file mode 100644
index 0000000..445ca8e
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encode_test.go
@@ -0,0 +1,542 @@
+package toml
+
+import (
+	"bytes"
+	"fmt"
+	"log"
+	"net"
+	"testing"
+	"time"
+)
+
+func TestEncodeRoundTrip(t *testing.T) {
+	type Config struct {
+		Age        int
+		Cats       []string
+		Pi         float64
+		Perfection []int
+		DOB        time.Time
+		Ipaddress  net.IP
+	}
+
+	var inputs = Config{
+		13,
+		[]string{"one", "two", "three"},
+		3.145,
+		[]int{11, 2, 3, 4},
+		time.Now(),
+		net.ParseIP("192.168.59.254"),
+	}
+
+	var firstBuffer bytes.Buffer
+	e := NewEncoder(&firstBuffer)
+	err := e.Encode(inputs)
+	if err != nil {
+		t.Fatal(err)
+	}
+	var outputs Config
+	if _, err := Decode(firstBuffer.String(), &outputs); err != nil {
+		log.Printf("Could not decode:\n-----\n%s\n-----\n",
+			firstBuffer.String())
+		t.Fatal(err)
+	}
+
+	// could test each value individually, but I'm lazy
+	var secondBuffer bytes.Buffer
+	e2 := NewEncoder(&secondBuffer)
+	err = e2.Encode(outputs)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if firstBuffer.String() != secondBuffer.String() {
+		t.Error(
+			firstBuffer.String(),
+			"\n\n is not identical to\n\n",
+			secondBuffer.String())
+	}
+}
+
+// XXX(burntsushi)
+// I think these tests probably should be removed. They are good, but they
+// ought to be obsolete by toml-test.
+func TestEncode(t *testing.T) {
+	type Embedded struct {
+		Int int `toml:"_int"`
+	}
+	type NonStruct int
+
+	date := time.Date(2014, 5, 11, 20, 30, 40, 0, time.FixedZone("IST", 3600))
+	dateStr := "2014-05-11T19:30:40Z"
+
+	tests := map[string]struct {
+		input      interface{}
+		wantOutput string
+		wantError  error
+	}{
+		"bool field": {
+			input: struct {
+				BoolTrue  bool
+				BoolFalse bool
+			}{true, false},
+			wantOutput: "BoolTrue = true\nBoolFalse = false\n",
+		},
+		"int fields": {
+			input: struct {
+				Int   int
+				Int8  int8
+				Int16 int16
+				Int32 int32
+				Int64 int64
+			}{1, 2, 3, 4, 5},
+			wantOutput: "Int = 1\nInt8 = 2\nInt16 = 3\nInt32 = 4\nInt64 = 5\n",
+		},
+		"uint fields": {
+			input: struct {
+				Uint   uint
+				Uint8  uint8
+				Uint16 uint16
+				Uint32 uint32
+				Uint64 uint64
+			}{1, 2, 3, 4, 5},
+			wantOutput: "Uint = 1\nUint8 = 2\nUint16 = 3\nUint32 = 4" +
+				"\nUint64 = 5\n",
+		},
+		"float fields": {
+			input: struct {
+				Float32 float32
+				Float64 float64
+			}{1.5, 2.5},
+			wantOutput: "Float32 = 1.5\nFloat64 = 2.5\n",
+		},
+		"string field": {
+			input:      struct{ String string }{"foo"},
+			wantOutput: "String = \"foo\"\n",
+		},
+		"string field and unexported field": {
+			input: struct {
+				String     string
+				unexported int
+			}{"foo", 0},
+			wantOutput: "String = \"foo\"\n",
+		},
+		"datetime field in UTC": {
+			input:      struct{ Date time.Time }{date},
+			wantOutput: fmt.Sprintf("Date = %s\n", dateStr),
+		},
+		"datetime field as primitive": {
+			// Using a map here to fail if isStructOrMap() returns true for
+			// time.Time.
+			input: map[string]interface{}{
+				"Date": date,
+				"Int":  1,
+			},
+			wantOutput: fmt.Sprintf("Date = %s\nInt = 1\n", dateStr),
+		},
+		"array fields": {
+			input: struct {
+				IntArray0 [0]int
+				IntArray3 [3]int
+			}{[0]int{}, [3]int{1, 2, 3}},
+			wantOutput: "IntArray0 = []\nIntArray3 = [1, 2, 3]\n",
+		},
+		"slice fields": {
+			input: struct{ IntSliceNil, IntSlice0, IntSlice3 []int }{
+				nil, []int{}, []int{1, 2, 3},
+			},
+			wantOutput: "IntSlice0 = []\nIntSlice3 = [1, 2, 3]\n",
+		},
+		"datetime slices": {
+			input: struct{ DatetimeSlice []time.Time }{
+				[]time.Time{date, date},
+			},
+			wantOutput: fmt.Sprintf("DatetimeSlice = [%s, %s]\n",
+				dateStr, dateStr),
+		},
+		"nested arrays and slices": {
+			input: struct {
+				SliceOfArrays         [][2]int
+				ArrayOfSlices         [2][]int
+				SliceOfArraysOfSlices [][2][]int
+				ArrayOfSlicesOfArrays [2][][2]int
+				SliceOfMixedArrays    [][2]interface{}
+				ArrayOfMixedSlices    [2][]interface{}
+			}{
+				[][2]int{{1, 2}, {3, 4}},
+				[2][]int{{1, 2}, {3, 4}},
+				[][2][]int{
+					{
+						{1, 2}, {3, 4},
+					},
+					{
+						{5, 6}, {7, 8},
+					},
+				},
+				[2][][2]int{
+					{
+						{1, 2}, {3, 4},
+					},
+					{
+						{5, 6}, {7, 8},
+					},
+				},
+				[][2]interface{}{
+					{1, 2}, {"a", "b"},
+				},
+				[2][]interface{}{
+					{1, 2}, {"a", "b"},
+				},
+			},
+			wantOutput: `SliceOfArrays = [[1, 2], [3, 4]]
+ArrayOfSlices = [[1, 2], [3, 4]]
+SliceOfArraysOfSlices = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
+ArrayOfSlicesOfArrays = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
+SliceOfMixedArrays = [[1, 2], ["a", "b"]]
+ArrayOfMixedSlices = [[1, 2], ["a", "b"]]
+`,
+		},
+		"empty slice": {
+			input:      struct{ Empty []interface{} }{[]interface{}{}},
+			wantOutput: "Empty = []\n",
+		},
+		"(error) slice with element type mismatch (string and integer)": {
+			input:     struct{ Mixed []interface{} }{[]interface{}{1, "a"}},
+			wantError: errArrayMixedElementTypes,
+		},
+		"(error) slice with element type mismatch (integer and float)": {
+			input:     struct{ Mixed []interface{} }{[]interface{}{1, 2.5}},
+			wantError: errArrayMixedElementTypes,
+		},
+		"slice with elems of differing Go types, same TOML types": {
+			input: struct {
+				MixedInts   []interface{}
+				MixedFloats []interface{}
+			}{
+				[]interface{}{
+					int(1), int8(2), int16(3), int32(4), int64(5),
+					uint(1), uint8(2), uint16(3), uint32(4), uint64(5),
+				},
+				[]interface{}{float32(1.5), float64(2.5)},
+			},
+			wantOutput: "MixedInts = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]\n" +
+				"MixedFloats = [1.5, 2.5]\n",
+		},
+		"(error) slice w/ element type mismatch (one is nested array)": {
+			input: struct{ Mixed []interface{} }{
+				[]interface{}{1, []interface{}{2}},
+			},
+			wantError: errArrayMixedElementTypes,
+		},
+		"(error) slice with 1 nil element": {
+			input:     struct{ NilElement1 []interface{} }{[]interface{}{nil}},
+			wantError: errArrayNilElement,
+		},
+		"(error) slice with 1 nil element (and other non-nil elements)": {
+			input: struct{ NilElement []interface{} }{
+				[]interface{}{1, nil},
+			},
+			wantError: errArrayNilElement,
+		},
+		"simple map": {
+			input:      map[string]int{"a": 1, "b": 2},
+			wantOutput: "a = 1\nb = 2\n",
+		},
+		"map with interface{} value type": {
+			input:      map[string]interface{}{"a": 1, "b": "c"},
+			wantOutput: "a = 1\nb = \"c\"\n",
+		},
+		"map with interface{} value type, some of which are structs": {
+			input: map[string]interface{}{
+				"a": struct{ Int int }{2},
+				"b": 1,
+			},
+			wantOutput: "b = 1\n\n[a]\n  Int = 2\n",
+		},
+		"nested map": {
+			input: map[string]map[string]int{
+				"a": {"b": 1},
+				"c": {"d": 2},
+			},
+			wantOutput: "[a]\n  b = 1\n\n[c]\n  d = 2\n",
+		},
+		"nested struct": {
+			input: struct{ Struct struct{ Int int } }{
+				struct{ Int int }{1},
+			},
+			wantOutput: "[Struct]\n  Int = 1\n",
+		},
+		"nested struct and non-struct field": {
+			input: struct {
+				Struct struct{ Int int }
+				Bool   bool
+			}{struct{ Int int }{1}, true},
+			wantOutput: "Bool = true\n\n[Struct]\n  Int = 1\n",
+		},
+		"2 nested structs": {
+			input: struct{ Struct1, Struct2 struct{ Int int } }{
+				struct{ Int int }{1}, struct{ Int int }{2},
+			},
+			wantOutput: "[Struct1]\n  Int = 1\n\n[Struct2]\n  Int = 2\n",
+		},
+		"deeply nested structs": {
+			input: struct {
+				Struct1, Struct2 struct{ Struct3 *struct{ Int int } }
+			}{
+				struct{ Struct3 *struct{ Int int } }{&struct{ Int int }{1}},
+				struct{ Struct3 *struct{ Int int } }{nil},
+			},
+			wantOutput: "[Struct1]\n  [Struct1.Struct3]\n    Int = 1" +
+				"\n\n[Struct2]\n",
+		},
+		"nested struct with nil struct elem": {
+			input: struct {
+				Struct struct{ Inner *struct{ Int int } }
+			}{
+				struct{ Inner *struct{ Int int } }{nil},
+			},
+			wantOutput: "[Struct]\n",
+		},
+		"nested struct with no fields": {
+			input: struct {
+				Struct struct{ Inner struct{} }
+			}{
+				struct{ Inner struct{} }{struct{}{}},
+			},
+			wantOutput: "[Struct]\n  [Struct.Inner]\n",
+		},
+		"struct with tags": {
+			input: struct {
+				Struct struct {
+					Int int `toml:"_int"`
+				} `toml:"_struct"`
+				Bool bool `toml:"_bool"`
+			}{
+				struct {
+					Int int `toml:"_int"`
+				}{1}, true,
+			},
+			wantOutput: "_bool = true\n\n[_struct]\n  _int = 1\n",
+		},
+		"embedded struct": {
+			input:      struct{ Embedded }{Embedded{1}},
+			wantOutput: "_int = 1\n",
+		},
+		"embedded *struct": {
+			input:      struct{ *Embedded }{&Embedded{1}},
+			wantOutput: "_int = 1\n",
+		},
+		"nested embedded struct": {
+			input: struct {
+				Struct struct{ Embedded } `toml:"_struct"`
+			}{struct{ Embedded }{Embedded{1}}},
+			wantOutput: "[_struct]\n  _int = 1\n",
+		},
+		"nested embedded *struct": {
+			input: struct {
+				Struct struct{ *Embedded } `toml:"_struct"`
+			}{struct{ *Embedded }{&Embedded{1}}},
+			wantOutput: "[_struct]\n  _int = 1\n",
+		},
+		"array of tables": {
+			input: struct {
+				Structs []*struct{ Int int } `toml:"struct"`
+			}{
+				[]*struct{ Int int }{{1}, {3}},
+			},
+			wantOutput: "[[struct]]\n  Int = 1\n\n[[struct]]\n  Int = 3\n",
+		},
+		"array of tables order": {
+			input: map[string]interface{}{
+				"map": map[string]interface{}{
+					"zero": 5,
+					"arr": []map[string]int{
+						map[string]int{
+							"friend": 5,
+						},
+					},
+				},
+			},
+			wantOutput: "[map]\n  zero = 5\n\n  [[map.arr]]\n    friend = 5\n",
+		},
+		"(error) top-level slice": {
+			input:     []struct{ Int int }{{1}, {2}, {3}},
+			wantError: errNoKey,
+		},
+		"(error) slice of slice": {
+			input: struct {
+				Slices [][]struct{ Int int }
+			}{
+				[][]struct{ Int int }{{{1}}, {{2}}, {{3}}},
+			},
+			wantError: errArrayNoTable,
+		},
+		"(error) map no string key": {
+			input:     map[int]string{1: ""},
+			wantError: errNonString,
+		},
+		"(error) anonymous non-struct": {
+			input:     struct{ NonStruct }{5},
+			wantError: errAnonNonStruct,
+		},
+		"(error) empty key name": {
+			input:     map[string]int{"": 1},
+			wantError: errAnything,
+		},
+		"(error) empty map name": {
+			input: map[string]interface{}{
+				"": map[string]int{"v": 1},
+			},
+			wantError: errAnything,
+		},
+	}
+	for label, test := range tests {
+		encodeExpected(t, label, test.input, test.wantOutput, test.wantError)
+	}
+}
+
+func TestEncodeNestedTableArrays(t *testing.T) {
+	type song struct {
+		Name string `toml:"name"`
+	}
+	type album struct {
+		Name  string `toml:"name"`
+		Songs []song `toml:"songs"`
+	}
+	type springsteen struct {
+		Albums []album `toml:"albums"`
+	}
+	value := springsteen{
+		[]album{
+			{"Born to Run",
+				[]song{{"Jungleland"}, {"Meeting Across the River"}}},
+			{"Born in the USA",
+				[]song{{"Glory Days"}, {"Dancing in the Dark"}}},
+		},
+	}
+	expected := `[[albums]]
+  name = "Born to Run"
+
+  [[albums.songs]]
+    name = "Jungleland"
+
+  [[albums.songs]]
+    name = "Meeting Across the River"
+
+[[albums]]
+  name = "Born in the USA"
+
+  [[albums.songs]]
+    name = "Glory Days"
+
+  [[albums.songs]]
+    name = "Dancing in the Dark"
+`
+	encodeExpected(t, "nested table arrays", value, expected, nil)
+}
+
+func TestEncodeArrayHashWithNormalHashOrder(t *testing.T) {
+	type Alpha struct {
+		V int
+	}
+	type Beta struct {
+		V int
+	}
+	type Conf struct {
+		V int
+		A Alpha
+		B []Beta
+	}
+
+	val := Conf{
+		V: 1,
+		A: Alpha{2},
+		B: []Beta{{3}},
+	}
+	expected := "V = 1\n\n[A]\n  V = 2\n\n[[B]]\n  V = 3\n"
+	encodeExpected(t, "array hash with normal hash order", val, expected, nil)
+}
+
+func TestEncodeWithOmitEmpty(t *testing.T) {
+	type simple struct {
+		User string `toml:"user"`
+		Pass string `toml:"password,omitempty"`
+	}
+
+	value := simple{"Testing", ""}
+	expected := fmt.Sprintf("user = %q\n", value.User)
+	encodeExpected(t, "simple with omitempty, is empty", value, expected, nil)
+	value.Pass = "some password"
+	expected = fmt.Sprintf("user = %q\npassword = %q\n", value.User, value.Pass)
+	encodeExpected(t, "simple with omitempty, not empty", value, expected, nil)
+}
+
+func TestEncodeWithOmitZero(t *testing.T) {
+	type simple struct {
+		Number   int     `toml:"number,omitzero"`
+		Real     float64 `toml:"real,omitzero"`
+		Unsigned uint    `toml:"unsigned,omitzero"`
+	}
+
+	value := simple{0, 0.0, uint(0)}
+	expected := ""
+
+	encodeExpected(t, "simple with omitzero, all zero", value, expected, nil)
+
+	value.Number = 10
+	value.Real = 20
+	value.Unsigned = 5
+	expected = `number = 10
+real = 20.0
+unsigned = 5
+`
+	encodeExpected(t, "simple with omitzero, non-zero", value, expected, nil)
+}
+
+func encodeExpected(
+	t *testing.T, label string, val interface{}, wantStr string, wantErr error,
+) {
+	var buf bytes.Buffer
+	enc := NewEncoder(&buf)
+	err := enc.Encode(val)
+	if err != wantErr {
+		if wantErr != nil {
+			if wantErr == errAnything && err != nil {
+				return
+			}
+			t.Errorf("%s: want Encode error %v, got %v", label, wantErr, err)
+		} else {
+			t.Errorf("%s: Encode failed: %s", label, err)
+		}
+	}
+	if err != nil {
+		return
+	}
+	if got := buf.String(); wantStr != got {
+		t.Errorf("%s: want\n-----\n%q\n-----\nbut got\n-----\n%q\n-----\n",
+			label, wantStr, got)
+	}
+}
+
+func ExampleEncoder_Encode() {
+	date, _ := time.Parse(time.RFC822, "14 Mar 10 18:00 UTC")
+	var config = map[string]interface{}{
+		"date":   date,
+		"counts": []int{1, 1, 2, 3, 5, 8},
+		"hash": map[string]string{
+			"key1": "val1",
+			"key2": "val2",
+		},
+	}
+	buf := new(bytes.Buffer)
+	if err := NewEncoder(buf).Encode(config); err != nil {
+		log.Fatal(err)
+	}
+	fmt.Println(buf.String())
+
+	// Output:
+	// counts = [1, 1, 2, 3, 5, 8]
+	// date = 2010-03-14T18:00:00Z
+	//
+	// [hash]
+	//   key1 = "val1"
+	//   key2 = "val2"
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types.go
new file mode 100644
index 0000000..d36e1dd
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types.go
@@ -0,0 +1,19 @@
+// +build go1.2
+
+package toml
+
+// In order to support Go 1.1, we define our own TextMarshaler and
+// TextUnmarshaler types. For Go 1.2+, we just alias them with the
+// standard library interfaces.
+
+import (
+	"encoding"
+)
+
+// TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here
+// so that Go 1.1 can be supported.
+type TextMarshaler encoding.TextMarshaler
+
+// TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined
+// here so that Go 1.1 can be supported.
+type TextUnmarshaler encoding.TextUnmarshaler

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types_1.1.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types_1.1.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types_1.1.go
new file mode 100644
index 0000000..e8d503d
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types_1.1.go
@@ -0,0 +1,18 @@
+// +build !go1.2
+
+package toml
+
+// These interfaces were introduced in Go 1.2, so we add them manually when
+// compiling for Go 1.1.
+
+// TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here
+// so that Go 1.1 can be supported.
+type TextMarshaler interface {
+	MarshalText() (text []byte, err error)
+}
+
+// TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined
+// here so that Go 1.1 can be supported.
+type TextUnmarshaler interface {
+	UnmarshalText(text []byte) error
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go
new file mode 100644
index 0000000..2191228
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go
@@ -0,0 +1,874 @@
+package toml
+
+import (
+	"fmt"
+	"strings"
+	"unicode/utf8"
+)
+
+type itemType int
+
+const (
+	itemError itemType = iota
+	itemNIL            // used in the parser to indicate no type
+	itemEOF
+	itemText
+	itemString
+	itemRawString
+	itemMultilineString
+	itemRawMultilineString
+	itemBool
+	itemInteger
+	itemFloat
+	itemDatetime
+	itemArray // the start of an array
+	itemArrayEnd
+	itemTableStart
+	itemTableEnd
+	itemArrayTableStart
+	itemArrayTableEnd
+	itemKeyStart
+	itemCommentStart
+)
+
+const (
+	eof             = 0
+	tableStart      = '['
+	tableEnd        = ']'
+	arrayTableStart = '['
+	arrayTableEnd   = ']'
+	tableSep        = '.'
+	keySep          = '='
+	arrayStart      = '['
+	arrayEnd        = ']'
+	arrayValTerm    = ','
+	commentStart    = '#'
+	stringStart     = '"'
+	stringEnd       = '"'
+	rawStringStart  = '\''
+	rawStringEnd    = '\''
+)
+
+type stateFn func(lx *lexer) stateFn
+
+type lexer struct {
+	input string
+	start int
+	pos   int
+	width int
+	line  int
+	state stateFn
+	items chan item
+
+	// A stack of state functions used to maintain context.
+	// The idea is to reuse parts of the state machine in various places.
+	// For example, values can appear at the top level or within arbitrarily
+	// nested arrays. The last state on the stack is used after a value has
+	// been lexed. Similarly for comments.
+	stack []stateFn
+}
+
+type item struct {
+	typ  itemType
+	val  string
+	line int
+}
+
+func (lx *lexer) nextItem() item {
+	for {
+		select {
+		case item := <-lx.items:
+			return item
+		default:
+			lx.state = lx.state(lx)
+		}
+	}
+}
+
+func lex(input string) *lexer {
+	lx := &lexer{
+		input: input + "\n",
+		state: lexTop,
+		line:  1,
+		items: make(chan item, 10),
+		stack: make([]stateFn, 0, 10),
+	}
+	return lx
+}
+
+func (lx *lexer) push(state stateFn) {
+	lx.stack = append(lx.stack, state)
+}
+
+func (lx *lexer) pop() stateFn {
+	if len(lx.stack) == 0 {
+		return lx.errorf("BUG in lexer: no states to pop.")
+	}
+	last := lx.stack[len(lx.stack)-1]
+	lx.stack = lx.stack[0 : len(lx.stack)-1]
+	return last
+}
+
+func (lx *lexer) current() string {
+	return lx.input[lx.start:lx.pos]
+}
+
+func (lx *lexer) emit(typ itemType) {
+	lx.items <- item{typ, lx.current(), lx.line}
+	lx.start = lx.pos
+}
+
+func (lx *lexer) emitTrim(typ itemType) {
+	lx.items <- item{typ, strings.TrimSpace(lx.current()), lx.line}
+	lx.start = lx.pos
+}
+
+func (lx *lexer) next() (r rune) {
+	if lx.pos >= len(lx.input) {
+		lx.width = 0
+		return eof
+	}
+
+	if lx.input[lx.pos] == '\n' {
+		lx.line++
+	}
+	r, lx.width = utf8.DecodeRuneInString(lx.input[lx.pos:])
+	lx.pos += lx.width
+	return r
+}
+
+// ignore skips over the pending input before this point.
+func (lx *lexer) ignore() {
+	lx.start = lx.pos
+}
+
+// backup steps back one rune. Can be called only once per call of next.
+func (lx *lexer) backup() {
+	lx.pos -= lx.width
+	if lx.pos < len(lx.input) && lx.input[lx.pos] == '\n' {
+		lx.line--
+	}
+}
+
+// accept consumes the next rune if it's equal to `valid`.
+func (lx *lexer) accept(valid rune) bool {
+	if lx.next() == valid {
+		return true
+	}
+	lx.backup()
+	return false
+}
+
+// peek returns but does not consume the next rune in the input.
+func (lx *lexer) peek() rune {
+	r := lx.next()
+	lx.backup()
+	return r
+}
+
+// errorf stops all lexing by emitting an error and returning `nil`.
+// Note that any value that is a character is escaped if it's a special
+// character (new lines, tabs, etc.).
+func (lx *lexer) errorf(format string, values ...interface{}) stateFn {
+	lx.items <- item{
+		itemError,
+		fmt.Sprintf(format, values...),
+		lx.line,
+	}
+	return nil
+}
+
+// lexTop consumes elements at the top level of TOML data.
+func lexTop(lx *lexer) stateFn {
+	r := lx.next()
+	if isWhitespace(r) || isNL(r) {
+		return lexSkip(lx, lexTop)
+	}
+
+	switch r {
+	case commentStart:
+		lx.push(lexTop)
+		return lexCommentStart
+	case tableStart:
+		return lexTableStart
+	case eof:
+		if lx.pos > lx.start {
+			return lx.errorf("Unexpected EOF.")
+		}
+		lx.emit(itemEOF)
+		return nil
+	}
+
+	// At this point, the only valid item can be a key, so we back up
+	// and let the key lexer do the rest.
+	lx.backup()
+	lx.push(lexTopEnd)
+	return lexKeyStart
+}
+
+// lexTopEnd is entered whenever a top-level item has been consumed. (A value
+// or a table.) It must see only whitespace, and will turn back to lexTop
+// upon a new line. If it sees EOF, it will quit the lexer successfully.
+func lexTopEnd(lx *lexer) stateFn {
+	r := lx.next()
+	switch {
+	case r == commentStart:
+		// a comment will read to a new line for us.
+		lx.push(lexTop)
+		return lexCommentStart
+	case isWhitespace(r):
+		return lexTopEnd
+	case isNL(r):
+		lx.ignore()
+		return lexTop
+	case r == eof:
+		lx.ignore()
+		return lexTop
+	}
+	return lx.errorf("Expected a top-level item to end with a new line, "+
+		"comment or EOF, but got %q instead.", r)
+}
+
+// lexTable lexes the beginning of a table. Namely, it makes sure that
+// it starts with a character other than '.' and ']'.
+// It assumes that '[' has already been consumed.
+// It also handles the case that this is an item in an array of tables.
+// e.g., '[[name]]'.
+func lexTableStart(lx *lexer) stateFn {
+	if lx.peek() == arrayTableStart {
+		lx.next()
+		lx.emit(itemArrayTableStart)
+		lx.push(lexArrayTableEnd)
+	} else {
+		lx.emit(itemTableStart)
+		lx.push(lexTableEnd)
+	}
+	return lexTableNameStart
+}
+
+func lexTableEnd(lx *lexer) stateFn {
+	lx.emit(itemTableEnd)
+	return lexTopEnd
+}
+
+func lexArrayTableEnd(lx *lexer) stateFn {
+	if r := lx.next(); r != arrayTableEnd {
+		return lx.errorf("Expected end of table array name delimiter %q, "+
+			"but got %q instead.", arrayTableEnd, r)
+	}
+	lx.emit(itemArrayTableEnd)
+	return lexTopEnd
+}
+
+func lexTableNameStart(lx *lexer) stateFn {
+	switch r := lx.peek(); {
+	case r == tableEnd || r == eof:
+		return lx.errorf("Unexpected end of table name. (Table names cannot " +
+			"be empty.)")
+	case r == tableSep:
+		return lx.errorf("Unexpected table separator. (Table names cannot " +
+			"be empty.)")
+	case r == stringStart || r == rawStringStart:
+		lx.ignore()
+		lx.push(lexTableNameEnd)
+		return lexValue // reuse string lexing
+	case isWhitespace(r):
+		return lexTableNameStart
+	default:
+		return lexBareTableName
+	}
+}
+
+// lexTableName lexes the name of a table. It assumes that at least one
+// valid character for the table has already been read.
+func lexBareTableName(lx *lexer) stateFn {
+	switch r := lx.next(); {
+	case isBareKeyChar(r):
+		return lexBareTableName
+	case r == tableSep || r == tableEnd:
+		lx.backup()
+		lx.emitTrim(itemText)
+		return lexTableNameEnd
+	default:
+		return lx.errorf("Bare keys cannot contain %q.", r)
+	}
+}
+
+// lexTableNameEnd reads the end of a piece of a table name, optionally
+// consuming whitespace.
+func lexTableNameEnd(lx *lexer) stateFn {
+	switch r := lx.next(); {
+	case isWhitespace(r):
+		return lexTableNameEnd
+	case r == tableSep:
+		lx.ignore()
+		return lexTableNameStart
+	case r == tableEnd:
+		return lx.pop()
+	default:
+		return lx.errorf("Expected '.' or ']' to end table name, but got %q "+
+			"instead.", r)
+	}
+}
+
+// lexKeyStart consumes a key name up until the first non-whitespace character.
+// lexKeyStart will ignore whitespace.
+func lexKeyStart(lx *lexer) stateFn {
+	r := lx.peek()
+	switch {
+	case r == keySep:
+		return lx.errorf("Unexpected key separator %q.", keySep)
+	case isWhitespace(r) || isNL(r):
+		lx.next()
+		return lexSkip(lx, lexKeyStart)
+	case r == stringStart || r == rawStringStart:
+		lx.ignore()
+		lx.emit(itemKeyStart)
+		lx.push(lexKeyEnd)
+		return lexValue // reuse string lexing
+	default:
+		lx.ignore()
+		lx.emit(itemKeyStart)
+		return lexBareKey
+	}
+}
+
+// lexBareKey consumes the text of a bare key. Assumes that the first character
+// (which is not whitespace) has not yet been consumed.
+func lexBareKey(lx *lexer) stateFn {
+	switch r := lx.next(); {
+	case isBareKeyChar(r):
+		return lexBareKey
+	case isWhitespace(r):
+		lx.emitTrim(itemText)
+		return lexKeyEnd
+	case r == keySep:
+		lx.backup()
+		lx.emitTrim(itemText)
+		return lexKeyEnd
+	default:
+		return lx.errorf("Bare keys cannot contain %q.", r)
+	}
+}
+
+// lexKeyEnd consumes the end of a key and trims whitespace (up to the key
+// separator).
+func lexKeyEnd(lx *lexer) stateFn {
+	switch r := lx.next(); {
+	case r == keySep:
+		return lexSkip(lx, lexValue)
+	case isWhitespace(r):
+		return lexSkip(lx, lexKeyEnd)
+	default:
+		return lx.errorf("Expected key separator %q, but got %q instead.",
+			keySep, r)
+	}
+}
+
+// lexValue starts the consumption of a value anywhere a value is expected.
+// lexValue will ignore whitespace.
+// After a value is lexed, the last state on the next is popped and returned.
+func lexValue(lx *lexer) stateFn {
+	// We allow whitespace to precede a value, but NOT new lines.
+	// In array syntax, the array states are responsible for ignoring new
+	// lines.
+	r := lx.next()
+	if isWhitespace(r) {
+		return lexSkip(lx, lexValue)
+	}
+
+	switch {
+	case r == arrayStart:
+		lx.ignore()
+		lx.emit(itemArray)
+		return lexArrayValue
+	case r == stringStart:
+		if lx.accept(stringStart) {
+			if lx.accept(stringStart) {
+				lx.ignore() // Ignore """
+				return lexMultilineString
+			}
+			lx.backup()
+		}
+		lx.ignore() // ignore the '"'
+		return lexString
+	case r == rawStringStart:
+		if lx.accept(rawStringStart) {
+			if lx.accept(rawStringStart) {
+				lx.ignore() // Ignore """
+				return lexMultilineRawString
+			}
+			lx.backup()
+		}
+		lx.ignore() // ignore the "'"
+		return lexRawString
+	case r == 't':
+		return lexTrue
+	case r == 'f':
+		return lexFalse
+	case r == '-':
+		return lexNumberStart
+	case isDigit(r):
+		lx.backup() // avoid an extra state and use the same as above
+		return lexNumberOrDateStart
+	case r == '.': // special error case, be kind to users
+		return lx.errorf("Floats must start with a digit, not '.'.")
+	}
+	return lx.errorf("Expected value but found %q instead.", r)
+}
+
+// lexArrayValue consumes one value in an array. It assumes that '[' or ','
+// have already been consumed. All whitespace and new lines are ignored.
+func lexArrayValue(lx *lexer) stateFn {
+	r := lx.next()
+	switch {
+	case isWhitespace(r) || isNL(r):
+		return lexSkip(lx, lexArrayValue)
+	case r == commentStart:
+		lx.push(lexArrayValue)
+		return lexCommentStart
+	case r == arrayValTerm:
+		return lx.errorf("Unexpected array value terminator %q.",
+			arrayValTerm)
+	case r == arrayEnd:
+		return lexArrayEnd
+	}
+
+	lx.backup()
+	lx.push(lexArrayValueEnd)
+	return lexValue
+}
+
+// lexArrayValueEnd consumes the cruft between values of an array. Namely,
+// it ignores whitespace and expects either a ',' or a ']'.
+func lexArrayValueEnd(lx *lexer) stateFn {
+	r := lx.next()
+	switch {
+	case isWhitespace(r) || isNL(r):
+		return lexSkip(lx, lexArrayValueEnd)
+	case r == commentStart:
+		lx.push(lexArrayValueEnd)
+		return lexCommentStart
+	case r == arrayValTerm:
+		lx.ignore()
+		return lexArrayValue // move on to the next value
+	case r == arrayEnd:
+		return lexArrayEnd
+	}
+	return lx.errorf("Expected an array value terminator %q or an array "+
+		"terminator %q, but got %q instead.", arrayValTerm, arrayEnd, r)
+}
+
+// lexArrayEnd finishes the lexing of an array. It assumes that a ']' has
+// just been consumed.
+func lexArrayEnd(lx *lexer) stateFn {
+	lx.ignore()
+	lx.emit(itemArrayEnd)
+	return lx.pop()
+}
+
+// lexString consumes the inner contents of a string. It assumes that the
+// beginning '"' has already been consumed and ignored.
+func lexString(lx *lexer) stateFn {
+	r := lx.next()
+	switch {
+	case isNL(r):
+		return lx.errorf("Strings cannot contain new lines.")
+	case r == '\\':
+		lx.push(lexString)
+		return lexStringEscape
+	case r == stringEnd:
+		lx.backup()
+		lx.emit(itemString)
+		lx.next()
+		lx.ignore()
+		return lx.pop()
+	}
+	return lexString
+}
+
+// lexMultilineString consumes the inner contents of a string. It assumes that
+// the beginning '"""' has already been consumed and ignored.
+func lexMultilineString(lx *lexer) stateFn {
+	r := lx.next()
+	switch {
+	case r == '\\':
+		return lexMultilineStringEscape
+	case r == stringEnd:
+		if lx.accept(stringEnd) {
+			if lx.accept(stringEnd) {
+				lx.backup()
+				lx.backup()
+				lx.backup()
+				lx.emit(itemMultilineString)
+				lx.next()
+				lx.next()
+				lx.next()
+				lx.ignore()
+				return lx.pop()
+			}
+			lx.backup()
+		}
+	}
+	return lexMultilineString
+}
+
+// lexRawString consumes a raw string. Nothing can be escaped in such a string.
+// It assumes that the beginning "'" has already been consumed and ignored.
+func lexRawString(lx *lexer) stateFn {
+	r := lx.next()
+	switch {
+	case isNL(r):
+		return lx.errorf("Strings cannot contain new lines.")
+	case r == rawStringEnd:
+		lx.backup()
+		lx.emit(itemRawString)
+		lx.next()
+		lx.ignore()
+		return lx.pop()
+	}
+	return lexRawString
+}
+
+// lexMultilineRawString consumes a raw string. Nothing can be escaped in such
+// a string. It assumes that the beginning "'" has already been consumed and
+// ignored.
+func lexMultilineRawString(lx *lexer) stateFn {
+	r := lx.next()
+	switch {
+	case r == rawStringEnd:
+		if lx.accept(rawStringEnd) {
+			if lx.accept(rawStringEnd) {
+				lx.backup()
+				lx.backup()
+				lx.backup()
+				lx.emit(itemRawMultilineString)
+				lx.next()
+				lx.next()
+				lx.next()
+				lx.ignore()
+				return lx.pop()
+			}
+			lx.backup()
+		}
+	}
+	return lexMultilineRawString
+}
+
+// lexMultilineStringEscape consumes an escaped character. It assumes that the
+// preceding '\\' has already been consumed.
+func lexMultilineStringEscape(lx *lexer) stateFn {
+	// Handle the special case first:
+	if isNL(lx.next()) {
+		lx.next()
+		return lexMultilineString
+	} else {
+		lx.backup()
+		lx.push(lexMultilineString)
+		return lexStringEscape(lx)
+	}
+}
+
+func lexStringEscape(lx *lexer) stateFn {
+	r := lx.next()
+	switch r {
+	case 'b':
+		fallthrough
+	case 't':
+		fallthrough
+	case 'n':
+		fallthrough
+	case 'f':
+		fallthrough
+	case 'r':
+		fallthrough
+	case '"':
+		fallthrough
+	case '\\':
+		return lx.pop()
+	case 'u':
+		return lexShortUnicodeEscape
+	case 'U':
+		return lexLongUnicodeEscape
+	}
+	return lx.errorf("Invalid escape character %q. Only the following "+
+		"escape characters are allowed: "+
+		"\\b, \\t, \\n, \\f, \\r, \\\", \\/, \\\\, "+
+		"\\uXXXX and \\UXXXXXXXX.", r)
+}
+
+func lexShortUnicodeEscape(lx *lexer) stateFn {
+	var r rune
+	for i := 0; i < 4; i++ {
+		r = lx.next()
+		if !isHexadecimal(r) {
+			return lx.errorf("Expected four hexadecimal digits after '\\u', "+
+				"but got '%s' instead.", lx.current())
+		}
+	}
+	return lx.pop()
+}
+
+func lexLongUnicodeEscape(lx *lexer) stateFn {
+	var r rune
+	for i := 0; i < 8; i++ {
+		r = lx.next()
+		if !isHexadecimal(r) {
+			return lx.errorf("Expected eight hexadecimal digits after '\\U', "+
+				"but got '%s' instead.", lx.current())
+		}
+	}
+	return lx.pop()
+}
+
+// lexNumberOrDateStart consumes either a (positive) integer, float or
+// datetime. It assumes that NO negative sign has been consumed.
+func lexNumberOrDateStart(lx *lexer) stateFn {
+	r := lx.next()
+	if !isDigit(r) {
+		if r == '.' {
+			return lx.errorf("Floats must start with a digit, not '.'.")
+		} else {
+			return lx.errorf("Expected a digit but got %q.", r)
+		}
+	}
+	return lexNumberOrDate
+}
+
+// lexNumberOrDate consumes either a (positive) integer, float or datetime.
+func lexNumberOrDate(lx *lexer) stateFn {
+	r := lx.next()
+	switch {
+	case r == '-':
+		if lx.pos-lx.start != 5 {
+			return lx.errorf("All ISO8601 dates must be in full Zulu form.")
+		}
+		return lexDateAfterYear
+	case isDigit(r):
+		return lexNumberOrDate
+	case r == '.':
+		return lexFloatStart
+	}
+
+	lx.backup()
+	lx.emit(itemInteger)
+	return lx.pop()
+}
+
+// lexDateAfterYear consumes a full Zulu Datetime in ISO8601 format.
+// It assumes that "YYYY-" has already been consumed.
+func lexDateAfterYear(lx *lexer) stateFn {
+	formats := []rune{
+		// digits are '0'.
+		// everything else is direct equality.
+		'0', '0', '-', '0', '0',
+		'T',
+		'0', '0', ':', '0', '0', ':', '0', '0',
+		'Z',
+	}
+	for _, f := range formats {
+		r := lx.next()
+		if f == '0' {
+			if !isDigit(r) {
+				return lx.errorf("Expected digit in ISO8601 datetime, "+
+					"but found %q instead.", r)
+			}
+		} else if f != r {
+			return lx.errorf("Expected %q in ISO8601 datetime, "+
+				"but found %q instead.", f, r)
+		}
+	}
+	lx.emit(itemDatetime)
+	return lx.pop()
+}
+
+// lexNumberStart consumes either an integer or a float. It assumes that
+// a negative sign has already been read, but that *no* digits have been
+// consumed. lexNumberStart will move to the appropriate integer or float
+// states.
+func lexNumberStart(lx *lexer) stateFn {
+	// we MUST see a digit. Even floats have to start with a digit.
+	r := lx.next()
+	if !isDigit(r) {
+		if r == '.' {
+			return lx.errorf("Floats must start with a digit, not '.'.")
+		} else {
+			return lx.errorf("Expected a digit but got %q.", r)
+		}
+	}
+	return lexNumber
+}
+
+// lexNumber consumes an integer or a float after seeing the first digit.
+func lexNumber(lx *lexer) stateFn {
+	r := lx.next()
+	switch {
+	case isDigit(r):
+		return lexNumber
+	case r == '.':
+		return lexFloatStart
+	}
+
+	lx.backup()
+	lx.emit(itemInteger)
+	return lx.pop()
+}
+
+// lexFloatStart starts the consumption of digits of a float after a '.'.
+// Namely, at least one digit is required.
+func lexFloatStart(lx *lexer) stateFn {
+	r := lx.next()
+	if !isDigit(r) {
+		return lx.errorf("Floats must have a digit after the '.', but got "+
+			"%q instead.", r)
+	}
+	return lexFloat
+}
+
+// lexFloat consumes the digits of a float after a '.'.
+// Assumes that one digit has been consumed after a '.' already.
+func lexFloat(lx *lexer) stateFn {
+	r := lx.next()
+	if isDigit(r) {
+		return lexFloat
+	}
+
+	lx.backup()
+	lx.emit(itemFloat)
+	return lx.pop()
+}
+
+// lexConst consumes the s[1:] in s. It assumes that s[0] has already been
+// consumed.
+func lexConst(lx *lexer, s string) stateFn {
+	for i := range s[1:] {
+		if r := lx.next(); r != rune(s[i+1]) {
+			return lx.errorf("Expected %q, but found %q instead.", s[:i+1],
+				s[:i]+string(r))
+		}
+	}
+	return nil
+}
+
+// lexTrue consumes the "rue" in "true". It assumes that 't' has already
+// been consumed.
+func lexTrue(lx *lexer) stateFn {
+	if fn := lexConst(lx, "true"); fn != nil {
+		return fn
+	}
+	lx.emit(itemBool)
+	return lx.pop()
+}
+
+// lexFalse consumes the "alse" in "false". It assumes that 'f' has already
+// been consumed.
+func lexFalse(lx *lexer) stateFn {
+	if fn := lexConst(lx, "false"); fn != nil {
+		return fn
+	}
+	lx.emit(itemBool)
+	return lx.pop()
+}
+
+// lexCommentStart begins the lexing of a comment. It will emit
+// itemCommentStart and consume no characters, passing control to lexComment.
+func lexCommentStart(lx *lexer) stateFn {
+	lx.ignore()
+	lx.emit(itemCommentStart)
+	return lexComment
+}
+
+// lexComment lexes an entire comment. It assumes that '#' has been consumed.
+// It will consume *up to* the first new line character, and pass control
+// back to the last state on the stack.
+func lexComment(lx *lexer) stateFn {
+	r := lx.peek()
+	if isNL(r) || r == eof {
+		lx.emit(itemText)
+		return lx.pop()
+	}
+	lx.next()
+	return lexComment
+}
+
+// lexSkip ignores all slurped input and moves on to the next state.
+func lexSkip(lx *lexer, nextState stateFn) stateFn {
+	return func(lx *lexer) stateFn {
+		lx.ignore()
+		return nextState
+	}
+}
+
+// isWhitespace returns true if `r` is a whitespace character according
+// to the spec.
+func isWhitespace(r rune) bool {
+	return r == '\t' || r == ' '
+}
+
+func isNL(r rune) bool {
+	return r == '\n' || r == '\r'
+}
+
+func isDigit(r rune) bool {
+	return r >= '0' && r <= '9'
+}
+
+func isHexadecimal(r rune) bool {
+	return (r >= '0' && r <= '9') ||
+		(r >= 'a' && r <= 'f') ||
+		(r >= 'A' && r <= 'F')
+}
+
+func isBareKeyChar(r rune) bool {
+	return (r >= 'A' && r <= 'Z') ||
+		(r >= 'a' && r <= 'z') ||
+		(r >= '0' && r <= '9') ||
+		r == '_' ||
+		r == '-'
+}
+
+func (itype itemType) String() string {
+	switch itype {
+	case itemError:
+		return "Error"
+	case itemNIL:
+		return "NIL"
+	case itemEOF:
+		return "EOF"
+	case itemText:
+		return "Text"
+	case itemString:
+		return "String"
+	case itemRawString:
+		return "String"
+	case itemMultilineString:
+		return "String"
+	case itemRawMultilineString:
+		return "String"
+	case itemBool:
+		return "Bool"
+	case itemInteger:
+		return "Integer"
+	case itemFloat:
+		return "Float"
+	case itemDatetime:
+		return "DateTime"
+	case itemTableStart:
+		return "TableStart"
+	case itemTableEnd:
+		return "TableEnd"
+	case itemKeyStart:
+		return "KeyStart"
+	case itemArray:
+		return "Array"
+	case itemArrayEnd:
+		return "ArrayEnd"
+	case itemCommentStart:
+		return "CommentStart"
+	}
+	panic(fmt.Sprintf("BUG: Unknown type '%d'.", int(itype)))
+}
+
+func (item item) String() string {
+	return fmt.Sprintf("(%s, %s)", item.typ.String(), item.val)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/parse.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/parse.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/parse.go
new file mode 100644
index 0000000..c6069be
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/parse.go
@@ -0,0 +1,498 @@
+package toml
+
+import (
+	"fmt"
+	"log"
+	"strconv"
+	"strings"
+	"time"
+	"unicode"
+	"unicode/utf8"
+)
+
+type parser struct {
+	mapping map[string]interface{}
+	types   map[string]tomlType
+	lx      *lexer
+
+	// A list of keys in the order that they appear in the TOML data.
+	ordered []Key
+
+	// the full key for the current hash in scope
+	context Key
+
+	// the base key name for everything except hashes
+	currentKey string
+
+	// rough approximation of line number
+	approxLine int
+
+	// A map of 'key.group.names' to whether they were created implicitly.
+	implicits map[string]bool
+}
+
+type parseError string
+
+func (pe parseError) Error() string {
+	return string(pe)
+}
+
+func parse(data string) (p *parser, err error) {
+	defer func() {
+		if r := recover(); r != nil {
+			var ok bool
+			if err, ok = r.(parseError); ok {
+				return
+			}
+			panic(r)
+		}
+	}()
+
+	p = &parser{
+		mapping:   make(map[string]interface{}),
+		types:     make(map[string]tomlType),
+		lx:        lex(data),
+		ordered:   make([]Key, 0),
+		implicits: make(map[string]bool),
+	}
+	for {
+		item := p.next()
+		if item.typ == itemEOF {
+			break
+		}
+		p.topLevel(item)
+	}
+
+	return p, nil
+}
+
+func (p *parser) panicf(format string, v ...interface{}) {
+	msg := fmt.Sprintf("Near line %d (last key parsed '%s'): %s",
+		p.approxLine, p.current(), fmt.Sprintf(format, v...))
+	panic(parseError(msg))
+}
+
+func (p *parser) next() item {
+	it := p.lx.nextItem()
+	if it.typ == itemError {
+		p.panicf("%s", it.val)
+	}
+	return it
+}
+
+func (p *parser) bug(format string, v ...interface{}) {
+	log.Fatalf("BUG: %s\n\n", fmt.Sprintf(format, v...))
+}
+
+func (p *parser) expect(typ itemType) item {
+	it := p.next()
+	p.assertEqual(typ, it.typ)
+	return it
+}
+
+func (p *parser) assertEqual(expected, got itemType) {
+	if expected != got {
+		p.bug("Expected '%s' but got '%s'.", expected, got)
+	}
+}
+
+func (p *parser) topLevel(item item) {
+	switch item.typ {
+	case itemCommentStart:
+		p.approxLine = item.line
+		p.expect(itemText)
+	case itemTableStart:
+		kg := p.next()
+		p.approxLine = kg.line
+
+		var key Key
+		for ; kg.typ != itemTableEnd && kg.typ != itemEOF; kg = p.next() {
+			key = append(key, p.keyString(kg))
+		}
+		p.assertEqual(itemTableEnd, kg.typ)
+
+		p.establishContext(key, false)
+		p.setType("", tomlHash)
+		p.ordered = append(p.ordered, key)
+	case itemArrayTableStart:
+		kg := p.next()
+		p.approxLine = kg.line
+
+		var key Key
+		for ; kg.typ != itemArrayTableEnd && kg.typ != itemEOF; kg = p.next() {
+			key = append(key, p.keyString(kg))
+		}
+		p.assertEqual(itemArrayTableEnd, kg.typ)
+
+		p.establishContext(key, true)
+		p.setType("", tomlArrayHash)
+		p.ordered = append(p.ordered, key)
+	case itemKeyStart:
+		kname := p.next()
+		p.approxLine = kname.line
+		p.currentKey = p.keyString(kname)
+
+		val, typ := p.value(p.next())
+		p.setValue(p.currentKey, val)
+		p.setType(p.currentKey, typ)
+		p.ordered = append(p.ordered, p.context.add(p.currentKey))
+		p.currentKey = ""
+	default:
+		p.bug("Unexpected type at top level: %s", item.typ)
+	}
+}
+
+// Gets a string for a key (or part of a key in a table name).
+func (p *parser) keyString(it item) string {
+	switch it.typ {
+	case itemText:
+		return it.val
+	case itemString, itemMultilineString,
+		itemRawString, itemRawMultilineString:
+		s, _ := p.value(it)
+		return s.(string)
+	default:
+		p.bug("Unexpected key type: %s", it.typ)
+		panic("unreachable")
+	}
+}
+
+// value translates an expected value from the lexer into a Go value wrapped
+// as an empty interface.
+func (p *parser) value(it item) (interface{}, tomlType) {
+	switch it.typ {
+	case itemString:
+		return p.replaceEscapes(it.val), p.typeOfPrimitive(it)
+	case itemMultilineString:
+		trimmed := stripFirstNewline(stripEscapedWhitespace(it.val))
+		return p.replaceEscapes(trimmed), p.typeOfPrimitive(it)
+	case itemRawString:
+		return it.val, p.typeOfPrimitive(it)
+	case itemRawMultilineString:
+		return stripFirstNewline(it.val), p.typeOfPrimitive(it)
+	case itemBool:
+		switch it.val {
+		case "true":
+			return true, p.typeOfPrimitive(it)
+		case "false":
+			return false, p.typeOfPrimitive(it)
+		}
+		p.bug("Expected boolean value, but got '%s'.", it.val)
+	case itemInteger:
+		num, err := strconv.ParseInt(it.val, 10, 64)
+		if err != nil {
+			// See comment below for floats describing why we make a
+			// distinction between a bug and a user error.
+			if e, ok := err.(*strconv.NumError); ok &&
+				e.Err == strconv.ErrRange {
+
+				p.panicf("Integer '%s' is out of the range of 64-bit "+
+					"signed integers.", it.val)
+			} else {
+				p.bug("Expected integer value, but got '%s'.", it.val)
+			}
+		}
+		return num, p.typeOfPrimitive(it)
+	case itemFloat:
+		num, err := strconv.ParseFloat(it.val, 64)
+		if err != nil {
+			// Distinguish float values. Normally, it'd be a bug if the lexer
+			// provides an invalid float, but it's possible that the float is
+			// out of range of valid values (which the lexer cannot determine).
+			// So mark the former as a bug but the latter as a legitimate user
+			// error.
+			//
+			// This is also true for integers.
+			if e, ok := err.(*strconv.NumError); ok &&
+				e.Err == strconv.ErrRange {
+
+				p.panicf("Float '%s' is out of the range of 64-bit "+
+					"IEEE-754 floating-point numbers.", it.val)
+			} else {
+				p.bug("Expected float value, but got '%s'.", it.val)
+			}
+		}
+		return num, p.typeOfPrimitive(it)
+	case itemDatetime:
+		t, err := time.Parse("2006-01-02T15:04:05Z", it.val)
+		if err != nil {
+			p.bug("Expected Zulu formatted DateTime, but got '%s'.", it.val)
+		}
+		return t, p.typeOfPrimitive(it)
+	case itemArray:
+		array := make([]interface{}, 0)
+		types := make([]tomlType, 0)
+
+		for it = p.next(); it.typ != itemArrayEnd; it = p.next() {
+			if it.typ == itemCommentStart {
+				p.expect(itemText)
+				continue
+			}
+
+			val, typ := p.value(it)
+			array = append(array, val)
+			types = append(types, typ)
+		}
+		return array, p.typeOfArray(types)
+	}
+	p.bug("Unexpected value type: %s", it.typ)
+	panic("unreachable")
+}
+
+// establishContext sets the current context of the parser,
+// where the context is either a hash or an array of hashes. Which one is
+// set depends on the value of the `array` parameter.
+//
+// Establishing the context also makes sure that the key isn't a duplicate, and
+// will create implicit hashes automatically.
+func (p *parser) establishContext(key Key, array bool) {
+	var ok bool
+
+	// Always start at the top level and drill down for our context.
+	hashContext := p.mapping
+	keyContext := make(Key, 0)
+
+	// We only need implicit hashes for key[0:-1]
+	for _, k := range key[0 : len(key)-1] {
+		_, ok = hashContext[k]
+		keyContext = append(keyContext, k)
+
+		// No key? Make an implicit hash and move on.
+		if !ok {
+			p.addImplicit(keyContext)
+			hashContext[k] = make(map[string]interface{})
+		}
+
+		// If the hash context is actually an array of tables, then set
+		// the hash context to the last element in that array.
+		//
+		// Otherwise, it better be a table, since this MUST be a key group (by
+		// virtue of it not being the last element in a key).
+		switch t := hashContext[k].(type) {
+		case []map[string]interface{}:
+			hashContext = t[len(t)-1]
+		case map[string]interface{}:
+			hashContext = t
+		default:
+			p.panicf("Key '%s' was already created as a hash.", keyContext)
+		}
+	}
+
+	p.context = keyContext
+	if array {
+		// If this is the first element for this array, then allocate a new
+		// list of tables for it.
+		k := key[len(key)-1]
+		if _, ok := hashContext[k]; !ok {
+			hashContext[k] = make([]map[string]interface{}, 0, 5)
+		}
+
+		// Add a new table. But make sure the key hasn't already been used
+		// for something else.
+		if hash, ok := hashContext[k].([]map[string]interface{}); ok {
+			hashContext[k] = append(hash, make(map[string]interface{}))
+		} else {
+			p.panicf("Key '%s' was already created and cannot be used as "+
+				"an array.", keyContext)
+		}
+	} else {
+		p.setValue(key[len(key)-1], make(map[string]interface{}))
+	}
+	p.context = append(p.context, key[len(key)-1])
+}
+
+// setValue sets the given key to the given value in the current context.
+// It will make sure that the key hasn't already been defined, account for
+// implicit key groups.
+func (p *parser) setValue(key string, value interface{}) {
+	var tmpHash interface{}
+	var ok bool
+
+	hash := p.mapping
+	keyContext := make(Key, 0)
+	for _, k := range p.context {
+		keyContext = append(keyContext, k)
+		if tmpHash, ok = hash[k]; !ok {
+			p.bug("Context for key '%s' has not been established.", keyContext)
+		}
+		switch t := tmpHash.(type) {
+		case []map[string]interface{}:
+			// The context is a table of hashes. Pick the most recent table
+			// defined as the current hash.
+			hash = t[len(t)-1]
+		case map[string]interface{}:
+			hash = t
+		default:
+			p.bug("Expected hash to have type 'map[string]interface{}', but "+
+				"it has '%T' instead.", tmpHash)
+		}
+	}
+	keyContext = append(keyContext, key)
+
+	if _, ok := hash[key]; ok {
+		// Typically, if the given key has already been set, then we have
+		// to raise an error since duplicate keys are disallowed. However,
+		// it's possible that a key was previously defined implicitly. In this
+		// case, it is allowed to be redefined concretely. (See the
+		// `tests/valid/implicit-and-explicit-after.toml` test in `toml-test`.)
+		//
+		// But we have to make sure to stop marking it as an implicit. (So that
+		// another redefinition provokes an error.)
+		//
+		// Note that since it has already been defined (as a hash), we don't
+		// want to overwrite it. So our business is done.
+		if p.isImplicit(keyContext) {
+			p.removeImplicit(keyContext)
+			return
+		}
+
+		// Otherwise, we have a concrete key trying to override a previous
+		// key, which is *always* wrong.
+		p.panicf("Key '%s' has already been defined.", keyContext)
+	}
+	hash[key] = value
+}
+
+// setType sets the type of a particular value at a given key.
+// It should be called immediately AFTER setValue.
+//
+// Note that if `key` is empty, then the type given will be applied to the
+// current context (which is either a table or an array of tables).
+func (p *parser) setType(key string, typ tomlType) {
+	keyContext := make(Key, 0, len(p.context)+1)
+	for _, k := range p.context {
+		keyContext = append(keyContext, k)
+	}
+	if len(key) > 0 { // allow type setting for hashes
+		keyContext = append(keyContext, key)
+	}
+	p.types[keyContext.String()] = typ
+}
+
+// addImplicit sets the given Key as having been created implicitly.
+func (p *parser) addImplicit(key Key) {
+	p.implicits[key.String()] = true
+}
+
+// removeImplicit stops tagging the given key as having been implicitly
+// created.
+func (p *parser) removeImplicit(key Key) {
+	p.implicits[key.String()] = false
+}
+
+// isImplicit returns true if the key group pointed to by the key was created
+// implicitly.
+func (p *parser) isImplicit(key Key) bool {
+	return p.implicits[key.String()]
+}
+
+// current returns the full key name of the current context.
+func (p *parser) current() string {
+	if len(p.currentKey) == 0 {
+		return p.context.String()
+	}
+	if len(p.context) == 0 {
+		return p.currentKey
+	}
+	return fmt.Sprintf("%s.%s", p.context, p.currentKey)
+}
+
+func stripFirstNewline(s string) string {
+	if len(s) == 0 || s[0] != '\n' {
+		return s
+	}
+	return s[1:len(s)]
+}
+
+func stripEscapedWhitespace(s string) string {
+	esc := strings.Split(s, "\\\n")
+	if len(esc) > 1 {
+		for i := 1; i < len(esc); i++ {
+			esc[i] = strings.TrimLeftFunc(esc[i], unicode.IsSpace)
+		}
+	}
+	return strings.Join(esc, "")
+}
+
+func (p *parser) replaceEscapes(str string) string {
+	var replaced []rune
+	s := []byte(str)
+	r := 0
+	for r < len(s) {
+		if s[r] != '\\' {
+			c, size := utf8.DecodeRune(s[r:])
+			r += size
+			replaced = append(replaced, c)
+			continue
+		}
+		r += 1
+		if r >= len(s) {
+			p.bug("Escape sequence at end of string.")
+			return ""
+		}
+		switch s[r] {
+		default:
+			p.bug("Expected valid escape code after \\, but got %q.", s[r])
+			return ""
+		case 'b':
+			replaced = append(replaced, rune(0x0008))
+			r += 1
+		case 't':
+			replaced = append(replaced, rune(0x0009))
+			r += 1
+		case 'n':
+			replaced = append(replaced, rune(0x000A))
+			r += 1
+		case 'f':
+			replaced = append(replaced, rune(0x000C))
+			r += 1
+		case 'r':
+			replaced = append(replaced, rune(0x000D))
+			r += 1
+		case '"':
+			replaced = append(replaced, rune(0x0022))
+			r += 1
+		case '\\':
+			replaced = append(replaced, rune(0x005C))
+			r += 1
+		case 'u':
+			// At this point, we know we have a Unicode escape of the form
+			// `uXXXX` at [r, r+5). (Because the lexer guarantees this
+			// for us.)
+			escaped := p.asciiEscapeToUnicode(s[r+1 : r+5])
+			replaced = append(replaced, escaped)
+			r += 5
+		case 'U':
+			// At this point, we know we have a Unicode escape of the form
+			// `uXXXX` at [r, r+9). (Because the lexer guarantees this
+			// for us.)
+			escaped := p.asciiEscapeToUnicode(s[r+1 : r+9])
+			replaced = append(replaced, escaped)
+			r += 9
+		}
+	}
+	return string(replaced)
+}
+
+func (p *parser) asciiEscapeToUnicode(bs []byte) rune {
+	s := string(bs)
+	hex, err := strconv.ParseUint(strings.ToLower(s), 16, 32)
+	if err != nil {
+		p.bug("Could not parse '%s' as a hexadecimal number, but the "+
+			"lexer claims it's OK: %s", s, err)
+	}
+
+	// BUG(burntsushi)
+	// I honestly don't understand how this works. I can't seem
+	// to find a way to make this fail. I figured this would fail on invalid
+	// UTF-8 characters like U+DCFF, but it doesn't.
+	if !utf8.ValidString(string(rune(hex))) {
+		p.panicf("Escaped character '\\u%s' is not valid UTF-8.", s)
+	}
+	return rune(hex)
+}
+
+func isStringType(ty itemType) bool {
+	return ty == itemString || ty == itemMultilineString ||
+		ty == itemRawString || ty == itemRawMultilineString
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/session.vim
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/session.vim b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/session.vim
new file mode 100644
index 0000000..562164b
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/session.vim
@@ -0,0 +1 @@
+au BufWritePost *.go silent!make tags > /dev/null 2>&1

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/type_check.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/type_check.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/type_check.go
new file mode 100644
index 0000000..c73f8af
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/type_check.go
@@ -0,0 +1,91 @@
+package toml
+
+// tomlType represents any Go type that corresponds to a TOML type.
+// While the first draft of the TOML spec has a simplistic type system that
+// probably doesn't need this level of sophistication, we seem to be militating
+// toward adding real composite types.
+type tomlType interface {
+	typeString() string
+}
+
+// typeEqual accepts any two types and returns true if they are equal.
+func typeEqual(t1, t2 tomlType) bool {
+	if t1 == nil || t2 == nil {
+		return false
+	}
+	return t1.typeString() == t2.typeString()
+}
+
+func typeIsHash(t tomlType) bool {
+	return typeEqual(t, tomlHash) || typeEqual(t, tomlArrayHash)
+}
+
+type tomlBaseType string
+
+func (btype tomlBaseType) typeString() string {
+	return string(btype)
+}
+
+func (btype tomlBaseType) String() string {
+	return btype.typeString()
+}
+
+var (
+	tomlInteger   tomlBaseType = "Integer"
+	tomlFloat     tomlBaseType = "Float"
+	tomlDatetime  tomlBaseType = "Datetime"
+	tomlString    tomlBaseType = "String"
+	tomlBool      tomlBaseType = "Bool"
+	tomlArray     tomlBaseType = "Array"
+	tomlHash      tomlBaseType = "Hash"
+	tomlArrayHash tomlBaseType = "ArrayHash"
+)
+
+// typeOfPrimitive returns a tomlType of any primitive value in TOML.
+// Primitive values are: Integer, Float, Datetime, String and Bool.
+//
+// Passing a lexer item other than the following will cause a BUG message
+// to occur: itemString, itemBool, itemInteger, itemFloat, itemDatetime.
+func (p *parser) typeOfPrimitive(lexItem item) tomlType {
+	switch lexItem.typ {
+	case itemInteger:
+		return tomlInteger
+	case itemFloat:
+		return tomlFloat
+	case itemDatetime:
+		return tomlDatetime
+	case itemString:
+		return tomlString
+	case itemMultilineString:
+		return tomlString
+	case itemRawString:
+		return tomlString
+	case itemRawMultilineString:
+		return tomlString
+	case itemBool:
+		return tomlBool
+	}
+	p.bug("Cannot infer primitive type of lex item '%s'.", lexItem)
+	panic("unreachable")
+}
+
+// typeOfArray returns a tomlType for an array given a list of types of its
+// values.
+//
+// In the current spec, if an array is homogeneous, then its type is always
+// "Array". If the array is not homogeneous, an error is generated.
+func (p *parser) typeOfArray(types []tomlType) tomlType {
+	// Empty arrays are cool.
+	if len(types) == 0 {
+		return tomlArray
+	}
+
+	theType := types[0]
+	for _, t := range types[1:] {
+		if !typeEqual(theType, t) {
+			p.panicf("Array contains values of type '%s' and '%s', but "+
+				"arrays must be homogeneous.", theType, t)
+		}
+	}
+	return tomlArray
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/type_fields.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/type_fields.go b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/type_fields.go
new file mode 100644
index 0000000..7592f87
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/BurntSushi/toml/type_fields.go
@@ -0,0 +1,241 @@
+package toml
+
+// Struct field handling is adapted from code in encoding/json:
+//
+// Copyright 2010 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the Go distribution.
+
+import (
+	"reflect"
+	"sort"
+	"sync"
+)
+
+// A field represents a single field found in a struct.
+type field struct {
+	name  string       // the name of the field (`toml` tag included)
+	tag   bool         // whether field has a `toml` tag
+	index []int        // represents the depth of an anonymous field
+	typ   reflect.Type // the type of the field
+}
+
+// byName sorts field by name, breaking ties with depth,
+// then breaking ties with "name came from toml tag", then
+// breaking ties with index sequence.
+type byName []field
+
+func (x byName) Len() int { return len(x) }
+
+func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
+
+func (x byName) Less(i, j int) bool {
+	if x[i].name != x[j].name {
+		return x[i].name < x[j].name
+	}
+	if len(x[i].index) != len(x[j].index) {
+		return len(x[i].index) < len(x[j].index)
+	}
+	if x[i].tag != x[j].tag {
+		return x[i].tag
+	}
+	return byIndex(x).Less(i, j)
+}
+
+// byIndex sorts field by index sequence.
+type byIndex []field
+
+func (x byIndex) Len() int { return len(x) }
+
+func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
+
+func (x byIndex) Less(i, j int) bool {
+	for k, xik := range x[i].index {
+		if k >= len(x[j].index) {
+			return false
+		}
+		if xik != x[j].index[k] {
+			return xik < x[j].index[k]
+		}
+	}
+	return len(x[i].index) < len(x[j].index)
+}
+
+// typeFields returns a list of fields that TOML should recognize for the given
+// type. The algorithm is breadth-first search over the set of structs to
+// include - the top struct and then any reachable anonymous structs.
+func typeFields(t reflect.Type) []field {
+	// Anonymous fields to explore at the current level and the next.
+	current := []field{}
+	next := []field{{typ: t}}
+
+	// Count of queued names for current level and the next.
+	count := map[reflect.Type]int{}
+	nextCount := map[reflect.Type]int{}
+
+	// Types already visited at an earlier level.
+	visited := map[reflect.Type]bool{}
+
+	// Fields found.
+	var fields []field
+
+	for len(next) > 0 {
+		current, next = next, current[:0]
+		count, nextCount = nextCount, map[reflect.Type]int{}
+
+		for _, f := range current {
+			if visited[f.typ] {
+				continue
+			}
+			visited[f.typ] = true
+
+			// Scan f.typ for fields to include.
+			for i := 0; i < f.typ.NumField(); i++ {
+				sf := f.typ.Field(i)
+				if sf.PkgPath != "" { // unexported
+					continue
+				}
+				name := sf.Tag.Get("toml")
+				if name == "-" {
+					continue
+				}
+				index := make([]int, len(f.index)+1)
+				copy(index, f.index)
+				index[len(f.index)] = i
+
+				ft := sf.Type
+				if ft.Name() == "" && ft.Kind() == reflect.Ptr {
+					// Follow pointer.
+					ft = ft.Elem()
+				}
+
+				// Record found field and index sequence.
+				if name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct {
+					tagged := name != ""
+					if name == "" {
+						name = sf.Name
+					}
+					fields = append(fields, field{name, tagged, index, ft})
+					if count[f.typ] > 1 {
+						// If there were multiple instances, add a second,
+						// so that the annihilation code will see a duplicate.
+						// It only cares about the distinction between 1 or 2,
+						// so don't bother generating any more copies.
+						fields = append(fields, fields[len(fields)-1])
+					}
+					continue
+				}
+
+				// Record new anonymous struct to explore in next round.
+				nextCount[ft]++
+				if nextCount[ft] == 1 {
+					f := field{name: ft.Name(), index: index, typ: ft}
+					next = append(next, f)
+				}
+			}
+		}
+	}
+
+	sort.Sort(byName(fields))
+
+	// Delete all fields that are hidden by the Go rules for embedded fields,
+	// except that fields with TOML tags are promoted.
+
+	// The fields are sorted in primary order of name, secondary order
+	// of field index length. Loop over names; for each name, delete
+	// hidden fields by choosing the one dominant field that survives.
+	out := fields[:0]
+	for advance, i := 0, 0; i < len(fields); i += advance {
+		// One iteration per name.
+		// Find the sequence of fields with the name of this first field.
+		fi := fields[i]
+		name := fi.name
+		for advance = 1; i+advance < len(fields); advance++ {
+			fj := fields[i+advance]
+			if fj.name != name {
+				break
+			}
+		}
+		if advance == 1 { // Only one field with this name
+			out = append(out, fi)
+			continue
+		}
+		dominant, ok := dominantField(fields[i : i+advance])
+		if ok {
+			out = append(out, dominant)
+		}
+	}
+
+	fields = out
+	sort.Sort(byIndex(fields))
+
+	return fields
+}
+
+// dominantField looks through the fields, all of which are known to
+// have the same name, to find the single field that dominates the
+// others using Go's embedding rules, modified by the presence of
+// TOML tags. If there are multiple top-level fields, the boolean
+// will be false: This condition is an error in Go and we skip all
+// the fields.
+func dominantField(fields []field) (field, bool) {
+	// The fields are sorted in increasing index-length order. The winner
+	// must therefore be one with the shortest index length. Drop all
+	// longer entries, which is easy: just truncate the slice.
+	length := len(fields[0].index)
+	tagged := -1 // Index of first tagged field.
+	for i, f := range fields {
+		if len(f.index) > length {
+			fields = fields[:i]
+			break
+		}
+		if f.tag {
+			if tagged >= 0 {
+				// Multiple tagged fields at the same level: conflict.
+				// Return no field.
+				return field{}, false
+			}
+			tagged = i
+		}
+	}
+	if tagged >= 0 {
+		return fields[tagged], true
+	}
+	// All remaining fields have the same length. If there's more than one,
+	// we have a conflict (two fields named "X" at the same level) and we
+	// return no field.
+	if len(fields) > 1 {
+		return field{}, false
+	}
+	return fields[0], true
+}
+
+var fieldCache struct {
+	sync.RWMutex
+	m map[reflect.Type][]field
+}
+
+// cachedTypeFields is like typeFields but uses a cache to avoid repeated work.
+func cachedTypeFields(t reflect.Type) []field {
+	fieldCache.RLock()
+	f := fieldCache.m[t]
+	fieldCache.RUnlock()
+	if f != nil {
+		return f
+	}
+
+	// Compute fields without lock.
+	// Might duplicate effort but won't hold other computations back.
+	f = typeFields(t)
+	if f == nil {
+		f = []field{}
+	}
+
+	fieldCache.Lock()
+	if fieldCache.m == nil {
+		fieldCache.m = map[reflect.Type][]field{}
+	}
+	fieldCache.m[t] = f
+	fieldCache.Unlock()
+	return f
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/.gitignore b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/.gitignore
new file mode 100644
index 0000000..a4a1e00
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/.gitignore
@@ -0,0 +1,4 @@
+*.6
+*.o
+src/_cgo_*
+src/_obj/

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/.travis.yml
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/.travis.yml b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/.travis.yml
new file mode 100644
index 0000000..e35e709
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/.travis.yml
@@ -0,0 +1,15 @@
+language: go
+go:
+  - 1.1.2
+  - 1.2
+  - tip
+before_install:
+  - sudo apt-get update -qq > apt-get.out 2>&1  || (cat apt-get.out && exit 1)
+install: go build -x -v
+script: go test -v
+notifications:
+  email:
+    recipients:
+      - fledna@foxmail.com
+    on_success: change
+    on_failure: always

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/LICENSE b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/LICENSE
new file mode 100644
index 0000000..07a5cea
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2014 Shuyu Wang <an...@gmail.com>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this project except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/README.md b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/README.md
new file mode 100644
index 0000000..f1870f7
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/README.md
@@ -0,0 +1,73 @@
+go-curl
+=======
+
+[![Build Status](https://secure.travis-ci.org/andelf/go-curl.png?branch=master)](http://travis-ci.org/andelf/go-curl)
+
+my golang libcurl(curl) binding.
+
+See more examples in ./examples/ directory~!
+
+LICENSE
+-------
+
+go-curl is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).
+
+Current Development Statue
+--------------------------
+
+ * currently stable
+ * READ, WRITE, HEADER, PROGRESS function callback
+ * a Multipart Form supports file uploading
+ * Most curl_easy_setopt option
+ * partly implement share & multi interface
+ * new callback function prototype
+
+How to Install
+--------------
+
+Make Sure You Have libcurl (and its develop headers, static/dynamic libs) installed!
+
+
+    $ go get -u github.com/andelf/go-curl
+
+Current Status
+--------------
+
+ * Linux x64
+   * passed go1 (ArchLinux)
+ * Windows x86
+   * passed go1 (win7, mingw-gcc 4.5.2, curl 7.22.0)
+ * Mac OS
+   * passed go1 (Mac OS X 10.7.3, curl 7.21.4)
+
+Sample Program
+--------------
+
+```go
+package main
+
+import (
+    "fmt"
+    curl "github.com/andelf/go-curl"
+)
+
+func main() {
+    easy := curl.EasyInit()
+    defer easy.Cleanup()
+
+    easy.Setopt(curl.OPT_URL, "http://www.baidu.com/")
+
+    // make a callback function
+    fooTest := func (buf []byte, userdata interface{}) bool {
+        println("DEBUG: size=>", len(buf))
+        println("DEBUG: content=>", string(buf))
+        return true
+    }
+
+    easy.Setopt(curl.OPT_WRITEFUNCTION, fooTest)
+
+    if err := easy.Perform(); err != nil {
+        fmt.Printf("ERROR: %v\n", err)
+    }
+}
+```

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/c-callback.c
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/c-callback.c b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/c-callback.c
new file mode 100644
index 0000000..74c5503
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/c-callback.c
@@ -0,0 +1,68 @@
+#include <stdio.h>
+#include <string.h>
+#include "callback.h"
+#include "_cgo_export.h"
+
+/* for OPT_HEADERFUNCTION */
+size_t header_function( char *ptr, size_t size, size_t nmemb, void *ctx) {
+    void *go_header_func = (void *)goGetCurlField((GoUintptr)ctx, "headerFunction");
+    GoInterface *userdata = (GoInterface *)goGetCurlField((GoUintptr)ctx, "headerData");
+
+    if (userdata == NULL) {
+	return goCallWriteFunctionCallback(go_header_func, ptr, size*nmemb, goNilInterface());
+    }
+    return goCallWriteFunctionCallback(go_header_func, ptr, size*nmemb, *userdata);
+}
+
+void *return_header_function() {
+    return (void *)&header_function;
+}
+
+
+/* for OPT_WRITEFUNCTION */
+size_t write_function( char *ptr, size_t size, size_t nmemb, void *ctx) {
+    void *go_write_func = (void *)goGetCurlField((GoUintptr)ctx, "writeFunction");
+    GoInterface *userdata = (GoInterface *)goGetCurlField((GoUintptr)ctx, "writeData");
+
+    if (userdata == NULL) {
+	return goCallWriteFunctionCallback(go_write_func, ptr, size*nmemb, goNilInterface());
+    }
+    return goCallWriteFunctionCallback(go_write_func, ptr, size*nmemb, *userdata);
+}
+
+void *return_write_function() {
+    return (void *)&write_function;
+}
+
+/* for OPT_READFUNCTION */
+size_t read_function( char *ptr, size_t size, size_t nmemb, void *ctx) {
+    void *go_read_func = (void *)goGetCurlField((GoUintptr)ctx, "readFunction");
+    GoInterface *userdata = (GoInterface *)goGetCurlField((GoUintptr)ctx, "readData");
+
+    if (userdata == NULL) {
+	return goCallReadFunctionCallback(go_read_func, ptr, size*nmemb, goNilInterface());
+    }
+    return goCallReadFunctionCallback(go_read_func, ptr, size*nmemb, *userdata);
+}
+
+void *return_read_function() {
+    return (void *)&read_function;
+}
+
+
+/* for OPT_PROGRESSFUNCTION */
+int progress_function(void *ctx, double dltotal, double dlnow, double ultotal, double ulnow) {
+    void *go_progress_func = (void *)goGetCurlField((GoUintptr)ctx, "progressFunction");
+    GoInterface *clientp = (GoInterface *)goGetCurlField((GoUintptr)ctx, "progressData");
+
+    if (clientp == NULL) {
+	return goCallProgressCallback(go_progress_func, goNilInterface(),
+				    dltotal, dlnow, ultotal, ulnow);
+    }
+    return goCallProgressCallback(go_progress_func, *clientp,
+				dltotal, dlnow, ultotal, ulnow);
+}
+
+void *return_progress_function() {
+    return (void *)progress_function;
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/callback.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/callback.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/callback.go
new file mode 100644
index 0000000..fbb2a7f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/callback.go
@@ -0,0 +1,90 @@
+package curl
+
+/*
+#include <stdlib.h>
+#include <string.h>
+#include <curl/curl.h>
+
+*/
+import "C"
+
+import (
+	"reflect"
+	"unsafe"
+)
+
+//export goGetCurlField
+func goGetCurlField(p uintptr, cname *C.char) uintptr {
+	name := C.GoString(cname)
+	curl := (*CURL)(unsafe.Pointer(p))
+	switch name {
+	case "readFunction":
+		return reflect.ValueOf(curl.readFunction).Pointer()
+	case "headerFunction":
+		return reflect.ValueOf(curl.headerFunction).Pointer()
+	case "writeFunction":
+		return reflect.ValueOf(curl.writeFunction).Pointer()
+	case "progressFunction":
+		return reflect.ValueOf(curl.progressFunction).Pointer()
+	case "headerData":
+		return uintptr(unsafe.Pointer(curl.headerData))
+	case "writeData":
+		return uintptr(unsafe.Pointer(curl.writeData))
+	case "readData":
+		return uintptr(unsafe.Pointer(curl.readData))
+	case "progressData":
+		return uintptr(unsafe.Pointer(curl.progressData))
+	}
+
+	warnf("Field not found: %s", name)
+	return 0
+}
+
+//export goNilInterface
+func goNilInterface() interface{} {
+	return nil
+}
+
+// callback functions
+//export goCallWriteFunctionCallback
+func goCallWriteFunctionCallback(f *func([]byte, interface{}) bool,
+	ptr *C.char,
+	size C.size_t,
+	userdata interface{}) uintptr {
+	buf := C.GoBytes(unsafe.Pointer(ptr), C.int(size))
+	ok := (*f)(buf, userdata)
+	if ok {
+		return uintptr(size)
+	}
+	//return uintptr(C.CURL_MAX_WRITE_SIZE + 1)
+	return C.CURL_WRITEFUNC_PAUSE
+}
+
+//export goCallProgressCallback
+func goCallProgressCallback(f *func(float64, float64, float64, float64, interface{}) bool,
+	userdata interface{},
+	dltotal, dlnow, ultotal, ulnow C.double) int {
+	// fdltotal, fdlnow, fultotal, fulnow
+	ok := (*f)(float64(dltotal), float64(dlnow), float64(ultotal), float64(ulnow), userdata)
+	// non-zero va lue will cause libcurl to abort the transfer and return Error
+	if ok {
+		return 0
+	}
+	return 1
+}
+
+//export goCallReadFunctionCallback
+func goCallReadFunctionCallback(f *func([]byte, interface{}) int,
+	ptr *C.char,
+	size C.size_t,
+	userdata interface{}) uintptr {
+	// TODO code cleanup
+	buf := C.GoBytes(unsafe.Pointer(ptr), C.int(size))
+	ret := (*f)(buf, userdata)
+	str := C.CString(string(buf))
+	defer C.free(unsafe.Pointer(str))
+	if C.memcpy(unsafe.Pointer(ptr), unsafe.Pointer(str), C.size_t(ret)) == nil {
+		panic("read_callback memcpy error!")
+	}
+	return uintptr(ret)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/callback.h
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/callback.h b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/callback.h
new file mode 100644
index 0000000..498678a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/callback.h
@@ -0,0 +1,6 @@
+
+void *return_header_function();
+void *return_write_function();
+void *return_read_function();
+
+void *return_progress_function();


[18/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/simple.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/simple.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/simple.go
new file mode 100644
index 0000000..8261ec6
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/simple.go
@@ -0,0 +1,14 @@
+package main
+
+import (
+	curl "github.com/andelf/go-curl"
+)
+
+func main() {
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+	if easy != nil {
+		easy.Setopt(curl.OPT_URL, "http://www.google.com/")
+		easy.Perform()
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/logging.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/logging.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/logging.go
new file mode 100644
index 0000000..8976233
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/logging.go
@@ -0,0 +1,56 @@
+package curl
+
+import (
+    "log"
+)
+
+const (
+    _DEBUG = 10 * (iota + 1)
+    _INFO
+    _WARN
+    _ERROR
+)
+
+const _DEFAULT_LOG_LEVEL = _WARN
+
+var log_level = _DEFAULT_LOG_LEVEL
+
+// SetLogLevel changes the log level which determines the granularity of the
+// messages that are logged.  Available log levels are: "DEBUG", "INFO",
+// "WARN", "ERROR" and "DEFAULT_LOG_LEVEL".
+func SetLogLevel(levelName string) {
+    switch levelName {
+    case "DEBUG":
+        log_level = _DEBUG
+    case "INFO":
+        log_level = _INFO
+    case "WARN":
+        log_level = _WARN
+    case "ERROR":
+        log_level = _ERROR
+    case "DEFAULT_LOG_LEVEL":
+        log_level = _DEFAULT_LOG_LEVEL
+    }
+}
+
+func logf(limitLevel int, format string, args ...interface{}) {
+    if log_level <= limitLevel {
+        log.Printf(format, args...)
+    }
+}
+
+func debugf(format string, args ...interface{}) {
+    logf(_DEBUG, format, args...)
+}
+
+func infof(format string, args ...interface{}) {
+    logf(_INFO, format, args...)
+}
+
+func warnf(format string, args ...interface{}) {
+    logf(_WARN, format, args...)
+}
+
+func errorf(format string, args ...interface{}) {
+    logf(_ERROR, format, args...)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/logging_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/logging_test.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/logging_test.go
new file mode 100644
index 0000000..387705a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/logging_test.go
@@ -0,0 +1,64 @@
+
+package curl
+
+import (
+	"testing"
+	"bytes"
+	"log"
+	"os"
+	"fmt"
+	"regexp"
+)
+
+func TestDefaultLogLevel(t *testing.T) {
+    if log_level != _DEFAULT_LOG_LEVEL {t.Error("Test failed, expected DEFAULT_LOG_LEVEL level.")}
+}
+
+func TestSetLogLevel(t *testing.T) {
+    SetLogLevel("DEBUG")
+    defer SetLogLevel("DEFAULT_LOG_LEVEL")
+    if log_level != _DEBUG {t.Error("Test failed, expected DEBUG level.")}
+    SetLogLevel("INFO")
+    if log_level != _INFO {t.Error("Test failed, expected INFO level.")}
+    SetLogLevel("WARN")
+    if log_level != _WARN {t.Error("Test failed, expected WARN level.")}
+    SetLogLevel("ERROR")
+    if log_level != _ERROR {t.Error("Test failed, expected ERROR level.")}
+}
+
+var (
+    testFormat = "test format %s"
+    testArgument = "test string 1"
+    expectedRegexp = regexp.MustCompile(".*" + fmt.Sprintf(testFormat, testArgument) + "\n$")
+)
+
+
+func TestLogf(t *testing.T) {
+    buf := new(bytes.Buffer)
+    log.SetOutput(buf)
+    defer log.SetOutput(os.Stderr)
+    SetLogLevel("DEBUG")
+    defer SetLogLevel("DEFAULT_LOG_LEVEL")
+
+    logf(_DEBUG, testFormat, testArgument)
+    line := buf.String()
+    matched := expectedRegexp.MatchString(line)
+    if !matched {
+        t.Errorf("log output should match %q and is %q.", expectedRegexp, line)
+    }
+}
+
+func TestLogfUsesLogLevel(t *testing.T) {
+    buf := new(bytes.Buffer)
+    log.SetOutput(buf)
+    defer log.SetOutput(os.Stderr)
+    SetLogLevel("WARN")
+    defer SetLogLevel("DEFAULT_LOG_LEVEL")
+
+    logf(_DEBUG, testFormat, testArgument)
+    line := buf.String()
+    expectedLine := ""
+    if line != expectedLine {
+        t.Errorf("log output should match %q and is %q.", expectedLine, line)
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/misc/codegen.py
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/misc/codegen.py b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/misc/codegen.py
new file mode 100644
index 0000000..08047e5
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/misc/codegen.py
@@ -0,0 +1,88 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
+import re
+
+
+
+opts = []
+codes = []
+infos = []
+pattern = re.compile(r'CINIT\((.*?),\s+(LONG|OBJECTPOINT|FUNCTIONPOINT|OFF_T),\s+(\d+)\)')
+pattern2 = re.compile('^\s+(CURLE_[A-Z_0-9]+),')
+pattern3 = re.compile('^\s+(CURLINFO_[A-Z_0-9]+)\s+=')
+for line in open("./curl/include/curl/curl.h"):
+    match = pattern.findall(line)
+    if match:
+        opts.append(match[0][0])
+    if line.startswith('#define CURLOPT_'):
+        o = line.split()
+        opts.append(o[1][8:])   # strip :(
+
+    match = pattern2.findall(line)
+    if match:
+        codes.append(match[0])
+
+    if line.startswith('#define CURLE_'):
+        c = line.split()
+        codes.append(c[1])
+
+    match = pattern3.findall(line)
+    if match:
+        infos.append(match[0])
+
+    if line.startswith('#define CURLINFO_'):
+        i = line.split()
+        if '0x' not in i[2]:    # :(
+            infos.append(i[1])
+
+
+template = """
+// generated by codegen.py
+
+package curl
+/*
+#include <curl/curl.h>
+#include "compat.h"
+*/
+import "C"
+
+// CURLcode
+const (
+{code_part}
+)
+
+// easy.Setopt(flag, ...)
+const (
+{opt_part}
+)
+
+// easy.Getinfo(flag)
+const (
+{info_part}
+)
+
+// generated ends
+"""
+
+code_part = []
+for c in codes:
+    code_part.append("\t{:<25} = C.{}".format(c[4:], c))
+
+code_part = '\n'.join(code_part)
+
+opt_part = []
+for o in opts:
+    opt_part.append("\tOPT_{0:<25} = C.CURLOPT_{0}".format(o))
+
+opt_part = '\n'.join(opt_part)
+
+info_part = []
+for i in infos:
+    info_part.append("\t{:<25} = C.{}".format(i[4:], i))
+
+info_part = '\n'.join(info_part)
+
+
+with open('./const_gen.go', 'w') as fp:
+    fp.write(template.format(**locals()))

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/misc/compatgen.py
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/misc/compatgen.py b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/misc/compatgen.py
new file mode 100644
index 0000000..e7f2860
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/misc/compatgen.py
@@ -0,0 +1,162 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+import re
+import os
+
+def version_symbol(ver):
+    os.system("cd ./curl && git checkout {}".format(ver))
+    opts = []
+    codes = []
+    infos = []
+    vers = []
+    pattern = re.compile(r'CINIT\((.*?), (LONG|OBJECTPOINT|FUNCTIONPOINT|OFF_T), (\d+)\)')
+    pattern2 = re.compile('^\s+(CURLE_[A-Z_0-9]+),')
+    pattern3 = re.compile('^\s+(CURLINFO_[A-Z_0-9]+)\s+=')
+    for line in open("./curl/include/curl/curl.h"):
+        match = pattern.findall(line)
+        if match:
+            opts.append("CURLOPT_" + match[0][0])
+        if line.startswith('#define CURLOPT_'):
+            o = line.split()
+            opts.append(o[1])
+
+        match = pattern2.findall(line)
+        if match:
+            codes.append(match[0])
+
+        if line.startswith('#define CURLE_'):
+            c = line.split()
+            codes.append(c[1])
+
+        match = pattern3.findall(line)
+        if match:
+            infos.append(match[0])
+
+        if line.startswith('#define CURLINFO_'):
+            i = line.split()
+            if '0x' not in i[2]:    # :(
+                infos.append(i[1])
+
+        if line.startswith('#define CURL_VERSION_'):
+            i = line.split()
+            vers.append(i[1])
+
+    return opts, codes, infos, vers
+
+
+versions = """
+curl-7_10_1
+curl-7_10_2
+curl-7_10_3
+curl-7_10_4
+curl-7_10_5
+curl-7_10_6
+curl-7_10_7
+curl-7_10_8
+curl-7_11_0
+curl-7_11_1
+curl-7_11_2
+curl-7_12_0
+curl-7_12_1
+curl-7_12_2
+curl-7_12_3
+curl-7_13_0
+curl-7_13_1
+curl-7_13_2
+curl-7_14_0
+curl-7_14_1
+curl-7_15_0
+curl-7_15_1
+curl-7_15_2
+curl-7_15_3
+curl-7_15_4
+curl-7_15_5
+curl-7_16_0
+curl-7_16_1
+curl-7_16_2
+curl-7_16_3
+curl-7_16_4
+curl-7_17_0
+curl-7_17_1
+curl-7_18_0
+curl-7_18_1
+curl-7_18_2
+curl-7_19_0
+curl-7_19_1
+curl-7_19_2
+curl-7_19_3
+curl-7_19_4
+curl-7_19_5
+curl-7_19_6
+curl-7_19_7
+curl-7_20_0
+curl-7_20_1
+curl-7_21_0
+curl-7_21_1
+curl-7_21_2
+curl-7_21_3
+curl-7_21_4
+curl-7_21_5
+curl-7_21_6
+curl-7_21_7
+curl-7_22_0
+curl-7_23_0
+curl-7_23_1
+curl-7_24_0
+curl-7_25_0
+curl-7_26_0
+curl-7_27_0
+curl-7_28_0
+curl-7_28_1
+curl-7_29_0
+curl-7_30_0
+curl-7_31_0
+curl-7_32_0
+curl-7_33_0
+curl-7_34_0
+curl-7_35_0
+curl-7_36_0""".split()[::-1]
+
+last = version_symbol("master")
+
+template = """
+/* generated by compatgen.py */
+#include<curl/curl.h>
+
+
+"""
+
+result = [template]
+result_tail = ["/* generated ends */\n"]
+if __name__ == '__main__':
+    for ver in versions:
+        minor, patch = map(int, ver.split("_")[-2:])
+
+        opts, codes, infos, vers = curr = version_symbol(ver)
+
+        for o in last[0]:
+            if o not in opts:
+                result.append("#define {} 0".format(o)) # 0 for nil option
+        for c in last[1]:
+            if c not in codes:
+                result.append("#define {} -1".format(c)) # -1 for error
+        for i in last[2]:
+            if i not in infos:
+                result.append("#define {} 0".format(i)) # 0 for nil
+        for v in last[3]:
+            if v not in vers:
+                result.append("#define {} 0".format(v)) # 0 for nil
+
+        result.append("#if (LIBCURL_VERSION_MINOR == {} && LIBCURL_VERSION_PATCH < {}) || LIBCURL_VERSION_MINOR < {} ".format(minor, patch, minor))
+
+        result_tail.insert(0, "#endif /* 7.{}.{} */".format(minor, patch))
+
+        last = curr
+
+result.append("#error your version is TOOOOOOOO low")
+
+result.extend(result_tail)
+
+with open("./compat.h", 'w') as fp:
+    fp.write('\n'.join(result))

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/multi.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/multi.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/multi.go
new file mode 100644
index 0000000..814fd6e
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/multi.go
@@ -0,0 +1,154 @@
+package curl
+
+/*
+#include <stdlib.h>
+#include <curl/curl.h>
+
+static CURLMcode curl_multi_setopt_long(CURLM *handle, CURLMoption option, long parameter) {
+  return curl_multi_setopt(handle, option, parameter);
+}
+static CURLMcode curl_multi_setopt_pointer(CURLM *handle, CURLMoption option, void *parameter) {
+  return curl_multi_setopt(handle, option, parameter);
+}
+static CURLMcode curl_multi_fdset_pointer(CURLM *handle,
+                            void *read_fd_set,
+                            void *write_fd_set,
+                            void *exc_fd_set,
+                            int *max_fd)
+{
+  return curl_multi_fdset(handle, read_fd_set, write_fd_set, exc_fd_set, max_fd);
+}                            
+static CURLMsg *curl_multi_info_read_pointer(CURLM *handle, int *msgs_in_queue)
+{
+  return curl_multi_info_read(handle, msgs_in_queue);
+}                            
+*/
+import "C"
+
+import (
+		"unsafe"
+		"syscall"
+)
+
+type CurlMultiError C.CURLMcode
+type CurlMultiMsg	C.CURLMSG
+
+func (e CurlMultiError) Error() string {
+	// ret is const char*, no need to free
+	ret := C.curl_multi_strerror(C.CURLMcode(e))
+	return C.GoString(ret)
+}
+
+func newCurlMultiError(errno C.CURLMcode) error {
+	// cannot use C.CURLM_OK here, cause multi.h use a undefined emum num
+	if errno == 0 { // if nothing wrong
+		return nil
+	}
+	return CurlMultiError(errno)
+}
+
+func newCURLMessage(message *C.CURLMsg) (msg *CURLMessage){
+	if message == nil {
+		return nil
+	}
+	msg = new(CURLMessage)
+	msg.Msg = CurlMultiMsg(message.msg)
+	msg.Easy_handle = &CURL{handle: message.easy_handle}
+	msg.Data = message.data
+	return msg 
+}
+
+type CURLM struct {
+	handle unsafe.Pointer
+}
+
+type CURLMessage struct {
+	Msg CurlMultiMsg
+	Easy_handle *CURL
+	Data [8]byte
+}
+
+// curl_multi_init - create a multi handle
+func MultiInit() *CURLM {
+	p := C.curl_multi_init()
+	return &CURLM{p}
+}
+
+// curl_multi_cleanup - close down a multi session
+func (mcurl *CURLM) Cleanup() error {
+	p := mcurl.handle
+	return newCurlMultiError(C.curl_multi_cleanup(p))
+}
+
+// curl_multi_perform - reads/writes available data from each easy handle
+func (mcurl *CURLM) Perform() (int, error) {
+	p := mcurl.handle
+	running_handles := C.int(-1)
+	err := newCurlMultiError(C.curl_multi_perform(p, &running_handles))
+	return int(running_handles), err
+}
+
+// curl_multi_add_handle - add an easy handle to a multi session
+func (mcurl *CURLM) AddHandle(easy *CURL) error {
+	mp := mcurl.handle
+	easy_handle := easy.handle
+	return newCurlMultiError(C.curl_multi_add_handle(mp, easy_handle))
+}
+
+// curl_multi_remove_handle - remove an easy handle from a multi session
+func (mcurl *CURLM) RemoveHandle(easy *CURL) error {
+	mp := mcurl.handle
+	easy_handle := easy.handle
+	return newCurlMultiError(C.curl_multi_remove_handle(mp, easy_handle))
+}
+
+func (mcurl *CURLM) Timeout() (int, error) {
+	p := mcurl.handle
+	timeout := C.long(-1)
+	err := newCurlMultiError(C.curl_multi_timeout(p, &timeout))
+	return int(timeout), err
+}
+
+func (mcurl *CURLM) Setopt(opt int, param interface{}) error {
+	p := mcurl.handle
+	if param == nil {
+		return newCurlMultiError(C.curl_multi_setopt_pointer(p, C.CURLMoption(opt), nil))
+	}
+	switch {
+	//  currently cannot support these option
+	//	case MOPT_SOCKETFUNCTION, MOPT_SOCKETDATA, MOPT_TIMERFUNCTION, MOPT_TIMERDATA:
+	//		panic("not supported CURLM.Setopt opt")
+	case opt >= C.CURLOPTTYPE_LONG:
+		val := C.long(0)
+		switch t := param.(type) {
+		case int:
+			val := C.long(t)
+			return newCurlMultiError(C.curl_multi_setopt_long(p, C.CURLMoption(opt), val))
+		case bool:
+			val = C.long(0)
+			if t {
+				val = C.long(1)
+			}
+			return newCurlMultiError(C.curl_multi_setopt_long(p, C.CURLMoption(opt), val))
+		}
+	}
+	panic("not supported CURLM.Setopt opt or param")
+	return nil
+}
+
+func (mcurl *CURLM) Fdset(rset, wset, eset *syscall.FdSet) (int, error) {
+	p := mcurl.handle
+	read := unsafe.Pointer(rset)
+	write := unsafe.Pointer(wset)
+	exc := unsafe.Pointer(eset)
+	maxfd := C.int(-1)
+	err := newCurlMultiError(C.curl_multi_fdset_pointer(p, read, write,
+							 exc, &maxfd))
+	return int(maxfd), err
+}
+
+func (mcurl *CURLM) Info_read() (*CURLMessage, int) {
+	p := mcurl.handle
+	left := C.int(0)
+  	return newCURLMessage(C.curl_multi_info_read_pointer(p, &left)), int(left)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/share.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/share.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/share.go
new file mode 100644
index 0000000..8d1e16d
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/share.go
@@ -0,0 +1,62 @@
+package curl
+
+/*
+#include <curl/curl.h>
+
+static CURLSHcode curl_share_setopt_long(CURLSH *handle, CURLSHoption option, long parameter) {
+  return curl_share_setopt(handle, option, parameter);
+}
+static CURLSHcode curl_share_setopt_pointer(CURLSH *handle, CURLSHoption option, void *parameter) {
+  return curl_share_setopt(handle, option, parameter);
+}
+*/
+import "C"
+
+import "unsafe"
+
+// implement os.Error interface
+type CurlShareError C.CURLMcode
+
+func (e CurlShareError) Error() string {
+	// ret is const char*, no need to free
+	ret := C.curl_share_strerror(C.CURLSHcode(e))
+	return C.GoString(ret)
+}
+
+func newCurlShareError(errno C.CURLSHcode) error {
+	if errno == 0 { // if nothing wrong
+		return nil
+	}
+	return CurlShareError(errno)
+}
+
+type CURLSH struct {
+	handle unsafe.Pointer
+}
+
+func ShareInit() *CURLSH {
+	p := C.curl_share_init()
+	return &CURLSH{p}
+}
+
+func (shcurl *CURLSH) Cleanup() error {
+	p := shcurl.handle
+	return newCurlShareError(C.curl_share_cleanup(p))
+}
+
+func (shcurl *CURLSH) Setopt(opt int, param interface{}) error {
+	p := shcurl.handle
+	if param == nil {
+		return newCurlShareError(C.curl_share_setopt_pointer(p, C.CURLSHoption(opt), nil))
+	}
+	switch opt {
+	//	case SHOPT_LOCKFUNC, SHOPT_UNLOCKFUNC, SHOPT_USERDATA:
+	//		panic("not supported")
+	case SHOPT_SHARE, SHOPT_UNSHARE:
+		if val, ok := param.(int); ok {
+			return newCurlShareError(C.curl_share_setopt_long(p, C.CURLSHoption(opt), C.long(val)))
+		}
+	}
+	panic("not supported CURLSH.Setopt opt or param")
+	return nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore
new file mode 100644
index 0000000..0026861
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore
@@ -0,0 +1,22 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE
new file mode 100644
index 0000000..c33dcc7
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE
@@ -0,0 +1,354 @@
+Mozilla Public License, version 2.0
+
+1. Definitions
+
+1.1. “Contributor”
+
+     means each individual or legal entity that creates, contributes to the
+     creation of, or owns Covered Software.
+
+1.2. “Contributor Version”
+
+     means the combination of the Contributions of others (if any) used by a
+     Contributor and that particular Contributor’s Contribution.
+
+1.3. “Contribution”
+
+     means Covered Software of a particular Contributor.
+
+1.4. “Covered Software”
+
+     means Source Code Form to which the initial Contributor has attached the
+     notice in Exhibit A, the Executable Form of such Source Code Form, and
+     Modifications of such Source Code Form, in each case including portions
+     thereof.
+
+1.5. “Incompatible With Secondary Licenses”
+     means
+
+     a. that the initial Contributor has attached the notice described in
+        Exhibit B to the Covered Software; or
+
+     b. that the Covered Software was made available under the terms of version
+        1.1 or earlier of the License, but not also under the terms of a
+        Secondary License.
+
+1.6. “Executable Form”
+
+     means any form of the work other than Source Code Form.
+
+1.7. “Larger Work”
+
+     means a work that combines Covered Software with other material, in a separate
+     file or files, that is not Covered Software.
+
+1.8. “License”
+
+     means this document.
+
+1.9. “Licensable”
+
+     means having the right to grant, to the maximum extent possible, whether at the
+     time of the initial grant or subsequently, any and all of the rights conveyed by
+     this License.
+
+1.10. “Modifications”
+
+     means any of the following:
+
+     a. any file in Source Code Form that results from an addition to, deletion
+        from, or modification of the contents of Covered Software; or
+
+     b. any new file in Source Code Form that contains any Covered Software.
+
+1.11. “Patent Claims” of a Contributor
+
+      means any patent claim(s), including without limitation, method, process,
+      and apparatus claims, in any patent Licensable by such Contributor that
+      would be infringed, but for the grant of the License, by the making,
+      using, selling, offering for sale, having made, import, or transfer of
+      either its Contributions or its Contributor Version.
+
+1.12. “Secondary License”
+
+      means either the GNU General Public License, Version 2.0, the GNU Lesser
+      General Public License, Version 2.1, the GNU Affero General Public
+      License, Version 3.0, or any later versions of those licenses.
+
+1.13. “Source Code Form”
+
+      means the form of the work preferred for making modifications.
+
+1.14. “You” (or “Your”)
+
+      means an individual or a legal entity exercising rights under this
+      License. For legal entities, “You” includes any entity that controls, is
+      controlled by, or is under common control with You. For purposes of this
+      definition, “control” means (a) the power, direct or indirect, to cause
+      the direction or management of such entity, whether by contract or
+      otherwise, or (b) ownership of more than fifty percent (50%) of the
+      outstanding shares or beneficial ownership of such entity.
+
+
+2. License Grants and Conditions
+
+2.1. Grants
+
+     Each Contributor hereby grants You a world-wide, royalty-free,
+     non-exclusive license:
+
+     a. under intellectual property rights (other than patent or trademark)
+        Licensable by such Contributor to use, reproduce, make available,
+        modify, display, perform, distribute, and otherwise exploit its
+        Contributions, either on an unmodified basis, with Modifications, or as
+        part of a Larger Work; and
+
+     b. under Patent Claims of such Contributor to make, use, sell, offer for
+        sale, have made, import, and otherwise transfer either its Contributions
+        or its Contributor Version.
+
+2.2. Effective Date
+
+     The licenses granted in Section 2.1 with respect to any Contribution become
+     effective for each Contribution on the date the Contributor first distributes
+     such Contribution.
+
+2.3. Limitations on Grant Scope
+
+     The licenses granted in this Section 2 are the only rights granted under this
+     License. No additional rights or licenses will be implied from the distribution
+     or licensing of Covered Software under this License. Notwithstanding Section
+     2.1(b) above, no patent license is granted by a Contributor:
+
+     a. for any code that a Contributor has removed from Covered Software; or
+
+     b. for infringements caused by: (i) Your and any other third party’s
+        modifications of Covered Software, or (ii) the combination of its
+        Contributions with other software (except as part of its Contributor
+        Version); or
+
+     c. under Patent Claims infringed by Covered Software in the absence of its
+        Contributions.
+
+     This License does not grant any rights in the trademarks, service marks, or
+     logos of any Contributor (except as may be necessary to comply with the
+     notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+     No Contributor makes additional grants as a result of Your choice to
+     distribute the Covered Software under a subsequent version of this License
+     (see Section 10.2) or under the terms of a Secondary License (if permitted
+     under the terms of Section 3.3).
+
+2.5. Representation
+
+     Each Contributor represents that the Contributor believes its Contributions
+     are its original creation(s) or it has sufficient rights to grant the
+     rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+     This License is not intended to limit any rights You have under applicable
+     copyright doctrines of fair use, fair dealing, or other equivalents.
+
+2.7. Conditions
+
+     Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
+     Section 2.1.
+
+
+3. Responsibilities
+
+3.1. Distribution of Source Form
+
+     All distribution of Covered Software in Source Code Form, including any
+     Modifications that You create or to which You contribute, must be under the
+     terms of this License. You must inform recipients that the Source Code Form
+     of the Covered Software is governed by the terms of this License, and how
+     they can obtain a copy of this License. You may not attempt to alter or
+     restrict the recipients’ rights in the Source Code Form.
+
+3.2. Distribution of Executable Form
+
+     If You distribute Covered Software in Executable Form then:
+
+     a. such Covered Software must also be made available in Source Code Form,
+        as described in Section 3.1, and You must inform recipients of the
+        Executable Form how they can obtain a copy of such Source Code Form by
+        reasonable means in a timely manner, at a charge no more than the cost
+        of distribution to the recipient; and
+
+     b. You may distribute such Executable Form under the terms of this License,
+        or sublicense it under different terms, provided that the license for
+        the Executable Form does not attempt to limit or alter the recipients’
+        rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+     You may create and distribute a Larger Work under terms of Your choice,
+     provided that You also comply with the requirements of this License for the
+     Covered Software. If the Larger Work is a combination of Covered Software
+     with a work governed by one or more Secondary Licenses, and the Covered
+     Software is not Incompatible With Secondary Licenses, this License permits
+     You to additionally distribute such Covered Software under the terms of
+     such Secondary License(s), so that the recipient of the Larger Work may, at
+     their option, further distribute the Covered Software under the terms of
+     either this License or such Secondary License(s).
+
+3.4. Notices
+
+     You may not remove or alter the substance of any license notices (including
+     copyright notices, patent notices, disclaimers of warranty, or limitations
+     of liability) contained within the Source Code Form of the Covered
+     Software, except that You may alter any license notices to the extent
+     required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+     You may choose to offer, and to charge a fee for, warranty, support,
+     indemnity or liability obligations to one or more recipients of Covered
+     Software. However, You may do so only on Your own behalf, and not on behalf
+     of any Contributor. You must make it absolutely clear that any such
+     warranty, support, indemnity, or liability obligation is offered by You
+     alone, and You hereby agree to indemnify every Contributor for any
+     liability incurred by such Contributor as a result of warranty, support,
+     indemnity or liability terms You offer. You may include additional
+     disclaimers of warranty and limitations of liability specific to any
+     jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+
+   If it is impossible for You to comply with any of the terms of this License
+   with respect to some or all of the Covered Software due to statute, judicial
+   order, or regulation then You must: (a) comply with the terms of this License
+   to the maximum extent possible; and (b) describe the limitations and the code
+   they affect. Such description must be placed in a text file included with all
+   distributions of the Covered Software under this License. Except to the
+   extent prohibited by statute or regulation, such description must be
+   sufficiently detailed for a recipient of ordinary skill to be able to
+   understand it.
+
+5. Termination
+
+5.1. The rights granted under this License will terminate automatically if You
+     fail to comply with any of its terms. However, if You become compliant,
+     then the rights granted under this License from a particular Contributor
+     are reinstated (a) provisionally, unless and until such Contributor
+     explicitly and finally terminates Your grants, and (b) on an ongoing basis,
+     if such Contributor fails to notify You of the non-compliance by some
+     reasonable means prior to 60 days after You have come back into compliance.
+     Moreover, Your grants from a particular Contributor are reinstated on an
+     ongoing basis if such Contributor notifies You of the non-compliance by
+     some reasonable means, this is the first time You have received notice of
+     non-compliance with this License from such Contributor, and You become
+     compliant prior to 30 days after Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+     infringement claim (excluding declaratory judgment actions, counter-claims,
+     and cross-claims) alleging that a Contributor Version directly or
+     indirectly infringes any patent, then the rights granted to You by any and
+     all Contributors for the Covered Software under Section 2.1 of this License
+     shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
+     license agreements (excluding distributors and resellers) which have been
+     validly granted by You or Your distributors under this License prior to
+     termination shall survive termination.
+
+6. Disclaimer of Warranty
+
+   Covered Software is provided under this License on an “as is” basis, without
+   warranty of any kind, either expressed, implied, or statutory, including,
+   without limitation, warranties that the Covered Software is free of defects,
+   merchantable, fit for a particular purpose or non-infringing. The entire
+   risk as to the quality and performance of the Covered Software is with You.
+   Should any Covered Software prove defective in any respect, You (not any
+   Contributor) assume the cost of any necessary servicing, repair, or
+   correction. This disclaimer of warranty constitutes an essential part of this
+   License. No use of  any Covered Software is authorized under this License
+   except under this disclaimer.
+
+7. Limitation of Liability
+
+   Under no circumstances and under no legal theory, whether tort (including
+   negligence), contract, or otherwise, shall any Contributor, or anyone who
+   distributes Covered Software as permitted above, be liable to You for any
+   direct, indirect, special, incidental, or consequential damages of any
+   character including, without limitation, damages for lost profits, loss of
+   goodwill, work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses, even if such party shall have been
+   informed of the possibility of such damages. This limitation of liability
+   shall not apply to liability for death or personal injury resulting from such
+   party’s negligence to the extent applicable law prohibits such limitation.
+   Some jurisdictions do not allow the exclusion or limitation of incidental or
+   consequential damages, so this exclusion and limitation may not apply to You.
+
+8. Litigation
+
+   Any litigation relating to this License may be brought only in the courts of
+   a jurisdiction where the defendant maintains its principal place of business
+   and such litigation shall be governed by laws of that jurisdiction, without
+   reference to its conflict-of-law provisions. Nothing in this Section shall
+   prevent a party’s ability to bring cross-claims or counter-claims.
+
+9. Miscellaneous
+
+   This License represents the complete agreement concerning the subject matter
+   hereof. If any provision of this License is held to be unenforceable, such
+   provision shall be reformed only to the extent necessary to make it
+   enforceable. Any law or regulation which provides that the language of a
+   contract shall be construed against the drafter shall not be used to construe
+   this License against a Contributor.
+
+
+10. Versions of the License
+
+10.1. New Versions
+
+      Mozilla Foundation is the license steward. Except as provided in Section
+      10.3, no one other than the license steward has the right to modify or
+      publish new versions of this License. Each version will be given a
+      distinguishing version number.
+
+10.2. Effect of New Versions
+
+      You may distribute the Covered Software under the terms of the version of
+      the License under which You originally received the Covered Software, or
+      under the terms of any subsequent version published by the license
+      steward.
+
+10.3. Modified Versions
+
+      If you create software not governed by this License, and you want to
+      create a new license for such software, you may create and use a modified
+      version of this License if you rename the license and remove any
+      references to the name of the license steward (except to note that such
+      modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
+      If You choose to distribute Source Code Form that is Incompatible With
+      Secondary Licenses under the terms of this version of the License, the
+      notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+
+      This Source Code Form is subject to the
+      terms of the Mozilla Public License, v.
+      2.0. If a copy of the MPL was not
+      distributed with this file, You can
+      obtain one at
+      http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular file, then
+You may include the notice in a location (such as a LICENSE file in a relevant
+directory) where a recipient would be likely to look for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - “Incompatible With Secondary Licenses” Notice
+
+      This Source Code Form is “Incompatible
+      With Secondary Licenses”, as defined by
+      the Mozilla Public License, v. 2.0.
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md
new file mode 100644
index 0000000..49490ea
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md
@@ -0,0 +1,36 @@
+# logutils
+
+logutils is a Go package that augments the standard library "log" package
+to make logging a bit more modern, without fragmenting the Go ecosystem
+with new logging packages.
+
+## The simplest thing that could possibly work
+
+Presumably your application already uses the default `log` package. To switch, you'll want your code to look like the following:
+
+```go
+package main
+
+import (
+	"log"
+	"os"
+
+	"github.com/hashicorp/logutils"
+)
+
+func main() {
+	filter := &logutils.LevelFilter{
+		Levels: []logutils.LogLevel{"DEBUG", "WARN", "ERROR"},
+		MinLevel: logutils.LogLevel("WARN"),
+		Writer: os.Stderr,
+	}
+	log.SetOutput(filter)
+
+	log.Print("[DEBUG] Debugging") // this will not print
+	log.Print("[WARN] Warning") // this will
+	log.Print("[ERROR] Erring") // and so will this
+	log.Print("Message I haven't updated") // and so will this
+}
+```
+
+This logs to standard error exactly like go's standard logger. Any log messages you haven't converted to have a level will continue to print as before.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go
new file mode 100644
index 0000000..6381bf1
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go
@@ -0,0 +1,81 @@
+// Package logutils augments the standard log package with levels.
+package logutils
+
+import (
+	"bytes"
+	"io"
+	"sync"
+)
+
+type LogLevel string
+
+// LevelFilter is an io.Writer that can be used with a logger that
+// will filter out log messages that aren't at least a certain level.
+//
+// Once the filter is in use somewhere, it is not safe to modify
+// the structure.
+type LevelFilter struct {
+	// Levels is the list of log levels, in increasing order of
+	// severity. Example might be: {"DEBUG", "WARN", "ERROR"}.
+	Levels []LogLevel
+
+	// MinLevel is the minimum level allowed through
+	MinLevel LogLevel
+
+	// The underlying io.Writer where log messages that pass the filter
+	// will be set.
+	Writer io.Writer
+
+	badLevels map[LogLevel]struct{}
+	once      sync.Once
+}
+
+// Check will check a given line if it would be included in the level
+// filter.
+func (f *LevelFilter) Check(line []byte) bool {
+	f.once.Do(f.init)
+
+	// Check for a log level
+	var level LogLevel
+	x := bytes.IndexByte(line, '[')
+	if x >= 0 {
+		y := bytes.IndexByte(line[x:], ']')
+		if y >= 0 {
+			level = LogLevel(line[x+1 : x+y])
+		}
+	}
+
+	_, ok := f.badLevels[level]
+	return !ok
+}
+
+func (f *LevelFilter) Write(p []byte) (n int, err error) {
+	// Note in general that io.Writer can receive any byte sequence
+	// to write, but the "log" package always guarantees that we only
+	// get a single line. We use that as a slight optimization within
+	// this method, assuming we're dealing with a single, complete line
+	// of log data.
+
+	if !f.Check(p) {
+		return len(p), nil
+	}
+
+	return f.Writer.Write(p)
+}
+
+// SetMinLevel is used to update the minimum log level
+func (f *LevelFilter) SetMinLevel(min LogLevel) {
+	f.MinLevel = min
+	f.init()
+}
+
+func (f *LevelFilter) init() {
+	badLevels := make(map[LogLevel]struct{})
+	for _, level := range f.Levels {
+		if level == f.MinLevel {
+			break
+		}
+		badLevels[level] = struct{}{}
+	}
+	f.badLevels = badLevels
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go
new file mode 100644
index 0000000..3c2caf7
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go
@@ -0,0 +1,37 @@
+package logutils
+
+import (
+	"io/ioutil"
+	"testing"
+)
+
+var messages [][]byte
+
+func init() {
+	messages = [][]byte{
+		[]byte("[TRACE] foo"),
+		[]byte("[DEBUG] foo"),
+		[]byte("[INFO] foo"),
+		[]byte("[WARN] foo"),
+		[]byte("[ERROR] foo"),
+	}
+}
+
+func BenchmarkDiscard(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		ioutil.Discard.Write(messages[i%len(messages)])
+	}
+}
+
+func BenchmarkLevelFilter(b *testing.B) {
+	filter := &LevelFilter{
+		Levels:   []LogLevel{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"},
+		MinLevel: "WARN",
+		Writer:   ioutil.Discard,
+	}
+
+	b.ResetTimer()
+	for i := 0; i < b.N; i++ {
+		filter.Write(messages[i%len(messages)])
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go
new file mode 100644
index 0000000..f6b6ac3
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go
@@ -0,0 +1,94 @@
+package logutils
+
+import (
+	"bytes"
+	"io"
+	"log"
+	"testing"
+)
+
+func TestLevelFilter_impl(t *testing.T) {
+	var _ io.Writer = new(LevelFilter)
+}
+
+func TestLevelFilter(t *testing.T) {
+	buf := new(bytes.Buffer)
+	filter := &LevelFilter{
+		Levels:   []LogLevel{"DEBUG", "WARN", "ERROR"},
+		MinLevel: "WARN",
+		Writer:   buf,
+	}
+
+	logger := log.New(filter, "", 0)
+	logger.Print("[WARN] foo")
+	logger.Println("[ERROR] bar")
+	logger.Println("[DEBUG] baz")
+	logger.Println("[WARN] buzz")
+
+	result := buf.String()
+	expected := "[WARN] foo\n[ERROR] bar\n[WARN] buzz\n"
+	if result != expected {
+		t.Fatalf("bad: %#v", result)
+	}
+}
+
+func TestLevelFilterCheck(t *testing.T) {
+	filter := &LevelFilter{
+		Levels:   []LogLevel{"DEBUG", "WARN", "ERROR"},
+		MinLevel: "WARN",
+		Writer:   nil,
+	}
+
+	testCases := []struct {
+		line  string
+		check bool
+	}{
+		{"[WARN] foo\n", true},
+		{"[ERROR] bar\n", true},
+		{"[DEBUG] baz\n", false},
+		{"[WARN] buzz\n", true},
+	}
+
+	for _, testCase := range testCases {
+		result := filter.Check([]byte(testCase.line))
+		if result != testCase.check {
+			t.Errorf("Fail: %s", testCase.line)
+		}
+	}
+}
+
+func TestLevelFilter_SetMinLevel(t *testing.T) {
+	filter := &LevelFilter{
+		Levels:   []LogLevel{"DEBUG", "WARN", "ERROR"},
+		MinLevel: "ERROR",
+		Writer:   nil,
+	}
+
+	testCases := []struct {
+		line        string
+		checkBefore bool
+		checkAfter  bool
+	}{
+		{"[WARN] foo\n", false, true},
+		{"[ERROR] bar\n", true, true},
+		{"[DEBUG] baz\n", false, false},
+		{"[WARN] buzz\n", false, true},
+	}
+
+	for _, testCase := range testCases {
+		result := filter.Check([]byte(testCase.line))
+		if result != testCase.checkBefore {
+			t.Errorf("Fail: %s", testCase.line)
+		}
+	}
+
+	// Update the minimum level to WARN
+	filter.SetMinLevel("WARN")
+
+	for _, testCase := range testCases {
+		result := filter.Check([]byte(testCase.line))
+		if result != testCase.checkAfter {
+			t.Errorf("Fail: %s", testCase.line)
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE b/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE
new file mode 100644
index 0000000..5f0d1fb
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2014 Alan Shreve
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/README.md b/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/README.md
new file mode 100644
index 0000000..7a950d1
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/README.md
@@ -0,0 +1,23 @@
+# mousetrap
+
+mousetrap is a tiny library that answers a single question.
+
+On a Windows machine, was the process invoked by someone double clicking on
+the executable file while browsing in explorer?
+
+### Motivation
+
+Windows developers unfamiliar with command line tools will often "double-click"
+the executable for a tool. Because most CLI tools print the help and then exit
+when invoked without arguments, this is often very frustrating for those users.
+
+mousetrap provides a way to detect these invocations so that you can provide
+more helpful behavior and instructions on how to run the CLI tool. To see what
+this looks like, both from an organizational and a technical perspective, see
+https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/
+
+### The interface
+
+The library exposes a single interface:
+
+    func StartedByExplorer() (bool)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_others.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_others.go b/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_others.go
new file mode 100644
index 0000000..9d2d8a4
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_others.go
@@ -0,0 +1,15 @@
+// +build !windows
+
+package mousetrap
+
+// StartedByExplorer returns true if the program was invoked by the user
+// double-clicking on the executable from explorer.exe
+//
+// It is conservative and returns false if any of the internal calls fail.
+// It does not guarantee that the program was run from a terminal. It only can tell you
+// whether it was launched from explorer.exe
+//
+// On non-Windows platforms, it always returns false.
+func StartedByExplorer() bool {
+	return false
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows.go b/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows.go
new file mode 100644
index 0000000..336142a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows.go
@@ -0,0 +1,98 @@
+// +build windows
+// +build !go1.4
+
+package mousetrap
+
+import (
+	"fmt"
+	"os"
+	"syscall"
+	"unsafe"
+)
+
+const (
+	// defined by the Win32 API
+	th32cs_snapprocess uintptr = 0x2
+)
+
+var (
+	kernel                   = syscall.MustLoadDLL("kernel32.dll")
+	CreateToolhelp32Snapshot = kernel.MustFindProc("CreateToolhelp32Snapshot")
+	Process32First           = kernel.MustFindProc("Process32FirstW")
+	Process32Next            = kernel.MustFindProc("Process32NextW")
+)
+
+// ProcessEntry32 structure defined by the Win32 API
+type processEntry32 struct {
+	dwSize              uint32
+	cntUsage            uint32
+	th32ProcessID       uint32
+	th32DefaultHeapID   int
+	th32ModuleID        uint32
+	cntThreads          uint32
+	th32ParentProcessID uint32
+	pcPriClassBase      int32
+	dwFlags             uint32
+	szExeFile           [syscall.MAX_PATH]uint16
+}
+
+func getProcessEntry(pid int) (pe *processEntry32, err error) {
+	snapshot, _, e1 := CreateToolhelp32Snapshot.Call(th32cs_snapprocess, uintptr(0))
+	if snapshot == uintptr(syscall.InvalidHandle) {
+		err = fmt.Errorf("CreateToolhelp32Snapshot: %v", e1)
+		return
+	}
+	defer syscall.CloseHandle(syscall.Handle(snapshot))
+
+	var processEntry processEntry32
+	processEntry.dwSize = uint32(unsafe.Sizeof(processEntry))
+	ok, _, e1 := Process32First.Call(snapshot, uintptr(unsafe.Pointer(&processEntry)))
+	if ok == 0 {
+		err = fmt.Errorf("Process32First: %v", e1)
+		return
+	}
+
+	for {
+		if processEntry.th32ProcessID == uint32(pid) {
+			pe = &processEntry
+			return
+		}
+
+		ok, _, e1 = Process32Next.Call(snapshot, uintptr(unsafe.Pointer(&processEntry)))
+		if ok == 0 {
+			err = fmt.Errorf("Process32Next: %v", e1)
+			return
+		}
+	}
+}
+
+func getppid() (pid int, err error) {
+	pe, err := getProcessEntry(os.Getpid())
+	if err != nil {
+		return
+	}
+
+	pid = int(pe.th32ParentProcessID)
+	return
+}
+
+// StartedByExplorer returns true if the program was invoked by the user double-clicking
+// on the executable from explorer.exe
+//
+// It is conservative and returns false if any of the internal calls fail.
+// It does not guarantee that the program was run from a terminal. It only can tell you
+// whether it was launched from explorer.exe
+func StartedByExplorer() bool {
+	ppid, err := getppid()
+	if err != nil {
+		return false
+	}
+
+	pe, err := getProcessEntry(ppid)
+	if err != nil {
+		return false
+	}
+
+	name := syscall.UTF16ToString(pe.szExeFile[:])
+	return name == "explorer.exe"
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows_1.4.go b/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
new file mode 100644
index 0000000..9a28e57
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
@@ -0,0 +1,46 @@
+// +build windows
+// +build go1.4
+
+package mousetrap
+
+import (
+	"os"
+	"syscall"
+	"unsafe"
+)
+
+func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) {
+	snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0)
+	if err != nil {
+		return nil, err
+	}
+	defer syscall.CloseHandle(snapshot)
+	var procEntry syscall.ProcessEntry32
+	procEntry.Size = uint32(unsafe.Sizeof(procEntry))
+	if err = syscall.Process32First(snapshot, &procEntry); err != nil {
+		return nil, err
+	}
+	for {
+		if procEntry.ProcessID == uint32(pid) {
+			return &procEntry, nil
+		}
+		err = syscall.Process32Next(snapshot, &procEntry)
+		if err != nil {
+			return nil, err
+		}
+	}
+}
+
+// StartedByExplorer returns true if the program was invoked by the user double-clicking
+// on the executable from explorer.exe
+//
+// It is conservative and returns false if any of the internal calls fail.
+// It does not guarantee that the program was run from a terminal. It only can tell you
+// whether it was launched from explorer.exe
+func StartedByExplorer() bool {
+	pe, err := getProcessEntry(os.Getppid())
+	if err != nil {
+		return false
+	}
+	return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:])
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/pretty/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/pretty/.gitignore b/newt/Godeps/_workspace/src/github.com/kr/pretty/.gitignore
new file mode 100644
index 0000000..1f0a99f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/pretty/.gitignore
@@ -0,0 +1,4 @@
+[568].out
+_go*
+_test*
+_obj

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/pretty/License
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/pretty/License b/newt/Godeps/_workspace/src/github.com/kr/pretty/License
new file mode 100644
index 0000000..05c783c
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/pretty/License
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright 2012 Keith Rarick
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/pretty/Readme
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/pretty/Readme b/newt/Godeps/_workspace/src/github.com/kr/pretty/Readme
new file mode 100644
index 0000000..c589fc6
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/pretty/Readme
@@ -0,0 +1,9 @@
+package pretty
+
+    import "github.com/kr/pretty"
+
+    Package pretty provides pretty-printing for Go values.
+
+Documentation
+
+    http://godoc.org/github.com/kr/pretty

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/pretty/diff.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/pretty/diff.go b/newt/Godeps/_workspace/src/github.com/kr/pretty/diff.go
new file mode 100644
index 0000000..8fe8e24
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/pretty/diff.go
@@ -0,0 +1,158 @@
+package pretty
+
+import (
+	"fmt"
+	"io"
+	"reflect"
+)
+
+type sbuf []string
+
+func (s *sbuf) Write(b []byte) (int, error) {
+	*s = append(*s, string(b))
+	return len(b), nil
+}
+
+// Diff returns a slice where each element describes
+// a difference between a and b.
+func Diff(a, b interface{}) (desc []string) {
+	Fdiff((*sbuf)(&desc), a, b)
+	return desc
+}
+
+// Fdiff writes to w a description of the differences between a and b.
+func Fdiff(w io.Writer, a, b interface{}) {
+	diffWriter{w: w}.diff(reflect.ValueOf(a), reflect.ValueOf(b))
+}
+
+type diffWriter struct {
+	w io.Writer
+	l string // label
+}
+
+func (w diffWriter) printf(f string, a ...interface{}) {
+	var l string
+	if w.l != "" {
+		l = w.l + ": "
+	}
+	fmt.Fprintf(w.w, l+f, a...)
+}
+
+func (w diffWriter) diff(av, bv reflect.Value) {
+	if !av.IsValid() && bv.IsValid() {
+		w.printf("nil != %#v", bv.Interface())
+		return
+	}
+	if av.IsValid() && !bv.IsValid() {
+		w.printf("%#v != nil", av.Interface())
+		return
+	}
+	if !av.IsValid() && !bv.IsValid() {
+		return
+	}
+
+	at := av.Type()
+	bt := bv.Type()
+	if at != bt {
+		w.printf("%v != %v", at, bt)
+		return
+	}
+
+	// numeric types, including bool
+	if at.Kind() < reflect.Array {
+		a, b := av.Interface(), bv.Interface()
+		if a != b {
+			w.printf("%#v != %#v", a, b)
+		}
+		return
+	}
+
+	switch at.Kind() {
+	case reflect.String:
+		a, b := av.Interface(), bv.Interface()
+		if a != b {
+			w.printf("%q != %q", a, b)
+		}
+	case reflect.Ptr:
+		switch {
+		case av.IsNil() && !bv.IsNil():
+			w.printf("nil != %v", bv.Interface())
+		case !av.IsNil() && bv.IsNil():
+			w.printf("%v != nil", av.Interface())
+		case !av.IsNil() && !bv.IsNil():
+			w.diff(av.Elem(), bv.Elem())
+		}
+	case reflect.Struct:
+		for i := 0; i < av.NumField(); i++ {
+			w.relabel(at.Field(i).Name).diff(av.Field(i), bv.Field(i))
+		}
+	case reflect.Slice:
+		lenA := av.Len()
+		lenB := bv.Len()
+		if lenA != lenB {
+			w.printf("%s[%d] != %s[%d]", av.Type(), lenA, bv.Type(), lenB)
+			break
+		}
+		for i := 0; i < lenA; i++ {
+			w.relabel(fmt.Sprintf("[%d]", i)).diff(av.Index(i), bv.Index(i))
+		}
+	case reflect.Map:
+		ak, both, bk := keyDiff(av.MapKeys(), bv.MapKeys())
+		for _, k := range ak {
+			w := w.relabel(fmt.Sprintf("[%#v]", k.Interface()))
+			w.printf("%q != (missing)", av.MapIndex(k))
+		}
+		for _, k := range both {
+			w := w.relabel(fmt.Sprintf("[%#v]", k.Interface()))
+			w.diff(av.MapIndex(k), bv.MapIndex(k))
+		}
+		for _, k := range bk {
+			w := w.relabel(fmt.Sprintf("[%#v]", k.Interface()))
+			w.printf("(missing) != %q", bv.MapIndex(k))
+		}
+	case reflect.Interface:
+		w.diff(reflect.ValueOf(av.Interface()), reflect.ValueOf(bv.Interface()))
+	default:
+		if !reflect.DeepEqual(av.Interface(), bv.Interface()) {
+			w.printf("%# v != %# v", Formatter(av.Interface()), Formatter(bv.Interface()))
+		}
+	}
+}
+
+func (d diffWriter) relabel(name string) (d1 diffWriter) {
+	d1 = d
+	if d.l != "" && name[0] != '[' {
+		d1.l += "."
+	}
+	d1.l += name
+	return d1
+}
+
+func keyDiff(a, b []reflect.Value) (ak, both, bk []reflect.Value) {
+	for _, av := range a {
+		inBoth := false
+		for _, bv := range b {
+			if reflect.DeepEqual(av.Interface(), bv.Interface()) {
+				inBoth = true
+				both = append(both, av)
+				break
+			}
+		}
+		if !inBoth {
+			ak = append(ak, av)
+		}
+	}
+	for _, bv := range b {
+		inBoth := false
+		for _, av := range a {
+			if reflect.DeepEqual(av.Interface(), bv.Interface()) {
+				inBoth = true
+				break
+			}
+		}
+		if !inBoth {
+			bk = append(bk, bv)
+		}
+	}
+	return
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/pretty/diff_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/pretty/diff_test.go b/newt/Godeps/_workspace/src/github.com/kr/pretty/diff_test.go
new file mode 100644
index 0000000..3c388f1
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/pretty/diff_test.go
@@ -0,0 +1,74 @@
+package pretty
+
+import (
+	"testing"
+)
+
+type difftest struct {
+	a   interface{}
+	b   interface{}
+	exp []string
+}
+
+type S struct {
+	A int
+	S *S
+	I interface{}
+	C []int
+}
+
+var diffs = []difftest{
+	{a: nil, b: nil},
+	{a: S{A: 1}, b: S{A: 1}},
+
+	{0, "", []string{`int != string`}},
+	{0, 1, []string{`0 != 1`}},
+	{S{}, new(S), []string{`pretty.S != *pretty.S`}},
+	{"a", "b", []string{`"a" != "b"`}},
+	{S{}, S{A: 1}, []string{`A: 0 != 1`}},
+	{new(S), &S{A: 1}, []string{`A: 0 != 1`}},
+	{S{S: new(S)}, S{S: &S{A: 1}}, []string{`S.A: 0 != 1`}},
+	{S{}, S{I: 0}, []string{`I: nil != 0`}},
+	{S{I: 1}, S{I: "x"}, []string{`I: int != string`}},
+	{S{}, S{C: []int{1}}, []string{`C: []int[0] != []int[1]`}},
+	{S{C: []int{}}, S{C: []int{1}}, []string{`C: []int[0] != []int[1]`}},
+	{S{C: []int{1, 2, 3}}, S{C: []int{1, 2, 4}}, []string{`C[2]: 3 != 4`}},
+	{S{}, S{A: 1, S: new(S)}, []string{`A: 0 != 1`, `S: nil != &{0 <nil> <nil> []}`}},
+}
+
+func TestDiff(t *testing.T) {
+	for _, tt := range diffs {
+		got := Diff(tt.a, tt.b)
+		eq := len(got) == len(tt.exp)
+		if eq {
+			for i := range got {
+				eq = eq && got[i] == tt.exp[i]
+			}
+		}
+		if !eq {
+			t.Errorf("diffing % #v", tt.a)
+			t.Errorf("with    % #v", tt.b)
+			diffdiff(t, got, tt.exp)
+			continue
+		}
+	}
+}
+
+func diffdiff(t *testing.T, got, exp []string) {
+	minus(t, "unexpected:", got, exp)
+	minus(t, "missing:", exp, got)
+}
+
+func minus(t *testing.T, s string, a, b []string) {
+	var i, j int
+	for i = 0; i < len(a); i++ {
+		for j = 0; j < len(b); j++ {
+			if a[i] == b[j] {
+				break
+			}
+		}
+		if j == len(b) {
+			t.Error(s, a[i])
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/pretty/example_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/pretty/example_test.go b/newt/Godeps/_workspace/src/github.com/kr/pretty/example_test.go
new file mode 100644
index 0000000..ecf40f3
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/pretty/example_test.go
@@ -0,0 +1,20 @@
+package pretty_test
+
+import (
+	"fmt"
+	"github.com/kr/pretty"
+)
+
+func Example() {
+	type myType struct {
+		a, b int
+	}
+	var x = []myType{{1, 2}, {3, 4}, {5, 6}}
+	fmt.Printf("%# v", pretty.Formatter(x))
+	// output:
+	// []pretty_test.myType{
+	//     {a:1, b:2},
+	//     {a:3, b:4},
+	//     {a:5, b:6},
+	// }
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/pretty/formatter.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/pretty/formatter.go b/newt/Godeps/_workspace/src/github.com/kr/pretty/formatter.go
new file mode 100644
index 0000000..8dacda2
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/pretty/formatter.go
@@ -0,0 +1,337 @@
+package pretty
+
+import (
+	"fmt"
+	"io"
+	"reflect"
+	"strconv"
+	"text/tabwriter"
+
+	"github.com/kr/text"
+)
+
+const (
+	limit = 50
+)
+
+type formatter struct {
+	x     interface{}
+	force bool
+	quote bool
+}
+
+// Formatter makes a wrapper, f, that will format x as go source with line
+// breaks and tabs. Object f responds to the "%v" formatting verb when both the
+// "#" and " " (space) flags are set, for example:
+//
+//     fmt.Sprintf("%# v", Formatter(x))
+//
+// If one of these two flags is not set, or any other verb is used, f will
+// format x according to the usual rules of package fmt.
+// In particular, if x satisfies fmt.Formatter, then x.Format will be called.
+func Formatter(x interface{}) (f fmt.Formatter) {
+	return formatter{x: x, quote: true}
+}
+
+func (fo formatter) String() string {
+	return fmt.Sprint(fo.x) // unwrap it
+}
+
+func (fo formatter) passThrough(f fmt.State, c rune) {
+	s := "%"
+	for i := 0; i < 128; i++ {
+		if f.Flag(i) {
+			s += string(i)
+		}
+	}
+	if w, ok := f.Width(); ok {
+		s += fmt.Sprintf("%d", w)
+	}
+	if p, ok := f.Precision(); ok {
+		s += fmt.Sprintf(".%d", p)
+	}
+	s += string(c)
+	fmt.Fprintf(f, s, fo.x)
+}
+
+func (fo formatter) Format(f fmt.State, c rune) {
+	if fo.force || c == 'v' && f.Flag('#') && f.Flag(' ') {
+		w := tabwriter.NewWriter(f, 4, 4, 1, ' ', 0)
+		p := &printer{tw: w, Writer: w, visited: make(map[visit]int)}
+		p.printValue(reflect.ValueOf(fo.x), true, fo.quote)
+		w.Flush()
+		return
+	}
+	fo.passThrough(f, c)
+}
+
+type printer struct {
+	io.Writer
+	tw      *tabwriter.Writer
+	visited map[visit]int
+	depth   int
+}
+
+func (p *printer) indent() *printer {
+	q := *p
+	q.tw = tabwriter.NewWriter(p.Writer, 4, 4, 1, ' ', 0)
+	q.Writer = text.NewIndentWriter(q.tw, []byte{'\t'})
+	return &q
+}
+
+func (p *printer) printInline(v reflect.Value, x interface{}, showType bool) {
+	if showType {
+		io.WriteString(p, v.Type().String())
+		fmt.Fprintf(p, "(%#v)", x)
+	} else {
+		fmt.Fprintf(p, "%#v", x)
+	}
+}
+
+// printValue must keep track of already-printed pointer values to avoid
+// infinite recursion.
+type visit struct {
+	v   uintptr
+	typ reflect.Type
+}
+
+func (p *printer) printValue(v reflect.Value, showType, quote bool) {
+	if p.depth > 10 {
+		io.WriteString(p, "!%v(DEPTH EXCEEDED)")
+		return
+	}
+
+	switch v.Kind() {
+	case reflect.Bool:
+		p.printInline(v, v.Bool(), showType)
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		p.printInline(v, v.Int(), showType)
+	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+		p.printInline(v, v.Uint(), showType)
+	case reflect.Float32, reflect.Float64:
+		p.printInline(v, v.Float(), showType)
+	case reflect.Complex64, reflect.Complex128:
+		fmt.Fprintf(p, "%#v", v.Complex())
+	case reflect.String:
+		p.fmtString(v.String(), quote)
+	case reflect.Map:
+		t := v.Type()
+		if showType {
+			io.WriteString(p, t.String())
+		}
+		writeByte(p, '{')
+		if nonzero(v) {
+			expand := !canInline(v.Type())
+			pp := p
+			if expand {
+				writeByte(p, '\n')
+				pp = p.indent()
+			}
+			keys := v.MapKeys()
+			for i := 0; i < v.Len(); i++ {
+				showTypeInStruct := true
+				k := keys[i]
+				mv := v.MapIndex(k)
+				pp.printValue(k, false, true)
+				writeByte(pp, ':')
+				if expand {
+					writeByte(pp, '\t')
+				}
+				showTypeInStruct = t.Elem().Kind() == reflect.Interface
+				pp.printValue(mv, showTypeInStruct, true)
+				if expand {
+					io.WriteString(pp, ",\n")
+				} else if i < v.Len()-1 {
+					io.WriteString(pp, ", ")
+				}
+			}
+			if expand {
+				pp.tw.Flush()
+			}
+		}
+		writeByte(p, '}')
+	case reflect.Struct:
+		t := v.Type()
+		if v.CanAddr() {
+			addr := v.UnsafeAddr()
+			vis := visit{addr, t}
+			if vd, ok := p.visited[vis]; ok && vd < p.depth {
+				p.fmtString(t.String()+"{(CYCLIC REFERENCE)}", false)
+				break // don't print v again
+			}
+			p.visited[vis] = p.depth
+		}
+
+		if showType {
+			io.WriteString(p, t.String())
+		}
+		writeByte(p, '{')
+		if nonzero(v) {
+			expand := !canInline(v.Type())
+			pp := p
+			if expand {
+				writeByte(p, '\n')
+				pp = p.indent()
+			}
+			for i := 0; i < v.NumField(); i++ {
+				showTypeInStruct := true
+				if f := t.Field(i); f.Name != "" {
+					io.WriteString(pp, f.Name)
+					writeByte(pp, ':')
+					if expand {
+						writeByte(pp, '\t')
+					}
+					showTypeInStruct = labelType(f.Type)
+				}
+				pp.printValue(getField(v, i), showTypeInStruct, true)
+				if expand {
+					io.WriteString(pp, ",\n")
+				} else if i < v.NumField()-1 {
+					io.WriteString(pp, ", ")
+				}
+			}
+			if expand {
+				pp.tw.Flush()
+			}
+		}
+		writeByte(p, '}')
+	case reflect.Interface:
+		switch e := v.Elem(); {
+		case e.Kind() == reflect.Invalid:
+			io.WriteString(p, "nil")
+		case e.IsValid():
+			pp := *p
+			pp.depth++
+			pp.printValue(e, showType, true)
+		default:
+			io.WriteString(p, v.Type().String())
+			io.WriteString(p, "(nil)")
+		}
+	case reflect.Array, reflect.Slice:
+		t := v.Type()
+		if showType {
+			io.WriteString(p, t.String())
+		}
+		if v.Kind() == reflect.Slice && v.IsNil() && showType {
+			io.WriteString(p, "(nil)")
+			break
+		}
+		if v.Kind() == reflect.Slice && v.IsNil() {
+			io.WriteString(p, "nil")
+			break
+		}
+		writeByte(p, '{')
+		expand := !canInline(v.Type())
+		pp := p
+		if expand {
+			writeByte(p, '\n')
+			pp = p.indent()
+		}
+		for i := 0; i < v.Len(); i++ {
+			showTypeInSlice := t.Elem().Kind() == reflect.Interface
+			pp.printValue(v.Index(i), showTypeInSlice, true)
+			if expand {
+				io.WriteString(pp, ",\n")
+			} else if i < v.Len()-1 {
+				io.WriteString(pp, ", ")
+			}
+		}
+		if expand {
+			pp.tw.Flush()
+		}
+		writeByte(p, '}')
+	case reflect.Ptr:
+		e := v.Elem()
+		if !e.IsValid() {
+			writeByte(p, '(')
+			io.WriteString(p, v.Type().String())
+			io.WriteString(p, ")(nil)")
+		} else {
+			pp := *p
+			pp.depth++
+			writeByte(pp, '&')
+			pp.printValue(e, true, true)
+		}
+	case reflect.Chan:
+		x := v.Pointer()
+		if showType {
+			writeByte(p, '(')
+			io.WriteString(p, v.Type().String())
+			fmt.Fprintf(p, ")(%#v)", x)
+		} else {
+			fmt.Fprintf(p, "%#v", x)
+		}
+	case reflect.Func:
+		io.WriteString(p, v.Type().String())
+		io.WriteString(p, " {...}")
+	case reflect.UnsafePointer:
+		p.printInline(v, v.Pointer(), showType)
+	case reflect.Invalid:
+		io.WriteString(p, "nil")
+	}
+}
+
+func canInline(t reflect.Type) bool {
+	switch t.Kind() {
+	case reflect.Map:
+		return !canExpand(t.Elem())
+	case reflect.Struct:
+		for i := 0; i < t.NumField(); i++ {
+			if canExpand(t.Field(i).Type) {
+				return false
+			}
+		}
+		return true
+	case reflect.Interface:
+		return false
+	case reflect.Array, reflect.Slice:
+		return !canExpand(t.Elem())
+	case reflect.Ptr:
+		return false
+	case reflect.Chan, reflect.Func, reflect.UnsafePointer:
+		return false
+	}
+	return true
+}
+
+func canExpand(t reflect.Type) bool {
+	switch t.Kind() {
+	case reflect.Map, reflect.Struct,
+		reflect.Interface, reflect.Array, reflect.Slice,
+		reflect.Ptr:
+		return true
+	}
+	return false
+}
+
+func labelType(t reflect.Type) bool {
+	switch t.Kind() {
+	case reflect.Interface, reflect.Struct:
+		return true
+	}
+	return false
+}
+
+func (p *printer) fmtString(s string, quote bool) {
+	if quote {
+		s = strconv.Quote(s)
+	}
+	io.WriteString(p, s)
+}
+
+func tryDeepEqual(a, b interface{}) bool {
+	defer func() { recover() }()
+	return reflect.DeepEqual(a, b)
+}
+
+func writeByte(w io.Writer, b byte) {
+	w.Write([]byte{b})
+}
+
+func getField(v reflect.Value, i int) reflect.Value {
+	val := v.Field(i)
+	if val.Kind() == reflect.Interface && !val.IsNil() {
+		val = val.Elem()
+	}
+	return val
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/pretty/formatter_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/pretty/formatter_test.go b/newt/Godeps/_workspace/src/github.com/kr/pretty/formatter_test.go
new file mode 100644
index 0000000..5f3204e
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/pretty/formatter_test.go
@@ -0,0 +1,261 @@
+package pretty
+
+import (
+	"fmt"
+	"io"
+	"strings"
+	"testing"
+	"unsafe"
+)
+
+type test struct {
+	v interface{}
+	s string
+}
+
+type LongStructTypeName struct {
+	longFieldName      interface{}
+	otherLongFieldName interface{}
+}
+
+type SA struct {
+	t *T
+	v T
+}
+
+type T struct {
+	x, y int
+}
+
+type F int
+
+func (f F) Format(s fmt.State, c rune) {
+	fmt.Fprintf(s, "F(%d)", int(f))
+}
+
+var long = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+
+var gosyntax = []test{
+	{nil, `nil`},
+	{"", `""`},
+	{"a", `"a"`},
+	{1, "int(1)"},
+	{1.0, "float64(1)"},
+	{[]int(nil), "[]int(nil)"},
+	{[0]int{}, "[0]int{}"},
+	{complex(1, 0), "(1+0i)"},
+	//{make(chan int), "(chan int)(0x1234)"},
+	{unsafe.Pointer(uintptr(unsafe.Pointer(&long))), fmt.Sprintf("unsafe.Pointer(0x%02x)", uintptr(unsafe.Pointer(&long)))},
+	{func(int) {}, "func(int) {...}"},
+	{map[int]int{1: 1}, "map[int]int{1:1}"},
+	{int32(1), "int32(1)"},
+	{io.EOF, `&errors.errorString{s:"EOF"}`},
+	{[]string{"a"}, `[]string{"a"}`},
+	{
+		[]string{long},
+		`[]string{"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"}`,
+	},
+	{F(5), "pretty.F(5)"},
+	{
+		SA{&T{1, 2}, T{3, 4}},
+		`pretty.SA{
+    t:  &pretty.T{x:1, y:2},
+    v:  pretty.T{x:3, y:4},
+}`,
+	},
+	{
+		map[int][]byte{1: {}},
+		`map[int][]uint8{
+    1:  {},
+}`,
+	},
+	{
+		map[int]T{1: {}},
+		`map[int]pretty.T{
+    1:  {},
+}`,
+	},
+	{
+		long,
+		`"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"`,
+	},
+	{
+		LongStructTypeName{
+			longFieldName:      LongStructTypeName{},
+			otherLongFieldName: long,
+		},
+		`pretty.LongStructTypeName{
+    longFieldName:      pretty.LongStructTypeName{},
+    otherLongFieldName: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
+}`,
+	},
+	{
+		&LongStructTypeName{
+			longFieldName:      &LongStructTypeName{},
+			otherLongFieldName: (*LongStructTypeName)(nil),
+		},
+		`&pretty.LongStructTypeName{
+    longFieldName:      &pretty.LongStructTypeName{},
+    otherLongFieldName: (*pretty.LongStructTypeName)(nil),
+}`,
+	},
+	{
+		[]LongStructTypeName{
+			{nil, nil},
+			{3, 3},
+			{long, nil},
+		},
+		`[]pretty.LongStructTypeName{
+    {},
+    {
+        longFieldName:      int(3),
+        otherLongFieldName: int(3),
+    },
+    {
+        longFieldName:      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
+        otherLongFieldName: nil,
+    },
+}`,
+	},
+	{
+		[]interface{}{
+			LongStructTypeName{nil, nil},
+			[]byte{1, 2, 3},
+			T{3, 4},
+			LongStructTypeName{long, nil},
+		},
+		`[]interface {}{
+    pretty.LongStructTypeName{},
+    []uint8{0x1, 0x2, 0x3},
+    pretty.T{x:3, y:4},
+    pretty.LongStructTypeName{
+        longFieldName:      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
+        otherLongFieldName: nil,
+    },
+}`,
+	},
+}
+
+func TestGoSyntax(t *testing.T) {
+	for _, tt := range gosyntax {
+		s := fmt.Sprintf("%# v", Formatter(tt.v))
+		if tt.s != s {
+			t.Errorf("expected %q", tt.s)
+			t.Errorf("got      %q", s)
+			t.Errorf("expraw\n%s", tt.s)
+			t.Errorf("gotraw\n%s", s)
+		}
+	}
+}
+
+type I struct {
+	i int
+	R interface{}
+}
+
+func (i *I) I() *I { return i.R.(*I) }
+
+func TestCycle(t *testing.T) {
+	type A struct{ *A }
+	v := &A{}
+	v.A = v
+
+	// panics from stack overflow without cycle detection
+	t.Logf("Example cycle:\n%# v", Formatter(v))
+
+	p := &A{}
+	s := fmt.Sprintf("%# v", Formatter([]*A{p, p}))
+	if strings.Contains(s, "CYCLIC") {
+		t.Errorf("Repeated address detected as cyclic reference:\n%s", s)
+	}
+
+	type R struct {
+		i int
+		*R
+	}
+	r := &R{
+		i: 1,
+		R: &R{
+			i: 2,
+			R: &R{
+				i: 3,
+			},
+		},
+	}
+	r.R.R.R = r
+	t.Logf("Example longer cycle:\n%# v", Formatter(r))
+
+	r = &R{
+		i: 1,
+		R: &R{
+			i: 2,
+			R: &R{
+				i: 3,
+				R: &R{
+					i: 4,
+					R: &R{
+						i: 5,
+						R: &R{
+							i: 6,
+							R: &R{
+								i: 7,
+								R: &R{
+									i: 8,
+									R: &R{
+										i: 9,
+										R: &R{
+											i: 10,
+											R: &R{
+												i: 11,
+											},
+										},
+									},
+								},
+							},
+						},
+					},
+				},
+			},
+		},
+	}
+	// here be pirates
+	r.R.R.R.R.R.R.R.R.R.R.R = r
+	t.Logf("Example very long cycle:\n%# v", Formatter(r))
+
+	i := &I{
+		i: 1,
+		R: &I{
+			i: 2,
+			R: &I{
+				i: 3,
+				R: &I{
+					i: 4,
+					R: &I{
+						i: 5,
+						R: &I{
+							i: 6,
+							R: &I{
+								i: 7,
+								R: &I{
+									i: 8,
+									R: &I{
+										i: 9,
+										R: &I{
+											i: 10,
+											R: &I{
+												i: 11,
+											},
+										},
+									},
+								},
+							},
+						},
+					},
+				},
+			},
+		},
+	}
+	iv := i.I().I().I().I().I().I().I().I().I().I()
+	*iv = *i
+	t.Logf("Example long interface cycle:\n%# v", Formatter(i))
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/pretty/pretty.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/pretty/pretty.go b/newt/Godeps/_workspace/src/github.com/kr/pretty/pretty.go
new file mode 100644
index 0000000..d3df868
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/pretty/pretty.go
@@ -0,0 +1,98 @@
+// Package pretty provides pretty-printing for Go values. This is
+// useful during debugging, to avoid wrapping long output lines in
+// the terminal.
+//
+// It provides a function, Formatter, that can be used with any
+// function that accepts a format string. It also provides
+// convenience wrappers for functions in packages fmt and log.
+package pretty
+
+import (
+	"fmt"
+	"io"
+	"log"
+)
+
+// Errorf is a convenience wrapper for fmt.Errorf.
+//
+// Calling Errorf(f, x, y) is equivalent to
+// fmt.Errorf(f, Formatter(x), Formatter(y)).
+func Errorf(format string, a ...interface{}) error {
+	return fmt.Errorf(format, wrap(a, false)...)
+}
+
+// Fprintf is a convenience wrapper for fmt.Fprintf.
+//
+// Calling Fprintf(w, f, x, y) is equivalent to
+// fmt.Fprintf(w, f, Formatter(x), Formatter(y)).
+func Fprintf(w io.Writer, format string, a ...interface{}) (n int, error error) {
+	return fmt.Fprintf(w, format, wrap(a, false)...)
+}
+
+// Log is a convenience wrapper for log.Printf.
+//
+// Calling Log(x, y) is equivalent to
+// log.Print(Formatter(x), Formatter(y)), but each operand is
+// formatted with "%# v".
+func Log(a ...interface{}) {
+	log.Print(wrap(a, true)...)
+}
+
+// Logf is a convenience wrapper for log.Printf.
+//
+// Calling Logf(f, x, y) is equivalent to
+// log.Printf(f, Formatter(x), Formatter(y)).
+func Logf(format string, a ...interface{}) {
+	log.Printf(format, wrap(a, false)...)
+}
+
+// Logln is a convenience wrapper for log.Printf.
+//
+// Calling Logln(x, y) is equivalent to
+// log.Println(Formatter(x), Formatter(y)), but each operand is
+// formatted with "%# v".
+func Logln(a ...interface{}) {
+	log.Println(wrap(a, true)...)
+}
+
+// Print pretty-prints its operands and writes to standard output.
+//
+// Calling Print(x, y) is equivalent to
+// fmt.Print(Formatter(x), Formatter(y)), but each operand is
+// formatted with "%# v".
+func Print(a ...interface{}) (n int, errno error) {
+	return fmt.Print(wrap(a, true)...)
+}
+
+// Printf is a convenience wrapper for fmt.Printf.
+//
+// Calling Printf(f, x, y) is equivalent to
+// fmt.Printf(f, Formatter(x), Formatter(y)).
+func Printf(format string, a ...interface{}) (n int, errno error) {
+	return fmt.Printf(format, wrap(a, false)...)
+}
+
+// Println pretty-prints its operands and writes to standard output.
+//
+// Calling Print(x, y) is equivalent to
+// fmt.Println(Formatter(x), Formatter(y)), but each operand is
+// formatted with "%# v".
+func Println(a ...interface{}) (n int, errno error) {
+	return fmt.Println(wrap(a, true)...)
+}
+
+// Sprintf is a convenience wrapper for fmt.Sprintf.
+//
+// Calling Sprintf(f, x, y) is equivalent to
+// fmt.Sprintf(f, Formatter(x), Formatter(y)).
+func Sprintf(format string, a ...interface{}) string {
+	return fmt.Sprintf(format, wrap(a, false)...)
+}
+
+func wrap(a []interface{}, force bool) []interface{} {
+	w := make([]interface{}, len(a))
+	for i, x := range a {
+		w[i] = formatter{x: x, force: force}
+	}
+	return w
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/pretty/zero.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/pretty/zero.go b/newt/Godeps/_workspace/src/github.com/kr/pretty/zero.go
new file mode 100644
index 0000000..abb5b6f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/pretty/zero.go
@@ -0,0 +1,41 @@
+package pretty
+
+import (
+	"reflect"
+)
+
+func nonzero(v reflect.Value) bool {
+	switch v.Kind() {
+	case reflect.Bool:
+		return v.Bool()
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		return v.Int() != 0
+	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+		return v.Uint() != 0
+	case reflect.Float32, reflect.Float64:
+		return v.Float() != 0
+	case reflect.Complex64, reflect.Complex128:
+		return v.Complex() != complex(0, 0)
+	case reflect.String:
+		return v.String() != ""
+	case reflect.Struct:
+		for i := 0; i < v.NumField(); i++ {
+			if nonzero(getField(v, i)) {
+				return true
+			}
+		}
+		return false
+	case reflect.Array:
+		for i := 0; i < v.Len(); i++ {
+			if nonzero(v.Index(i)) {
+				return true
+			}
+		}
+		return false
+	case reflect.Map, reflect.Interface, reflect.Slice, reflect.Ptr, reflect.Chan, reflect.Func:
+		return !v.IsNil()
+	case reflect.UnsafePointer:
+		return v.Pointer() != 0
+	}
+	return true
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/License
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/License b/newt/Godeps/_workspace/src/github.com/kr/text/License
new file mode 100644
index 0000000..480a328
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/License
@@ -0,0 +1,19 @@
+Copyright 2012 Keith Rarick
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/Readme
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/Readme b/newt/Godeps/_workspace/src/github.com/kr/text/Readme
new file mode 100644
index 0000000..7e6e7c0
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/Readme
@@ -0,0 +1,3 @@
+This is a Go package for manipulating paragraphs of text.
+
+See http://go.pkgdoc.org/github.com/kr/text for full documentation.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/Readme
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/Readme b/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/Readme
new file mode 100644
index 0000000..1c1f4e6
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/Readme
@@ -0,0 +1,5 @@
+Package colwriter provides a write filter that formats
+input lines in multiple columns.
+
+The package is a straightforward translation from
+/src/cmd/draw/mc.c in Plan 9 from User Space.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/column.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/column.go b/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/column.go
new file mode 100644
index 0000000..7302ce9
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/column.go
@@ -0,0 +1,147 @@
+// Package colwriter provides a write filter that formats
+// input lines in multiple columns.
+//
+// The package is a straightforward translation from
+// /src/cmd/draw/mc.c in Plan 9 from User Space.
+package colwriter
+
+import (
+	"bytes"
+	"io"
+	"unicode/utf8"
+)
+
+const (
+	tab = 4
+)
+
+const (
+	// Print each input line ending in a colon ':' separately.
+	BreakOnColon uint = 1 << iota
+)
+
+// A Writer is a filter that arranges input lines in as many columns as will
+// fit in its width. Tab '\t' chars in the input are translated to sequences
+// of spaces ending at multiples of 4 positions.
+//
+// If BreakOnColon is set, each input line ending in a colon ':' is written
+// separately.
+//
+// The Writer assumes that all Unicode code points have the same width; this
+// may not be true in some fonts.
+type Writer struct {
+	w     io.Writer
+	buf   []byte
+	width int
+	flag  uint
+}
+
+// NewWriter allocates and initializes a new Writer writing to w.
+// Parameter width controls the total number of characters on each line
+// across all columns.
+func NewWriter(w io.Writer, width int, flag uint) *Writer {
+	return &Writer{
+		w:     w,
+		width: width,
+		flag:  flag,
+	}
+}
+
+// Write writes p to the writer w. The only errors returned are ones
+// encountered while writing to the underlying output stream.
+func (w *Writer) Write(p []byte) (n int, err error) {
+	var linelen int
+	var lastWasColon bool
+	for i, c := range p {
+		w.buf = append(w.buf, c)
+		linelen++
+		if c == '\t' {
+			w.buf[len(w.buf)-1] = ' '
+			for linelen%tab != 0 {
+				w.buf = append(w.buf, ' ')
+				linelen++
+			}
+		}
+		if w.flag&BreakOnColon != 0 && c == ':' {
+			lastWasColon = true
+		} else if lastWasColon {
+			if c == '\n' {
+				pos := bytes.LastIndex(w.buf[:len(w.buf)-1], []byte{'\n'})
+				if pos < 0 {
+					pos = 0
+				}
+				line := w.buf[pos:]
+				w.buf = w.buf[:pos]
+				if err = w.columnate(); err != nil {
+					if len(line) < i {
+						return i - len(line), err
+					}
+					return 0, err
+				}
+				if n, err := w.w.Write(line); err != nil {
+					if r := len(line) - n; r < i {
+						return i - r, err
+					}
+					return 0, err
+				}
+			}
+			lastWasColon = false
+		}
+		if c == '\n' {
+			linelen = 0
+		}
+	}
+	return len(p), nil
+}
+
+// Flush should be called after the last call to Write to ensure that any data
+// buffered in the Writer is written to output.
+func (w *Writer) Flush() error {
+	return w.columnate()
+}
+
+func (w *Writer) columnate() error {
+	words := bytes.Split(w.buf, []byte{'\n'})
+	w.buf = nil
+	if len(words[len(words)-1]) == 0 {
+		words = words[:len(words)-1]
+	}
+	maxwidth := 0
+	for _, wd := range words {
+		if n := utf8.RuneCount(wd); n > maxwidth {
+			maxwidth = n
+		}
+	}
+	maxwidth++ // space char
+	wordsPerLine := w.width / maxwidth
+	if wordsPerLine <= 0 {
+		wordsPerLine = 1
+	}
+	nlines := (len(words) + wordsPerLine - 1) / wordsPerLine
+	for i := 0; i < nlines; i++ {
+		col := 0
+		endcol := 0
+		for j := i; j < len(words); j += nlines {
+			endcol += maxwidth
+			_, err := w.w.Write(words[j])
+			if err != nil {
+				return err
+			}
+			col += utf8.RuneCount(words[j])
+			if j+nlines < len(words) {
+				for col < endcol {
+					_, err := w.w.Write([]byte{' '})
+					if err != nil {
+						return err
+					}
+					col++
+				}
+			}
+		}
+		_, err := w.w.Write([]byte{'\n'})
+		if err != nil {
+			return err
+		}
+	}
+	return nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/column_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/column_test.go b/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/column_test.go
new file mode 100644
index 0000000..ce388f5
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/colwriter/column_test.go
@@ -0,0 +1,90 @@
+package colwriter
+
+import (
+	"bytes"
+	"testing"
+)
+
+var src = `
+.git
+.gitignore
+.godir
+Procfile:
+README.md
+api.go
+apps.go
+auth.go
+darwin.go
+data.go
+dyno.go:
+env.go
+git.go
+help.go
+hkdist
+linux.go
+ls.go
+main.go
+plugin.go
+run.go
+scale.go
+ssh.go
+tail.go
+term
+unix.go
+update.go
+version.go
+windows.go
+`[1:]
+
+var tests = []struct {
+	wid  int
+	flag uint
+	src  string
+	want string
+}{
+	{80, 0, "", ""},
+	{80, 0, src, `
+.git       README.md  darwin.go  git.go     ls.go      scale.go   unix.go
+.gitignore api.go     data.go    help.go    main.go    ssh.go     update.go
+.godir     apps.go    dyno.go:   hkdist     plugin.go  tail.go    version.go
+Procfile:  auth.go    env.go     linux.go   run.go     term       windows.go
+`[1:]},
+	{80, BreakOnColon, src, `
+.git       .gitignore .godir
+
+Procfile:
+README.md api.go    apps.go   auth.go   darwin.go data.go
+
+dyno.go:
+env.go     hkdist     main.go    scale.go   term       version.go
+git.go     linux.go   plugin.go  ssh.go     unix.go    windows.go
+help.go    ls.go      run.go     tail.go    update.go
+`[1:]},
+	{20, 0, `
+Hello
+Γειά σου
+안녕
+今日は
+`[1:], `
+Hello    안녕
+Γειά σου 今日は
+`[1:]},
+}
+
+func TestWriter(t *testing.T) {
+	for _, test := range tests {
+		b := new(bytes.Buffer)
+		w := NewWriter(b, test.wid, test.flag)
+		if _, err := w.Write([]byte(test.src)); err != nil {
+			t.Error(err)
+		}
+		if err := w.Flush(); err != nil {
+			t.Error(err)
+		}
+		if g := b.String(); test.want != g {
+			t.Log("\n" + test.want)
+			t.Log("\n" + g)
+			t.Errorf("%q != %q", test.want, g)
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/kr/text/doc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/kr/text/doc.go b/newt/Godeps/_workspace/src/github.com/kr/text/doc.go
new file mode 100644
index 0000000..cf4c198
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/kr/text/doc.go
@@ -0,0 +1,3 @@
+// Package text provides rudimentary functions for manipulating text in
+// paragraphs.
+package text



[39/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/easy.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/easy.go b/Godeps/_workspace/src/github.com/andelf/go-curl/easy.go
deleted file mode 100644
index 4593590..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/easy.go
+++ /dev/null
@@ -1,495 +0,0 @@
-package curl
-
-/*
-#include <stdlib.h>
-#include <curl/curl.h>
-#include "callback.h"
-#include "compat.h"
-
-static CURLcode curl_easy_setopt_long(CURL *handle, CURLoption option, long parameter) {
-  return curl_easy_setopt(handle, option, parameter);
-}
-static CURLcode curl_easy_setopt_string(CURL *handle, CURLoption option, char *parameter) {
-  return curl_easy_setopt(handle, option, parameter);
-}
-static CURLcode curl_easy_setopt_slist(CURL *handle, CURLoption option, struct curl_slist *parameter) {
-  return curl_easy_setopt(handle, option, parameter);
-}
-static CURLcode curl_easy_setopt_pointer(CURL *handle, CURLoption option, void *parameter) {
-  return curl_easy_setopt(handle, option, parameter);
-}
-static CURLcode curl_easy_setopt_off_t(CURL *handle, CURLoption option, off_t parameter) {
-  return curl_easy_setopt(handle, option, parameter);
-}
-
-static CURLcode curl_easy_getinfo_string(CURL *curl, CURLINFO info, char **p) {
- return curl_easy_getinfo(curl, info, p);
-}
-static CURLcode curl_easy_getinfo_long(CURL *curl, CURLINFO info, long *p) {
- return curl_easy_getinfo(curl, info, p);
-}
-static CURLcode curl_easy_getinfo_double(CURL *curl, CURLINFO info, double *p) {
- return curl_easy_getinfo(curl, info, p);
-}
-static CURLcode curl_easy_getinfo_slist(CURL *curl, CURLINFO info, struct curl_slist **p) {
- return curl_easy_getinfo(curl, info, p);
-}
-
-static CURLFORMcode curl_formadd_name_content_length(
-    struct curl_httppost **httppost, struct curl_httppost **last_post, char *name, char *content, int length) {
-    return curl_formadd(httppost, last_post,
-                        CURLFORM_COPYNAME, name,
-                        CURLFORM_COPYCONTENTS, content,
-                        CURLFORM_CONTENTSLENGTH, length, CURLFORM_END);
-}
-static CURLFORMcode curl_formadd_name_content_length_type(
-    struct curl_httppost **httppost, struct curl_httppost **last_post, char *name, char *content, int length, char *type) {
-    return curl_formadd(httppost, last_post,
-                        CURLFORM_COPYNAME, name,
-                        CURLFORM_COPYCONTENTS, content,
-                        CURLFORM_CONTENTSLENGTH, length,
-                        CURLFORM_CONTENTTYPE, type, CURLFORM_END);
-}
-static CURLFORMcode curl_formadd_name_file_type(
-    struct curl_httppost **httppost, struct curl_httppost **last_post, char *name, char *filename, char *type) {
-    return curl_formadd(httppost, last_post,
-                        CURLFORM_COPYNAME, name,
-                        CURLFORM_FILE, filename,
-                        CURLFORM_CONTENTTYPE, type, CURLFORM_END);
-}
- // TODO: support multi file
-
-*/
-import "C"
-
-import (
-	"fmt"
-	"mime"
-	"path"
-	"reflect"
-	"unsafe"
-)
-
-type CurlInfo C.CURLINFO
-type CurlError C.CURLcode
-
-type CurlString *C.char
-
-func NewCurlString(s string) CurlString {
-	return CurlString(unsafe.Pointer(C.CString(s)))
-}
-
-func FreeCurlString(s CurlString) {
-	C.free(unsafe.Pointer(s))
-}
-
-func (e CurlError) Error() string {
-	// ret is const char*, no need to free
-	ret := C.curl_easy_strerror(C.CURLcode(e))
-	return fmt.Sprintf("curl: %s", C.GoString(ret))
-}
-
-func newCurlError(errno C.CURLcode) error {
-	if errno == C.CURLE_OK { // if nothing wrong
-		return nil
-	}
-	return CurlError(errno)
-}
-
-// curl_easy interface
-type CURL struct {
-	handle unsafe.Pointer
-	// callback functions, bool ret means ok or not
-	headerFunction, writeFunction *func([]byte, interface{}) bool
-	readFunction                  *func([]byte, interface{}) int // return num of bytes writed to buf
-	progressFunction              *func(float64, float64, float64, float64, interface{}) bool
-	fnmatchFunction               *func(string, string, interface{}) int
-	// callback datas
-	headerData, writeData, readData, progressData, fnmatchData *interface{}
-	// list of C allocs
-	mallocAllocs []*C.char
-}
-
-// curl_easy_init - Start a libcurl easy session
-func EasyInit() *CURL {
-	p := C.curl_easy_init()
-	return &CURL{handle: p, mallocAllocs: make([]*C.char, 0)} // other field defaults to nil
-}
-
-// curl_easy_duphandle - Clone a libcurl session handle
-func (curl *CURL) Duphandle() *CURL {
-	p := curl.handle
-	return &CURL{handle: C.curl_easy_duphandle(p)}
-}
-
-// curl_easy_cleanup - End a libcurl easy session
-func (curl *CURL) Cleanup() {
-	p := curl.handle
-	C.curl_easy_cleanup(p)
-	curl.MallocFreeAfter(0)
-}
-
-// curl_easy_setopt - set options for a curl easy handle
-// WARNING: a function pointer is &fun, but function addr is reflect.ValueOf(fun).Pointer()
-func (curl *CURL) Setopt(opt int, param interface{}) error {
-	p := curl.handle
-	if param == nil {
-		// NOTE: some option will crash program when got a nil param
-		return newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), nil))
-	}
-	switch {
-	// not really set
-	case opt == OPT_READDATA: // OPT_INFILE
-		curl.readData = &param
-		return nil
-	case opt == OPT_PROGRESSDATA:
-		curl.progressData = &param
-		return nil
-	case opt == OPT_HEADERDATA: // also known as OPT_WRITEHEADER
-		curl.headerData = &param
-		return nil
-	case opt == OPT_WRITEDATA: // OPT_FILE
-		curl.writeData = &param
-		return nil
-
-	case opt == OPT_READFUNCTION:
-		fun := param.(func([]byte, interface{}) int)
-		curl.readFunction = &fun
-
-		ptr := C.return_read_function()
-		if err := newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), ptr)); err == nil {
-			return newCurlError(C.curl_easy_setopt_pointer(p, OPT_READDATA,
-				unsafe.Pointer(reflect.ValueOf(curl).Pointer())))
-		} else {
-			return err
-		}
-
-	case opt == OPT_PROGRESSFUNCTION:
-		fun := param.(func(float64, float64, float64, float64, interface{}) bool)
-		curl.progressFunction = &fun
-
-		ptr := C.return_progress_function()
-		if err := newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), ptr)); err == nil {
-			return newCurlError(C.curl_easy_setopt_pointer(p, OPT_PROGRESSDATA,
-				unsafe.Pointer(reflect.ValueOf(curl).Pointer())))
-		} else {
-			return err
-		}
-
-	case opt == OPT_HEADERFUNCTION:
-		fun := param.(func([]byte, interface{}) bool)
-		curl.headerFunction = &fun
-
-		ptr := C.return_header_function()
-		if err := newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), ptr)); err == nil {
-			return newCurlError(C.curl_easy_setopt_pointer(p, OPT_HEADERDATA,
-				unsafe.Pointer(reflect.ValueOf(curl).Pointer())))
-		} else {
-			return err
-		}
-
-	case opt == OPT_WRITEFUNCTION:
-		fun := param.(func([]byte, interface{}) bool)
-		curl.writeFunction = &fun
-
-		ptr := C.return_write_function()
-		if err := newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), ptr)); err == nil {
-			return newCurlError(C.curl_easy_setopt_pointer(p, OPT_WRITEDATA,
-				unsafe.Pointer(reflect.ValueOf(curl).Pointer())))
-		} else {
-			return err
-		}
-
-	// for OPT_HTTPPOST, use struct Form
-	case opt == OPT_HTTPPOST:
-		post := param.(*Form)
-		ptr := post.head
-		return newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), unsafe.Pointer(ptr)))
-
-	case opt >= C.CURLOPTTYPE_OFF_T:
-		val := C.off_t(0)
-		switch t := param.(type) {
-		case int:
-			val = C.off_t(t)
-		case uint64:
-			val = C.off_t(t)
-		default:
-			panic("OFF_T conversion not supported")
-		}
-		return newCurlError(C.curl_easy_setopt_off_t(p, C.CURLoption(opt), val))
-
-	case opt >= C.CURLOPTTYPE_FUNCTIONPOINT:
-		// function pointer
-		panic("function pointer not implemented yet!")
-
-	case opt >= C.CURLOPTTYPE_OBJECTPOINT:
-		switch t := param.(type) {
-		case string:
-			ptr := C.CString(t)
-			curl.mallocAddPtr(ptr)
-			return newCurlError(C.curl_easy_setopt_string(p, C.CURLoption(opt), ptr))
-		case CurlString:
-			ptr := (*C.char)(t)
-			return newCurlError(C.curl_easy_setopt_string(p, C.CURLoption(opt), ptr))
-		case []string:
-			if len(t) > 0 {
-				ptr := C.CString(t[0])
-				curl.mallocAddPtr(ptr)
-				a_slist := C.curl_slist_append(nil, ptr)
-				for _, s := range t[1:] {
-					ptr := C.CString(s)
-					curl.mallocAddPtr(ptr)
-					a_slist = C.curl_slist_append(a_slist, ptr)
-				}
-				return newCurlError(C.curl_easy_setopt_slist(p, C.CURLoption(opt), a_slist))
-			} else {
-				return newCurlError(C.curl_easy_setopt_slist(p, C.CURLoption(opt), nil))
-			}
-		case []CurlString:
-			if len(t) > 0 {
-				ptr := (*C.char)(t[0])
-				a_slist := C.curl_slist_append(nil, ptr)
-				for _, s := range t[1:] {
-					ptr := (*C.char)(s)
-					a_slist = C.curl_slist_append(a_slist, ptr)
-				}
-				return newCurlError(C.curl_easy_setopt_slist(p, C.CURLoption(opt), a_slist))
-			} else {
-				return newCurlError(C.curl_easy_setopt_slist(p, C.CURLoption(opt), nil))
-			}
-		default:
-			// It panics if v's Kind is not Chan, Func, Map, Ptr, Slice, or UnsafePointer.
-			// val := reflect.ValueOf(param)
-			//fmt.Printf("DEBUG(Setopt): param=%x\n", val.Pointer())
-			//println("DEBUG can addr =", val.Pointer(), "opt=", opt)
-			// pass a pointer to GoInterface
-			return newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt),
-				unsafe.Pointer(&param)))
-		}
-	case opt >= C.CURLOPTTYPE_LONG:
-		val := C.long(0)
-		switch t := param.(type) {
-		case int:
-			val = C.long(t)
-		case bool:
-			if t {
-				val = 1
-			}
-		case int64:
-			val = C.long(t)
-		case int32:
-			val = C.long(t)
-		default:
-			panic("not supported converstion to c long")
-		}
-		return newCurlError(C.curl_easy_setopt_long(p, C.CURLoption(opt), val))
-	}
-	panic("opt param error!")
-}
-
-// curl_easy_send - sends raw data over an "easy" connection
-func (curl *CURL) Send(buffer []byte) (int, error) {
-	p := curl.handle
-	buflen := len(buffer)
-	n := C.size_t(0)
-	ret := C.curl_easy_send(p, unsafe.Pointer(&buffer[0]), C.size_t(buflen), &n)
-	return int(n), newCurlError(ret)
-}
-
-// curl_easy_recv - receives raw data on an "easy" connection
-func (curl *CURL) Recv(buffer []byte) (int, error) {
-	p := curl.handle
-	buflen := len(buffer)
-	buf := C.CString(string(buffer))
-	n := C.size_t(0)
-	ret := C.curl_easy_recv(p, unsafe.Pointer(buf), C.size_t(buflen), &n)
-	return copy(buffer, C.GoStringN(buf, C.int(n))), newCurlError(ret)
-}
-
-// curl_easy_perform - Perform a file transfer
-func (curl *CURL) Perform() error {
-	p := curl.handle
-	return newCurlError(C.curl_easy_perform(p))
-}
-
-// curl_easy_pause - pause and unpause a connection
-func (curl *CURL) Pause(bitmask int) error {
-	p := curl.handle
-	return newCurlError(C.curl_easy_pause(p, C.int(bitmask)))
-}
-
-// curl_easy_reset - reset all options of a libcurl session handle
-func (curl *CURL) Reset() {
-	p := curl.handle
-	C.curl_easy_reset(p)
-}
-
-// curl_easy_escape - URL encodes the given string
-func (curl *CURL) Escape(url string) string {
-	p := curl.handle
-	oldUrl := C.CString(url)
-	defer C.free(unsafe.Pointer(oldUrl))
-	newUrl := C.curl_easy_escape(p, oldUrl, 0)
-	defer C.curl_free(unsafe.Pointer(newUrl))
-	return C.GoString(newUrl)
-}
-
-// curl_easy_unescape - URL decodes the given string
-func (curl *CURL) Unescape(url string) string {
-	p := curl.handle
-	oldUrl := C.CString(url)
-	outlength := C.int(0)
-	defer C.free(unsafe.Pointer(oldUrl))
-	// If outlength is non-NULL, the function will write the length of the
-	// returned string in  the  integer  it  points  to.  This allows an
-	// escaped string containing %00 to still get used properly after unescaping.
-	newUrl := C.curl_easy_unescape(p, oldUrl, 0, &outlength)
-	defer C.curl_free(unsafe.Pointer(newUrl))
-	return C.GoStringN(newUrl, outlength)
-}
-
-// curl_easy_getinfo - extract information from a curl handle
-func (curl *CURL) Getinfo(info CurlInfo) (ret interface{}, err error) {
-	p := curl.handle
-	cInfo := C.CURLINFO(info)
-	switch cInfo & C.CURLINFO_TYPEMASK {
-	case C.CURLINFO_STRING:
-		a_string := C.CString("")
-		defer C.free(unsafe.Pointer(a_string))
-		err := newCurlError(C.curl_easy_getinfo_string(p, cInfo, &a_string))
-		ret := C.GoString(a_string)
-		debugf("Getinfo %s", ret)
-		return ret, err
-	case C.CURLINFO_LONG:
-		a_long := C.long(-1)
-		err := newCurlError(C.curl_easy_getinfo_long(p, cInfo, &a_long))
-		ret := int(a_long)
-		debugf("Getinfo %s", ret)
-		return ret, err
-	case C.CURLINFO_DOUBLE:
-		a_double := C.double(0.0)
-		err := newCurlError(C.curl_easy_getinfo_double(p, cInfo, &a_double))
-		ret := float64(a_double)
-		debugf("Getinfo %s", ret)
-		return ret, err
-	case C.CURLINFO_SLIST:
-		a_ptr_slist := new(_Ctype_struct_curl_slist)
-		err := newCurlError(C.curl_easy_getinfo_slist(p, cInfo, &a_ptr_slist))
-		ret := []string{}
-		for a_ptr_slist != nil {
-			debugf("Getinfo %s %v", C.GoString(a_ptr_slist.data), a_ptr_slist.next)
-			ret = append(ret, C.GoString(a_ptr_slist.data))
-			a_ptr_slist = a_ptr_slist.next
-		}
-		return ret, err
-	default:
-		panic("error calling Getinfo\n")
-	}
-	panic("not implemented yet!")
-	return nil, nil
-}
-
-func (curl *CURL) GetHandle() unsafe.Pointer {
-	return curl.handle
-}
-
-func (curl *CURL) MallocGetPos() int {
-	return len(curl.mallocAllocs)
-}
-
-func (curl *CURL) MallocFreeAfter(from int) {
-	l := len(curl.mallocAllocs)
-	for idx := from; idx < l; idx++ {
-		C.free(unsafe.Pointer(curl.mallocAllocs[idx]))
-		curl.mallocAllocs[idx] = nil
-	}
-	curl.mallocAllocs = curl.mallocAllocs[0:from]
-}
-
-func (curl *CURL) mallocAddPtr(ptr *C.char) {
-	curl.mallocAllocs = append(curl.mallocAllocs, ptr)
-}
-
-// A multipart/formdata HTTP POST form
-type Form struct {
-	head, last *C.struct_curl_httppost
-}
-
-func NewForm() *Form {
-	return &Form{}
-}
-
-func (form *Form) Add(name string, content interface{}) error {
-	head, last := form.head, form.last
-	namestr := C.CString(name)
-	defer C.free(unsafe.Pointer(namestr))
-	var (
-		buffer *C.char
-		length C.int
-	)
-	switch t := content.(type) {
-	case string:
-		buffer = C.CString(t)
-		length = C.int(len(t))
-	case []byte:
-		buffer = C.CString(string(t))
-		length = C.int(len(t))
-	default:
-		panic("not implemented")
-	}
-	defer C.free(unsafe.Pointer(buffer))
-	C.curl_formadd_name_content_length(&head, &last, namestr, buffer, length)
-	form.head, form.last = head, last
-	return nil
-}
-
-func (form *Form) AddWithType(name string, content interface{}, content_type string) error {
-	head, last := form.head, form.last
-	namestr := C.CString(name)
-	typestr := C.CString(content_type)
-	defer C.free(unsafe.Pointer(namestr))
-	defer C.free(unsafe.Pointer(typestr))
-	var (
-		buffer *C.char
-		length C.int
-	)
-	switch t := content.(type) {
-	case string:
-		buffer = C.CString(t)
-		length = C.int(len(t))
-	case []byte:
-		buffer = C.CString(string(t))
-		length = C.int(len(t))
-	default:
-		panic("not implemented")
-	}
-	defer C.free(unsafe.Pointer(buffer))
-	C.curl_formadd_name_content_length_type(&head, &last, namestr, buffer, length, typestr)
-	form.head, form.last = head, last
-	return nil
-}
-
-func (form *Form) AddFile(name, filename string) error {
-	head, last := form.head, form.last
-	namestr := C.CString(name)
-	pathstr := C.CString(filename)
-	typestr := C.CString(guessType(filename))
-	defer C.free(unsafe.Pointer(namestr))
-	defer C.free(unsafe.Pointer(pathstr))
-	defer C.free(unsafe.Pointer(typestr))
-	C.curl_formadd_name_file_type(&head, &last, namestr, pathstr, typestr)
-	form.head, form.last = head, last
-	return nil
-}
-
-func (form *Form) AddFromFile(name, filename string) {
-}
-
-func guessType(filename string) string {
-	ext := path.Ext(filename)
-	file_type := mime.TypeByExtension(ext)
-	if file_type == "" {
-		return "application/octet-stream"
-	}
-	return file_type
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/easy_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/easy_test.go b/Godeps/_workspace/src/github.com/andelf/go-curl/easy_test.go
deleted file mode 100644
index 071245c..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/easy_test.go
+++ /dev/null
@@ -1,61 +0,0 @@
-package curl
-
-import (
-	"fmt"
-	"net/http"
-	"net/http/httptest"
-	"testing"
-)
-
-func setupTestServer(serverContent string) *httptest.Server {
-	return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-		fmt.Fprintln(w, serverContent)
-	}))
-}
-
-func TestEasyInterface(t *testing.T) {
-	ts := setupTestServer("")
-	defer ts.Close()
-
-	easy := EasyInit()
-	defer easy.Cleanup()
-
-	easy.Setopt(OPT_URL, ts.URL)
-	if err := easy.Perform(); err != nil {
-		t.Fatal(err)
-	}
-}
-
-func TestCallbackFunction(t *testing.T) {
-	serverContent := "A random string"
-	ts := setupTestServer(serverContent)
-	defer ts.Close()
-
-	easy := EasyInit()
-	defer easy.Cleanup()
-
-	easy.Setopt(OPT_URL, ts.URL)
-	easy.Setopt(OPT_WRITEFUNCTION, func(buf []byte, userdata interface{}) bool {
-		result := string(buf)
-		expected := serverContent + "\n"
-		if result != expected {
-			t.Errorf("output should be %q and is %q.", expected, result)
-		}
-		return true
-	})
-	if err := easy.Perform(); err != nil {
-		t.Fatal(err)
-	}
-}
-
-func TestEscape(t *testing.T) {
-	easy := EasyInit()
-	defer easy.Cleanup()
-
-	payload := `payload={"msg": "First line\nSecond Line"}`
-	expected := `payload%3D%7B%22msg%22%3A%20%22First%20line%5CnSecond%20Line%22%7D`
-	result := easy.Escape(payload)
-	if result != expected {
-		t.Errorf("escaped output should be %q and is %q.", expected, result)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/channal_callback.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/channal_callback.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/channal_callback.go
deleted file mode 100644
index c9c93f6..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/channal_callback.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package main
-
-import (
-	curl "github.com/andelf/go-curl"
-	"time"
-)
-
-func write_data(ptr []byte, userdata interface{}) bool {
-	ch, ok := userdata.(chan string)
-	if ok {
-		ch <- string(ptr)
-		return true // ok
-	} else {
-		println("ERROR!")
-		return false
-	}
-	return false
-}
-
-func main() {
-	curl.GlobalInit(curl.GLOBAL_ALL)
-
-	// init the curl session
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-
-	easy.Setopt(curl.OPT_URL, "http://cn.bing.com/")
-
-	easy.Setopt(curl.OPT_WRITEFUNCTION, write_data)
-
-	// make a chan
-	ch := make(chan string, 100)
-	go func(ch chan string) {
-		for {
-			data := <-ch
-			println("Got data size=", len(data))
-		}
-	}(ch)
-
-	easy.Setopt(curl.OPT_WRITEDATA, ch)
-
-	if err := easy.Perform(); err != nil {
-		println("ERROR: ", err.Error())
-	}
-
-	time.Sleep(10000) // wait gorotine
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/ftpget.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/ftpget.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/ftpget.go
deleted file mode 100644
index 1c1502d..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/ftpget.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package main
-
-import (
-	curl "github.com/andelf/go-curl"
-	"os"
-)
-
-const filename = "README"
-
-func main() {
-	curl.GlobalInit(curl.GLOBAL_DEFAULT)
-	defer curl.GlobalCleanup()
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-
-	easy.Setopt(curl.OPT_URL, "ftp://ftp.gnu.org/README")
-
-	// define our callback use lambda function
-	easy.Setopt(curl.OPT_WRITEFUNCTION, func(ptr []byte, userdata interface{}) bool {
-		file := userdata.(*os.File)
-		if _, err := file.Write(ptr); err != nil {
-			return false
-		}
-		return true
-	})
-
-	fp, _ := os.OpenFile(filename, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0777)
-	defer fp.Close() // defer close
-
-	easy.Setopt(curl.OPT_WRITEDATA, fp)
-
-	easy.Setopt(curl.OPT_VERBOSE, true)
-
-	if err := easy.Perform(); err != nil {
-		println("ERROR", err.Error())
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/https.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/https.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/https.go
deleted file mode 100644
index 0a4e031..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/https.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package main
-
-import (
-	curl "github.com/andelf/go-curl"
-)
-
-func main() {
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-	if easy != nil {
-		easy.Setopt(curl.OPT_URL, "https://mail.google.com/")
-		// skip_peer_verification
-		easy.Setopt(curl.OPT_SSL_VERIFYPEER, false) // 0 is ok
-
-		easy.Perform()
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/misc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/misc.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/misc.go
deleted file mode 100644
index d66d2b7..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/misc.go
+++ /dev/null
@@ -1,104 +0,0 @@
-package main
-
-import (
-	"fmt"
-	curl "github.com/andelf/go-curl"
-	"os"
-	"reflect"
-)
-
-const endl = "\n"
-
-func main() {
-	println("DEBUG chdir=>", os.Chdir("/sadf"))
-	ret := curl.EasyInit()
-	defer ret.Cleanup()
-	print("init =>", ret, " ", reflect.TypeOf(ret).String(), endl)
-	ret = ret.Duphandle()
-	defer ret.Cleanup()
-
-	print("dup =>", ret, " ", reflect.TypeOf(ret).String(), endl)
-	print("global init =>", curl.GlobalInit(curl.GLOBAL_ALL), endl)
-	print("version =>", curl.Version(), endl)
-	// debug
-	//print("set verbose =>", ret.Setopt(curl.OPT_VERBOSE, true), endl)
-
-	//print("set header =>", ret.Setopt(curl.OPT_HEADER, true), endl)
-
-	// auto calculate port
-	// print("set port =>", ret.EasySetopt(curl.OPT_PORT, 6060), endl)
-	fmt.Printf("XXXX debug setopt %#v \n", ret.Setopt(30000, 19).Error())
-
-	print("set timeout =>", ret.Setopt(curl.OPT_TIMEOUT, 20), endl)
-
-	//print("set post size =>", ret.Setopt(curl.OPT_POSTFIELDSIZE, 10), endl)
-	if ret.Setopt(curl.OPT_URL, "http://www.baidu.com:8000/") != nil {
-		println("set url ok!")
-	}
-	//print("set url =>", ret.Setopt(curl.OPT_URL, "http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/104547/chrome-linux.zip"), endl)
-
-	print("set user_agent =>", ret.Setopt(curl.OPT_USERAGENT, "go-curl v0.0.1") == nil, endl)
-	// add to DNS cache
-	print("set resolve =>", ret.Setopt(curl.OPT_RESOLVE, []string{"www.baidu.com:8000:127.0.0.1"}) == nil, endl)
-	// ret.EasyReset()  clean seted
-
-	// currently not finished!
-	//
-	fooTest := func(buf []byte, userdata interface{}) bool {
-		// buf := ptr.([]byte)
-		println("size=>", len(buf))
-		println("DEBUG(in callback)", buf, userdata)
-		println("data = >", string(buf))
-		return true
-	}
-
-	ret.Setopt(curl.OPT_WRITEFUNCTION, fooTest) // curl.CallbackWriteFunction(fooTest))
-	println("set opt!")
-	// for test only
-
-	code := ret.Perform()
-	//	dump.Dump(code)
-	fmt.Printf("code -> %v\n", code)
-
-	println("================================")
-	print("pause =>", ret.Pause(curl.PAUSE_ALL), endl)
-
-	print("escape =>", ret.Escape("http://baidu.com/"), endl)
-	print("unescape =>", ret.Unescape("http://baidu.com/-%00-%5c"), endl)
-
-	print("unescape lenght =>", len(ret.Unescape("http://baidu.com/-%00-%5c")), endl)
-	// print("version info data =>", curl.VersionInfo(1), endl)
-	ver := curl.VersionInfo(curl.VERSION_NOW)
-	fmt.Printf("VersionInfo: Age: %d, Version:%s, Host:%s, Features:%d, SslVer: %s, LibzV: %s, ssh: %s\n",
-		ver.Age, ver.Version, ver.Host, ver.Features, ver.SslVersion, ver.LibzVersion, ver.LibsshVersion)
-
-	print("Protocols:")
-	for _, p := range ver.Protocols {
-		print(p, ", ")
-	}
-	print(endl)
-	println(curl.Getdate("20111002 15:05:58 +0800").String())
-	ret.Getinfo(curl.INFO_EFFECTIVE_URL)
-	ret.Getinfo(curl.INFO_RESPONSE_CODE)
-
-	ret.Getinfo(curl.INFO_FILETIME)
-	ret.Getinfo(curl.INFO_SSL_ENGINES)
-
-	ret.Getinfo(curl.INFO_TOTAL_TIME)
-
-	println("================================")
-
-	// ret.Getinfo(curl.INFO_SSL_ENGINES)
-
-	/*	mret := curl.MultiInit()
-		mret.AddHandle(ret)			// works
-		defer mret.Cleanup()
-		if ok, handles := mret.Perform(); ok == curl.OK {
-			fmt.Printf("ok=%s, handles=%d\n", ok, handles)
-		} else {
-			fmt.Printf("error calling multi\n")
-		}
-	*/
-	println("================================")
-	//println(curl.GlobalInit(curl.GLOBAL_SSL))
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_and_select.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_and_select.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_and_select.go
deleted file mode 100644
index 950da36..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_and_select.go
+++ /dev/null
@@ -1,101 +0,0 @@
-package main
-
-/*
-#include <stdlib.h>
-#include <sys/select.h>
-static void _FD_ZERO(void *set) {
-    FD_ZERO((fd_set*)set);
-}
-static void _FD_SET(int sysfd, void *set) {
-    FD_SET(sysfd, (fd_set*)set);
-}
-static int _FD_ISSET (int sysfd, void *set) {
-    return FD_ISSET(sysfd, (fd_set*)set);
-}
-*/
-import "C"
-
-import (
-	curl "github.com/Pyrrvs/go-curl"
-	"syscall"
-	"unsafe"
-	"fmt"
-)
-
-func FD_ZERO(set *syscall.FdSet) {
-    s := unsafe.Pointer(set)
-    C._FD_ZERO(s)
-}
-
-func FD_SET(sysfd int, set *syscall.FdSet) {
-    s := unsafe.Pointer(set)
-    fd := C.int(sysfd)
-    C._FD_SET(fd, s)
-}
-
-func FD_ISSET(sysfd int, set *syscall.FdSet) bool {
-    s := unsafe.Pointer(set)
-    fd := C.int(sysfd)
-    return C._FD_ISSET(fd, s) != 0
-}
-
-func main() {
-    var (
-            rset, wset, eset syscall.FdSet
-            still_running, curl_timeout int = 0, 0
-            err error
-    )
-
-	ch1 := curl.EasyInit()
-	ch2 := curl.EasyInit()
-
-	ch1.Setopt(curl.OPT_URL, "http://www.163.com")
-	ch1.Setopt(curl.OPT_HEADER, 0)
-	ch1.Setopt(curl.OPT_VERBOSE, true)
-	ch2.Setopt(curl.OPT_URL, "http://www.baidu.com")
-	ch2.Setopt(curl.OPT_HEADER, 0)
-	ch2.Setopt(curl.OPT_VERBOSE, true)
-
-	mh := curl.MultiInit()
-
-	mh.AddHandle(ch1)
-	mh.AddHandle(ch2)
-
-	for {
-        FD_ZERO(&rset)
-        FD_ZERO(&wset)
-        FD_ZERO(&eset)
-
-        timeout := syscall.Timeval{Sec:1, Usec:0}
-       	curl_timeout, err = mh.Timeout()
-       	if err != nil {
-       		fmt.Printf("Error multi_timeout: %s\n", err)
-       	}
-       	if curl_timeout >= 0 {
-       		timeout.Sec = int64(curl_timeout / 1000)
-       		if timeout.Sec > 1 {
-       			timeout.Sec = 1
-       		} else {
-       			timeout.Usec = int64((curl_timeout % 1000)) * 1000
-       		}
-       	}
-
-	max_fd, err := mh.Fdset(&rset, &wset, &eset)
-        if err != nil {
-            fmt.Printf("Error FDSET: %s\n", err)
-        }
-
-        _, err = syscall.Select(int(max_fd + 1), &rset, &wset, &eset, &timeout)
-        if err != nil {
-        	fmt.Printf("Error select: %s\n", err)
-        } else {
-        	still_running, err = mh.Perform()
-        	if still_running > 0 {
-        		fmt.Printf("Still running: %d\n", still_running)
-        	} else {
-        		break
-        	}
-        }
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_sample.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_sample.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_sample.go
deleted file mode 100644
index a0563a8..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_sample.go
+++ /dev/null
@@ -1,36 +0,0 @@
-
-package main
-
-import (
-	curl "github.com/andelf/go-curl"
-	"time"
-)
-
-func main() {
-
-	ch1 := curl.EasyInit()
-	ch2 := curl.EasyInit()
-
-	ch1.Setopt(curl.OPT_URL, "http://www.163.com")
-	ch1.Setopt(curl.OPT_HEADER, 0)
-	ch1.Setopt(curl.OPT_VERBOSE, true)
-	ch2.Setopt(curl.OPT_URL, "http://www.baidu.com")
-	ch2.Setopt(curl.OPT_HEADER, 0)
-	ch2.Setopt(curl.OPT_VERBOSE, true)
-
-	mh := curl.MultiInit()
-
-	mh.AddHandle(ch1)
-	mh.AddHandle(ch2)
-
-	for {
-		nRunning, _ := mh.Perform()
-		// println("n =", nRunning)
-		if nRunning == 0 {
-			println("ok")
-			break
-		}
-		time.Sleep(1000)
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/post-callback.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/post-callback.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/post-callback.go
deleted file mode 100644
index 3b02802..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/post-callback.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package main
-
-import (
-	curl "github.com/andelf/go-curl"
-	"time"
-)
-
-const POST_DATA = "a_test_data_only"
-
-var sent = false
-
-func main() {
-	// init the curl session
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-
-	easy.Setopt(curl.OPT_URL, "http://www.google.com")
-
-	easy.Setopt(curl.OPT_POST, true)
-	easy.Setopt(curl.OPT_VERBOSE, true)
-
-	easy.Setopt(curl.OPT_READFUNCTION,
-		func(ptr []byte, userdata interface{}) int {
-			// WARNING: never use append()
-			if !sent {
-				sent = true
-				ret := copy(ptr, POST_DATA)
-				return ret
-			}
-			return 0 // sent ok
-		})
-
-	// disable HTTP/1.1 Expect 100
-	easy.Setopt(curl.OPT_HTTPHEADER, []string{"Expect:"})
-	// must set
-	easy.Setopt(curl.OPT_POSTFIELDSIZE, len(POST_DATA))
-
-	if err := easy.Perform(); err != nil {
-		println("ERROR: ", err.Error())
-	}
-
-	time.Sleep(10000) // wait gorotine
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/progress.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/progress.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/progress.go
deleted file mode 100644
index 09efcf5..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/progress.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// A sample program to show how to use PROGRESS callback to calculate
-// downloading percentage and speed
-package main
-
-import (
-	"fmt"
-	curl "github.com/andelf/go-curl"
-	"time"
-)
-
-func write_data(ptr []byte, userdata interface{}) bool {
-	// make it ok, do nothing
-	return true
-}
-
-func main() {
-	curl.GlobalInit(curl.GLOBAL_ALL)
-
-	// init the curl session
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-
-	easy.Setopt(curl.OPT_URL, "http://curl.haxx.se/download/curl-7.22.0.tar.gz")
-
-	easy.Setopt(curl.OPT_WRITEFUNCTION, write_data)
-
-	easy.Setopt(curl.OPT_NOPROGRESS, false)
-
-	started := int64(0)
-	easy.Setopt(curl.OPT_PROGRESSFUNCTION, func(dltotal, dlnow, ultotal, ulnow float64, userdata interface{}) bool {
-		// canceled when 50% finished
-		if dlnow/dltotal > 0.5 {
-			println("")
-			// abort downloading
-			return false
-		}
-		if started == 0 {
-			started = time.Now().Unix()
-		}
-		fmt.Printf("Downloaded: %3.2f%%, Speed: %.1fKiB/s \r", dlnow/dltotal*100, dlnow/1000/float64((time.Now().Unix()-started)))
-		return true
-	})
-
-	if err := easy.Perform(); err != nil {
-		fmt.Printf("ERROR: %v\n", err)
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_login.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_login.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_login.go
deleted file mode 100644
index 60ef84c..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_login.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// 测试人人网登录, 并保存cookiejar
-package main
-
-import (
-	"flag"
-	curl "github.com/andelf/go-curl"
-)
-
-func main() {
-	// init the curl session
-
-	var username *string = flag.String("username", "test", "renren.com email")
-	var password *string = flag.String("password", "test", "renren.com password")
-
-	flag.Parse()
-
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-
-	easy.Setopt(curl.OPT_URL, "http://m.renren.com/home.do")
-
-	easy.Setopt(curl.OPT_PORT, 80)
-	easy.Setopt(curl.OPT_VERBOSE, true)
-
-	easy.Setopt(curl.OPT_COOKIEJAR, "./cookie.jar")
-
-	// disable HTTP/1.1 Expect: 100-continue
-	easy.Setopt(curl.OPT_HTTPHEADER, []string{"Expect:"})
-
-	postdata := "email=" + *username + "&password=" + *password + "&login=" + easy.Escape("登录")
-	easy.Setopt(curl.OPT_POSTFIELDS, postdata)
-
-	if err := easy.Perform(); err != nil {
-		println("ERROR: ", err.Error())
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_upload.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_upload.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_upload.go
deleted file mode 100644
index d02e320..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_upload.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// 人人网图片上传
-package main
-
-import (
-	"fmt"
-	curl "github.com/andelf/go-curl"
-	"regexp"
-	"time"
-)
-
-func getUploadUrl() string {
-	page := ""
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-
-	u := "http://3g.renren.com/album/wuploadphoto.do"
-	easy.Setopt(curl.OPT_URL, u)
-	easy.Setopt(curl.OPT_COOKIEFILE, "./cookie.jar")
-	easy.Setopt(curl.OPT_COOKIEJAR, "./cookie.jar")
-	easy.Setopt(curl.OPT_VERBOSE, true)
-	easy.Setopt(curl.OPT_WRITEFUNCTION, func(ptr []byte, _ interface{}) bool {
-		page += string(ptr)
-		return true
-	})
-	easy.Perform()
-	// extract url from
-	// <form enctype="multipart/form-data" action="http://3g.renren.com/album/wuploadphoto.do?type=3&amp;sid=zv3tiXTZr6Cu1rj5dhgX_X"
-	pattern, _ := regexp.Compile(`action="(.*?)"`)
-
-	if matches := pattern.FindStringSubmatch(page); len(matches) == 2 {
-		return matches[1]
-	}
-	return ""
-}
-
-func main() {
-	// init the curl session
-
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-
-	posturl := getUploadUrl()
-
-	easy.Setopt(curl.OPT_URL, posturl)
-
-	easy.Setopt(curl.OPT_PORT, 80)
-	easy.Setopt(curl.OPT_VERBOSE, true)
-
-	// save cookie and load cookie
-	easy.Setopt(curl.OPT_COOKIEFILE, "./cookie.jar")
-	easy.Setopt(curl.OPT_COOKIEJAR, "./cookie.jar")
-
-	// disable HTTP/1.1 Expect: 100-continue
-	easy.Setopt(curl.OPT_HTTPHEADER, []string{"Expect:"})
-
-	form := curl.NewForm()
-	form.Add("albumid", "452618633") // your album id
-	form.AddFile("theFile", "./test.jpg")
-	form.Add("description", "我就尝试下这段代码靠谱不。。截图下看看")
-	form.Add("post", "上传照片")
-
-	easy.Setopt(curl.OPT_HTTPPOST, form)
-
-	// print upload progress
-	easy.Setopt(curl.OPT_NOPROGRESS, false)
-	easy.Setopt(curl.OPT_PROGRESSFUNCTION, func(dltotal, dlnow, ultotal, ulnow float64, _ interface{}) bool {
-		fmt.Printf("Download %3.2f%%, Uploading %3.2f%%\r", dlnow/dltotal*100, ulnow/ultotal*100)
-		return true
-	})
-
-	if err := easy.Perform(); err != nil {
-		println("ERROR: ", err.Error())
-	}
-
-	time.Sleep(1000000000) // wait gorotine
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sendrecv.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sendrecv.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sendrecv.go
deleted file mode 100644
index 841825c..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sendrecv.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package main
-
-import (
-	"fmt"
-	curl "github.com/andelf/go-curl"
-	"time"
-)
-
-const POST_DATA = "a_test_data_only"
-
-var sent = false
-
-func main() {
-	// init the curl session
-
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-
-	easy.Setopt(curl.OPT_URL, "http://www.renren.com")
-
-	easy.Setopt(curl.OPT_PORT, 80)
-	easy.Setopt(curl.OPT_VERBOSE, true)
-	easy.Setopt(curl.OPT_CONNECT_ONLY, true)
-
-	easy.Setopt(curl.OPT_WRITEFUNCTION, nil)
-
-	if err := easy.Perform(); err != nil {
-		println("ERROR: ", err.Error())
-	}
-
-	easy.Send([]byte("HEAD / HTTP/1.0\r\nHost: www.renren.com\r\n\r\n"))
-
-	buf := make([]byte, 1000)
-	time.Sleep(1000000000) // wait gorotine
-	num, err := easy.Recv(buf)
-	if err != nil {
-		println("ERROR:", err.Error())
-	}
-	println("recv num = ", num)
-	// NOTE: must use buf[:num]
-	println(string(buf[:num]))
-
-	fmt.Printf("got:\n%#v\n", string(buf[:num]))
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sepheaders.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sepheaders.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sepheaders.go
deleted file mode 100644
index b7603e3..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sepheaders.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package main
-
-import (
-	curl "github.com/andelf/go-curl"
-	"os"
-)
-
-const (
-	headerfilename = "head.out"
-	bodyfilename   = "body.out"
-)
-
-func write_data(ptr []byte, userdata interface{}) bool {
-	//println("DEBUG(write_data): ", userdata)
-	//println("DEBUG", userdata.(interface{}))
-	fp := userdata.(*os.File)
-	if _, err := fp.Write(ptr); err == nil {
-		return true
-	}
-	return false
-}
-
-func main() {
-	curl.GlobalInit(curl.GLOBAL_ALL)
-
-	// init the curl session
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-
-	// set URL to get
-	easy.Setopt(curl.OPT_URL, "http://cn.bing.com/")
-
-	// no progress meter
-	easy.Setopt(curl.OPT_NOPROGRESS, true)
-
-	easy.Setopt(curl.OPT_WRITEFUNCTION, write_data)
-
-	// write file
-	fp, _ := os.OpenFile(bodyfilename, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0777)
-	defer fp.Close()
-	easy.Setopt(curl.OPT_WRITEDATA, fp)
-
-	// easy.Setopt(curl.OPT_WRITEHEADER, 0)
-
-	if err := easy.Perform(); err != nil {
-		println("ERROR: ", err.Error())
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/examples/simple.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/simple.go b/Godeps/_workspace/src/github.com/andelf/go-curl/examples/simple.go
deleted file mode 100644
index 8261ec6..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/examples/simple.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package main
-
-import (
-	curl "github.com/andelf/go-curl"
-)
-
-func main() {
-	easy := curl.EasyInit()
-	defer easy.Cleanup()
-	if easy != nil {
-		easy.Setopt(curl.OPT_URL, "http://www.google.com/")
-		easy.Perform()
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/logging.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/logging.go b/Godeps/_workspace/src/github.com/andelf/go-curl/logging.go
deleted file mode 100644
index 8976233..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/logging.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package curl
-
-import (
-    "log"
-)
-
-const (
-    _DEBUG = 10 * (iota + 1)
-    _INFO
-    _WARN
-    _ERROR
-)
-
-const _DEFAULT_LOG_LEVEL = _WARN
-
-var log_level = _DEFAULT_LOG_LEVEL
-
-// SetLogLevel changes the log level which determines the granularity of the
-// messages that are logged.  Available log levels are: "DEBUG", "INFO",
-// "WARN", "ERROR" and "DEFAULT_LOG_LEVEL".
-func SetLogLevel(levelName string) {
-    switch levelName {
-    case "DEBUG":
-        log_level = _DEBUG
-    case "INFO":
-        log_level = _INFO
-    case "WARN":
-        log_level = _WARN
-    case "ERROR":
-        log_level = _ERROR
-    case "DEFAULT_LOG_LEVEL":
-        log_level = _DEFAULT_LOG_LEVEL
-    }
-}
-
-func logf(limitLevel int, format string, args ...interface{}) {
-    if log_level <= limitLevel {
-        log.Printf(format, args...)
-    }
-}
-
-func debugf(format string, args ...interface{}) {
-    logf(_DEBUG, format, args...)
-}
-
-func infof(format string, args ...interface{}) {
-    logf(_INFO, format, args...)
-}
-
-func warnf(format string, args ...interface{}) {
-    logf(_WARN, format, args...)
-}
-
-func errorf(format string, args ...interface{}) {
-    logf(_ERROR, format, args...)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/logging_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/logging_test.go b/Godeps/_workspace/src/github.com/andelf/go-curl/logging_test.go
deleted file mode 100644
index 387705a..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/logging_test.go
+++ /dev/null
@@ -1,64 +0,0 @@
-
-package curl
-
-import (
-	"testing"
-	"bytes"
-	"log"
-	"os"
-	"fmt"
-	"regexp"
-)
-
-func TestDefaultLogLevel(t *testing.T) {
-    if log_level != _DEFAULT_LOG_LEVEL {t.Error("Test failed, expected DEFAULT_LOG_LEVEL level.")}
-}
-
-func TestSetLogLevel(t *testing.T) {
-    SetLogLevel("DEBUG")
-    defer SetLogLevel("DEFAULT_LOG_LEVEL")
-    if log_level != _DEBUG {t.Error("Test failed, expected DEBUG level.")}
-    SetLogLevel("INFO")
-    if log_level != _INFO {t.Error("Test failed, expected INFO level.")}
-    SetLogLevel("WARN")
-    if log_level != _WARN {t.Error("Test failed, expected WARN level.")}
-    SetLogLevel("ERROR")
-    if log_level != _ERROR {t.Error("Test failed, expected ERROR level.")}
-}
-
-var (
-    testFormat = "test format %s"
-    testArgument = "test string 1"
-    expectedRegexp = regexp.MustCompile(".*" + fmt.Sprintf(testFormat, testArgument) + "\n$")
-)
-
-
-func TestLogf(t *testing.T) {
-    buf := new(bytes.Buffer)
-    log.SetOutput(buf)
-    defer log.SetOutput(os.Stderr)
-    SetLogLevel("DEBUG")
-    defer SetLogLevel("DEFAULT_LOG_LEVEL")
-
-    logf(_DEBUG, testFormat, testArgument)
-    line := buf.String()
-    matched := expectedRegexp.MatchString(line)
-    if !matched {
-        t.Errorf("log output should match %q and is %q.", expectedRegexp, line)
-    }
-}
-
-func TestLogfUsesLogLevel(t *testing.T) {
-    buf := new(bytes.Buffer)
-    log.SetOutput(buf)
-    defer log.SetOutput(os.Stderr)
-    SetLogLevel("WARN")
-    defer SetLogLevel("DEFAULT_LOG_LEVEL")
-
-    logf(_DEBUG, testFormat, testArgument)
-    line := buf.String()
-    expectedLine := ""
-    if line != expectedLine {
-        t.Errorf("log output should match %q and is %q.", expectedLine, line)
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/misc/codegen.py
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/misc/codegen.py b/Godeps/_workspace/src/github.com/andelf/go-curl/misc/codegen.py
deleted file mode 100644
index 08047e5..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/misc/codegen.py
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env python2
-# -*- coding: utf-8 -*-
-
-import re
-
-
-
-opts = []
-codes = []
-infos = []
-pattern = re.compile(r'CINIT\((.*?),\s+(LONG|OBJECTPOINT|FUNCTIONPOINT|OFF_T),\s+(\d+)\)')
-pattern2 = re.compile('^\s+(CURLE_[A-Z_0-9]+),')
-pattern3 = re.compile('^\s+(CURLINFO_[A-Z_0-9]+)\s+=')
-for line in open("./curl/include/curl/curl.h"):
-    match = pattern.findall(line)
-    if match:
-        opts.append(match[0][0])
-    if line.startswith('#define CURLOPT_'):
-        o = line.split()
-        opts.append(o[1][8:])   # strip :(
-
-    match = pattern2.findall(line)
-    if match:
-        codes.append(match[0])
-
-    if line.startswith('#define CURLE_'):
-        c = line.split()
-        codes.append(c[1])
-
-    match = pattern3.findall(line)
-    if match:
-        infos.append(match[0])
-
-    if line.startswith('#define CURLINFO_'):
-        i = line.split()
-        if '0x' not in i[2]:    # :(
-            infos.append(i[1])
-
-
-template = """
-// generated by codegen.py
-
-package curl
-/*
-#include <curl/curl.h>
-#include "compat.h"
-*/
-import "C"
-
-// CURLcode
-const (
-{code_part}
-)
-
-// easy.Setopt(flag, ...)
-const (
-{opt_part}
-)
-
-// easy.Getinfo(flag)
-const (
-{info_part}
-)
-
-// generated ends
-"""
-
-code_part = []
-for c in codes:
-    code_part.append("\t{:<25} = C.{}".format(c[4:], c))
-
-code_part = '\n'.join(code_part)
-
-opt_part = []
-for o in opts:
-    opt_part.append("\tOPT_{0:<25} = C.CURLOPT_{0}".format(o))
-
-opt_part = '\n'.join(opt_part)
-
-info_part = []
-for i in infos:
-    info_part.append("\t{:<25} = C.{}".format(i[4:], i))
-
-info_part = '\n'.join(info_part)
-
-
-with open('./const_gen.go', 'w') as fp:
-    fp.write(template.format(**locals()))

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/misc/compatgen.py
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/misc/compatgen.py b/Godeps/_workspace/src/github.com/andelf/go-curl/misc/compatgen.py
deleted file mode 100644
index e7f2860..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/misc/compatgen.py
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-import re
-import os
-
-def version_symbol(ver):
-    os.system("cd ./curl && git checkout {}".format(ver))
-    opts = []
-    codes = []
-    infos = []
-    vers = []
-    pattern = re.compile(r'CINIT\((.*?), (LONG|OBJECTPOINT|FUNCTIONPOINT|OFF_T), (\d+)\)')
-    pattern2 = re.compile('^\s+(CURLE_[A-Z_0-9]+),')
-    pattern3 = re.compile('^\s+(CURLINFO_[A-Z_0-9]+)\s+=')
-    for line in open("./curl/include/curl/curl.h"):
-        match = pattern.findall(line)
-        if match:
-            opts.append("CURLOPT_" + match[0][0])
-        if line.startswith('#define CURLOPT_'):
-            o = line.split()
-            opts.append(o[1])
-
-        match = pattern2.findall(line)
-        if match:
-            codes.append(match[0])
-
-        if line.startswith('#define CURLE_'):
-            c = line.split()
-            codes.append(c[1])
-
-        match = pattern3.findall(line)
-        if match:
-            infos.append(match[0])
-
-        if line.startswith('#define CURLINFO_'):
-            i = line.split()
-            if '0x' not in i[2]:    # :(
-                infos.append(i[1])
-
-        if line.startswith('#define CURL_VERSION_'):
-            i = line.split()
-            vers.append(i[1])
-
-    return opts, codes, infos, vers
-
-
-versions = """
-curl-7_10_1
-curl-7_10_2
-curl-7_10_3
-curl-7_10_4
-curl-7_10_5
-curl-7_10_6
-curl-7_10_7
-curl-7_10_8
-curl-7_11_0
-curl-7_11_1
-curl-7_11_2
-curl-7_12_0
-curl-7_12_1
-curl-7_12_2
-curl-7_12_3
-curl-7_13_0
-curl-7_13_1
-curl-7_13_2
-curl-7_14_0
-curl-7_14_1
-curl-7_15_0
-curl-7_15_1
-curl-7_15_2
-curl-7_15_3
-curl-7_15_4
-curl-7_15_5
-curl-7_16_0
-curl-7_16_1
-curl-7_16_2
-curl-7_16_3
-curl-7_16_4
-curl-7_17_0
-curl-7_17_1
-curl-7_18_0
-curl-7_18_1
-curl-7_18_2
-curl-7_19_0
-curl-7_19_1
-curl-7_19_2
-curl-7_19_3
-curl-7_19_4
-curl-7_19_5
-curl-7_19_6
-curl-7_19_7
-curl-7_20_0
-curl-7_20_1
-curl-7_21_0
-curl-7_21_1
-curl-7_21_2
-curl-7_21_3
-curl-7_21_4
-curl-7_21_5
-curl-7_21_6
-curl-7_21_7
-curl-7_22_0
-curl-7_23_0
-curl-7_23_1
-curl-7_24_0
-curl-7_25_0
-curl-7_26_0
-curl-7_27_0
-curl-7_28_0
-curl-7_28_1
-curl-7_29_0
-curl-7_30_0
-curl-7_31_0
-curl-7_32_0
-curl-7_33_0
-curl-7_34_0
-curl-7_35_0
-curl-7_36_0""".split()[::-1]
-
-last = version_symbol("master")
-
-template = """
-/* generated by compatgen.py */
-#include<curl/curl.h>
-
-
-"""
-
-result = [template]
-result_tail = ["/* generated ends */\n"]
-if __name__ == '__main__':
-    for ver in versions:
-        minor, patch = map(int, ver.split("_")[-2:])
-
-        opts, codes, infos, vers = curr = version_symbol(ver)
-
-        for o in last[0]:
-            if o not in opts:
-                result.append("#define {} 0".format(o)) # 0 for nil option
-        for c in last[1]:
-            if c not in codes:
-                result.append("#define {} -1".format(c)) # -1 for error
-        for i in last[2]:
-            if i not in infos:
-                result.append("#define {} 0".format(i)) # 0 for nil
-        for v in last[3]:
-            if v not in vers:
-                result.append("#define {} 0".format(v)) # 0 for nil
-
-        result.append("#if (LIBCURL_VERSION_MINOR == {} && LIBCURL_VERSION_PATCH < {}) || LIBCURL_VERSION_MINOR < {} ".format(minor, patch, minor))
-
-        result_tail.insert(0, "#endif /* 7.{}.{} */".format(minor, patch))
-
-        last = curr
-
-result.append("#error your version is TOOOOOOOO low")
-
-result.extend(result_tail)
-
-with open("./compat.h", 'w') as fp:
-    fp.write('\n'.join(result))

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/multi.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/multi.go b/Godeps/_workspace/src/github.com/andelf/go-curl/multi.go
deleted file mode 100644
index 814fd6e..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/multi.go
+++ /dev/null
@@ -1,154 +0,0 @@
-package curl
-
-/*
-#include <stdlib.h>
-#include <curl/curl.h>
-
-static CURLMcode curl_multi_setopt_long(CURLM *handle, CURLMoption option, long parameter) {
-  return curl_multi_setopt(handle, option, parameter);
-}
-static CURLMcode curl_multi_setopt_pointer(CURLM *handle, CURLMoption option, void *parameter) {
-  return curl_multi_setopt(handle, option, parameter);
-}
-static CURLMcode curl_multi_fdset_pointer(CURLM *handle,
-                            void *read_fd_set,
-                            void *write_fd_set,
-                            void *exc_fd_set,
-                            int *max_fd)
-{
-  return curl_multi_fdset(handle, read_fd_set, write_fd_set, exc_fd_set, max_fd);
-}                            
-static CURLMsg *curl_multi_info_read_pointer(CURLM *handle, int *msgs_in_queue)
-{
-  return curl_multi_info_read(handle, msgs_in_queue);
-}                            
-*/
-import "C"
-
-import (
-		"unsafe"
-		"syscall"
-)
-
-type CurlMultiError C.CURLMcode
-type CurlMultiMsg	C.CURLMSG
-
-func (e CurlMultiError) Error() string {
-	// ret is const char*, no need to free
-	ret := C.curl_multi_strerror(C.CURLMcode(e))
-	return C.GoString(ret)
-}
-
-func newCurlMultiError(errno C.CURLMcode) error {
-	// cannot use C.CURLM_OK here, cause multi.h use a undefined emum num
-	if errno == 0 { // if nothing wrong
-		return nil
-	}
-	return CurlMultiError(errno)
-}
-
-func newCURLMessage(message *C.CURLMsg) (msg *CURLMessage){
-	if message == nil {
-		return nil
-	}
-	msg = new(CURLMessage)
-	msg.Msg = CurlMultiMsg(message.msg)
-	msg.Easy_handle = &CURL{handle: message.easy_handle}
-	msg.Data = message.data
-	return msg 
-}
-
-type CURLM struct {
-	handle unsafe.Pointer
-}
-
-type CURLMessage struct {
-	Msg CurlMultiMsg
-	Easy_handle *CURL
-	Data [8]byte
-}
-
-// curl_multi_init - create a multi handle
-func MultiInit() *CURLM {
-	p := C.curl_multi_init()
-	return &CURLM{p}
-}
-
-// curl_multi_cleanup - close down a multi session
-func (mcurl *CURLM) Cleanup() error {
-	p := mcurl.handle
-	return newCurlMultiError(C.curl_multi_cleanup(p))
-}
-
-// curl_multi_perform - reads/writes available data from each easy handle
-func (mcurl *CURLM) Perform() (int, error) {
-	p := mcurl.handle
-	running_handles := C.int(-1)
-	err := newCurlMultiError(C.curl_multi_perform(p, &running_handles))
-	return int(running_handles), err
-}
-
-// curl_multi_add_handle - add an easy handle to a multi session
-func (mcurl *CURLM) AddHandle(easy *CURL) error {
-	mp := mcurl.handle
-	easy_handle := easy.handle
-	return newCurlMultiError(C.curl_multi_add_handle(mp, easy_handle))
-}
-
-// curl_multi_remove_handle - remove an easy handle from a multi session
-func (mcurl *CURLM) RemoveHandle(easy *CURL) error {
-	mp := mcurl.handle
-	easy_handle := easy.handle
-	return newCurlMultiError(C.curl_multi_remove_handle(mp, easy_handle))
-}
-
-func (mcurl *CURLM) Timeout() (int, error) {
-	p := mcurl.handle
-	timeout := C.long(-1)
-	err := newCurlMultiError(C.curl_multi_timeout(p, &timeout))
-	return int(timeout), err
-}
-
-func (mcurl *CURLM) Setopt(opt int, param interface{}) error {
-	p := mcurl.handle
-	if param == nil {
-		return newCurlMultiError(C.curl_multi_setopt_pointer(p, C.CURLMoption(opt), nil))
-	}
-	switch {
-	//  currently cannot support these option
-	//	case MOPT_SOCKETFUNCTION, MOPT_SOCKETDATA, MOPT_TIMERFUNCTION, MOPT_TIMERDATA:
-	//		panic("not supported CURLM.Setopt opt")
-	case opt >= C.CURLOPTTYPE_LONG:
-		val := C.long(0)
-		switch t := param.(type) {
-		case int:
-			val := C.long(t)
-			return newCurlMultiError(C.curl_multi_setopt_long(p, C.CURLMoption(opt), val))
-		case bool:
-			val = C.long(0)
-			if t {
-				val = C.long(1)
-			}
-			return newCurlMultiError(C.curl_multi_setopt_long(p, C.CURLMoption(opt), val))
-		}
-	}
-	panic("not supported CURLM.Setopt opt or param")
-	return nil
-}
-
-func (mcurl *CURLM) Fdset(rset, wset, eset *syscall.FdSet) (int, error) {
-	p := mcurl.handle
-	read := unsafe.Pointer(rset)
-	write := unsafe.Pointer(wset)
-	exc := unsafe.Pointer(eset)
-	maxfd := C.int(-1)
-	err := newCurlMultiError(C.curl_multi_fdset_pointer(p, read, write,
-							 exc, &maxfd))
-	return int(maxfd), err
-}
-
-func (mcurl *CURLM) Info_read() (*CURLMessage, int) {
-	p := mcurl.handle
-	left := C.int(0)
-  	return newCURLMessage(C.curl_multi_info_read_pointer(p, &left)), int(left)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/andelf/go-curl/share.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/andelf/go-curl/share.go b/Godeps/_workspace/src/github.com/andelf/go-curl/share.go
deleted file mode 100644
index 8d1e16d..0000000
--- a/Godeps/_workspace/src/github.com/andelf/go-curl/share.go
+++ /dev/null
@@ -1,62 +0,0 @@
-package curl
-
-/*
-#include <curl/curl.h>
-
-static CURLSHcode curl_share_setopt_long(CURLSH *handle, CURLSHoption option, long parameter) {
-  return curl_share_setopt(handle, option, parameter);
-}
-static CURLSHcode curl_share_setopt_pointer(CURLSH *handle, CURLSHoption option, void *parameter) {
-  return curl_share_setopt(handle, option, parameter);
-}
-*/
-import "C"
-
-import "unsafe"
-
-// implement os.Error interface
-type CurlShareError C.CURLMcode
-
-func (e CurlShareError) Error() string {
-	// ret is const char*, no need to free
-	ret := C.curl_share_strerror(C.CURLSHcode(e))
-	return C.GoString(ret)
-}
-
-func newCurlShareError(errno C.CURLSHcode) error {
-	if errno == 0 { // if nothing wrong
-		return nil
-	}
-	return CurlShareError(errno)
-}
-
-type CURLSH struct {
-	handle unsafe.Pointer
-}
-
-func ShareInit() *CURLSH {
-	p := C.curl_share_init()
-	return &CURLSH{p}
-}
-
-func (shcurl *CURLSH) Cleanup() error {
-	p := shcurl.handle
-	return newCurlShareError(C.curl_share_cleanup(p))
-}
-
-func (shcurl *CURLSH) Setopt(opt int, param interface{}) error {
-	p := shcurl.handle
-	if param == nil {
-		return newCurlShareError(C.curl_share_setopt_pointer(p, C.CURLSHoption(opt), nil))
-	}
-	switch opt {
-	//	case SHOPT_LOCKFUNC, SHOPT_UNLOCKFUNC, SHOPT_USERDATA:
-	//		panic("not supported")
-	case SHOPT_SHARE, SHOPT_UNSHARE:
-		if val, ok := param.(int); ok {
-			return newCurlShareError(C.curl_share_setopt_long(p, C.CURLSHoption(opt), C.long(val)))
-		}
-	}
-	panic("not supported CURLSH.Setopt opt or param")
-	return nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore b/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore
deleted file mode 100644
index 0026861..0000000
--- a/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE b/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE
deleted file mode 100644
index c33dcc7..0000000
--- a/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE
+++ /dev/null
@@ -1,354 +0,0 @@
-Mozilla Public License, version 2.0
-
-1. Definitions
-
-1.1. “Contributor”
-
-     means each individual or legal entity that creates, contributes to the
-     creation of, or owns Covered Software.
-
-1.2. “Contributor Version”
-
-     means the combination of the Contributions of others (if any) used by a
-     Contributor and that particular Contributor’s Contribution.
-
-1.3. “Contribution”
-
-     means Covered Software of a particular Contributor.
-
-1.4. “Covered Software”
-
-     means Source Code Form to which the initial Contributor has attached the
-     notice in Exhibit A, the Executable Form of such Source Code Form, and
-     Modifications of such Source Code Form, in each case including portions
-     thereof.
-
-1.5. “Incompatible With Secondary Licenses”
-     means
-
-     a. that the initial Contributor has attached the notice described in
-        Exhibit B to the Covered Software; or
-
-     b. that the Covered Software was made available under the terms of version
-        1.1 or earlier of the License, but not also under the terms of a
-        Secondary License.
-
-1.6. “Executable Form”
-
-     means any form of the work other than Source Code Form.
-
-1.7. “Larger Work”
-
-     means a work that combines Covered Software with other material, in a separate
-     file or files, that is not Covered Software.
-
-1.8. “License”
-
-     means this document.
-
-1.9. “Licensable”
-
-     means having the right to grant, to the maximum extent possible, whether at the
-     time of the initial grant or subsequently, any and all of the rights conveyed by
-     this License.
-
-1.10. “Modifications”
-
-     means any of the following:
-
-     a. any file in Source Code Form that results from an addition to, deletion
-        from, or modification of the contents of Covered Software; or
-
-     b. any new file in Source Code Form that contains any Covered Software.
-
-1.11. “Patent Claims” of a Contributor
-
-      means any patent claim(s), including without limitation, method, process,
-      and apparatus claims, in any patent Licensable by such Contributor that
-      would be infringed, but for the grant of the License, by the making,
-      using, selling, offering for sale, having made, import, or transfer of
-      either its Contributions or its Contributor Version.
-
-1.12. “Secondary License”
-
-      means either the GNU General Public License, Version 2.0, the GNU Lesser
-      General Public License, Version 2.1, the GNU Affero General Public
-      License, Version 3.0, or any later versions of those licenses.
-
-1.13. “Source Code Form”
-
-      means the form of the work preferred for making modifications.
-
-1.14. “You” (or “Your”)
-
-      means an individual or a legal entity exercising rights under this
-      License. For legal entities, “You” includes any entity that controls, is
-      controlled by, or is under common control with You. For purposes of this
-      definition, “control” means (a) the power, direct or indirect, to cause
-      the direction or management of such entity, whether by contract or
-      otherwise, or (b) ownership of more than fifty percent (50%) of the
-      outstanding shares or beneficial ownership of such entity.
-
-
-2. License Grants and Conditions
-
-2.1. Grants
-
-     Each Contributor hereby grants You a world-wide, royalty-free,
-     non-exclusive license:
-
-     a. under intellectual property rights (other than patent or trademark)
-        Licensable by such Contributor to use, reproduce, make available,
-        modify, display, perform, distribute, and otherwise exploit its
-        Contributions, either on an unmodified basis, with Modifications, or as
-        part of a Larger Work; and
-
-     b. under Patent Claims of such Contributor to make, use, sell, offer for
-        sale, have made, import, and otherwise transfer either its Contributions
-        or its Contributor Version.
-
-2.2. Effective Date
-
-     The licenses granted in Section 2.1 with respect to any Contribution become
-     effective for each Contribution on the date the Contributor first distributes
-     such Contribution.
-
-2.3. Limitations on Grant Scope
-
-     The licenses granted in this Section 2 are the only rights granted under this
-     License. No additional rights or licenses will be implied from the distribution
-     or licensing of Covered Software under this License. Notwithstanding Section
-     2.1(b) above, no patent license is granted by a Contributor:
-
-     a. for any code that a Contributor has removed from Covered Software; or
-
-     b. for infringements caused by: (i) Your and any other third party’s
-        modifications of Covered Software, or (ii) the combination of its
-        Contributions with other software (except as part of its Contributor
-        Version); or
-
-     c. under Patent Claims infringed by Covered Software in the absence of its
-        Contributions.
-
-     This License does not grant any rights in the trademarks, service marks, or
-     logos of any Contributor (except as may be necessary to comply with the
-     notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
-     No Contributor makes additional grants as a result of Your choice to
-     distribute the Covered Software under a subsequent version of this License
-     (see Section 10.2) or under the terms of a Secondary License (if permitted
-     under the terms of Section 3.3).
-
-2.5. Representation
-
-     Each Contributor represents that the Contributor believes its Contributions
-     are its original creation(s) or it has sufficient rights to grant the
-     rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
-     This License is not intended to limit any rights You have under applicable
-     copyright doctrines of fair use, fair dealing, or other equivalents.
-
-2.7. Conditions
-
-     Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
-     Section 2.1.
-
-
-3. Responsibilities
-
-3.1. Distribution of Source Form
-
-     All distribution of Covered Software in Source Code Form, including any
-     Modifications that You create or to which You contribute, must be under the
-     terms of this License. You must inform recipients that the Source Code Form
-     of the Covered Software is governed by the terms of this License, and how
-     they can obtain a copy of this License. You may not attempt to alter or
-     restrict the recipients’ rights in the Source Code Form.
-
-3.2. Distribution of Executable Form
-
-     If You distribute Covered Software in Executable Form then:
-
-     a. such Covered Software must also be made available in Source Code Form,
-        as described in Section 3.1, and You must inform recipients of the
-        Executable Form how they can obtain a copy of such Source Code Form by
-        reasonable means in a timely manner, at a charge no more than the cost
-        of distribution to the recipient; and
-
-     b. You may distribute such Executable Form under the terms of this License,
-        or sublicense it under different terms, provided that the license for
-        the Executable Form does not attempt to limit or alter the recipients’
-        rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
-     You may create and distribute a Larger Work under terms of Your choice,
-     provided that You also comply with the requirements of this License for the
-     Covered Software. If the Larger Work is a combination of Covered Software
-     with a work governed by one or more Secondary Licenses, and the Covered
-     Software is not Incompatible With Secondary Licenses, this License permits
-     You to additionally distribute such Covered Software under the terms of
-     such Secondary License(s), so that the recipient of the Larger Work may, at
-     their option, further distribute the Covered Software under the terms of
-     either this License or such Secondary License(s).
-
-3.4. Notices
-
-     You may not remove or alter the substance of any license notices (including
-     copyright notices, patent notices, disclaimers of warranty, or limitations
-     of liability) contained within the Source Code Form of the Covered
-     Software, except that You may alter any license notices to the extent
-     required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
-     You may choose to offer, and to charge a fee for, warranty, support,
-     indemnity or liability obligations to one or more recipients of Covered
-     Software. However, You may do so only on Your own behalf, and not on behalf
-     of any Contributor. You must make it absolutely clear that any such
-     warranty, support, indemnity, or liability obligation is offered by You
-     alone, and You hereby agree to indemnify every Contributor for any
-     liability incurred by such Contributor as a result of warranty, support,
-     indemnity or liability terms You offer. You may include additional
-     disclaimers of warranty and limitations of liability specific to any
-     jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
-
-   If it is impossible for You to comply with any of the terms of this License
-   with respect to some or all of the Covered Software due to statute, judicial
-   order, or regulation then You must: (a) comply with the terms of this License
-   to the maximum extent possible; and (b) describe the limitations and the code
-   they affect. Such description must be placed in a text file included with all
-   distributions of the Covered Software under this License. Except to the
-   extent prohibited by statute or regulation, such description must be
-   sufficiently detailed for a recipient of ordinary skill to be able to
-   understand it.
-
-5. Termination
-
-5.1. The rights granted under this License will terminate automatically if You
-     fail to comply with any of its terms. However, if You become compliant,
-     then the rights granted under this License from a particular Contributor
-     are reinstated (a) provisionally, unless and until such Contributor
-     explicitly and finally terminates Your grants, and (b) on an ongoing basis,
-     if such Contributor fails to notify You of the non-compliance by some
-     reasonable means prior to 60 days after You have come back into compliance.
-     Moreover, Your grants from a particular Contributor are reinstated on an
-     ongoing basis if such Contributor notifies You of the non-compliance by
-     some reasonable means, this is the first time You have received notice of
-     non-compliance with this License from such Contributor, and You become
-     compliant prior to 30 days after Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
-     infringement claim (excluding declaratory judgment actions, counter-claims,
-     and cross-claims) alleging that a Contributor Version directly or
-     indirectly infringes any patent, then the rights granted to You by any and
-     all Contributors for the Covered Software under Section 2.1 of this License
-     shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
-     license agreements (excluding distributors and resellers) which have been
-     validly granted by You or Your distributors under this License prior to
-     termination shall survive termination.
-
-6. Disclaimer of Warranty
-
-   Covered Software is provided under this License on an “as is” basis, without
-   warranty of any kind, either expressed, implied, or statutory, including,
-   without limitation, warranties that the Covered Software is free of defects,
-   merchantable, fit for a particular purpose or non-infringing. The entire
-   risk as to the quality and performance of the Covered Software is with You.
-   Should any Covered Software prove defective in any respect, You (not any
-   Contributor) assume the cost of any necessary servicing, repair, or
-   correction. This disclaimer of warranty constitutes an essential part of this
-   License. No use of  any Covered Software is authorized under this License
-   except under this disclaimer.
-
-7. Limitation of Liability
-
-   Under no circumstances and under no legal theory, whether tort (including
-   negligence), contract, or otherwise, shall any Contributor, or anyone who
-   distributes Covered Software as permitted above, be liable to You for any
-   direct, indirect, special, incidental, or consequential damages of any
-   character including, without limitation, damages for lost profits, loss of
-   goodwill, work stoppage, computer failure or malfunction, or any and all
-   other commercial damages or losses, even if such party shall have been
-   informed of the possibility of such damages. This limitation of liability
-   shall not apply to liability for death or personal injury resulting from such
-   party’s negligence to the extent applicable law prohibits such limitation.
-   Some jurisdictions do not allow the exclusion or limitation of incidental or
-   consequential damages, so this exclusion and limitation may not apply to You.
-
-8. Litigation
-
-   Any litigation relating to this License may be brought only in the courts of
-   a jurisdiction where the defendant maintains its principal place of business
-   and such litigation shall be governed by laws of that jurisdiction, without
-   reference to its conflict-of-law provisions. Nothing in this Section shall
-   prevent a party’s ability to bring cross-claims or counter-claims.
-
-9. Miscellaneous
-
-   This License represents the complete agreement concerning the subject matter
-   hereof. If any provision of this License is held to be unenforceable, such
-   provision shall be reformed only to the extent necessary to make it
-   enforceable. Any law or regulation which provides that the language of a
-   contract shall be construed against the drafter shall not be used to construe
-   this License against a Contributor.
-
-
-10. Versions of the License
-
-10.1. New Versions
-
-      Mozilla Foundation is the license steward. Except as provided in Section
-      10.3, no one other than the license steward has the right to modify or
-      publish new versions of this License. Each version will be given a
-      distinguishing version number.
-
-10.2. Effect of New Versions
-
-      You may distribute the Covered Software under the terms of the version of
-      the License under which You originally received the Covered Software, or
-      under the terms of any subsequent version published by the license
-      steward.
-
-10.3. Modified Versions
-
-      If you create software not governed by this License, and you want to
-      create a new license for such software, you may create and use a modified
-      version of this License if you rename the license and remove any
-      references to the name of the license steward (except to note that such
-      modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
-      If You choose to distribute Source Code Form that is Incompatible With
-      Secondary Licenses under the terms of this version of the License, the
-      notice described in Exhibit B of this License must be attached.
-
-Exhibit A - Source Code Form License Notice
-
-      This Source Code Form is subject to the
-      terms of the Mozilla Public License, v.
-      2.0. If a copy of the MPL was not
-      distributed with this file, You can
-      obtain one at
-      http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular file, then
-You may include the notice in a location (such as a LICENSE file in a relevant
-directory) where a recipient would be likely to look for such a notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - “Incompatible With Secondary Licenses” Notice
-
-      This Source Code Form is “Incompatible
-      With Secondary Licenses”, as defined by
-      the Mozilla Public License, v. 2.0.
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md b/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md
deleted file mode 100644
index 49490ea..0000000
--- a/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# logutils
-
-logutils is a Go package that augments the standard library "log" package
-to make logging a bit more modern, without fragmenting the Go ecosystem
-with new logging packages.
-
-## The simplest thing that could possibly work
-
-Presumably your application already uses the default `log` package. To switch, you'll want your code to look like the following:
-
-```go
-package main
-
-import (
-	"log"
-	"os"
-
-	"github.com/hashicorp/logutils"
-)
-
-func main() {
-	filter := &logutils.LevelFilter{
-		Levels: []logutils.LogLevel{"DEBUG", "WARN", "ERROR"},
-		MinLevel: logutils.LogLevel("WARN"),
-		Writer: os.Stderr,
-	}
-	log.SetOutput(filter)
-
-	log.Print("[DEBUG] Debugging") // this will not print
-	log.Print("[WARN] Warning") // this will
-	log.Print("[ERROR] Erring") // and so will this
-	log.Print("Message I haven't updated") // and so will this
-}
-```
-
-This logs to standard error exactly like go's standard logger. Any log messages you haven't converted to have a level will continue to print as before.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go b/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go
deleted file mode 100644
index 6381bf1..0000000
--- a/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// Package logutils augments the standard log package with levels.
-package logutils
-
-import (
-	"bytes"
-	"io"
-	"sync"
-)
-
-type LogLevel string
-
-// LevelFilter is an io.Writer that can be used with a logger that
-// will filter out log messages that aren't at least a certain level.
-//
-// Once the filter is in use somewhere, it is not safe to modify
-// the structure.
-type LevelFilter struct {
-	// Levels is the list of log levels, in increasing order of
-	// severity. Example might be: {"DEBUG", "WARN", "ERROR"}.
-	Levels []LogLevel
-
-	// MinLevel is the minimum level allowed through
-	MinLevel LogLevel
-
-	// The underlying io.Writer where log messages that pass the filter
-	// will be set.
-	Writer io.Writer
-
-	badLevels map[LogLevel]struct{}
-	once      sync.Once
-}
-
-// Check will check a given line if it would be included in the level
-// filter.
-func (f *LevelFilter) Check(line []byte) bool {
-	f.once.Do(f.init)
-
-	// Check for a log level
-	var level LogLevel
-	x := bytes.IndexByte(line, '[')
-	if x >= 0 {
-		y := bytes.IndexByte(line[x:], ']')
-		if y >= 0 {
-			level = LogLevel(line[x+1 : x+y])
-		}
-	}
-
-	_, ok := f.badLevels[level]
-	return !ok
-}
-
-func (f *LevelFilter) Write(p []byte) (n int, err error) {
-	// Note in general that io.Writer can receive any byte sequence
-	// to write, but the "log" package always guarantees that we only
-	// get a single line. We use that as a slight optimization within
-	// this method, assuming we're dealing with a single, complete line
-	// of log data.
-
-	if !f.Check(p) {
-		return len(p), nil
-	}
-
-	return f.Writer.Write(p)
-}
-
-// SetMinLevel is used to update the minimum log level
-func (f *LevelFilter) SetMinLevel(min LogLevel) {
-	f.MinLevel = min
-	f.init()
-}
-
-func (f *LevelFilter) init() {
-	badLevels := make(map[LogLevel]struct{})
-	for _, level := range f.Levels {
-		if level == f.MinLevel {
-			break
-		}
-		badLevels[level] = struct{}{}
-	}
-	f.badLevels = badLevels
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go b/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go
deleted file mode 100644
index 3c2caf7..0000000
--- a/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package logutils
-
-import (
-	"io/ioutil"
-	"testing"
-)
-
-var messages [][]byte
-
-func init() {
-	messages = [][]byte{
-		[]byte("[TRACE] foo"),
-		[]byte("[DEBUG] foo"),
-		[]byte("[INFO] foo"),
-		[]byte("[WARN] foo"),
-		[]byte("[ERROR] foo"),
-	}
-}
-
-func BenchmarkDiscard(b *testing.B) {
-	for i := 0; i < b.N; i++ {
-		ioutil.Discard.Write(messages[i%len(messages)])
-	}
-}
-
-func BenchmarkLevelFilter(b *testing.B) {
-	filter := &LevelFilter{
-		Levels:   []LogLevel{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"},
-		MinLevel: "WARN",
-		Writer:   ioutil.Discard,
-	}
-
-	b.ResetTimer()
-	for i := 0; i < b.N; i++ {
-		filter.Write(messages[i%len(messages)])
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go b/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go
deleted file mode 100644
index f6b6ac3..0000000
--- a/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package logutils
-
-import (
-	"bytes"
-	"io"
-	"log"
-	"testing"
-)
-
-func TestLevelFilter_impl(t *testing.T) {
-	var _ io.Writer = new(LevelFilter)
-}
-
-func TestLevelFilter(t *testing.T) {
-	buf := new(bytes.Buffer)
-	filter := &LevelFilter{
-		Levels:   []LogLevel{"DEBUG", "WARN", "ERROR"},
-		MinLevel: "WARN",
-		Writer:   buf,
-	}
-
-	logger := log.New(filter, "", 0)
-	logger.Print("[WARN] foo")
-	logger.Println("[ERROR] bar")
-	logger.Println("[DEBUG] baz")
-	logger.Println("[WARN] buzz")
-
-	result := buf.String()
-	expected := "[WARN] foo\n[ERROR] bar\n[WARN] buzz\n"
-	if result != expected {
-		t.Fatalf("bad: %#v", result)
-	}
-}
-
-func TestLevelFilterCheck(t *testing.T) {
-	filter := &LevelFilter{
-		Levels:   []LogLevel{"DEBUG", "WARN", "ERROR"},
-		MinLevel: "WARN",
-		Writer:   nil,
-	}
-
-	testCases := []struct {
-		line  string
-		check bool
-	}{
-		{"[WARN] foo\n", true},
-		{"[ERROR] bar\n", true},
-		{"[DEBUG] baz\n", false},
-		{"[WARN] buzz\n", true},
-	}
-
-	for _, testCase := range testCases {
-		result := filter.Check([]byte(testCase.line))
-		if result != testCase.check {
-			t.Errorf("Fail: %s", testCase.line)
-		}
-	}
-}
-
-func TestLevelFilter_SetMinLevel(t *testing.T) {
-	filter := &LevelFilter{
-		Levels:   []LogLevel{"DEBUG", "WARN", "ERROR"},
-		MinLevel: "ERROR",
-		Writer:   nil,
-	}
-
-	testCases := []struct {
-		line        string
-		checkBefore bool
-		checkAfter  bool
-	}{
-		{"[WARN] foo\n", false, true},
-		{"[ERROR] bar\n", true, true},
-		{"[DEBUG] baz\n", false, false},
-		{"[WARN] buzz\n", false, true},
-	}
-
-	for _, testCase := range testCases {
-		result := filter.Check([]byte(testCase.line))
-		if result != testCase.checkBefore {
-			t.Errorf("Fail: %s", testCase.line)
-		}
-	}
-
-	// Update the minimum level to WARN
-	filter.SetMinLevel("WARN")
-
-	for _, testCase := range testCases {
-		result := filter.Check([]byte(testCase.line))
-		if result != testCase.checkAfter {
-			t.Errorf("Fail: %s", testCase.line)
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE b/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE
deleted file mode 100644
index 5f0d1fb..0000000
--- a/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE
+++ /dev/null
@@ -1,13 +0,0 @@
-Copyright 2014 Alan Shreve
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/README.md b/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/README.md
deleted file mode 100644
index 7a950d1..0000000
--- a/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# mousetrap
-
-mousetrap is a tiny library that answers a single question.
-
-On a Windows machine, was the process invoked by someone double clicking on
-the executable file while browsing in explorer?
-
-### Motivation
-
-Windows developers unfamiliar with command line tools will often "double-click"
-the executable for a tool. Because most CLI tools print the help and then exit
-when invoked without arguments, this is often very frustrating for those users.
-
-mousetrap provides a way to detect these invocations so that you can provide
-more helpful behavior and instructions on how to run the CLI tool. To see what
-this looks like, both from an organizational and a technical perspective, see
-https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/
-
-### The interface
-
-The library exposes a single interface:
-
-    func StartedByExplorer() (bool)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_others.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_others.go b/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_others.go
deleted file mode 100644
index 9d2d8a4..0000000
--- a/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_others.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// +build !windows
-
-package mousetrap
-
-// StartedByExplorer returns true if the program was invoked by the user
-// double-clicking on the executable from explorer.exe
-//
-// It is conservative and returns false if any of the internal calls fail.
-// It does not guarantee that the program was run from a terminal. It only can tell you
-// whether it was launched from explorer.exe
-//
-// On non-Windows platforms, it always returns false.
-func StartedByExplorer() bool {
-	return false
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows.go b/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows.go
deleted file mode 100644
index 336142a..0000000
--- a/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/trap_windows.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// +build windows
-// +build !go1.4
-
-package mousetrap
-
-import (
-	"fmt"
-	"os"
-	"syscall"
-	"unsafe"
-)
-
-const (
-	// defined by the Win32 API
-	th32cs_snapprocess uintptr = 0x2
-)
-
-var (
-	kernel                   = syscall.MustLoadDLL("kernel32.dll")
-	CreateToolhelp32Snapshot = kernel.MustFindProc("CreateToolhelp32Snapshot")
-	Process32First           = kernel.MustFindProc("Process32FirstW")
-	Process32Next            = kernel.MustFindProc("Process32NextW")
-)
-
-// ProcessEntry32 structure defined by the Win32 API
-type processEntry32 struct {
-	dwSize              uint32
-	cntUsage            uint32
-	th32ProcessID       uint32
-	th32DefaultHeapID   int
-	th32ModuleID        uint32
-	cntThreads          uint32
-	th32ParentProcessID uint32
-	pcPriClassBase      int32
-	dwFlags             uint32
-	szExeFile           [syscall.MAX_PATH]uint16
-}
-
-func getProcessEntry(pid int) (pe *processEntry32, err error) {
-	snapshot, _, e1 := CreateToolhelp32Snapshot.Call(th32cs_snapprocess, uintptr(0))
-	if snapshot == uintptr(syscall.InvalidHandle) {
-		err = fmt.Errorf("CreateToolhelp32Snapshot: %v", e1)
-		return
-	}
-	defer syscall.CloseHandle(syscall.Handle(snapshot))
-
-	var processEntry processEntry32
-	processEntry.dwSize = uint32(unsafe.Sizeof(processEntry))
-	ok, _, e1 := Process32First.Call(snapshot, uintptr(unsafe.Pointer(&processEntry)))
-	if ok == 0 {
-		err = fmt.Errorf("Process32First: %v", e1)
-		return
-	}
-
-	for {
-		if processEntry.th32ProcessID == uint32(pid) {
-			pe = &processEntry
-			return
-		}
-
-		ok, _, e1 = Process32Next.Call(snapshot, uintptr(unsafe.Pointer(&processEntry)))
-		if ok == 0 {
-			err = fmt.Errorf("Process32Next: %v", e1)
-			return
-		}
-	}
-}
-
-func getppid() (pid int, err error) {
-	pe, err := getProcessEntry(os.Getpid())
-	if err != nil {
-		return
-	}
-
-	pid = int(pe.th32ParentProcessID)
-	return
-}
-
-// StartedByExplorer returns true if the program was invoked by the user double-clicking
-// on the executable from explorer.exe
-//
-// It is conservative and returns false if any of the internal calls fail.
-// It does not guarantee that the program was run from a terminal. It only can tell you
-// whether it was launched from explorer.exe
-func StartedByExplorer() bool {
-	ppid, err := getppid()
-	if err != nil {
-		return false
-	}
-
-	pe, err := getProcessEntry(ppid)
-	if err != nil {
-		return false
-	}
-
-	name := syscall.UTF16ToString(pe.szExeFile[:])
-	return name == "explorer.exe"
-}



[11/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/.gitignore b/newt/Godeps/_workspace/src/github.com/spf13/cobra/.gitignore
new file mode 100644
index 0000000..36d1a84
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/.gitignore
@@ -0,0 +1,24 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe
+
+cobra.test

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/.travis.yml
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/.travis.yml b/newt/Godeps/_workspace/src/github.com/spf13/cobra/.travis.yml
new file mode 100644
index 0000000..dc43afd
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/.travis.yml
@@ -0,0 +1,8 @@
+language: go
+go:
+  - 1.3
+  - 1.4.2
+  - tip
+script:
+  - go test ./...
+  - go build

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt b/newt/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt
new file mode 100644
index 0000000..298f0e2
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt
@@ -0,0 +1,174 @@
+                                Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/README.md b/newt/Godeps/_workspace/src/github.com/spf13/cobra/README.md
new file mode 100644
index 0000000..b1fb088
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/README.md
@@ -0,0 +1,485 @@
+# Cobra
+
+A Commander for modern go CLI interactions
+
+[![Build Status](https://travis-ci.org/spf13/cobra.svg)](https://travis-ci.org/spf13/cobra)
+
+## Overview
+
+Cobra is a commander providing a simple interface to create powerful modern CLI
+interfaces similar to git & go tools. In addition to providing an interface, Cobra
+simultaneously provides a controller to organize your application code.
+
+Inspired by go, go-Commander, gh and subcommand, Cobra improves on these by
+providing **fully posix compliant flags** (including short & long versions),
+**nesting commands**, and the ability to **define your own help and usage** for any or
+all commands.
+
+Cobra has an exceptionally clean interface and simple design without needless
+constructors or initialization methods.
+
+Applications built with Cobra commands are designed to be as user friendly as
+possible. Flags can be placed before or after the command (as long as a
+confusing space isn’t provided). Both short and long flags can be used. A
+command need not even be fully typed. The shortest unambiguous string will
+suffice. Help is automatically generated and available for the application or
+for a specific command using either the help command or the --help flag.
+
+## Concepts
+
+Cobra is built on a structure of commands & flags.
+
+**Commands** represent actions and **Flags** are modifiers for those actions.
+
+In the following example 'server' is a command and 'port' is a flag.
+
+    hugo server --port=1313
+
+### Commands
+
+Command is the central point of the application. Each interaction that
+the application supports will be contained in a Command. A command can
+have children commands and optionally run an action.
+
+In the example above 'server' is the command
+
+A Command has the following structure:
+
+    type Command struct {
+        Use string // The one-line usage message.
+        Short string // The short description shown in the 'help' output.
+        Long string // The long message shown in the 'help <this-command>' output.
+        Run func(cmd *Command, args []string) // Run runs the command.
+    }
+
+### Flags
+
+A Flag is a way to modify the behavior of an command. Cobra supports
+fully posix compliant flags as well as the go flag package. 
+A Cobra command can define flags that persist through to children commands
+and flags that are only available to that command.
+
+In the example above 'port' is the flag.
+
+Flag functionality is provided by the [pflag
+library](https://github.com/ogier/pflag), a fork of the flag standard library
+which maintains the same interface while adding posix compliance.
+
+## Usage
+
+Cobra works by creating a set of commands and then organizing them into a tree.
+The tree defines the structure of the application.
+
+Once each command is defined with it's corresponding flags, then the
+tree is assigned to the commander which is finally executed.
+
+### Installing
+Using Cobra is easy. First use go get to install the latest version
+of the library.
+
+    $ go get github.com/spf13/cobra
+
+Next include cobra in your application.
+
+    import "github.com/spf13/cobra"
+
+### Create the root command
+
+The root command represents your binary itself.
+
+Cobra doesn't require any special constructors. Simply create your commands.
+
+    var HugoCmd = &cobra.Command{
+        Use:   "hugo",
+        Short: "Hugo is a very fast static site generator",
+        Long: `A Fast and Flexible Static Site Generator built with
+                love by spf13 and friends in Go.
+                Complete documentation is available at http://hugo.spf13.com`,
+        Run: func(cmd *cobra.Command, args []string) {
+            // Do Stuff Here
+        },
+    }
+
+### Create additional commands
+
+Additional commands can be defined.
+
+    var versionCmd = &cobra.Command{
+        Use:   "version",
+        Short: "Print the version number of Hugo",
+        Long:  `All software has versions. This is Hugo's`,
+        Run: func(cmd *cobra.Command, args []string) {
+            fmt.Println("Hugo Static Site Generator v0.9 -- HEAD")
+        },
+    }
+
+### Attach command to its parent
+In this example we are attaching it to the root, but commands can be attached at any level.
+
+	HugoCmd.AddCommand(versionCmd)
+
+### Assign flags to a command
+
+Since the flags are defined and used in different locations, we need to
+define a variable outside with the correct scope to assign the flag to
+work with.
+
+    var Verbose bool
+    var Source string
+
+There are two different approaches to assign a flag.
+
+#### Persistent Flags
+
+A flag can be 'persistent' meaning that this flag will be available to the
+command it's assigned to as well as every command under that command. For
+global flags assign a flag as a persistent flag on the root.
+
+	HugoCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output")
+
+#### Local Flags
+
+A flag can also be assigned locally which will only apply to that specific command.
+
+	HugoCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from")
+
+### Remove a command from its parent
+
+Removing a command is not a common action in simple programs but it allows 3rd parties to customize an existing command tree.
+
+In this example, we remove the existing `VersionCmd` command of an existing root command, and we replace it by our own version.
+
+	mainlib.RootCmd.RemoveCommand(mainlib.VersionCmd)
+	mainlib.RootCmd.AddCommand(versionCmd)
+
+### Once all commands and flags are defined, Execute the commands
+
+Execute should be run on the root for clarity, though it can be called on any command.
+
+    HugoCmd.Execute()
+
+## Example
+
+In the example below we have defined three commands. Two are at the top level
+and one (cmdTimes) is a child of one of the top commands. In this case the root
+is not executable meaning that a subcommand is required. This is accomplished
+by not providing a 'Run' for the 'rootCmd'.
+
+We have only defined one flag for a single command.
+
+More documentation about flags is available at https://github.com/spf13/pflag
+
+    import(
+        "github.com/spf13/cobra"
+        "fmt"
+        "strings"
+    )
+
+    func main() {
+
+        var echoTimes int
+
+        var cmdPrint = &cobra.Command{
+            Use:   "print [string to print]",
+            Short: "Print anything to the screen",
+            Long:  `print is for printing anything back to the screen.
+            For many years people have printed back to the screen.
+            `,
+            Run: func(cmd *cobra.Command, args []string) {
+                fmt.Println("Print: " + strings.Join(args, " "))
+            },
+        }
+
+        var cmdEcho = &cobra.Command{
+            Use:   "echo [string to echo]",
+            Short: "Echo anything to the screen",
+            Long:  `echo is for echoing anything back.
+            Echo works a lot like print, except it has a child command.
+            `,
+            Run: func(cmd *cobra.Command, args []string) {
+                fmt.Println("Print: " + strings.Join(args, " "))
+            },
+        }
+
+        var cmdTimes = &cobra.Command{
+            Use:   "times [# times] [string to echo]",
+            Short: "Echo anything to the screen more times",
+            Long:  `echo things multiple times back to the user by providing
+            a count and a string.`,
+            Run: func(cmd *cobra.Command, args []string) {
+                for i:=0; i < echoTimes; i++ {
+                    fmt.Println("Echo: " + strings.Join(args, " "))
+                }
+            },
+        }
+
+        cmdTimes.Flags().IntVarP(&echoTimes, "times", "t", 1, "times to echo the input")
+
+        var rootCmd = &cobra.Command{Use: "app"}
+        rootCmd.AddCommand(cmdPrint, cmdEcho)
+        cmdEcho.AddCommand(cmdTimes)
+        rootCmd.Execute()
+    }
+
+For a more complete example of a larger application, please checkout [Hugo](http://hugo.spf13.com)
+
+## The Help Command
+
+Cobra automatically adds a help command to your application when you have subcommands.
+This will be called when a user runs 'app help'. Additionally help will also
+support all other commands as input. Say for instance you have a command called
+'create' without any additional configuration cobra will work when 'app help
+create' is called.  Every command will automatically have the '--help' flag added.
+
+### Example
+
+The following output is automatically generated by cobra. Nothing beyond the
+command and flag definitions are needed.
+
+    > hugo help
+
+    A Fast and Flexible Static Site Generator built with
+    love by spf13 and friends in Go.
+
+    Complete documentation is available at http://hugo.spf13.com
+
+    Usage:
+      hugo [flags]
+      hugo [command]
+
+    Available Commands:
+      server          :: Hugo runs it's own a webserver to render the files
+      version         :: Print the version number of Hugo
+      check           :: Check content in the source directory
+      benchmark       :: Benchmark hugo by building a site a number of times
+      help [command]  :: Help about any command
+
+     Available Flags:
+      -b, --base-url="": hostname (and path) to the root eg. http://spf13.com/
+      -D, --build-drafts=false: include content marked as draft
+          --config="": config file (default is path/config.yaml|json|toml)
+      -d, --destination="": filesystem path to write files to
+      -s, --source="": filesystem path to read files relative from
+          --stepAnalysis=false: display memory and timing of different steps of the program
+          --uglyurls=false: if true, use /filename.html instead of /filename/
+      -v, --verbose=false: verbose output
+      -w, --watch=false: watch filesystem for changes and recreate as needed
+
+    Use "hugo help [command]" for more information about that command.
+
+
+
+Help is just a command like any other. There is no special logic or behavior
+around it. In fact you can provide your own if you want.
+
+### Defining your own help
+
+You can provide your own Help command or you own template for the default command to use.
+
+The default help command is 
+
+    func (c *Command) initHelp() {
+        if c.helpCommand == nil {
+            c.helpCommand = &Command{
+                Use:   "help [command]",
+                Short: "Help about any command",
+                Long: `Help provides help for any command in the application.
+        Simply type ` + c.Name() + ` help [path to command] for full details.`,
+                Run: c.HelpFunc(),
+            }
+        }
+        c.AddCommand(c.helpCommand)
+    }
+
+You can provide your own command, function or template through the following methods.
+
+    command.SetHelpCommand(cmd *Command)
+
+    command.SetHelpFunc(f func(*Command, []string))
+
+    command.SetHelpTemplate(s string)
+
+The latter two will also apply to any children commands.
+
+## Usage
+
+When the user provides an invalid flag or invalid command Cobra responds by
+showing the user the 'usage'
+
+### Example
+You may recognize this from the help above. That's because the default help
+embeds the usage as part of it's output.
+
+    Usage:
+      hugo [flags]
+      hugo [command]
+
+    Available Commands:
+      server          Hugo runs it's own a webserver to render the files
+      version         Print the version number of Hugo
+      check           Check content in the source directory
+      benchmark       Benchmark hugo by building a site a number of times
+      help [command]  Help about any command
+
+     Available Flags:
+      -b, --base-url="": hostname (and path) to the root eg. http://spf13.com/
+      -D, --build-drafts=false: include content marked as draft
+          --config="": config file (default is path/config.yaml|json|toml)
+      -d, --destination="": filesystem path to write files to
+      -s, --source="": filesystem path to read files relative from
+          --stepAnalysis=false: display memory and timing of different steps of the program
+          --uglyurls=false: if true, use /filename.html instead of /filename/
+      -v, --verbose=false: verbose output
+      -w, --watch=false: watch filesystem for changes and recreate as needed
+
+### Defining your own usage
+You can provide your own usage function or template for cobra to use.
+
+The default usage function is
+
+		return func(c *Command) error {
+			err := tmpl(c.Out(), c.UsageTemplate(), c)
+			return err
+		}
+
+Like help the function and template are over ridable through public methods.
+
+    command.SetUsageFunc(f func(*Command) error)
+
+    command.SetUsageTemplate(s string)
+
+## PreRun or PostRun Hooks
+
+It is possible to run functions before or after the main `Run` function of your command. The `PersistentPreRun` and `PreRun` functions will be executed before `Run`. `PersistendPostRun` and `PostRun` will be executed after `Run`.  The `Persistent*Run` functions will be inherrited by children if they do not declare their own.  These function are run in the following order:
+
+- `PersistentPreRun`
+- `PreRun`
+- `Run`
+- `PostRun`
+- `PersistenPostRun`
+
+And example of two commands which use all of these features is below.  When the subcommand in executed it will run the root command's `PersistentPreRun` but not the root command's `PersistentPostRun`
+
+```go
+package main
+
+import (
+	"fmt"
+
+	"github.com/spf13/cobra"
+)
+
+func main() {
+
+	var rootCmd = &cobra.Command{
+		Use:   "root [sub]",
+		Short: "My root command",
+		PersistentPreRun: func(cmd *cobra.Command, args []string) {
+			fmt.Printf("Inside rootCmd PersistentPreRun with args: %v\n", args)
+		},
+		PreRun: func(cmd *cobra.Command, args []string) {
+			fmt.Printf("Inside rootCmd PreRun with args: %v\n", args)
+		},
+		Run: func(cmd *cobra.Command, args []string) {
+			fmt.Printf("Inside rootCmd Run with args: %v\n", args)
+		},
+		PostRun: func(cmd *cobra.Command, args []string) {
+			fmt.Printf("Inside rootCmd PostRun with args: %v\n", args)
+		},
+		PersistentPostRun: func(cmd *cobra.Command, args []string) {
+			fmt.Printf("Inside rootCmd PersistentPostRun with args: %v\n", args)
+		},
+	}
+
+	var subCmd = &cobra.Command{
+		Use:   "sub [no options!]",
+		Short: "My sub command",
+		PreRun: func(cmd *cobra.Command, args []string) {
+			fmt.Printf("Inside subCmd PreRun with args: %v\n", args)
+		},
+		Run: func(cmd *cobra.Command, args []string) {
+			fmt.Printf("Inside subCmd Run with args: %v\n", args)
+		},
+		PostRun: func(cmd *cobra.Command, args []string) {
+			fmt.Printf("Inside subCmd PostRun with args: %v\n", args)
+		},
+		PersistentPostRun: func(cmd *cobra.Command, args []string) {
+			fmt.Printf("Inside subCmd PersistentPostRun with args: %v\n", args)
+		},
+	}
+
+	rootCmd.AddCommand(subCmd)
+
+	rootCmd.SetArgs([]string{""})
+	_ = rootCmd.Execute()
+	fmt.Print("\n")
+	rootCmd.SetArgs([]string{"sub", "arg1", "arg2"})
+	_ = rootCmd.Execute()
+}
+```
+
+## Generating markdown formatted documentation for your command
+
+Cobra can generate a markdown formatted document based on the subcommands, flags, etc. A simple example of how to do this for your command can be found in [Markdown Docs](md_docs.md)
+
+## Generating bash completions for your command
+
+Cobra can generate a bash completions file. If you add more information to your command these completions can be amazingly powerful and flexible.  Read more about [Bash Completions](bash_completions.md)
+
+## Debugging
+
+Cobra provides a ‘DebugFlags’ method on a command which when called will print
+out everything Cobra knows about the flags for each command
+
+### Example
+
+    command.DebugFlags()
+
+## Release Notes
+* **0.9.0** June 17, 2014
+  * flags can appears anywhere in the args (provided they are unambiguous)
+  * --help prints usage screen for app or command
+  * Prefix matching for commands
+  * Cleaner looking help and usage output
+  * Extensive test suite
+* **0.8.0** Nov 5, 2013
+  * Reworked interface to remove commander completely
+  * Command now primary structure
+  * No initialization needed
+  * Usage & Help templates & functions definable at any level
+  * Updated Readme
+* **0.7.0** Sept 24, 2013
+  * Needs more eyes
+  * Test suite
+  * Support for automatic error messages
+  * Support for help command
+  * Support for printing to any io.Writer instead of os.Stderr
+  * Support for persistent flags which cascade down tree
+  * Ready for integration into Hugo
+* **0.1.0** Sept 3, 2013
+  * Implement first draft
+
+## ToDo
+* Launch proper documentation site
+
+## Contributing
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Add some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
+
+## Contributors
+
+Names in no particular order:
+
+* [spf13](https://github.com/spf13)
+
+## License
+
+Cobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt)
+
+
+[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/spf13/cobra/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go b/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go
new file mode 100644
index 0000000..3a421bc
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go
@@ -0,0 +1,370 @@
+package cobra
+
+import (
+	"bytes"
+	"fmt"
+	"os"
+	"sort"
+	"strings"
+
+	"github.com/spf13/pflag"
+)
+
+const (
+	BashCompFilenameExt     = "cobra_annotation_bash_completion_filename_extentions"
+	BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required_flag"
+)
+
+func preamble(out *bytes.Buffer) {
+	fmt.Fprintf(out, `#!/bin/bash
+
+
+__debug()
+{
+    if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
+        echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
+    fi
+}
+
+__index_of_word()
+{
+    local w word=$1
+    shift
+    index=0
+    for w in "$@"; do
+        [[ $w = "$word" ]] && return
+        index=$((index+1))
+    done
+    index=-1
+}
+
+__contains_word()
+{
+    local w word=$1; shift
+    for w in "$@"; do
+        [[ $w = "$word" ]] && return
+    done
+    return 1
+}
+
+__handle_reply()
+{
+    __debug "${FUNCNAME}"
+    case $cur in
+        -*)
+            compopt -o nospace
+            local allflags
+            if [ ${#must_have_one_flag[@]} -ne 0 ]; then
+                allflags=("${must_have_one_flag[@]}")
+            else
+                allflags=("${flags[*]} ${two_word_flags[*]}")
+            fi
+            COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") )
+            [[ $COMPREPLY == *= ]] || compopt +o nospace
+            return 0;
+            ;;
+    esac
+
+    # check if we are handling a flag with special work handling
+    local index
+    __index_of_word "${prev}" "${flags_with_completion[@]}"
+    if [[ ${index} -ge 0 ]]; then
+        ${flags_completion[${index}]}
+        return
+    fi
+
+    # we are parsing a flag and don't have a special handler, no completion
+    if [[ ${cur} != "${words[cword]}" ]]; then
+        return
+    fi
+
+    local completions
+    if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
+        completions=("${must_have_one_flag[@]}")
+    elif [[ ${#must_have_one_noun[@]} -ne 0 ]]; then
+        completions=("${must_have_one_noun[@]}")
+    else
+        completions=("${commands[@]}")
+    fi
+    COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") )
+
+    if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
+        declare -F __custom_func >/dev/null && __custom_func
+    fi
+}
+
+# The arguments should be in the form "ext1|ext2|extn"
+__handle_filename_extension_flag()
+{
+    local ext="$1"
+    _filedir "@(${ext})"
+}
+
+__handle_flag()
+{
+    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
+
+    # if a command required a flag, and we found it, unset must_have_one_flag()
+    local flagname=${words[c]}
+    # if the word contained an =
+    if [[ ${words[c]} == *"="* ]]; then
+        flagname=${flagname%%=*} # strip everything after the =
+        flagname="${flagname}=" # but put the = back
+    fi
+    __debug "${FUNCNAME}: looking for ${flagname}"
+    if __contains_word "${flagname}" "${must_have_one_flag[@]}"; then
+        must_have_one_flag=()
+    fi
+
+    # skip the argument to a two word flag
+    if __contains_word "${words[c]}" "${two_word_flags[@]}"; then
+        c=$((c+1))
+        # if we are looking for a flags value, don't show commands
+        if [[ $c -eq $cword ]]; then
+            commands=()
+        fi
+    fi
+
+    # skip the flag itself
+    c=$((c+1))
+
+}
+
+__handle_noun()
+{
+    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
+
+    if __contains_word "${words[c]}" "${must_have_one_noun[@]}"; then
+        must_have_one_noun=()
+    fi
+
+    nouns+=("${words[c]}")
+    c=$((c+1))
+}
+
+__handle_command()
+{
+    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
+
+    local next_command
+    if [[ -n ${last_command} ]]; then
+        next_command="_${last_command}_${words[c]}"
+    else
+        next_command="_${words[c]}"
+    fi
+    c=$((c+1))
+    __debug "${FUNCNAME}: looking for ${next_command}"
+    declare -F $next_command >/dev/null && $next_command
+}
+
+__handle_word()
+{
+    if [[ $c -ge $cword ]]; then
+        __handle_reply
+	return
+    fi
+    __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
+    if [[ "${words[c]}" == -* ]]; then
+	__handle_flag
+    elif __contains_word "${words[c]}" "${commands[@]}"; then
+        __handle_command
+    else
+        __handle_noun
+    fi
+    __handle_word
+}
+
+`)
+}
+
+func postscript(out *bytes.Buffer, name string) {
+	fmt.Fprintf(out, "__start_%s()\n", name)
+	fmt.Fprintf(out, `{
+    local cur prev words cword
+    _init_completion -s || return
+
+    local c=0
+    local flags=()
+    local two_word_flags=()
+    local flags_with_completion=()
+    local flags_completion=()
+    local commands=("%s")
+    local must_have_one_flag=()
+    local must_have_one_noun=()
+    local last_command
+    local nouns=()
+
+    __handle_word
+}
+
+`, name)
+	fmt.Fprintf(out, "complete -F __start_%s %s\n", name, name)
+	fmt.Fprintf(out, "# ex: ts=4 sw=4 et filetype=sh\n")
+}
+
+func writeCommands(cmd *Command, out *bytes.Buffer) {
+	fmt.Fprintf(out, "    commands=()\n")
+	for _, c := range cmd.Commands() {
+		if len(c.Deprecated) > 0 {
+			continue
+		}
+		fmt.Fprintf(out, "    commands+=(%q)\n", c.Name())
+	}
+	fmt.Fprintf(out, "\n")
+}
+
+func writeFlagHandler(name string, annotations map[string][]string, out *bytes.Buffer) {
+	for key, value := range annotations {
+		switch key {
+		case BashCompFilenameExt:
+			fmt.Fprintf(out, "    flags_with_completion+=(%q)\n", name)
+
+			if len(value) > 0 {
+				ext := "__handle_filename_extension_flag " + strings.Join(value, "|")
+				fmt.Fprintf(out, "    flags_completion+=(%q)\n", ext)
+			} else {
+				ext := "_filedir"
+				fmt.Fprintf(out, "    flags_completion+=(%q)\n", ext)
+			}
+		}
+	}
+}
+
+func writeShortFlag(flag *pflag.Flag, out *bytes.Buffer) {
+	b := (flag.Value.Type() == "bool")
+	name := flag.Shorthand
+	format := "    "
+	if !b {
+		format += "two_word_"
+	}
+	format += "flags+=(\"-%s\")\n"
+	fmt.Fprintf(out, format, name)
+	writeFlagHandler("-"+name, flag.Annotations, out)
+}
+
+func writeFlag(flag *pflag.Flag, out *bytes.Buffer) {
+	b := (flag.Value.Type() == "bool")
+	name := flag.Name
+	format := "    flags+=(\"--%s"
+	if !b {
+		format += "="
+	}
+	format += "\")\n"
+	fmt.Fprintf(out, format, name)
+	writeFlagHandler("--"+name, flag.Annotations, out)
+}
+
+func writeFlags(cmd *Command, out *bytes.Buffer) {
+	fmt.Fprintf(out, `    flags=()
+    two_word_flags=()
+    flags_with_completion=()
+    flags_completion=()
+
+`)
+	cmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) {
+		writeFlag(flag, out)
+		if len(flag.Shorthand) > 0 {
+			writeShortFlag(flag, out)
+		}
+	})
+
+	fmt.Fprintf(out, "\n")
+}
+
+func writeRequiredFlag(cmd *Command, out *bytes.Buffer) {
+	fmt.Fprintf(out, "    must_have_one_flag=()\n")
+	flags := cmd.NonInheritedFlags()
+	flags.VisitAll(func(flag *pflag.Flag) {
+		for key, _ := range flag.Annotations {
+			switch key {
+			case BashCompOneRequiredFlag:
+				format := "    must_have_one_flag+=(\"--%s"
+				b := (flag.Value.Type() == "bool")
+				if !b {
+					format += "="
+				}
+				format += "\")\n"
+				fmt.Fprintf(out, format, flag.Name)
+
+				if len(flag.Shorthand) > 0 {
+					fmt.Fprintf(out, "    must_have_one_flag+=(\"-%s\")\n", flag.Shorthand)
+				}
+			}
+		}
+	})
+}
+
+func writeRequiredNoun(cmd *Command, out *bytes.Buffer) {
+	fmt.Fprintf(out, "    must_have_one_noun=()\n")
+	sort.Sort(sort.StringSlice(cmd.ValidArgs))
+	for _, value := range cmd.ValidArgs {
+		fmt.Fprintf(out, "    must_have_one_noun+=(%q)\n", value)
+	}
+}
+
+func gen(cmd *Command, out *bytes.Buffer) {
+	for _, c := range cmd.Commands() {
+		if len(c.Deprecated) > 0 {
+			continue
+		}
+		gen(c, out)
+	}
+	commandName := cmd.CommandPath()
+	commandName = strings.Replace(commandName, " ", "_", -1)
+	fmt.Fprintf(out, "_%s()\n{\n", commandName)
+	fmt.Fprintf(out, "    last_command=%q\n", commandName)
+	writeCommands(cmd, out)
+	writeFlags(cmd, out)
+	writeRequiredFlag(cmd, out)
+	writeRequiredNoun(cmd, out)
+	fmt.Fprintf(out, "}\n\n")
+}
+
+func (cmd *Command) GenBashCompletion(out *bytes.Buffer) {
+	preamble(out)
+	if len(cmd.BashCompletionFunction) > 0 {
+		fmt.Fprintf(out, "%s\n", cmd.BashCompletionFunction)
+	}
+	gen(cmd, out)
+	postscript(out, cmd.Name())
+}
+
+func (cmd *Command) GenBashCompletionFile(filename string) error {
+	out := new(bytes.Buffer)
+
+	cmd.GenBashCompletion(out)
+
+	outFile, err := os.Create(filename)
+	if err != nil {
+		return err
+	}
+	defer outFile.Close()
+
+	_, err = outFile.Write(out.Bytes())
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag, if it exists.
+func (cmd *Command) MarkFlagRequired(name string) error {
+	return MarkFlagRequired(cmd.Flags(), name)
+}
+
+// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag in the flag set, if it exists.
+func MarkFlagRequired(flags *pflag.FlagSet, name string) error {
+	return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"})
+}
+
+// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists.
+// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided.
+func (cmd *Command) MarkFlagFilename(name string, extensions ...string) error {
+	return MarkFlagFilename(cmd.Flags(), name, extensions...)
+}
+
+// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag in the flag set, if it exists.
+// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided.
+func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error {
+	return flags.SetAnnotation(name, BashCompFilenameExt, extensions)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md b/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md
new file mode 100644
index 0000000..204704e
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.md
@@ -0,0 +1,149 @@
+# Generating Bash Completions For Your Own cobra.Command
+
+Generating bash completions from a cobra command is incredibly easy. An actual program which does so for the kubernetes kubectl binary is as follows:
+
+```go
+package main
+
+import (
+        "io/ioutil"
+        "os"
+
+        "github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd"
+)
+
+func main() {
+        kubectl := cmd.NewFactory(nil).NewKubectlCommand(os.Stdin, ioutil.Discard, ioutil.Discard)
+        kubectl.GenBashCompletionFile("out.sh")
+}
+```
+
+That will get you completions of subcommands and flags. If you make additional annotations to your code, you can get even more intelligent and flexible behavior.
+
+## Creating your own custom functions
+
+Some more actual code that works in kubernetes:
+
+```bash
+const (
+        bash_completion_func = `__kubectl_parse_get()
+{
+    local kubectl_output out
+    if kubectl_output=$(kubectl get --no-headers "$1" 2>/dev/null); then
+        out=($(echo "${kubectl_output}" | awk '{print $1}'))
+        COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) )
+    fi
+}
+
+__kubectl_get_resource()
+{
+    if [[ ${#nouns[@]} -eq 0 ]]; then
+        return 1
+    fi
+    __kubectl_parse_get ${nouns[${#nouns[@]} -1]}
+    if [[ $? -eq 0 ]]; then
+        return 0
+    fi
+}
+
+__custom_func() {
+    case ${last_command} in
+        kubectl_get | kubectl_describe | kubectl_delete | kubectl_stop)
+            __kubectl_get_resource
+            return
+            ;;
+        *)
+            ;;
+    esac
+}
+`)
+```
+
+And then I set that in my command definition:
+
+```go
+cmds := &cobra.Command{
+	Use:   "kubectl",
+	Short: "kubectl controls the Kubernetes cluster manager",
+	Long: `kubectl controls the Kubernetes cluster manager.
+
+Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,
+	Run: runHelp,
+	BashCompletionFunction: bash_completion_func,
+}
+```
+
+The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__custom_func()` to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`.  `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`.  So it will call `__kubectl_parse_get pod`.  `__kubectl_parse_get` will actually call out to kubernetes and get any pods.  It will then set `COMPREPLY` to valid pods!
+
+## Have the completions code complete your 'nouns'
+
+In the above example "pod" was assumed to already be typed. But if you want `kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them. Simplified code from `kubectl get` looks like:
+
+```go
+validArgs []string = { "pods", "nodes", "services", "replicationControllers" }
+
+cmd := &cobra.Command{
+	Use:     "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)",
+	Short:   "Display one or many resources",
+	Long:    get_long,
+	Example: get_example,
+	Run: func(cmd *cobra.Command, args []string) {
+		err := RunGet(f, out, cmd, args)
+		util.CheckErr(err)
+	},
+	ValidArgs: validArgs,
+}
+```
+
+Notice we put the "ValidArgs" on the "get" subcommand. Doing so will give results like
+
+```bash
+# kubectl get [tab][tab]
+nodes                 pods                    replicationControllers  services
+```
+
+## Mark flags as required
+
+Most of the time completions will only show subcommands. But if a flag is required to make a subcommand work, you probably want it to show up when the user types [tab][tab].  Marking a flag as 'Required' is incredibly easy.
+
+```go
+cmd.MarkFlagRequired("pod")
+cmd.MarkFlagRequired("container")
+```
+
+and you'll get something like
+
+```bash
+# kubectl exec [tab][tab][tab]
+-c            --container=  -p            --pod=  
+```
+
+# Specify valid filename extensions for flags that take a filename
+
+In this example we use --filename= and expect to get a json or yaml file as the argument. To make this easier we annotate the --filename flag with valid filename extensions.
+
+```go
+	annotations := []string{"json", "yaml", "yml"}
+	annotation := make(map[string][]string)
+	annotation[cobra.BashCompFilenameExt] = annotations
+
+	flag := &pflag.Flag{
+		Name:        "filename",
+		Shorthand:   "f",
+		Usage:       usage,
+		Value:       value,
+		DefValue:    value.String(),
+		Annotations: annotation,
+	}
+	cmd.Flags().AddFlag(flag)
+```
+
+Now when you run a command with this filename flag you'll get something like
+
+```bash
+# kubectl create -f 
+test/                         example/                      rpmbuild/
+hello.yml                     test.json
+```
+
+So while there are many other files in the CWD it only shows me subdirs and those with valid extensions.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go b/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go
new file mode 100644
index 0000000..acb6d81
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go
@@ -0,0 +1,80 @@
+package cobra
+
+import (
+	"bytes"
+	"fmt"
+	"os"
+	"strings"
+	"testing"
+)
+
+var _ = fmt.Println
+var _ = os.Stderr
+
+func checkOmit(t *testing.T, found, unexpected string) {
+	if strings.Contains(found, unexpected) {
+		t.Errorf("Unexpected response.\nGot: %q\nBut should not have!\n", unexpected)
+	}
+}
+
+func check(t *testing.T, found, expected string) {
+	if !strings.Contains(found, expected) {
+		t.Errorf("Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
+	}
+}
+
+// World worst custom function, just keep telling you to enter hello!
+const (
+	bash_completion_func = `__custom_func() {
+COMPREPLY=( "hello" )
+}
+`
+)
+
+func TestBashCompletions(t *testing.T) {
+	c := initializeWithRootCmd()
+	cmdEcho.AddCommand(cmdTimes)
+	c.AddCommand(cmdEcho, cmdPrint, cmdDeprecated)
+
+	// custom completion function
+	c.BashCompletionFunction = bash_completion_func
+
+	// required flag
+	c.MarkFlagRequired("introot")
+
+	// valid nouns
+	validArgs := []string{"pods", "nodes", "services", "replicationControllers"}
+	c.ValidArgs = validArgs
+
+	// filename
+	var flagval string
+	c.Flags().StringVar(&flagval, "filename", "", "Enter a filename")
+	c.MarkFlagFilename("filename", "json", "yaml", "yml")
+
+	// filename extensions
+	var flagvalExt string
+	c.Flags().StringVar(&flagvalExt, "filename-ext", "", "Enter a filename (extension limited)")
+	c.MarkFlagFilename("filename-ext")
+
+	out := new(bytes.Buffer)
+	c.GenBashCompletion(out)
+	str := out.String()
+
+	check(t, str, "_cobra-test")
+	check(t, str, "_cobra-test_echo")
+	check(t, str, "_cobra-test_echo_times")
+	check(t, str, "_cobra-test_print")
+
+	// check for required flags
+	check(t, str, `must_have_one_flag+=("--introot=")`)
+	// check for custom completion function
+	check(t, str, `COMPREPLY=( "hello" )`)
+	// check for required nouns
+	check(t, str, `must_have_one_noun+=("pods")`)
+	// check for filename extension flags
+	check(t, str, `flags_completion+=("_filedir")`)
+	// check for filename extension flags
+	check(t, str, `flags_completion+=("__handle_filename_extension_flag json|yaml|yml")`)
+
+	checkOmit(t, str, cmdDeprecated.Name())
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go b/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go
new file mode 100644
index 0000000..78b92b0
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra.go
@@ -0,0 +1,112 @@
+// Copyright © 2013 Steve Francia <sp...@spf13.com>.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Commands similar to git, go tools and other modern CLI tools
+// inspired by go, go-Commander, gh and subcommand
+
+package cobra
+
+import (
+	"fmt"
+	"io"
+	"reflect"
+	"strconv"
+	"strings"
+	"text/template"
+)
+
+var initializers []func()
+
+// automatic prefix matching can be a dangerous thing to automatically enable in CLI tools.
+// Set this to true to enable it
+var EnablePrefixMatching bool = false
+
+// enables an information splash screen on Windows if the CLI is started from explorer.exe.
+var EnableWindowsMouseTrap bool = true
+
+var MousetrapHelpText string = `This is a command line tool
+
+You need to open cmd.exe and run it from there.
+`
+
+//OnInitialize takes a series of func() arguments and appends them to a slice of func().
+func OnInitialize(y ...func()) {
+	for _, x := range y {
+		initializers = append(initializers, x)
+	}
+}
+
+//Gt takes two types and checks whether the first type is greater than the second. In case of types Arrays, Chans,
+//Maps and Slices, Gt will compare their lengths. Ints are compared directly while strings are first parsed as
+//ints and then compared.
+func Gt(a interface{}, b interface{}) bool {
+	var left, right int64
+	av := reflect.ValueOf(a)
+
+	switch av.Kind() {
+	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
+		left = int64(av.Len())
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		left = av.Int()
+	case reflect.String:
+		left, _ = strconv.ParseInt(av.String(), 10, 64)
+	}
+
+	bv := reflect.ValueOf(b)
+
+	switch bv.Kind() {
+	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
+		right = int64(bv.Len())
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		right = bv.Int()
+	case reflect.String:
+		right, _ = strconv.ParseInt(bv.String(), 10, 64)
+	}
+
+	return left > right
+}
+
+//Eq takes two types and checks whether they are equal. Supported types are int and string. Unsupported types will panic.
+func Eq(a interface{}, b interface{}) bool {
+	av := reflect.ValueOf(a)
+	bv := reflect.ValueOf(b)
+
+	switch av.Kind() {
+	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
+		panic("Eq called on unsupported type")
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		return av.Int() == bv.Int()
+	case reflect.String:
+		return av.String() == bv.String()
+	}
+	return false
+}
+
+//rpad adds padding to the right of a string
+func rpad(s string, padding int) string {
+	template := fmt.Sprintf("%%-%ds", padding)
+	return fmt.Sprintf(template, s)
+}
+
+// tmpl executes the given template text on data, writing the result to w.
+func tmpl(w io.Writer, text string, data interface{}) error {
+	t := template.New("top")
+	t.Funcs(template.FuncMap{
+		"trim": strings.TrimSpace,
+		"rpad": rpad,
+		"gt":   Gt,
+		"eq":   Eq,
+	})
+	template.Must(t.Parse(text))
+	return t.Execute(w, data)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go b/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go
new file mode 100644
index 0000000..f181a07
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go
@@ -0,0 +1,965 @@
+package cobra
+
+import (
+	"bytes"
+	"fmt"
+	"os"
+	"reflect"
+	"runtime"
+	"strings"
+	"testing"
+
+	"github.com/spf13/pflag"
+)
+
+var _ = fmt.Println
+var _ = os.Stderr
+
+var tp, te, tt, t1, tr []string
+var rootPersPre, echoPre, echoPersPre, timesPersPre []string
+var flagb1, flagb2, flagb3, flagbr, flagbp bool
+var flags1, flags2a, flags2b, flags3 string
+var flagi1, flagi2, flagi3, flagir int
+var globalFlag1 bool
+var flagEcho, rootcalled bool
+var versionUsed int
+
+const strtwoParentHelp = "help message for parent flag strtwo"
+const strtwoChildHelp = "help message for child flag strtwo"
+
+var cmdPrint = &Command{
+	Use:   "print [string to print]",
+	Short: "Print anything to the screen",
+	Long:  `an absolutely utterly useless command for testing.`,
+	Run: func(cmd *Command, args []string) {
+		tp = args
+	},
+}
+
+var cmdEcho = &Command{
+	Use:     "echo [string to echo]",
+	Aliases: []string{"say"},
+	Short:   "Echo anything to the screen",
+	Long:    `an utterly useless command for testing.`,
+	Example: "Just run cobra-test echo",
+	PersistentPreRun: func(cmd *Command, args []string) {
+		echoPersPre = args
+	},
+	PreRun: func(cmd *Command, args []string) {
+		echoPre = args
+	},
+	Run: func(cmd *Command, args []string) {
+		te = args
+	},
+}
+
+var cmdEchoSub = &Command{
+	Use:   "echosub [string to print]",
+	Short: "second sub command for echo",
+	Long:  `an absolutely utterly useless command for testing gendocs!.`,
+	Run: func(cmd *Command, args []string) {
+	},
+}
+
+var cmdDeprecated = &Command{
+	Use:        "deprecated [can't do anything here]",
+	Short:      "A command which is deprecated",
+	Long:       `an absolutely utterly useless command for testing deprecation!.`,
+	Deprecated: "Please use echo instead",
+	Run: func(cmd *Command, args []string) {
+	},
+}
+
+var cmdTimes = &Command{
+	Use:   "times [# times] [string to echo]",
+	Short: "Echo anything to the screen more times",
+	Long:  `a slightly useless command for testing.`,
+	PersistentPreRun: func(cmd *Command, args []string) {
+		timesPersPre = args
+	},
+	Run: func(cmd *Command, args []string) {
+		tt = args
+	},
+}
+
+var cmdRootNoRun = &Command{
+	Use:   "cobra-test",
+	Short: "The root can run it's own function",
+	Long:  "The root description for help",
+	PersistentPreRun: func(cmd *Command, args []string) {
+		rootPersPre = args
+	},
+}
+
+var cmdRootSameName = &Command{
+	Use:   "print",
+	Short: "Root with the same name as a subcommand",
+	Long:  "The root description for help",
+}
+
+var cmdRootWithRun = &Command{
+	Use:   "cobra-test",
+	Short: "The root can run it's own function",
+	Long:  "The root description for help",
+	Run: func(cmd *Command, args []string) {
+		tr = args
+		rootcalled = true
+	},
+}
+
+var cmdSubNoRun = &Command{
+	Use:   "subnorun",
+	Short: "A subcommand without a Run function",
+	Long:  "A long output about a subcommand without a Run function",
+}
+
+var cmdVersion1 = &Command{
+	Use:   "version",
+	Short: "Print the version number",
+	Long:  `First version of the version command`,
+	Run: func(cmd *Command, args []string) {
+		versionUsed = 1
+	},
+}
+
+var cmdVersion2 = &Command{
+	Use:   "version",
+	Short: "Print the version number",
+	Long:  `Second version of the version command`,
+	Run: func(cmd *Command, args []string) {
+		versionUsed = 2
+	},
+}
+
+func flagInit() {
+	cmdEcho.ResetFlags()
+	cmdPrint.ResetFlags()
+	cmdTimes.ResetFlags()
+	cmdRootNoRun.ResetFlags()
+	cmdRootSameName.ResetFlags()
+	cmdRootWithRun.ResetFlags()
+	cmdSubNoRun.ResetFlags()
+	cmdRootNoRun.PersistentFlags().StringVarP(&flags2a, "strtwo", "t", "two", strtwoParentHelp)
+	cmdEcho.Flags().IntVarP(&flagi1, "intone", "i", 123, "help message for flag intone")
+	cmdTimes.Flags().IntVarP(&flagi2, "inttwo", "j", 234, "help message for flag inttwo")
+	cmdPrint.Flags().IntVarP(&flagi3, "intthree", "i", 345, "help message for flag intthree")
+	cmdEcho.PersistentFlags().StringVarP(&flags1, "strone", "s", "one", "help message for flag strone")
+	cmdEcho.PersistentFlags().BoolVarP(&flagbp, "persistentbool", "p", false, "help message for flag persistentbool")
+	cmdTimes.PersistentFlags().StringVarP(&flags2b, "strtwo", "t", "2", strtwoChildHelp)
+	cmdPrint.PersistentFlags().StringVarP(&flags3, "strthree", "s", "three", "help message for flag strthree")
+	cmdEcho.Flags().BoolVarP(&flagb1, "boolone", "b", true, "help message for flag boolone")
+	cmdTimes.Flags().BoolVarP(&flagb2, "booltwo", "c", false, "help message for flag booltwo")
+	cmdPrint.Flags().BoolVarP(&flagb3, "boolthree", "b", true, "help message for flag boolthree")
+	cmdVersion1.ResetFlags()
+	cmdVersion2.ResetFlags()
+}
+
+func commandInit() {
+	cmdEcho.ResetCommands()
+	cmdPrint.ResetCommands()
+	cmdTimes.ResetCommands()
+	cmdRootNoRun.ResetCommands()
+	cmdRootSameName.ResetCommands()
+	cmdRootWithRun.ResetCommands()
+	cmdSubNoRun.ResetCommands()
+}
+
+func initialize() *Command {
+	tt, tp, te = nil, nil, nil
+	rootPersPre, echoPre, echoPersPre, timesPersPre = nil, nil, nil, nil
+
+	var c = cmdRootNoRun
+	flagInit()
+	commandInit()
+	return c
+}
+
+func initializeWithSameName() *Command {
+	tt, tp, te = nil, nil, nil
+	rootPersPre, echoPre, echoPersPre, timesPersPre = nil, nil, nil, nil
+	var c = cmdRootSameName
+	flagInit()
+	commandInit()
+	return c
+}
+
+func initializeWithRootCmd() *Command {
+	cmdRootWithRun.ResetCommands()
+	tt, tp, te, tr, rootcalled = nil, nil, nil, nil, false
+	flagInit()
+	cmdRootWithRun.Flags().BoolVarP(&flagbr, "boolroot", "b", false, "help message for flag boolroot")
+	cmdRootWithRun.Flags().IntVarP(&flagir, "introot", "i", 321, "help message for flag introot")
+	commandInit()
+	return cmdRootWithRun
+}
+
+type resulter struct {
+	Error   error
+	Output  string
+	Command *Command
+}
+
+func fullSetupTest(input string) resulter {
+	c := initializeWithRootCmd()
+
+	return fullTester(c, input)
+}
+
+func noRRSetupTest(input string) resulter {
+	c := initialize()
+
+	return fullTester(c, input)
+}
+
+func rootOnlySetupTest(input string) resulter {
+	c := initializeWithRootCmd()
+
+	return simpleTester(c, input)
+}
+
+func simpleTester(c *Command, input string) resulter {
+	buf := new(bytes.Buffer)
+	// Testing flag with invalid input
+	c.SetOutput(buf)
+	c.SetArgs(strings.Split(input, " "))
+
+	err := c.Execute()
+	output := buf.String()
+
+	return resulter{err, output, c}
+}
+
+func fullTester(c *Command, input string) resulter {
+	buf := new(bytes.Buffer)
+	// Testing flag with invalid input
+	c.SetOutput(buf)
+	cmdEcho.AddCommand(cmdTimes)
+	c.AddCommand(cmdPrint, cmdEcho, cmdSubNoRun, cmdDeprecated)
+	c.SetArgs(strings.Split(input, " "))
+
+	err := c.Execute()
+	output := buf.String()
+
+	return resulter{err, output, c}
+}
+
+func logErr(t *testing.T, found, expected string) {
+	out := new(bytes.Buffer)
+
+	_, _, line, ok := runtime.Caller(2)
+	if ok {
+		fmt.Fprintf(out, "Line: %d ", line)
+	}
+	fmt.Fprintf(out, "Unexpected response.\nExpecting to contain: \n %q\nGot:\n %q\n", expected, found)
+	t.Errorf(out.String())
+}
+
+func checkResultContains(t *testing.T, x resulter, check string) {
+	if !strings.Contains(x.Output, check) {
+		logErr(t, x.Output, check)
+	}
+}
+
+func checkResultOmits(t *testing.T, x resulter, check string) {
+	if strings.Contains(x.Output, check) {
+		logErr(t, x.Output, check)
+	}
+}
+
+func checkOutputContains(t *testing.T, c *Command, check string) {
+	buf := new(bytes.Buffer)
+	c.SetOutput(buf)
+	c.Execute()
+
+	if !strings.Contains(buf.String(), check) {
+		logErr(t, buf.String(), check)
+	}
+}
+
+func TestSingleCommand(t *testing.T) {
+	noRRSetupTest("print one two")
+
+	if te != nil || tt != nil {
+		t.Error("Wrong command called")
+	}
+	if tp == nil {
+		t.Error("Wrong command called")
+	}
+	if strings.Join(tp, " ") != "one two" {
+		t.Error("Command didn't parse correctly")
+	}
+}
+
+func TestChildCommand(t *testing.T) {
+	noRRSetupTest("echo times one two")
+
+	if te != nil || tp != nil {
+		t.Error("Wrong command called")
+	}
+	if tt == nil {
+		t.Error("Wrong command called")
+	}
+	if strings.Join(tt, " ") != "one two" {
+		t.Error("Command didn't parse correctly")
+	}
+}
+
+func TestCommandAlias(t *testing.T) {
+	noRRSetupTest("say times one two")
+
+	if te != nil || tp != nil {
+		t.Error("Wrong command called")
+	}
+	if tt == nil {
+		t.Error("Wrong command called")
+	}
+	if strings.Join(tt, " ") != "one two" {
+		t.Error("Command didn't parse correctly")
+	}
+}
+
+func TestPrefixMatching(t *testing.T) {
+	EnablePrefixMatching = true
+	noRRSetupTest("ech times one two")
+
+	if te != nil || tp != nil {
+		t.Error("Wrong command called")
+	}
+	if tt == nil {
+		t.Error("Wrong command called")
+	}
+	if strings.Join(tt, " ") != "one two" {
+		t.Error("Command didn't parse correctly")
+	}
+
+	EnablePrefixMatching = false
+}
+
+func TestNoPrefixMatching(t *testing.T) {
+	EnablePrefixMatching = false
+
+	noRRSetupTest("ech times one two")
+
+	if !(tt == nil && te == nil && tp == nil) {
+		t.Error("Wrong command called")
+	}
+}
+
+func TestAliasPrefixMatching(t *testing.T) {
+	EnablePrefixMatching = true
+	noRRSetupTest("sa times one two")
+
+	if te != nil || tp != nil {
+		t.Error("Wrong command called")
+	}
+	if tt == nil {
+		t.Error("Wrong command called")
+	}
+	if strings.Join(tt, " ") != "one two" {
+		t.Error("Command didn't parse correctly")
+	}
+	EnablePrefixMatching = false
+}
+
+func TestChildSameName(t *testing.T) {
+	c := initializeWithSameName()
+	c.AddCommand(cmdPrint, cmdEcho)
+	c.SetArgs(strings.Split("print one two", " "))
+	c.Execute()
+
+	if te != nil || tt != nil {
+		t.Error("Wrong command called")
+	}
+	if tp == nil {
+		t.Error("Wrong command called")
+	}
+	if strings.Join(tp, " ") != "one two" {
+		t.Error("Command didn't parse correctly")
+	}
+}
+
+func TestGrandChildSameName(t *testing.T) {
+	c := initializeWithSameName()
+	cmdTimes.AddCommand(cmdPrint)
+	c.AddCommand(cmdTimes)
+	c.SetArgs(strings.Split("times print one two", " "))
+	c.Execute()
+
+	if te != nil || tt != nil {
+		t.Error("Wrong command called")
+	}
+	if tp == nil {
+		t.Error("Wrong command called")
+	}
+	if strings.Join(tp, " ") != "one two" {
+		t.Error("Command didn't parse correctly")
+	}
+}
+
+func TestFlagLong(t *testing.T) {
+	noRRSetupTest("echo --intone=13 something here")
+
+	if strings.Join(te, " ") != "something here" {
+		t.Errorf("flags didn't leave proper args remaining..%s given", te)
+	}
+	if flagi1 != 13 {
+		t.Errorf("int flag didn't get correct value, had %d", flagi1)
+	}
+	if flagi2 != 234 {
+		t.Errorf("default flag value changed, 234 expected, %d given", flagi2)
+	}
+}
+
+func TestFlagShort(t *testing.T) {
+	noRRSetupTest("echo -i13 something here")
+
+	if strings.Join(te, " ") != "something here" {
+		t.Errorf("flags didn't leave proper args remaining..%s given", te)
+	}
+	if flagi1 != 13 {
+		t.Errorf("int flag didn't get correct value, had %d", flagi1)
+	}
+	if flagi2 != 234 {
+		t.Errorf("default flag value changed, 234 expected, %d given", flagi2)
+	}
+
+	noRRSetupTest("echo -i 13 something here")
+
+	if strings.Join(te, " ") != "something here" {
+		t.Errorf("flags didn't leave proper args remaining..%s given", te)
+	}
+	if flagi1 != 13 {
+		t.Errorf("int flag didn't get correct value, had %d", flagi1)
+	}
+	if flagi2 != 234 {
+		t.Errorf("default flag value changed, 234 expected, %d given", flagi2)
+	}
+
+	noRRSetupTest("print -i99 one two")
+
+	if strings.Join(tp, " ") != "one two" {
+		t.Errorf("flags didn't leave proper args remaining..%s given", tp)
+	}
+	if flagi3 != 99 {
+		t.Errorf("int flag didn't get correct value, had %d", flagi3)
+	}
+	if flagi1 != 123 {
+		t.Errorf("default flag value changed on different command with same shortname, 234 expected, %d given", flagi2)
+	}
+}
+
+func TestChildCommandFlags(t *testing.T) {
+	noRRSetupTest("echo times -j 99 one two")
+
+	if strings.Join(tt, " ") != "one two" {
+		t.Errorf("flags didn't leave proper args remaining..%s given", tt)
+	}
+
+	// Testing with flag that shouldn't be persistent
+	r := noRRSetupTest("echo times -j 99 -i77 one two")
+
+	if r.Error == nil {
+		t.Errorf("invalid flag should generate error")
+	}
+
+	if !strings.Contains(r.Output, "unknown shorthand") {
+		t.Errorf("Wrong error message displayed, \n %s", r.Output)
+	}
+
+	if flagi2 != 99 {
+		t.Errorf("flag value should be 99, %d given", flagi2)
+	}
+
+	if flagi1 != 123 {
+		t.Errorf("unset flag should have default value, expecting 123, given %d", flagi1)
+	}
+
+	// Testing with flag only existing on child
+	r = noRRSetupTest("echo -j 99 -i77 one two")
+
+	if r.Error == nil {
+		t.Errorf("invalid flag should generate error")
+	}
+
+	if !strings.Contains(r.Output, "unknown shorthand flag") {
+		t.Errorf("Wrong error message displayed, \n %s", r.Output)
+	}
+
+	// Testing with persistent flag overwritten by child
+	noRRSetupTest("echo times --strtwo=child one two")
+
+	if flags2b != "child" {
+		t.Errorf("flag value should be child, %s given", flags2b)
+	}
+
+	if flags2a != "two" {
+		t.Errorf("unset flag should have default value, expecting two, given %s", flags2a)
+	}
+
+	// Testing flag with invalid input
+	r = noRRSetupTest("echo -i10E")
+
+	if r.Error == nil {
+		t.Errorf("invalid input should generate error")
+	}
+
+	if !strings.Contains(r.Output, "invalid argument \"10E\" for i10E") {
+		t.Errorf("Wrong error message displayed, \n %s", r.Output)
+	}
+}
+
+func TestTrailingCommandFlags(t *testing.T) {
+	x := fullSetupTest("echo two -x")
+
+	if x.Error == nil {
+		t.Errorf("invalid flag should generate error")
+	}
+}
+
+func TestInvalidSubcommandFlags(t *testing.T) {
+	cmd := initializeWithRootCmd()
+	cmd.AddCommand(cmdTimes)
+
+	result := simpleTester(cmd, "times --inttwo=2 --badflag=bar")
+
+	checkResultContains(t, result, "unknown flag: --badflag")
+
+	if strings.Contains(result.Output, "unknown flag: --inttwo") {
+		t.Errorf("invalid --badflag flag shouldn't fail on 'unknown' --inttwo flag")
+	}
+
+}
+
+func TestSubcommandArgEvaluation(t *testing.T) {
+	cmd := initializeWithRootCmd()
+
+	first := &Command{
+		Use: "first",
+		Run: func(cmd *Command, args []string) {
+		},
+	}
+	cmd.AddCommand(first)
+
+	second := &Command{
+		Use: "second",
+		Run: func(cmd *Command, args []string) {
+			fmt.Fprintf(cmd.Out(), "%v", args)
+		},
+	}
+	first.AddCommand(second)
+
+	result := simpleTester(cmd, "first second first third")
+
+	expectedOutput := fmt.Sprintf("%v", []string{"first third"})
+	if result.Output != expectedOutput {
+		t.Errorf("exptected %v, got %v", expectedOutput, result.Output)
+	}
+}
+
+func TestPersistentFlags(t *testing.T) {
+	fullSetupTest("echo -s something -p more here")
+
+	// persistentFlag should act like normal flag on it's own command
+	if strings.Join(te, " ") != "more here" {
+		t.Errorf("flags didn't leave proper args remaining..%s given", te)
+	}
+	if flags1 != "something" {
+		t.Errorf("string flag didn't get correct value, had %v", flags1)
+	}
+	if !flagbp {
+		t.Errorf("persistent bool flag not parsed correctly. Expected true, had %v", flagbp)
+	}
+
+	// persistentFlag should act like normal flag on it's own command
+	fullSetupTest("echo times -s again -c -p test here")
+
+	if strings.Join(tt, " ") != "test here" {
+		t.Errorf("flags didn't leave proper args remaining..%s given", tt)
+	}
+
+	if flags1 != "again" {
+		t.Errorf("string flag didn't get correct value, had %v", flags1)
+	}
+
+	if !flagb2 {
+		t.Errorf("local flag not parsed correctly. Expected true, had %v", flagb2)
+	}
+	if !flagbp {
+		t.Errorf("persistent bool flag not parsed correctly. Expected true, had %v", flagbp)
+	}
+}
+
+func TestHelpCommand(t *testing.T) {
+	x := fullSetupTest("help")
+	checkResultContains(t, x, cmdRootWithRun.Long)
+
+	x = fullSetupTest("help echo")
+	checkResultContains(t, x, cmdEcho.Long)
+
+	x = fullSetupTest("help echo times")
+	checkResultContains(t, x, cmdTimes.Long)
+}
+
+func TestChildCommandHelp(t *testing.T) {
+	c := noRRSetupTest("print --help")
+	checkResultContains(t, c, strtwoParentHelp)
+	r := noRRSetupTest("echo times --help")
+	checkResultContains(t, r, strtwoChildHelp)
+}
+
+func TestNonRunChildHelp(t *testing.T) {
+	x := noRRSetupTest("subnorun")
+	checkResultContains(t, x, cmdSubNoRun.Long)
+}
+
+func TestRunnableRootCommand(t *testing.T) {
+	fullSetupTest("")
+
+	if rootcalled != true {
+		t.Errorf("Root Function was not called")
+	}
+}
+
+func TestRunnableRootCommandNilInput(t *testing.T) {
+	empty_arg := make([]string, 0)
+	c := initializeWithRootCmd()
+
+	buf := new(bytes.Buffer)
+	// Testing flag with invalid input
+	c.SetOutput(buf)
+	cmdEcho.AddCommand(cmdTimes)
+	c.AddCommand(cmdPrint, cmdEcho)
+	c.SetArgs(empty_arg)
+
+	c.Execute()
+
+	if rootcalled != true {
+		t.Errorf("Root Function was not called")
+	}
+}
+
+func TestRunnableRootCommandEmptyInput(t *testing.T) {
+	args := make([]string, 3)
+	args[0] = ""
+	args[1] = "--introot=12"
+	args[2] = ""
+	c := initializeWithRootCmd()
+
+	buf := new(bytes.Buffer)
+	// Testing flag with invalid input
+	c.SetOutput(buf)
+	cmdEcho.AddCommand(cmdTimes)
+	c.AddCommand(cmdPrint, cmdEcho)
+	c.SetArgs(args)
+
+	c.Execute()
+
+	if rootcalled != true {
+		t.Errorf("Root Function was not called.\n\nOutput was:\n\n%s\n", buf)
+	}
+}
+
+func TestInvalidSubcommandWhenArgsAllowed(t *testing.T) {
+	fullSetupTest("echo invalid-sub")
+
+	if te[0] != "invalid-sub" {
+		t.Errorf("Subcommand didn't work...")
+	}
+}
+
+func TestRootFlags(t *testing.T) {
+	fullSetupTest("-i 17 -b")
+
+	if flagbr != true {
+		t.Errorf("flag value should be true, %v given", flagbr)
+	}
+
+	if flagir != 17 {
+		t.Errorf("flag value should be 17, %d given", flagir)
+	}
+}
+
+func TestRootHelp(t *testing.T) {
+	x := fullSetupTest("--help")
+
+	checkResultContains(t, x, "Available Commands:")
+	checkResultContains(t, x, "for more information about a command")
+
+	if strings.Contains(x.Output, "unknown flag: --help") {
+		t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
+	}
+
+	if strings.Contains(x.Output, cmdEcho.Use) {
+		t.Errorf("--help shouldn't display subcommand's usage, Got: \n %s", x.Output)
+	}
+
+	x = fullSetupTest("echo --help")
+
+	if strings.Contains(x.Output, cmdTimes.Use) {
+		t.Errorf("--help shouldn't display subsubcommand's usage, Got: \n %s", x.Output)
+	}
+
+	checkResultContains(t, x, "Available Commands:")
+	checkResultContains(t, x, "for more information about a command")
+
+	if strings.Contains(x.Output, "unknown flag: --help") {
+		t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
+	}
+
+}
+
+func TestFlagAccess(t *testing.T) {
+	initialize()
+
+	local := cmdTimes.LocalFlags()
+	inherited := cmdTimes.InheritedFlags()
+
+	for _, f := range []string{"inttwo", "strtwo", "booltwo"} {
+		if local.Lookup(f) == nil {
+			t.Errorf("LocalFlags expected to contain %s, Got: nil", f)
+		}
+	}
+	if inherited.Lookup("strone") == nil {
+		t.Errorf("InheritedFlags expected to contain strone, Got: nil")
+	}
+	if inherited.Lookup("strtwo") != nil {
+		t.Errorf("InheritedFlags shouldn not contain overwritten flag strtwo")
+
+	}
+}
+
+func TestNoNRunnableRootCommandNilInput(t *testing.T) {
+	args := make([]string, 0)
+	c := initialize()
+
+	buf := new(bytes.Buffer)
+	// Testing flag with invalid input
+	c.SetOutput(buf)
+	cmdEcho.AddCommand(cmdTimes)
+	c.AddCommand(cmdPrint, cmdEcho)
+	c.SetArgs(args)
+
+	c.Execute()
+
+	if !strings.Contains(buf.String(), cmdRootNoRun.Long) {
+		t.Errorf("Expected to get help output, Got: \n %s", buf)
+	}
+}
+
+func TestRootNoCommandHelp(t *testing.T) {
+	x := rootOnlySetupTest("--help")
+
+	checkResultOmits(t, x, "Available Commands:")
+	checkResultOmits(t, x, "for more information about a command")
+
+	if strings.Contains(x.Output, "unknown flag: --help") {
+		t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
+	}
+
+	x = rootOnlySetupTest("echo --help")
+
+	checkResultOmits(t, x, "Available Commands:")
+	checkResultOmits(t, x, "for more information about a command")
+
+	if strings.Contains(x.Output, "unknown flag: --help") {
+		t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
+	}
+}
+
+func TestRootUnknownCommand(t *testing.T) {
+	r := noRRSetupTest("bogus")
+	s := "Error: unknown command \"bogus\"\nRun 'cobra-test help' for usage.\n"
+
+	if r.Output != s {
+		t.Errorf("Unexpected response.\nExpecting to be:\n %q\nGot:\n %q\n", s, r.Output)
+	}
+
+	r = noRRSetupTest("--strtwo=a bogus")
+	if r.Output != s {
+		t.Errorf("Unexpected response.\nExpecting to be:\n %q\nGot:\n %q\n", s, r.Output)
+	}
+}
+
+func TestFlagsBeforeCommand(t *testing.T) {
+	// short without space
+	x := fullSetupTest("-i10 echo")
+	if x.Error != nil {
+		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
+	}
+
+	// short (int) with equals
+	// It appears that pflags doesn't support this...
+	// Commenting out until support can be added
+
+	//x = noRRSetupTest("echo -i=10")
+	//if x.Error != nil {
+	//t.Errorf("Valid Input shouldn't have errors, got:\n %s", x.Error)
+	//}
+
+	// long with equals
+	x = noRRSetupTest("--intone=123 echo one two")
+	if x.Error != nil {
+		t.Errorf("Valid Input shouldn't have errors, got:\n %s", x.Error)
+	}
+
+	// With parsing error properly reported
+	x = fullSetupTest("-i10E echo")
+	if !strings.Contains(x.Output, "invalid argument \"10E\" for i10E") {
+		t.Errorf("Wrong error message displayed, \n %s", x.Output)
+	}
+
+	//With quotes
+	x = fullSetupTest("-s=\"walking\" echo")
+	if x.Error != nil {
+		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
+	}
+
+	//With quotes and space
+	x = fullSetupTest("-s=\"walking fast\" echo")
+	if x.Error != nil {
+		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
+	}
+
+	//With inner quote
+	x = fullSetupTest("-s=\"walking \\\"Inner Quote\\\" fast\" echo")
+	if x.Error != nil {
+		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
+	}
+
+	//With quotes and space
+	x = fullSetupTest("-s=\"walking \\\"Inner Quote\\\" fast\" echo")
+	if x.Error != nil {
+		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
+	}
+
+}
+
+func TestRemoveCommand(t *testing.T) {
+	versionUsed = 0
+	c := initializeWithRootCmd()
+	c.AddCommand(cmdVersion1)
+	c.RemoveCommand(cmdVersion1)
+	x := fullTester(c, "version")
+	if x.Error == nil {
+		t.Errorf("Removed command should not have been called\n")
+		return
+	}
+}
+
+func TestCommandWithoutSubcommands(t *testing.T) {
+	c := initializeWithRootCmd()
+
+	x := simpleTester(c, "")
+	if x.Error != nil {
+		t.Errorf("Calling command without subcommands should not have error: %v", x.Error)
+		return
+	}
+}
+
+func TestCommandWithoutSubcommandsWithArg(t *testing.T) {
+	c := initializeWithRootCmd()
+	expectedArgs := []string{"arg"}
+
+	x := simpleTester(c, "arg")
+	if x.Error != nil {
+		t.Errorf("Calling command without subcommands but with arg should not have error: %v", x.Error)
+		return
+	}
+	if !reflect.DeepEqual(expectedArgs, tr) {
+		t.Errorf("Calling command without subcommands but with arg has wrong args: expected: %v, actual: %v", expectedArgs, tr)
+		return
+	}
+}
+
+func TestReplaceCommandWithRemove(t *testing.T) {
+	versionUsed = 0
+	c := initializeWithRootCmd()
+	c.AddCommand(cmdVersion1)
+	c.RemoveCommand(cmdVersion1)
+	c.AddCommand(cmdVersion2)
+	x := fullTester(c, "version")
+	if x.Error != nil {
+		t.Errorf("Valid Input shouldn't have errors, got:\n %q", x.Error)
+		return
+	}
+	if versionUsed == 1 {
+		t.Errorf("Removed command shouldn't be called\n")
+	}
+	if versionUsed != 2 {
+		t.Errorf("Replacing command should have been called but didn't\n")
+	}
+}
+
+func TestDeprecatedSub(t *testing.T) {
+	c := fullSetupTest("deprecated")
+
+	checkResultContains(t, c, cmdDeprecated.Deprecated)
+}
+
+func TestPreRun(t *testing.T) {
+	noRRSetupTest("echo one two")
+	if echoPre == nil || echoPersPre == nil {
+		t.Error("PreRun or PersistentPreRun not called")
+	}
+	if rootPersPre != nil || timesPersPre != nil {
+		t.Error("Wrong *Pre functions called!")
+	}
+
+	noRRSetupTest("echo times one two")
+	if timesPersPre == nil {
+		t.Error("PreRun or PersistentPreRun not called")
+	}
+	if echoPre != nil || echoPersPre != nil || rootPersPre != nil {
+		t.Error("Wrong *Pre functions called!")
+	}
+
+	noRRSetupTest("print one two")
+	if rootPersPre == nil {
+		t.Error("Parent PersistentPreRun not called but should not have been")
+	}
+	if echoPre != nil || echoPersPre != nil || timesPersPre != nil {
+		t.Error("Wrong *Pre functions called!")
+	}
+}
+
+// Check if cmdEchoSub gets PersistentPreRun from rootCmd even if is added last
+func TestPeristentPreRunPropagation(t *testing.T) {
+	rootCmd := initialize()
+
+	// First add the cmdEchoSub to cmdPrint
+	cmdPrint.AddCommand(cmdEchoSub)
+	// Now add cmdPrint to rootCmd
+	rootCmd.AddCommand(cmdPrint)
+
+	rootCmd.SetArgs(strings.Split("print echosub lala", " "))
+	rootCmd.Execute()
+
+	if rootPersPre == nil || len(rootPersPre) == 0 || rootPersPre[0] != "lala" {
+		t.Error("RootCmd PersistentPreRun not called but should have been")
+	}
+}
+
+func TestGlobalNormFuncPropagation(t *testing.T) {
+	normFunc := func(f *pflag.FlagSet, name string) pflag.NormalizedName {
+		return pflag.NormalizedName(name)
+	}
+
+	rootCmd := initialize()
+	rootCmd.SetGlobalNormalizationFunc(normFunc)
+	if reflect.ValueOf(normFunc) != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()) {
+		t.Error("rootCmd seems to have a wrong normalization function")
+	}
+
+	// First add the cmdEchoSub to cmdPrint
+	cmdPrint.AddCommand(cmdEchoSub)
+	if cmdPrint.GlobalNormalizationFunc() != nil && cmdEchoSub.GlobalNormalizationFunc() != nil {
+		t.Error("cmdPrint and cmdEchoSub should had no normalization functions")
+	}
+
+	// Now add cmdPrint to rootCmd
+	rootCmd.AddCommand(cmdPrint)
+	if reflect.ValueOf(cmdPrint.GlobalNormalizationFunc()).Pointer() != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()).Pointer() ||
+		reflect.ValueOf(cmdEchoSub.GlobalNormalizationFunc()).Pointer() != reflect.ValueOf(rootCmd.GlobalNormalizationFunc()).Pointer() {
+		t.Error("cmdPrint and cmdEchoSub should had the normalization function of rootCmd")
+	}
+}


[29/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/string_slice_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/string_slice_test.go b/Godeps/_workspace/src/github.com/spf13/pflag/string_slice_test.go
deleted file mode 100644
index c37a91a..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/string_slice_test.go
+++ /dev/null
@@ -1,44 +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.
-
-package pflag
-
-import (
-	"fmt"
-	"strings"
-	"testing"
-)
-
-func setUpSSFlagSet(ssp *[]string) *FlagSet {
-	f := NewFlagSet("test", ContinueOnError)
-	f.StringSliceVar(ssp, "ss", []string{}, "Command seperated list!")
-	return f
-}
-
-func TestSS(t *testing.T) {
-	var ss []string
-	f := setUpSSFlagSet(&ss)
-
-	vals := []string{"one", "two", "4", "3"}
-	arg := fmt.Sprintf("--ss=%s", strings.Join(vals, ","))
-	err := f.Parse([]string{arg})
-	if err != nil {
-		t.Fatal("expected no error; got", err)
-	}
-	for i, v := range ss {
-		if vals[i] != v {
-			t.Fatal("expected ss[%d] to be %s but got: %s", i, vals[i], v)
-		}
-	}
-
-	getSS, err := f.GetStringSlice("ss")
-	if err != nil {
-		t.Fatal("got an error from GetStringSlice(): %v", err)
-	}
-	for i, v := range getSS {
-		if vals[i] != v {
-			t.Fatal("expected ss[%d] to be %s from GetStringSlice but got: %s", i, vals[i], v)
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/uint.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/uint.go b/Godeps/_workspace/src/github.com/spf13/pflag/uint.go
deleted file mode 100644
index d6f8e5b..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/uint.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- uint Value
-type uintValue uint
-
-func newUintValue(val uint, p *uint) *uintValue {
-	*p = val
-	return (*uintValue)(p)
-}
-
-func (i *uintValue) Set(s string) error {
-	v, err := strconv.ParseUint(s, 0, 64)
-	*i = uintValue(v)
-	return err
-}
-
-func (i *uintValue) Type() string {
-	return "uint"
-}
-
-func (i *uintValue) String() string { return fmt.Sprintf("%v", *i) }
-
-func uintConv(sval string) (interface{}, error) {
-	v, err := strconv.ParseUint(sval, 0, 0)
-	if err != nil {
-		return 0, err
-	}
-	return uint(v), nil
-}
-
-// GetUint return the uint value of a flag with the given name
-func (f *FlagSet) GetUint(name string) (uint, error) {
-	val, err := f.getFlagType(name, "uint", uintConv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(uint), nil
-}
-
-// UintVar defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
-func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) {
-	f.VarP(newUintValue(value, p), name, "", usage)
-}
-
-// Like UintVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage string) {
-	f.VarP(newUintValue(value, p), name, shorthand, usage)
-}
-
-// UintVar defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint  variable in which to store the value of the flag.
-func UintVar(p *uint, name string, value uint, usage string) {
-	CommandLine.VarP(newUintValue(value, p), name, "", usage)
-}
-
-// Like UintVar, but accepts a shorthand letter that can be used after a single dash.
-func UintVarP(p *uint, name, shorthand string, value uint, usage string) {
-	CommandLine.VarP(newUintValue(value, p), name, shorthand, usage)
-}
-
-// Uint defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint  variable that stores the value of the flag.
-func (f *FlagSet) Uint(name string, value uint, usage string) *uint {
-	p := new(uint)
-	f.UintVarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Uint, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint {
-	p := new(uint)
-	f.UintVarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Uint defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint  variable that stores the value of the flag.
-func Uint(name string, value uint, usage string) *uint {
-	return CommandLine.UintP(name, "", value, usage)
-}
-
-// Like Uint, but accepts a shorthand letter that can be used after a single dash.
-func UintP(name, shorthand string, value uint, usage string) *uint {
-	return CommandLine.UintP(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/uint16.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/uint16.go b/Godeps/_workspace/src/github.com/spf13/pflag/uint16.go
deleted file mode 100644
index 1cdc3df..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/uint16.go
+++ /dev/null
@@ -1,89 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- uint16 value
-type uint16Value uint16
-
-func newUint16Value(val uint16, p *uint16) *uint16Value {
-	*p = val
-	return (*uint16Value)(p)
-}
-func (i *uint16Value) String() string { return fmt.Sprintf("%d", *i) }
-func (i *uint16Value) Set(s string) error {
-	v, err := strconv.ParseUint(s, 0, 16)
-	*i = uint16Value(v)
-	return err
-}
-
-func (i *uint16Value) Type() string {
-	return "uint16"
-}
-
-func uint16Conv(sval string) (interface{}, error) {
-	v, err := strconv.ParseUint(sval, 0, 16)
-	if err != nil {
-		return 0, err
-	}
-	return uint16(v), nil
-}
-
-// GetUint16 return the uint16 value of a flag with the given name
-func (f *FlagSet) GetUint16(name string) (uint16, error) {
-	val, err := f.getFlagType(name, "uint16", uint16Conv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(uint16), nil
-}
-
-// Uint16Var defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
-func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string) {
-	f.VarP(newUint16Value(value, p), name, "", usage)
-}
-
-// Like Uint16Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) {
-	f.VarP(newUint16Value(value, p), name, shorthand, usage)
-}
-
-// Uint16Var defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint  variable in which to store the value of the flag.
-func Uint16Var(p *uint16, name string, value uint16, usage string) {
-	CommandLine.VarP(newUint16Value(value, p), name, "", usage)
-}
-
-// Like Uint16Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) {
-	CommandLine.VarP(newUint16Value(value, p), name, shorthand, usage)
-}
-
-// Uint16 defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint  variable that stores the value of the flag.
-func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 {
-	p := new(uint16)
-	f.Uint16VarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Uint16, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage string) *uint16 {
-	p := new(uint16)
-	f.Uint16VarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Uint16 defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint  variable that stores the value of the flag.
-func Uint16(name string, value uint16, usage string) *uint16 {
-	return CommandLine.Uint16P(name, "", value, usage)
-}
-
-// Like Uint16, but accepts a shorthand letter that can be used after a single dash.
-func Uint16P(name, shorthand string, value uint16, usage string) *uint16 {
-	return CommandLine.Uint16P(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/uint32.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/uint32.go b/Godeps/_workspace/src/github.com/spf13/pflag/uint32.go
deleted file mode 100644
index 1326e4a..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/uint32.go
+++ /dev/null
@@ -1,89 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- uint16 value
-type uint32Value uint32
-
-func newUint32Value(val uint32, p *uint32) *uint32Value {
-	*p = val
-	return (*uint32Value)(p)
-}
-func (i *uint32Value) String() string { return fmt.Sprintf("%d", *i) }
-func (i *uint32Value) Set(s string) error {
-	v, err := strconv.ParseUint(s, 0, 32)
-	*i = uint32Value(v)
-	return err
-}
-
-func (i *uint32Value) Type() string {
-	return "uint32"
-}
-
-func uint32Conv(sval string) (interface{}, error) {
-	v, err := strconv.ParseUint(sval, 0, 32)
-	if err != nil {
-		return 0, err
-	}
-	return uint32(v), nil
-}
-
-// GetUint32 return the uint32 value of a flag with the given name
-func (f *FlagSet) GetUint32(name string) (uint32, error) {
-	val, err := f.getFlagType(name, "uint32", uint32Conv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(uint32), nil
-}
-
-// Uint32Var defines a uint32 flag with specified name, default value, and usage string.
-// The argument p points to a uint32 variable in which to store the value of the flag.
-func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string) {
-	f.VarP(newUint32Value(value, p), name, "", usage)
-}
-
-// Like Uint32Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {
-	f.VarP(newUint32Value(value, p), name, shorthand, usage)
-}
-
-// Uint32Var defines a uint32 flag with specified name, default value, and usage string.
-// The argument p points to a uint32  variable in which to store the value of the flag.
-func Uint32Var(p *uint32, name string, value uint32, usage string) {
-	CommandLine.VarP(newUint32Value(value, p), name, "", usage)
-}
-
-// Like Uint32Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {
-	CommandLine.VarP(newUint32Value(value, p), name, shorthand, usage)
-}
-
-// Uint32 defines a uint32 flag with specified name, default value, and usage string.
-// The return value is the address of a uint32  variable that stores the value of the flag.
-func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 {
-	p := new(uint32)
-	f.Uint32VarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Uint32, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage string) *uint32 {
-	p := new(uint32)
-	f.Uint32VarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Uint32 defines a uint32 flag with specified name, default value, and usage string.
-// The return value is the address of a uint32  variable that stores the value of the flag.
-func Uint32(name string, value uint32, usage string) *uint32 {
-	return CommandLine.Uint32P(name, "", value, usage)
-}
-
-// Like Uint32, but accepts a shorthand letter that can be used after a single dash.
-func Uint32P(name, shorthand string, value uint32, usage string) *uint32 {
-	return CommandLine.Uint32P(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/uint64.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/uint64.go b/Godeps/_workspace/src/github.com/spf13/pflag/uint64.go
deleted file mode 100644
index 6788bbf..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/uint64.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- uint64 Value
-type uint64Value uint64
-
-func newUint64Value(val uint64, p *uint64) *uint64Value {
-	*p = val
-	return (*uint64Value)(p)
-}
-
-func (i *uint64Value) Set(s string) error {
-	v, err := strconv.ParseUint(s, 0, 64)
-	*i = uint64Value(v)
-	return err
-}
-
-func (i *uint64Value) Type() string {
-	return "uint64"
-}
-
-func (i *uint64Value) String() string { return fmt.Sprintf("%v", *i) }
-
-func uint64Conv(sval string) (interface{}, error) {
-	v, err := strconv.ParseUint(sval, 0, 64)
-	if err != nil {
-		return 0, err
-	}
-	return uint64(v), nil
-}
-
-// GetUint64 return the uint64 value of a flag with the given name
-func (f *FlagSet) GetUint64(name string) (uint64, error) {
-	val, err := f.getFlagType(name, "uint64", uint64Conv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(uint64), nil
-}
-
-// Uint64Var defines a uint64 flag with specified name, default value, and usage string.
-// The argument p points to a uint64 variable in which to store the value of the flag.
-func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) {
-	f.VarP(newUint64Value(value, p), name, "", usage)
-}
-
-// Like Uint64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {
-	f.VarP(newUint64Value(value, p), name, shorthand, usage)
-}
-
-// Uint64Var defines a uint64 flag with specified name, default value, and usage string.
-// The argument p points to a uint64 variable in which to store the value of the flag.
-func Uint64Var(p *uint64, name string, value uint64, usage string) {
-	CommandLine.VarP(newUint64Value(value, p), name, "", usage)
-}
-
-// Like Uint64Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {
-	CommandLine.VarP(newUint64Value(value, p), name, shorthand, usage)
-}
-
-// Uint64 defines a uint64 flag with specified name, default value, and usage string.
-// The return value is the address of a uint64 variable that stores the value of the flag.
-func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 {
-	p := new(uint64)
-	f.Uint64VarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Uint64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage string) *uint64 {
-	p := new(uint64)
-	f.Uint64VarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Uint64 defines a uint64 flag with specified name, default value, and usage string.
-// The return value is the address of a uint64 variable that stores the value of the flag.
-func Uint64(name string, value uint64, usage string) *uint64 {
-	return CommandLine.Uint64P(name, "", value, usage)
-}
-
-// Like Uint64, but accepts a shorthand letter that can be used after a single dash.
-func Uint64P(name, shorthand string, value uint64, usage string) *uint64 {
-	return CommandLine.Uint64P(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/pflag/uint8.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/uint8.go b/Godeps/_workspace/src/github.com/spf13/pflag/uint8.go
deleted file mode 100644
index 560c569..0000000
--- a/Godeps/_workspace/src/github.com/spf13/pflag/uint8.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package pflag
-
-import (
-	"fmt"
-	"strconv"
-)
-
-// -- uint8 Value
-type uint8Value uint8
-
-func newUint8Value(val uint8, p *uint8) *uint8Value {
-	*p = val
-	return (*uint8Value)(p)
-}
-
-func (i *uint8Value) Set(s string) error {
-	v, err := strconv.ParseUint(s, 0, 8)
-	*i = uint8Value(v)
-	return err
-}
-
-func (i *uint8Value) Type() string {
-	return "uint8"
-}
-
-func (i *uint8Value) String() string { return fmt.Sprintf("%v", *i) }
-
-func uint8Conv(sval string) (interface{}, error) {
-	v, err := strconv.ParseUint(sval, 0, 8)
-	if err != nil {
-		return 0, err
-	}
-	return uint8(v), nil
-}
-
-// GetUint8 return the uint8 value of a flag with the given name
-func (f *FlagSet) GetUint8(name string) (uint8, error) {
-	val, err := f.getFlagType(name, "uint8", uint8Conv)
-	if err != nil {
-		return 0, err
-	}
-	return val.(uint8), nil
-}
-
-// Uint8Var defines a uint8 flag with specified name, default value, and usage string.
-// The argument p points to a uint8 variable in which to store the value of the flag.
-func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) {
-	f.VarP(newUint8Value(value, p), name, "", usage)
-}
-
-// Like Uint8Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) {
-	f.VarP(newUint8Value(value, p), name, shorthand, usage)
-}
-
-// Uint8Var defines a uint8 flag with specified name, default value, and usage string.
-// The argument p points to a uint8 variable in which to store the value of the flag.
-func Uint8Var(p *uint8, name string, value uint8, usage string) {
-	CommandLine.VarP(newUint8Value(value, p), name, "", usage)
-}
-
-// Like Uint8Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) {
-	CommandLine.VarP(newUint8Value(value, p), name, shorthand, usage)
-}
-
-// Uint8 defines a uint8 flag with specified name, default value, and usage string.
-// The return value is the address of a uint8 variable that stores the value of the flag.
-func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 {
-	p := new(uint8)
-	f.Uint8VarP(p, name, "", value, usage)
-	return p
-}
-
-// Like Uint8, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage string) *uint8 {
-	p := new(uint8)
-	f.Uint8VarP(p, name, shorthand, value, usage)
-	return p
-}
-
-// Uint8 defines a uint8 flag with specified name, default value, and usage string.
-// The return value is the address of a uint8 variable that stores the value of the flag.
-func Uint8(name string, value uint8, usage string) *uint8 {
-	return CommandLine.Uint8P(name, "", value, usage)
-}
-
-// Like Uint8, but accepts a shorthand letter that can be used after a single dash.
-func Uint8P(name, shorthand string, value uint8, usage string) *uint8 {
-	return CommandLine.Uint8P(name, shorthand, value, usage)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/viper/.gitignore
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/viper/.gitignore b/Godeps/_workspace/src/github.com/spf13/viper/.gitignore
deleted file mode 100644
index 8365624..0000000
--- a/Godeps/_workspace/src/github.com/spf13/viper/.gitignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-*.test

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/viper/.travis.yml
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/viper/.travis.yml b/Godeps/_workspace/src/github.com/spf13/viper/.travis.yml
deleted file mode 100644
index ae1f68e..0000000
--- a/Godeps/_workspace/src/github.com/spf13/viper/.travis.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-language: go
-go:
-  - 1.3
-  - release
-  - tip
-
-script:
-  - go test -v ./...

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/viper/LICENSE
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/viper/LICENSE b/Godeps/_workspace/src/github.com/spf13/viper/LICENSE
deleted file mode 100644
index 4527efb..0000000
--- a/Godeps/_workspace/src/github.com/spf13/viper/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Steve Francia
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/viper/README.md
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/viper/README.md b/Godeps/_workspace/src/github.com/spf13/viper/README.md
deleted file mode 100644
index 76e1071..0000000
--- a/Godeps/_workspace/src/github.com/spf13/viper/README.md
+++ /dev/null
@@ -1,445 +0,0 @@
-viper [![Build Status](https://travis-ci.org/spf13/viper.svg)](https://travis-ci.org/spf13/viper)
-=====
-
-[![Join the chat at https://gitter.im/spf13/viper](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/spf13/viper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
-Go configuration with fangs
-
-## What is Viper?
-
-Viper is a complete configuration solution for go applications. It has
-been designed to work within an application to handle all types of
-configuration. It supports
-
-* setting defaults
-* reading from json, toml and yaml config files
-* reading from environment variables
-* reading from remote config systems (Etcd or Consul), watching changes
-* reading from command line flags
-* reading from buffer
-* setting explicit values
-
-It can be thought of as a registry for all of your applications
-configuration needs.
-
-## Why Viper?
-
-When building a modern application, you don’t want to have to worry about
-configuration file formats; you want to focus on building awesome software.
-Viper is here to help with that.
-
-Viper does the following for you:
-
-1. Find, load and marshal a configuration file in JSON, TOML or YAML.
-2. Provide a mechanism to set default values for your different
-   configuration options.
-3. Provide a mechanism to set override values for options specified
-   through command line flags.
-4. Provide an alias system to easily rename parameters without breaking
-   existing code.
-5. Make it easy to tell the difference between when a user has provided
-   a command line or config file which is the same as the default.
-
-Viper uses the following precedence order. Each item takes precedence
-over the item below it:
-
- * explicit call to Set
- * flag
- * env
- * config
- * key/value store
- * default
-
-Viper configuration keys are case insensitive.
-
-## Putting Values into Viper
-
-### Establishing Defaults
-
-A good configuration system will support default values. A default value
-is not required for a key, but can establish a default to be used in the
-event that the key hasn’t be set via config file, environment variable,
-remote configuration or flag.
-
-Examples:
-
-	viper.SetDefault("ContentDir", "content")
-	viper.SetDefault("LayoutDir", "layouts")
-	viper.SetDefault("Taxonomies", map[string]string{"tag": "tags", "category": "categories"})
-
-### Reading Config Files
-
-If you want to support a config file, Viper requires a minimal
-configuration so it knows where to look for the config file. Viper
-supports json, toml and yaml files. Viper can search multiple paths, but
-currently a single viper only supports a single config file.
-
-	viper.SetConfigName("config") // name of config file (without extension)
-	viper.AddConfigPath("/etc/appname/")   // path to look for the config file in
-	viper.AddConfigPath("$HOME/.appname")  // call multiple times to add many search paths
-	err := viper.ReadInConfig() // Find and read the config file
-    if err != nil { // Handle errors reading the config file
-        panic(fmt.Errorf("Fatal error config file: %s \n", err))
-    }
-
-### Reading Config from io.Reader
-
-Viper predefined many configuration sources, such as files, environment variables, flags and 
-remote K/V store. But you are not bound to them. You can also implement your own way to
-require configuration and feed it to viper.
-
-````go
-viper.SetConfigType("yaml") // or viper.SetConfigType("YAML")
-
-// any approach to require this configuration into your program. 
-var yamlExample = []byte(`
-Hacker: true
-name: steve
-hobbies:
-- skateboarding
-- snowboarding
-- go
-clothing:
-  jacket: leather
-  trousers: denim
-age: 35
-eyes : brown
-beard: true
-`)
-
-viper.ReadConfig(bytes.NewBuffer(yamlExample))
-
-viper.Get("name") // this would be "steve"
-````
-
-### Setting Overrides
-
-These could be from a command line flag, or from your own application logic.
-
-    viper.Set("Verbose", true)
-    viper.Set("LogFile", LogFile)
-
-### Registering and Using Aliases
-
-Aliases permit a single value to be referenced by multiple keys
-
-    viper.RegisterAlias("loud", "Verbose")
-
-    viper.Set("verbose", true) // same result as next line
-    viper.Set("loud", true)   // same result as prior line
-
-    viper.GetBool("loud") // true
-    viper.GetBool("verbose") // true
-
-### Working with Environment Variables
-
-Viper has full support for environment variables. This enables 12 factor
-applications out of the box. There are four methods that exist to aid
-with working with ENV:
-
- * AutomaticEnv()
- * BindEnv(string...) : error
- * SetEnvPrefix(string)
- * SetEnvReplacer(string...) *strings.Replacer
-
-_When working with ENV variables, it’s important to recognize that Viper
-treats ENV variables as case sensitive._
-
-Viper provides a mechanism to try to ensure that ENV variables are
-unique. By using SetEnvPrefix, you can tell Viper to use add a prefix
-while reading from the environment variables. Both BindEnv and
-AutomaticEnv will use this prefix.
-
-BindEnv takes one or two parameters. The first parameter is the key
-name, the second is the name of the environment variable. The name of
-the environment variable is case sensitive. If the ENV variable name is
-not provided, then Viper will automatically assume that the key name
-matches the ENV variable name but the ENV variable is IN ALL CAPS. When
-you explicitly provide the ENV variable name, it **does not**
-automatically add the prefix.
-
-One important thing to recognize when working with ENV variables is that
-the value will be read each time it is accessed. It does not fix the
-value when the BindEnv is called.
-
-AutomaticEnv is a powerful helper especially when combined with
-SetEnvPrefix. When called, Viper will check for an environment variable
-any time a viper.Get request is made. It will apply the following rules.
-It will check for a environment variable with a name matching the key
-uppercased and prefixed with the EnvPrefix if set.
-
-SetEnvReplacer allows you to use a `strings.Replacer` object to rewrite Env keys
-to an extent. This is useful if you want to use `-` or something in your Get()
-calls, but want your environmental variables to use `_` delimiters. An example
-of using it can be found in `viper_test.go`.
-
-#### Env example
-
-	SetEnvPrefix("spf") // will be uppercased automatically
-	BindEnv("id")
-
-	os.Setenv("SPF_ID", "13") // typically done outside of the app
-
-	id := Get("id") // 13
-
-
-### Working with Flags
-
-Viper has the ability to bind to flags. Specifically, Viper supports
-Pflags as used in the [Cobra](https://github.com/spf13/cobra) library.
-
-Like BindEnv, the value is not set when the binding method is called, but
-when it is accessed. This means you can bind as early as you want, even
-in an init() function.
-
-The BindPFlag() method provides this functionality.
-
-Example:
-
-    serverCmd.Flags().Int("port", 1138, "Port to run Application server on")
-    viper.BindPFlag("port", serverCmd.Flags().Lookup("port"))
-
-
-### Remote Key/Value Store Support
-
-To enable remote support in Viper, do a blank import of the `viper/remote` package:
-
-`import _ github.com/spf13/viper/remote`
-
-Viper will read a config string (as JSON, TOML, or YAML) retrieved from a
-path in a Key/Value store such as Etcd or Consul.  These values take precedence
-over default values, but are overriden by configuration values retrieved from disk,
-flags, or environment variables.
-
-Viper uses [crypt](https://github.com/xordataexchange/crypt) to retrieve configuration
-from the K/V store, which means that you can store your configuration values
-encrypted and have them automatically decrypted if you have the correct
-gpg keyring.  Encryption is optional.
-
-You can use remote configuration in conjunction with local configuration, or
-independently of it.
-
-`crypt` has a command-line helper that you can use to put configurations
-in your K/V store. `crypt` defaults to etcd on http://127.0.0.1:4001.
-
-	go get github.com/xordataexchange/crypt/bin/crypt
-	crypt set -plaintext /config/hugo.json /Users/hugo/settings/config.json
-
-Confirm that your value was set:
-
-	crypt get -plaintext /config/hugo.json
-
-See the `crypt` documentation for examples of how to set encrypted values, or how
-to use Consul.
-
-### Remote Key/Value Store Example - Unencrypted
-
-	viper.AddRemoteProvider("etcd", "http://127.0.0.1:4001","/config/hugo.json")
-	viper.SetConfigType("json") // because there is no file extension in a stream of bytes
-	err := viper.ReadRemoteConfig()
-
-### Remote Key/Value Store Example - Encrypted
-
-	viper.AddSecureRemoteProvider("etcd","http://127.0.0.1:4001","/config/hugo.json","/etc/secrets/mykeyring.gpg")
-	viper.SetConfigType("json") // because there is no file extension in a stream of bytes
-	err := viper.ReadRemoteConfig()
-
-### Watching Changes in Etcd - Unencrypted
-
-    // alternatively, you can create a new viper instance.
-    var runtime_viper = viper.New()
-
-    runtime_viper.AddRemoteProvider("etcd", "http://127.0.0.1:4001", "/config/hugo.yml")
-    runtime_viper.SetConfigType("yaml") // because there is no file extension in a stream of bytes
-
-    // read from remote config the first time.
-    err := runtime_viper.ReadRemoteConfig()
-
-    // marshal config
-    runtime_viper.Marshal(&runtime_conf)
-
-    // open a goroutine to wath remote changes forever
-    go func(){
-        for {
-            time.Sleep(time.Second * 5) // delay after each request
-
-            // currenlty, only tested with etcd support
-            err := runtime_viper.WatchRemoteConfig()
-            if err != nil {
-                log.Errorf("unable to read remote config: %v", err)
-                continue
-            }
-
-            // marshal new config into our runtime config struct. you can also use channel 
-            // to implement a signal to notify the system of the changes
-            runtime_viper.Marshal(&runtime_conf)
-        }
-    }()
-
-
-## Getting Values From Viper
-
-In Viper, there are a few ways to get a value depending on what type of value you want to retrieved.
-The following functions and methods exist:
-
- * Get(key string) : interface{}
- * GetBool(key string) : bool
- * GetFloat64(key string) : float64
- * GetInt(key string) : int
- * GetString(key string) : string
- * GetStringMap(key string) : map[string]interface{}
- * GetStringMapString(key string) : map[string]string
- * GetStringSlice(key string) : []string
- * GetTime(key string) : time.Time
- * GetDuration(key string) : time.Duration
- * IsSet(key string) : bool
-
-One important thing to recognize is that each Get function will return
-its zero value if it’s not found. To check if a given key exists, the IsSet()
-method has been provided.
-
-Example:
-
-    viper.GetString("logfile") // case-insensitive Setting & Getting
-    if viper.GetBool("verbose") {
-        fmt.Println("verbose enabled")
-    }
-
-### Accessing nested keys
-
-The accessor methods also accept formatted paths to deeply nested keys. 
-For example, if the following JSON file is loaded:
-
-```
-{
-    "host": {
-        "address": "localhost",
-        "port": 5799
-    },
-    "datastore": {
-        "metric": {
-            "host": "127.0.0.1",
-            "port": 3099
-        },
-        "warehouse": {
-            "host": "198.0.0.1",
-            "port": 2112
-        }
-    }
-}
-
-```
-
-Viper can access a nested field by passing a `.` delimited path of keys:
-```
-GetString("datastore.metric.host") // (returns "127.0.0.1")
-```
-
-This obeys the precendense rules established above; the search for the root key
-(in this examole, `datastore`) will cascade through the remaining configuration registries
-until found. The search for the subkeys (`metric` and `host`), however, will not.
-
-For example, if the `metric` key was not defined in the configuration loaded
-from file, but was defined in the defaults, Viper would return the zero value.
-
-On the other hand, if the primary key was not defined, Viper would go through the
-remaining registries looking for it.
-
-Lastly, if there exists a key that matches the delimited key path, its value will
-be returned instead. E.g. 
-
-```
-{
-    "datastore.metric.host": "0.0.0.0",
-    "host": {
-        "address": "localhost",
-        "port": 5799
-    },
-    "datastore": {
-        "metric": {
-            "host": "127.0.0.1",
-            "port": 3099
-        },
-        "warehouse": {
-            "host": "198.0.0.1",
-            "port": 2112
-        }
-    }
-}
-
-GetString("datastore.metric.host") //returns "0.0.0.0"
-```
-
-### Marshaling
-
-You also have the option of Marshaling all or a specific value to a struct, map, etc.
-
-There are two methods to do this:
-
- * Marshal(rawVal interface{}) : error
- * MarshalKey(key string, rawVal interface{}) : error
-
-Example:
-
-	type config struct {
-		Port int
-		Name string
-	}
-
-	var C config
-
-	err := Marshal(&C)
-	if err != nil {
-		t.Fatalf("unable to decode into struct, %v", err)
-	}
-
-
-## Viper or Vipers?
-
-Viper comes ready to use out of the box. There is no configuration or
-initialization needed to begin using Viper. Since most applications will
-want to use a single central repository for their configuration, the
-viper package provides this. It is similar to a singleton.
-
-In all of the examples above, they demonstrate using viper in its
-singleton style approach.
-
-### Working with multiple vipers
-
-You can also create many different vipers for use in your application.
-Each will have it’s own unique set of configurations and values. Each
-can read from a different config file, key value store, etc. All of the
-functions that viper package supports are mirrored as methods on a viper.
-
-Example:
-
-    x := viper.New()
-    y := viper.New()
-
-	x.SetDefault("ContentDir", "content")
-	y.SetDefault("ContentDir", "foobar")
-
-    ...
-
-When working with multiple vipers, it is up to the user to keep track of
-the different vipers.
-
-## Q & A
-
-Q: Why not INI files?
-
-A: Ini files are pretty awful. There’s no standard format, and they are hard to
-validate. Viper is designed to work with JSON, TOML or YAML files. If someone
-really wants to add this feature, I’d be happy to merge it. It’s easy to
-specify which formats your application will permit.
-
-Q: Why is it called “Viper”?
-
-A: Viper is designed to be a [companion](http://en.wikipedia.org/wiki/Viper_(G.I._Joe)) to
-[Cobra](https://github.com/spf13/cobra). While both can operate completely
-independently, together they make a powerful pair to handle much of your
-application foundation needs.
-
-Q: Why is it called “Cobra”?
-
-A: Is there a better name for a [commander](http://en.wikipedia.org/wiki/Cobra_Commander)?

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/viper/remote/remote.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/viper/remote/remote.go b/Godeps/_workspace/src/github.com/spf13/viper/remote/remote.go
deleted file mode 100644
index faaf3b3..0000000
--- a/Godeps/_workspace/src/github.com/spf13/viper/remote/remote.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright © 2015 Steve Francia <sp...@spf13.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-// Package remote integrates the remote features of Viper.
-package remote
-
-import (
-	"bytes"
-	"github.com/spf13/viper"
-	crypt "github.com/xordataexchange/crypt/config"
-	"io"
-	"os"
-)
-
-type remoteConfigProvider struct{}
-
-func (rc remoteConfigProvider) Get(rp viper.RemoteProvider) (io.Reader, error) {
-	cm, err := getConfigManager(rp)
-	if err != nil {
-		return nil, err
-	}
-	b, err := cm.Get(rp.Path())
-	if err != nil {
-		return nil, err
-	}
-	return bytes.NewReader(b), nil
-}
-
-func (rc remoteConfigProvider) Watch(rp viper.RemoteProvider) (io.Reader, error) {
-	cm, err := getConfigManager(rp)
-	if err != nil {
-		return nil, err
-	}
-	resp := <-cm.Watch(rp.Path(), nil)
-	err = resp.Error
-	if err != nil {
-		return nil, err
-	}
-
-	return bytes.NewReader(resp.Value), nil
-}
-
-func getConfigManager(rp viper.RemoteProvider) (crypt.ConfigManager, error) {
-
-	var cm crypt.ConfigManager
-	var err error
-
-	if rp.SecretKeyring() != "" {
-		kr, err := os.Open(rp.SecretKeyring())
-		defer kr.Close()
-		if err != nil {
-			return nil, err
-		}
-		if rp.Provider() == "etcd" {
-			cm, err = crypt.NewEtcdConfigManager([]string{rp.Endpoint()}, kr)
-		} else {
-			cm, err = crypt.NewConsulConfigManager([]string{rp.Endpoint()}, kr)
-		}
-	} else {
-		if rp.Provider() == "etcd" {
-			cm, err = crypt.NewStandardEtcdConfigManager([]string{rp.Endpoint()})
-		} else {
-			cm, err = crypt.NewStandardConsulConfigManager([]string{rp.Endpoint()})
-		}
-	}
-	if err != nil {
-		return nil, err
-	}
-	return cm, nil
-
-}
-
-func init() {
-	viper.RemoteConfig = &remoteConfigProvider{}
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/viper/util.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/viper/util.go b/Godeps/_workspace/src/github.com/spf13/viper/util.go
deleted file mode 100644
index 7904b1a..0000000
--- a/Godeps/_workspace/src/github.com/spf13/viper/util.go
+++ /dev/null
@@ -1,198 +0,0 @@
-// Copyright © 2014 Steve Francia <sp...@spf13.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-// Viper is a application configuration system.
-// It believes that applications can be configured a variety of ways
-// via flags, ENVIRONMENT variables, configuration files retrieved
-// from the file system, or a remote key/value store.
-
-package viper
-
-import (
-	"bytes"
-	"encoding/json"
-	"fmt"
-	"io"
-	"os"
-	"path/filepath"
-	"runtime"
-	"strings"
-	"unicode"
-
-	"github.com/BurntSushi/toml"
-	"github.com/magiconair/properties"
-	"github.com/spf13/cast"
-	jww "github.com/spf13/jwalterweatherman"
-	"gopkg.in/yaml.v2"
-)
-
-func insensitiviseMap(m map[string]interface{}) {
-	for key, val := range m {
-		lower := strings.ToLower(key)
-		if key != lower {
-			delete(m, key)
-			m[lower] = val
-		}
-	}
-}
-
-func absPathify(inPath string) string {
-	jww.INFO.Println("Trying to resolve absolute path to", inPath)
-
-	if strings.HasPrefix(inPath, "$HOME") {
-		inPath = userHomeDir() + inPath[5:]
-	}
-
-	if strings.HasPrefix(inPath, "$") {
-		end := strings.Index(inPath, string(os.PathSeparator))
-		inPath = os.Getenv(inPath[1:end]) + inPath[end:]
-	}
-
-	if filepath.IsAbs(inPath) {
-		return filepath.Clean(inPath)
-	}
-
-	p, err := filepath.Abs(inPath)
-	if err == nil {
-		return filepath.Clean(p)
-	} else {
-		jww.ERROR.Println("Couldn't discover absolute path")
-		jww.ERROR.Println(err)
-	}
-	return ""
-}
-
-// Check if File / Directory Exists
-func exists(path string) (bool, error) {
-	_, err := os.Stat(path)
-	if err == nil {
-		return true, nil
-	}
-	if os.IsNotExist(err) {
-		return false, nil
-	}
-	return false, err
-}
-
-func stringInSlice(a string, list []string) bool {
-	for _, b := range list {
-		if b == a {
-			return true
-		}
-	}
-	return false
-}
-
-func userHomeDir() string {
-	if runtime.GOOS == "windows" {
-		home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
-		if home == "" {
-			home = os.Getenv("USERPROFILE")
-		}
-		return home
-	}
-	return os.Getenv("HOME")
-}
-
-func findCWD() (string, error) {
-	serverFile, err := filepath.Abs(os.Args[0])
-
-	if err != nil {
-		return "", fmt.Errorf("Can't get absolute path for executable: %v", err)
-	}
-
-	path := filepath.Dir(serverFile)
-	realFile, err := filepath.EvalSymlinks(serverFile)
-
-	if err != nil {
-		if _, err = os.Stat(serverFile + ".exe"); err == nil {
-			realFile = filepath.Clean(serverFile + ".exe")
-		}
-	}
-
-	if err == nil && realFile != serverFile {
-		path = filepath.Dir(realFile)
-	}
-
-	return path, nil
-}
-
-func marshallConfigReader(in io.Reader, c map[string]interface{}, configType string) {
-	buf := new(bytes.Buffer)
-	buf.ReadFrom(in)
-
-	switch strings.ToLower(configType) {
-	case "yaml", "yml":
-		if err := yaml.Unmarshal(buf.Bytes(), &c); err != nil {
-			jww.ERROR.Fatalf("Error parsing config: %s", err)
-		}
-
-	case "json":
-		if err := json.Unmarshal(buf.Bytes(), &c); err != nil {
-			jww.ERROR.Fatalf("Error parsing config: %s", err)
-		}
-
-	case "toml":
-		if _, err := toml.Decode(buf.String(), &c); err != nil {
-			jww.ERROR.Fatalf("Error parsing config: %s", err)
-		}
-
-	case "properties", "props", "prop":
-		var p *properties.Properties
-		var err error
-		if p, err = properties.Load(buf.Bytes(), properties.UTF8); err != nil {
-			jww.ERROR.Fatalf("Error parsing config: %s", err)
-		}
-		for _, key := range p.Keys() {
-			value, _ := p.Get(key)
-			c[key] = value
-		}
-	}
-
-	insensitiviseMap(c)
-}
-
-func safeMul(a, b uint) uint {
-	c := a * b
-	if a > 1 && b > 1 && c/b != a {
-		return 0
-	}
-	return c
-}
-
-// parseSizeInBytes converts strings like 1GB or 12 mb into an unsigned integer number of bytes
-func parseSizeInBytes(sizeStr string) uint {
-	sizeStr = strings.TrimSpace(sizeStr)
-	lastChar := len(sizeStr) - 1
-	multiplier := uint(1)
-
-	if lastChar > 0 {
-		if sizeStr[lastChar] == 'b' || sizeStr[lastChar] == 'B' {
-			if lastChar > 1 {
-				switch unicode.ToLower(rune(sizeStr[lastChar-1])) {
-				case 'k':
-					multiplier = 1 << 10
-					sizeStr = strings.TrimSpace(sizeStr[:lastChar-1])
-				case 'm':
-					multiplier = 1 << 20
-					sizeStr = strings.TrimSpace(sizeStr[:lastChar-1])
-				case 'g':
-					multiplier = 1 << 30
-					sizeStr = strings.TrimSpace(sizeStr[:lastChar-1])
-				default:
-					multiplier = 1
-					sizeStr = strings.TrimSpace(sizeStr[:lastChar])
-				}
-			}
-		}
-	}
-
-	size := cast.ToInt(sizeStr)
-	if size < 0 {
-		size = 0
-	}
-
-	return safeMul(uint(size), multiplier)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/viper/viper.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/viper/viper.go b/Godeps/_workspace/src/github.com/spf13/viper/viper.go
deleted file mode 100644
index 3db9cd2..0000000
--- a/Godeps/_workspace/src/github.com/spf13/viper/viper.go
+++ /dev/null
@@ -1,982 +0,0 @@
-// Copyright © 2014 Steve Francia <sp...@spf13.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-// Viper is a application configuration system.
-// It believes that applications can be configured a variety of ways
-// via flags, ENVIRONMENT variables, configuration files retrieved
-// from the file system, or a remote key/value store.
-
-// Each item takes precedence over the item below it:
-
-// overrides
-// flag
-// env
-// config
-// key/value store
-// default
-
-package viper
-
-import (
-	"bytes"
-	"fmt"
-	"io"
-	"io/ioutil"
-	"os"
-	"path/filepath"
-	"reflect"
-	"strings"
-	"time"
-
-	"github.com/kr/pretty"
-	"github.com/mitchellh/mapstructure"
-	"github.com/spf13/cast"
-	jww "github.com/spf13/jwalterweatherman"
-	"github.com/spf13/pflag"
-)
-
-var v *Viper
-
-func init() {
-	v = New()
-}
-
-type remoteConfigFactory interface {
-	Get(rp RemoteProvider) (io.Reader, error)
-	Watch(rp RemoteProvider) (io.Reader, error)
-}
-
-// RemoteConfig is optional, see the remote package
-var RemoteConfig remoteConfigFactory
-
-// Denotes encountering an unsupported
-// configuration filetype.
-type UnsupportedConfigError string
-
-// Returns the formatted configuration error.
-func (str UnsupportedConfigError) Error() string {
-	return fmt.Sprintf("Unsupported Config Type %q", string(str))
-}
-
-// Denotes encountering an unsupported remote
-// provider. Currently only Etcd and Consul are
-// supported.
-type UnsupportedRemoteProviderError string
-
-// Returns the formatted remote provider error.
-func (str UnsupportedRemoteProviderError) Error() string {
-	return fmt.Sprintf("Unsupported Remote Provider Type %q", string(str))
-}
-
-// Denotes encountering an error while trying to
-// pull the configuration from the remote provider.
-type RemoteConfigError string
-
-// Returns the formatted remote provider error
-func (rce RemoteConfigError) Error() string {
-	return fmt.Sprintf("Remote Configurations Error: %s", string(rce))
-}
-
-// Viper is a prioritized configuration registry. It
-// maintains a set of configuration sources, fetches
-// values to populate those, and provides them according
-// to the source's priority.
-// The priority of the sources is the following:
-// 1. overrides
-// 2. flags
-// 3. env. variables
-// 4. config file
-// 5. key/value store
-// 6. defaults
-//
-// For example, if values from the following sources were loaded:
-//
-//  Defaults : {
-//  	"secret": "",
-//  	"user": "default",
-// 	    "endpoint": "https://localhost"
-//  }
-//  Config : {
-//  	"user": "root"
-//	    "secret": "defaultsecret"
-//  }
-//  Env : {
-//  	"secret": "somesecretkey"
-//  }
-//
-// The resulting config will have the following values:
-//
-//	{
-//		"secret": "somesecretkey",
-//		"user": "root",
-//		"endpoint": "https://localhost"
-//	}
-type Viper struct {
-	// Delimiter that separates a list of keys
-	// used to access a nested value in one go
-	keyDelim string
-
-	// A set of paths to look for the config file in
-	configPaths []string
-
-	// A set of remote providers to search for the configuration
-	remoteProviders []*defaultRemoteProvider
-
-	// Name of file to look for inside the path
-	configName string
-	configFile string
-	configType string
-	envPrefix  string
-
-	automaticEnvApplied bool
-	envKeyReplacer      *strings.Replacer
-
-	config   map[string]interface{}
-	override map[string]interface{}
-	defaults map[string]interface{}
-	kvstore  map[string]interface{}
-	pflags   map[string]*pflag.Flag
-	env      map[string]string
-	aliases  map[string]string
-}
-
-// Returns an initialized Viper instance.
-func New() *Viper {
-	v := new(Viper)
-	v.keyDelim = "."
-	v.configName = "config"
-	v.config = make(map[string]interface{})
-	v.override = make(map[string]interface{})
-	v.defaults = make(map[string]interface{})
-	v.kvstore = make(map[string]interface{})
-	v.pflags = make(map[string]*pflag.Flag)
-	v.env = make(map[string]string)
-	v.aliases = make(map[string]string)
-
-	return v
-}
-
-// Intended for testing, will reset all to default settings.
-// In the public interface for the viper package so applications
-// can use it in their testing as well.
-func Reset() {
-	v = New()
-	SupportedExts = []string{"json", "toml", "yaml", "yml"}
-	SupportedRemoteProviders = []string{"etcd", "consul"}
-}
-
-type defaultRemoteProvider struct {
-	provider      string
-	endpoint      string
-	path          string
-	secretKeyring string
-}
-
-func (rp defaultRemoteProvider) Provider() string {
-	return rp.provider
-}
-
-func (rp defaultRemoteProvider) Endpoint() string {
-	return rp.endpoint
-}
-
-func (rp defaultRemoteProvider) Path() string {
-	return rp.path
-}
-
-func (rp defaultRemoteProvider) SecretKeyring() string {
-	return rp.secretKeyring
-}
-
-// RemoteProvider stores the configuration necessary
-// to connect to a remote key/value store.
-// Optional secretKeyring to unencrypt encrypted values
-// can be provided.
-type RemoteProvider interface {
-	Provider() string
-	Endpoint() string
-	Path() string
-	SecretKeyring() string
-}
-
-// Universally supported extensions.
-var SupportedExts []string = []string{"json", "toml", "yaml", "yml", "properties", "props", "prop"}
-
-// Universally supported remote providers.
-var SupportedRemoteProviders []string = []string{"etcd", "consul"}
-
-// Explicitly define the path, name and extension of the config file
-// Viper will use this and not check any of the config paths
-func SetConfigFile(in string) { v.SetConfigFile(in) }
-func (v *Viper) SetConfigFile(in string) {
-	if in != "" {
-		v.configFile = in
-	}
-}
-
-// Define a prefix that ENVIRONMENT variables will use.
-// E.g. if your prefix is "spf", the env registry
-// will look for env. variables that start with "SPF_"
-func SetEnvPrefix(in string) { v.SetEnvPrefix(in) }
-func (v *Viper) SetEnvPrefix(in string) {
-	if in != "" {
-		v.envPrefix = in
-	}
-}
-
-func (v *Viper) mergeWithEnvPrefix(in string) string {
-	if v.envPrefix != "" {
-		return strings.ToUpper(v.envPrefix + "_" + in)
-	}
-
-	return strings.ToUpper(in)
-}
-
-// TODO: should getEnv logic be moved into find(). Can generalize the use of
-// rewriting keys many things, Ex: Get('someKey') -> some_key
-// (cammel case to snake case for JSON keys perhaps)
-
-// getEnv s a wrapper around os.Getenv which replaces characters in the original
-// key. This allows env vars which have different keys then the config object
-// keys
-func (v *Viper) getEnv(key string) string {
-	if v.envKeyReplacer != nil {
-		key = v.envKeyReplacer.Replace(key)
-	}
-	return os.Getenv(key)
-}
-
-// Return the file used to populate the config registry
-func ConfigFileUsed() string            { return v.ConfigFileUsed() }
-func (v *Viper) ConfigFileUsed() string { return v.configFile }
-
-// Add a path for Viper to search for the config file in.
-// Can be called multiple times to define multiple search paths.
-func AddConfigPath(in string) { v.AddConfigPath(in) }
-func (v *Viper) AddConfigPath(in string) {
-	if in != "" {
-		absin := absPathify(in)
-		jww.INFO.Println("adding", absin, "to paths to search")
-		if !stringInSlice(absin, v.configPaths) {
-			v.configPaths = append(v.configPaths, absin)
-		}
-	}
-}
-
-// AddRemoteProvider adds a remote configuration source.
-// Remote Providers are searched in the order they are added.
-// provider is a string value, "etcd" or "consul" are currently supported.
-// endpoint is the url.  etcd requires http://ip:port  consul requires ip:port
-// path is the path in the k/v store to retrieve configuration
-// To retrieve a config file called myapp.json from /configs/myapp.json
-// you should set path to /configs and set config name (SetConfigName()) to
-// "myapp"
-func AddRemoteProvider(provider, endpoint, path string) error {
-	return v.AddRemoteProvider(provider, endpoint, path)
-}
-func (v *Viper) AddRemoteProvider(provider, endpoint, path string) error {
-	if !stringInSlice(provider, SupportedRemoteProviders) {
-		return UnsupportedRemoteProviderError(provider)
-	}
-	if provider != "" && endpoint != "" {
-		jww.INFO.Printf("adding %s:%s to remote provider list", provider, endpoint)
-		rp := &defaultRemoteProvider{
-			endpoint: endpoint,
-			provider: provider,
-			path:     path,
-		}
-		if !v.providerPathExists(rp) {
-			v.remoteProviders = append(v.remoteProviders, rp)
-		}
-	}
-	return nil
-}
-
-// AddSecureRemoteProvider adds a remote configuration source.
-// Secure Remote Providers are searched in the order they are added.
-// provider is a string value, "etcd" or "consul" are currently supported.
-// endpoint is the url.  etcd requires http://ip:port  consul requires ip:port
-// secretkeyring is the filepath to your openpgp secret keyring.  e.g. /etc/secrets/myring.gpg
-// path is the path in the k/v store to retrieve configuration
-// To retrieve a config file called myapp.json from /configs/myapp.json
-// you should set path to /configs and set config name (SetConfigName()) to
-// "myapp"
-// Secure Remote Providers are implemented with github.com/xordataexchange/crypt
-func AddSecureRemoteProvider(provider, endpoint, path, secretkeyring string) error {
-	return v.AddSecureRemoteProvider(provider, endpoint, path, secretkeyring)
-}
-
-func (v *Viper) AddSecureRemoteProvider(provider, endpoint, path, secretkeyring string) error {
-	if !stringInSlice(provider, SupportedRemoteProviders) {
-		return UnsupportedRemoteProviderError(provider)
-	}
-	if provider != "" && endpoint != "" {
-		jww.INFO.Printf("adding %s:%s to remote provider list", provider, endpoint)
-		rp := &defaultRemoteProvider{
-			endpoint:      endpoint,
-			provider:      provider,
-			path:          path,
-			secretKeyring: secretkeyring,
-		}
-		if !v.providerPathExists(rp) {
-			v.remoteProviders = append(v.remoteProviders, rp)
-		}
-	}
-	return nil
-}
-
-func (v *Viper) providerPathExists(p *defaultRemoteProvider) bool {
-	for _, y := range v.remoteProviders {
-		if reflect.DeepEqual(y, p) {
-			return true
-		}
-	}
-	return false
-}
-
-func (v *Viper) searchMap(source map[string]interface{}, path []string) interface{} {
-
-	if len(path) == 0 {
-		return source
-	}
-
-	if next, ok := source[path[0]]; ok {
-		switch next.(type) {
-		case map[interface{}]interface{}:
-			return v.searchMap(cast.ToStringMap(next), path[1:])
-		case map[string]interface{}:
-			// Type assertion is safe here since it is only reached
-			// if the type of `next` is the same as the type being asserted
-			return v.searchMap(next.(map[string]interface{}), path[1:])
-		default:
-			return next
-		}
-	} else {
-		return nil
-	}
-}
-
-// Viper is essentially repository for configurations
-// Get can retrieve any value given the key to use
-// Get has the behavior of returning the value associated with the first
-// place from where it is set. Viper will check in the following order:
-// override, flag, env, config file, key/value store, default
-//
-// Get returns an interface. For a specific value use one of the Get____ methods.
-func Get(key string) interface{} { return v.Get(key) }
-func (v *Viper) Get(key string) interface{} {
-	path := strings.Split(key, v.keyDelim)
-
-	val := v.find(strings.ToLower(key))
-
-	if val == nil {
-		source := v.find(path[0])
-		if source == nil {
-			return nil
-		}
-
-		if reflect.TypeOf(source).Kind() == reflect.Map {
-			val = v.searchMap(cast.ToStringMap(source), path[1:])
-		}
-	}
-
-	switch val.(type) {
-	case bool:
-		return cast.ToBool(val)
-	case string:
-		return cast.ToString(val)
-	case int64, int32, int16, int8, int:
-		return cast.ToInt(val)
-	case float64, float32:
-		return cast.ToFloat64(val)
-	case time.Time:
-		return cast.ToTime(val)
-	case time.Duration:
-		return cast.ToDuration(val)
-	case []string:
-		return val
-	}
-	return val
-}
-
-// Returns the value associated with the key as a string
-func GetString(key string) string { return v.GetString(key) }
-func (v *Viper) GetString(key string) string {
-	return cast.ToString(v.Get(key))
-}
-
-// Returns the value associated with the key asa boolean
-func GetBool(key string) bool { return v.GetBool(key) }
-func (v *Viper) GetBool(key string) bool {
-	return cast.ToBool(v.Get(key))
-}
-
-// Returns the value associated with the key as an integer
-func GetInt(key string) int { return v.GetInt(key) }
-func (v *Viper) GetInt(key string) int {
-	return cast.ToInt(v.Get(key))
-}
-
-// Returns the value associated with the key as a float64
-func GetFloat64(key string) float64 { return v.GetFloat64(key) }
-func (v *Viper) GetFloat64(key string) float64 {
-	return cast.ToFloat64(v.Get(key))
-}
-
-// Returns the value associated with the key as time
-func GetTime(key string) time.Time { return v.GetTime(key) }
-func (v *Viper) GetTime(key string) time.Time {
-	return cast.ToTime(v.Get(key))
-}
-
-// Returns the value associated with the key as a duration
-func GetDuration(key string) time.Duration { return v.GetDuration(key) }
-func (v *Viper) GetDuration(key string) time.Duration {
-	return cast.ToDuration(v.Get(key))
-}
-
-// Returns the value associated with the key as a slice of strings
-func GetStringSlice(key string) []string { return v.GetStringSlice(key) }
-func (v *Viper) GetStringSlice(key string) []string {
-	return cast.ToStringSlice(v.Get(key))
-}
-
-// Returns the value associated with the key as a map of interfaces
-func GetStringMap(key string) map[string]interface{} { return v.GetStringMap(key) }
-func (v *Viper) GetStringMap(key string) map[string]interface{} {
-	return cast.ToStringMap(v.Get(key))
-}
-
-// Returns the value associated with the key as a map of strings
-func GetStringMapString(key string) map[string]string { return v.GetStringMapString(key) }
-func (v *Viper) GetStringMapString(key string) map[string]string {
-	return cast.ToStringMapString(v.Get(key))
-}
-
-// Returns the size of the value associated with the given key
-// in bytes.
-func GetSizeInBytes(key string) uint { return v.GetSizeInBytes(key) }
-func (v *Viper) GetSizeInBytes(key string) uint {
-	sizeStr := cast.ToString(v.Get(key))
-	return parseSizeInBytes(sizeStr)
-}
-
-// Takes a single key and marshals it into a Struct
-func MarshalKey(key string, rawVal interface{}) error { return v.MarshalKey(key, rawVal) }
-func (v *Viper) MarshalKey(key string, rawVal interface{}) error {
-	return mapstructure.Decode(v.Get(key), rawVal)
-}
-
-// Marshals the config into a Struct. Make sure that the tags
-// on the fields of the structure are properly set.
-func Marshal(rawVal interface{}) error { return v.Marshal(rawVal) }
-func (v *Viper) Marshal(rawVal interface{}) error {
-	err := mapstructure.WeakDecode(v.AllSettings(), rawVal)
-
-	if err != nil {
-		return err
-	}
-
-	v.insensitiviseMaps()
-
-	return nil
-}
-
-// Bind a full flag set to the configuration, using each flag's long
-// name as the config key.
-func BindPFlags(flags *pflag.FlagSet) (err error) { return v.BindPFlags(flags) }
-func (v *Viper) BindPFlags(flags *pflag.FlagSet) (err error) {
-	flags.VisitAll(func(flag *pflag.Flag) {
-		if err != nil {
-			// an error has been encountered in one of the previous flags
-			return
-		}
-
-		err = v.BindPFlag(flag.Name, flag)
-		switch flag.Value.Type() {
-		case "int", "int8", "int16", "int32", "int64":
-			v.SetDefault(flag.Name, cast.ToInt(flag.Value.String()))
-		case "bool":
-			v.SetDefault(flag.Name, cast.ToBool(flag.Value.String()))
-		default:
-			v.SetDefault(flag.Name, flag.Value.String())
-		}
-	})
-	return
-}
-
-// Bind a specific key to a flag (as used by cobra)
-// Example(where serverCmd is a Cobra instance):
-//
-//	 serverCmd.Flags().Int("port", 1138, "Port to run Application server on")
-//	 Viper.BindPFlag("port", serverCmd.Flags().Lookup("port"))
-//
-func BindPFlag(key string, flag *pflag.Flag) (err error) { return v.BindPFlag(key, flag) }
-func (v *Viper) BindPFlag(key string, flag *pflag.Flag) (err error) {
-	if flag == nil {
-		return fmt.Errorf("flag for %q is nil", key)
-	}
-	v.pflags[strings.ToLower(key)] = flag
-
-	switch flag.Value.Type() {
-	case "int", "int8", "int16", "int32", "int64":
-		SetDefault(key, cast.ToInt(flag.Value.String()))
-	case "bool":
-		SetDefault(key, cast.ToBool(flag.Value.String()))
-	default:
-		SetDefault(key, flag.Value.String())
-	}
-	return nil
-}
-
-// Binds a Viper key to a ENV variable
-// ENV variables are case sensitive
-// If only a key is provided, it will use the env key matching the key, uppercased.
-// EnvPrefix will be used when set when env name is not provided.
-func BindEnv(input ...string) (err error) { return v.BindEnv(input...) }
-func (v *Viper) BindEnv(input ...string) (err error) {
-	var key, envkey string
-	if len(input) == 0 {
-		return fmt.Errorf("BindEnv missing key to bind to")
-	}
-
-	key = strings.ToLower(input[0])
-
-	if len(input) == 1 {
-		envkey = v.mergeWithEnvPrefix(key)
-	} else {
-		envkey = input[1]
-	}
-
-	v.env[key] = envkey
-
-	return nil
-}
-
-// Given a key, find the value
-// Viper will check in the following order:
-// flag, env, config file, key/value store, default
-// Viper will check to see if an alias exists first
-func (v *Viper) find(key string) interface{} {
-	var val interface{}
-	var exists bool
-
-	// if the requested key is an alias, then return the proper key
-	key = v.realKey(key)
-
-	// PFlag Override first
-	flag, exists := v.pflags[key]
-	if exists {
-		if flag.Changed {
-			jww.TRACE.Println(key, "found in override (via pflag):", val)
-			return flag.Value.String()
-		}
-	}
-
-	val, exists = v.override[key]
-	if exists {
-		jww.TRACE.Println(key, "found in override:", val)
-		return val
-	}
-
-	if v.automaticEnvApplied {
-		// even if it hasn't been registered, if automaticEnv is used,
-		// check any Get request
-		if val = v.getEnv(v.mergeWithEnvPrefix(key)); val != "" {
-			jww.TRACE.Println(key, "found in environment with val:", val)
-			return val
-		}
-	}
-
-	envkey, exists := v.env[key]
-	if exists {
-		jww.TRACE.Println(key, "registered as env var", envkey)
-		if val = v.getEnv(envkey); val != "" {
-			jww.TRACE.Println(envkey, "found in environment with val:", val)
-			return val
-		} else {
-			jww.TRACE.Println(envkey, "env value unset:")
-		}
-	}
-
-	val, exists = v.config[key]
-	if exists {
-		jww.TRACE.Println(key, "found in config:", val)
-		return val
-	}
-
-	val, exists = v.kvstore[key]
-	if exists {
-		jww.TRACE.Println(key, "found in key/value store:", val)
-		return val
-	}
-
-	val, exists = v.defaults[key]
-	if exists {
-		jww.TRACE.Println(key, "found in defaults:", val)
-		return val
-	}
-
-	return nil
-}
-
-// Check to see if the key has been set in any of the data locations
-func IsSet(key string) bool { return v.IsSet(key) }
-func (v *Viper) IsSet(key string) bool {
-	t := v.Get(key)
-	return t != nil
-}
-
-// Have Viper check ENV variables for all
-// keys set in config, default & flags
-func AutomaticEnv() { v.AutomaticEnv() }
-func (v *Viper) AutomaticEnv() {
-	v.automaticEnvApplied = true
-}
-
-// SetEnvKeyReplacer sets the strings.Replacer on the viper object
-// Useful for mapping an environmental variable to a key that does
-// not match it.
-func SetEnvKeyReplacer(r *strings.Replacer) { v.SetEnvKeyReplacer(r) }
-func (v *Viper) SetEnvKeyReplacer(r *strings.Replacer) {
-	v.envKeyReplacer = r
-}
-
-// Aliases provide another accessor for the same key.
-// This enables one to change a name without breaking the application
-func RegisterAlias(alias string, key string) { v.RegisterAlias(alias, key) }
-func (v *Viper) RegisterAlias(alias string, key string) {
-	v.registerAlias(alias, strings.ToLower(key))
-}
-
-func (v *Viper) registerAlias(alias string, key string) {
-	alias = strings.ToLower(alias)
-	if alias != key && alias != v.realKey(key) {
-		_, exists := v.aliases[alias]
-
-		if !exists {
-			// if we alias something that exists in one of the maps to another
-			// name, we'll never be able to get that value using the original
-			// name, so move the config value to the new realkey.
-			if val, ok := v.config[alias]; ok {
-				delete(v.config, alias)
-				v.config[key] = val
-			}
-			if val, ok := v.kvstore[alias]; ok {
-				delete(v.kvstore, alias)
-				v.kvstore[key] = val
-			}
-			if val, ok := v.defaults[alias]; ok {
-				delete(v.defaults, alias)
-				v.defaults[key] = val
-			}
-			if val, ok := v.override[alias]; ok {
-				delete(v.override, alias)
-				v.override[key] = val
-			}
-			v.aliases[alias] = key
-		}
-	} else {
-		jww.WARN.Println("Creating circular reference alias", alias, key, v.realKey(key))
-	}
-}
-
-func (v *Viper) realKey(key string) string {
-	newkey, exists := v.aliases[key]
-	if exists {
-		jww.DEBUG.Println("Alias", key, "to", newkey)
-		return v.realKey(newkey)
-	} else {
-		return key
-	}
-}
-
-// Check to see if the given key (or an alias) is in the config file
-func InConfig(key string) bool { return v.InConfig(key) }
-func (v *Viper) InConfig(key string) bool {
-	// if the requested key is an alias, then return the proper key
-	key = v.realKey(key)
-
-	_, exists := v.config[key]
-	return exists
-}
-
-// Set the default value for this key.
-// Default only used when no value is provided by the user via flag, config or ENV.
-func SetDefault(key string, value interface{}) { v.SetDefault(key, value) }
-func (v *Viper) SetDefault(key string, value interface{}) {
-	// If alias passed in, then set the proper default
-	key = v.realKey(strings.ToLower(key))
-	v.defaults[key] = value
-}
-
-// Sets the value for the key in the override regiser.
-// Will be used instead of values obtained via
-// flags, config file, ENV, default, or key/value store
-func Set(key string, value interface{}) { v.Set(key, value) }
-func (v *Viper) Set(key string, value interface{}) {
-	// If alias passed in, then set the proper override
-	key = v.realKey(strings.ToLower(key))
-	v.override[key] = value
-}
-
-// Viper will discover and load the configuration file from disk
-// and key/value stores, searching in one of the defined paths.
-func ReadInConfig() error { return v.ReadInConfig() }
-func (v *Viper) ReadInConfig() error {
-	jww.INFO.Println("Attempting to read in config file")
-	if !stringInSlice(v.getConfigType(), SupportedExts) {
-		return UnsupportedConfigError(v.getConfigType())
-	}
-
-	file, err := ioutil.ReadFile(v.getConfigFile())
-	if err != nil {
-		return err
-	}
-
-	v.config = make(map[string]interface{})
-
-	v.marshalReader(bytes.NewReader(file), v.config)
-	return nil
-}
-
-func ReadConfig(in io.Reader) error { return v.ReadConfig(in) }
-func (v *Viper) ReadConfig(in io.Reader) error {
-	v.config = make(map[string]interface{})
-	v.marshalReader(in, v.config)
-	return nil
-}
-
-// func ReadBufConfig(buf *bytes.Buffer) error { return v.ReadBufConfig(buf) }
-// func (v *Viper) ReadBufConfig(buf *bytes.Buffer) error {
-// 	v.config = make(map[string]interface{})
-// 	v.marshalReader(buf, v.config)
-// 	return nil
-// }
-
-// Attempts to get configuration from a remote source
-// and read it in the remote configuration registry.
-func ReadRemoteConfig() error { return v.ReadRemoteConfig() }
-func (v *Viper) ReadRemoteConfig() error {
-	err := v.getKeyValueConfig()
-	if err != nil {
-		return err
-	}
-	return nil
-}
-
-func WatchRemoteConfig() error { return v.WatchRemoteConfig() }
-func (v *Viper) WatchRemoteConfig() error {
-	err := v.watchKeyValueConfig()
-	if err != nil {
-		return err
-	}
-	return nil
-}
-
-// Marshall a Reader into a map
-// Should probably be an unexported function
-func marshalReader(in io.Reader, c map[string]interface{}) { v.marshalReader(in, c) }
-func (v *Viper) marshalReader(in io.Reader, c map[string]interface{}) {
-	marshallConfigReader(in, c, v.getConfigType())
-}
-
-func (v *Viper) insensitiviseMaps() {
-	insensitiviseMap(v.config)
-	insensitiviseMap(v.defaults)
-	insensitiviseMap(v.override)
-	insensitiviseMap(v.kvstore)
-}
-
-// retrieve the first found remote configuration
-func (v *Viper) getKeyValueConfig() error {
-	if RemoteConfig == nil {
-		return RemoteConfigError("Enable the remote features by doing a blank import of the viper/remote package: '_ github.com/spf13/viper/remote'")
-	}
-
-	for _, rp := range v.remoteProviders {
-		val, err := v.getRemoteConfig(rp)
-		if err != nil {
-			continue
-		}
-		v.kvstore = val
-		return nil
-	}
-	return RemoteConfigError("No Files Found")
-}
-
-func (v *Viper) getRemoteConfig(provider *defaultRemoteProvider) (map[string]interface{}, error) {
-
-	reader, err := RemoteConfig.Get(provider)
-	if err != nil {
-		return nil, err
-	}
-	v.marshalReader(reader, v.kvstore)
-	return v.kvstore, err
-}
-
-// retrieve the first found remote configuration
-func (v *Viper) watchKeyValueConfig() error {
-	for _, rp := range v.remoteProviders {
-		val, err := v.watchRemoteConfig(rp)
-		if err != nil {
-			continue
-		}
-		v.kvstore = val
-		return nil
-	}
-	return RemoteConfigError("No Files Found")
-}
-
-func (v *Viper) watchRemoteConfig(provider *defaultRemoteProvider) (map[string]interface{}, error) {
-	reader, err := RemoteConfig.Watch(provider)
-	if err != nil {
-		return nil, err
-	}
-	v.marshalReader(reader, v.kvstore)
-	return v.kvstore, err
-}
-
-// Return all keys regardless where they are set
-func AllKeys() []string { return v.AllKeys() }
-func (v *Viper) AllKeys() []string {
-	m := map[string]struct{}{}
-
-	for key, _ := range v.defaults {
-		m[key] = struct{}{}
-	}
-
-	for key, _ := range v.config {
-		m[key] = struct{}{}
-	}
-
-	for key, _ := range v.kvstore {
-		m[key] = struct{}{}
-	}
-
-	for key, _ := range v.override {
-		m[key] = struct{}{}
-	}
-
-	a := []string{}
-	for x, _ := range m {
-		a = append(a, x)
-	}
-
-	return a
-}
-
-// Return all settings as a map[string]interface{}
-func AllSettings() map[string]interface{} { return v.AllSettings() }
-func (v *Viper) AllSettings() map[string]interface{} {
-	m := map[string]interface{}{}
-	for _, x := range v.AllKeys() {
-		m[x] = v.Get(x)
-	}
-
-	return m
-}
-
-// Name for the config file.
-// Does not include extension.
-func SetConfigName(in string) { v.SetConfigName(in) }
-func (v *Viper) SetConfigName(in string) {
-	if in != "" {
-		v.configName = in
-	}
-}
-
-// Sets the type of the configuration returned by the
-// remote source, e.g. "json".
-func SetConfigType(in string) { v.SetConfigType(in) }
-func (v *Viper) SetConfigType(in string) {
-	if in != "" {
-		v.configType = in
-	}
-}
-
-func (v *Viper) getConfigType() string {
-	if v.configType != "" {
-		return v.configType
-	}
-
-	cf := v.getConfigFile()
-	ext := filepath.Ext(cf)
-
-	if len(ext) > 1 {
-		return ext[1:]
-	} else {
-		return ""
-	}
-}
-
-func (v *Viper) getConfigFile() string {
-	// if explicitly set, then use it
-	if v.configFile != "" {
-		return v.configFile
-	}
-
-	cf, err := v.findConfigFile()
-	if err != nil {
-		return ""
-	}
-
-	v.configFile = cf
-	return v.getConfigFile()
-}
-
-func (v *Viper) searchInPath(in string) (filename string) {
-	jww.DEBUG.Println("Searching for config in ", in)
-	for _, ext := range SupportedExts {
-		jww.DEBUG.Println("Checking for", filepath.Join(in, v.configName+"."+ext))
-		if b, _ := exists(filepath.Join(in, v.configName+"."+ext)); b {
-			jww.DEBUG.Println("Found: ", filepath.Join(in, v.configName+"."+ext))
-			return filepath.Join(in, v.configName+"."+ext)
-		}
-	}
-
-	return ""
-}
-
-// search all configPaths for any config file.
-// Returns the first path that exists (and is a config file)
-func (v *Viper) findConfigFile() (string, error) {
-	jww.INFO.Println("Searching for config in ", v.configPaths)
-
-	for _, cp := range v.configPaths {
-		file := v.searchInPath(cp)
-		if file != "" {
-			return file, nil
-		}
-	}
-
-	// try the current working directory
-	wd, _ := os.Getwd()
-	file := v.searchInPath(wd)
-	if file != "" {
-		return file, nil
-	}
-	return "", fmt.Errorf("config file not found in: %s", v.configPaths)
-}
-
-// Prints all configuration registries for debugging
-// purposes.
-func Debug() { v.Debug() }
-func (v *Viper) Debug() {
-	fmt.Println("Aliases:")
-	pretty.Println(v.aliases)
-	fmt.Println("Override:")
-	pretty.Println(v.override)
-	fmt.Println("PFlags")
-	pretty.Println(v.pflags)
-	fmt.Println("Env:")
-	pretty.Println(v.env)
-	fmt.Println("Key/Value Store:")
-	pretty.Println(v.kvstore)
-	fmt.Println("Config:")
-	pretty.Println(v.config)
-	fmt.Println("Defaults:")
-	pretty.Println(v.defaults)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go b/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go
deleted file mode 100644
index 8d7d152..0000000
--- a/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go
+++ /dev/null
@@ -1,559 +0,0 @@
-// Copyright © 2014 Steve Francia <sp...@spf13.com>.
-//
-// Use of this source code is governed by an MIT-style
-// license that can be found in the LICENSE file.
-
-package viper
-
-import (
-	"bytes"
-	"fmt"
-	"os"
-	"sort"
-	"strings"
-	"testing"
-	"time"
-
-	"github.com/spf13/pflag"
-	"github.com/stretchr/testify/assert"
-)
-
-var yamlExample = []byte(`Hacker: true
-name: steve
-hobbies:
-- skateboarding
-- snowboarding
-- go
-clothing:
-  jacket: leather
-  trousers: denim
-  pants:
-    size: large
-age: 35
-eyes : brown
-beard: true
-`)
-
-var tomlExample = []byte(`
-title = "TOML Example"
-
-[owner]
-organization = "MongoDB"
-Bio = "MongoDB Chief Developer Advocate & Hacker at Large"
-dob = 1979-05-27T07:32:00Z # First class dates? Why not?`)
-
-var jsonExample = []byte(`{
-"id": "0001",
-"type": "donut",
-"name": "Cake",
-"ppu": 0.55,
-"batters": {
-        "batter": [
-                { "type": "Regular" },
-                { "type": "Chocolate" },
-                { "type": "Blueberry" },
-                { "type": "Devil's Food" }
-            ]
-    }
-}`)
-
-var propertiesExample = []byte(`
-p_id: 0001
-p_type: donut
-p_name: Cake
-p_ppu: 0.55
-p_batters.batter.type: Regular
-`)
-
-var remoteExample = []byte(`{
-"id":"0002",
-"type":"cronut",
-"newkey":"remote"
-}`)
-
-func initConfigs() {
-	Reset()
-	SetConfigType("yaml")
-	r := bytes.NewReader(yamlExample)
-	marshalReader(r, v.config)
-
-	SetConfigType("json")
-	r = bytes.NewReader(jsonExample)
-	marshalReader(r, v.config)
-
-	SetConfigType("properties")
-	r = bytes.NewReader(propertiesExample)
-	marshalReader(r, v.config)
-
-	SetConfigType("toml")
-	r = bytes.NewReader(tomlExample)
-	marshalReader(r, v.config)
-
-	SetConfigType("json")
-	remote := bytes.NewReader(remoteExample)
-	marshalReader(remote, v.kvstore)
-}
-
-func initYAML() {
-	Reset()
-	SetConfigType("yaml")
-	r := bytes.NewReader(yamlExample)
-
-	marshalReader(r, v.config)
-}
-
-func initJSON() {
-	Reset()
-	SetConfigType("json")
-	r := bytes.NewReader(jsonExample)
-
-	marshalReader(r, v.config)
-}
-
-func initProperties() {
-	Reset()
-	SetConfigType("properties")
-	r := bytes.NewReader(propertiesExample)
-
-	marshalReader(r, v.config)
-}
-
-func initTOML() {
-	Reset()
-	SetConfigType("toml")
-	r := bytes.NewReader(tomlExample)
-
-	marshalReader(r, v.config)
-}
-
-//stubs for PFlag Values
-type stringValue string
-
-func newStringValue(val string, p *string) *stringValue {
-	*p = val
-	return (*stringValue)(p)
-}
-
-func (s *stringValue) Set(val string) error {
-	*s = stringValue(val)
-	return nil
-}
-
-func (s *stringValue) Type() string {
-	return "string"
-}
-
-func (s *stringValue) String() string {
-	return fmt.Sprintf("%s", *s)
-}
-
-func TestBasics(t *testing.T) {
-	SetConfigFile("/tmp/config.yaml")
-	assert.Equal(t, "/tmp/config.yaml", v.getConfigFile())
-}
-
-func TestDefault(t *testing.T) {
-	SetDefault("age", 45)
-	assert.Equal(t, 45, Get("age"))
-}
-
-func TestMarshalling(t *testing.T) {
-	SetConfigType("yaml")
-	r := bytes.NewReader(yamlExample)
-
-	marshalReader(r, v.config)
-	assert.True(t, InConfig("name"))
-	assert.False(t, InConfig("state"))
-	assert.Equal(t, "steve", Get("name"))
-	assert.Equal(t, []interface{}{"skateboarding", "snowboarding", "go"}, Get("hobbies"))
-	assert.Equal(t, map[interface{}]interface{}{"jacket": "leather", "trousers": "denim", "pants": map[interface{}]interface{}{"size": "large"}}, Get("clothing"))
-	assert.Equal(t, 35, Get("age"))
-}
-
-func TestOverrides(t *testing.T) {
-	Set("age", 40)
-	assert.Equal(t, 40, Get("age"))
-}
-
-func TestDefaultPost(t *testing.T) {
-	assert.NotEqual(t, "NYC", Get("state"))
-	SetDefault("state", "NYC")
-	assert.Equal(t, "NYC", Get("state"))
-}
-
-func TestAliases(t *testing.T) {
-	RegisterAlias("years", "age")
-	assert.Equal(t, 40, Get("years"))
-	Set("years", 45)
-	assert.Equal(t, 45, Get("age"))
-}
-
-func TestAliasInConfigFile(t *testing.T) {
-	// the config file specifies "beard".  If we make this an alias for
-	// "hasbeard", we still want the old config file to work with beard.
-	RegisterAlias("beard", "hasbeard")
-	assert.Equal(t, true, Get("hasbeard"))
-	Set("hasbeard", false)
-	assert.Equal(t, false, Get("beard"))
-}
-
-func TestYML(t *testing.T) {
-	initYAML()
-	assert.Equal(t, "steve", Get("name"))
-}
-
-func TestJSON(t *testing.T) {
-	initJSON()
-	assert.Equal(t, "0001", Get("id"))
-}
-
-func TestProperties(t *testing.T) {
-	initProperties()
-	assert.Equal(t, "0001", Get("p_id"))
-}
-
-func TestTOML(t *testing.T) {
-	initTOML()
-	assert.Equal(t, "TOML Example", Get("title"))
-}
-
-func TestRemotePrecedence(t *testing.T) {
-	initJSON()
-
-	remote := bytes.NewReader(remoteExample)
-	assert.Equal(t, "0001", Get("id"))
-	marshalReader(remote, v.kvstore)
-	assert.Equal(t, "0001", Get("id"))
-	assert.NotEqual(t, "cronut", Get("type"))
-	assert.Equal(t, "remote", Get("newkey"))
-	Set("newkey", "newvalue")
-	assert.NotEqual(t, "remote", Get("newkey"))
-	assert.Equal(t, "newvalue", Get("newkey"))
-	Set("newkey", "remote")
-}
-
-func TestEnv(t *testing.T) {
-	initJSON()
-
-	BindEnv("id")
-	BindEnv("f", "FOOD")
-
-	os.Setenv("ID", "13")
-	os.Setenv("FOOD", "apple")
-	os.Setenv("NAME", "crunk")
-
-	assert.Equal(t, "13", Get("id"))
-	assert.Equal(t, "apple", Get("f"))
-	assert.Equal(t, "Cake", Get("name"))
-
-	AutomaticEnv()
-
-	assert.Equal(t, "crunk", Get("name"))
-
-}
-
-func TestEnvPrefix(t *testing.T) {
-	initJSON()
-
-	SetEnvPrefix("foo") // will be uppercased automatically
-	BindEnv("id")
-	BindEnv("f", "FOOD") // not using prefix
-
-	os.Setenv("FOO_ID", "13")
-	os.Setenv("FOOD", "apple")
-	os.Setenv("FOO_NAME", "crunk")
-
-	assert.Equal(t, "13", Get("id"))
-	assert.Equal(t, "apple", Get("f"))
-	assert.Equal(t, "Cake", Get("name"))
-
-	AutomaticEnv()
-
-	assert.Equal(t, "crunk", Get("name"))
-}
-
-func TestAutoEnv(t *testing.T) {
-	Reset()
-
-	AutomaticEnv()
-	os.Setenv("FOO_BAR", "13")
-	assert.Equal(t, "13", Get("foo_bar"))
-}
-
-func TestAutoEnvWithPrefix(t *testing.T) {
-	Reset()
-
-	AutomaticEnv()
-	SetEnvPrefix("Baz")
-	os.Setenv("BAZ_BAR", "13")
-	assert.Equal(t, "13", Get("bar"))
-}
-
-func TestSetEnvReplacer(t *testing.T) {
-	Reset()
-
-	AutomaticEnv()
-	os.Setenv("REFRESH_INTERVAL", "30s")
-
-	replacer := strings.NewReplacer("-", "_")
-	SetEnvKeyReplacer(replacer)
-
-	assert.Equal(t, "30s", Get("refresh-interval"))
-}
-
-func TestAllKeys(t *testing.T) {
-	initConfigs()
-
-	ks := sort.StringSlice{"title", "newkey", "owner", "name", "beard", "ppu", "batters", "hobbies", "clothing", "age", "hacker", "id", "type", "eyes", "p_id", "p_ppu", "p_batters.batter.type", "p_type", "p_name"}
-	dob, _ := time.Parse(time.RFC3339, "1979-05-27T07:32:00Z")
-	all := map[string]interface{}{"owner": map[string]interface{}{"organization": "MongoDB", "Bio": "MongoDB Chief Developer Advocate & Hacker at Large", "dob": dob}, "title": "TOML Example", "ppu": 0.55, "eyes": "brown", "clothing": map[interface{}]interface{}{"trousers": "denim", "jacket": "leather", "pants": map[interface{}]interface{}{"size": "large"}}, "id": "0001", "batters": map[string]interface{}{"batter": []interface{}{map[string]interface{}{"type": "Regular"}, map[string]interface{}{"type": "Chocolate"}, map[string]interface{}{"type": "Blueberry"}, map[string]interface{}{"type": "Devil's Food"}}}, "hacker": true, "beard": true, "hobbies": []interface{}{"skateboarding", "snowboarding", "go"}, "age": 35, "type": "donut", "newkey": "remote", "name": "Cake", "p_id": "0001", "p_ppu": "0.55", "p_name": "Cake", "p_batters.batter.type": "Regular", "p_type": "donut"}
-
-	var allkeys sort.StringSlice
-	allkeys = AllKeys()
-	allkeys.Sort()
-	ks.Sort()
-
-	assert.Equal(t, ks, allkeys)
-	assert.Equal(t, all, AllSettings())
-}
-
-func TestCaseInSensitive(t *testing.T) {
-	assert.Equal(t, true, Get("hacker"))
-	Set("Title", "Checking Case")
-	assert.Equal(t, "Checking Case", Get("tItle"))
-}
-
-func TestAliasesOfAliases(t *testing.T) {
-	RegisterAlias("Foo", "Bar")
-	RegisterAlias("Bar", "Title")
-	assert.Equal(t, "Checking Case", Get("FOO"))
-}
-
-func TestRecursiveAliases(t *testing.T) {
-	RegisterAlias("Baz", "Roo")
-	RegisterAlias("Roo", "baz")
-}
-
-func TestMarshal(t *testing.T) {
-	SetDefault("port", 1313)
-	Set("name", "Steve")
-
-	type config struct {
-		Port int
-		Name string
-	}
-
-	var C config
-
-	err := Marshal(&C)
-	if err != nil {
-		t.Fatalf("unable to decode into struct, %v", err)
-	}
-
-	assert.Equal(t, &C, &config{Name: "Steve", Port: 1313})
-
-	Set("port", 1234)
-	err = Marshal(&C)
-	if err != nil {
-		t.Fatalf("unable to decode into struct, %v", err)
-	}
-	assert.Equal(t, &C, &config{Name: "Steve", Port: 1234})
-}
-
-func TestBindPFlags(t *testing.T) {
-	flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError)
-
-	var testValues = map[string]*string{
-		"host":     nil,
-		"port":     nil,
-		"endpoint": nil,
-	}
-
-	var mutatedTestValues = map[string]string{
-		"host":     "localhost",
-		"port":     "6060",
-		"endpoint": "/public",
-	}
-
-	for name, _ := range testValues {
-		testValues[name] = flagSet.String(name, "", "test")
-	}
-
-	err := BindPFlags(flagSet)
-	if err != nil {
-		t.Fatalf("error binding flag set, %v", err)
-	}
-
-	flagSet.VisitAll(func(flag *pflag.Flag) {
-		flag.Value.Set(mutatedTestValues[flag.Name])
-		flag.Changed = true
-	})
-
-	for name, expected := range mutatedTestValues {
-		assert.Equal(t, Get(name), expected)
-	}
-
-}
-
-func TestBindPFlag(t *testing.T) {
-	var testString = "testing"
-	var testValue = newStringValue(testString, &testString)
-
-	flag := &pflag.Flag{
-		Name:    "testflag",
-		Value:   testValue,
-		Changed: false,
-	}
-
-	BindPFlag("testvalue", flag)
-
-	assert.Equal(t, testString, Get("testvalue"))
-
-	flag.Value.Set("testing_mutate")
-	flag.Changed = true //hack for pflag usage
-
-	assert.Equal(t, "testing_mutate", Get("testvalue"))
-
-}
-
-func TestBoundCaseSensitivity(t *testing.T) {
-
-	assert.Equal(t, "brown", Get("eyes"))
-
-	BindEnv("eYEs", "TURTLE_EYES")
-	os.Setenv("TURTLE_EYES", "blue")
-
-	assert.Equal(t, "blue", Get("eyes"))
-
-	var testString = "green"
-	var testValue = newStringValue(testString, &testString)
-
-	flag := &pflag.Flag{
-		Name:    "eyeballs",
-		Value:   testValue,
-		Changed: true,
-	}
-
-	BindPFlag("eYEs", flag)
-	assert.Equal(t, "green", Get("eyes"))
-
-}
-
-func TestSizeInBytes(t *testing.T) {
-	input := map[string]uint{
-		"":               0,
-		"b":              0,
-		"12 bytes":       0,
-		"200000000000gb": 0,
-		"12 b":           12,
-		"43 MB":          43 * (1 << 20),
-		"10mb":           10 * (1 << 20),
-		"1gb":            1 << 30,
-	}
-
-	for str, expected := range input {
-		assert.Equal(t, expected, parseSizeInBytes(str), str)
-	}
-}
-
-func TestFindsNestedKeys(t *testing.T) {
-	initConfigs()
-	dob, _ := time.Parse(time.RFC3339, "1979-05-27T07:32:00Z")
-
-	Set("super", map[string]interface{}{
-		"deep": map[string]interface{}{
-			"nested": "value",
-		},
-	})
-
-	expected := map[string]interface{}{
-		"super": map[string]interface{}{
-			"deep": map[string]interface{}{
-				"nested": "value",
-			},
-		},
-		"super.deep": map[string]interface{}{
-			"nested": "value",
-		},
-		"super.deep.nested":  "value",
-		"owner.organization": "MongoDB",
-		"batters.batter": []interface{}{
-			map[string]interface{}{
-				"type": "Regular",
-			},
-			map[string]interface{}{
-				"type": "Chocolate",
-			},
-			map[string]interface{}{
-				"type": "Blueberry",
-			},
-			map[string]interface{}{
-				"type": "Devil's Food",
-			},
-		},
-		"hobbies": []interface{}{
-			"skateboarding", "snowboarding", "go",
-		},
-		"title":  "TOML Example",
-		"newkey": "remote",
-		"batters": map[string]interface{}{
-			"batter": []interface{}{
-				map[string]interface{}{
-					"type": "Regular",
-				},
-				map[string]interface{}{
-					"type": "Chocolate",
-				}, map[string]interface{}{
-					"type": "Blueberry",
-				}, map[string]interface{}{
-					"type": "Devil's Food",
-				},
-			},
-		},
-		"eyes": "brown",
-		"age":  35,
-		"owner": map[string]interface{}{
-			"organization": "MongoDB",
-			"Bio":          "MongoDB Chief Developer Advocate & Hacker at Large",
-			"dob":          dob,
-		},
-		"owner.Bio": "MongoDB Chief Developer Advocate & Hacker at Large",
-		"type":      "donut",
-		"id":        "0001",
-		"name":      "Cake",
-		"hacker":    true,
-		"ppu":       0.55,
-		"clothing": map[interface{}]interface{}{
-			"jacket":   "leather",
-			"trousers": "denim",
-			"pants": map[interface{}]interface{}{
-				"size": "large",
-			},
-		},
-		"clothing.jacket":     "leather",
-		"clothing.pants.size": "large",
-		"clothing.trousers":   "denim",
-		"owner.dob":           dob,
-		"beard":               true,
-	}
-
-	for key, expectedValue := range expected {
-
-		assert.Equal(t, expectedValue, v.Get(key))
-	}
-
-}
-
-func TestReadBufConfig(t *testing.T) {
-	v := New()
-	v.SetConfigType("yaml")
-	v.ReadConfig(bytes.NewBuffer(yamlExample))
-	t.Log(v.AllKeys())
-
-	assert.True(t, v.InConfig("name"))
-	assert.False(t, v.InConfig("state"))
-	assert.Equal(t, "steve", v.Get("name"))
-	assert.Equal(t, []interface{}{"skateboarding", "snowboarding", "go"}, v.Get("hobbies"))
-	assert.Equal(t, map[interface{}]interface{}{"jacket": "leather", "trousers": "denim", "pants": map[interface{}]interface{}{"size": "large"}}, v.Get("clothing"))
-	assert.Equal(t, 35, v.Get("age"))
-}


[06/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/emitterc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/emitterc.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/emitterc.go
new file mode 100644
index 0000000..2befd55
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/emitterc.go
@@ -0,0 +1,1685 @@
+package yaml
+
+import (
+	"bytes"
+)
+
+// Flush the buffer if needed.
+func flush(emitter *yaml_emitter_t) bool {
+	if emitter.buffer_pos+5 >= len(emitter.buffer) {
+		return yaml_emitter_flush(emitter)
+	}
+	return true
+}
+
+// Put a character to the output buffer.
+func put(emitter *yaml_emitter_t, value byte) bool {
+	if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {
+		return false
+	}
+	emitter.buffer[emitter.buffer_pos] = value
+	emitter.buffer_pos++
+	emitter.column++
+	return true
+}
+
+// Put a line break to the output buffer.
+func put_break(emitter *yaml_emitter_t) bool {
+	if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {
+		return false
+	}
+	switch emitter.line_break {
+	case yaml_CR_BREAK:
+		emitter.buffer[emitter.buffer_pos] = '\r'
+		emitter.buffer_pos += 1
+	case yaml_LN_BREAK:
+		emitter.buffer[emitter.buffer_pos] = '\n'
+		emitter.buffer_pos += 1
+	case yaml_CRLN_BREAK:
+		emitter.buffer[emitter.buffer_pos+0] = '\r'
+		emitter.buffer[emitter.buffer_pos+1] = '\n'
+		emitter.buffer_pos += 2
+	default:
+		panic("unknown line break setting")
+	}
+	emitter.column = 0
+	emitter.line++
+	return true
+}
+
+// Copy a character from a string into buffer.
+func write(emitter *yaml_emitter_t, s []byte, i *int) bool {
+	if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {
+		return false
+	}
+	p := emitter.buffer_pos
+	w := width(s[*i])
+	switch w {
+	case 4:
+		emitter.buffer[p+3] = s[*i+3]
+		fallthrough
+	case 3:
+		emitter.buffer[p+2] = s[*i+2]
+		fallthrough
+	case 2:
+		emitter.buffer[p+1] = s[*i+1]
+		fallthrough
+	case 1:
+		emitter.buffer[p+0] = s[*i+0]
+	default:
+		panic("unknown character width")
+	}
+	emitter.column++
+	emitter.buffer_pos += w
+	*i += w
+	return true
+}
+
+// Write a whole string into buffer.
+func write_all(emitter *yaml_emitter_t, s []byte) bool {
+	for i := 0; i < len(s); {
+		if !write(emitter, s, &i) {
+			return false
+		}
+	}
+	return true
+}
+
+// Copy a line break character from a string into buffer.
+func write_break(emitter *yaml_emitter_t, s []byte, i *int) bool {
+	if s[*i] == '\n' {
+		if !put_break(emitter) {
+			return false
+		}
+		*i++
+	} else {
+		if !write(emitter, s, i) {
+			return false
+		}
+		emitter.column = 0
+		emitter.line++
+	}
+	return true
+}
+
+// Set an emitter error and return false.
+func yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem string) bool {
+	emitter.error = yaml_EMITTER_ERROR
+	emitter.problem = problem
+	return false
+}
+
+// Emit an event.
+func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+	emitter.events = append(emitter.events, *event)
+	for !yaml_emitter_need_more_events(emitter) {
+		event := &emitter.events[emitter.events_head]
+		if !yaml_emitter_analyze_event(emitter, event) {
+			return false
+		}
+		if !yaml_emitter_state_machine(emitter, event) {
+			return false
+		}
+		yaml_event_delete(event)
+		emitter.events_head++
+	}
+	return true
+}
+
+// Check if we need to accumulate more events before emitting.
+//
+// We accumulate extra
+//  - 1 event for DOCUMENT-START
+//  - 2 events for SEQUENCE-START
+//  - 3 events for MAPPING-START
+//
+func yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool {
+	if emitter.events_head == len(emitter.events) {
+		return true
+	}
+	var accumulate int
+	switch emitter.events[emitter.events_head].typ {
+	case yaml_DOCUMENT_START_EVENT:
+		accumulate = 1
+		break
+	case yaml_SEQUENCE_START_EVENT:
+		accumulate = 2
+		break
+	case yaml_MAPPING_START_EVENT:
+		accumulate = 3
+		break
+	default:
+		return false
+	}
+	if len(emitter.events)-emitter.events_head > accumulate {
+		return false
+	}
+	var level int
+	for i := emitter.events_head; i < len(emitter.events); i++ {
+		switch emitter.events[i].typ {
+		case yaml_STREAM_START_EVENT, yaml_DOCUMENT_START_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT:
+			level++
+		case yaml_STREAM_END_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_END_EVENT, yaml_MAPPING_END_EVENT:
+			level--
+		}
+		if level == 0 {
+			return false
+		}
+	}
+	return true
+}
+
+// Append a directive to the directives stack.
+func yaml_emitter_append_tag_directive(emitter *yaml_emitter_t, value *yaml_tag_directive_t, allow_duplicates bool) bool {
+	for i := 0; i < len(emitter.tag_directives); i++ {
+		if bytes.Equal(value.handle, emitter.tag_directives[i].handle) {
+			if allow_duplicates {
+				return true
+			}
+			return yaml_emitter_set_emitter_error(emitter, "duplicate %TAG directive")
+		}
+	}
+
+	// [Go] Do we actually need to copy this given garbage collection
+	// and the lack of deallocating destructors?
+	tag_copy := yaml_tag_directive_t{
+		handle: make([]byte, len(value.handle)),
+		prefix: make([]byte, len(value.prefix)),
+	}
+	copy(tag_copy.handle, value.handle)
+	copy(tag_copy.prefix, value.prefix)
+	emitter.tag_directives = append(emitter.tag_directives, tag_copy)
+	return true
+}
+
+// Increase the indentation level.
+func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool) bool {
+	emitter.indents = append(emitter.indents, emitter.indent)
+	if emitter.indent < 0 {
+		if flow {
+			emitter.indent = emitter.best_indent
+		} else {
+			emitter.indent = 0
+		}
+	} else if !indentless {
+		emitter.indent += emitter.best_indent
+	}
+	return true
+}
+
+// State dispatcher.
+func yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+	switch emitter.state {
+	default:
+	case yaml_EMIT_STREAM_START_STATE:
+		return yaml_emitter_emit_stream_start(emitter, event)
+
+	case yaml_EMIT_FIRST_DOCUMENT_START_STATE:
+		return yaml_emitter_emit_document_start(emitter, event, true)
+
+	case yaml_EMIT_DOCUMENT_START_STATE:
+		return yaml_emitter_emit_document_start(emitter, event, false)
+
+	case yaml_EMIT_DOCUMENT_CONTENT_STATE:
+		return yaml_emitter_emit_document_content(emitter, event)
+
+	case yaml_EMIT_DOCUMENT_END_STATE:
+		return yaml_emitter_emit_document_end(emitter, event)
+
+	case yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE:
+		return yaml_emitter_emit_flow_sequence_item(emitter, event, true)
+
+	case yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE:
+		return yaml_emitter_emit_flow_sequence_item(emitter, event, false)
+
+	case yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE:
+		return yaml_emitter_emit_flow_mapping_key(emitter, event, true)
+
+	case yaml_EMIT_FLOW_MAPPING_KEY_STATE:
+		return yaml_emitter_emit_flow_mapping_key(emitter, event, false)
+
+	case yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE:
+		return yaml_emitter_emit_flow_mapping_value(emitter, event, true)
+
+	case yaml_EMIT_FLOW_MAPPING_VALUE_STATE:
+		return yaml_emitter_emit_flow_mapping_value(emitter, event, false)
+
+	case yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE:
+		return yaml_emitter_emit_block_sequence_item(emitter, event, true)
+
+	case yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE:
+		return yaml_emitter_emit_block_sequence_item(emitter, event, false)
+
+	case yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE:
+		return yaml_emitter_emit_block_mapping_key(emitter, event, true)
+
+	case yaml_EMIT_BLOCK_MAPPING_KEY_STATE:
+		return yaml_emitter_emit_block_mapping_key(emitter, event, false)
+
+	case yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE:
+		return yaml_emitter_emit_block_mapping_value(emitter, event, true)
+
+	case yaml_EMIT_BLOCK_MAPPING_VALUE_STATE:
+		return yaml_emitter_emit_block_mapping_value(emitter, event, false)
+
+	case yaml_EMIT_END_STATE:
+		return yaml_emitter_set_emitter_error(emitter, "expected nothing after STREAM-END")
+	}
+	panic("invalid emitter state")
+}
+
+// Expect STREAM-START.
+func yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+	if event.typ != yaml_STREAM_START_EVENT {
+		return yaml_emitter_set_emitter_error(emitter, "expected STREAM-START")
+	}
+	if emitter.encoding == yaml_ANY_ENCODING {
+		emitter.encoding = event.encoding
+		if emitter.encoding == yaml_ANY_ENCODING {
+			emitter.encoding = yaml_UTF8_ENCODING
+		}
+	}
+	if emitter.best_indent < 2 || emitter.best_indent > 9 {
+		emitter.best_indent = 2
+	}
+	if emitter.best_width >= 0 && emitter.best_width <= emitter.best_indent*2 {
+		emitter.best_width = 80
+	}
+	if emitter.best_width < 0 {
+		emitter.best_width = 1<<31 - 1
+	}
+	if emitter.line_break == yaml_ANY_BREAK {
+		emitter.line_break = yaml_LN_BREAK
+	}
+
+	emitter.indent = -1
+	emitter.line = 0
+	emitter.column = 0
+	emitter.whitespace = true
+	emitter.indention = true
+
+	if emitter.encoding != yaml_UTF8_ENCODING {
+		if !yaml_emitter_write_bom(emitter) {
+			return false
+		}
+	}
+	emitter.state = yaml_EMIT_FIRST_DOCUMENT_START_STATE
+	return true
+}
+
+// Expect DOCUMENT-START or STREAM-END.
+func yaml_emitter_emit_document_start(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
+
+	if event.typ == yaml_DOCUMENT_START_EVENT {
+
+		if event.version_directive != nil {
+			if !yaml_emitter_analyze_version_directive(emitter, event.version_directive) {
+				return false
+			}
+		}
+
+		for i := 0; i < len(event.tag_directives); i++ {
+			tag_directive := &event.tag_directives[i]
+			if !yaml_emitter_analyze_tag_directive(emitter, tag_directive) {
+				return false
+			}
+			if !yaml_emitter_append_tag_directive(emitter, tag_directive, false) {
+				return false
+			}
+		}
+
+		for i := 0; i < len(default_tag_directives); i++ {
+			tag_directive := &default_tag_directives[i]
+			if !yaml_emitter_append_tag_directive(emitter, tag_directive, true) {
+				return false
+			}
+		}
+
+		implicit := event.implicit
+		if !first || emitter.canonical {
+			implicit = false
+		}
+
+		if emitter.open_ended && (event.version_directive != nil || len(event.tag_directives) > 0) {
+			if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) {
+				return false
+			}
+			if !yaml_emitter_write_indent(emitter) {
+				return false
+			}
+		}
+
+		if event.version_directive != nil {
+			implicit = false
+			if !yaml_emitter_write_indicator(emitter, []byte("%YAML"), true, false, false) {
+				return false
+			}
+			if !yaml_emitter_write_indicator(emitter, []byte("1.1"), true, false, false) {
+				return false
+			}
+			if !yaml_emitter_write_indent(emitter) {
+				return false
+			}
+		}
+
+		if len(event.tag_directives) > 0 {
+			implicit = false
+			for i := 0; i < len(event.tag_directives); i++ {
+				tag_directive := &event.tag_directives[i]
+				if !yaml_emitter_write_indicator(emitter, []byte("%TAG"), true, false, false) {
+					return false
+				}
+				if !yaml_emitter_write_tag_handle(emitter, tag_directive.handle) {
+					return false
+				}
+				if !yaml_emitter_write_tag_content(emitter, tag_directive.prefix, true) {
+					return false
+				}
+				if !yaml_emitter_write_indent(emitter) {
+					return false
+				}
+			}
+		}
+
+		if yaml_emitter_check_empty_document(emitter) {
+			implicit = false
+		}
+		if !implicit {
+			if !yaml_emitter_write_indent(emitter) {
+				return false
+			}
+			if !yaml_emitter_write_indicator(emitter, []byte("---"), true, false, false) {
+				return false
+			}
+			if emitter.canonical {
+				if !yaml_emitter_write_indent(emitter) {
+					return false
+				}
+			}
+		}
+
+		emitter.state = yaml_EMIT_DOCUMENT_CONTENT_STATE
+		return true
+	}
+
+	if event.typ == yaml_STREAM_END_EVENT {
+		if emitter.open_ended {
+			if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) {
+				return false
+			}
+			if !yaml_emitter_write_indent(emitter) {
+				return false
+			}
+		}
+		if !yaml_emitter_flush(emitter) {
+			return false
+		}
+		emitter.state = yaml_EMIT_END_STATE
+		return true
+	}
+
+	return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-START or STREAM-END")
+}
+
+// Expect the root node.
+func yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+	emitter.states = append(emitter.states, yaml_EMIT_DOCUMENT_END_STATE)
+	return yaml_emitter_emit_node(emitter, event, true, false, false, false)
+}
+
+// Expect DOCUMENT-END.
+func yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+	if event.typ != yaml_DOCUMENT_END_EVENT {
+		return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-END")
+	}
+	if !yaml_emitter_write_indent(emitter) {
+		return false
+	}
+	if !event.implicit {
+		// [Go] Allocate the slice elsewhere.
+		if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) {
+			return false
+		}
+		if !yaml_emitter_write_indent(emitter) {
+			return false
+		}
+	}
+	if !yaml_emitter_flush(emitter) {
+		return false
+	}
+	emitter.state = yaml_EMIT_DOCUMENT_START_STATE
+	emitter.tag_directives = emitter.tag_directives[:0]
+	return true
+}
+
+// Expect a flow item node.
+func yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
+	if first {
+		if !yaml_emitter_write_indicator(emitter, []byte{'['}, true, true, false) {
+			return false
+		}
+		if !yaml_emitter_increase_indent(emitter, true, false) {
+			return false
+		}
+		emitter.flow_level++
+	}
+
+	if event.typ == yaml_SEQUENCE_END_EVENT {
+		emitter.flow_level--
+		emitter.indent = emitter.indents[len(emitter.indents)-1]
+		emitter.indents = emitter.indents[:len(emitter.indents)-1]
+		if emitter.canonical && !first {
+			if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {
+				return false
+			}
+			if !yaml_emitter_write_indent(emitter) {
+				return false
+			}
+		}
+		if !yaml_emitter_write_indicator(emitter, []byte{']'}, false, false, false) {
+			return false
+		}
+		emitter.state = emitter.states[len(emitter.states)-1]
+		emitter.states = emitter.states[:len(emitter.states)-1]
+
+		return true
+	}
+
+	if !first {
+		if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {
+			return false
+		}
+	}
+
+	if emitter.canonical || emitter.column > emitter.best_width {
+		if !yaml_emitter_write_indent(emitter) {
+			return false
+		}
+	}
+	emitter.states = append(emitter.states, yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE)
+	return yaml_emitter_emit_node(emitter, event, false, true, false, false)
+}
+
+// Expect a flow key node.
+func yaml_emitter_emit_flow_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
+	if first {
+		if !yaml_emitter_write_indicator(emitter, []byte{'{'}, true, true, false) {
+			return false
+		}
+		if !yaml_emitter_increase_indent(emitter, true, false) {
+			return false
+		}
+		emitter.flow_level++
+	}
+
+	if event.typ == yaml_MAPPING_END_EVENT {
+		emitter.flow_level--
+		emitter.indent = emitter.indents[len(emitter.indents)-1]
+		emitter.indents = emitter.indents[:len(emitter.indents)-1]
+		if emitter.canonical && !first {
+			if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {
+				return false
+			}
+			if !yaml_emitter_write_indent(emitter) {
+				return false
+			}
+		}
+		if !yaml_emitter_write_indicator(emitter, []byte{'}'}, false, false, false) {
+			return false
+		}
+		emitter.state = emitter.states[len(emitter.states)-1]
+		emitter.states = emitter.states[:len(emitter.states)-1]
+		return true
+	}
+
+	if !first {
+		if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {
+			return false
+		}
+	}
+	if emitter.canonical || emitter.column > emitter.best_width {
+		if !yaml_emitter_write_indent(emitter) {
+			return false
+		}
+	}
+
+	if !emitter.canonical && yaml_emitter_check_simple_key(emitter) {
+		emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE)
+		return yaml_emitter_emit_node(emitter, event, false, false, true, true)
+	}
+	if !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, false) {
+		return false
+	}
+	emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_VALUE_STATE)
+	return yaml_emitter_emit_node(emitter, event, false, false, true, false)
+}
+
+// Expect a flow value node.
+func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool {
+	if simple {
+		if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) {
+			return false
+		}
+	} else {
+		if emitter.canonical || emitter.column > emitter.best_width {
+			if !yaml_emitter_write_indent(emitter) {
+				return false
+			}
+		}
+		if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, false) {
+			return false
+		}
+	}
+	emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_KEY_STATE)
+	return yaml_emitter_emit_node(emitter, event, false, false, true, false)
+}
+
+// Expect a block item node.
+func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
+	if first {
+		if !yaml_emitter_increase_indent(emitter, false, emitter.mapping_context && !emitter.indention) {
+			return false
+		}
+	}
+	if event.typ == yaml_SEQUENCE_END_EVENT {
+		emitter.indent = emitter.indents[len(emitter.indents)-1]
+		emitter.indents = emitter.indents[:len(emitter.indents)-1]
+		emitter.state = emitter.states[len(emitter.states)-1]
+		emitter.states = emitter.states[:len(emitter.states)-1]
+		return true
+	}
+	if !yaml_emitter_write_indent(emitter) {
+		return false
+	}
+	if !yaml_emitter_write_indicator(emitter, []byte{'-'}, true, false, true) {
+		return false
+	}
+	emitter.states = append(emitter.states, yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE)
+	return yaml_emitter_emit_node(emitter, event, false, true, false, false)
+}
+
+// Expect a block key node.
+func yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
+	if first {
+		if !yaml_emitter_increase_indent(emitter, false, false) {
+			return false
+		}
+	}
+	if event.typ == yaml_MAPPING_END_EVENT {
+		emitter.indent = emitter.indents[len(emitter.indents)-1]
+		emitter.indents = emitter.indents[:len(emitter.indents)-1]
+		emitter.state = emitter.states[len(emitter.states)-1]
+		emitter.states = emitter.states[:len(emitter.states)-1]
+		return true
+	}
+	if !yaml_emitter_write_indent(emitter) {
+		return false
+	}
+	if yaml_emitter_check_simple_key(emitter) {
+		emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE)
+		return yaml_emitter_emit_node(emitter, event, false, false, true, true)
+	}
+	if !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, true) {
+		return false
+	}
+	emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_VALUE_STATE)
+	return yaml_emitter_emit_node(emitter, event, false, false, true, false)
+}
+
+// Expect a block value node.
+func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool {
+	if simple {
+		if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) {
+			return false
+		}
+	} else {
+		if !yaml_emitter_write_indent(emitter) {
+			return false
+		}
+		if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, true) {
+			return false
+		}
+	}
+	emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE)
+	return yaml_emitter_emit_node(emitter, event, false, false, true, false)
+}
+
+// Expect a node.
+func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t,
+	root bool, sequence bool, mapping bool, simple_key bool) bool {
+
+	emitter.root_context = root
+	emitter.sequence_context = sequence
+	emitter.mapping_context = mapping
+	emitter.simple_key_context = simple_key
+
+	switch event.typ {
+	case yaml_ALIAS_EVENT:
+		return yaml_emitter_emit_alias(emitter, event)
+	case yaml_SCALAR_EVENT:
+		return yaml_emitter_emit_scalar(emitter, event)
+	case yaml_SEQUENCE_START_EVENT:
+		return yaml_emitter_emit_sequence_start(emitter, event)
+	case yaml_MAPPING_START_EVENT:
+		return yaml_emitter_emit_mapping_start(emitter, event)
+	default:
+		return yaml_emitter_set_emitter_error(emitter,
+			"expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS")
+	}
+	return false
+}
+
+// Expect ALIAS.
+func yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+	if !yaml_emitter_process_anchor(emitter) {
+		return false
+	}
+	emitter.state = emitter.states[len(emitter.states)-1]
+	emitter.states = emitter.states[:len(emitter.states)-1]
+	return true
+}
+
+// Expect SCALAR.
+func yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+	if !yaml_emitter_select_scalar_style(emitter, event) {
+		return false
+	}
+	if !yaml_emitter_process_anchor(emitter) {
+		return false
+	}
+	if !yaml_emitter_process_tag(emitter) {
+		return false
+	}
+	if !yaml_emitter_increase_indent(emitter, true, false) {
+		return false
+	}
+	if !yaml_emitter_process_scalar(emitter) {
+		return false
+	}
+	emitter.indent = emitter.indents[len(emitter.indents)-1]
+	emitter.indents = emitter.indents[:len(emitter.indents)-1]
+	emitter.state = emitter.states[len(emitter.states)-1]
+	emitter.states = emitter.states[:len(emitter.states)-1]
+	return true
+}
+
+// Expect SEQUENCE-START.
+func yaml_emitter_emit_sequence_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+	if !yaml_emitter_process_anchor(emitter) {
+		return false
+	}
+	if !yaml_emitter_process_tag(emitter) {
+		return false
+	}
+	if emitter.flow_level > 0 || emitter.canonical || event.sequence_style() == yaml_FLOW_SEQUENCE_STYLE ||
+		yaml_emitter_check_empty_sequence(emitter) {
+		emitter.state = yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE
+	} else {
+		emitter.state = yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE
+	}
+	return true
+}
+
+// Expect MAPPING-START.
+func yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+	if !yaml_emitter_process_anchor(emitter) {
+		return false
+	}
+	if !yaml_emitter_process_tag(emitter) {
+		return false
+	}
+	if emitter.flow_level > 0 || emitter.canonical || event.mapping_style() == yaml_FLOW_MAPPING_STYLE ||
+		yaml_emitter_check_empty_mapping(emitter) {
+		emitter.state = yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE
+	} else {
+		emitter.state = yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE
+	}
+	return true
+}
+
+// Check if the document content is an empty scalar.
+func yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool {
+	return false // [Go] Huh?
+}
+
+// Check if the next events represent an empty sequence.
+func yaml_emitter_check_empty_sequence(emitter *yaml_emitter_t) bool {
+	if len(emitter.events)-emitter.events_head < 2 {
+		return false
+	}
+	return emitter.events[emitter.events_head].typ == yaml_SEQUENCE_START_EVENT &&
+		emitter.events[emitter.events_head+1].typ == yaml_SEQUENCE_END_EVENT
+}
+
+// Check if the next events represent an empty mapping.
+func yaml_emitter_check_empty_mapping(emitter *yaml_emitter_t) bool {
+	if len(emitter.events)-emitter.events_head < 2 {
+		return false
+	}
+	return emitter.events[emitter.events_head].typ == yaml_MAPPING_START_EVENT &&
+		emitter.events[emitter.events_head+1].typ == yaml_MAPPING_END_EVENT
+}
+
+// Check if the next node can be expressed as a simple key.
+func yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool {
+	length := 0
+	switch emitter.events[emitter.events_head].typ {
+	case yaml_ALIAS_EVENT:
+		length += len(emitter.anchor_data.anchor)
+	case yaml_SCALAR_EVENT:
+		if emitter.scalar_data.multiline {
+			return false
+		}
+		length += len(emitter.anchor_data.anchor) +
+			len(emitter.tag_data.handle) +
+			len(emitter.tag_data.suffix) +
+			len(emitter.scalar_data.value)
+	case yaml_SEQUENCE_START_EVENT:
+		if !yaml_emitter_check_empty_sequence(emitter) {
+			return false
+		}
+		length += len(emitter.anchor_data.anchor) +
+			len(emitter.tag_data.handle) +
+			len(emitter.tag_data.suffix)
+	case yaml_MAPPING_START_EVENT:
+		if !yaml_emitter_check_empty_mapping(emitter) {
+			return false
+		}
+		length += len(emitter.anchor_data.anchor) +
+			len(emitter.tag_data.handle) +
+			len(emitter.tag_data.suffix)
+	default:
+		return false
+	}
+	return length <= 128
+}
+
+// Determine an acceptable scalar style.
+func yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+
+	no_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0
+	if no_tag && !event.implicit && !event.quoted_implicit {
+		return yaml_emitter_set_emitter_error(emitter, "neither tag nor implicit flags are specified")
+	}
+
+	style := event.scalar_style()
+	if style == yaml_ANY_SCALAR_STYLE {
+		style = yaml_PLAIN_SCALAR_STYLE
+	}
+	if emitter.canonical {
+		style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
+	}
+	if emitter.simple_key_context && emitter.scalar_data.multiline {
+		style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
+	}
+
+	if style == yaml_PLAIN_SCALAR_STYLE {
+		if emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed ||
+			emitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed {
+			style = yaml_SINGLE_QUOTED_SCALAR_STYLE
+		}
+		if len(emitter.scalar_data.value) == 0 && (emitter.flow_level > 0 || emitter.simple_key_context) {
+			style = yaml_SINGLE_QUOTED_SCALAR_STYLE
+		}
+		if no_tag && !event.implicit {
+			style = yaml_SINGLE_QUOTED_SCALAR_STYLE
+		}
+	}
+	if style == yaml_SINGLE_QUOTED_SCALAR_STYLE {
+		if !emitter.scalar_data.single_quoted_allowed {
+			style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
+		}
+	}
+	if style == yaml_LITERAL_SCALAR_STYLE || style == yaml_FOLDED_SCALAR_STYLE {
+		if !emitter.scalar_data.block_allowed || emitter.flow_level > 0 || emitter.simple_key_context {
+			style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
+		}
+	}
+
+	if no_tag && !event.quoted_implicit && style != yaml_PLAIN_SCALAR_STYLE {
+		emitter.tag_data.handle = []byte{'!'}
+	}
+	emitter.scalar_data.style = style
+	return true
+}
+
+// Write an achor.
+func yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool {
+	if emitter.anchor_data.anchor == nil {
+		return true
+	}
+	c := []byte{'&'}
+	if emitter.anchor_data.alias {
+		c[0] = '*'
+	}
+	if !yaml_emitter_write_indicator(emitter, c, true, false, false) {
+		return false
+	}
+	return yaml_emitter_write_anchor(emitter, emitter.anchor_data.anchor)
+}
+
+// Write a tag.
+func yaml_emitter_process_tag(emitter *yaml_emitter_t) bool {
+	if len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 {
+		return true
+	}
+	if len(emitter.tag_data.handle) > 0 {
+		if !yaml_emitter_write_tag_handle(emitter, emitter.tag_data.handle) {
+			return false
+		}
+		if len(emitter.tag_data.suffix) > 0 {
+			if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) {
+				return false
+			}
+		}
+	} else {
+		// [Go] Allocate these slices elsewhere.
+		if !yaml_emitter_write_indicator(emitter, []byte("!<"), true, false, false) {
+			return false
+		}
+		if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) {
+			return false
+		}
+		if !yaml_emitter_write_indicator(emitter, []byte{'>'}, false, false, false) {
+			return false
+		}
+	}
+	return true
+}
+
+// Write a scalar.
+func yaml_emitter_process_scalar(emitter *yaml_emitter_t) bool {
+	switch emitter.scalar_data.style {
+	case yaml_PLAIN_SCALAR_STYLE:
+		return yaml_emitter_write_plain_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)
+
+	case yaml_SINGLE_QUOTED_SCALAR_STYLE:
+		return yaml_emitter_write_single_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)
+
+	case yaml_DOUBLE_QUOTED_SCALAR_STYLE:
+		return yaml_emitter_write_double_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)
+
+	case yaml_LITERAL_SCALAR_STYLE:
+		return yaml_emitter_write_literal_scalar(emitter, emitter.scalar_data.value)
+
+	case yaml_FOLDED_SCALAR_STYLE:
+		return yaml_emitter_write_folded_scalar(emitter, emitter.scalar_data.value)
+	}
+	panic("unknown scalar style")
+}
+
+// Check if a %YAML directive is valid.
+func yaml_emitter_analyze_version_directive(emitter *yaml_emitter_t, version_directive *yaml_version_directive_t) bool {
+	if version_directive.major != 1 || version_directive.minor != 1 {
+		return yaml_emitter_set_emitter_error(emitter, "incompatible %YAML directive")
+	}
+	return true
+}
+
+// Check if a %TAG directive is valid.
+func yaml_emitter_analyze_tag_directive(emitter *yaml_emitter_t, tag_directive *yaml_tag_directive_t) bool {
+	handle := tag_directive.handle
+	prefix := tag_directive.prefix
+	if len(handle) == 0 {
+		return yaml_emitter_set_emitter_error(emitter, "tag handle must not be empty")
+	}
+	if handle[0] != '!' {
+		return yaml_emitter_set_emitter_error(emitter, "tag handle must start with '!'")
+	}
+	if handle[len(handle)-1] != '!' {
+		return yaml_emitter_set_emitter_error(emitter, "tag handle must end with '!'")
+	}
+	for i := 1; i < len(handle)-1; i += width(handle[i]) {
+		if !is_alpha(handle, i) {
+			return yaml_emitter_set_emitter_error(emitter, "tag handle must contain alphanumerical characters only")
+		}
+	}
+	if len(prefix) == 0 {
+		return yaml_emitter_set_emitter_error(emitter, "tag prefix must not be empty")
+	}
+	return true
+}
+
+// Check if an anchor is valid.
+func yaml_emitter_analyze_anchor(emitter *yaml_emitter_t, anchor []byte, alias bool) bool {
+	if len(anchor) == 0 {
+		problem := "anchor value must not be empty"
+		if alias {
+			problem = "alias value must not be empty"
+		}
+		return yaml_emitter_set_emitter_error(emitter, problem)
+	}
+	for i := 0; i < len(anchor); i += width(anchor[i]) {
+		if !is_alpha(anchor, i) {
+			problem := "anchor value must contain alphanumerical characters only"
+			if alias {
+				problem = "alias value must contain alphanumerical characters only"
+			}
+			return yaml_emitter_set_emitter_error(emitter, problem)
+		}
+	}
+	emitter.anchor_data.anchor = anchor
+	emitter.anchor_data.alias = alias
+	return true
+}
+
+// Check if a tag is valid.
+func yaml_emitter_analyze_tag(emitter *yaml_emitter_t, tag []byte) bool {
+	if len(tag) == 0 {
+		return yaml_emitter_set_emitter_error(emitter, "tag value must not be empty")
+	}
+	for i := 0; i < len(emitter.tag_directives); i++ {
+		tag_directive := &emitter.tag_directives[i]
+		if bytes.HasPrefix(tag, tag_directive.prefix) {
+			emitter.tag_data.handle = tag_directive.handle
+			emitter.tag_data.suffix = tag[len(tag_directive.prefix):]
+			return true
+		}
+	}
+	emitter.tag_data.suffix = tag
+	return true
+}
+
+// Check if a scalar is valid.
+func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool {
+	var (
+		block_indicators   = false
+		flow_indicators    = false
+		line_breaks        = false
+		special_characters = false
+
+		leading_space  = false
+		leading_break  = false
+		trailing_space = false
+		trailing_break = false
+		break_space    = false
+		space_break    = false
+
+		preceeded_by_whitespace = false
+		followed_by_whitespace  = false
+		previous_space          = false
+		previous_break          = false
+	)
+
+	emitter.scalar_data.value = value
+
+	if len(value) == 0 {
+		emitter.scalar_data.multiline = false
+		emitter.scalar_data.flow_plain_allowed = false
+		emitter.scalar_data.block_plain_allowed = true
+		emitter.scalar_data.single_quoted_allowed = true
+		emitter.scalar_data.block_allowed = false
+		return true
+	}
+
+	if len(value) >= 3 && ((value[0] == '-' && value[1] == '-' && value[2] == '-') || (value[0] == '.' && value[1] == '.' && value[2] == '.')) {
+		block_indicators = true
+		flow_indicators = true
+	}
+
+	preceeded_by_whitespace = true
+	for i, w := 0, 0; i < len(value); i += w {
+		w = width(value[i])
+		followed_by_whitespace = i+w >= len(value) || is_blank(value, i+w)
+
+		if i == 0 {
+			switch value[i] {
+			case '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\'', '"', '%', '@', '`':
+				flow_indicators = true
+				block_indicators = true
+			case '?', ':':
+				flow_indicators = true
+				if followed_by_whitespace {
+					block_indicators = true
+				}
+			case '-':
+				if followed_by_whitespace {
+					flow_indicators = true
+					block_indicators = true
+				}
+			}
+		} else {
+			switch value[i] {
+			case ',', '?', '[', ']', '{', '}':
+				flow_indicators = true
+			case ':':
+				flow_indicators = true
+				if followed_by_whitespace {
+					block_indicators = true
+				}
+			case '#':
+				if preceeded_by_whitespace {
+					flow_indicators = true
+					block_indicators = true
+				}
+			}
+		}
+
+		if !is_printable(value, i) || !is_ascii(value, i) && !emitter.unicode {
+			special_characters = true
+		}
+		if is_space(value, i) {
+			if i == 0 {
+				leading_space = true
+			}
+			if i+width(value[i]) == len(value) {
+				trailing_space = true
+			}
+			if previous_break {
+				break_space = true
+			}
+			previous_space = true
+			previous_break = false
+		} else if is_break(value, i) {
+			line_breaks = true
+			if i == 0 {
+				leading_break = true
+			}
+			if i+width(value[i]) == len(value) {
+				trailing_break = true
+			}
+			if previous_space {
+				space_break = true
+			}
+			previous_space = false
+			previous_break = true
+		} else {
+			previous_space = false
+			previous_break = false
+		}
+
+		// [Go]: Why 'z'? Couldn't be the end of the string as that's the loop condition.
+		preceeded_by_whitespace = is_blankz(value, i)
+	}
+
+	emitter.scalar_data.multiline = line_breaks
+	emitter.scalar_data.flow_plain_allowed = true
+	emitter.scalar_data.block_plain_allowed = true
+	emitter.scalar_data.single_quoted_allowed = true
+	emitter.scalar_data.block_allowed = true
+
+	if leading_space || leading_break || trailing_space || trailing_break {
+		emitter.scalar_data.flow_plain_allowed = false
+		emitter.scalar_data.block_plain_allowed = false
+	}
+	if trailing_space {
+		emitter.scalar_data.block_allowed = false
+	}
+	if break_space {
+		emitter.scalar_data.flow_plain_allowed = false
+		emitter.scalar_data.block_plain_allowed = false
+		emitter.scalar_data.single_quoted_allowed = false
+	}
+	if space_break || special_characters {
+		emitter.scalar_data.flow_plain_allowed = false
+		emitter.scalar_data.block_plain_allowed = false
+		emitter.scalar_data.single_quoted_allowed = false
+		emitter.scalar_data.block_allowed = false
+	}
+	if line_breaks {
+		emitter.scalar_data.flow_plain_allowed = false
+		emitter.scalar_data.block_plain_allowed = false
+	}
+	if flow_indicators {
+		emitter.scalar_data.flow_plain_allowed = false
+	}
+	if block_indicators {
+		emitter.scalar_data.block_plain_allowed = false
+	}
+	return true
+}
+
+// Check if the event data is valid.
+func yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_event_t) bool {
+
+	emitter.anchor_data.anchor = nil
+	emitter.tag_data.handle = nil
+	emitter.tag_data.suffix = nil
+	emitter.scalar_data.value = nil
+
+	switch event.typ {
+	case yaml_ALIAS_EVENT:
+		if !yaml_emitter_analyze_anchor(emitter, event.anchor, true) {
+			return false
+		}
+
+	case yaml_SCALAR_EVENT:
+		if len(event.anchor) > 0 {
+			if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {
+				return false
+			}
+		}
+		if len(event.tag) > 0 && (emitter.canonical || (!event.implicit && !event.quoted_implicit)) {
+			if !yaml_emitter_analyze_tag(emitter, event.tag) {
+				return false
+			}
+		}
+		if !yaml_emitter_analyze_scalar(emitter, event.value) {
+			return false
+		}
+
+	case yaml_SEQUENCE_START_EVENT:
+		if len(event.anchor) > 0 {
+			if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {
+				return false
+			}
+		}
+		if len(event.tag) > 0 && (emitter.canonical || !event.implicit) {
+			if !yaml_emitter_analyze_tag(emitter, event.tag) {
+				return false
+			}
+		}
+
+	case yaml_MAPPING_START_EVENT:
+		if len(event.anchor) > 0 {
+			if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {
+				return false
+			}
+		}
+		if len(event.tag) > 0 && (emitter.canonical || !event.implicit) {
+			if !yaml_emitter_analyze_tag(emitter, event.tag) {
+				return false
+			}
+		}
+	}
+	return true
+}
+
+// Write the BOM character.
+func yaml_emitter_write_bom(emitter *yaml_emitter_t) bool {
+	if !flush(emitter) {
+		return false
+	}
+	pos := emitter.buffer_pos
+	emitter.buffer[pos+0] = '\xEF'
+	emitter.buffer[pos+1] = '\xBB'
+	emitter.buffer[pos+2] = '\xBF'
+	emitter.buffer_pos += 3
+	return true
+}
+
+func yaml_emitter_write_indent(emitter *yaml_emitter_t) bool {
+	indent := emitter.indent
+	if indent < 0 {
+		indent = 0
+	}
+	if !emitter.indention || emitter.column > indent || (emitter.column == indent && !emitter.whitespace) {
+		if !put_break(emitter) {
+			return false
+		}
+	}
+	for emitter.column < indent {
+		if !put(emitter, ' ') {
+			return false
+		}
+	}
+	emitter.whitespace = true
+	emitter.indention = true
+	return true
+}
+
+func yaml_emitter_write_indicator(emitter *yaml_emitter_t, indicator []byte, need_whitespace, is_whitespace, is_indention bool) bool {
+	if need_whitespace && !emitter.whitespace {
+		if !put(emitter, ' ') {
+			return false
+		}
+	}
+	if !write_all(emitter, indicator) {
+		return false
+	}
+	emitter.whitespace = is_whitespace
+	emitter.indention = (emitter.indention && is_indention)
+	emitter.open_ended = false
+	return true
+}
+
+func yaml_emitter_write_anchor(emitter *yaml_emitter_t, value []byte) bool {
+	if !write_all(emitter, value) {
+		return false
+	}
+	emitter.whitespace = false
+	emitter.indention = false
+	return true
+}
+
+func yaml_emitter_write_tag_handle(emitter *yaml_emitter_t, value []byte) bool {
+	if !emitter.whitespace {
+		if !put(emitter, ' ') {
+			return false
+		}
+	}
+	if !write_all(emitter, value) {
+		return false
+	}
+	emitter.whitespace = false
+	emitter.indention = false
+	return true
+}
+
+func yaml_emitter_write_tag_content(emitter *yaml_emitter_t, value []byte, need_whitespace bool) bool {
+	if need_whitespace && !emitter.whitespace {
+		if !put(emitter, ' ') {
+			return false
+		}
+	}
+	for i := 0; i < len(value); {
+		var must_write bool
+		switch value[i] {
+		case ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '_', '.', '~', '*', '\'', '(', ')', '[', ']':
+			must_write = true
+		default:
+			must_write = is_alpha(value, i)
+		}
+		if must_write {
+			if !write(emitter, value, &i) {
+				return false
+			}
+		} else {
+			w := width(value[i])
+			for k := 0; k < w; k++ {
+				octet := value[i]
+				i++
+				if !put(emitter, '%') {
+					return false
+				}
+
+				c := octet >> 4
+				if c < 10 {
+					c += '0'
+				} else {
+					c += 'A' - 10
+				}
+				if !put(emitter, c) {
+					return false
+				}
+
+				c = octet & 0x0f
+				if c < 10 {
+					c += '0'
+				} else {
+					c += 'A' - 10
+				}
+				if !put(emitter, c) {
+					return false
+				}
+			}
+		}
+	}
+	emitter.whitespace = false
+	emitter.indention = false
+	return true
+}
+
+func yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {
+	if !emitter.whitespace {
+		if !put(emitter, ' ') {
+			return false
+		}
+	}
+
+	spaces := false
+	breaks := false
+	for i := 0; i < len(value); {
+		if is_space(value, i) {
+			if allow_breaks && !spaces && emitter.column > emitter.best_width && !is_space(value, i+1) {
+				if !yaml_emitter_write_indent(emitter) {
+					return false
+				}
+				i += width(value[i])
+			} else {
+				if !write(emitter, value, &i) {
+					return false
+				}
+			}
+			spaces = true
+		} else if is_break(value, i) {
+			if !breaks && value[i] == '\n' {
+				if !put_break(emitter) {
+					return false
+				}
+			}
+			if !write_break(emitter, value, &i) {
+				return false
+			}
+			emitter.indention = true
+			breaks = true
+		} else {
+			if breaks {
+				if !yaml_emitter_write_indent(emitter) {
+					return false
+				}
+			}
+			if !write(emitter, value, &i) {
+				return false
+			}
+			emitter.indention = false
+			spaces = false
+			breaks = false
+		}
+	}
+
+	emitter.whitespace = false
+	emitter.indention = false
+	if emitter.root_context {
+		emitter.open_ended = true
+	}
+
+	return true
+}
+
+func yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {
+
+	if !yaml_emitter_write_indicator(emitter, []byte{'\''}, true, false, false) {
+		return false
+	}
+
+	spaces := false
+	breaks := false
+	for i := 0; i < len(value); {
+		if is_space(value, i) {
+			if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 && !is_space(value, i+1) {
+				if !yaml_emitter_write_indent(emitter) {
+					return false
+				}
+				i += width(value[i])
+			} else {
+				if !write(emitter, value, &i) {
+					return false
+				}
+			}
+			spaces = true
+		} else if is_break(value, i) {
+			if !breaks && value[i] == '\n' {
+				if !put_break(emitter) {
+					return false
+				}
+			}
+			if !write_break(emitter, value, &i) {
+				return false
+			}
+			emitter.indention = true
+			breaks = true
+		} else {
+			if breaks {
+				if !yaml_emitter_write_indent(emitter) {
+					return false
+				}
+			}
+			if value[i] == '\'' {
+				if !put(emitter, '\'') {
+					return false
+				}
+			}
+			if !write(emitter, value, &i) {
+				return false
+			}
+			emitter.indention = false
+			spaces = false
+			breaks = false
+		}
+	}
+	if !yaml_emitter_write_indicator(emitter, []byte{'\''}, false, false, false) {
+		return false
+	}
+	emitter.whitespace = false
+	emitter.indention = false
+	return true
+}
+
+func yaml_emitter_write_double_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {
+	spaces := false
+	if !yaml_emitter_write_indicator(emitter, []byte{'"'}, true, false, false) {
+		return false
+	}
+
+	for i := 0; i < len(value); {
+		if !is_printable(value, i) || (!emitter.unicode && !is_ascii(value, i)) ||
+			is_bom(value, i) || is_break(value, i) ||
+			value[i] == '"' || value[i] == '\\' {
+
+			octet := value[i]
+
+			var w int
+			var v rune
+			switch {
+			case octet&0x80 == 0x00:
+				w, v = 1, rune(octet&0x7F)
+			case octet&0xE0 == 0xC0:
+				w, v = 2, rune(octet&0x1F)
+			case octet&0xF0 == 0xE0:
+				w, v = 3, rune(octet&0x0F)
+			case octet&0xF8 == 0xF0:
+				w, v = 4, rune(octet&0x07)
+			}
+			for k := 1; k < w; k++ {
+				octet = value[i+k]
+				v = (v << 6) + (rune(octet) & 0x3F)
+			}
+			i += w
+
+			if !put(emitter, '\\') {
+				return false
+			}
+
+			var ok bool
+			switch v {
+			case 0x00:
+				ok = put(emitter, '0')
+			case 0x07:
+				ok = put(emitter, 'a')
+			case 0x08:
+				ok = put(emitter, 'b')
+			case 0x09:
+				ok = put(emitter, 't')
+			case 0x0A:
+				ok = put(emitter, 'n')
+			case 0x0b:
+				ok = put(emitter, 'v')
+			case 0x0c:
+				ok = put(emitter, 'f')
+			case 0x0d:
+				ok = put(emitter, 'r')
+			case 0x1b:
+				ok = put(emitter, 'e')
+			case 0x22:
+				ok = put(emitter, '"')
+			case 0x5c:
+				ok = put(emitter, '\\')
+			case 0x85:
+				ok = put(emitter, 'N')
+			case 0xA0:
+				ok = put(emitter, '_')
+			case 0x2028:
+				ok = put(emitter, 'L')
+			case 0x2029:
+				ok = put(emitter, 'P')
+			default:
+				if v <= 0xFF {
+					ok = put(emitter, 'x')
+					w = 2
+				} else if v <= 0xFFFF {
+					ok = put(emitter, 'u')
+					w = 4
+				} else {
+					ok = put(emitter, 'U')
+					w = 8
+				}
+				for k := (w - 1) * 4; ok && k >= 0; k -= 4 {
+					digit := byte((v >> uint(k)) & 0x0F)
+					if digit < 10 {
+						ok = put(emitter, digit+'0')
+					} else {
+						ok = put(emitter, digit+'A'-10)
+					}
+				}
+			}
+			if !ok {
+				return false
+			}
+			spaces = false
+		} else if is_space(value, i) {
+			if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 {
+				if !yaml_emitter_write_indent(emitter) {
+					return false
+				}
+				if is_space(value, i+1) {
+					if !put(emitter, '\\') {
+						return false
+					}
+				}
+				i += width(value[i])
+			} else if !write(emitter, value, &i) {
+				return false
+			}
+			spaces = true
+		} else {
+			if !write(emitter, value, &i) {
+				return false
+			}
+			spaces = false
+		}
+	}
+	if !yaml_emitter_write_indicator(emitter, []byte{'"'}, false, false, false) {
+		return false
+	}
+	emitter.whitespace = false
+	emitter.indention = false
+	return true
+}
+
+func yaml_emitter_write_block_scalar_hints(emitter *yaml_emitter_t, value []byte) bool {
+	if is_space(value, 0) || is_break(value, 0) {
+		indent_hint := []byte{'0' + byte(emitter.best_indent)}
+		if !yaml_emitter_write_indicator(emitter, indent_hint, false, false, false) {
+			return false
+		}
+	}
+
+	emitter.open_ended = false
+
+	var chomp_hint [1]byte
+	if len(value) == 0 {
+		chomp_hint[0] = '-'
+	} else {
+		i := len(value) - 1
+		for value[i]&0xC0 == 0x80 {
+			i--
+		}
+		if !is_break(value, i) {
+			chomp_hint[0] = '-'
+		} else if i == 0 {
+			chomp_hint[0] = '+'
+			emitter.open_ended = true
+		} else {
+			i--
+			for value[i]&0xC0 == 0x80 {
+				i--
+			}
+			if is_break(value, i) {
+				chomp_hint[0] = '+'
+				emitter.open_ended = true
+			}
+		}
+	}
+	if chomp_hint[0] != 0 {
+		if !yaml_emitter_write_indicator(emitter, chomp_hint[:], false, false, false) {
+			return false
+		}
+	}
+	return true
+}
+
+func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bool {
+	if !yaml_emitter_write_indicator(emitter, []byte{'|'}, true, false, false) {
+		return false
+	}
+	if !yaml_emitter_write_block_scalar_hints(emitter, value) {
+		return false
+	}
+	if !put_break(emitter) {
+		return false
+	}
+	emitter.indention = true
+	emitter.whitespace = true
+	breaks := true
+	for i := 0; i < len(value); {
+		if is_break(value, i) {
+			if !write_break(emitter, value, &i) {
+				return false
+			}
+			emitter.indention = true
+			breaks = true
+		} else {
+			if breaks {
+				if !yaml_emitter_write_indent(emitter) {
+					return false
+				}
+			}
+			if !write(emitter, value, &i) {
+				return false
+			}
+			emitter.indention = false
+			breaks = false
+		}
+	}
+
+	return true
+}
+
+func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) bool {
+	if !yaml_emitter_write_indicator(emitter, []byte{'>'}, true, false, false) {
+		return false
+	}
+	if !yaml_emitter_write_block_scalar_hints(emitter, value) {
+		return false
+	}
+
+	if !put_break(emitter) {
+		return false
+	}
+	emitter.indention = true
+	emitter.whitespace = true
+
+	breaks := true
+	leading_spaces := true
+	for i := 0; i < len(value); {
+		if is_break(value, i) {
+			if !breaks && !leading_spaces && value[i] == '\n' {
+				k := 0
+				for is_break(value, k) {
+					k += width(value[k])
+				}
+				if !is_blankz(value, k) {
+					if !put_break(emitter) {
+						return false
+					}
+				}
+			}
+			if !write_break(emitter, value, &i) {
+				return false
+			}
+			emitter.indention = true
+			breaks = true
+		} else {
+			if breaks {
+				if !yaml_emitter_write_indent(emitter) {
+					return false
+				}
+				leading_spaces = is_blank(value, i)
+			}
+			if !breaks && is_space(value, i) && !is_space(value, i+1) && emitter.column > emitter.best_width {
+				if !yaml_emitter_write_indent(emitter) {
+					return false
+				}
+				i += width(value[i])
+			} else {
+				if !write(emitter, value, &i) {
+					return false
+				}
+			}
+			emitter.indention = false
+			breaks = false
+		}
+	}
+	return true
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/encode.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/encode.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/encode.go
new file mode 100644
index 0000000..84f8499
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/encode.go
@@ -0,0 +1,306 @@
+package yaml
+
+import (
+	"encoding"
+	"fmt"
+	"reflect"
+	"regexp"
+	"sort"
+	"strconv"
+	"strings"
+	"time"
+)
+
+type encoder struct {
+	emitter yaml_emitter_t
+	event   yaml_event_t
+	out     []byte
+	flow    bool
+}
+
+func newEncoder() (e *encoder) {
+	e = &encoder{}
+	e.must(yaml_emitter_initialize(&e.emitter))
+	yaml_emitter_set_output_string(&e.emitter, &e.out)
+	yaml_emitter_set_unicode(&e.emitter, true)
+	e.must(yaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING))
+	e.emit()
+	e.must(yaml_document_start_event_initialize(&e.event, nil, nil, true))
+	e.emit()
+	return e
+}
+
+func (e *encoder) finish() {
+	e.must(yaml_document_end_event_initialize(&e.event, true))
+	e.emit()
+	e.emitter.open_ended = false
+	e.must(yaml_stream_end_event_initialize(&e.event))
+	e.emit()
+}
+
+func (e *encoder) destroy() {
+	yaml_emitter_delete(&e.emitter)
+}
+
+func (e *encoder) emit() {
+	// This will internally delete the e.event value.
+	if !yaml_emitter_emit(&e.emitter, &e.event) && e.event.typ != yaml_DOCUMENT_END_EVENT && e.event.typ != yaml_STREAM_END_EVENT {
+		e.must(false)
+	}
+}
+
+func (e *encoder) must(ok bool) {
+	if !ok {
+		msg := e.emitter.problem
+		if msg == "" {
+			msg = "unknown problem generating YAML content"
+		}
+		failf("%s", msg)
+	}
+}
+
+func (e *encoder) marshal(tag string, in reflect.Value) {
+	if !in.IsValid() {
+		e.nilv()
+		return
+	}
+	iface := in.Interface()
+	if m, ok := iface.(Marshaler); ok {
+		v, err := m.MarshalYAML()
+		if err != nil {
+			fail(err)
+		}
+		if v == nil {
+			e.nilv()
+			return
+		}
+		in = reflect.ValueOf(v)
+	} else if m, ok := iface.(encoding.TextMarshaler); ok {
+		text, err := m.MarshalText()
+		if err != nil {
+			fail(err)
+		}
+		in = reflect.ValueOf(string(text))
+	}
+	switch in.Kind() {
+	case reflect.Interface:
+		if in.IsNil() {
+			e.nilv()
+		} else {
+			e.marshal(tag, in.Elem())
+		}
+	case reflect.Map:
+		e.mapv(tag, in)
+	case reflect.Ptr:
+		if in.IsNil() {
+			e.nilv()
+		} else {
+			e.marshal(tag, in.Elem())
+		}
+	case reflect.Struct:
+		e.structv(tag, in)
+	case reflect.Slice:
+		if in.Type().Elem() == mapItemType {
+			e.itemsv(tag, in)
+		} else {
+			e.slicev(tag, in)
+		}
+	case reflect.String:
+		e.stringv(tag, in)
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		if in.Type() == durationType {
+			e.stringv(tag, reflect.ValueOf(iface.(time.Duration).String()))
+		} else {
+			e.intv(tag, in)
+		}
+	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+		e.uintv(tag, in)
+	case reflect.Float32, reflect.Float64:
+		e.floatv(tag, in)
+	case reflect.Bool:
+		e.boolv(tag, in)
+	default:
+		panic("cannot marshal type: " + in.Type().String())
+	}
+}
+
+func (e *encoder) mapv(tag string, in reflect.Value) {
+	e.mappingv(tag, func() {
+		keys := keyList(in.MapKeys())
+		sort.Sort(keys)
+		for _, k := range keys {
+			e.marshal("", k)
+			e.marshal("", in.MapIndex(k))
+		}
+	})
+}
+
+func (e *encoder) itemsv(tag string, in reflect.Value) {
+	e.mappingv(tag, func() {
+		slice := in.Convert(reflect.TypeOf([]MapItem{})).Interface().([]MapItem)
+		for _, item := range slice {
+			e.marshal("", reflect.ValueOf(item.Key))
+			e.marshal("", reflect.ValueOf(item.Value))
+		}
+	})
+}
+
+func (e *encoder) structv(tag string, in reflect.Value) {
+	sinfo, err := getStructInfo(in.Type())
+	if err != nil {
+		panic(err)
+	}
+	e.mappingv(tag, func() {
+		for _, info := range sinfo.FieldsList {
+			var value reflect.Value
+			if info.Inline == nil {
+				value = in.Field(info.Num)
+			} else {
+				value = in.FieldByIndex(info.Inline)
+			}
+			if info.OmitEmpty && isZero(value) {
+				continue
+			}
+			e.marshal("", reflect.ValueOf(info.Key))
+			e.flow = info.Flow
+			e.marshal("", value)
+		}
+		if sinfo.InlineMap >= 0 {
+			m := in.Field(sinfo.InlineMap)
+			if m.Len() > 0 {
+				e.flow = false
+				keys := keyList(m.MapKeys())
+				sort.Sort(keys)
+				for _, k := range keys {
+					if _, found := sinfo.FieldsMap[k.String()]; found {
+						panic(fmt.Sprintf("Can't have key %q in inlined map; conflicts with struct field", k.String()))
+					}
+					e.marshal("", k)
+					e.flow = false
+					e.marshal("", m.MapIndex(k))
+				}
+			}
+		}
+	})
+}
+
+func (e *encoder) mappingv(tag string, f func()) {
+	implicit := tag == ""
+	style := yaml_BLOCK_MAPPING_STYLE
+	if e.flow {
+		e.flow = false
+		style = yaml_FLOW_MAPPING_STYLE
+	}
+	e.must(yaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style))
+	e.emit()
+	f()
+	e.must(yaml_mapping_end_event_initialize(&e.event))
+	e.emit()
+}
+
+func (e *encoder) slicev(tag string, in reflect.Value) {
+	implicit := tag == ""
+	style := yaml_BLOCK_SEQUENCE_STYLE
+	if e.flow {
+		e.flow = false
+		style = yaml_FLOW_SEQUENCE_STYLE
+	}
+	e.must(yaml_sequence_start_event_initialize(&e.event, nil, []byte(tag), implicit, style))
+	e.emit()
+	n := in.Len()
+	for i := 0; i < n; i++ {
+		e.marshal("", in.Index(i))
+	}
+	e.must(yaml_sequence_end_event_initialize(&e.event))
+	e.emit()
+}
+
+// isBase60 returns whether s is in base 60 notation as defined in YAML 1.1.
+//
+// The base 60 float notation in YAML 1.1 is a terrible idea and is unsupported
+// in YAML 1.2 and by this package, but these should be marshalled quoted for
+// the time being for compatibility with other parsers.
+func isBase60Float(s string) (result bool) {
+	// Fast path.
+	if s == "" {
+		return false
+	}
+	c := s[0]
+	if !(c == '+' || c == '-' || c >= '0' && c <= '9') || strings.IndexByte(s, ':') < 0 {
+		return false
+	}
+	// Do the full match.
+	return base60float.MatchString(s)
+}
+
+// From http://yaml.org/type/float.html, except the regular expression there
+// is bogus. In practice parsers do not enforce the "\.[0-9_]*" suffix.
+var base60float = regexp.MustCompile(`^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\.[0-9_]*)?$`)
+
+func (e *encoder) stringv(tag string, in reflect.Value) {
+	var style yaml_scalar_style_t
+	s := in.String()
+	rtag, rs := resolve("", s)
+	if rtag == yaml_BINARY_TAG {
+		if tag == "" || tag == yaml_STR_TAG {
+			tag = rtag
+			s = rs.(string)
+		} else if tag == yaml_BINARY_TAG {
+			failf("explicitly tagged !!binary data must be base64-encoded")
+		} else {
+			failf("cannot marshal invalid UTF-8 data as %s", shortTag(tag))
+		}
+	}
+	if tag == "" && (rtag != yaml_STR_TAG || isBase60Float(s)) {
+		style = yaml_DOUBLE_QUOTED_SCALAR_STYLE
+	} else if strings.Contains(s, "\n") {
+		style = yaml_LITERAL_SCALAR_STYLE
+	} else {
+		style = yaml_PLAIN_SCALAR_STYLE
+	}
+	e.emitScalar(s, "", tag, style)
+}
+
+func (e *encoder) boolv(tag string, in reflect.Value) {
+	var s string
+	if in.Bool() {
+		s = "true"
+	} else {
+		s = "false"
+	}
+	e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE)
+}
+
+func (e *encoder) intv(tag string, in reflect.Value) {
+	s := strconv.FormatInt(in.Int(), 10)
+	e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE)
+}
+
+func (e *encoder) uintv(tag string, in reflect.Value) {
+	s := strconv.FormatUint(in.Uint(), 10)
+	e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE)
+}
+
+func (e *encoder) floatv(tag string, in reflect.Value) {
+	// FIXME: Handle 64 bits here.
+	s := strconv.FormatFloat(float64(in.Float()), 'g', -1, 32)
+	switch s {
+	case "+Inf":
+		s = ".inf"
+	case "-Inf":
+		s = "-.inf"
+	case "NaN":
+		s = ".nan"
+	}
+	e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE)
+}
+
+func (e *encoder) nilv() {
+	e.emitScalar("null", "", "", yaml_PLAIN_SCALAR_STYLE)
+}
+
+func (e *encoder) emitScalar(value, anchor, tag string, style yaml_scalar_style_t) {
+	implicit := tag == ""
+	e.must(yaml_scalar_event_initialize(&e.event, []byte(anchor), []byte(tag), []byte(value), implicit, implicit, style))
+	e.emit()
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/encode_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/encode_test.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/encode_test.go
new file mode 100644
index 0000000..1b35452
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/encode_test.go
@@ -0,0 +1,495 @@
+package yaml_test
+
+import (
+	"fmt"
+	"math"
+	"strconv"
+	"strings"
+	"time"
+
+	. "gopkg.in/check.v1"
+	"gopkg.in/yaml.v2"
+	"net"
+	"os"
+)
+
+var marshalIntTest = 123
+
+var marshalTests = []struct {
+	value interface{}
+	data  string
+}{
+	{
+		nil,
+		"null\n",
+	}, {
+		&struct{}{},
+		"{}\n",
+	}, {
+		map[string]string{"v": "hi"},
+		"v: hi\n",
+	}, {
+		map[string]interface{}{"v": "hi"},
+		"v: hi\n",
+	}, {
+		map[string]string{"v": "true"},
+		"v: \"true\"\n",
+	}, {
+		map[string]string{"v": "false"},
+		"v: \"false\"\n",
+	}, {
+		map[string]interface{}{"v": true},
+		"v: true\n",
+	}, {
+		map[string]interface{}{"v": false},
+		"v: false\n",
+	}, {
+		map[string]interface{}{"v": 10},
+		"v: 10\n",
+	}, {
+		map[string]interface{}{"v": -10},
+		"v: -10\n",
+	}, {
+		map[string]uint{"v": 42},
+		"v: 42\n",
+	}, {
+		map[string]interface{}{"v": int64(4294967296)},
+		"v: 4294967296\n",
+	}, {
+		map[string]int64{"v": int64(4294967296)},
+		"v: 4294967296\n",
+	}, {
+		map[string]uint64{"v": 4294967296},
+		"v: 4294967296\n",
+	}, {
+		map[string]interface{}{"v": "10"},
+		"v: \"10\"\n",
+	}, {
+		map[string]interface{}{"v": 0.1},
+		"v: 0.1\n",
+	}, {
+		map[string]interface{}{"v": float64(0.1)},
+		"v: 0.1\n",
+	}, {
+		map[string]interface{}{"v": -0.1},
+		"v: -0.1\n",
+	}, {
+		map[string]interface{}{"v": math.Inf(+1)},
+		"v: .inf\n",
+	}, {
+		map[string]interface{}{"v": math.Inf(-1)},
+		"v: -.inf\n",
+	}, {
+		map[string]interface{}{"v": math.NaN()},
+		"v: .nan\n",
+	}, {
+		map[string]interface{}{"v": nil},
+		"v: null\n",
+	}, {
+		map[string]interface{}{"v": ""},
+		"v: \"\"\n",
+	}, {
+		map[string][]string{"v": []string{"A", "B"}},
+		"v:\n- A\n- B\n",
+	}, {
+		map[string][]string{"v": []string{"A", "B\nC"}},
+		"v:\n- A\n- |-\n  B\n  C\n",
+	}, {
+		map[string][]interface{}{"v": []interface{}{"A", 1, map[string][]int{"B": []int{2, 3}}}},
+		"v:\n- A\n- 1\n- B:\n  - 2\n  - 3\n",
+	}, {
+		map[string]interface{}{"a": map[interface{}]interface{}{"b": "c"}},
+		"a:\n  b: c\n",
+	}, {
+		map[string]interface{}{"a": "-"},
+		"a: '-'\n",
+	},
+
+	// Simple values.
+	{
+		&marshalIntTest,
+		"123\n",
+	},
+
+	// Structures
+	{
+		&struct{ Hello string }{"world"},
+		"hello: world\n",
+	}, {
+		&struct {
+			A struct {
+				B string
+			}
+		}{struct{ B string }{"c"}},
+		"a:\n  b: c\n",
+	}, {
+		&struct {
+			A *struct {
+				B string
+			}
+		}{&struct{ B string }{"c"}},
+		"a:\n  b: c\n",
+	}, {
+		&struct {
+			A *struct {
+				B string
+			}
+		}{},
+		"a: null\n",
+	}, {
+		&struct{ A int }{1},
+		"a: 1\n",
+	}, {
+		&struct{ A []int }{[]int{1, 2}},
+		"a:\n- 1\n- 2\n",
+	}, {
+		&struct {
+			B int "a"
+		}{1},
+		"a: 1\n",
+	}, {
+		&struct{ A bool }{true},
+		"a: true\n",
+	},
+
+	// Conditional flag
+	{
+		&struct {
+			A int "a,omitempty"
+			B int "b,omitempty"
+		}{1, 0},
+		"a: 1\n",
+	}, {
+		&struct {
+			A int "a,omitempty"
+			B int "b,omitempty"
+		}{0, 0},
+		"{}\n",
+	}, {
+		&struct {
+			A *struct{ X, y int } "a,omitempty,flow"
+		}{&struct{ X, y int }{1, 2}},
+		"a: {x: 1}\n",
+	}, {
+		&struct {
+			A *struct{ X, y int } "a,omitempty,flow"
+		}{nil},
+		"{}\n",
+	}, {
+		&struct {
+			A *struct{ X, y int } "a,omitempty,flow"
+		}{&struct{ X, y int }{}},
+		"a: {x: 0}\n",
+	}, {
+		&struct {
+			A struct{ X, y int } "a,omitempty,flow"
+		}{struct{ X, y int }{1, 2}},
+		"a: {x: 1}\n",
+	}, {
+		&struct {
+			A struct{ X, y int } "a,omitempty,flow"
+		}{struct{ X, y int }{0, 1}},
+		"{}\n",
+	},
+
+	// Flow flag
+	{
+		&struct {
+			A []int "a,flow"
+		}{[]int{1, 2}},
+		"a: [1, 2]\n",
+	}, {
+		&struct {
+			A map[string]string "a,flow"
+		}{map[string]string{"b": "c", "d": "e"}},
+		"a: {b: c, d: e}\n",
+	}, {
+		&struct {
+			A struct {
+				B, D string
+			} "a,flow"
+		}{struct{ B, D string }{"c", "e"}},
+		"a: {b: c, d: e}\n",
+	},
+
+	// Unexported field
+	{
+		&struct {
+			u int
+			A int
+		}{0, 1},
+		"a: 1\n",
+	},
+
+	// Ignored field
+	{
+		&struct {
+			A int
+			B int "-"
+		}{1, 2},
+		"a: 1\n",
+	},
+
+	// Struct inlining
+	{
+		&struct {
+			A int
+			C inlineB `yaml:",inline"`
+		}{1, inlineB{2, inlineC{3}}},
+		"a: 1\nb: 2\nc: 3\n",
+	},
+
+	// Map inlining
+	{
+		&struct {
+			A int
+			C map[string]int `yaml:",inline"`
+		}{1, map[string]int{"b": 2, "c": 3}},
+		"a: 1\nb: 2\nc: 3\n",
+	},
+
+	// Duration
+	{
+		map[string]time.Duration{"a": 3 * time.Second},
+		"a: 3s\n",
+	},
+
+	// Issue #24: bug in map merging logic.
+	{
+		map[string]string{"a": "<foo>"},
+		"a: <foo>\n",
+	},
+
+	// Issue #34: marshal unsupported base 60 floats quoted for compatibility
+	// with old YAML 1.1 parsers.
+	{
+		map[string]string{"a": "1:1"},
+		"a: \"1:1\"\n",
+	},
+
+	// Binary data.
+	{
+		map[string]string{"a": "\x00"},
+		"a: \"\\0\"\n",
+	}, {
+		map[string]string{"a": "\x80\x81\x82"},
+		"a: !!binary gIGC\n",
+	}, {
+		map[string]string{"a": strings.Repeat("\x90", 54)},
+		"a: !!binary |\n  " + strings.Repeat("kJCQ", 17) + "kJ\n  CQ\n",
+	},
+
+	// Ordered maps.
+	{
+		&yaml.MapSlice{{"b", 2}, {"a", 1}, {"d", 4}, {"c", 3}, {"sub", yaml.MapSlice{{"e", 5}}}},
+		"b: 2\na: 1\nd: 4\nc: 3\nsub:\n  e: 5\n",
+	},
+
+	// Encode unicode as utf-8 rather than in escaped form.
+	{
+		map[string]string{"a": "你好"},
+		"a: 你好\n",
+	},
+
+	// Support encoding.TextMarshaler.
+	{
+		map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)},
+		"a: 1.2.3.4\n",
+	},
+	{
+		map[string]time.Time{"a": time.Unix(1424801979, 0)},
+		"a: 2015-02-24T18:19:39Z\n",
+	},
+
+	// Ensure strings containing ": " are quoted (reported as PR #43, but not reproducible).
+	{
+		map[string]string{"a": "b: c"},
+		"a: 'b: c'\n",
+	},
+
+	// Containing hash mark ('#') in string should be quoted
+	{
+		map[string]string{"a": "Hello #comment"},
+		"a: 'Hello #comment'\n",
+	},
+	{
+		map[string]string{"a": "你好 #comment"},
+		"a: '你好 #comment'\n",
+	},
+}
+
+func (s *S) TestMarshal(c *C) {
+	defer os.Setenv("TZ", os.Getenv("TZ"))
+	os.Setenv("TZ", "UTC")
+	for _, item := range marshalTests {
+		data, err := yaml.Marshal(item.value)
+		c.Assert(err, IsNil)
+		c.Assert(string(data), Equals, item.data)
+	}
+}
+
+var marshalErrorTests = []struct {
+	value interface{}
+	error string
+	panic string
+}{{
+	value: &struct {
+		B       int
+		inlineB ",inline"
+	}{1, inlineB{2, inlineC{3}}},
+	panic: `Duplicated key 'b' in struct struct \{ B int; .*`,
+}, {
+	value: &struct {
+		A       int
+		B map[string]int ",inline"
+	}{1, map[string]int{"a": 2}},
+	panic: `Can't have key "a" in inlined map; conflicts with struct field`,
+}}
+
+func (s *S) TestMarshalErrors(c *C) {
+	for _, item := range marshalErrorTests {
+		if item.panic != "" {
+			c.Assert(func() { yaml.Marshal(item.value) }, PanicMatches, item.panic)
+		} else {
+			_, err := yaml.Marshal(item.value)
+			c.Assert(err, ErrorMatches, item.error)
+		}
+	}
+}
+
+func (s *S) TestMarshalTypeCache(c *C) {
+	var data []byte
+	var err error
+	func() {
+		type T struct{ A int }
+		data, err = yaml.Marshal(&T{})
+		c.Assert(err, IsNil)
+	}()
+	func() {
+		type T struct{ B int }
+		data, err = yaml.Marshal(&T{})
+		c.Assert(err, IsNil)
+	}()
+	c.Assert(string(data), Equals, "b: 0\n")
+}
+
+var marshalerTests = []struct {
+	data  string
+	value interface{}
+}{
+	{"_:\n  hi: there\n", map[interface{}]interface{}{"hi": "there"}},
+	{"_:\n- 1\n- A\n", []interface{}{1, "A"}},
+	{"_: 10\n", 10},
+	{"_: null\n", nil},
+	{"_: BAR!\n", "BAR!"},
+}
+
+type marshalerType struct {
+	value interface{}
+}
+
+func (o marshalerType) MarshalText() ([]byte, error) {
+	panic("MarshalText called on type with MarshalYAML")
+}
+
+func (o marshalerType) MarshalYAML() (interface{}, error) {
+	return o.value, nil
+}
+
+type marshalerValue struct {
+	Field marshalerType "_"
+}
+
+func (s *S) TestMarshaler(c *C) {
+	for _, item := range marshalerTests {
+		obj := &marshalerValue{}
+		obj.Field.value = item.value
+		data, err := yaml.Marshal(obj)
+		c.Assert(err, IsNil)
+		c.Assert(string(data), Equals, string(item.data))
+	}
+}
+
+func (s *S) TestMarshalerWholeDocument(c *C) {
+	obj := &marshalerType{}
+	obj.value = map[string]string{"hello": "world!"}
+	data, err := yaml.Marshal(obj)
+	c.Assert(err, IsNil)
+	c.Assert(string(data), Equals, "hello: world!\n")
+}
+
+type failingMarshaler struct{}
+
+func (ft *failingMarshaler) MarshalYAML() (interface{}, error) {
+	return nil, failingErr
+}
+
+func (s *S) TestMarshalerError(c *C) {
+	_, err := yaml.Marshal(&failingMarshaler{})
+	c.Assert(err, Equals, failingErr)
+}
+
+func (s *S) TestSortedOutput(c *C) {
+	order := []interface{}{
+		false,
+		true,
+		1,
+		uint(1),
+		1.0,
+		1.1,
+		1.2,
+		2,
+		uint(2),
+		2.0,
+		2.1,
+		"",
+		".1",
+		".2",
+		".a",
+		"1",
+		"2",
+		"a!10",
+		"a/2",
+		"a/10",
+		"a~10",
+		"ab/1",
+		"b/1",
+		"b/01",
+		"b/2",
+		"b/02",
+		"b/3",
+		"b/03",
+		"b1",
+		"b01",
+		"b3",
+		"c2.10",
+		"c10.2",
+		"d1",
+		"d12",
+		"d12a",
+	}
+	m := make(map[interface{}]int)
+	for _, k := range order {
+		m[k] = 1
+	}
+	data, err := yaml.Marshal(m)
+	c.Assert(err, IsNil)
+	out := "\n" + string(data)
+	last := 0
+	for i, k := range order {
+		repr := fmt.Sprint(k)
+		if s, ok := k.(string); ok {
+			if _, err = strconv.ParseFloat(repr, 32); s == "" || err == nil {
+				repr = `"` + repr + `"`
+			}
+		}
+		index := strings.Index(out, "\n"+repr+":")
+		if index == -1 {
+			c.Fatalf("%#v is not in the output: %#v", k, out)
+		}
+		if index < last {
+			c.Fatalf("%#v was generated before %#v: %q", k, order[i-1], out)
+		}
+		last = index
+	}
+}


[41/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_test.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_test.go
deleted file mode 100644
index 3805931..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/decode_test.go
+++ /dev/null
@@ -1,950 +0,0 @@
-package toml
-
-import (
-	"fmt"
-	"log"
-	"reflect"
-	"testing"
-	"time"
-)
-
-func init() {
-	log.SetFlags(0)
-}
-
-func TestDecodeSimple(t *testing.T) {
-	var testSimple = `
-age = 250
-andrew = "gallant"
-kait = "brady"
-now = 1987-07-05T05:45:00Z
-yesOrNo = true
-pi = 3.14
-colors = [
-	["red", "green", "blue"],
-	["cyan", "magenta", "yellow", "black"],
-]
-
-[My.Cats]
-plato = "cat 1"
-cauchy = "cat 2"
-`
-
-	type cats struct {
-		Plato  string
-		Cauchy string
-	}
-	type simple struct {
-		Age     int
-		Colors  [][]string
-		Pi      float64
-		YesOrNo bool
-		Now     time.Time
-		Andrew  string
-		Kait    string
-		My      map[string]cats
-	}
-
-	var val simple
-	_, err := Decode(testSimple, &val)
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	now, err := time.Parse("2006-01-02T15:04:05", "1987-07-05T05:45:00")
-	if err != nil {
-		panic(err)
-	}
-	var answer = simple{
-		Age:     250,
-		Andrew:  "gallant",
-		Kait:    "brady",
-		Now:     now,
-		YesOrNo: true,
-		Pi:      3.14,
-		Colors: [][]string{
-			{"red", "green", "blue"},
-			{"cyan", "magenta", "yellow", "black"},
-		},
-		My: map[string]cats{
-			"Cats": cats{Plato: "cat 1", Cauchy: "cat 2"},
-		},
-	}
-	if !reflect.DeepEqual(val, answer) {
-		t.Fatalf("Expected\n-----\n%#v\n-----\nbut got\n-----\n%#v\n",
-			answer, val)
-	}
-}
-
-func TestDecodeEmbedded(t *testing.T) {
-	type Dog struct{ Name string }
-	type Age int
-
-	tests := map[string]struct {
-		input       string
-		decodeInto  interface{}
-		wantDecoded interface{}
-	}{
-		"embedded struct": {
-			input:       `Name = "milton"`,
-			decodeInto:  &struct{ Dog }{},
-			wantDecoded: &struct{ Dog }{Dog{"milton"}},
-		},
-		"embedded non-nil pointer to struct": {
-			input:       `Name = "milton"`,
-			decodeInto:  &struct{ *Dog }{},
-			wantDecoded: &struct{ *Dog }{&Dog{"milton"}},
-		},
-		"embedded nil pointer to struct": {
-			input:       ``,
-			decodeInto:  &struct{ *Dog }{},
-			wantDecoded: &struct{ *Dog }{nil},
-		},
-		"embedded int": {
-			input:       `Age = -5`,
-			decodeInto:  &struct{ Age }{},
-			wantDecoded: &struct{ Age }{-5},
-		},
-	}
-
-	for label, test := range tests {
-		_, err := Decode(test.input, test.decodeInto)
-		if err != nil {
-			t.Fatal(err)
-		}
-		if !reflect.DeepEqual(test.wantDecoded, test.decodeInto) {
-			t.Errorf("%s: want decoded == %+v, got %+v",
-				label, test.wantDecoded, test.decodeInto)
-		}
-	}
-}
-
-func TestTableArrays(t *testing.T) {
-	var tomlTableArrays = `
-[[albums]]
-name = "Born to Run"
-
-  [[albums.songs]]
-  name = "Jungleland"
-
-  [[albums.songs]]
-  name = "Meeting Across the River"
-
-[[albums]]
-name = "Born in the USA"
-
-  [[albums.songs]]
-  name = "Glory Days"
-
-  [[albums.songs]]
-  name = "Dancing in the Dark"
-`
-
-	type Song struct {
-		Name string
-	}
-
-	type Album struct {
-		Name  string
-		Songs []Song
-	}
-
-	type Music struct {
-		Albums []Album
-	}
-
-	expected := Music{[]Album{
-		{"Born to Run", []Song{{"Jungleland"}, {"Meeting Across the River"}}},
-		{"Born in the USA", []Song{{"Glory Days"}, {"Dancing in the Dark"}}},
-	}}
-	var got Music
-	if _, err := Decode(tomlTableArrays, &got); err != nil {
-		t.Fatal(err)
-	}
-	if !reflect.DeepEqual(expected, got) {
-		t.Fatalf("\n%#v\n!=\n%#v\n", expected, got)
-	}
-}
-
-// Case insensitive matching tests.
-// A bit more comprehensive than needed given the current implementation,
-// but implementations change.
-// Probably still missing demonstrations of some ugly corner cases regarding
-// case insensitive matching and multiple fields.
-func TestCase(t *testing.T) {
-	var caseToml = `
-tOpString = "string"
-tOpInt = 1
-tOpFloat = 1.1
-tOpBool = true
-tOpdate = 2006-01-02T15:04:05Z
-tOparray = [ "array" ]
-Match = "i should be in Match only"
-MatcH = "i should be in MatcH only"
-once = "just once"
-[nEst.eD]
-nEstedString = "another string"
-`
-
-	type InsensitiveEd struct {
-		NestedString string
-	}
-
-	type InsensitiveNest struct {
-		Ed InsensitiveEd
-	}
-
-	type Insensitive struct {
-		TopString string
-		TopInt    int
-		TopFloat  float64
-		TopBool   bool
-		TopDate   time.Time
-		TopArray  []string
-		Match     string
-		MatcH     string
-		Once      string
-		OncE      string
-		Nest      InsensitiveNest
-	}
-
-	tme, err := time.Parse(time.RFC3339, time.RFC3339[:len(time.RFC3339)-5])
-	if err != nil {
-		panic(err)
-	}
-	expected := Insensitive{
-		TopString: "string",
-		TopInt:    1,
-		TopFloat:  1.1,
-		TopBool:   true,
-		TopDate:   tme,
-		TopArray:  []string{"array"},
-		MatcH:     "i should be in MatcH only",
-		Match:     "i should be in Match only",
-		Once:      "just once",
-		OncE:      "",
-		Nest: InsensitiveNest{
-			Ed: InsensitiveEd{NestedString: "another string"},
-		},
-	}
-	var got Insensitive
-	if _, err := Decode(caseToml, &got); err != nil {
-		t.Fatal(err)
-	}
-	if !reflect.DeepEqual(expected, got) {
-		t.Fatalf("\n%#v\n!=\n%#v\n", expected, got)
-	}
-}
-
-func TestPointers(t *testing.T) {
-	type Object struct {
-		Type        string
-		Description string
-	}
-
-	type Dict struct {
-		NamedObject map[string]*Object
-		BaseObject  *Object
-		Strptr      *string
-		Strptrs     []*string
-	}
-	s1, s2, s3 := "blah", "abc", "def"
-	expected := &Dict{
-		Strptr:  &s1,
-		Strptrs: []*string{&s2, &s3},
-		NamedObject: map[string]*Object{
-			"foo": {"FOO", "fooooo!!!"},
-			"bar": {"BAR", "ba-ba-ba-ba-barrrr!!!"},
-		},
-		BaseObject: &Object{"BASE", "da base"},
-	}
-
-	ex1 := `
-Strptr = "blah"
-Strptrs = ["abc", "def"]
-
-[NamedObject.foo]
-Type = "FOO"
-Description = "fooooo!!!"
-
-[NamedObject.bar]
-Type = "BAR"
-Description = "ba-ba-ba-ba-barrrr!!!"
-
-[BaseObject]
-Type = "BASE"
-Description = "da base"
-`
-	dict := new(Dict)
-	_, err := Decode(ex1, dict)
-	if err != nil {
-		t.Errorf("Decode error: %v", err)
-	}
-	if !reflect.DeepEqual(expected, dict) {
-		t.Fatalf("\n%#v\n!=\n%#v\n", expected, dict)
-	}
-}
-
-type sphere struct {
-	Center [3]float64
-	Radius float64
-}
-
-func TestDecodeSimpleArray(t *testing.T) {
-	var s1 sphere
-	if _, err := Decode(`center = [0.0, 1.5, 0.0]`, &s1); err != nil {
-		t.Fatal(err)
-	}
-}
-
-func TestDecodeArrayWrongSize(t *testing.T) {
-	var s1 sphere
-	if _, err := Decode(`center = [0.1, 2.3]`, &s1); err == nil {
-		t.Fatal("Expected array type mismatch error")
-	}
-}
-
-func TestDecodeLargeIntoSmallInt(t *testing.T) {
-	type table struct {
-		Value int8
-	}
-	var tab table
-	if _, err := Decode(`value = 500`, &tab); err == nil {
-		t.Fatal("Expected integer out-of-bounds error.")
-	}
-}
-
-func TestDecodeSizedInts(t *testing.T) {
-	type table struct {
-		U8  uint8
-		U16 uint16
-		U32 uint32
-		U64 uint64
-		U   uint
-		I8  int8
-		I16 int16
-		I32 int32
-		I64 int64
-		I   int
-	}
-	answer := table{1, 1, 1, 1, 1, -1, -1, -1, -1, -1}
-	toml := `
-	u8 = 1
-	u16 = 1
-	u32 = 1
-	u64 = 1
-	u = 1
-	i8 = -1
-	i16 = -1
-	i32 = -1
-	i64 = -1
-	i = -1
-	`
-	var tab table
-	if _, err := Decode(toml, &tab); err != nil {
-		t.Fatal(err.Error())
-	}
-	if answer != tab {
-		t.Fatalf("Expected %#v but got %#v", answer, tab)
-	}
-}
-
-func TestUnmarshaler(t *testing.T) {
-
-	var tomlBlob = `
-[dishes.hamboogie]
-name = "Hamboogie with fries"
-price = 10.99
-
-[[dishes.hamboogie.ingredients]]
-name = "Bread Bun"
-
-[[dishes.hamboogie.ingredients]]
-name = "Lettuce"
-
-[[dishes.hamboogie.ingredients]]
-name = "Real Beef Patty"
-
-[[dishes.hamboogie.ingredients]]
-name = "Tomato"
-
-[dishes.eggsalad]
-name = "Egg Salad with rice"
-price = 3.99
-
-[[dishes.eggsalad.ingredients]]
-name = "Egg"
-
-[[dishes.eggsalad.ingredients]]
-name = "Mayo"
-
-[[dishes.eggsalad.ingredients]]
-name = "Rice"
-`
-	m := &menu{}
-	if _, err := Decode(tomlBlob, m); err != nil {
-		log.Fatal(err)
-	}
-
-	if len(m.Dishes) != 2 {
-		t.Log("two dishes should be loaded with UnmarshalTOML()")
-		t.Errorf("expected %d but got %d", 2, len(m.Dishes))
-	}
-
-	eggSalad := m.Dishes["eggsalad"]
-	if _, ok := interface{}(eggSalad).(dish); !ok {
-		t.Errorf("expected a dish")
-	}
-
-	if eggSalad.Name != "Egg Salad with rice" {
-		t.Errorf("expected the dish to be named 'Egg Salad with rice'")
-	}
-
-	if len(eggSalad.Ingredients) != 3 {
-		t.Log("dish should be loaded with UnmarshalTOML()")
-		t.Errorf("expected %d but got %d", 3, len(eggSalad.Ingredients))
-	}
-
-	found := false
-	for _, i := range eggSalad.Ingredients {
-		if i.Name == "Rice" {
-			found = true
-			break
-		}
-	}
-	if !found {
-		t.Error("Rice was not loaded in UnmarshalTOML()")
-	}
-
-	// test on a value - must be passed as *
-	o := menu{}
-	if _, err := Decode(tomlBlob, &o); err != nil {
-		log.Fatal(err)
-	}
-
-}
-
-type menu struct {
-	Dishes map[string]dish
-}
-
-func (m *menu) UnmarshalTOML(p interface{}) error {
-	m.Dishes = make(map[string]dish)
-	data, _ := p.(map[string]interface{})
-	dishes := data["dishes"].(map[string]interface{})
-	for n, v := range dishes {
-		if d, ok := v.(map[string]interface{}); ok {
-			nd := dish{}
-			nd.UnmarshalTOML(d)
-			m.Dishes[n] = nd
-		} else {
-			return fmt.Errorf("not a dish")
-		}
-	}
-	return nil
-}
-
-type dish struct {
-	Name        string
-	Price       float32
-	Ingredients []ingredient
-}
-
-func (d *dish) UnmarshalTOML(p interface{}) error {
-	data, _ := p.(map[string]interface{})
-	d.Name, _ = data["name"].(string)
-	d.Price, _ = data["price"].(float32)
-	ingredients, _ := data["ingredients"].([]map[string]interface{})
-	for _, e := range ingredients {
-		n, _ := interface{}(e).(map[string]interface{})
-		name, _ := n["name"].(string)
-		i := ingredient{name}
-		d.Ingredients = append(d.Ingredients, i)
-	}
-	return nil
-}
-
-type ingredient struct {
-	Name string
-}
-
-func ExampleMetaData_PrimitiveDecode() {
-	var md MetaData
-	var err error
-
-	var tomlBlob = `
-ranking = ["Springsteen", "J Geils"]
-
-[bands.Springsteen]
-started = 1973
-albums = ["Greetings", "WIESS", "Born to Run", "Darkness"]
-
-[bands."J Geils"]
-started = 1970
-albums = ["The J. Geils Band", "Full House", "Blow Your Face Out"]
-`
-
-	type band struct {
-		Started int
-		Albums  []string
-	}
-	type classics struct {
-		Ranking []string
-		Bands   map[string]Primitive
-	}
-
-	// Do the initial decode. Reflection is delayed on Primitive values.
-	var music classics
-	if md, err = Decode(tomlBlob, &music); err != nil {
-		log.Fatal(err)
-	}
-
-	// MetaData still includes information on Primitive values.
-	fmt.Printf("Is `bands.Springsteen` defined? %v\n",
-		md.IsDefined("bands", "Springsteen"))
-
-	// Decode primitive data into Go values.
-	for _, artist := range music.Ranking {
-		// A band is a primitive value, so we need to decode it to get a
-		// real `band` value.
-		primValue := music.Bands[artist]
-
-		var aBand band
-		if err = md.PrimitiveDecode(primValue, &aBand); err != nil {
-			log.Fatal(err)
-		}
-		fmt.Printf("%s started in %d.\n", artist, aBand.Started)
-	}
-	// Check to see if there were any fields left undecoded.
-	// Note that this won't be empty before decoding the Primitive value!
-	fmt.Printf("Undecoded: %q\n", md.Undecoded())
-
-	// Output:
-	// Is `bands.Springsteen` defined? true
-	// Springsteen started in 1973.
-	// J Geils started in 1970.
-	// Undecoded: []
-}
-
-func ExampleDecode() {
-	var tomlBlob = `
-# Some comments.
-[alpha]
-ip = "10.0.0.1"
-
-	[alpha.config]
-	Ports = [ 8001, 8002 ]
-	Location = "Toronto"
-	Created = 1987-07-05T05:45:00Z
-
-[beta]
-ip = "10.0.0.2"
-
-	[beta.config]
-	Ports = [ 9001, 9002 ]
-	Location = "New Jersey"
-	Created = 1887-01-05T05:55:00Z
-`
-
-	type serverConfig struct {
-		Ports    []int
-		Location string
-		Created  time.Time
-	}
-
-	type server struct {
-		IP     string       `toml:"ip"`
-		Config serverConfig `toml:"config"`
-	}
-
-	type servers map[string]server
-
-	var config servers
-	if _, err := Decode(tomlBlob, &config); err != nil {
-		log.Fatal(err)
-	}
-
-	for _, name := range []string{"alpha", "beta"} {
-		s := config[name]
-		fmt.Printf("Server: %s (ip: %s) in %s created on %s\n",
-			name, s.IP, s.Config.Location,
-			s.Config.Created.Format("2006-01-02"))
-		fmt.Printf("Ports: %v\n", s.Config.Ports)
-	}
-
-	// Output:
-	// Server: alpha (ip: 10.0.0.1) in Toronto created on 1987-07-05
-	// Ports: [8001 8002]
-	// Server: beta (ip: 10.0.0.2) in New Jersey created on 1887-01-05
-	// Ports: [9001 9002]
-}
-
-type duration struct {
-	time.Duration
-}
-
-func (d *duration) UnmarshalText(text []byte) error {
-	var err error
-	d.Duration, err = time.ParseDuration(string(text))
-	return err
-}
-
-// Example Unmarshaler shows how to decode TOML strings into your own
-// custom data type.
-func Example_unmarshaler() {
-	blob := `
-[[song]]
-name = "Thunder Road"
-duration = "4m49s"
-
-[[song]]
-name = "Stairway to Heaven"
-duration = "8m03s"
-`
-	type song struct {
-		Name     string
-		Duration duration
-	}
-	type songs struct {
-		Song []song
-	}
-	var favorites songs
-	if _, err := Decode(blob, &favorites); err != nil {
-		log.Fatal(err)
-	}
-
-	// Code to implement the TextUnmarshaler interface for `duration`:
-	//
-	// type duration struct {
-	// 	time.Duration
-	// }
-	//
-	// func (d *duration) UnmarshalText(text []byte) error {
-	// 	var err error
-	// 	d.Duration, err = time.ParseDuration(string(text))
-	// 	return err
-	// }
-
-	for _, s := range favorites.Song {
-		fmt.Printf("%s (%s)\n", s.Name, s.Duration)
-	}
-	// Output:
-	// Thunder Road (4m49s)
-	// Stairway to Heaven (8m3s)
-}
-
-// Example StrictDecoding shows how to detect whether there are keys in the
-// TOML document that weren't decoded into the value given. This is useful
-// for returning an error to the user if they've included extraneous fields
-// in their configuration.
-func Example_strictDecoding() {
-	var blob = `
-key1 = "value1"
-key2 = "value2"
-key3 = "value3"
-`
-	type config struct {
-		Key1 string
-		Key3 string
-	}
-
-	var conf config
-	md, err := Decode(blob, &conf)
-	if err != nil {
-		log.Fatal(err)
-	}
-	fmt.Printf("Undecoded keys: %q\n", md.Undecoded())
-	// Output:
-	// Undecoded keys: ["key2"]
-}
-
-// Example UnmarshalTOML shows how to implement a struct type that knows how to
-// unmarshal itself. The struct must take full responsibility for mapping the
-// values passed into the struct. The method may be used with interfaces in a
-// struct in cases where the actual type is not known until the data is
-// examined.
-func Example_unmarshalTOML() {
-
-	var blob = `
-[[parts]]
-type = "valve"
-id = "valve-1"
-size = 1.2
-rating = 4
-
-[[parts]]
-type = "valve"
-id = "valve-2"
-size = 2.1
-rating = 5
-
-[[parts]]
-type = "pipe"
-id = "pipe-1"
-length = 2.1
-diameter = 12
-
-[[parts]]
-type = "cable"
-id = "cable-1"
-length = 12
-rating = 3.1
-`
-	o := &order{}
-	err := Unmarshal([]byte(blob), o)
-	if err != nil {
-		log.Fatal(err)
-	}
-
-	fmt.Println(len(o.parts))
-
-	for _, part := range o.parts {
-		fmt.Println(part.Name())
-	}
-
-	// Code to implement UmarshalJSON.
-
-	// type order struct {
-	// 	// NOTE `order.parts` is a private slice of type `part` which is an
-	// 	// interface and may only be loaded from toml using the
-	// 	// UnmarshalTOML() method of the Umarshaler interface.
-	// 	parts parts
-	// }
-
-	// func (o *order) UnmarshalTOML(data interface{}) error {
-
-	// 	// NOTE the example below contains detailed type casting to show how
-	// 	// the 'data' is retrieved. In operational use, a type cast wrapper
-	// 	// may be prefered e.g.
-	// 	//
-	// 	// func AsMap(v interface{}) (map[string]interface{}, error) {
-	// 	// 		return v.(map[string]interface{})
-	// 	// }
-	// 	//
-	// 	// resulting in:
-	// 	// d, _ := AsMap(data)
-	// 	//
-
-	// 	d, _ := data.(map[string]interface{})
-	// 	parts, _ := d["parts"].([]map[string]interface{})
-
-	// 	for _, p := range parts {
-
-	// 		typ, _ := p["type"].(string)
-	// 		id, _ := p["id"].(string)
-
-	// 		// detect the type of part and handle each case
-	// 		switch p["type"] {
-	// 		case "valve":
-
-	// 			size := float32(p["size"].(float64))
-	// 			rating := int(p["rating"].(int64))
-
-	// 			valve := &valve{
-	// 				Type:   typ,
-	// 				ID:     id,
-	// 				Size:   size,
-	// 				Rating: rating,
-	// 			}
-
-	// 			o.parts = append(o.parts, valve)
-
-	// 		case "pipe":
-
-	// 			length := float32(p["length"].(float64))
-	// 			diameter := int(p["diameter"].(int64))
-
-	// 			pipe := &pipe{
-	// 				Type:     typ,
-	// 				ID:       id,
-	// 				Length:   length,
-	// 				Diameter: diameter,
-	// 			}
-
-	// 			o.parts = append(o.parts, pipe)
-
-	// 		case "cable":
-
-	// 			length := int(p["length"].(int64))
-	// 			rating := float32(p["rating"].(float64))
-
-	// 			cable := &cable{
-	// 				Type:   typ,
-	// 				ID:     id,
-	// 				Length: length,
-	// 				Rating: rating,
-	// 			}
-
-	// 			o.parts = append(o.parts, cable)
-
-	// 		}
-	// 	}
-
-	// 	return nil
-	// }
-
-	// type parts []part
-
-	// type part interface {
-	// 	Name() string
-	// }
-
-	// type valve struct {
-	// 	Type   string
-	// 	ID     string
-	// 	Size   float32
-	// 	Rating int
-	// }
-
-	// func (v *valve) Name() string {
-	// 	return fmt.Sprintf("VALVE: %s", v.ID)
-	// }
-
-	// type pipe struct {
-	// 	Type     string
-	// 	ID       string
-	// 	Length   float32
-	// 	Diameter int
-	// }
-
-	// func (p *pipe) Name() string {
-	// 	return fmt.Sprintf("PIPE: %s", p.ID)
-	// }
-
-	// type cable struct {
-	// 	Type   string
-	// 	ID     string
-	// 	Length int
-	// 	Rating float32
-	// }
-
-	// func (c *cable) Name() string {
-	// 	return fmt.Sprintf("CABLE: %s", c.ID)
-	// }
-
-	// Output:
-	// 4
-	// VALVE: valve-1
-	// VALVE: valve-2
-	// PIPE: pipe-1
-	// CABLE: cable-1
-
-}
-
-type order struct {
-	// NOTE `order.parts` is a private slice of type `part` which is an
-	// interface and may only be loaded from toml using the UnmarshalTOML()
-	// method of the Umarshaler interface.
-	parts parts
-}
-
-func (o *order) UnmarshalTOML(data interface{}) error {
-
-	// NOTE the example below contains detailed type casting to show how
-	// the 'data' is retrieved. In operational use, a type cast wrapper
-	// may be prefered e.g.
-	//
-	// func AsMap(v interface{}) (map[string]interface{}, error) {
-	// 		return v.(map[string]interface{})
-	// }
-	//
-	// resulting in:
-	// d, _ := AsMap(data)
-	//
-
-	d, _ := data.(map[string]interface{})
-	parts, _ := d["parts"].([]map[string]interface{})
-
-	for _, p := range parts {
-
-		typ, _ := p["type"].(string)
-		id, _ := p["id"].(string)
-
-		// detect the type of part and handle each case
-		switch p["type"] {
-		case "valve":
-
-			size := float32(p["size"].(float64))
-			rating := int(p["rating"].(int64))
-
-			valve := &valve{
-				Type:   typ,
-				ID:     id,
-				Size:   size,
-				Rating: rating,
-			}
-
-			o.parts = append(o.parts, valve)
-
-		case "pipe":
-
-			length := float32(p["length"].(float64))
-			diameter := int(p["diameter"].(int64))
-
-			pipe := &pipe{
-				Type:     typ,
-				ID:       id,
-				Length:   length,
-				Diameter: diameter,
-			}
-
-			o.parts = append(o.parts, pipe)
-
-		case "cable":
-
-			length := int(p["length"].(int64))
-			rating := float32(p["rating"].(float64))
-
-			cable := &cable{
-				Type:   typ,
-				ID:     id,
-				Length: length,
-				Rating: rating,
-			}
-
-			o.parts = append(o.parts, cable)
-
-		}
-	}
-
-	return nil
-}
-
-type parts []part
-
-type part interface {
-	Name() string
-}
-
-type valve struct {
-	Type   string
-	ID     string
-	Size   float32
-	Rating int
-}
-
-func (v *valve) Name() string {
-	return fmt.Sprintf("VALVE: %s", v.ID)
-}
-
-type pipe struct {
-	Type     string
-	ID       string
-	Length   float32
-	Diameter int
-}
-
-func (p *pipe) Name() string {
-	return fmt.Sprintf("PIPE: %s", p.ID)
-}
-
-type cable struct {
-	Type   string
-	ID     string
-	Length int
-	Rating float32
-}
-
-func (c *cable) Name() string {
-	return fmt.Sprintf("CABLE: %s", c.ID)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/doc.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/doc.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/doc.go
deleted file mode 100644
index fe26800..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/doc.go
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Package toml provides facilities for decoding and encoding TOML configuration
-files via reflection. There is also support for delaying decoding with
-the Primitive type, and querying the set of keys in a TOML document with the
-MetaData type.
-
-The specification implemented: https://github.com/mojombo/toml
-
-The sub-command github.com/BurntSushi/toml/cmd/tomlv can be used to verify
-whether a file is a valid TOML document. It can also be used to print the
-type of each key in a TOML document.
-
-Testing
-
-There are two important types of tests used for this package. The first is
-contained inside '*_test.go' files and uses the standard Go unit testing
-framework. These tests are primarily devoted to holistically testing the
-decoder and encoder.
-
-The second type of testing is used to verify the implementation's adherence
-to the TOML specification. These tests have been factored into their own
-project: https://github.com/BurntSushi/toml-test
-
-The reason the tests are in a separate project is so that they can be used by
-any implementation of TOML. Namely, it is language agnostic.
-*/
-package toml

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/encode.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/encode.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/encode.go
deleted file mode 100644
index c7e227c..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/encode.go
+++ /dev/null
@@ -1,551 +0,0 @@
-package toml
-
-import (
-	"bufio"
-	"errors"
-	"fmt"
-	"io"
-	"reflect"
-	"sort"
-	"strconv"
-	"strings"
-	"time"
-)
-
-type tomlEncodeError struct{ error }
-
-var (
-	errArrayMixedElementTypes = errors.New(
-		"can't encode array with mixed element types")
-	errArrayNilElement = errors.New(
-		"can't encode array with nil element")
-	errNonString = errors.New(
-		"can't encode a map with non-string key type")
-	errAnonNonStruct = errors.New(
-		"can't encode an anonymous field that is not a struct")
-	errArrayNoTable = errors.New(
-		"TOML array element can't contain a table")
-	errNoKey = errors.New(
-		"top-level values must be a Go map or struct")
-	errAnything = errors.New("") // used in testing
-)
-
-var quotedReplacer = strings.NewReplacer(
-	"\t", "\\t",
-	"\n", "\\n",
-	"\r", "\\r",
-	"\"", "\\\"",
-	"\\", "\\\\",
-)
-
-// Encoder controls the encoding of Go values to a TOML document to some
-// io.Writer.
-//
-// The indentation level can be controlled with the Indent field.
-type Encoder struct {
-	// A single indentation level. By default it is two spaces.
-	Indent string
-
-	// hasWritten is whether we have written any output to w yet.
-	hasWritten bool
-	w          *bufio.Writer
-}
-
-// NewEncoder returns a TOML encoder that encodes Go values to the io.Writer
-// given. By default, a single indentation level is 2 spaces.
-func NewEncoder(w io.Writer) *Encoder {
-	return &Encoder{
-		w:      bufio.NewWriter(w),
-		Indent: "  ",
-	}
-}
-
-// Encode writes a TOML representation of the Go value to the underlying
-// io.Writer. If the value given cannot be encoded to a valid TOML document,
-// then an error is returned.
-//
-// The mapping between Go values and TOML values should be precisely the same
-// as for the Decode* functions. Similarly, the TextMarshaler interface is
-// supported by encoding the resulting bytes as strings. (If you want to write
-// arbitrary binary data then you will need to use something like base64 since
-// TOML does not have any binary types.)
-//
-// When encoding TOML hashes (i.e., Go maps or structs), keys without any
-// sub-hashes are encoded first.
-//
-// If a Go map is encoded, then its keys are sorted alphabetically for
-// deterministic output. More control over this behavior may be provided if
-// there is demand for it.
-//
-// Encoding Go values without a corresponding TOML representation---like map
-// types with non-string keys---will cause an error to be returned. Similarly
-// for mixed arrays/slices, arrays/slices with nil elements, embedded
-// non-struct types and nested slices containing maps or structs.
-// (e.g., [][]map[string]string is not allowed but []map[string]string is OK
-// and so is []map[string][]string.)
-func (enc *Encoder) Encode(v interface{}) error {
-	rv := eindirect(reflect.ValueOf(v))
-	if err := enc.safeEncode(Key([]string{}), rv); err != nil {
-		return err
-	}
-	return enc.w.Flush()
-}
-
-func (enc *Encoder) safeEncode(key Key, rv reflect.Value) (err error) {
-	defer func() {
-		if r := recover(); r != nil {
-			if terr, ok := r.(tomlEncodeError); ok {
-				err = terr.error
-				return
-			}
-			panic(r)
-		}
-	}()
-	enc.encode(key, rv)
-	return nil
-}
-
-func (enc *Encoder) encode(key Key, rv reflect.Value) {
-	// Special case. Time needs to be in ISO8601 format.
-	// Special case. If we can marshal the type to text, then we used that.
-	// Basically, this prevents the encoder for handling these types as
-	// generic structs (or whatever the underlying type of a TextMarshaler is).
-	switch rv.Interface().(type) {
-	case time.Time, TextMarshaler:
-		enc.keyEqElement(key, rv)
-		return
-	}
-
-	k := rv.Kind()
-	switch k {
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,
-		reflect.Int64,
-		reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32,
-		reflect.Uint64,
-		reflect.Float32, reflect.Float64, reflect.String, reflect.Bool:
-		enc.keyEqElement(key, rv)
-	case reflect.Array, reflect.Slice:
-		if typeEqual(tomlArrayHash, tomlTypeOfGo(rv)) {
-			enc.eArrayOfTables(key, rv)
-		} else {
-			enc.keyEqElement(key, rv)
-		}
-	case reflect.Interface:
-		if rv.IsNil() {
-			return
-		}
-		enc.encode(key, rv.Elem())
-	case reflect.Map:
-		if rv.IsNil() {
-			return
-		}
-		enc.eTable(key, rv)
-	case reflect.Ptr:
-		if rv.IsNil() {
-			return
-		}
-		enc.encode(key, rv.Elem())
-	case reflect.Struct:
-		enc.eTable(key, rv)
-	default:
-		panic(e("Unsupported type for key '%s': %s", key, k))
-	}
-}
-
-// eElement encodes any value that can be an array element (primitives and
-// arrays).
-func (enc *Encoder) eElement(rv reflect.Value) {
-	switch v := rv.Interface().(type) {
-	case time.Time:
-		// Special case time.Time as a primitive. Has to come before
-		// TextMarshaler below because time.Time implements
-		// encoding.TextMarshaler, but we need to always use UTC.
-		enc.wf(v.In(time.FixedZone("UTC", 0)).Format("2006-01-02T15:04:05Z"))
-		return
-	case TextMarshaler:
-		// Special case. Use text marshaler if it's available for this value.
-		if s, err := v.MarshalText(); err != nil {
-			encPanic(err)
-		} else {
-			enc.writeQuoted(string(s))
-		}
-		return
-	}
-	switch rv.Kind() {
-	case reflect.Bool:
-		enc.wf(strconv.FormatBool(rv.Bool()))
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,
-		reflect.Int64:
-		enc.wf(strconv.FormatInt(rv.Int(), 10))
-	case reflect.Uint, reflect.Uint8, reflect.Uint16,
-		reflect.Uint32, reflect.Uint64:
-		enc.wf(strconv.FormatUint(rv.Uint(), 10))
-	case reflect.Float32:
-		enc.wf(floatAddDecimal(strconv.FormatFloat(rv.Float(), 'f', -1, 32)))
-	case reflect.Float64:
-		enc.wf(floatAddDecimal(strconv.FormatFloat(rv.Float(), 'f', -1, 64)))
-	case reflect.Array, reflect.Slice:
-		enc.eArrayOrSliceElement(rv)
-	case reflect.Interface:
-		enc.eElement(rv.Elem())
-	case reflect.String:
-		enc.writeQuoted(rv.String())
-	default:
-		panic(e("Unexpected primitive type: %s", rv.Kind()))
-	}
-}
-
-// By the TOML spec, all floats must have a decimal with at least one
-// number on either side.
-func floatAddDecimal(fstr string) string {
-	if !strings.Contains(fstr, ".") {
-		return fstr + ".0"
-	}
-	return fstr
-}
-
-func (enc *Encoder) writeQuoted(s string) {
-	enc.wf("\"%s\"", quotedReplacer.Replace(s))
-}
-
-func (enc *Encoder) eArrayOrSliceElement(rv reflect.Value) {
-	length := rv.Len()
-	enc.wf("[")
-	for i := 0; i < length; i++ {
-		elem := rv.Index(i)
-		enc.eElement(elem)
-		if i != length-1 {
-			enc.wf(", ")
-		}
-	}
-	enc.wf("]")
-}
-
-func (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) {
-	if len(key) == 0 {
-		encPanic(errNoKey)
-	}
-	for i := 0; i < rv.Len(); i++ {
-		trv := rv.Index(i)
-		if isNil(trv) {
-			continue
-		}
-		panicIfInvalidKey(key)
-		enc.newline()
-		enc.wf("%s[[%s]]", enc.indentStr(key), key.maybeQuotedAll())
-		enc.newline()
-		enc.eMapOrStruct(key, trv)
-	}
-}
-
-func (enc *Encoder) eTable(key Key, rv reflect.Value) {
-	panicIfInvalidKey(key)
-	if len(key) == 1 {
-		// Output an extra new line between top-level tables.
-		// (The newline isn't written if nothing else has been written though.)
-		enc.newline()
-	}
-	if len(key) > 0 {
-		enc.wf("%s[%s]", enc.indentStr(key), key.maybeQuotedAll())
-		enc.newline()
-	}
-	enc.eMapOrStruct(key, rv)
-}
-
-func (enc *Encoder) eMapOrStruct(key Key, rv reflect.Value) {
-	switch rv := eindirect(rv); rv.Kind() {
-	case reflect.Map:
-		enc.eMap(key, rv)
-	case reflect.Struct:
-		enc.eStruct(key, rv)
-	default:
-		panic("eTable: unhandled reflect.Value Kind: " + rv.Kind().String())
-	}
-}
-
-func (enc *Encoder) eMap(key Key, rv reflect.Value) {
-	rt := rv.Type()
-	if rt.Key().Kind() != reflect.String {
-		encPanic(errNonString)
-	}
-
-	// Sort keys so that we have deterministic output. And write keys directly
-	// underneath this key first, before writing sub-structs or sub-maps.
-	var mapKeysDirect, mapKeysSub []string
-	for _, mapKey := range rv.MapKeys() {
-		k := mapKey.String()
-		if typeIsHash(tomlTypeOfGo(rv.MapIndex(mapKey))) {
-			mapKeysSub = append(mapKeysSub, k)
-		} else {
-			mapKeysDirect = append(mapKeysDirect, k)
-		}
-	}
-
-	var writeMapKeys = func(mapKeys []string) {
-		sort.Strings(mapKeys)
-		for _, mapKey := range mapKeys {
-			mrv := rv.MapIndex(reflect.ValueOf(mapKey))
-			if isNil(mrv) {
-				// Don't write anything for nil fields.
-				continue
-			}
-			enc.encode(key.add(mapKey), mrv)
-		}
-	}
-	writeMapKeys(mapKeysDirect)
-	writeMapKeys(mapKeysSub)
-}
-
-func (enc *Encoder) eStruct(key Key, rv reflect.Value) {
-	// Write keys for fields directly under this key first, because if we write
-	// a field that creates a new table, then all keys under it will be in that
-	// table (not the one we're writing here).
-	rt := rv.Type()
-	var fieldsDirect, fieldsSub [][]int
-	var addFields func(rt reflect.Type, rv reflect.Value, start []int)
-	addFields = func(rt reflect.Type, rv reflect.Value, start []int) {
-		for i := 0; i < rt.NumField(); i++ {
-			f := rt.Field(i)
-			// skip unexporded fields
-			if f.PkgPath != "" {
-				continue
-			}
-			frv := rv.Field(i)
-			if f.Anonymous {
-				frv := eindirect(frv)
-				t := frv.Type()
-				if t.Kind() != reflect.Struct {
-					encPanic(errAnonNonStruct)
-				}
-				addFields(t, frv, f.Index)
-			} else if typeIsHash(tomlTypeOfGo(frv)) {
-				fieldsSub = append(fieldsSub, append(start, f.Index...))
-			} else {
-				fieldsDirect = append(fieldsDirect, append(start, f.Index...))
-			}
-		}
-	}
-	addFields(rt, rv, nil)
-
-	var writeFields = func(fields [][]int) {
-		for _, fieldIndex := range fields {
-			sft := rt.FieldByIndex(fieldIndex)
-			sf := rv.FieldByIndex(fieldIndex)
-			if isNil(sf) {
-				// Don't write anything for nil fields.
-				continue
-			}
-
-			keyName := sft.Tag.Get("toml")
-			if keyName == "-" {
-				continue
-			}
-			if keyName == "" {
-				keyName = sft.Name
-			}
-
-			keyName, opts := getOptions(keyName)
-			if _, ok := opts["omitempty"]; ok && isEmpty(sf) {
-				continue
-			} else if _, ok := opts["omitzero"]; ok && isZero(sf) {
-				continue
-			}
-
-			enc.encode(key.add(keyName), sf)
-		}
-	}
-	writeFields(fieldsDirect)
-	writeFields(fieldsSub)
-}
-
-// tomlTypeName returns the TOML type name of the Go value's type. It is
-// used to determine whether the types of array elements are mixed (which is
-// forbidden). If the Go value is nil, then it is illegal for it to be an array
-// element, and valueIsNil is returned as true.
-
-// Returns the TOML type of a Go value. The type may be `nil`, which means
-// no concrete TOML type could be found.
-func tomlTypeOfGo(rv reflect.Value) tomlType {
-	if isNil(rv) || !rv.IsValid() {
-		return nil
-	}
-	switch rv.Kind() {
-	case reflect.Bool:
-		return tomlBool
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,
-		reflect.Int64,
-		reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32,
-		reflect.Uint64:
-		return tomlInteger
-	case reflect.Float32, reflect.Float64:
-		return tomlFloat
-	case reflect.Array, reflect.Slice:
-		if typeEqual(tomlHash, tomlArrayType(rv)) {
-			return tomlArrayHash
-		} else {
-			return tomlArray
-		}
-	case reflect.Ptr, reflect.Interface:
-		return tomlTypeOfGo(rv.Elem())
-	case reflect.String:
-		return tomlString
-	case reflect.Map:
-		return tomlHash
-	case reflect.Struct:
-		switch rv.Interface().(type) {
-		case time.Time:
-			return tomlDatetime
-		case TextMarshaler:
-			return tomlString
-		default:
-			return tomlHash
-		}
-	default:
-		panic("unexpected reflect.Kind: " + rv.Kind().String())
-	}
-}
-
-// tomlArrayType returns the element type of a TOML array. The type returned
-// may be nil if it cannot be determined (e.g., a nil slice or a zero length
-// slize). This function may also panic if it finds a type that cannot be
-// expressed in TOML (such as nil elements, heterogeneous arrays or directly
-// nested arrays of tables).
-func tomlArrayType(rv reflect.Value) tomlType {
-	if isNil(rv) || !rv.IsValid() || rv.Len() == 0 {
-		return nil
-	}
-	firstType := tomlTypeOfGo(rv.Index(0))
-	if firstType == nil {
-		encPanic(errArrayNilElement)
-	}
-
-	rvlen := rv.Len()
-	for i := 1; i < rvlen; i++ {
-		elem := rv.Index(i)
-		switch elemType := tomlTypeOfGo(elem); {
-		case elemType == nil:
-			encPanic(errArrayNilElement)
-		case !typeEqual(firstType, elemType):
-			encPanic(errArrayMixedElementTypes)
-		}
-	}
-	// If we have a nested array, then we must make sure that the nested
-	// array contains ONLY primitives.
-	// This checks arbitrarily nested arrays.
-	if typeEqual(firstType, tomlArray) || typeEqual(firstType, tomlArrayHash) {
-		nest := tomlArrayType(eindirect(rv.Index(0)))
-		if typeEqual(nest, tomlHash) || typeEqual(nest, tomlArrayHash) {
-			encPanic(errArrayNoTable)
-		}
-	}
-	return firstType
-}
-
-func getOptions(keyName string) (string, map[string]struct{}) {
-	opts := make(map[string]struct{})
-	ss := strings.Split(keyName, ",")
-	name := ss[0]
-	if len(ss) > 1 {
-		for _, opt := range ss {
-			opts[opt] = struct{}{}
-		}
-	}
-
-	return name, opts
-}
-
-func isZero(rv reflect.Value) bool {
-	switch rv.Kind() {
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		if rv.Int() == 0 {
-			return true
-		}
-	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
-		if rv.Uint() == 0 {
-			return true
-		}
-	case reflect.Float32, reflect.Float64:
-		if rv.Float() == 0.0 {
-			return true
-		}
-	}
-
-	return false
-}
-
-func isEmpty(rv reflect.Value) bool {
-	switch rv.Kind() {
-	case reflect.String:
-		if len(strings.TrimSpace(rv.String())) == 0 {
-			return true
-		}
-	case reflect.Array, reflect.Slice, reflect.Map:
-		if rv.Len() == 0 {
-			return true
-		}
-	}
-
-	return false
-}
-
-func (enc *Encoder) newline() {
-	if enc.hasWritten {
-		enc.wf("\n")
-	}
-}
-
-func (enc *Encoder) keyEqElement(key Key, val reflect.Value) {
-	if len(key) == 0 {
-		encPanic(errNoKey)
-	}
-	panicIfInvalidKey(key)
-	enc.wf("%s%s = ", enc.indentStr(key), key.maybeQuoted(len(key)-1))
-	enc.eElement(val)
-	enc.newline()
-}
-
-func (enc *Encoder) wf(format string, v ...interface{}) {
-	if _, err := fmt.Fprintf(enc.w, format, v...); err != nil {
-		encPanic(err)
-	}
-	enc.hasWritten = true
-}
-
-func (enc *Encoder) indentStr(key Key) string {
-	return strings.Repeat(enc.Indent, len(key)-1)
-}
-
-func encPanic(err error) {
-	panic(tomlEncodeError{err})
-}
-
-func eindirect(v reflect.Value) reflect.Value {
-	switch v.Kind() {
-	case reflect.Ptr, reflect.Interface:
-		return eindirect(v.Elem())
-	default:
-		return v
-	}
-}
-
-func isNil(rv reflect.Value) bool {
-	switch rv.Kind() {
-	case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
-		return rv.IsNil()
-	default:
-		return false
-	}
-}
-
-func panicIfInvalidKey(key Key) {
-	for _, k := range key {
-		if len(k) == 0 {
-			encPanic(e("Key '%s' is not a valid table name. Key names "+
-				"cannot be empty.", key.maybeQuotedAll()))
-		}
-	}
-}
-
-func isValidKeyName(s string) bool {
-	return len(s) != 0
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/encode_test.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/encode_test.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/encode_test.go
deleted file mode 100644
index 445ca8e..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/encode_test.go
+++ /dev/null
@@ -1,542 +0,0 @@
-package toml
-
-import (
-	"bytes"
-	"fmt"
-	"log"
-	"net"
-	"testing"
-	"time"
-)
-
-func TestEncodeRoundTrip(t *testing.T) {
-	type Config struct {
-		Age        int
-		Cats       []string
-		Pi         float64
-		Perfection []int
-		DOB        time.Time
-		Ipaddress  net.IP
-	}
-
-	var inputs = Config{
-		13,
-		[]string{"one", "two", "three"},
-		3.145,
-		[]int{11, 2, 3, 4},
-		time.Now(),
-		net.ParseIP("192.168.59.254"),
-	}
-
-	var firstBuffer bytes.Buffer
-	e := NewEncoder(&firstBuffer)
-	err := e.Encode(inputs)
-	if err != nil {
-		t.Fatal(err)
-	}
-	var outputs Config
-	if _, err := Decode(firstBuffer.String(), &outputs); err != nil {
-		log.Printf("Could not decode:\n-----\n%s\n-----\n",
-			firstBuffer.String())
-		t.Fatal(err)
-	}
-
-	// could test each value individually, but I'm lazy
-	var secondBuffer bytes.Buffer
-	e2 := NewEncoder(&secondBuffer)
-	err = e2.Encode(outputs)
-	if err != nil {
-		t.Fatal(err)
-	}
-	if firstBuffer.String() != secondBuffer.String() {
-		t.Error(
-			firstBuffer.String(),
-			"\n\n is not identical to\n\n",
-			secondBuffer.String())
-	}
-}
-
-// XXX(burntsushi)
-// I think these tests probably should be removed. They are good, but they
-// ought to be obsolete by toml-test.
-func TestEncode(t *testing.T) {
-	type Embedded struct {
-		Int int `toml:"_int"`
-	}
-	type NonStruct int
-
-	date := time.Date(2014, 5, 11, 20, 30, 40, 0, time.FixedZone("IST", 3600))
-	dateStr := "2014-05-11T19:30:40Z"
-
-	tests := map[string]struct {
-		input      interface{}
-		wantOutput string
-		wantError  error
-	}{
-		"bool field": {
-			input: struct {
-				BoolTrue  bool
-				BoolFalse bool
-			}{true, false},
-			wantOutput: "BoolTrue = true\nBoolFalse = false\n",
-		},
-		"int fields": {
-			input: struct {
-				Int   int
-				Int8  int8
-				Int16 int16
-				Int32 int32
-				Int64 int64
-			}{1, 2, 3, 4, 5},
-			wantOutput: "Int = 1\nInt8 = 2\nInt16 = 3\nInt32 = 4\nInt64 = 5\n",
-		},
-		"uint fields": {
-			input: struct {
-				Uint   uint
-				Uint8  uint8
-				Uint16 uint16
-				Uint32 uint32
-				Uint64 uint64
-			}{1, 2, 3, 4, 5},
-			wantOutput: "Uint = 1\nUint8 = 2\nUint16 = 3\nUint32 = 4" +
-				"\nUint64 = 5\n",
-		},
-		"float fields": {
-			input: struct {
-				Float32 float32
-				Float64 float64
-			}{1.5, 2.5},
-			wantOutput: "Float32 = 1.5\nFloat64 = 2.5\n",
-		},
-		"string field": {
-			input:      struct{ String string }{"foo"},
-			wantOutput: "String = \"foo\"\n",
-		},
-		"string field and unexported field": {
-			input: struct {
-				String     string
-				unexported int
-			}{"foo", 0},
-			wantOutput: "String = \"foo\"\n",
-		},
-		"datetime field in UTC": {
-			input:      struct{ Date time.Time }{date},
-			wantOutput: fmt.Sprintf("Date = %s\n", dateStr),
-		},
-		"datetime field as primitive": {
-			// Using a map here to fail if isStructOrMap() returns true for
-			// time.Time.
-			input: map[string]interface{}{
-				"Date": date,
-				"Int":  1,
-			},
-			wantOutput: fmt.Sprintf("Date = %s\nInt = 1\n", dateStr),
-		},
-		"array fields": {
-			input: struct {
-				IntArray0 [0]int
-				IntArray3 [3]int
-			}{[0]int{}, [3]int{1, 2, 3}},
-			wantOutput: "IntArray0 = []\nIntArray3 = [1, 2, 3]\n",
-		},
-		"slice fields": {
-			input: struct{ IntSliceNil, IntSlice0, IntSlice3 []int }{
-				nil, []int{}, []int{1, 2, 3},
-			},
-			wantOutput: "IntSlice0 = []\nIntSlice3 = [1, 2, 3]\n",
-		},
-		"datetime slices": {
-			input: struct{ DatetimeSlice []time.Time }{
-				[]time.Time{date, date},
-			},
-			wantOutput: fmt.Sprintf("DatetimeSlice = [%s, %s]\n",
-				dateStr, dateStr),
-		},
-		"nested arrays and slices": {
-			input: struct {
-				SliceOfArrays         [][2]int
-				ArrayOfSlices         [2][]int
-				SliceOfArraysOfSlices [][2][]int
-				ArrayOfSlicesOfArrays [2][][2]int
-				SliceOfMixedArrays    [][2]interface{}
-				ArrayOfMixedSlices    [2][]interface{}
-			}{
-				[][2]int{{1, 2}, {3, 4}},
-				[2][]int{{1, 2}, {3, 4}},
-				[][2][]int{
-					{
-						{1, 2}, {3, 4},
-					},
-					{
-						{5, 6}, {7, 8},
-					},
-				},
-				[2][][2]int{
-					{
-						{1, 2}, {3, 4},
-					},
-					{
-						{5, 6}, {7, 8},
-					},
-				},
-				[][2]interface{}{
-					{1, 2}, {"a", "b"},
-				},
-				[2][]interface{}{
-					{1, 2}, {"a", "b"},
-				},
-			},
-			wantOutput: `SliceOfArrays = [[1, 2], [3, 4]]
-ArrayOfSlices = [[1, 2], [3, 4]]
-SliceOfArraysOfSlices = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
-ArrayOfSlicesOfArrays = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
-SliceOfMixedArrays = [[1, 2], ["a", "b"]]
-ArrayOfMixedSlices = [[1, 2], ["a", "b"]]
-`,
-		},
-		"empty slice": {
-			input:      struct{ Empty []interface{} }{[]interface{}{}},
-			wantOutput: "Empty = []\n",
-		},
-		"(error) slice with element type mismatch (string and integer)": {
-			input:     struct{ Mixed []interface{} }{[]interface{}{1, "a"}},
-			wantError: errArrayMixedElementTypes,
-		},
-		"(error) slice with element type mismatch (integer and float)": {
-			input:     struct{ Mixed []interface{} }{[]interface{}{1, 2.5}},
-			wantError: errArrayMixedElementTypes,
-		},
-		"slice with elems of differing Go types, same TOML types": {
-			input: struct {
-				MixedInts   []interface{}
-				MixedFloats []interface{}
-			}{
-				[]interface{}{
-					int(1), int8(2), int16(3), int32(4), int64(5),
-					uint(1), uint8(2), uint16(3), uint32(4), uint64(5),
-				},
-				[]interface{}{float32(1.5), float64(2.5)},
-			},
-			wantOutput: "MixedInts = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]\n" +
-				"MixedFloats = [1.5, 2.5]\n",
-		},
-		"(error) slice w/ element type mismatch (one is nested array)": {
-			input: struct{ Mixed []interface{} }{
-				[]interface{}{1, []interface{}{2}},
-			},
-			wantError: errArrayMixedElementTypes,
-		},
-		"(error) slice with 1 nil element": {
-			input:     struct{ NilElement1 []interface{} }{[]interface{}{nil}},
-			wantError: errArrayNilElement,
-		},
-		"(error) slice with 1 nil element (and other non-nil elements)": {
-			input: struct{ NilElement []interface{} }{
-				[]interface{}{1, nil},
-			},
-			wantError: errArrayNilElement,
-		},
-		"simple map": {
-			input:      map[string]int{"a": 1, "b": 2},
-			wantOutput: "a = 1\nb = 2\n",
-		},
-		"map with interface{} value type": {
-			input:      map[string]interface{}{"a": 1, "b": "c"},
-			wantOutput: "a = 1\nb = \"c\"\n",
-		},
-		"map with interface{} value type, some of which are structs": {
-			input: map[string]interface{}{
-				"a": struct{ Int int }{2},
-				"b": 1,
-			},
-			wantOutput: "b = 1\n\n[a]\n  Int = 2\n",
-		},
-		"nested map": {
-			input: map[string]map[string]int{
-				"a": {"b": 1},
-				"c": {"d": 2},
-			},
-			wantOutput: "[a]\n  b = 1\n\n[c]\n  d = 2\n",
-		},
-		"nested struct": {
-			input: struct{ Struct struct{ Int int } }{
-				struct{ Int int }{1},
-			},
-			wantOutput: "[Struct]\n  Int = 1\n",
-		},
-		"nested struct and non-struct field": {
-			input: struct {
-				Struct struct{ Int int }
-				Bool   bool
-			}{struct{ Int int }{1}, true},
-			wantOutput: "Bool = true\n\n[Struct]\n  Int = 1\n",
-		},
-		"2 nested structs": {
-			input: struct{ Struct1, Struct2 struct{ Int int } }{
-				struct{ Int int }{1}, struct{ Int int }{2},
-			},
-			wantOutput: "[Struct1]\n  Int = 1\n\n[Struct2]\n  Int = 2\n",
-		},
-		"deeply nested structs": {
-			input: struct {
-				Struct1, Struct2 struct{ Struct3 *struct{ Int int } }
-			}{
-				struct{ Struct3 *struct{ Int int } }{&struct{ Int int }{1}},
-				struct{ Struct3 *struct{ Int int } }{nil},
-			},
-			wantOutput: "[Struct1]\n  [Struct1.Struct3]\n    Int = 1" +
-				"\n\n[Struct2]\n",
-		},
-		"nested struct with nil struct elem": {
-			input: struct {
-				Struct struct{ Inner *struct{ Int int } }
-			}{
-				struct{ Inner *struct{ Int int } }{nil},
-			},
-			wantOutput: "[Struct]\n",
-		},
-		"nested struct with no fields": {
-			input: struct {
-				Struct struct{ Inner struct{} }
-			}{
-				struct{ Inner struct{} }{struct{}{}},
-			},
-			wantOutput: "[Struct]\n  [Struct.Inner]\n",
-		},
-		"struct with tags": {
-			input: struct {
-				Struct struct {
-					Int int `toml:"_int"`
-				} `toml:"_struct"`
-				Bool bool `toml:"_bool"`
-			}{
-				struct {
-					Int int `toml:"_int"`
-				}{1}, true,
-			},
-			wantOutput: "_bool = true\n\n[_struct]\n  _int = 1\n",
-		},
-		"embedded struct": {
-			input:      struct{ Embedded }{Embedded{1}},
-			wantOutput: "_int = 1\n",
-		},
-		"embedded *struct": {
-			input:      struct{ *Embedded }{&Embedded{1}},
-			wantOutput: "_int = 1\n",
-		},
-		"nested embedded struct": {
-			input: struct {
-				Struct struct{ Embedded } `toml:"_struct"`
-			}{struct{ Embedded }{Embedded{1}}},
-			wantOutput: "[_struct]\n  _int = 1\n",
-		},
-		"nested embedded *struct": {
-			input: struct {
-				Struct struct{ *Embedded } `toml:"_struct"`
-			}{struct{ *Embedded }{&Embedded{1}}},
-			wantOutput: "[_struct]\n  _int = 1\n",
-		},
-		"array of tables": {
-			input: struct {
-				Structs []*struct{ Int int } `toml:"struct"`
-			}{
-				[]*struct{ Int int }{{1}, {3}},
-			},
-			wantOutput: "[[struct]]\n  Int = 1\n\n[[struct]]\n  Int = 3\n",
-		},
-		"array of tables order": {
-			input: map[string]interface{}{
-				"map": map[string]interface{}{
-					"zero": 5,
-					"arr": []map[string]int{
-						map[string]int{
-							"friend": 5,
-						},
-					},
-				},
-			},
-			wantOutput: "[map]\n  zero = 5\n\n  [[map.arr]]\n    friend = 5\n",
-		},
-		"(error) top-level slice": {
-			input:     []struct{ Int int }{{1}, {2}, {3}},
-			wantError: errNoKey,
-		},
-		"(error) slice of slice": {
-			input: struct {
-				Slices [][]struct{ Int int }
-			}{
-				[][]struct{ Int int }{{{1}}, {{2}}, {{3}}},
-			},
-			wantError: errArrayNoTable,
-		},
-		"(error) map no string key": {
-			input:     map[int]string{1: ""},
-			wantError: errNonString,
-		},
-		"(error) anonymous non-struct": {
-			input:     struct{ NonStruct }{5},
-			wantError: errAnonNonStruct,
-		},
-		"(error) empty key name": {
-			input:     map[string]int{"": 1},
-			wantError: errAnything,
-		},
-		"(error) empty map name": {
-			input: map[string]interface{}{
-				"": map[string]int{"v": 1},
-			},
-			wantError: errAnything,
-		},
-	}
-	for label, test := range tests {
-		encodeExpected(t, label, test.input, test.wantOutput, test.wantError)
-	}
-}
-
-func TestEncodeNestedTableArrays(t *testing.T) {
-	type song struct {
-		Name string `toml:"name"`
-	}
-	type album struct {
-		Name  string `toml:"name"`
-		Songs []song `toml:"songs"`
-	}
-	type springsteen struct {
-		Albums []album `toml:"albums"`
-	}
-	value := springsteen{
-		[]album{
-			{"Born to Run",
-				[]song{{"Jungleland"}, {"Meeting Across the River"}}},
-			{"Born in the USA",
-				[]song{{"Glory Days"}, {"Dancing in the Dark"}}},
-		},
-	}
-	expected := `[[albums]]
-  name = "Born to Run"
-
-  [[albums.songs]]
-    name = "Jungleland"
-
-  [[albums.songs]]
-    name = "Meeting Across the River"
-
-[[albums]]
-  name = "Born in the USA"
-
-  [[albums.songs]]
-    name = "Glory Days"
-
-  [[albums.songs]]
-    name = "Dancing in the Dark"
-`
-	encodeExpected(t, "nested table arrays", value, expected, nil)
-}
-
-func TestEncodeArrayHashWithNormalHashOrder(t *testing.T) {
-	type Alpha struct {
-		V int
-	}
-	type Beta struct {
-		V int
-	}
-	type Conf struct {
-		V int
-		A Alpha
-		B []Beta
-	}
-
-	val := Conf{
-		V: 1,
-		A: Alpha{2},
-		B: []Beta{{3}},
-	}
-	expected := "V = 1\n\n[A]\n  V = 2\n\n[[B]]\n  V = 3\n"
-	encodeExpected(t, "array hash with normal hash order", val, expected, nil)
-}
-
-func TestEncodeWithOmitEmpty(t *testing.T) {
-	type simple struct {
-		User string `toml:"user"`
-		Pass string `toml:"password,omitempty"`
-	}
-
-	value := simple{"Testing", ""}
-	expected := fmt.Sprintf("user = %q\n", value.User)
-	encodeExpected(t, "simple with omitempty, is empty", value, expected, nil)
-	value.Pass = "some password"
-	expected = fmt.Sprintf("user = %q\npassword = %q\n", value.User, value.Pass)
-	encodeExpected(t, "simple with omitempty, not empty", value, expected, nil)
-}
-
-func TestEncodeWithOmitZero(t *testing.T) {
-	type simple struct {
-		Number   int     `toml:"number,omitzero"`
-		Real     float64 `toml:"real,omitzero"`
-		Unsigned uint    `toml:"unsigned,omitzero"`
-	}
-
-	value := simple{0, 0.0, uint(0)}
-	expected := ""
-
-	encodeExpected(t, "simple with omitzero, all zero", value, expected, nil)
-
-	value.Number = 10
-	value.Real = 20
-	value.Unsigned = 5
-	expected = `number = 10
-real = 20.0
-unsigned = 5
-`
-	encodeExpected(t, "simple with omitzero, non-zero", value, expected, nil)
-}
-
-func encodeExpected(
-	t *testing.T, label string, val interface{}, wantStr string, wantErr error,
-) {
-	var buf bytes.Buffer
-	enc := NewEncoder(&buf)
-	err := enc.Encode(val)
-	if err != wantErr {
-		if wantErr != nil {
-			if wantErr == errAnything && err != nil {
-				return
-			}
-			t.Errorf("%s: want Encode error %v, got %v", label, wantErr, err)
-		} else {
-			t.Errorf("%s: Encode failed: %s", label, err)
-		}
-	}
-	if err != nil {
-		return
-	}
-	if got := buf.String(); wantStr != got {
-		t.Errorf("%s: want\n-----\n%q\n-----\nbut got\n-----\n%q\n-----\n",
-			label, wantStr, got)
-	}
-}
-
-func ExampleEncoder_Encode() {
-	date, _ := time.Parse(time.RFC822, "14 Mar 10 18:00 UTC")
-	var config = map[string]interface{}{
-		"date":   date,
-		"counts": []int{1, 1, 2, 3, 5, 8},
-		"hash": map[string]string{
-			"key1": "val1",
-			"key2": "val2",
-		},
-	}
-	buf := new(bytes.Buffer)
-	if err := NewEncoder(buf).Encode(config); err != nil {
-		log.Fatal(err)
-	}
-	fmt.Println(buf.String())
-
-	// Output:
-	// counts = [1, 1, 2, 3, 5, 8]
-	// date = 2010-03-14T18:00:00Z
-	//
-	// [hash]
-	//   key1 = "val1"
-	//   key2 = "val2"
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types.go
deleted file mode 100644
index d36e1dd..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// +build go1.2
-
-package toml
-
-// In order to support Go 1.1, we define our own TextMarshaler and
-// TextUnmarshaler types. For Go 1.2+, we just alias them with the
-// standard library interfaces.
-
-import (
-	"encoding"
-)
-
-// TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here
-// so that Go 1.1 can be supported.
-type TextMarshaler encoding.TextMarshaler
-
-// TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined
-// here so that Go 1.1 can be supported.
-type TextUnmarshaler encoding.TextUnmarshaler

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types_1.1.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types_1.1.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types_1.1.go
deleted file mode 100644
index e8d503d..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/encoding_types_1.1.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// +build !go1.2
-
-package toml
-
-// These interfaces were introduced in Go 1.2, so we add them manually when
-// compiling for Go 1.1.
-
-// TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here
-// so that Go 1.1 can be supported.
-type TextMarshaler interface {
-	MarshalText() (text []byte, err error)
-}
-
-// TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined
-// here so that Go 1.1 can be supported.
-type TextUnmarshaler interface {
-	UnmarshalText(text []byte) error
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go
----------------------------------------------------------------------
diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go
deleted file mode 100644
index 2191228..0000000
--- a/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go
+++ /dev/null
@@ -1,874 +0,0 @@
-package toml
-
-import (
-	"fmt"
-	"strings"
-	"unicode/utf8"
-)
-
-type itemType int
-
-const (
-	itemError itemType = iota
-	itemNIL            // used in the parser to indicate no type
-	itemEOF
-	itemText
-	itemString
-	itemRawString
-	itemMultilineString
-	itemRawMultilineString
-	itemBool
-	itemInteger
-	itemFloat
-	itemDatetime
-	itemArray // the start of an array
-	itemArrayEnd
-	itemTableStart
-	itemTableEnd
-	itemArrayTableStart
-	itemArrayTableEnd
-	itemKeyStart
-	itemCommentStart
-)
-
-const (
-	eof             = 0
-	tableStart      = '['
-	tableEnd        = ']'
-	arrayTableStart = '['
-	arrayTableEnd   = ']'
-	tableSep        = '.'
-	keySep          = '='
-	arrayStart      = '['
-	arrayEnd        = ']'
-	arrayValTerm    = ','
-	commentStart    = '#'
-	stringStart     = '"'
-	stringEnd       = '"'
-	rawStringStart  = '\''
-	rawStringEnd    = '\''
-)
-
-type stateFn func(lx *lexer) stateFn
-
-type lexer struct {
-	input string
-	start int
-	pos   int
-	width int
-	line  int
-	state stateFn
-	items chan item
-
-	// A stack of state functions used to maintain context.
-	// The idea is to reuse parts of the state machine in various places.
-	// For example, values can appear at the top level or within arbitrarily
-	// nested arrays. The last state on the stack is used after a value has
-	// been lexed. Similarly for comments.
-	stack []stateFn
-}
-
-type item struct {
-	typ  itemType
-	val  string
-	line int
-}
-
-func (lx *lexer) nextItem() item {
-	for {
-		select {
-		case item := <-lx.items:
-			return item
-		default:
-			lx.state = lx.state(lx)
-		}
-	}
-}
-
-func lex(input string) *lexer {
-	lx := &lexer{
-		input: input + "\n",
-		state: lexTop,
-		line:  1,
-		items: make(chan item, 10),
-		stack: make([]stateFn, 0, 10),
-	}
-	return lx
-}
-
-func (lx *lexer) push(state stateFn) {
-	lx.stack = append(lx.stack, state)
-}
-
-func (lx *lexer) pop() stateFn {
-	if len(lx.stack) == 0 {
-		return lx.errorf("BUG in lexer: no states to pop.")
-	}
-	last := lx.stack[len(lx.stack)-1]
-	lx.stack = lx.stack[0 : len(lx.stack)-1]
-	return last
-}
-
-func (lx *lexer) current() string {
-	return lx.input[lx.start:lx.pos]
-}
-
-func (lx *lexer) emit(typ itemType) {
-	lx.items <- item{typ, lx.current(), lx.line}
-	lx.start = lx.pos
-}
-
-func (lx *lexer) emitTrim(typ itemType) {
-	lx.items <- item{typ, strings.TrimSpace(lx.current()), lx.line}
-	lx.start = lx.pos
-}
-
-func (lx *lexer) next() (r rune) {
-	if lx.pos >= len(lx.input) {
-		lx.width = 0
-		return eof
-	}
-
-	if lx.input[lx.pos] == '\n' {
-		lx.line++
-	}
-	r, lx.width = utf8.DecodeRuneInString(lx.input[lx.pos:])
-	lx.pos += lx.width
-	return r
-}
-
-// ignore skips over the pending input before this point.
-func (lx *lexer) ignore() {
-	lx.start = lx.pos
-}
-
-// backup steps back one rune. Can be called only once per call of next.
-func (lx *lexer) backup() {
-	lx.pos -= lx.width
-	if lx.pos < len(lx.input) && lx.input[lx.pos] == '\n' {
-		lx.line--
-	}
-}
-
-// accept consumes the next rune if it's equal to `valid`.
-func (lx *lexer) accept(valid rune) bool {
-	if lx.next() == valid {
-		return true
-	}
-	lx.backup()
-	return false
-}
-
-// peek returns but does not consume the next rune in the input.
-func (lx *lexer) peek() rune {
-	r := lx.next()
-	lx.backup()
-	return r
-}
-
-// errorf stops all lexing by emitting an error and returning `nil`.
-// Note that any value that is a character is escaped if it's a special
-// character (new lines, tabs, etc.).
-func (lx *lexer) errorf(format string, values ...interface{}) stateFn {
-	lx.items <- item{
-		itemError,
-		fmt.Sprintf(format, values...),
-		lx.line,
-	}
-	return nil
-}
-
-// lexTop consumes elements at the top level of TOML data.
-func lexTop(lx *lexer) stateFn {
-	r := lx.next()
-	if isWhitespace(r) || isNL(r) {
-		return lexSkip(lx, lexTop)
-	}
-
-	switch r {
-	case commentStart:
-		lx.push(lexTop)
-		return lexCommentStart
-	case tableStart:
-		return lexTableStart
-	case eof:
-		if lx.pos > lx.start {
-			return lx.errorf("Unexpected EOF.")
-		}
-		lx.emit(itemEOF)
-		return nil
-	}
-
-	// At this point, the only valid item can be a key, so we back up
-	// and let the key lexer do the rest.
-	lx.backup()
-	lx.push(lexTopEnd)
-	return lexKeyStart
-}
-
-// lexTopEnd is entered whenever a top-level item has been consumed. (A value
-// or a table.) It must see only whitespace, and will turn back to lexTop
-// upon a new line. If it sees EOF, it will quit the lexer successfully.
-func lexTopEnd(lx *lexer) stateFn {
-	r := lx.next()
-	switch {
-	case r == commentStart:
-		// a comment will read to a new line for us.
-		lx.push(lexTop)
-		return lexCommentStart
-	case isWhitespace(r):
-		return lexTopEnd
-	case isNL(r):
-		lx.ignore()
-		return lexTop
-	case r == eof:
-		lx.ignore()
-		return lexTop
-	}
-	return lx.errorf("Expected a top-level item to end with a new line, "+
-		"comment or EOF, but got %q instead.", r)
-}
-
-// lexTable lexes the beginning of a table. Namely, it makes sure that
-// it starts with a character other than '.' and ']'.
-// It assumes that '[' has already been consumed.
-// It also handles the case that this is an item in an array of tables.
-// e.g., '[[name]]'.
-func lexTableStart(lx *lexer) stateFn {
-	if lx.peek() == arrayTableStart {
-		lx.next()
-		lx.emit(itemArrayTableStart)
-		lx.push(lexArrayTableEnd)
-	} else {
-		lx.emit(itemTableStart)
-		lx.push(lexTableEnd)
-	}
-	return lexTableNameStart
-}
-
-func lexTableEnd(lx *lexer) stateFn {
-	lx.emit(itemTableEnd)
-	return lexTopEnd
-}
-
-func lexArrayTableEnd(lx *lexer) stateFn {
-	if r := lx.next(); r != arrayTableEnd {
-		return lx.errorf("Expected end of table array name delimiter %q, "+
-			"but got %q instead.", arrayTableEnd, r)
-	}
-	lx.emit(itemArrayTableEnd)
-	return lexTopEnd
-}
-
-func lexTableNameStart(lx *lexer) stateFn {
-	switch r := lx.peek(); {
-	case r == tableEnd || r == eof:
-		return lx.errorf("Unexpected end of table name. (Table names cannot " +
-			"be empty.)")
-	case r == tableSep:
-		return lx.errorf("Unexpected table separator. (Table names cannot " +
-			"be empty.)")
-	case r == stringStart || r == rawStringStart:
-		lx.ignore()
-		lx.push(lexTableNameEnd)
-		return lexValue // reuse string lexing
-	case isWhitespace(r):
-		return lexTableNameStart
-	default:
-		return lexBareTableName
-	}
-}
-
-// lexTableName lexes the name of a table. It assumes that at least one
-// valid character for the table has already been read.
-func lexBareTableName(lx *lexer) stateFn {
-	switch r := lx.next(); {
-	case isBareKeyChar(r):
-		return lexBareTableName
-	case r == tableSep || r == tableEnd:
-		lx.backup()
-		lx.emitTrim(itemText)
-		return lexTableNameEnd
-	default:
-		return lx.errorf("Bare keys cannot contain %q.", r)
-	}
-}
-
-// lexTableNameEnd reads the end of a piece of a table name, optionally
-// consuming whitespace.
-func lexTableNameEnd(lx *lexer) stateFn {
-	switch r := lx.next(); {
-	case isWhitespace(r):
-		return lexTableNameEnd
-	case r == tableSep:
-		lx.ignore()
-		return lexTableNameStart
-	case r == tableEnd:
-		return lx.pop()
-	default:
-		return lx.errorf("Expected '.' or ']' to end table name, but got %q "+
-			"instead.", r)
-	}
-}
-
-// lexKeyStart consumes a key name up until the first non-whitespace character.
-// lexKeyStart will ignore whitespace.
-func lexKeyStart(lx *lexer) stateFn {
-	r := lx.peek()
-	switch {
-	case r == keySep:
-		return lx.errorf("Unexpected key separator %q.", keySep)
-	case isWhitespace(r) || isNL(r):
-		lx.next()
-		return lexSkip(lx, lexKeyStart)
-	case r == stringStart || r == rawStringStart:
-		lx.ignore()
-		lx.emit(itemKeyStart)
-		lx.push(lexKeyEnd)
-		return lexValue // reuse string lexing
-	default:
-		lx.ignore()
-		lx.emit(itemKeyStart)
-		return lexBareKey
-	}
-}
-
-// lexBareKey consumes the text of a bare key. Assumes that the first character
-// (which is not whitespace) has not yet been consumed.
-func lexBareKey(lx *lexer) stateFn {
-	switch r := lx.next(); {
-	case isBareKeyChar(r):
-		return lexBareKey
-	case isWhitespace(r):
-		lx.emitTrim(itemText)
-		return lexKeyEnd
-	case r == keySep:
-		lx.backup()
-		lx.emitTrim(itemText)
-		return lexKeyEnd
-	default:
-		return lx.errorf("Bare keys cannot contain %q.", r)
-	}
-}
-
-// lexKeyEnd consumes the end of a key and trims whitespace (up to the key
-// separator).
-func lexKeyEnd(lx *lexer) stateFn {
-	switch r := lx.next(); {
-	case r == keySep:
-		return lexSkip(lx, lexValue)
-	case isWhitespace(r):
-		return lexSkip(lx, lexKeyEnd)
-	default:
-		return lx.errorf("Expected key separator %q, but got %q instead.",
-			keySep, r)
-	}
-}
-
-// lexValue starts the consumption of a value anywhere a value is expected.
-// lexValue will ignore whitespace.
-// After a value is lexed, the last state on the next is popped and returned.
-func lexValue(lx *lexer) stateFn {
-	// We allow whitespace to precede a value, but NOT new lines.
-	// In array syntax, the array states are responsible for ignoring new
-	// lines.
-	r := lx.next()
-	if isWhitespace(r) {
-		return lexSkip(lx, lexValue)
-	}
-
-	switch {
-	case r == arrayStart:
-		lx.ignore()
-		lx.emit(itemArray)
-		return lexArrayValue
-	case r == stringStart:
-		if lx.accept(stringStart) {
-			if lx.accept(stringStart) {
-				lx.ignore() // Ignore """
-				return lexMultilineString
-			}
-			lx.backup()
-		}
-		lx.ignore() // ignore the '"'
-		return lexString
-	case r == rawStringStart:
-		if lx.accept(rawStringStart) {
-			if lx.accept(rawStringStart) {
-				lx.ignore() // Ignore """
-				return lexMultilineRawString
-			}
-			lx.backup()
-		}
-		lx.ignore() // ignore the "'"
-		return lexRawString
-	case r == 't':
-		return lexTrue
-	case r == 'f':
-		return lexFalse
-	case r == '-':
-		return lexNumberStart
-	case isDigit(r):
-		lx.backup() // avoid an extra state and use the same as above
-		return lexNumberOrDateStart
-	case r == '.': // special error case, be kind to users
-		return lx.errorf("Floats must start with a digit, not '.'.")
-	}
-	return lx.errorf("Expected value but found %q instead.", r)
-}
-
-// lexArrayValue consumes one value in an array. It assumes that '[' or ','
-// have already been consumed. All whitespace and new lines are ignored.
-func lexArrayValue(lx *lexer) stateFn {
-	r := lx.next()
-	switch {
-	case isWhitespace(r) || isNL(r):
-		return lexSkip(lx, lexArrayValue)
-	case r == commentStart:
-		lx.push(lexArrayValue)
-		return lexCommentStart
-	case r == arrayValTerm:
-		return lx.errorf("Unexpected array value terminator %q.",
-			arrayValTerm)
-	case r == arrayEnd:
-		return lexArrayEnd
-	}
-
-	lx.backup()
-	lx.push(lexArrayValueEnd)
-	return lexValue
-}
-
-// lexArrayValueEnd consumes the cruft between values of an array. Namely,
-// it ignores whitespace and expects either a ',' or a ']'.
-func lexArrayValueEnd(lx *lexer) stateFn {
-	r := lx.next()
-	switch {
-	case isWhitespace(r) || isNL(r):
-		return lexSkip(lx, lexArrayValueEnd)
-	case r == commentStart:
-		lx.push(lexArrayValueEnd)
-		return lexCommentStart
-	case r == arrayValTerm:
-		lx.ignore()
-		return lexArrayValue // move on to the next value
-	case r == arrayEnd:
-		return lexArrayEnd
-	}
-	return lx.errorf("Expected an array value terminator %q or an array "+
-		"terminator %q, but got %q instead.", arrayValTerm, arrayEnd, r)
-}
-
-// lexArrayEnd finishes the lexing of an array. It assumes that a ']' has
-// just been consumed.
-func lexArrayEnd(lx *lexer) stateFn {
-	lx.ignore()
-	lx.emit(itemArrayEnd)
-	return lx.pop()
-}
-
-// lexString consumes the inner contents of a string. It assumes that the
-// beginning '"' has already been consumed and ignored.
-func lexString(lx *lexer) stateFn {
-	r := lx.next()
-	switch {
-	case isNL(r):
-		return lx.errorf("Strings cannot contain new lines.")
-	case r == '\\':
-		lx.push(lexString)
-		return lexStringEscape
-	case r == stringEnd:
-		lx.backup()
-		lx.emit(itemString)
-		lx.next()
-		lx.ignore()
-		return lx.pop()
-	}
-	return lexString
-}
-
-// lexMultilineString consumes the inner contents of a string. It assumes that
-// the beginning '"""' has already been consumed and ignored.
-func lexMultilineString(lx *lexer) stateFn {
-	r := lx.next()
-	switch {
-	case r == '\\':
-		return lexMultilineStringEscape
-	case r == stringEnd:
-		if lx.accept(stringEnd) {
-			if lx.accept(stringEnd) {
-				lx.backup()
-				lx.backup()
-				lx.backup()
-				lx.emit(itemMultilineString)
-				lx.next()
-				lx.next()
-				lx.next()
-				lx.ignore()
-				return lx.pop()
-			}
-			lx.backup()
-		}
-	}
-	return lexMultilineString
-}
-
-// lexRawString consumes a raw string. Nothing can be escaped in such a string.
-// It assumes that the beginning "'" has already been consumed and ignored.
-func lexRawString(lx *lexer) stateFn {
-	r := lx.next()
-	switch {
-	case isNL(r):
-		return lx.errorf("Strings cannot contain new lines.")
-	case r == rawStringEnd:
-		lx.backup()
-		lx.emit(itemRawString)
-		lx.next()
-		lx.ignore()
-		return lx.pop()
-	}
-	return lexRawString
-}
-
-// lexMultilineRawString consumes a raw string. Nothing can be escaped in such
-// a string. It assumes that the beginning "'" has already been consumed and
-// ignored.
-func lexMultilineRawString(lx *lexer) stateFn {
-	r := lx.next()
-	switch {
-	case r == rawStringEnd:
-		if lx.accept(rawStringEnd) {
-			if lx.accept(rawStringEnd) {
-				lx.backup()
-				lx.backup()
-				lx.backup()
-				lx.emit(itemRawMultilineString)
-				lx.next()
-				lx.next()
-				lx.next()
-				lx.ignore()
-				return lx.pop()
-			}
-			lx.backup()
-		}
-	}
-	return lexMultilineRawString
-}
-
-// lexMultilineStringEscape consumes an escaped character. It assumes that the
-// preceding '\\' has already been consumed.
-func lexMultilineStringEscape(lx *lexer) stateFn {
-	// Handle the special case first:
-	if isNL(lx.next()) {
-		lx.next()
-		return lexMultilineString
-	} else {
-		lx.backup()
-		lx.push(lexMultilineString)
-		return lexStringEscape(lx)
-	}
-}
-
-func lexStringEscape(lx *lexer) stateFn {
-	r := lx.next()
-	switch r {
-	case 'b':
-		fallthrough
-	case 't':
-		fallthrough
-	case 'n':
-		fallthrough
-	case 'f':
-		fallthrough
-	case 'r':
-		fallthrough
-	case '"':
-		fallthrough
-	case '\\':
-		return lx.pop()
-	case 'u':
-		return lexShortUnicodeEscape
-	case 'U':
-		return lexLongUnicodeEscape
-	}
-	return lx.errorf("Invalid escape character %q. Only the following "+
-		"escape characters are allowed: "+
-		"\\b, \\t, \\n, \\f, \\r, \\\", \\/, \\\\, "+
-		"\\uXXXX and \\UXXXXXXXX.", r)
-}
-
-func lexShortUnicodeEscape(lx *lexer) stateFn {
-	var r rune
-	for i := 0; i < 4; i++ {
-		r = lx.next()
-		if !isHexadecimal(r) {
-			return lx.errorf("Expected four hexadecimal digits after '\\u', "+
-				"but got '%s' instead.", lx.current())
-		}
-	}
-	return lx.pop()
-}
-
-func lexLongUnicodeEscape(lx *lexer) stateFn {
-	var r rune
-	for i := 0; i < 8; i++ {
-		r = lx.next()
-		if !isHexadecimal(r) {
-			return lx.errorf("Expected eight hexadecimal digits after '\\U', "+
-				"but got '%s' instead.", lx.current())
-		}
-	}
-	return lx.pop()
-}
-
-// lexNumberOrDateStart consumes either a (positive) integer, float or
-// datetime. It assumes that NO negative sign has been consumed.
-func lexNumberOrDateStart(lx *lexer) stateFn {
-	r := lx.next()
-	if !isDigit(r) {
-		if r == '.' {
-			return lx.errorf("Floats must start with a digit, not '.'.")
-		} else {
-			return lx.errorf("Expected a digit but got %q.", r)
-		}
-	}
-	return lexNumberOrDate
-}
-
-// lexNumberOrDate consumes either a (positive) integer, float or datetime.
-func lexNumberOrDate(lx *lexer) stateFn {
-	r := lx.next()
-	switch {
-	case r == '-':
-		if lx.pos-lx.start != 5 {
-			return lx.errorf("All ISO8601 dates must be in full Zulu form.")
-		}
-		return lexDateAfterYear
-	case isDigit(r):
-		return lexNumberOrDate
-	case r == '.':
-		return lexFloatStart
-	}
-
-	lx.backup()
-	lx.emit(itemInteger)
-	return lx.pop()
-}
-
-// lexDateAfterYear consumes a full Zulu Datetime in ISO8601 format.
-// It assumes that "YYYY-" has already been consumed.
-func lexDateAfterYear(lx *lexer) stateFn {
-	formats := []rune{
-		// digits are '0'.
-		// everything else is direct equality.
-		'0', '0', '-', '0', '0',
-		'T',
-		'0', '0', ':', '0', '0', ':', '0', '0',
-		'Z',
-	}
-	for _, f := range formats {
-		r := lx.next()
-		if f == '0' {
-			if !isDigit(r) {
-				return lx.errorf("Expected digit in ISO8601 datetime, "+
-					"but found %q instead.", r)
-			}
-		} else if f != r {
-			return lx.errorf("Expected %q in ISO8601 datetime, "+
-				"but found %q instead.", f, r)
-		}
-	}
-	lx.emit(itemDatetime)
-	return lx.pop()
-}
-
-// lexNumberStart consumes either an integer or a float. It assumes that
-// a negative sign has already been read, but that *no* digits have been
-// consumed. lexNumberStart will move to the appropriate integer or float
-// states.
-func lexNumberStart(lx *lexer) stateFn {
-	// we MUST see a digit. Even floats have to start with a digit.
-	r := lx.next()
-	if !isDigit(r) {
-		if r == '.' {
-			return lx.errorf("Floats must start with a digit, not '.'.")
-		} else {
-			return lx.errorf("Expected a digit but got %q.", r)
-		}
-	}
-	return lexNumber
-}
-
-// lexNumber consumes an integer or a float after seeing the first digit.
-func lexNumber(lx *lexer) stateFn {
-	r := lx.next()
-	switch {
-	case isDigit(r):
-		return lexNumber
-	case r == '.':
-		return lexFloatStart
-	}
-
-	lx.backup()
-	lx.emit(itemInteger)
-	return lx.pop()
-}
-
-// lexFloatStart starts the consumption of digits of a float after a '.'.
-// Namely, at least one digit is required.
-func lexFloatStart(lx *lexer) stateFn {
-	r := lx.next()
-	if !isDigit(r) {
-		return lx.errorf("Floats must have a digit after the '.', but got "+
-			"%q instead.", r)
-	}
-	return lexFloat
-}
-
-// lexFloat consumes the digits of a float after a '.'.
-// Assumes that one digit has been consumed after a '.' already.
-func lexFloat(lx *lexer) stateFn {
-	r := lx.next()
-	if isDigit(r) {
-		return lexFloat
-	}
-
-	lx.backup()
-	lx.emit(itemFloat)
-	return lx.pop()
-}
-
-// lexConst consumes the s[1:] in s. It assumes that s[0] has already been
-// consumed.
-func lexConst(lx *lexer, s string) stateFn {
-	for i := range s[1:] {
-		if r := lx.next(); r != rune(s[i+1]) {
-			return lx.errorf("Expected %q, but found %q instead.", s[:i+1],
-				s[:i]+string(r))
-		}
-	}
-	return nil
-}
-
-// lexTrue consumes the "rue" in "true". It assumes that 't' has already
-// been consumed.
-func lexTrue(lx *lexer) stateFn {
-	if fn := lexConst(lx, "true"); fn != nil {
-		return fn
-	}
-	lx.emit(itemBool)
-	return lx.pop()
-}
-
-// lexFalse consumes the "alse" in "false". It assumes that 'f' has already
-// been consumed.
-func lexFalse(lx *lexer) stateFn {
-	if fn := lexConst(lx, "false"); fn != nil {
-		return fn
-	}
-	lx.emit(itemBool)
-	return lx.pop()
-}
-
-// lexCommentStart begins the lexing of a comment. It will emit
-// itemCommentStart and consume no characters, passing control to lexComment.
-func lexCommentStart(lx *lexer) stateFn {
-	lx.ignore()
-	lx.emit(itemCommentStart)
-	return lexComment
-}
-
-// lexComment lexes an entire comment. It assumes that '#' has been consumed.
-// It will consume *up to* the first new line character, and pass control
-// back to the last state on the stack.
-func lexComment(lx *lexer) stateFn {
-	r := lx.peek()
-	if isNL(r) || r == eof {
-		lx.emit(itemText)
-		return lx.pop()
-	}
-	lx.next()
-	return lexComment
-}
-
-// lexSkip ignores all slurped input and moves on to the next state.
-func lexSkip(lx *lexer, nextState stateFn) stateFn {
-	return func(lx *lexer) stateFn {
-		lx.ignore()
-		return nextState
-	}
-}
-
-// isWhitespace returns true if `r` is a whitespace character according
-// to the spec.
-func isWhitespace(r rune) bool {
-	return r == '\t' || r == ' '
-}
-
-func isNL(r rune) bool {
-	return r == '\n' || r == '\r'
-}
-
-func isDigit(r rune) bool {
-	return r >= '0' && r <= '9'
-}
-
-func isHexadecimal(r rune) bool {
-	return (r >= '0' && r <= '9') ||
-		(r >= 'a' && r <= 'f') ||
-		(r >= 'A' && r <= 'F')
-}
-
-func isBareKeyChar(r rune) bool {
-	return (r >= 'A' && r <= 'Z') ||
-		(r >= 'a' && r <= 'z') ||
-		(r >= '0' && r <= '9') ||
-		r == '_' ||
-		r == '-'
-}
-
-func (itype itemType) String() string {
-	switch itype {
-	case itemError:
-		return "Error"
-	case itemNIL:
-		return "NIL"
-	case itemEOF:
-		return "EOF"
-	case itemText:
-		return "Text"
-	case itemString:
-		return "String"
-	case itemRawString:
-		return "String"
-	case itemMultilineString:
-		return "String"
-	case itemRawMultilineString:
-		return "String"
-	case itemBool:
-		return "Bool"
-	case itemInteger:
-		return "Integer"
-	case itemFloat:
-		return "Float"
-	case itemDatetime:
-		return "DateTime"
-	case itemTableStart:
-		return "TableStart"
-	case itemTableEnd:
-		return "TableEnd"
-	case itemKeyStart:
-		return "KeyStart"
-	case itemArray:
-		return "Array"
-	case itemArrayEnd:
-		return "ArrayEnd"
-	case itemCommentStart:
-		return "CommentStart"
-	}
-	panic(fmt.Sprintf("BUG: Unknown type '%d'.", int(itype)))
-}
-
-func (item item) String() string {
-	return fmt.Sprintf("(%s, %s)", item.typ.String(), item.val)
-}


[23/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/compiler.go
----------------------------------------------------------------------
diff --git a/cli/compiler.go b/cli/compiler.go
deleted file mode 100644
index 94cea3a..0000000
--- a/cli/compiler.go
+++ /dev/null
@@ -1,619 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cli
-
-import (
-	"io/ioutil"
-	"log"
-	"os"
-	"path"
-	"path/filepath"
-	"sort"
-	"strings"
-	"time"
-)
-
-const (
-	COMPILER_TYPE_C   = 0
-	COMPILER_TYPE_ASM = 1
-)
-
-type Compiler struct {
-	ConfigPath   string
-	TargetName   string
-	BaseIncludes map[string]bool
-	ObjPathList  map[string]bool
-	LinkerScript string
-
-	Cflags string
-	Aflags string
-	Lflags string
-
-	depTracker            DepTracker
-	ccPath                string
-	asPath                string
-	arPath                string
-	odPath                string
-	osPath                string
-	ocPath                string
-	ldFlags               string
-	ldResolveCircularDeps bool
-	ldMapFile             bool
-}
-
-func NewCompiler(ccPath string, cDef string, tName string, includes []string) (
-	*Compiler, error) {
-
-	c := &Compiler{
-		ConfigPath:   ccPath,
-		TargetName:   tName,
-		BaseIncludes: map[string]bool{},
-		ObjPathList:  map[string]bool{},
-	}
-
-	c.depTracker = NewDepTracker(c)
-	for _, incl := range includes {
-		c.BaseIncludes[incl] = true
-	}
-
-	StatusMessage(VERBOSITY_VERBOSE,
-		"Loading compiler %s, target %s, def %s\n", ccPath, tName, cDef)
-
-	err := c.ReadSettings(cDef)
-	if err != nil {
-		return nil, err
-	}
-
-	return c, nil
-}
-
-func (c *Compiler) ReadSettings(cDef string) error {
-	v, err := ReadConfig(c.ConfigPath, "compiler")
-	if err != nil {
-		return err
-	}
-
-	c.ccPath = v.GetString("compiler.path.cc")
-	c.asPath = v.GetString("compiler.path.as")
-	c.arPath = v.GetString("compiler.path.archive")
-	c.odPath = v.GetString("compiler.path.objdump")
-	c.osPath = v.GetString("compiler.path.objsize")
-	c.ocPath = v.GetString("compiler.path.objcopy")
-
-	cflags := v.GetStringSlice("compiler.flags." + cDef)
-	for _, flag := range cflags {
-		if strings.HasPrefix(flag, "compiler.flags") {
-			c.Cflags += " " + strings.Trim(v.GetString(flag), "\n")
-		} else {
-			c.Cflags += " " + strings.Trim(flag, "\n")
-		}
-	}
-
-	c.ldFlags = v.GetString("compiler.ld.flags")
-	c.ldResolveCircularDeps = v.GetBool("compiler.ld.resolve_circular_deps")
-	c.ldMapFile = v.GetBool("compiler.ld.mapfile")
-
-	log.Printf("[INFO] ccPath = %s, arPath = %s, flags = %s", c.ccPath,
-		c.arPath, c.Cflags)
-
-	return nil
-}
-
-// Skips compilation of the specified C or assembly file, but adds the name of
-// the object file that would have been generated to the compiler's list of
-// object files.  This function is used when the object file is already up to
-// date, so no compilation is necessary.  The name of the object file should
-// still be remembered so that it gets linked in to the final library or
-// executable.
-func (c *Compiler) SkipSourceFile(srcFile string) error {
-	wd, _ := os.Getwd()
-	objDir := wd + "/obj/" + c.TargetName + "/"
-	objFile := objDir + strings.TrimSuffix(srcFile, filepath.Ext(srcFile)) +
-		".o"
-	c.ObjPathList[filepath.ToSlash(objFile)] = true
-
-	// Update the dependency tracker with the object file's modification time.
-	// This is necessary later for determining if the library / executable
-	// needs to be rebuilt.
-	err := c.depTracker.ProcessFileTime(objFile)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// Generates a string consisting of all the necessary include path (-I)
-// options.  The result is sorted and contains no duplicate paths.
-func (c *Compiler) IncludesString() string {
-	includes := make([]string, 0, len(c.BaseIncludes))
-	for k, _ := range c.BaseIncludes {
-		includes = append(includes, filepath.ToSlash(k))
-	}
-
-	sort.Strings(includes)
-
-	return "-I" + strings.Join(includes, " -I")
-}
-
-// Calculates the command-line invocation necessary to compile the specified C
-// or assembly file.
-//
-// @param file                  The filename of the source file to compile.
-// @param compilerType          One of the COMPILER_TYPE_[...] constants.
-//
-// @return                      (success) The command string.
-func (c *Compiler) CompileFileCmd(file string,
-	compilerType int) (string, error) {
-
-	wd, _ := os.Getwd()
-	objDir := wd + "/obj/" + c.TargetName + "/"
-	objFile := strings.TrimSuffix(file, filepath.Ext(file)) + ".o"
-	objPath := filepath.ToSlash(objDir + objFile)
-
-	var cmd string
-
-	switch compilerType {
-	case COMPILER_TYPE_C:
-		cmd = c.ccPath
-	case COMPILER_TYPE_ASM:
-		cmd = c.asPath
-	default:
-		return "", NewNewtError("Unknown compiler type")
-	}
-
-	cmd += " -c " + "-o " + objPath + " " + file +
-		" " + c.Cflags + " " + c.IncludesString()
-
-	return cmd, nil
-}
-
-// Generates a dependency Makefile (.d) for the specified source C file.
-//
-// @param file                  The name of the source file.
-func (c *Compiler) GenDepsForFile(file string) error {
-	wd, _ := os.Getwd()
-	objDir := wd + "/obj/" + c.TargetName + "/"
-
-	if NodeNotExist(objDir) {
-		os.MkdirAll(objDir, 0755)
-	}
-
-	depFile := objDir + strings.TrimSuffix(file, filepath.Ext(file)) + ".d"
-	depFile = filepath.ToSlash(depFile)
-	cFlags := c.Cflags + " " + c.IncludesString()
-
-	var cmd string
-	var err error
-
-	cmd = c.ccPath + " " + cFlags + " -MM -MG " + file + " > " + depFile
-	_, err = ShellCommand(cmd)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// Compile the specified C or assembly file.
-//
-// @param file                  The filename of the source file to compile.
-// @param compilerType          One of the COMPILER_TYPE_[...] constants.
-func (c *Compiler) CompileFile(file string, compilerType int) error {
-	wd, _ := os.Getwd()
-	objDir := wd + "/obj/" + c.TargetName + "/"
-
-	if NodeNotExist(objDir) {
-		os.MkdirAll(objDir, 0755)
-	}
-
-	objFile := strings.TrimSuffix(file, filepath.Ext(file)) + ".o"
-
-	objPath := objDir + objFile
-	c.ObjPathList[filepath.ToSlash(objPath)] = true
-
-	cmd, err := c.CompileFileCmd(file, compilerType)
-	if err != nil {
-		return err
-	}
-
-	switch compilerType {
-	case COMPILER_TYPE_C:
-		StatusMessage(VERBOSITY_DEFAULT, "Compiling %s\n", file)
-	case COMPILER_TYPE_ASM:
-		StatusMessage(VERBOSITY_DEFAULT, "Assembling %s\n", file)
-	default:
-		return NewNewtError("Unknown compiler type")
-	}
-
-	rsp, err := ShellCommand(cmd)
-	if err != nil {
-		StatusMessage(VERBOSITY_QUIET, string(rsp))
-		return err
-	}
-
-	err = WriteCommandFile(objPath, cmd)
-	if err != nil {
-		return err
-	}
-
-	// Tell the dependency tracker that an object file was just rebuilt.
-	c.depTracker.MostRecent = time.Now()
-
-	return nil
-}
-
-// Compiles all C files matching the specified file glob.
-//
-// @param match                 The file glob specifying which C files to
-//                                  compile.
-func (c *Compiler) Compile(match string) error {
-	files, _ := filepath.Glob(match)
-
-	wd, err := os.Getwd()
-	if err != nil {
-		return err
-	}
-
-	log.Printf("[INFO] Compiling C if outdated (%s/%s) %s", wd, match,
-		strings.Join(files, " "))
-	for _, file := range files {
-		file = filepath.ToSlash(file)
-		compileRequired, err := c.depTracker.CompileRequired(file, 0)
-		if err != nil {
-			return err
-		}
-		if compileRequired {
-			err = c.CompileFile(file, COMPILER_TYPE_C)
-		} else {
-			err = c.SkipSourceFile(file)
-		}
-		if err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-// Compiles all assembly files matching the specified file glob.
-//
-// @param match                 The file glob specifying which assembly files
-//                                  to compile.
-func (c *Compiler) CompileAs(match string) error {
-	files, _ := filepath.Glob(match)
-
-	wd, err := os.Getwd()
-	if err != nil {
-		return err
-	}
-
-	log.Printf("[INFO] Compiling assembly if outdated (%s/%s) %s", wd, match,
-		strings.Join(files, " "))
-	for _, file := range files {
-		compileRequired, err := c.depTracker.CompileRequired(file, 1)
-		if err != nil {
-			return err
-		}
-		if compileRequired {
-			err = c.CompileFile(file, COMPILER_TYPE_ASM)
-		} else {
-			err = c.SkipSourceFile(file)
-		}
-		if err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-func (c *Compiler) RecursiveClean(path string, tName string) error {
-	// Find all the subdirectories of path that contain an "obj/" directory,
-	// and remove that directory either altogether, or just the arch specific
-	// directory.
-	dirList, err := ioutil.ReadDir(path)
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	for _, node := range dirList {
-		if node.IsDir() {
-			if node.Name() == "obj" || node.Name() == "bin" {
-				if tName == "" {
-					os.RemoveAll(path + "/" + node.Name() + "/")
-				} else {
-					os.RemoveAll(path + "/" + node.Name() + "/" + tName + "/")
-				}
-			} else {
-				// recurse into the directory.
-				err = c.RecursiveClean(path+"/"+node.Name(), tName)
-				if err != nil {
-					return err
-				}
-			}
-		}
-	}
-
-	return nil
-}
-
-func (c *Compiler) processEntry(wd string, node os.FileInfo, match string, cType int,
-	ignDirs []string) error {
-	// check to see if we ignore this element
-	for _, entry := range ignDirs {
-		if entry == node.Name() {
-			return nil
-		}
-	}
-
-	// if not, recurse into the directory
-	os.Chdir(wd + "/" + node.Name())
-	return c.RecursiveCompile(match, cType, ignDirs)
-}
-
-func (c *Compiler) RecursiveCompile(match string, cType int, ignDirs []string) error {
-	// Get a list of files in the current directory, and if they are a directory,
-	// and that directory is not in the ignDirs variable, then recurse into that
-	// directory and compile the files in there
-	wd, err := os.Getwd()
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-	wd = filepath.ToSlash(wd)
-
-	dirList, err := ioutil.ReadDir(wd)
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	for _, node := range dirList {
-		if node.IsDir() {
-			err = c.processEntry(wd, node, match, cType, ignDirs)
-			if err != nil {
-				return err
-			}
-		}
-	}
-
-	os.Chdir(wd)
-
-	switch cType {
-	case 0:
-		return c.Compile(match)
-	case 1:
-		return c.CompileAs(match)
-	default:
-		return NewNewtError("Wrong compiler type specified to RecursiveCompile")
-	}
-}
-
-func (c *Compiler) getObjFiles(baseObjFiles []string) string {
-	for objName, _ := range c.ObjPathList {
-		baseObjFiles = append(baseObjFiles, objName)
-	}
-
-	sort.Strings(baseObjFiles)
-	objList := strings.Join(baseObjFiles, " ")
-	return objList
-}
-
-// Calculates the command-line invocation necessary to link the specified elf
-// file.
-//
-// @param dstFile               The filename of the destination elf file to
-//                                  link.
-// @param options               Some build options specifying how the elf file
-//                                  gets generated.
-// @param objFiles              An array of the source .o and .a filenames.
-//
-// @return                      (success) The command string.
-func (c *Compiler) CompileBinaryCmd(dstFile string, options map[string]bool,
-	objFiles []string) string {
-
-	objList := c.getObjFiles(UniqueStrings(objFiles))
-
-	cmd := c.ccPath + " -o " + dstFile + " " + c.ldFlags + " " + c.Cflags
-	if c.ldResolveCircularDeps {
-		cmd += " -Wl,--start-group " + objList + " -Wl,--end-group "
-	} else {
-		cmd += " " + objList
-	}
-
-	if c.LinkerScript != "" {
-		cmd += " -T " + c.LinkerScript
-	}
-	if checkBoolMap(options, "mapFile") {
-		cmd += " -Wl,-Map=" + dstFile + ".map"
-	}
-
-	return cmd
-}
-
-// Links the specified elf file.
-//
-// @param dstFile               The filename of the destination elf file to
-//                                  link.
-// @param options               Some build options specifying how the elf file
-//                                  gets generated.
-// @param objFiles              An array of the source .o and .a filenames.
-func (c *Compiler) CompileBinary(dstFile string, options map[string]bool,
-	objFiles []string) error {
-
-	objList := c.getObjFiles(UniqueStrings(objFiles))
-
-	StatusMessage(VERBOSITY_DEFAULT, "Linking %s\n", path.Base(dstFile))
-	StatusMessage(VERBOSITY_VERBOSE, "Linking %s with input files %s\n",
-		dstFile, objList)
-
-	cmd := c.CompileBinaryCmd(dstFile, options, objFiles)
-	rsp, err := ShellCommand(cmd)
-	if err != nil {
-		StatusMessage(VERBOSITY_QUIET, string(rsp))
-		return err
-	}
-
-	err = WriteCommandFile(dstFile, cmd)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// Generates the following build artifacts:
-//    * lst file
-//    * map file
-//    * bin file
-//
-// @param elfFilename           The filename of the elf file corresponding to
-//                                  the artifacts to be generated.
-// @param options               Some build options specifying which artifacts
-//                                  get generated.
-func (c *Compiler) generateExtras(elfFilename string,
-	options map[string]bool) error {
-
-	var cmd string
-
-	if checkBoolMap(options, "listFile") {
-		listFile := elfFilename + ".lst"
-		// if list file exists, remove it
-		if NodeExist(listFile) {
-			if err := os.RemoveAll(listFile); err != nil {
-				return err
-			}
-		}
-
-		cmd = c.odPath + " -wxdS " + elfFilename + " >> " + listFile
-		_, err := ShellCommand(cmd)
-		if err != nil {
-			// XXX: gobjdump appears to always crash.  Until we get that sorted
-			// out, don't fail the link process if lst generation fails.
-			return nil
-		}
-
-		sects := []string{".text", ".rodata", ".data"}
-		for _, sect := range sects {
-			cmd = c.odPath + " -s -j " + sect + " " + elfFilename + " >> " +
-				listFile
-			ShellCommand(cmd)
-		}
-
-		cmd = c.osPath + " " + elfFilename + " >> " + listFile
-		_, err = ShellCommand(cmd)
-		if err != nil {
-			return err
-		}
-	}
-
-	if checkBoolMap(options, "binFile") {
-		binFile := elfFilename + ".bin"
-		cmd = c.ocPath + " -R .bss -R .bss.core -R .bss.core.nz -O binary " +
-			elfFilename + " " + binFile
-		_, err := ShellCommand(cmd)
-		if err != nil {
-			return err
-		}
-	}
-
-	return nil
-}
-
-// Links the specified elf file and generates some associated artifacts (lst,
-// bin, and map files).
-//
-// @param binFile               The filename of the destination elf file to
-//                                  link.
-// @param options               Some build options specifying how the elf file
-//                                  gets generated.
-// @param objFiles              An array of the source .o and .a filenames.
-func (c *Compiler) CompileElf(binFile string, options map[string]bool,
-	objFiles []string) error {
-
-	binFile += ".elf"
-
-	linkRequired, err := c.depTracker.LinkRequired(binFile, options, objFiles)
-	if err != nil {
-		return err
-	}
-	if linkRequired {
-		err := c.CompileBinary(binFile, options, objFiles)
-		if err != nil {
-			return err
-		}
-	}
-
-	err = c.generateExtras(binFile, options)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// Calculates the command-line invocation necessary to archive the specified
-// static library.
-//
-// @param archiveFile           The filename of the library to archive.
-// @param objFiles              An array of the source .o filenames.
-//
-// @return                      The command string.
-func (c *Compiler) CompileArchiveCmd(archiveFile string,
-	objFiles []string) string {
-
-	objList := c.getObjFiles(objFiles)
-	return c.arPath + " rcs " + archiveFile + " " + objList
-}
-
-// Archives the specified static library.
-//
-// @param archiveFile           The filename of the library to archive.
-// @param objFiles              An array of the source .o filenames.
-func (c *Compiler) CompileArchive(archiveFile string, objFiles []string) error {
-	arRequired, err := c.depTracker.ArchiveRequired(archiveFile, objFiles)
-	if err != nil {
-		return err
-	}
-	if !arRequired {
-		return nil
-	}
-
-	objList := c.getObjFiles(objFiles)
-
-	StatusMessage(VERBOSITY_DEFAULT, "Archiving %s\n", path.Base(archiveFile))
-	StatusMessage(VERBOSITY_VERBOSE, "Archiving %s with object files %s",
-		archiveFile, objList)
-
-	// Delete the old archive, if it exists.
-	err = os.Remove(archiveFile)
-	if err != nil && !os.IsNotExist(err) {
-		return NewNewtError(err.Error())
-	}
-
-	cmd := c.CompileArchiveCmd(archiveFile, objFiles)
-	rsp, err := ShellCommand(cmd)
-	if err != nil {
-		StatusMessage(VERBOSITY_QUIET, string(rsp))
-		return err
-	}
-
-	err = WriteCommandFile(archiveFile, cmd)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/deps.go
----------------------------------------------------------------------
diff --git a/cli/deps.go b/cli/deps.go
deleted file mode 100644
index 23dd4b9..0000000
--- a/cli/deps.go
+++ /dev/null
@@ -1,239 +0,0 @@
-package cli
-
-import (
-	"os"
-	"path/filepath"
-	"strings"
-	"time"
-)
-
-type DepTracker struct {
-	// Most recent .o modification time.
-	MostRecent time.Time
-
-	compiler *Compiler
-}
-
-func NewDepTracker(c *Compiler) DepTracker {
-	tracker := DepTracker{
-		MostRecent: time.Unix(0, 0),
-		compiler:   c,
-	}
-
-	return tracker
-}
-
-// Parses a dependency (.d) file generated by gcc.  On success, the returned
-// string array is populated with the dependency filenames.  This function
-// expects the first line of a dependency file to have the following format:
-//
-// <file>.d: <file>.c a.h b.h c.h \
-//  d.h e.h f.h
-//
-// This function ignores all lines except for the first.
-func ParseDepsFile(filename string) ([]string, error) {
-	lines, err := ReadLines(filename)
-	if err != nil {
-		return nil, err
-	}
-
-	if len(lines) == 0 {
-		return []string{}, nil
-	}
-
-	// Assume only the first line is important.
-	tokens := strings.Fields(lines[0])
-	if len(tokens) == 0 {
-		return nil, NewNewtError("Invalid Makefile dependency file; first " +
-			"line is blank")
-	}
-
-	dFileTok := tokens[0]
-	if dFileTok[len(dFileTok)-1:] != ":" {
-		return nil, NewNewtError("Invalid Makefile dependency file; first " +
-			"line missing ':'")
-	}
-
-	return tokens[1:], nil
-}
-
-// Updates the dependency tracker's most recent timestamp according to the
-// modification time of the specified file.  If the specified file is older
-// than the tracker's currently most-recent time, this function has no effect.
-func (tracker *DepTracker) ProcessFileTime(file string) error {
-	modTime, err := FileModificationTime(file)
-	if err != nil {
-		return err
-	}
-
-	if modTime.After(tracker.MostRecent) {
-		tracker.MostRecent = modTime
-	}
-
-	return nil
-}
-
-// Determines if the specified C or assembly file needs to be built.  A compile
-// is required if any of the following is true:
-//     * The destination object file does not exist.
-//     * The existing object file was built with a different compiler
-//       invocation.
-//     * The source file has a newer modification time than the object file.
-//     * One or more included header files has a newer modification time than
-//       the object file.
-func (tracker *DepTracker) CompileRequired(srcFile string,
-	compilerType int) (bool, error) {
-	wd, _ := os.Getwd()
-	objDir := wd + "/obj/" + tracker.compiler.TargetName + "/"
-
-	objFile := objDir + strings.TrimSuffix(srcFile, filepath.Ext(srcFile)) +
-		".o"
-	depFile := objDir + strings.TrimSuffix(srcFile, filepath.Ext(srcFile)) +
-		".d"
-
-	// If the object was previously built with a different set of options, a
-	// rebuild is necessary.
-	cmd, err := tracker.compiler.CompileFileCmd(srcFile, compilerType)
-	if err != nil {
-		return false, err
-	}
-	if CommandHasChanged(objFile, cmd) {
-		return true, nil
-	}
-
-	srcModTime, err := FileModificationTime(srcFile)
-	if err != nil {
-		return false, err
-	}
-
-	objModTime, err := FileModificationTime(objFile)
-	if err != nil {
-		return false, err
-	}
-
-	// If the object doesn't exist or is older than the source file, a build is
-	// required; no need to check dependencies.
-	if srcModTime.After(objModTime) {
-		return true, nil
-	}
-
-	// Determine if the dependency (.d) file needs to be generated.  If it
-	// doesn't exist or is older than the source file, it is out of date and
-	// needs to be created.
-	depModTime, err := FileModificationTime(depFile)
-	if err != nil {
-		return false, err
-	}
-
-	if srcModTime.After(depModTime) {
-		err := tracker.compiler.GenDepsForFile(srcFile)
-		if err != nil {
-			return false, err
-		}
-	}
-
-	// Extract the dependency filenames from the dependency file.
-	deps, err := ParseDepsFile(depFile)
-	if err != nil {
-		return false, err
-	}
-
-	// Check if any dependencies are newer than the destination object file.
-	for _, dep := range deps {
-		if NodeNotExist(dep) {
-			depModTime = time.Now()
-		} else {
-			depModTime, err = FileModificationTime(dep)
-			if err != nil {
-				return false, err
-			}
-		}
-
-		if depModTime.After(objModTime) {
-			return true, nil
-		}
-	}
-
-	return false, nil
-}
-
-// Determines if the specified static library needs to be rearchived.  The
-// library needs to be archived if any of the following is true:
-//     * The destination library file does not exist.
-//     * The existing library file was built with a different compiler
-//       invocation.
-//     * One or more source object files has a newer modification time than the
-//       library file.
-func (tracker *DepTracker) ArchiveRequired(archiveFile string,
-	objFiles []string) (bool, error) {
-
-	// If the archive was previously built with a different set of options, a
-	// rebuild is required.
-	cmd := tracker.compiler.CompileArchiveCmd(archiveFile, objFiles)
-	if CommandHasChanged(archiveFile, cmd) {
-		return true, nil
-	}
-
-	// If the archive doesn't exist or is older than any object file, a rebuild
-	// is required.
-	aModTime, err := FileModificationTime(archiveFile)
-	if err != nil {
-		return false, err
-	}
-	if tracker.MostRecent.After(aModTime) {
-		return true, nil
-	}
-
-	// The library is up to date.
-	return false, nil
-}
-
-// Determines if the specified elf file needs to be linked.  Linking is
-// necessary if the elf file does not exist or has an older modification time
-// than any source object or library file.
-// Determines if the specified static library needs to be rearchived.  The
-// library needs to be archived if any of the following is true:
-//     * The destination library file does not exist.
-//     * The existing library file was built with a different compiler
-//       invocation.
-//     * One or more source object files has a newer modification time than the
-//       library file.
-func (tracker *DepTracker) LinkRequired(dstFile string,
-	options map[string]bool, objFiles []string) (bool, error) {
-
-	// If the elf file was previously built with a different set of options, a
-	// rebuild is required.
-	cmd := tracker.compiler.CompileBinaryCmd(dstFile, options, objFiles)
-	if CommandHasChanged(dstFile, cmd) {
-		return true, nil
-	}
-
-	// If the elf file doesn't exist or is older than any input file, a rebuild
-	// is required.
-	dstModTime, err := FileModificationTime(dstFile)
-	if err != nil {
-		return false, err
-	}
-
-	// Check timestamp of each .o file in the project.
-	if tracker.MostRecent.After(dstModTime) {
-		return true, nil
-	}
-
-	// Check timestamp of the linker script and all input libraries.
-	if tracker.compiler.LinkerScript != "" {
-		objFiles = append(objFiles, tracker.compiler.LinkerScript)
-	}
-	for _, obj := range objFiles {
-		objModTime, err := FileModificationTime(obj)
-		if err != nil {
-			return false, err
-		}
-
-		if objModTime.After(dstModTime) {
-			return true, nil
-		}
-	}
-
-	return false, nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/downloader.go
----------------------------------------------------------------------
diff --git a/cli/downloader.go b/cli/downloader.go
deleted file mode 100644
index b743fea..0000000
--- a/cli/downloader.go
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cli
-
-import (
-	"fmt"
-	"io/ioutil"
-	"os"
-)
-
-type Downloader struct {
-	Repos map[string]string
-}
-
-func NewDownloader() (*Downloader, error) {
-	dl := &Downloader{}
-
-	dl.Repos = map[string]string{}
-
-	return dl, nil
-}
-
-func (dl *Downloader) gitClone(url string, branch string, dest string) error {
-	StatusMessage(VERBOSITY_VERBOSE,
-		"Git cloning URL %s branch %s into dest %s\n", branch, url, dest)
-
-	_, err := ShellCommand(fmt.Sprintf("git clone --depth 1 -b %s %s %s", branch, url, dest))
-	if err != nil {
-		return NewNewtError(fmt.Sprintf("Command git clone %s branch %s failed",
-			url, branch))
-	}
-
-	StatusMessage(VERBOSITY_VERBOSE,
-		"Git clone successful, removing .git directory\n")
-
-	if err := os.RemoveAll(dest + "/.git/"); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (dl *Downloader) GetRepo(repoUrl string, branch string) (string, error) {
-	// If repo already exists, return the temporary directory where it exists
-	dir, ok := dl.Repos[repoUrl+branch]
-	if ok {
-		return dir, nil
-	}
-
-	dir, err := ioutil.TempDir("", "newtrepo")
-	if err != nil {
-		return "", err
-	}
-
-	// Otherwise, get a temporary directory and place the repo there.
-	if err := dl.gitClone(repoUrl, branch, dir); err != nil {
-		return "", err
-	}
-
-	dl.Repos[repoUrl+branch] = dir
-
-	return dir, nil
-}
-
-func (dl *Downloader) DownloadFile(repoUrl string, branch string,
-	filePath string, destPath string) error {
-	repoDir, err := dl.GetRepo(repoUrl, branch)
-	if err != nil {
-		return err
-	}
-
-	if err := CopyFile(repoDir+"/"+filePath, destPath); err != nil {
-		return err
-	}
-
-	return nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/egg.go
----------------------------------------------------------------------
diff --git a/cli/egg.go b/cli/egg.go
deleted file mode 100644
index 0758a51..0000000
--- a/cli/egg.go
+++ /dev/null
@@ -1,775 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cli
-
-import (
-	"crypto/sha1"
-	"fmt"
-	"io/ioutil"
-	"log"
-	"os"
-	"path/filepath"
-	"regexp"
-	"strconv"
-	"strings"
-)
-
-type VersMatch struct {
-	CompareType string
-	Vers        *Version
-}
-
-type Version struct {
-	Major    int64
-	Minor    int64
-	Revision int64
-}
-
-type DependencyRequirement struct {
-	Name        string
-	Stability   string
-	VersMatches []*VersMatch
-}
-
-type Egg struct {
-	// Base directory of the egg
-	BasePath string
-	// Name of the egg
-	Name string
-	// Full Name of the egg include prefix dir
-	FullName string
-	// Nest this egg belongs to
-	Nest *Nest
-	// Egg version
-	Version *Version
-	// Type of egg
-	LinkerScript string
-
-	// For BSP egg, how to download
-	DownloadScript string
-	// For BSP egg, how to start debugger and attach it to target board
-	DebugScript string
-
-	// Has the dependencies been loaded for this egg
-	DepLoaded bool
-
-	// Has the configuration been loaded for this egg
-	CfgLoaded bool
-
-	// Egg sources
-	Sources []string
-	// Egg include directories
-	Includes []string
-
-	// Egg compiler flags
-	Cflags string
-
-	// Egg linker flags
-	Lflags string
-
-	// Egg assembler flags
-	Aflags string
-
-	// Whether or not this egg is a BSP
-	IsBsp bool
-
-	// Capabilities that this egg exports
-	Capabilities []*DependencyRequirement
-
-	// Capabilities that this egg requires
-	ReqCapabilities []*DependencyRequirement
-
-	// Whether or not we've already compiled this egg
-	Built bool
-
-	// Whether or not we've already cleaned this egg
-	Clean bool
-
-	// Eggs that this egg depends on
-	Deps []*DependencyRequirement
-}
-
-type EggShell struct {
-	FullName string
-	Version  *Version
-	/* Clutch this eggshell belongs to */
-	Clutch  *Clutch
-	Hash    string
-	Deps    []*DependencyRequirement
-	Caps    []*DependencyRequirement
-	ReqCaps []*DependencyRequirement
-}
-
-func NewEggShell(clutch *Clutch) (*EggShell, error) {
-	eShell := &EggShell{
-		Clutch: clutch,
-	}
-
-	return eShell, nil
-}
-
-func (es *EggShell) serializeDepReq(name string,
-	drList []*DependencyRequirement, indent string) string {
-	drStr := ""
-	if len(drList) > 0 {
-		drStr += fmt.Sprintf("%s%s:\n", indent, name)
-		for _, dr := range drList {
-			drStr += fmt.Sprintf("%s    - %s\n", indent, dr)
-		}
-	}
-
-	return drStr
-}
-
-func (es *EggShell) Serialize(indent string) string {
-	esStr := fmt.Sprintf("%s%s:\n", indent, es.FullName)
-	indent += "    "
-	if es.Version == nil {
-		es.Version = &Version{0, 0, 0}
-	}
-	esStr += fmt.Sprintf("%svers: %s\n", indent, es.Version)
-	esStr += fmt.Sprintf("%shash: %s\n", indent, es.Hash)
-	esStr += es.serializeDepReq("deps", es.Deps, indent)
-	esStr += es.serializeDepReq("caps", es.Caps, indent)
-	esStr += es.serializeDepReq("req_caps", es.ReqCaps, indent)
-
-	return esStr
-}
-
-func (v *Version) compareVersions(vers1 *Version, vers2 *Version) int64 {
-	log.Printf("[DEBUG] Comparing %s to %s (%d %d %d)", vers1, vers2,
-		vers1.Major-vers2.Major, vers1.Minor-vers2.Minor,
-		vers1.Revision-vers2.Revision)
-
-	if r := vers1.Major - vers2.Major; r != 0 {
-		return r
-	}
-
-	if r := vers1.Minor - vers2.Minor; r != 0 {
-		return r
-	}
-
-	if r := vers1.Revision - vers2.Revision; r != 0 {
-		return r
-	}
-
-	return 0
-}
-
-func (v *Version) SatisfiesVersion(versMatches []*VersMatch) bool {
-	if versMatches == nil {
-		return true
-	}
-
-	for _, match := range versMatches {
-		r := v.compareVersions(match.Vers, v)
-		switch match.CompareType {
-		case "<":
-			if r <= 0 {
-				return false
-			}
-		case "<=":
-			if r < 0 {
-				return false
-			}
-		case ">":
-			if r >= 0 {
-				return false
-			}
-		case ">=":
-			if r > 0 {
-				return false
-			}
-		case "==":
-			if r != 0 {
-				return false
-			}
-		}
-	}
-
-	return true
-}
-
-func (vers *Version) String() string {
-	return fmt.Sprintf("%d.%d.%d", vers.Major, vers.Minor, vers.Revision)
-}
-
-func NewVersParseString(versStr string) (*Version, error) {
-	var err error
-
-	parts := strings.Split(versStr, ".")
-	if len(parts) > 3 {
-		return nil, NewNewtError(fmt.Sprintf("Invalid version string: %s", versStr))
-	}
-
-	if strings.Trim(parts[0], " ") == "" || strings.Trim(parts[0], " ") == "none" {
-		return nil, nil
-	}
-
-	v := &Version{}
-
-	// convert first string to an int
-	if v.Major, err = strconv.ParseInt(parts[0], 0, 64); err != nil {
-		return nil, NewNewtError(err.Error())
-	}
-	if len(parts) >= 2 {
-		if v.Minor, err = strconv.ParseInt(parts[1], 0, 64); err != nil {
-			return nil, NewNewtError(err.Error())
-		}
-	}
-	if len(parts) == 3 {
-		if v.Revision, err = strconv.ParseInt(parts[2], 0, 64); err != nil {
-			return nil, NewNewtError(err.Error())
-		}
-	}
-
-	return v, nil
-}
-
-//
-// Set the version comparison constraints on a dependency requirement.
-// The version string contains a list of version constraints in the following format:
-//    - <comparison><version>
-// Where <comparison> can be any one of the following comparison
-//   operators: <=, <, >, >=, ==
-// And <version> is specified in the form: X.Y.Z where X, Y and Z are all
-// int64 types in decimal form
-func (dr *DependencyRequirement) SetVersStr(versStr string) error {
-	var err error
-
-	re, err := regexp.Compile(`(<=|>=|==|>|<)([\d\.]+)`)
-	if err != nil {
-		return err
-	}
-
-	matches := re.FindAllStringSubmatch(versStr, -1)
-	if matches != nil {
-		dr.VersMatches = make([]*VersMatch, 0, len(matches))
-		for _, match := range matches {
-			vm := &VersMatch{}
-			vm.CompareType = match[1]
-			if vm.Vers, err = NewVersParseString(match[2]); err != nil {
-				return err
-			}
-
-			if vm.Vers != nil {
-				dr.VersMatches = append(dr.VersMatches, vm)
-			}
-		}
-	} else {
-		dr.VersMatches = make([]*VersMatch, 0)
-		vm := &VersMatch{}
-		vm.CompareType = "=="
-		if vm.Vers, err = NewVersParseString(versStr); err != nil {
-			return err
-		}
-		if vm.Vers != nil {
-			dr.VersMatches = append(dr.VersMatches, vm)
-		}
-	}
-
-	if len(dr.VersMatches) == 0 {
-		dr.VersMatches = nil
-	}
-
-	return nil
-}
-
-// Convert the array of version matches into a string for display
-func (dr *DependencyRequirement) VersMatchesString() string {
-	if dr.VersMatches != nil {
-		str := ""
-		for _, match := range dr.VersMatches {
-			str += fmt.Sprintf("%s%s", match.CompareType, match.Vers)
-		}
-		return str
-	} else {
-		return "none"
-	}
-}
-
-// Convert the dependency requirement to a string for display
-func (dr *DependencyRequirement) String() string {
-	return fmt.Sprintf("%s@%s#%s", dr.Name, dr.VersMatchesString(), dr.Stability)
-}
-
-func (dr *DependencyRequirement) SatisfiesCapability(
-	capability *DependencyRequirement) error {
-	if dr.Name != capability.Name {
-		return NewNewtError(fmt.Sprintf("Required capability name %s doesn't match "+
-			"specified capability name %s", dr.Name, capability.Name))
-	}
-
-	for _, versMatch := range dr.VersMatches {
-		if !versMatch.Vers.SatisfiesVersion(capability.VersMatches) {
-			return NewNewtError(fmt.Sprintf("Capability %s doesn't satisfy version "+
-				"requirement %s", capability, versMatch.Vers))
-		}
-	}
-
-	return nil
-}
-
-// Check whether the passed in egg satisfies the current dependency requirement
-func (dr *DependencyRequirement) SatisfiesDependency(egg *Egg) bool {
-	if egg.FullName != dr.Name {
-		return false
-	}
-
-	if egg.Version.SatisfiesVersion(dr.VersMatches) {
-		return true
-	}
-
-	return false
-}
-
-// Convert the dependency requirement to branch name to look for
-func (dr *DependencyRequirement) BranchName() string {
-	if dr.Stability != "stable" {
-		// XXX should compare to latest
-		return dr.Stability
-	}
-	for _, versMatch := range dr.VersMatches {
-		if versMatch.CompareType == "==" || versMatch.CompareType == "<=" {
-			if versMatch.Vers.Minor == 0 && versMatch.Vers.Revision == 0 {
-				return fmt.Sprintf("%d", versMatch.Vers.Major)
-			} else if versMatch.Vers.Revision == 0 {
-				return fmt.Sprintf("%d.%d", versMatch.Vers.Major,
-					versMatch.Vers.Minor)
-			} else {
-				return fmt.Sprintf("%d.%d.%d", versMatch.Vers.Major,
-					versMatch.Vers.Minor, versMatch.Vers.Revision)
-			}
-		}
-		// XXX What to do with other version comparisons?
-	}
-	return "master"
-}
-
-// Create a New DependencyRequirement structure from the contents of the depReq
-// string that has been passed in as an argument.
-func NewDependencyRequirementParseString(depReq string) (*DependencyRequirement,
-	error) {
-	// Allocate dependency requirement
-	dr := &DependencyRequirement{}
-	// Split string into multiple parts, @#
-	// first, get dependency name
-	parts := strings.Split(depReq, "@")
-	if len(parts) == 1 {
-		parts = strings.Split(depReq, "#")
-		dr.Name = parts[0]
-		if len(parts) > 1 {
-			dr.Stability = parts[1]
-		} else {
-			dr.Stability = "stable"
-		}
-	} else if len(parts) == 2 {
-		dr.Name = parts[0]
-		verParts := strings.Split(parts[1], "#")
-
-		if err := dr.SetVersStr(verParts[0]); err != nil {
-			return nil, err
-		}
-		if len(verParts) == 2 {
-			dr.Stability = verParts[1]
-		} else {
-			dr.Stability = "stable"
-		}
-	}
-
-	return dr, nil
-}
-
-// Get a map of egg capabilities.  The returned map contains the name of the
-// capability, and its version as the key, and a pointer to the
-// Capability structure associated with that name.
-func (egg *Egg) GetCapabilities() ([]*DependencyRequirement, error) {
-	return egg.Capabilities, nil
-}
-
-// Return the egg dependencies for this egg.
-func (egg *Egg) GetDependencies() ([]*DependencyRequirement, error) {
-	return egg.Deps, nil
-}
-
-func (egg *Egg) GetReqCapabilities() ([]*DependencyRequirement, error) {
-	return egg.ReqCapabilities, nil
-}
-
-func (eggShell *EggShell) GetCapabilities() ([]*DependencyRequirement, error) {
-	return eggShell.Caps, nil
-}
-
-// Return the egg dependencies for this eggShell.
-func (eggShell *EggShell) GetDependencies() ([]*DependencyRequirement, error) {
-	return eggShell.Deps, nil
-}
-
-func (eggShell *EggShell) GetReqCapabilities() ([]*DependencyRequirement, error) {
-	return eggShell.ReqCaps, nil
-}
-
-// Load a egg's configuration information from the egg config
-// file.
-func (egg *Egg) GetIncludes(t *Target) ([]string, error) {
-	// Return the include directories for just this egg
-	incls := []string{
-		egg.BasePath + "/include/",
-		egg.BasePath + "/include/" + egg.Name + "/arch/" + t.Arch + "/",
-	}
-
-	return incls, nil
-}
-
-// Load capabilities from a string containing a list of capabilities.
-// The capability format is expected to be one of:
-//   name@version
-//   name
-// @param capList An array of capability strings
-// @return On success error is nil, and a list of capabilities is returned,
-// on failure error is non-nil
-func (egg *Egg) loadCaps(capList []string) ([]*DependencyRequirement, error) {
-	if len(capList) == 0 {
-		return nil, nil
-	}
-
-	// Allocate an array of capabilities
-	caps := make([]*DependencyRequirement, 0)
-
-	StatusMessage(VERBOSITY_VERBOSE, "Loading capabilities %s\n",
-		strings.Join(capList, " "))
-	for _, capItem := range capList {
-		dr, err := NewDependencyRequirementParseString(capItem)
-		if err != nil {
-			return nil, err
-		}
-
-		caps = append(caps, dr)
-		log.Printf("[DEBUG] Appending new capability egg: %s, cap:%s",
-			egg.Name, dr)
-	}
-
-	return caps, nil
-}
-
-// Create a dependency requirement out of an egg
-//
-func (egg *Egg) MakeDependency() (*DependencyRequirement, error) {
-	return NewDependencyRequirementParseString(egg.FullName)
-}
-
-// Generate a hash of the contents of an egg.  This function recursively
-// processes the contents of a directory, ignoring hidden files and the
-// bin and obj directories.  It returns a hash of all the files, their
-// contents.
-func (egg *Egg) GetHash() (string, error) {
-	hash := sha1.New()
-
-	err := filepath.Walk(egg.BasePath,
-		func(path string, info os.FileInfo, err error) error {
-			name := info.Name()
-			if name == "bin" || name == "obj" || name[0] == '.' {
-				return filepath.SkipDir
-			}
-
-			if info.IsDir() {
-				// SHA the directory name into the hash
-				hash.Write([]byte(name))
-			} else {
-				// SHA the file name & contents into the hash
-				contents, err := ioutil.ReadFile(path)
-				if err != nil {
-					return err
-				}
-				hash.Write(contents)
-			}
-			return nil
-		})
-	if err != nil && err != filepath.SkipDir {
-		return "", NewNewtError(err.Error())
-	}
-
-	hashStr := fmt.Sprintf("%x", hash.Sum(nil))
-
-	return hashStr, nil
-}
-
-// Load egg's configuration, and collect required capabilities, dependencies, and
-// identities it provides, so we'll have this available when target is being built.
-func (egg *Egg) LoadDependencies(identities map[string]string,
-	capabilities map[string]string) error {
-
-	if egg.DepLoaded {
-		return nil
-	}
-
-	log.Printf("[DEBUG] Loading dependencies for egg %s", egg.BasePath)
-
-	v, err := ReadConfig(egg.BasePath, "egg")
-	if err != nil {
-		return err
-	}
-
-	// Append all identities that this egg exposes.
-	idents := GetStringSliceIdentities(v, identities, "egg.identities")
-
-	// Add these to project identities
-	for _, item := range idents {
-		StatusMessage(VERBOSITY_VERBOSE, "    Adding identity %s - %s\n", item,
-			egg.FullName)
-		identities[item] = egg.FullName
-	}
-
-	// Load the list of capabilities that this egg exposes
-	egg.Capabilities, err = egg.loadCaps(GetStringSliceIdentities(v, identities,
-		"egg.caps"))
-	if err != nil {
-		return err
-	}
-
-	// Add these to project capabilities
-	for _, cap := range egg.Capabilities {
-		if capabilities[cap.String()] != "" &&
-			capabilities[cap.String()] != egg.FullName {
-
-			return NewNewtError(fmt.Sprintf("Multiple eggs with "+
-				"capability %s (%s and %s)",
-				cap.String(), capabilities[cap.String()], egg.FullName))
-		}
-		capabilities[cap.String()] = egg.FullName
-		StatusMessage(VERBOSITY_VERBOSE, "    Adding capability %s - %s\n",
-			cap.String(), egg.FullName)
-	}
-
-	// Load the list of capabilities that this egg requires
-	egg.ReqCapabilities, err = egg.loadCaps(GetStringSliceIdentities(v, identities,
-		"egg.req_caps"))
-	if err != nil {
-		return err
-	}
-
-	// Load egg dependencies
-	depList := GetStringSliceIdentities(v, identities, "egg.deps")
-	if len(depList) > 0 {
-		egg.Deps = make([]*DependencyRequirement, 0, len(depList))
-		for _, depStr := range depList {
-			log.Printf("[DEBUG] Loading dependency %s from egg %s", depStr,
-				egg.FullName)
-			dr, err := NewDependencyRequirementParseString(depStr)
-			if err != nil {
-				return err
-			}
-
-			egg.Deps = append(egg.Deps, dr)
-		}
-	}
-	for _, cap := range egg.ReqCapabilities {
-		eggName := capabilities[cap.String()]
-		if eggName == "" {
-			continue
-		}
-		dr, err := NewDependencyRequirementParseString(eggName)
-		if err != nil {
-			return err
-		}
-		egg.Deps = append(egg.Deps, dr)
-	}
-
-	// Check these as well
-	egg.LinkerScript = GetStringIdentities(v, identities, "egg.linkerscript")
-	egg.DownloadScript = GetStringIdentities(v, identities, "egg.downloadscript")
-	egg.DebugScript = GetStringIdentities(v, identities, "egg.debugscript")
-
-	egg.Cflags = GetStringIdentities(v, identities, "egg.cflags")
-	egg.Lflags = GetStringIdentities(v, identities, "egg.lflags")
-	egg.Aflags = GetStringIdentities(v, identities, "egg.aflags")
-
-	egg.DepLoaded = true
-
-	return nil
-}
-
-// Collect identities and capabilities that egg and it's dependencies provide
-func (egg *Egg) collectDependencies(clutch *Clutch,
-	identities map[string]string,
-	capabilities map[string]string) error {
-
-	if egg.DepLoaded {
-		return nil
-	}
-
-	StatusMessage(VERBOSITY_VERBOSE, "  Collecting egg %s dependencies\n", egg.Name)
-
-	err := egg.LoadDependencies(identities, capabilities)
-	if err != nil {
-		return err
-	}
-
-	for _, dep := range egg.Deps {
-		egg, err := clutch.ResolveEggName(dep.Name)
-		if err != nil {
-			return err
-		}
-		err = egg.collectDependencies(clutch, identities, capabilities)
-		if err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-// Clear the var which says that dependencies have been checked for this egg and
-// it's dependencies
-func (egg *Egg) clearDependencyMarker(clutch *Clutch) {
-
-	if egg.DepLoaded == false {
-		return
-	}
-	egg.DepLoaded = false
-
-	for _, dep := range egg.Deps {
-		egg, err := clutch.ResolveEggName(dep.Name)
-		if err == nil {
-			egg.clearDependencyMarker(clutch)
-		}
-	}
-}
-
-// Load a egg's configuration.  This allocates & initializes a fair number of
-// the main data structures within the egg.
-func (egg *Egg) LoadConfig(t *Target, force bool) error {
-	if egg.CfgLoaded && !force {
-		return nil
-	}
-
-	log.Printf("[DEBUG] Loading configuration for egg %s", egg.BasePath)
-
-	v, err := ReadConfig(egg.BasePath, "egg")
-	if err != nil {
-		return err
-	}
-
-	egg.FullName = v.GetString("egg.name")
-	egg.Name = filepath.Base(egg.FullName)
-
-	egg.Version, err = NewVersParseString(v.GetString("egg.vers"))
-	if err != nil {
-		return err
-	}
-
-	// Append all the identities that this egg exposes to sub-eggs.  This must
-	// be done before the remainder of the settings, as some settings depend on
-	// identity.
-	identities := map[string]string{}
-	if t != nil {
-		identities = t.Identities;
-		idents := GetStringSliceIdentities(v, identities, "egg.identities")
-		for _, item := range idents {
-		    identities[item] = egg.FullName;
-		}
-	}
-
-	egg.LinkerScript = GetStringIdentities(v, identities, "egg.linkerscript")
-	egg.DownloadScript = GetStringIdentities(v, identities, "egg.downloadscript")
-	egg.DebugScript = GetStringIdentities(v, identities, "egg.debugscript")
-
-	egg.Cflags += GetStringIdentities(v, identities, "egg.cflags")
-	egg.Lflags += GetStringIdentities(v, identities, "egg.lflags")
-	egg.Aflags += GetStringIdentities(v, identities, "egg.aflags")
-
-	// Load egg dependencies
-	depList := GetStringSliceIdentities(v, identities, "egg.deps")
-	if len(depList) > 0 {
-		egg.Deps = make([]*DependencyRequirement, 0, len(depList))
-		for _, depStr := range depList {
-			log.Printf("[DEBUG] Loading dependency %s from egg %s", depStr,
-				egg.FullName)
-			dr, err := NewDependencyRequirementParseString(depStr)
-			if err != nil {
-				return err
-			}
-
-			egg.Deps = append(egg.Deps, dr)
-		}
-	}
-
-	// Load the list of capabilities that this egg exposes
-	egg.Capabilities, err = egg.loadCaps(GetStringSliceIdentities(v, identities,
-		"egg.caps"))
-	if err != nil {
-		return err
-	}
-
-	// Load the list of capabilities that this egg requires
-	egg.ReqCapabilities, err = egg.loadCaps(GetStringSliceIdentities(v, identities,
-		"egg.req_caps"))
-	if err != nil {
-		return err
-	}
-	if len(egg.ReqCapabilities) > 0 {
-		for _, reqStr := range egg.ReqCapabilities {
-			log.Printf("[DEBUG] Loading reqCap %s from egg %s", reqStr,
-				egg.FullName)
-		}
-	}
-	egg.CfgLoaded = true
-
-	return nil
-}
-
-// Initialize a egg: loads the egg configuration, and sets up egg data
-// structures.  Should only be called from NewEgg
-func (egg *Egg) Init() error {
-	return nil
-}
-
-// Allocate and initialize a new egg, and return a fully initialized Egg
-//     structure.
-// @param nest The Nest this egg is located in
-// @param basePath The path to this egg, within the specified nest
-// @return On success, error is nil, and a Egg is returned.  on failure,
-//         error is not nil.
-func NewEgg(nest *Nest, basePath string) (*Egg, error) {
-	egg := &Egg{
-		BasePath: basePath,
-		Nest:     nest,
-	}
-
-	if err := egg.Init(); err != nil {
-		return nil, err
-	}
-
-	return egg, nil
-}
-
-func (egg *Egg) TestBinName() string {
-	return "test_" + egg.Name
-}
-
-/*
- * Download egg from a clutch and stick it to nest.
- */
-func (eggShell *EggShell) Install(eggMgr *Clutch, branch string) error {
-	downloaded, err := eggMgr.InstallEgg(eggShell.FullName, branch, nil)
-	for _, remoteNest := range downloaded {
-		remoteNest.Remove()
-	}
-	return err
-}
-
-func (egg *Egg) Remove() error {
-	return os.RemoveAll(egg.BasePath)
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/nest.go
----------------------------------------------------------------------
diff --git a/cli/nest.go b/cli/nest.go
deleted file mode 100644
index abc2bce..0000000
--- a/cli/nest.go
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cli
-
-import (
-	"database/sql"
-	"fmt"
-	_ "github.com/mattn/go-sqlite3"
-	"io/ioutil"
-	"log"
-	"os"
-	"path"
-	"path/filepath"
-)
-
-type Nest struct {
-	// Name of the Nest
-	Name string
-
-	// Path to the Nest Store
-	StorePath string
-
-	// Path to the Nest Clutches
-	ClutchPath string
-
-	// Nest File
-	NestFile string
-
-	// Base path of the nest
-	BasePath string
-
-	// Store of Clutches
-	Clutches map[string]*Clutch
-
-	// Configuration
-	Config map[string]map[string]string
-
-	// The database handle for the nest configuration database
-	db *sql.DB
-}
-
-// Create a new Nest object and initialize it
-func NewNest() (*Nest, error) {
-	n := &Nest{}
-
-	err := n.Init()
-	if err != nil {
-		return nil, err
-	}
-
-	return n, nil
-}
-
-// Create a Nest object constructed out of repo in given path
-func NewNestWithDir(srcDir string) (*Nest, error) {
-	n := &Nest{}
-
-	err := n.InitPath(srcDir)
-	if err != nil {
-		return nil, err
-	}
-
-	return n, nil
-}
-
-func CreateNest(nestName string, destDir string, tadpoleUrl string) error {
-	if tadpoleUrl == "" {
-		tadpoleUrl = "https://git-wip-us.apache.org/repos/asf/incubator-mynewt-tadpole.git"
-	}
-
-	if NodeExist(destDir) {
-		return NewNewtError(fmt.Sprintf("Directory %s already exists, "+
-			" cannot create new newt nest", destDir))
-	}
-
-	dl, err := NewDownloader()
-	if err != nil {
-		return err
-	}
-
-	StatusMessage(VERBOSITY_DEFAULT, "Downloading nest skeleton from %s...",
-		tadpoleUrl)
-	if err := dl.DownloadFile(tadpoleUrl, "master", "/",
-		destDir); err != nil {
-		return err
-	}
-	StatusMessage(VERBOSITY_DEFAULT, OK_STRING)
-
-	// Overwrite nest.yml
-	contents := []byte(fmt.Sprintf("nest.name: %s\n", nestName))
-	if err := ioutil.WriteFile(destDir+"/nest.yml",
-		contents, 0644); err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	// DONE!
-
-	return nil
-}
-
-// Get a temporary directory to stick stuff in
-func (nest *Nest) GetTmpDir(dirName string, prefix string) (string, error) {
-	tmpDir := dirName
-	if NodeNotExist(tmpDir) {
-		if err := os.MkdirAll(tmpDir, 0700); err != nil {
-			return "", err
-		}
-	}
-
-	name, err := ioutil.TempDir(tmpDir, prefix)
-	if err != nil {
-		return "", err
-	}
-
-	return name, nil
-}
-
-// Find the repo file.  Searches the current directory, and then recurses
-// parent directories until it finds a file named .repo.yml
-// if no repo file found in the directory heirarchy, an error is returned
-func (nest *Nest) getNestFile() (string, error) {
-	rFile := ""
-
-	curDir, err := os.Getwd()
-	if err != nil {
-		return rFile, NewNewtError(err.Error())
-	}
-
-	for {
-		rFile = curDir + "/nest.yml"
-		log.Printf("[DEBUG] Searching for nest file at %s", rFile)
-		if _, err := os.Stat(rFile); err == nil {
-			log.Printf("[DEBUG] Found nest file at %s!", rFile)
-			break
-		}
-
-		curDir = path.Clean(curDir + "../../")
-		if curDir == "/" {
-			rFile = ""
-			err = NewNewtError("No repo file found!")
-			break
-		}
-	}
-
-	return rFile, err
-}
-
-// Create the contents of the configuration database
-func (nest *Nest) createDb(db *sql.DB) error {
-	query := `
-	CREATE TABLE IF NOT EXISTS newt_cfg (
-		cfg_name VARCHAR(255) NOT NULL,
-		key VARCHAR(255) NOT NULL,
-		value TEXT
-	)
-	`
-	_, err := db.Exec(query)
-	if err != nil {
-		return NewNewtError(err.Error())
-	} else {
-		return nil
-	}
-}
-
-// Initialize the configuration database specified by dbName.  If the database
-// doesn't exist, create it.
-func (nest *Nest) initDb(dbName string) error {
-	db, err := sql.Open("sqlite3", dbName)
-	if err != nil {
-		return err
-	}
-	nest.db = db
-
-	err = nest.createDb(db)
-	if err != nil {
-		return err
-	}
-
-	// Populate repo configuration
-	log.Printf("[DEBUG] Populating Nest configuration from %s", dbName)
-
-	rows, err := db.Query("SELECT * FROM newt_cfg")
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-	defer rows.Close()
-
-	for rows.Next() {
-		var cfgName sql.NullString
-		var cfgKey sql.NullString
-		var cfgVal sql.NullString
-
-		err := rows.Scan(&cfgName, &cfgKey, &cfgVal)
-		if err != nil {
-			return NewNewtError(err.Error())
-		}
-
-		log.Printf("[DEBUG] Setting sect %s, key %s to val %s", cfgName.String,
-			cfgKey.String, cfgVal.String)
-
-		_, ok := nest.Config[cfgName.String]
-		if !ok {
-			nest.Config[cfgName.String] = make(map[string]string)
-		}
-
-		nest.Config[cfgName.String][cfgKey.String] = cfgVal.String
-	}
-
-	return nil
-}
-
-// Get a configuration variable in section sect, with key
-// error is populated if variable doesn't exist
-func (nest *Nest) GetConfig(sect string, key string) (string, error) {
-	sectMap, ok := nest.Config[sect]
-	if !ok {
-		return "", NewNewtError("No configuration section exists")
-	}
-
-	val, ok := sectMap[key]
-	if !ok {
-		return "", NewNewtError("No configuration variable exists")
-	}
-
-	return val, nil
-}
-
-func (nest *Nest) GetConfigSect(sect string) (map[string]string, error) {
-	sm, ok := nest.Config[sect]
-	if !ok {
-		return nil, NewNewtError("No configuration section exists")
-	}
-
-	return sm, nil
-}
-
-// Delete a configuration variable in section sect with key and val
-// Returns an error if configuration variable cannot be deleted
-// (most likely due to database error or key not existing)
-func (nest *Nest) DelConfig(sect string, key string) error {
-	db := nest.db
-
-	log.Printf("[DEBUG] Deleting sect %s, key %s", sect, key)
-
-	tx, err := db.Begin()
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	stmt, err := tx.Prepare("DELETE FROM newt_cfg WHERE cfg_name=? AND key=?")
-	if err != nil {
-		return err
-	}
-	defer stmt.Close()
-
-	res, err := stmt.Exec(sect, key)
-	if err != nil {
-		return err
-	}
-
-	tx.Commit()
-
-	if affected, err := res.RowsAffected(); affected > 0 && err == nil {
-		log.Printf("[DEBUG] sect %s, key %s successfully deleted from database",
-			sect, key)
-	} else {
-		log.Printf("[DEBUG] sect %s, key %s not found, considering \"delete\" successful",
-			sect, key)
-	}
-
-	return nil
-}
-
-// Set a configuration variable in section sect with key, and val
-// Returns an error if configuration variable cannot be set
-// (most likely not able to set it in database.)
-func (nest *Nest) SetConfig(sect string, key string, val string) error {
-	_, ok := nest.Config[sect]
-	if !ok {
-		nest.Config[sect] = make(map[string]string)
-	}
-	nest.Config[sect][key] = val
-
-	// Store config
-	log.Printf("[DEBUG] Storing value %s into key %s for section %s",
-		val, sect, key)
-	db := nest.db
-
-	tx, err := db.Begin()
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	stmt, err := tx.Prepare(
-		"UPDATE newt_cfg SET value=? WHERE cfg_name=? AND key=?")
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-	defer stmt.Close()
-
-	res, err := stmt.Exec(val, sect, key)
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	// Value already existed, and we updated it.  Mission accomplished!
-	// Exit
-	if affected, err := res.RowsAffected(); affected > 0 && err == nil {
-		tx.Commit()
-		log.Printf("[DEBUG] Key %s, sect %s successfully updated to %s", key, sect, val)
-		return nil
-	}
-
-	// Otherwise, insert a new row
-	stmt1, err := tx.Prepare("INSERT INTO newt_cfg VALUES (?, ?, ?)")
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-	defer stmt1.Close()
-
-	_, err = stmt1.Exec(sect, key, val)
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	tx.Commit()
-
-	log.Printf("[DEBUG] Key %s, sect %s successfully create, value set to %s",
-		key, sect, val)
-
-	return nil
-}
-
-// Load the repo configuration file
-func (nest *Nest) loadConfig() error {
-	v, err := ReadConfig(nest.BasePath, "nest")
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	nest.Name = v.GetString("nest.name")
-	if nest.Name == "" {
-		return NewNewtError("Nest file must specify nest name")
-	}
-
-	return nil
-}
-
-func (nest *Nest) LoadClutches() error {
-	files, err := ioutil.ReadDir(nest.ClutchPath)
-	if err != nil {
-		return err
-	}
-	for _, fileInfo := range files {
-		file := fileInfo.Name()
-		if filepath.Ext(file) == ".yml" {
-			name := file[:len(filepath.Base(file))-len(".yml")]
-			log.Printf("[DEBUG] Loading Clutch %s", name)
-			clutch, err := NewClutch(nest)
-			if err != nil {
-				return err
-			}
-			if err := clutch.Load(name); err != nil {
-				return err
-			}
-		}
-	}
-	return nil
-}
-
-func (nest *Nest) InitPath(nestPath string) error {
-	cwd, err := os.Getwd()
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	if err = os.Chdir(nestPath); err != nil {
-		return NewNewtError(err.Error())
-	}
-
-	log.Printf("[DEBUG] Searching for repository, starting in directory %s", cwd)
-
-	if nest.NestFile, err = nest.getNestFile(); err != nil {
-		return err
-	}
-
-	log.Printf("[DEBUG] Nest file found, directory %s, loading configuration...",
-		nest.NestFile)
-
-	nest.BasePath = filepath.ToSlash(path.Dir(nest.NestFile))
-
-	if err = nest.loadConfig(); err != nil {
-		return err
-	}
-
-	if err = os.Chdir(cwd); err != nil {
-		return NewNewtError(err.Error())
-	}
-	return nil
-}
-
-// Initialze the repository
-// returns a NewtError on failure, and nil on success
-func (nest *Nest) Init() error {
-	var err error
-
-	cwd, err := os.Getwd()
-	if err != nil {
-		return NewNewtError(err.Error())
-	}
-	if err := nest.InitPath(cwd); err != nil {
-		return err
-	}
-
-	log.Printf("[DEBUG] Configuration loaded!  Initializing .nest database")
-
-	// Create Nest store directory
-	nest.StorePath = nest.BasePath + "/.nest/"
-	if NodeNotExist(nest.StorePath) {
-		if err := os.MkdirAll(nest.StorePath, 0755); err != nil {
-			return NewNewtError(err.Error())
-		}
-	}
-
-	// Create Nest configuration database
-	nest.Config = make(map[string]map[string]string)
-
-	dbName := nest.StorePath + "/nest.db"
-	if err := nest.initDb(dbName); err != nil {
-		return err
-	}
-
-	log.Printf("[DEBUG] Database initialized.")
-
-	// Load Clutches for the current Nest
-	nest.ClutchPath = nest.StorePath + "/clutches/"
-	if NodeNotExist(nest.ClutchPath) {
-		if err := os.MkdirAll(nest.ClutchPath, 0755); err != nil {
-			return NewNewtError(err.Error())
-		}
-	}
-
-	nest.Clutches = map[string]*Clutch{}
-
-	if err := nest.LoadClutches(); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (nest *Nest) GetClutches() (map[string]*Clutch, error) {
-	return nest.Clutches, nil
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/project.go
----------------------------------------------------------------------
diff --git a/cli/project.go b/cli/project.go
deleted file mode 100644
index e7aa0da..0000000
--- a/cli/project.go
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cli
-
-import (
-	"log"
-	"os"
-)
-
-// Structure representing a project
-type Project struct {
-	// Project name
-	Name string
-
-	// Base path of project
-	BasePath string
-
-	// Eggs
-	Eggs []string
-
-	// Capabilities
-	Capabilities []string
-
-	// Assembler compiler flags
-	Aflags string
-
-	// Compiler flags
-	Cflags string
-
-	// Linker flags
-	Lflags string
-
-	// The repository the project is located in
-	Nest *Nest
-
-	// The target associated with this project
-	Target *Target
-}
-
-// Load and initialize a project specified by name
-// nest & t are the nest and target to associate the project with
-func LoadProject(nest *Nest, t *Target, name string) (*Project, error) {
-	p := &Project{
-		Name:   name,
-		Nest:   nest,
-		Target: t,
-	}
-
-	StatusMessage(VERBOSITY_VERBOSE,
-		"Loading project %s for repo %s, target %s\n",
-		name, nest.BasePath, t.Name)
-
-	if err := p.Init(); err != nil {
-		return nil, err
-	} else {
-		return p, nil
-	}
-}
-
-// Get the packages associated with the project
-func (p *Project) GetEggs() []string {
-	return p.Eggs
-}
-
-// Load project configuration
-func (p *Project) loadConfig() error {
-	log.Printf("[DEBUG] Reading Project configuration for %s in %s",
-		p.Name, p.BasePath)
-
-	v, err := ReadConfig(p.BasePath, p.Name)
-	if err != nil {
-		return err
-	}
-
-	t := p.Target
-
-	p.Eggs = GetStringSliceIdentities(v, t.Identities, "project.eggs")
-
-	idents := GetStringSliceIdentities(v, t.Identities, "project.identities")
-	for _, ident := range idents {
-		t.Identities[ident] = p.Name
-	}
-	p.Capabilities = GetStringSliceIdentities(v, t.Identities, "project.caps")
-
-	p.Cflags = GetStringIdentities(v, t.Identities, "project.cflags")
-	p.Lflags = GetStringIdentities(v, t.Identities, "project.lflags")
-	p.Aflags = GetStringIdentities(v, t.Identities, "project.aflags")
-
-	return nil
-}
-
-// Clean the project build, and all packages that were built with the
-// project, if cleanAll is true, then clean everything, not just the current
-// architecture
-func (p *Project) BuildClean(cleanAll bool) error {
-	clutch, err := NewClutch(p.Nest)
-	if err != nil {
-		return err
-	}
-
-	// first, clean packages
-	StatusMessage(VERBOSITY_VERBOSE,
-		"Cleaning all the packages associated with project %s", p.Name)
-	for _, eggName := range p.GetEggs() {
-		err = clutch.BuildClean(p.Target, eggName, cleanAll)
-		if err != nil {
-			return err
-		}
-	}
-
-	// clean the BSP, if it exists
-	if p.Target.Bsp != "" {
-		if err := clutch.BuildClean(p.Target, p.Target.Bsp, cleanAll); err != nil {
-			return err
-		}
-	}
-
-	c, err := NewCompiler(p.Target.GetCompiler(), p.Target.Cdef, p.Target.Name, []string{})
-	if err != nil {
-		return err
-	}
-
-	tName := p.Target.Name
-	if cleanAll {
-		tName = ""
-	}
-
-	if err := c.RecursiveClean(p.BasePath, tName); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// Collect all identities and capabilities that project has
-func (p *Project) collectAllDeps(clutch *Clutch, identities map[string]string,
-	capabilities map[string]string) error {
-
-	eggList := p.GetEggs()
-	if eggList == nil {
-		return nil
-	}
-
-	StatusMessage(VERBOSITY_VERBOSE, " Collecting all project dependencies\n")
-
-	t := p.Target
-
-	eggList = append(eggList, t.Dependencies...)
-	if t.Bsp != "" {
-		eggList = append(eggList, t.Bsp)
-	}
-
-	for _, eggName := range eggList {
-		if eggName == "" {
-			continue
-		}
-
-		egg, err := clutch.ResolveEggName(eggName)
-		if err != nil {
-			return err
-		}
-
-		err = egg.collectDependencies(clutch, identities, capabilities)
-		if err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-func (p *Project) clearAllDeps(clutch *Clutch) {
-	eggList := p.GetEggs()
-	if eggList == nil {
-		return
-	}
-
-	t := p.Target
-
-	eggList = append(eggList, t.Dependencies...)
-	if t.Bsp != "" {
-		eggList = append(eggList, t.Bsp)
-	}
-
-	for _, eggName := range eggList {
-		if eggName == "" {
-			continue
-		}
-		egg, err := clutch.ResolveEggName(eggName)
-		if err != nil {
-			return
-		}
-		egg.clearDependencyMarker(clutch)
-	}
-}
-
-// Collect project identities and capabilities, and make target ready for
-// building.
-func (p *Project) collectDeps(clutch *Clutch) error {
-
-	identCount := 0
-	capCount := 0
-
-	t := p.Target
-
-	StatusMessage(VERBOSITY_VERBOSE,
-		"Collecting egg dependencies for project %s\n", p.Name)
-
-	// Need to do this multiple times, until there are no new identities,
-	// capabilities which show up.
-	identities := t.Identities
-	capabilities := map[string]string{}
-	for {
-		err := p.collectAllDeps(clutch, identities, capabilities)
-		if err != nil {
-			return err
-		}
-		newIdentCount := len(identities)
-		newCapCount := len(capabilities)
-		StatusMessage(VERBOSITY_VERBOSE, "Collected idents %d caps %d\n",
-			newIdentCount, newCapCount)
-		if identCount == newIdentCount && capCount == newCapCount {
-			break
-		}
-		p.clearAllDeps(clutch)
-		identCount = newIdentCount
-		capCount = newCapCount
-	}
-
-	return nil
-}
-
-// Build the packages that this project depends on
-// clutch is an initialized package manager, incls is an array of includes to
-// append to (package includes get append as they are built)
-// libs is an array of archive files to append to (package libraries get
-// appended as they are built)
-func (p *Project) buildDeps(clutch *Clutch, incls *[]string,
-	libs *[]string) (map[string]string, error) {
-	eggList := p.GetEggs()
-	if eggList == nil {
-		return nil, nil
-	}
-
-	StatusMessage(VERBOSITY_VERBOSE,
-		"Building egg dependencies for project %s\n", p.Name)
-
-	t := p.Target
-
-	// Append project variables to target variables, so that all package builds
-	// inherit from them
-	eggList = append(eggList, t.Dependencies...)
-	t.Capabilities = append(t.Capabilities, p.Capabilities...)
-	t.Cflags += " " + p.Cflags
-	t.Lflags += " " + p.Lflags
-	t.Aflags += " " + p.Aflags
-
-	deps := map[string]*DependencyRequirement{}
-	reqcaps := map[string]*DependencyRequirement{}
-	caps := map[string]*DependencyRequirement{}
-	capEggs := map[string]string{}
-
-	// inherit project capabilities, mark these capabilities as supported.
-	for _, cName := range t.Capabilities {
-		dr, err := NewDependencyRequirementParseString(cName)
-		if err != nil {
-			return nil, err
-		}
-
-		caps[dr.String()] = dr
-	}
-
-	for _, eggName := range eggList {
-		if eggName == "" {
-			continue
-		}
-
-		egg, err := clutch.ResolveEggName(eggName)
-		if err != nil {
-			return nil, err
-		}
-
-		if err := clutch.CheckEggDeps(egg, deps, reqcaps, caps, capEggs); err != nil {
-			return nil, err
-		}
-	}
-
-	StatusMessage(VERBOSITY_VERBOSE,
-		"Reporting required capabilities for project %s\n", p.Name)
-	for dname, dep := range reqcaps {
-		StatusMessage(VERBOSITY_VERBOSE,
-			"	%s - %s\n", dname, dep.Name)
-	}
-	StatusMessage(VERBOSITY_VERBOSE,
-		"Reporting actual capabilities for project %s\n", p.Name)
-	for dname, dep := range caps {
-		StatusMessage(VERBOSITY_VERBOSE,
-			"	%s - %s ", dname, dep.Name)
-		if capEggs[dname] != "" {
-			StatusMessage(VERBOSITY_VERBOSE,
-				"- %s\n", capEggs[dname])
-		} else {
-			StatusMessage(VERBOSITY_VERBOSE, "\n")
-		}
-	}
-
-	// After processing all the dependencies, verify that the package's
-	// capability requirements are satisfied as well
-	if err := clutch.VerifyCaps(reqcaps, caps); err != nil {
-		return nil, err
-	}
-
-	// now go through and build everything
-	for _, eggName := range eggList {
-		if eggName == "" {
-			continue
-		}
-
-		egg, err := clutch.ResolveEggName(eggName)
-		if err != nil {
-			return nil, err
-		}
-
-		if err = clutch.Build(p.Target, eggName, *incls, libs); err != nil {
-			return nil, err
-		}
-
-		// Don't fail if package did not produce a library file; some packages
-		// are header-only.
-		if lib := clutch.GetEggLib(p.Target, egg); NodeExist(lib) {
-			*libs = append(*libs, lib)
-		}
-
-		*incls = append(*incls, egg.Includes...)
-	}
-
-	return capEggs, nil
-}
-
-// Build the BSP for this project.
-// The BSP is specified by the Target attached to the project.
-// clutch is an initialized egg mgr, containing all the packages
-// incls and libs are pointers to an array of includes and libraries, when buildBsp()
-// builds the BSP, it appends the include directories for the BSP, and the archive file
-// to these variables.
-func (p *Project) buildBsp(clutch *Clutch, incls *[]string,
-	libs *[]string, capEggs map[string]string) (string, error) {
-
-	StatusMessage(VERBOSITY_VERBOSE, "Building BSP %s for project %s\n",
-		p.Target.Bsp, p.Name)
-
-	if p.Target.Bsp == "" {
-		return "", NewNewtError("Must specify a BSP to build project")
-	}
-
-	return buildBsp(p.Target, clutch, incls, libs, capEggs)
-}
-
-// Build the project
-func (p *Project) Build() error {
-	clutch, err := NewClutch(p.Nest)
-	if err != nil {
-		return err
-	}
-
-	// Load the configuration for this target
-	if err := clutch.LoadConfigs(nil, false); err != nil {
-		return err
-	}
-
-	incls := []string{}
-	libs := []string{}
-	linkerScript := ""
-
-	// Collect target identities, libraries to include
-	err = p.collectDeps(clutch)
-	if err != nil {
-		return err
-	}
-
-	// If there is a BSP:
-	//     1. Calculate the include paths that it and its dependencies export.
-	//        This set of include paths is accessible during all subsequent
-	//        builds.
-	//     2. Build the BSP package.
-	if p.Target.Bsp != "" {
-		incls, err = BspIncludePaths(clutch, p.Target)
-		if err != nil {
-			return err
-		}
-	}
-
-	// Build the project dependencies.
-	capEggs, err := p.buildDeps(clutch, &incls, &libs)
-	if err != nil {
-		return err
-	}
-
-	if p.Target.Bsp != "" {
-		linkerScript, err = p.buildBsp(clutch, &incls, &libs, capEggs)
-		if err != nil {
-			return err
-		}
-	}
-
-	// Append project includes
-	projIncls := []string{
-		p.BasePath + "/include/",
-		p.BasePath + "/arch/" + p.Target.Arch + "/include/",
-	}
-
-	incls = append(incls, projIncls...)
-
-	c, err := NewCompiler(p.Target.GetCompiler(), p.Target.Cdef, p.Target.Name,
-		incls)
-	if err != nil {
-		return err
-	}
-
-	c.LinkerScript = linkerScript
-
-	// Add target C flags
-	c.Cflags = CreateCflags(clutch, c, p.Target, p.Cflags)
-
-	os.Chdir(p.BasePath + "/src/")
-	if err = c.Compile("*.c"); err != nil {
-		return err
-	}
-
-	if !NodeNotExist(p.BasePath + "/src/arch/" + p.Target.Arch + "/") {
-		os.Chdir(p.BasePath + "/src/arch/" + p.Target.Arch + "/")
-		if err = c.Compile("*.c"); err != nil {
-			return err
-		}
-	}
-
-	StatusMessage(VERBOSITY_DEFAULT, "Building project %s\n", p.Name)
-
-	// Create binaries in the project bin/ directory, under:
-	// bin/<arch>/
-	binDir := p.BinPath()
-	if NodeNotExist(binDir) {
-		os.MkdirAll(binDir, 0755)
-	}
-
-	options := map[string]bool{"mapFile": c.ldMapFile,
-		"listFile": true, "binFile": true}
-	err = c.CompileElf(binDir+p.Name, options, libs)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// Initialize the project, and project definition
-func (p *Project) Init() error {
-	p.BasePath = p.Nest.BasePath + "/project/" + p.Name + "/"
-	if NodeNotExist(p.BasePath) {
-		return NewNewtError("Project directory does not exist")
-	}
-
-	if err := p.loadConfig(); err != nil {
-		return err
-	}
-	return nil
-}
-
-// Return path to target binary
-func (p *Project) BinPath() string {
-	return p.BasePath + "/bin/" + p.Target.Name + "/"
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/cli/remotenest.go
----------------------------------------------------------------------
diff --git a/cli/remotenest.go b/cli/remotenest.go
deleted file mode 100644
index 7bd51d7..0000000
--- a/cli/remotenest.go
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cli
-
-import (
-	"fmt"
-	"os"
-	"path/filepath"
-)
-
-type RemoteNest struct {
-	// Nestsitory associated with the Eggs
-	Nest *Nest
-
-	Clutch *Clutch
-
-	Name string
-
-	RemoteLoc string
-
-	LocalLoc string
-}
-
-// Allocate a new  structure, and initialize it.
-func NewRemoteNest(clutch *Clutch, branch string) (*RemoteNest, error) {
-	remoteNest := &RemoteNest{
-		Name : clutch.Name,
-		RemoteLoc: clutch.RemoteUrl,
-		LocalLoc: "",
-	}
-
-	err := remoteNest.Download(branch)
-	if err != nil {
-		return nil, err
-	}
-	return remoteNest, nil
-}
-
-// Download it
-func (remoteNest *RemoteNest) Download(branch string) error {
-	dl, err := NewDownloader()
-	if err != nil {
-		return err
-	}
-
-	StatusMessage(VERBOSITY_DEFAULT, "Downloading %s from %s/"+
-		"%s...", remoteNest.Name, remoteNest.RemoteLoc, branch)
-
-	dir, err := dl.GetRepo(remoteNest.RemoteLoc, branch)
-	if err != nil {
-		return err
-	}
-
-	StatusMessage(VERBOSITY_DEFAULT, OK_STRING)
-
-	remoteNest.LocalLoc = dir
-
-	nest, err := NewNestWithDir(dir)
-	if err != nil {
-		return err
-	}
-	remoteNest.Nest = nest
-
-	clutch, err := NewClutch(nest)
-	if err != nil {
-		return err
-	}
-
-	err = clutch.LoadConfigs(nil, false)
-	if err != nil {
-		return err
-	}
-	remoteNest.Clutch = clutch
-
-	return nil
-}
-
-func (remoteNest *RemoteNest) ResolveEggName(eggName string) (*Egg, error) {
-	if remoteNest.Clutch == nil {
-		return nil, NewNewtError(fmt.Sprintf("RemoteNest %s not downloaded yet!",
-					remoteNest.Name))
-	}
-	return remoteNest.Clutch.ResolveEggName(eggName)
-}
-
-func (remoteNest *RemoteNest) fetchEgg(eggName string, tgtBase string) error {
-	egg, err := remoteNest.ResolveEggName(eggName)
-	if err != nil {
-		return err
-	}
-
-	StatusMessage(VERBOSITY_DEFAULT, "Installing %s\n", egg.FullName)
-
-	srcDir := filepath.Join(remoteNest.LocalLoc, egg.FullName)
-	tgtDir := filepath.Join(tgtBase, egg.FullName)
-
-	err = CopyDir(srcDir, tgtDir)
-	return err
-}
-
-// Remove local copy
-func (remoteNest *RemoteNest) Remove() error {
-	if remoteNest.LocalLoc != "" {
-		err := os.RemoveAll(remoteNest.LocalLoc)
-		return err
-	}
-	return nil
-}


[07/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE
new file mode 100644
index 0000000..a68e67f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE
@@ -0,0 +1,188 @@
+
+Copyright (c) 2011-2014 - Canonical Inc.
+
+This software is licensed under the LGPLv3, included below.
+
+As a special exception to the GNU Lesser General Public License version 3
+("LGPL3"), the copyright holders of this Library give you permission to
+convey to a third party a Combined Work that links statically or dynamically
+to this Library without providing any Minimal Corresponding Source or
+Minimal Application Code as set out in 4d or providing the installation
+information set out in section 4e, provided that you comply with the other
+provisions of LGPL3 and provided that you meet, for the Application the
+terms and conditions of the license(s) which apply to the Application.
+
+Except as stated in this special exception, the provisions of LGPL3 will
+continue to comply in full to this Library. If you modify this Library, you
+may apply this exception to your version of this Library, but you are not
+obliged to do so. If you do not wish to do so, delete this exception
+statement from your version. This exception does not (and cannot) modify any
+license terms which apply to the Application, with which you must still
+comply.
+
+
+                   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+  This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+  0. Additional Definitions.
+
+  As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+  "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+  An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+  A "Combined Work" is a work produced by combining or linking an
+Application with the Library.  The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+  The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+  The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+  1. Exception to Section 3 of the GNU GPL.
+
+  You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+  2. Conveying Modified Versions.
+
+  If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+   a) under this License, provided that you make a good faith effort to
+   ensure that, in the event an Application does not supply the
+   function or data, the facility still operates, and performs
+   whatever part of its purpose remains meaningful, or
+
+   b) under the GNU GPL, with none of the additional permissions of
+   this License applicable to that copy.
+
+  3. Object Code Incorporating Material from Library Header Files.
+
+  The object code form of an Application may incorporate material from
+a header file that is part of the Library.  You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+   a) Give prominent notice with each copy of the object code that the
+   Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the object code with a copy of the GNU GPL and this license
+   document.
+
+  4. Combined Works.
+
+  You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+   a) Give prominent notice with each copy of the Combined Work that
+   the Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
+   document.
+
+   c) For a Combined Work that displays copyright notices during
+   execution, include the copyright notice for the Library among
+   these notices, as well as a reference directing the user to the
+   copies of the GNU GPL and this license document.
+
+   d) Do one of the following:
+
+       0) Convey the Minimal Corresponding Source under the terms of this
+       License, and the Corresponding Application Code in a form
+       suitable for, and under terms that permit, the user to
+       recombine or relink the Application with a modified version of
+       the Linked Version to produce a modified Combined Work, in the
+       manner specified by section 6 of the GNU GPL for conveying
+       Corresponding Source.
+
+       1) Use a suitable shared library mechanism for linking with the
+       Library.  A suitable mechanism is one that (a) uses at run time
+       a copy of the Library already present on the user's computer
+       system, and (b) will operate properly with a modified version
+       of the Library that is interface-compatible with the Linked
+       Version.
+
+   e) Provide Installation Information, but only if you would otherwise
+   be required to provide such information under section 6 of the
+   GNU GPL, and only to the extent that such information is
+   necessary to install and execute a modified version of the
+   Combined Work produced by recombining or relinking the
+   Application with a modified version of the Linked Version. (If
+   you use option 4d0, the Installation Information must accompany
+   the Minimal Corresponding Source and Corresponding Application
+   Code. If you use option 4d1, you must provide the Installation
+   Information in the manner specified by section 6 of the GNU GPL
+   for conveying Corresponding Source.)
+
+  5. Combined Libraries.
+
+  You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+   a) Accompany the combined library with a copy of the same work based
+   on the Library, uncombined with any other library facilities,
+   conveyed under the terms of this License.
+
+   b) Give prominent notice with the combined library that part of it
+   is a work based on the Library, and explaining where to find the
+   accompanying uncombined form of the same work.
+
+  6. Revised Versions of the GNU Lesser General Public License.
+
+  The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+  Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+  If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml
new file mode 100644
index 0000000..8da58fb
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml
@@ -0,0 +1,31 @@
+The following files were ported to Go from C files of libyaml, and thus
+are still covered by their original copyright and license:
+
+    apic.go
+    emitterc.go
+    parserc.go
+    readerc.go
+    scannerc.go
+    writerc.go
+    yamlh.go
+    yamlprivateh.go
+
+Copyright (c) 2006 Kirill Simonov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/README.md b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/README.md
new file mode 100644
index 0000000..d6c919e
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/README.md
@@ -0,0 +1,128 @@
+# YAML support for the Go language
+
+Introduction
+------------
+
+The yaml package enables Go programs to comfortably encode and decode YAML
+values. It was developed within [Canonical](https://www.canonical.com) as
+part of the [juju](https://juju.ubuntu.com) project, and is based on a
+pure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML)
+C library to parse and generate YAML data quickly and reliably.
+
+Compatibility
+-------------
+
+The yaml package supports most of YAML 1.1 and 1.2, including support for
+anchors, tags, map merging, etc. Multi-document unmarshalling is not yet
+implemented, and base-60 floats from YAML 1.1 are purposefully not
+supported since they're a poor design and are gone in YAML 1.2.
+
+Installation and usage
+----------------------
+
+The import path for the package is *gopkg.in/yaml.v2*.
+
+To install it, run:
+
+    go get gopkg.in/yaml.v2
+
+API documentation
+-----------------
+
+If opened in a browser, the import path itself leads to the API documentation:
+
+  * [https://gopkg.in/yaml.v2](https://gopkg.in/yaml.v2)
+
+API stability
+-------------
+
+The package API for yaml v2 will remain stable as described in [gopkg.in](https://gopkg.in).
+
+
+License
+-------
+
+The yaml package is licensed under the LGPL with an exception that allows it to be linked statically. Please see the LICENSE file for details.
+
+
+Example
+-------
+
+```Go
+package main
+
+import (
+        "fmt"
+        "log"
+
+        "gopkg.in/yaml.v2"
+)
+
+var data = `
+a: Easy!
+b:
+  c: 2
+  d: [3, 4]
+`
+
+type T struct {
+        A string
+        B struct{C int; D []int ",flow"}
+}
+
+func main() {
+        t := T{}
+    
+        err := yaml.Unmarshal([]byte(data), &t)
+        if err != nil {
+                log.Fatalf("error: %v", err)
+        }
+        fmt.Printf("--- t:\n%v\n\n", t)
+    
+        d, err := yaml.Marshal(&t)
+        if err != nil {
+                log.Fatalf("error: %v", err)
+        }
+        fmt.Printf("--- t dump:\n%s\n\n", string(d))
+    
+        m := make(map[interface{}]interface{})
+    
+        err = yaml.Unmarshal([]byte(data), &m)
+        if err != nil {
+                log.Fatalf("error: %v", err)
+        }
+        fmt.Printf("--- m:\n%v\n\n", m)
+    
+        d, err = yaml.Marshal(&m)
+        if err != nil {
+                log.Fatalf("error: %v", err)
+        }
+        fmt.Printf("--- m dump:\n%s\n\n", string(d))
+}
+```
+
+This example will generate the following output:
+
+```
+--- t:
+{Easy! {2 [3 4]}}
+
+--- t dump:
+a: Easy!
+b:
+  c: 2
+  d: [3, 4]
+
+
+--- m:
+map[a:Easy! b:map[c:2 d:[3 4]]]
+
+--- m dump:
+a: Easy!
+b:
+  c: 2
+  d:
+  - 3
+  - 4
+```
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/apic.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/apic.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/apic.go
new file mode 100644
index 0000000..95ec014
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/apic.go
@@ -0,0 +1,742 @@
+package yaml
+
+import (
+	"io"
+	"os"
+)
+
+func yaml_insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) {
+	//fmt.Println("yaml_insert_token", "pos:", pos, "typ:", token.typ, "head:", parser.tokens_head, "len:", len(parser.tokens))
+
+	// Check if we can move the queue at the beginning of the buffer.
+	if parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) {
+		if parser.tokens_head != len(parser.tokens) {
+			copy(parser.tokens, parser.tokens[parser.tokens_head:])
+		}
+		parser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head]
+		parser.tokens_head = 0
+	}
+	parser.tokens = append(parser.tokens, *token)
+	if pos < 0 {
+		return
+	}
+	copy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:])
+	parser.tokens[parser.tokens_head+pos] = *token
+}
+
+// Create a new parser object.
+func yaml_parser_initialize(parser *yaml_parser_t) bool {
+	*parser = yaml_parser_t{
+		raw_buffer: make([]byte, 0, input_raw_buffer_size),
+		buffer:     make([]byte, 0, input_buffer_size),
+	}
+	return true
+}
+
+// Destroy a parser object.
+func yaml_parser_delete(parser *yaml_parser_t) {
+	*parser = yaml_parser_t{}
+}
+
+// String read handler.
+func yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) {
+	if parser.input_pos == len(parser.input) {
+		return 0, io.EOF
+	}
+	n = copy(buffer, parser.input[parser.input_pos:])
+	parser.input_pos += n
+	return n, nil
+}
+
+// File read handler.
+func yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) {
+	return parser.input_file.Read(buffer)
+}
+
+// Set a string input.
+func yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) {
+	if parser.read_handler != nil {
+		panic("must set the input source only once")
+	}
+	parser.read_handler = yaml_string_read_handler
+	parser.input = input
+	parser.input_pos = 0
+}
+
+// Set a file input.
+func yaml_parser_set_input_file(parser *yaml_parser_t, file *os.File) {
+	if parser.read_handler != nil {
+		panic("must set the input source only once")
+	}
+	parser.read_handler = yaml_file_read_handler
+	parser.input_file = file
+}
+
+// Set the source encoding.
+func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) {
+	if parser.encoding != yaml_ANY_ENCODING {
+		panic("must set the encoding only once")
+	}
+	parser.encoding = encoding
+}
+
+// Create a new emitter object.
+func yaml_emitter_initialize(emitter *yaml_emitter_t) bool {
+	*emitter = yaml_emitter_t{
+		buffer:     make([]byte, output_buffer_size),
+		raw_buffer: make([]byte, 0, output_raw_buffer_size),
+		states:     make([]yaml_emitter_state_t, 0, initial_stack_size),
+		events:     make([]yaml_event_t, 0, initial_queue_size),
+	}
+	return true
+}
+
+// Destroy an emitter object.
+func yaml_emitter_delete(emitter *yaml_emitter_t) {
+	*emitter = yaml_emitter_t{}
+}
+
+// String write handler.
+func yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) error {
+	*emitter.output_buffer = append(*emitter.output_buffer, buffer...)
+	return nil
+}
+
+// File write handler.
+func yaml_file_write_handler(emitter *yaml_emitter_t, buffer []byte) error {
+	_, err := emitter.output_file.Write(buffer)
+	return err
+}
+
+// Set a string output.
+func yaml_emitter_set_output_string(emitter *yaml_emitter_t, output_buffer *[]byte) {
+	if emitter.write_handler != nil {
+		panic("must set the output target only once")
+	}
+	emitter.write_handler = yaml_string_write_handler
+	emitter.output_buffer = output_buffer
+}
+
+// Set a file output.
+func yaml_emitter_set_output_file(emitter *yaml_emitter_t, file io.Writer) {
+	if emitter.write_handler != nil {
+		panic("must set the output target only once")
+	}
+	emitter.write_handler = yaml_file_write_handler
+	emitter.output_file = file
+}
+
+// Set the output encoding.
+func yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_encoding_t) {
+	if emitter.encoding != yaml_ANY_ENCODING {
+		panic("must set the output encoding only once")
+	}
+	emitter.encoding = encoding
+}
+
+// Set the canonical output style.
+func yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) {
+	emitter.canonical = canonical
+}
+
+//// Set the indentation increment.
+func yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) {
+	if indent < 2 || indent > 9 {
+		indent = 2
+	}
+	emitter.best_indent = indent
+}
+
+// Set the preferred line width.
+func yaml_emitter_set_width(emitter *yaml_emitter_t, width int) {
+	if width < 0 {
+		width = -1
+	}
+	emitter.best_width = width
+}
+
+// Set if unescaped non-ASCII characters are allowed.
+func yaml_emitter_set_unicode(emitter *yaml_emitter_t, unicode bool) {
+	emitter.unicode = unicode
+}
+
+// Set the preferred line break character.
+func yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_break_t) {
+	emitter.line_break = line_break
+}
+
+///*
+// * Destroy a token object.
+// */
+//
+//YAML_DECLARE(void)
+//yaml_token_delete(yaml_token_t *token)
+//{
+//    assert(token);  // Non-NULL token object expected.
+//
+//    switch (token.type)
+//    {
+//        case YAML_TAG_DIRECTIVE_TOKEN:
+//            yaml_free(token.data.tag_directive.handle);
+//            yaml_free(token.data.tag_directive.prefix);
+//            break;
+//
+//        case YAML_ALIAS_TOKEN:
+//            yaml_free(token.data.alias.value);
+//            break;
+//
+//        case YAML_ANCHOR_TOKEN:
+//            yaml_free(token.data.anchor.value);
+//            break;
+//
+//        case YAML_TAG_TOKEN:
+//            yaml_free(token.data.tag.handle);
+//            yaml_free(token.data.tag.suffix);
+//            break;
+//
+//        case YAML_SCALAR_TOKEN:
+//            yaml_free(token.data.scalar.value);
+//            break;
+//
+//        default:
+//            break;
+//    }
+//
+//    memset(token, 0, sizeof(yaml_token_t));
+//}
+//
+///*
+// * Check if a string is a valid UTF-8 sequence.
+// *
+// * Check 'reader.c' for more details on UTF-8 encoding.
+// */
+//
+//static int
+//yaml_check_utf8(yaml_char_t *start, size_t length)
+//{
+//    yaml_char_t *end = start+length;
+//    yaml_char_t *pointer = start;
+//
+//    while (pointer < end) {
+//        unsigned char octet;
+//        unsigned int width;
+//        unsigned int value;
+//        size_t k;
+//
+//        octet = pointer[0];
+//        width = (octet & 0x80) == 0x00 ? 1 :
+//                (octet & 0xE0) == 0xC0 ? 2 :
+//                (octet & 0xF0) == 0xE0 ? 3 :
+//                (octet & 0xF8) == 0xF0 ? 4 : 0;
+//        value = (octet & 0x80) == 0x00 ? octet & 0x7F :
+//                (octet & 0xE0) == 0xC0 ? octet & 0x1F :
+//                (octet & 0xF0) == 0xE0 ? octet & 0x0F :
+//                (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;
+//        if (!width) return 0;
+//        if (pointer+width > end) return 0;
+//        for (k = 1; k < width; k ++) {
+//            octet = pointer[k];
+//            if ((octet & 0xC0) != 0x80) return 0;
+//            value = (value << 6) + (octet & 0x3F);
+//        }
+//        if (!((width == 1) ||
+//            (width == 2 && value >= 0x80) ||
+//            (width == 3 && value >= 0x800) ||
+//            (width == 4 && value >= 0x10000))) return 0;
+//
+//        pointer += width;
+//    }
+//
+//    return 1;
+//}
+//
+
+// Create STREAM-START.
+func yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) bool {
+	*event = yaml_event_t{
+		typ:      yaml_STREAM_START_EVENT,
+		encoding: encoding,
+	}
+	return true
+}
+
+// Create STREAM-END.
+func yaml_stream_end_event_initialize(event *yaml_event_t) bool {
+	*event = yaml_event_t{
+		typ: yaml_STREAM_END_EVENT,
+	}
+	return true
+}
+
+// Create DOCUMENT-START.
+func yaml_document_start_event_initialize(event *yaml_event_t, version_directive *yaml_version_directive_t,
+	tag_directives []yaml_tag_directive_t, implicit bool) bool {
+	*event = yaml_event_t{
+		typ:               yaml_DOCUMENT_START_EVENT,
+		version_directive: version_directive,
+		tag_directives:    tag_directives,
+		implicit:          implicit,
+	}
+	return true
+}
+
+// Create DOCUMENT-END.
+func yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) bool {
+	*event = yaml_event_t{
+		typ:      yaml_DOCUMENT_END_EVENT,
+		implicit: implicit,
+	}
+	return true
+}
+
+///*
+// * Create ALIAS.
+// */
+//
+//YAML_DECLARE(int)
+//yaml_alias_event_initialize(event *yaml_event_t, anchor *yaml_char_t)
+//{
+//    mark yaml_mark_t = { 0, 0, 0 }
+//    anchor_copy *yaml_char_t = NULL
+//
+//    assert(event) // Non-NULL event object is expected.
+//    assert(anchor) // Non-NULL anchor is expected.
+//
+//    if (!yaml_check_utf8(anchor, strlen((char *)anchor))) return 0
+//
+//    anchor_copy = yaml_strdup(anchor)
+//    if (!anchor_copy)
+//        return 0
+//
+//    ALIAS_EVENT_INIT(*event, anchor_copy, mark, mark)
+//
+//    return 1
+//}
+
+// Create SCALAR.
+func yaml_scalar_event_initialize(event *yaml_event_t, anchor, tag, value []byte, plain_implicit, quoted_implicit bool, style yaml_scalar_style_t) bool {
+	*event = yaml_event_t{
+		typ:             yaml_SCALAR_EVENT,
+		anchor:          anchor,
+		tag:             tag,
+		value:           value,
+		implicit:        plain_implicit,
+		quoted_implicit: quoted_implicit,
+		style:           yaml_style_t(style),
+	}
+	return true
+}
+
+// Create SEQUENCE-START.
+func yaml_sequence_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_sequence_style_t) bool {
+	*event = yaml_event_t{
+		typ:      yaml_SEQUENCE_START_EVENT,
+		anchor:   anchor,
+		tag:      tag,
+		implicit: implicit,
+		style:    yaml_style_t(style),
+	}
+	return true
+}
+
+// Create SEQUENCE-END.
+func yaml_sequence_end_event_initialize(event *yaml_event_t) bool {
+	*event = yaml_event_t{
+		typ: yaml_SEQUENCE_END_EVENT,
+	}
+	return true
+}
+
+// Create MAPPING-START.
+func yaml_mapping_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_mapping_style_t) bool {
+	*event = yaml_event_t{
+		typ:      yaml_MAPPING_START_EVENT,
+		anchor:   anchor,
+		tag:      tag,
+		implicit: implicit,
+		style:    yaml_style_t(style),
+	}
+	return true
+}
+
+// Create MAPPING-END.
+func yaml_mapping_end_event_initialize(event *yaml_event_t) bool {
+	*event = yaml_event_t{
+		typ: yaml_MAPPING_END_EVENT,
+	}
+	return true
+}
+
+// Destroy an event object.
+func yaml_event_delete(event *yaml_event_t) {
+	*event = yaml_event_t{}
+}
+
+///*
+// * Create a document object.
+// */
+//
+//YAML_DECLARE(int)
+//yaml_document_initialize(document *yaml_document_t,
+//        version_directive *yaml_version_directive_t,
+//        tag_directives_start *yaml_tag_directive_t,
+//        tag_directives_end *yaml_tag_directive_t,
+//        start_implicit int, end_implicit int)
+//{
+//    struct {
+//        error yaml_error_type_t
+//    } context
+//    struct {
+//        start *yaml_node_t
+//        end *yaml_node_t
+//        top *yaml_node_t
+//    } nodes = { NULL, NULL, NULL }
+//    version_directive_copy *yaml_version_directive_t = NULL
+//    struct {
+//        start *yaml_tag_directive_t
+//        end *yaml_tag_directive_t
+//        top *yaml_tag_directive_t
+//    } tag_directives_copy = { NULL, NULL, NULL }
+//    value yaml_tag_directive_t = { NULL, NULL }
+//    mark yaml_mark_t = { 0, 0, 0 }
+//
+//    assert(document) // Non-NULL document object is expected.
+//    assert((tag_directives_start && tag_directives_end) ||
+//            (tag_directives_start == tag_directives_end))
+//                            // Valid tag directives are expected.
+//
+//    if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error
+//
+//    if (version_directive) {
+//        version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t))
+//        if (!version_directive_copy) goto error
+//        version_directive_copy.major = version_directive.major
+//        version_directive_copy.minor = version_directive.minor
+//    }
+//
+//    if (tag_directives_start != tag_directives_end) {
+//        tag_directive *yaml_tag_directive_t
+//        if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE))
+//            goto error
+//        for (tag_directive = tag_directives_start
+//                tag_directive != tag_directives_end; tag_directive ++) {
+//            assert(tag_directive.handle)
+//            assert(tag_directive.prefix)
+//            if (!yaml_check_utf8(tag_directive.handle,
+//                        strlen((char *)tag_directive.handle)))
+//                goto error
+//            if (!yaml_check_utf8(tag_directive.prefix,
+//                        strlen((char *)tag_directive.prefix)))
+//                goto error
+//            value.handle = yaml_strdup(tag_directive.handle)
+//            value.prefix = yaml_strdup(tag_directive.prefix)
+//            if (!value.handle || !value.prefix) goto error
+//            if (!PUSH(&context, tag_directives_copy, value))
+//                goto error
+//            value.handle = NULL
+//            value.prefix = NULL
+//        }
+//    }
+//
+//    DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy,
+//            tag_directives_copy.start, tag_directives_copy.top,
+//            start_implicit, end_implicit, mark, mark)
+//
+//    return 1
+//
+//error:
+//    STACK_DEL(&context, nodes)
+//    yaml_free(version_directive_copy)
+//    while (!STACK_EMPTY(&context, tag_directives_copy)) {
+//        value yaml_tag_directive_t = POP(&context, tag_directives_copy)
+//        yaml_free(value.handle)
+//        yaml_free(value.prefix)
+//    }
+//    STACK_DEL(&context, tag_directives_copy)
+//    yaml_free(value.handle)
+//    yaml_free(value.prefix)
+//
+//    return 0
+//}
+//
+///*
+// * Destroy a document object.
+// */
+//
+//YAML_DECLARE(void)
+//yaml_document_delete(document *yaml_document_t)
+//{
+//    struct {
+//        error yaml_error_type_t
+//    } context
+//    tag_directive *yaml_tag_directive_t
+//
+//    context.error = YAML_NO_ERROR // Eliminate a compliler warning.
+//
+//    assert(document) // Non-NULL document object is expected.
+//
+//    while (!STACK_EMPTY(&context, document.nodes)) {
+//        node yaml_node_t = POP(&context, document.nodes)
+//        yaml_free(node.tag)
+//        switch (node.type) {
+//            case YAML_SCALAR_NODE:
+//                yaml_free(node.data.scalar.value)
+//                break
+//            case YAML_SEQUENCE_NODE:
+//                STACK_DEL(&context, node.data.sequence.items)
+//                break
+//            case YAML_MAPPING_NODE:
+//                STACK_DEL(&context, node.data.mapping.pairs)
+//                break
+//            default:
+//                assert(0) // Should not happen.
+//        }
+//    }
+//    STACK_DEL(&context, document.nodes)
+//
+//    yaml_free(document.version_directive)
+//    for (tag_directive = document.tag_directives.start
+//            tag_directive != document.tag_directives.end
+//            tag_directive++) {
+//        yaml_free(tag_directive.handle)
+//        yaml_free(tag_directive.prefix)
+//    }
+//    yaml_free(document.tag_directives.start)
+//
+//    memset(document, 0, sizeof(yaml_document_t))
+//}
+//
+///**
+// * Get a document node.
+// */
+//
+//YAML_DECLARE(yaml_node_t *)
+//yaml_document_get_node(document *yaml_document_t, index int)
+//{
+//    assert(document) // Non-NULL document object is expected.
+//
+//    if (index > 0 && document.nodes.start + index <= document.nodes.top) {
+//        return document.nodes.start + index - 1
+//    }
+//    return NULL
+//}
+//
+///**
+// * Get the root object.
+// */
+//
+//YAML_DECLARE(yaml_node_t *)
+//yaml_document_get_root_node(document *yaml_document_t)
+//{
+//    assert(document) // Non-NULL document object is expected.
+//
+//    if (document.nodes.top != document.nodes.start) {
+//        return document.nodes.start
+//    }
+//    return NULL
+//}
+//
+///*
+// * Add a scalar node to a document.
+// */
+//
+//YAML_DECLARE(int)
+//yaml_document_add_scalar(document *yaml_document_t,
+//        tag *yaml_char_t, value *yaml_char_t, length int,
+//        style yaml_scalar_style_t)
+//{
+//    struct {
+//        error yaml_error_type_t
+//    } context
+//    mark yaml_mark_t = { 0, 0, 0 }
+//    tag_copy *yaml_char_t = NULL
+//    value_copy *yaml_char_t = NULL
+//    node yaml_node_t
+//
+//    assert(document) // Non-NULL document object is expected.
+//    assert(value) // Non-NULL value is expected.
+//
+//    if (!tag) {
+//        tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG
+//    }
+//
+//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error
+//    tag_copy = yaml_strdup(tag)
+//    if (!tag_copy) goto error
+//
+//    if (length < 0) {
+//        length = strlen((char *)value)
+//    }
+//
+//    if (!yaml_check_utf8(value, length)) goto error
+//    value_copy = yaml_malloc(length+1)
+//    if (!value_copy) goto error
+//    memcpy(value_copy, value, length)
+//    value_copy[length] = '\0'
+//
+//    SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark)
+//    if (!PUSH(&context, document.nodes, node)) goto error
+//
+//    return document.nodes.top - document.nodes.start
+//
+//error:
+//    yaml_free(tag_copy)
+//    yaml_free(value_copy)
+//
+//    return 0
+//}
+//
+///*
+// * Add a sequence node to a document.
+// */
+//
+//YAML_DECLARE(int)
+//yaml_document_add_sequence(document *yaml_document_t,
+//        tag *yaml_char_t, style yaml_sequence_style_t)
+//{
+//    struct {
+//        error yaml_error_type_t
+//    } context
+//    mark yaml_mark_t = { 0, 0, 0 }
+//    tag_copy *yaml_char_t = NULL
+//    struct {
+//        start *yaml_node_item_t
+//        end *yaml_node_item_t
+//        top *yaml_node_item_t
+//    } items = { NULL, NULL, NULL }
+//    node yaml_node_t
+//
+//    assert(document) // Non-NULL document object is expected.
+//
+//    if (!tag) {
+//        tag = (yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG
+//    }
+//
+//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error
+//    tag_copy = yaml_strdup(tag)
+//    if (!tag_copy) goto error
+//
+//    if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error
+//
+//    SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end,
+//            style, mark, mark)
+//    if (!PUSH(&context, document.nodes, node)) goto error
+//
+//    return document.nodes.top - document.nodes.start
+//
+//error:
+//    STACK_DEL(&context, items)
+//    yaml_free(tag_copy)
+//
+//    return 0
+//}
+//
+///*
+// * Add a mapping node to a document.
+// */
+//
+//YAML_DECLARE(int)
+//yaml_document_add_mapping(document *yaml_document_t,
+//        tag *yaml_char_t, style yaml_mapping_style_t)
+//{
+//    struct {
+//        error yaml_error_type_t
+//    } context
+//    mark yaml_mark_t = { 0, 0, 0 }
+//    tag_copy *yaml_char_t = NULL
+//    struct {
+//        start *yaml_node_pair_t
+//        end *yaml_node_pair_t
+//        top *yaml_node_pair_t
+//    } pairs = { NULL, NULL, NULL }
+//    node yaml_node_t
+//
+//    assert(document) // Non-NULL document object is expected.
+//
+//    if (!tag) {
+//        tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG
+//    }
+//
+//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error
+//    tag_copy = yaml_strdup(tag)
+//    if (!tag_copy) goto error
+//
+//    if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error
+//
+//    MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end,
+//            style, mark, mark)
+//    if (!PUSH(&context, document.nodes, node)) goto error
+//
+//    return document.nodes.top - document.nodes.start
+//
+//error:
+//    STACK_DEL(&context, pairs)
+//    yaml_free(tag_copy)
+//
+//    return 0
+//}
+//
+///*
+// * Append an item to a sequence node.
+// */
+//
+//YAML_DECLARE(int)
+//yaml_document_append_sequence_item(document *yaml_document_t,
+//        sequence int, item int)
+//{
+//    struct {
+//        error yaml_error_type_t
+//    } context
+//
+//    assert(document) // Non-NULL document is required.
+//    assert(sequence > 0
+//            && document.nodes.start + sequence <= document.nodes.top)
+//                            // Valid sequence id is required.
+//    assert(document.nodes.start[sequence-1].type == YAML_SEQUENCE_NODE)
+//                            // A sequence node is required.
+//    assert(item > 0 && document.nodes.start + item <= document.nodes.top)
+//                            // Valid item id is required.
+//
+//    if (!PUSH(&context,
+//                document.nodes.start[sequence-1].data.sequence.items, item))
+//        return 0
+//
+//    return 1
+//}
+//
+///*
+// * Append a pair of a key and a value to a mapping node.
+// */
+//
+//YAML_DECLARE(int)
+//yaml_document_append_mapping_pair(document *yaml_document_t,
+//        mapping int, key int, value int)
+//{
+//    struct {
+//        error yaml_error_type_t
+//    } context
+//
+//    pair yaml_node_pair_t
+//
+//    assert(document) // Non-NULL document is required.
+//    assert(mapping > 0
+//            && document.nodes.start + mapping <= document.nodes.top)
+//                            // Valid mapping id is required.
+//    assert(document.nodes.start[mapping-1].type == YAML_MAPPING_NODE)
+//                            // A mapping node is required.
+//    assert(key > 0 && document.nodes.start + key <= document.nodes.top)
+//                            // Valid key id is required.
+//    assert(value > 0 && document.nodes.start + value <= document.nodes.top)
+//                            // Valid value id is required.
+//
+//    pair.key = key
+//    pair.value = value
+//
+//    if (!PUSH(&context,
+//                document.nodes.start[mapping-1].data.mapping.pairs, pair))
+//        return 0
+//
+//    return 1
+//}
+//
+//

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/decode.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/decode.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/decode.go
new file mode 100644
index 0000000..085cddc
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/decode.go
@@ -0,0 +1,683 @@
+package yaml
+
+import (
+	"encoding"
+	"encoding/base64"
+	"fmt"
+	"math"
+	"reflect"
+	"strconv"
+	"time"
+)
+
+const (
+	documentNode = 1 << iota
+	mappingNode
+	sequenceNode
+	scalarNode
+	aliasNode
+)
+
+type node struct {
+	kind         int
+	line, column int
+	tag          string
+	value        string
+	implicit     bool
+	children     []*node
+	anchors      map[string]*node
+}
+
+// ----------------------------------------------------------------------------
+// Parser, produces a node tree out of a libyaml event stream.
+
+type parser struct {
+	parser yaml_parser_t
+	event  yaml_event_t
+	doc    *node
+}
+
+func newParser(b []byte) *parser {
+	p := parser{}
+	if !yaml_parser_initialize(&p.parser) {
+		panic("failed to initialize YAML emitter")
+	}
+
+	if len(b) == 0 {
+		b = []byte{'\n'}
+	}
+
+	yaml_parser_set_input_string(&p.parser, b)
+
+	p.skip()
+	if p.event.typ != yaml_STREAM_START_EVENT {
+		panic("expected stream start event, got " + strconv.Itoa(int(p.event.typ)))
+	}
+	p.skip()
+	return &p
+}
+
+func (p *parser) destroy() {
+	if p.event.typ != yaml_NO_EVENT {
+		yaml_event_delete(&p.event)
+	}
+	yaml_parser_delete(&p.parser)
+}
+
+func (p *parser) skip() {
+	if p.event.typ != yaml_NO_EVENT {
+		if p.event.typ == yaml_STREAM_END_EVENT {
+			failf("attempted to go past the end of stream; corrupted value?")
+		}
+		yaml_event_delete(&p.event)
+	}
+	if !yaml_parser_parse(&p.parser, &p.event) {
+		p.fail()
+	}
+}
+
+func (p *parser) fail() {
+	var where string
+	var line int
+	if p.parser.problem_mark.line != 0 {
+		line = p.parser.problem_mark.line
+	} else if p.parser.context_mark.line != 0 {
+		line = p.parser.context_mark.line
+	}
+	if line != 0 {
+		where = "line " + strconv.Itoa(line) + ": "
+	}
+	var msg string
+	if len(p.parser.problem) > 0 {
+		msg = p.parser.problem
+	} else {
+		msg = "unknown problem parsing YAML content"
+	}
+	failf("%s%s", where, msg)
+}
+
+func (p *parser) anchor(n *node, anchor []byte) {
+	if anchor != nil {
+		p.doc.anchors[string(anchor)] = n
+	}
+}
+
+func (p *parser) parse() *node {
+	switch p.event.typ {
+	case yaml_SCALAR_EVENT:
+		return p.scalar()
+	case yaml_ALIAS_EVENT:
+		return p.alias()
+	case yaml_MAPPING_START_EVENT:
+		return p.mapping()
+	case yaml_SEQUENCE_START_EVENT:
+		return p.sequence()
+	case yaml_DOCUMENT_START_EVENT:
+		return p.document()
+	case yaml_STREAM_END_EVENT:
+		// Happens when attempting to decode an empty buffer.
+		return nil
+	default:
+		panic("attempted to parse unknown event: " + strconv.Itoa(int(p.event.typ)))
+	}
+	panic("unreachable")
+}
+
+func (p *parser) node(kind int) *node {
+	return &node{
+		kind:   kind,
+		line:   p.event.start_mark.line,
+		column: p.event.start_mark.column,
+	}
+}
+
+func (p *parser) document() *node {
+	n := p.node(documentNode)
+	n.anchors = make(map[string]*node)
+	p.doc = n
+	p.skip()
+	n.children = append(n.children, p.parse())
+	if p.event.typ != yaml_DOCUMENT_END_EVENT {
+		panic("expected end of document event but got " + strconv.Itoa(int(p.event.typ)))
+	}
+	p.skip()
+	return n
+}
+
+func (p *parser) alias() *node {
+	n := p.node(aliasNode)
+	n.value = string(p.event.anchor)
+	p.skip()
+	return n
+}
+
+func (p *parser) scalar() *node {
+	n := p.node(scalarNode)
+	n.value = string(p.event.value)
+	n.tag = string(p.event.tag)
+	n.implicit = p.event.implicit
+	p.anchor(n, p.event.anchor)
+	p.skip()
+	return n
+}
+
+func (p *parser) sequence() *node {
+	n := p.node(sequenceNode)
+	p.anchor(n, p.event.anchor)
+	p.skip()
+	for p.event.typ != yaml_SEQUENCE_END_EVENT {
+		n.children = append(n.children, p.parse())
+	}
+	p.skip()
+	return n
+}
+
+func (p *parser) mapping() *node {
+	n := p.node(mappingNode)
+	p.anchor(n, p.event.anchor)
+	p.skip()
+	for p.event.typ != yaml_MAPPING_END_EVENT {
+		n.children = append(n.children, p.parse(), p.parse())
+	}
+	p.skip()
+	return n
+}
+
+// ----------------------------------------------------------------------------
+// Decoder, unmarshals a node into a provided value.
+
+type decoder struct {
+	doc     *node
+	aliases map[string]bool
+	mapType reflect.Type
+	terrors []string
+}
+
+var (
+	mapItemType    = reflect.TypeOf(MapItem{})
+	durationType   = reflect.TypeOf(time.Duration(0))
+	defaultMapType = reflect.TypeOf(map[interface{}]interface{}{})
+	ifaceType      = defaultMapType.Elem()
+)
+
+func newDecoder() *decoder {
+	d := &decoder{mapType: defaultMapType}
+	d.aliases = make(map[string]bool)
+	return d
+}
+
+func (d *decoder) terror(n *node, tag string, out reflect.Value) {
+	if n.tag != "" {
+		tag = n.tag
+	}
+	value := n.value
+	if tag != yaml_SEQ_TAG && tag != yaml_MAP_TAG {
+		if len(value) > 10 {
+			value = " `" + value[:7] + "...`"
+		} else {
+			value = " `" + value + "`"
+		}
+	}
+	d.terrors = append(d.terrors, fmt.Sprintf("line %d: cannot unmarshal %s%s into %s", n.line+1, shortTag(tag), value, out.Type()))
+}
+
+func (d *decoder) callUnmarshaler(n *node, u Unmarshaler) (good bool) {
+	terrlen := len(d.terrors)
+	err := u.UnmarshalYAML(func(v interface{}) (err error) {
+		defer handleErr(&err)
+		d.unmarshal(n, reflect.ValueOf(v))
+		if len(d.terrors) > terrlen {
+			issues := d.terrors[terrlen:]
+			d.terrors = d.terrors[:terrlen]
+			return &TypeError{issues}
+		}
+		return nil
+	})
+	if e, ok := err.(*TypeError); ok {
+		d.terrors = append(d.terrors, e.Errors...)
+		return false
+	}
+	if err != nil {
+		fail(err)
+	}
+	return true
+}
+
+// d.prepare initializes and dereferences pointers and calls UnmarshalYAML
+// if a value is found to implement it.
+// It returns the initialized and dereferenced out value, whether
+// unmarshalling was already done by UnmarshalYAML, and if so whether
+// its types unmarshalled appropriately.
+//
+// If n holds a null value, prepare returns before doing anything.
+func (d *decoder) prepare(n *node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) {
+	if n.tag == yaml_NULL_TAG || n.kind == scalarNode && n.tag == "" && (n.value == "null" || n.value == "") {
+		return out, false, false
+	}
+	again := true
+	for again {
+		again = false
+		if out.Kind() == reflect.Ptr {
+			if out.IsNil() {
+				out.Set(reflect.New(out.Type().Elem()))
+			}
+			out = out.Elem()
+			again = true
+		}
+		if out.CanAddr() {
+			if u, ok := out.Addr().Interface().(Unmarshaler); ok {
+				good = d.callUnmarshaler(n, u)
+				return out, true, good
+			}
+		}
+	}
+	return out, false, false
+}
+
+func (d *decoder) unmarshal(n *node, out reflect.Value) (good bool) {
+	switch n.kind {
+	case documentNode:
+		return d.document(n, out)
+	case aliasNode:
+		return d.alias(n, out)
+	}
+	out, unmarshaled, good := d.prepare(n, out)
+	if unmarshaled {
+		return good
+	}
+	switch n.kind {
+	case scalarNode:
+		good = d.scalar(n, out)
+	case mappingNode:
+		good = d.mapping(n, out)
+	case sequenceNode:
+		good = d.sequence(n, out)
+	default:
+		panic("internal error: unknown node kind: " + strconv.Itoa(n.kind))
+	}
+	return good
+}
+
+func (d *decoder) document(n *node, out reflect.Value) (good bool) {
+	if len(n.children) == 1 {
+		d.doc = n
+		d.unmarshal(n.children[0], out)
+		return true
+	}
+	return false
+}
+
+func (d *decoder) alias(n *node, out reflect.Value) (good bool) {
+	an, ok := d.doc.anchors[n.value]
+	if !ok {
+		failf("unknown anchor '%s' referenced", n.value)
+	}
+	if d.aliases[n.value] {
+		failf("anchor '%s' value contains itself", n.value)
+	}
+	d.aliases[n.value] = true
+	good = d.unmarshal(an, out)
+	delete(d.aliases, n.value)
+	return good
+}
+
+var zeroValue reflect.Value
+
+func resetMap(out reflect.Value) {
+	for _, k := range out.MapKeys() {
+		out.SetMapIndex(k, zeroValue)
+	}
+}
+
+func (d *decoder) scalar(n *node, out reflect.Value) (good bool) {
+	var tag string
+	var resolved interface{}
+	if n.tag == "" && !n.implicit {
+		tag = yaml_STR_TAG
+		resolved = n.value
+	} else {
+		tag, resolved = resolve(n.tag, n.value)
+		if tag == yaml_BINARY_TAG {
+			data, err := base64.StdEncoding.DecodeString(resolved.(string))
+			if err != nil {
+				failf("!!binary value contains invalid base64 data")
+			}
+			resolved = string(data)
+		}
+	}
+	if resolved == nil {
+		if out.Kind() == reflect.Map && !out.CanAddr() {
+			resetMap(out)
+		} else {
+			out.Set(reflect.Zero(out.Type()))
+		}
+		return true
+	}
+	if s, ok := resolved.(string); ok && out.CanAddr() {
+		if u, ok := out.Addr().Interface().(encoding.TextUnmarshaler); ok {
+			err := u.UnmarshalText([]byte(s))
+			if err != nil {
+				fail(err)
+			}
+			return true
+		}
+	}
+	switch out.Kind() {
+	case reflect.String:
+		if tag == yaml_BINARY_TAG {
+			out.SetString(resolved.(string))
+			good = true
+		} else if resolved != nil {
+			out.SetString(n.value)
+			good = true
+		}
+	case reflect.Interface:
+		if resolved == nil {
+			out.Set(reflect.Zero(out.Type()))
+		} else {
+			out.Set(reflect.ValueOf(resolved))
+		}
+		good = true
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		switch resolved := resolved.(type) {
+		case int:
+			if !out.OverflowInt(int64(resolved)) {
+				out.SetInt(int64(resolved))
+				good = true
+			}
+		case int64:
+			if !out.OverflowInt(resolved) {
+				out.SetInt(resolved)
+				good = true
+			}
+		case uint64:
+			if resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) {
+				out.SetInt(int64(resolved))
+				good = true
+			}
+		case float64:
+			if resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) {
+				out.SetInt(int64(resolved))
+				good = true
+			}
+		case string:
+			if out.Type() == durationType {
+				d, err := time.ParseDuration(resolved)
+				if err == nil {
+					out.SetInt(int64(d))
+					good = true
+				}
+			}
+		}
+	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+		switch resolved := resolved.(type) {
+		case int:
+			if resolved >= 0 && !out.OverflowUint(uint64(resolved)) {
+				out.SetUint(uint64(resolved))
+				good = true
+			}
+		case int64:
+			if resolved >= 0 && !out.OverflowUint(uint64(resolved)) {
+				out.SetUint(uint64(resolved))
+				good = true
+			}
+		case uint64:
+			if !out.OverflowUint(uint64(resolved)) {
+				out.SetUint(uint64(resolved))
+				good = true
+			}
+		case float64:
+			if resolved <= math.MaxUint64 && !out.OverflowUint(uint64(resolved)) {
+				out.SetUint(uint64(resolved))
+				good = true
+			}
+		}
+	case reflect.Bool:
+		switch resolved := resolved.(type) {
+		case bool:
+			out.SetBool(resolved)
+			good = true
+		}
+	case reflect.Float32, reflect.Float64:
+		switch resolved := resolved.(type) {
+		case int:
+			out.SetFloat(float64(resolved))
+			good = true
+		case int64:
+			out.SetFloat(float64(resolved))
+			good = true
+		case uint64:
+			out.SetFloat(float64(resolved))
+			good = true
+		case float64:
+			out.SetFloat(resolved)
+			good = true
+		}
+	case reflect.Ptr:
+		if out.Type().Elem() == reflect.TypeOf(resolved) {
+			// TODO DOes this make sense? When is out a Ptr except when decoding a nil value?
+			elem := reflect.New(out.Type().Elem())
+			elem.Elem().Set(reflect.ValueOf(resolved))
+			out.Set(elem)
+			good = true
+		}
+	}
+	if !good {
+		d.terror(n, tag, out)
+	}
+	return good
+}
+
+func settableValueOf(i interface{}) reflect.Value {
+	v := reflect.ValueOf(i)
+	sv := reflect.New(v.Type()).Elem()
+	sv.Set(v)
+	return sv
+}
+
+func (d *decoder) sequence(n *node, out reflect.Value) (good bool) {
+	l := len(n.children)
+
+	var iface reflect.Value
+	switch out.Kind() {
+	case reflect.Slice:
+		out.Set(reflect.MakeSlice(out.Type(), l, l))
+	case reflect.Interface:
+		// No type hints. Will have to use a generic sequence.
+		iface = out
+		out = settableValueOf(make([]interface{}, l))
+	default:
+		d.terror(n, yaml_SEQ_TAG, out)
+		return false
+	}
+	et := out.Type().Elem()
+
+	j := 0
+	for i := 0; i < l; i++ {
+		e := reflect.New(et).Elem()
+		if ok := d.unmarshal(n.children[i], e); ok {
+			out.Index(j).Set(e)
+			j++
+		}
+	}
+	out.Set(out.Slice(0, j))
+	if iface.IsValid() {
+		iface.Set(out)
+	}
+	return true
+}
+
+func (d *decoder) mapping(n *node, out reflect.Value) (good bool) {
+	switch out.Kind() {
+	case reflect.Struct:
+		return d.mappingStruct(n, out)
+	case reflect.Slice:
+		return d.mappingSlice(n, out)
+	case reflect.Map:
+		// okay
+	case reflect.Interface:
+		if d.mapType.Kind() == reflect.Map {
+			iface := out
+			out = reflect.MakeMap(d.mapType)
+			iface.Set(out)
+		} else {
+			slicev := reflect.New(d.mapType).Elem()
+			if !d.mappingSlice(n, slicev) {
+				return false
+			}
+			out.Set(slicev)
+			return true
+		}
+	default:
+		d.terror(n, yaml_MAP_TAG, out)
+		return false
+	}
+	outt := out.Type()
+	kt := outt.Key()
+	et := outt.Elem()
+
+	mapType := d.mapType
+	if outt.Key() == ifaceType && outt.Elem() == ifaceType {
+		d.mapType = outt
+	}
+
+	if out.IsNil() {
+		out.Set(reflect.MakeMap(outt))
+	}
+	l := len(n.children)
+	for i := 0; i < l; i += 2 {
+		if isMerge(n.children[i]) {
+			d.merge(n.children[i+1], out)
+			continue
+		}
+		k := reflect.New(kt).Elem()
+		if d.unmarshal(n.children[i], k) {
+			kkind := k.Kind()
+			if kkind == reflect.Interface {
+				kkind = k.Elem().Kind()
+			}
+			if kkind == reflect.Map || kkind == reflect.Slice {
+				failf("invalid map key: %#v", k.Interface())
+			}
+			e := reflect.New(et).Elem()
+			if d.unmarshal(n.children[i+1], e) {
+				out.SetMapIndex(k, e)
+			}
+		}
+	}
+	d.mapType = mapType
+	return true
+}
+
+func (d *decoder) mappingSlice(n *node, out reflect.Value) (good bool) {
+	outt := out.Type()
+	if outt.Elem() != mapItemType {
+		d.terror(n, yaml_MAP_TAG, out)
+		return false
+	}
+
+	mapType := d.mapType
+	d.mapType = outt
+
+	var slice []MapItem
+	var l = len(n.children)
+	for i := 0; i < l; i += 2 {
+		if isMerge(n.children[i]) {
+			d.merge(n.children[i+1], out)
+			continue
+		}
+		item := MapItem{}
+		k := reflect.ValueOf(&item.Key).Elem()
+		if d.unmarshal(n.children[i], k) {
+			v := reflect.ValueOf(&item.Value).Elem()
+			if d.unmarshal(n.children[i+1], v) {
+				slice = append(slice, item)
+			}
+		}
+	}
+	out.Set(reflect.ValueOf(slice))
+	d.mapType = mapType
+	return true
+}
+
+func (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) {
+	sinfo, err := getStructInfo(out.Type())
+	if err != nil {
+		panic(err)
+	}
+	name := settableValueOf("")
+	l := len(n.children)
+
+	var inlineMap reflect.Value
+	var elemType reflect.Type
+	if sinfo.InlineMap != -1 {
+		inlineMap = out.Field(sinfo.InlineMap)
+		inlineMap.Set(reflect.New(inlineMap.Type()).Elem())
+		elemType = inlineMap.Type().Elem()
+	}
+
+	for i := 0; i < l; i += 2 {
+		ni := n.children[i]
+		if isMerge(ni) {
+			d.merge(n.children[i+1], out)
+			continue
+		}
+		if !d.unmarshal(ni, name) {
+			continue
+		}
+		if info, ok := sinfo.FieldsMap[name.String()]; ok {
+			var field reflect.Value
+			if info.Inline == nil {
+				field = out.Field(info.Num)
+			} else {
+				field = out.FieldByIndex(info.Inline)
+			}
+			d.unmarshal(n.children[i+1], field)
+		} else if sinfo.InlineMap != -1 {
+			if inlineMap.IsNil() {
+				inlineMap.Set(reflect.MakeMap(inlineMap.Type()))
+			}
+			value := reflect.New(elemType).Elem()
+			d.unmarshal(n.children[i+1], value)
+			inlineMap.SetMapIndex(name, value)
+		}
+	}
+	return true
+}
+
+func failWantMap() {
+	failf("map merge requires map or sequence of maps as the value")
+}
+
+func (d *decoder) merge(n *node, out reflect.Value) {
+	switch n.kind {
+	case mappingNode:
+		d.unmarshal(n, out)
+	case aliasNode:
+		an, ok := d.doc.anchors[n.value]
+		if ok && an.kind != mappingNode {
+			failWantMap()
+		}
+		d.unmarshal(n, out)
+	case sequenceNode:
+		// Step backwards as earlier nodes take precedence.
+		for i := len(n.children) - 1; i >= 0; i-- {
+			ni := n.children[i]
+			if ni.kind == aliasNode {
+				an, ok := d.doc.anchors[ni.value]
+				if ok && an.kind != mappingNode {
+					failWantMap()
+				}
+			} else if ni.kind != mappingNode {
+				failWantMap()
+			}
+			d.unmarshal(ni, out)
+		}
+	default:
+		failWantMap()
+	}
+}
+
+func isMerge(n *node) bool {
+	return n.kind == scalarNode && n.value == "<<" && (n.implicit == true || n.tag == yaml_MERGE_TAG)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/decode_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/decode_test.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/decode_test.go
new file mode 100644
index 0000000..04fdd9e
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/decode_test.go
@@ -0,0 +1,966 @@
+package yaml_test
+
+import (
+	"errors"
+	. "gopkg.in/check.v1"
+	"gopkg.in/yaml.v2"
+	"math"
+	"net"
+	"reflect"
+	"strings"
+	"time"
+)
+
+var unmarshalIntTest = 123
+
+var unmarshalTests = []struct {
+	data  string
+	value interface{}
+}{
+	{
+		"",
+		&struct{}{},
+	}, {
+		"{}", &struct{}{},
+	}, {
+		"v: hi",
+		map[string]string{"v": "hi"},
+	}, {
+		"v: hi", map[string]interface{}{"v": "hi"},
+	}, {
+		"v: true",
+		map[string]string{"v": "true"},
+	}, {
+		"v: true",
+		map[string]interface{}{"v": true},
+	}, {
+		"v: 10",
+		map[string]interface{}{"v": 10},
+	}, {
+		"v: 0b10",
+		map[string]interface{}{"v": 2},
+	}, {
+		"v: 0xA",
+		map[string]interface{}{"v": 10},
+	}, {
+		"v: 4294967296",
+		map[string]int64{"v": 4294967296},
+	}, {
+		"v: 0.1",
+		map[string]interface{}{"v": 0.1},
+	}, {
+		"v: .1",
+		map[string]interface{}{"v": 0.1},
+	}, {
+		"v: .Inf",
+		map[string]interface{}{"v": math.Inf(+1)},
+	}, {
+		"v: -.Inf",
+		map[string]interface{}{"v": math.Inf(-1)},
+	}, {
+		"v: -10",
+		map[string]interface{}{"v": -10},
+	}, {
+		"v: -.1",
+		map[string]interface{}{"v": -0.1},
+	},
+
+	// Simple values.
+	{
+		"123",
+		&unmarshalIntTest,
+	},
+
+	// Floats from spec
+	{
+		"canonical: 6.8523e+5",
+		map[string]interface{}{"canonical": 6.8523e+5},
+	}, {
+		"expo: 685.230_15e+03",
+		map[string]interface{}{"expo": 685.23015e+03},
+	}, {
+		"fixed: 685_230.15",
+		map[string]interface{}{"fixed": 685230.15},
+	}, {
+		"neginf: -.inf",
+		map[string]interface{}{"neginf": math.Inf(-1)},
+	}, {
+		"fixed: 685_230.15",
+		map[string]float64{"fixed": 685230.15},
+	},
+	//{"sexa: 190:20:30.15", map[string]interface{}{"sexa": 0}}, // Unsupported
+	//{"notanum: .NaN", map[string]interface{}{"notanum": math.NaN()}}, // Equality of NaN fails.
+
+	// Bools from spec
+	{
+		"canonical: y",
+		map[string]interface{}{"canonical": true},
+	}, {
+		"answer: NO",
+		map[string]interface{}{"answer": false},
+	}, {
+		"logical: True",
+		map[string]interface{}{"logical": true},
+	}, {
+		"option: on",
+		map[string]interface{}{"option": true},
+	}, {
+		"option: on",
+		map[string]bool{"option": true},
+	},
+	// Ints from spec
+	{
+		"canonical: 685230",
+		map[string]interface{}{"canonical": 685230},
+	}, {
+		"decimal: +685_230",
+		map[string]interface{}{"decimal": 685230},
+	}, {
+		"octal: 02472256",
+		map[string]interface{}{"octal": 685230},
+	}, {
+		"hexa: 0x_0A_74_AE",
+		map[string]interface{}{"hexa": 685230},
+	}, {
+		"bin: 0b1010_0111_0100_1010_1110",
+		map[string]interface{}{"bin": 685230},
+	}, {
+		"bin: -0b101010",
+		map[string]interface{}{"bin": -42},
+	}, {
+		"decimal: +685_230",
+		map[string]int{"decimal": 685230},
+	},
+
+	//{"sexa: 190:20:30", map[string]interface{}{"sexa": 0}}, // Unsupported
+
+	// Nulls from spec
+	{
+		"empty:",
+		map[string]interface{}{"empty": nil},
+	}, {
+		"canonical: ~",
+		map[string]interface{}{"canonical": nil},
+	}, {
+		"english: null",
+		map[string]interface{}{"english": nil},
+	}, {
+		"~: null key",
+		map[interface{}]string{nil: "null key"},
+	}, {
+		"empty:",
+		map[string]*bool{"empty": nil},
+	},
+
+	// Flow sequence
+	{
+		"seq: [A,B]",
+		map[string]interface{}{"seq": []interface{}{"A", "B"}},
+	}, {
+		"seq: [A,B,C,]",
+		map[string][]string{"seq": []string{"A", "B", "C"}},
+	}, {
+		"seq: [A,1,C]",
+		map[string][]string{"seq": []string{"A", "1", "C"}},
+	}, {
+		"seq: [A,1,C]",
+		map[string][]int{"seq": []int{1}},
+	}, {
+		"seq: [A,1,C]",
+		map[string]interface{}{"seq": []interface{}{"A", 1, "C"}},
+	},
+	// Block sequence
+	{
+		"seq:\n - A\n - B",
+		map[string]interface{}{"seq": []interface{}{"A", "B"}},
+	}, {
+		"seq:\n - A\n - B\n - C",
+		map[string][]string{"seq": []string{"A", "B", "C"}},
+	}, {
+		"seq:\n - A\n - 1\n - C",
+		map[string][]string{"seq": []string{"A", "1", "C"}},
+	}, {
+		"seq:\n - A\n - 1\n - C",
+		map[string][]int{"seq": []int{1}},
+	}, {
+		"seq:\n - A\n - 1\n - C",
+		map[string]interface{}{"seq": []interface{}{"A", 1, "C"}},
+	},
+
+	// Literal block scalar
+	{
+		"scalar: | # Comment\n\n literal\n\n \ttext\n\n",
+		map[string]string{"scalar": "\nliteral\n\n\ttext\n"},
+	},
+
+	// Folded block scalar
+	{
+		"scalar: > # Comment\n\n folded\n line\n \n next\n line\n  * one\n  * two\n\n last\n line\n\n",
+		map[string]string{"scalar": "\nfolded line\nnext line\n * one\n * two\n\nlast line\n"},
+	},
+
+	// Map inside interface with no type hints.
+	{
+		"a: {b: c}",
+		map[interface{}]interface{}{"a": map[interface{}]interface{}{"b": "c"}},
+	},
+
+	// Structs and type conversions.
+	{
+		"hello: world",
+		&struct{ Hello string }{"world"},
+	}, {
+		"a: {b: c}",
+		&struct{ A struct{ B string } }{struct{ B string }{"c"}},
+	}, {
+		"a: {b: c}",
+		&struct{ A *struct{ B string } }{&struct{ B string }{"c"}},
+	}, {
+		"a: {b: c}",
+		&struct{ A map[string]string }{map[string]string{"b": "c"}},
+	}, {
+		"a: {b: c}",
+		&struct{ A *map[string]string }{&map[string]string{"b": "c"}},
+	}, {
+		"a:",
+		&struct{ A map[string]string }{},
+	}, {
+		"a: 1",
+		&struct{ A int }{1},
+	}, {
+		"a: 1",
+		&struct{ A float64 }{1},
+	}, {
+		"a: 1.0",
+		&struct{ A int }{1},
+	}, {
+		"a: 1.0",
+		&struct{ A uint }{1},
+	}, {
+		"a: [1, 2]",
+		&struct{ A []int }{[]int{1, 2}},
+	}, {
+		"a: 1",
+		&struct{ B int }{0},
+	}, {
+		"a: 1",
+		&struct {
+			B int "a"
+		}{1},
+	}, {
+		"a: y",
+		&struct{ A bool }{true},
+	},
+
+	// Some cross type conversions
+	{
+		"v: 42",
+		map[string]uint{"v": 42},
+	}, {
+		"v: -42",
+		map[string]uint{},
+	}, {
+		"v: 4294967296",
+		map[string]uint64{"v": 4294967296},
+	}, {
+		"v: -4294967296",
+		map[string]uint64{},
+	},
+
+	// int
+	{
+		"int_max: 2147483647",
+		map[string]int{"int_max": math.MaxInt32},
+	},
+	{
+		"int_min: -2147483648",
+		map[string]int{"int_min": math.MinInt32},
+	},
+	{
+		"int_overflow: 9223372036854775808", // math.MaxInt64 + 1
+		map[string]int{},
+	},
+
+	// int64
+	{
+		"int64_max: 9223372036854775807",
+		map[string]int64{"int64_max": math.MaxInt64},
+	},
+	{
+		"int64_max_base2: 0b111111111111111111111111111111111111111111111111111111111111111",
+		map[string]int64{"int64_max_base2": math.MaxInt64},
+	},
+	{
+		"int64_min: -9223372036854775808",
+		map[string]int64{"int64_min": math.MinInt64},
+	},
+	{
+		"int64_neg_base2: -0b111111111111111111111111111111111111111111111111111111111111111",
+		map[string]int64{"int64_neg_base2": -math.MaxInt64},
+	},
+	{
+		"int64_overflow: 9223372036854775808", // math.MaxInt64 + 1
+		map[string]int64{},
+	},
+
+	// uint
+	{
+		"uint_min: 0",
+		map[string]uint{"uint_min": 0},
+	},
+	{
+		"uint_max: 4294967295",
+		map[string]uint{"uint_max": math.MaxUint32},
+	},
+	{
+		"uint_underflow: -1",
+		map[string]uint{},
+	},
+
+	// uint64
+	{
+		"uint64_min: 0",
+		map[string]uint{"uint64_min": 0},
+	},
+	{
+		"uint64_max: 18446744073709551615",
+		map[string]uint64{"uint64_max": math.MaxUint64},
+	},
+	{
+		"uint64_max_base2: 0b1111111111111111111111111111111111111111111111111111111111111111",
+		map[string]uint64{"uint64_max_base2": math.MaxUint64},
+	},
+	{
+		"uint64_maxint64: 9223372036854775807",
+		map[string]uint64{"uint64_maxint64": math.MaxInt64},
+	},
+	{
+		"uint64_underflow: -1",
+		map[string]uint64{},
+	},
+
+	// float32
+	{
+		"float32_max: 3.40282346638528859811704183484516925440e+38",
+		map[string]float32{"float32_max": math.MaxFloat32},
+	},
+	{
+		"float32_nonzero: 1.401298464324817070923729583289916131280e-45",
+		map[string]float32{"float32_nonzero": math.SmallestNonzeroFloat32},
+	},
+	{
+		"float32_maxuint64: 18446744073709551615",
+		map[string]float32{"float32_maxuint64": float32(math.MaxUint64)},
+	},
+	{
+		"float32_maxuint64+1: 18446744073709551616",
+		map[string]float32{"float32_maxuint64+1": float32(math.MaxUint64 + 1)},
+	},
+
+	// float64
+	{
+		"float64_max: 1.797693134862315708145274237317043567981e+308",
+		map[string]float64{"float64_max": math.MaxFloat64},
+	},
+	{
+		"float64_nonzero: 4.940656458412465441765687928682213723651e-324",
+		map[string]float64{"float64_nonzero": math.SmallestNonzeroFloat64},
+	},
+	{
+		"float64_maxuint64: 18446744073709551615",
+		map[string]float64{"float64_maxuint64": float64(math.MaxUint64)},
+	},
+	{
+		"float64_maxuint64+1: 18446744073709551616",
+		map[string]float64{"float64_maxuint64+1": float64(math.MaxUint64 + 1)},
+	},
+
+	// Overflow cases.
+	{
+		"v: 4294967297",
+		map[string]int32{},
+	}, {
+		"v: 128",
+		map[string]int8{},
+	},
+
+	// Quoted values.
+	{
+		"'1': '\"2\"'",
+		map[interface{}]interface{}{"1": "\"2\""},
+	}, {
+		"v:\n- A\n- 'B\n\n  C'\n",
+		map[string][]string{"v": []string{"A", "B\nC"}},
+	},
+
+	// Explicit tags.
+	{
+		"v: !!float '1.1'",
+		map[string]interface{}{"v": 1.1},
+	}, {
+		"v: !!null ''",
+		map[string]interface{}{"v": nil},
+	}, {
+		"%TAG !y! tag:yaml.org,2002:\n---\nv: !y!int '1'",
+		map[string]interface{}{"v": 1},
+	},
+
+	// Anchors and aliases.
+	{
+		"a: &x 1\nb: &y 2\nc: *x\nd: *y\n",
+		&struct{ A, B, C, D int }{1, 2, 1, 2},
+	}, {
+		"a: &a {c: 1}\nb: *a",
+		&struct {
+			A, B struct {
+				C int
+			}
+		}{struct{ C int }{1}, struct{ C int }{1}},
+	}, {
+		"a: &a [1, 2]\nb: *a",
+		&struct{ B []int }{[]int{1, 2}},
+	}, {
+		"b: *a\na: &a {c: 1}",
+		&struct {
+			A, B struct {
+				C int
+			}
+		}{struct{ C int }{1}, struct{ C int }{1}},
+	},
+
+	// Bug #1133337
+	{
+		"foo: ''",
+		map[string]*string{"foo": new(string)},
+	}, {
+		"foo: null",
+		map[string]string{"foo": ""},
+	}, {
+		"foo: null",
+		map[string]interface{}{"foo": nil},
+	},
+
+	// Ignored field
+	{
+		"a: 1\nb: 2\n",
+		&struct {
+			A int
+			B int "-"
+		}{1, 0},
+	},
+
+	// Bug #1191981
+	{
+		"" +
+			"%YAML 1.1\n" +
+			"--- !!str\n" +
+			`"Generic line break (no glyph)\n\` + "\n" +
+			` Generic line break (glyphed)\n\` + "\n" +
+			` Line separator\u2028\` + "\n" +
+			` Paragraph separator\u2029"` + "\n",
+		"" +
+			"Generic line break (no glyph)\n" +
+			"Generic line break (glyphed)\n" +
+			"Line separator\u2028Paragraph separator\u2029",
+	},
+
+	// Struct inlining
+	{
+		"a: 1\nb: 2\nc: 3\n",
+		&struct {
+			A int
+			C inlineB `yaml:",inline"`
+		}{1, inlineB{2, inlineC{3}}},
+	},
+
+	// Map inlining
+	{
+		"a: 1\nb: 2\nc: 3\n",
+		&struct {
+			A int
+			C map[string]int `yaml:",inline"`
+		}{1, map[string]int{"b": 2, "c": 3}},
+	},
+
+	// bug 1243827
+	{
+		"a: -b_c",
+		map[string]interface{}{"a": "-b_c"},
+	},
+	{
+		"a: +b_c",
+		map[string]interface{}{"a": "+b_c"},
+	},
+	{
+		"a: 50cent_of_dollar",
+		map[string]interface{}{"a": "50cent_of_dollar"},
+	},
+
+	// Duration
+	{
+		"a: 3s",
+		map[string]time.Duration{"a": 3 * time.Second},
+	},
+
+	// Issue #24.
+	{
+		"a: <foo>",
+		map[string]string{"a": "<foo>"},
+	},
+
+	// Base 60 floats are obsolete and unsupported.
+	{
+		"a: 1:1\n",
+		map[string]string{"a": "1:1"},
+	},
+
+	// Binary data.
+	{
+		"a: !!binary gIGC\n",
+		map[string]string{"a": "\x80\x81\x82"},
+	}, {
+		"a: !!binary |\n  " + strings.Repeat("kJCQ", 17) + "kJ\n  CQ\n",
+		map[string]string{"a": strings.Repeat("\x90", 54)},
+	}, {
+		"a: !!binary |\n  " + strings.Repeat("A", 70) + "\n  ==\n",
+		map[string]string{"a": strings.Repeat("\x00", 52)},
+	},
+
+	// Ordered maps.
+	{
+		"{b: 2, a: 1, d: 4, c: 3, sub: {e: 5}}",
+		&yaml.MapSlice{{"b", 2}, {"a", 1}, {"d", 4}, {"c", 3}, {"sub", yaml.MapSlice{{"e", 5}}}},
+	},
+
+	// Issue #39.
+	{
+		"a:\n b:\n  c: d\n",
+		map[string]struct{ B interface{} }{"a": {map[interface{}]interface{}{"c": "d"}}},
+	},
+
+	// Custom map type.
+	{
+		"a: {b: c}",
+		M{"a": M{"b": "c"}},
+	},
+
+	// Support encoding.TextUnmarshaler.
+	{
+		"a: 1.2.3.4\n",
+		map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)},
+	},
+	{
+		"a: 2015-02-24T18:19:39Z\n",
+		map[string]time.Time{"a": time.Unix(1424801979, 0)},
+	},
+
+	// Encode empty lists as zero-length slices.
+	{
+		"a: []",
+		&struct{ A []int }{[]int{}},
+	},
+}
+
+type M map[interface{}]interface{}
+
+type inlineB struct {
+	B       int
+	inlineC `yaml:",inline"`
+}
+
+type inlineC struct {
+	C int
+}
+
+func (s *S) TestUnmarshal(c *C) {
+	for _, item := range unmarshalTests {
+		t := reflect.ValueOf(item.value).Type()
+		var value interface{}
+		switch t.Kind() {
+		case reflect.Map:
+			value = reflect.MakeMap(t).Interface()
+		case reflect.String:
+			value = reflect.New(t).Interface()
+		case reflect.Ptr:
+			value = reflect.New(t.Elem()).Interface()
+		default:
+			c.Fatalf("missing case for %s", t)
+		}
+		err := yaml.Unmarshal([]byte(item.data), value)
+		if _, ok := err.(*yaml.TypeError); !ok {
+			c.Assert(err, IsNil)
+		}
+		if t.Kind() == reflect.String {
+			c.Assert(*value.(*string), Equals, item.value)
+		} else {
+			c.Assert(value, DeepEquals, item.value)
+		}
+	}
+}
+
+func (s *S) TestUnmarshalNaN(c *C) {
+	value := map[string]interface{}{}
+	err := yaml.Unmarshal([]byte("notanum: .NaN"), &value)
+	c.Assert(err, IsNil)
+	c.Assert(math.IsNaN(value["notanum"].(float64)), Equals, true)
+}
+
+var unmarshalErrorTests = []struct {
+	data, error string
+}{
+	{"v: !!float 'error'", "yaml: cannot decode !!str `error` as a !!float"},
+	{"v: [A,", "yaml: line 1: did not find expected node content"},
+	{"v:\n- [A,", "yaml: line 2: did not find expected node content"},
+	{"a: *b\n", "yaml: unknown anchor 'b' referenced"},
+	{"a: &a\n  b: *a\n", "yaml: anchor 'a' value contains itself"},
+	{"value: -", "yaml: block sequence entries are not allowed in this context"},
+	{"a: !!binary ==", "yaml: !!binary value contains invalid base64 data"},
+	{"{[.]}", `yaml: invalid map key: \[\]interface \{\}\{"\."\}`},
+	{"{{.}}", `yaml: invalid map key: map\[interface\ \{\}\]interface \{\}\{".":interface \{\}\(nil\)\}`},
+}
+
+func (s *S) TestUnmarshalErrors(c *C) {
+	for _, item := range unmarshalErrorTests {
+		var value interface{}
+		err := yaml.Unmarshal([]byte(item.data), &value)
+		c.Assert(err, ErrorMatches, item.error, Commentf("Partial unmarshal: %#v", value))
+	}
+}
+
+var unmarshalerTests = []struct {
+	data, tag string
+	value     interface{}
+}{
+	{"_: {hi: there}", "!!map", map[interface{}]interface{}{"hi": "there"}},
+	{"_: [1,A]", "!!seq", []interface{}{1, "A"}},
+	{"_: 10", "!!int", 10},
+	{"_: null", "!!null", nil},
+	{`_: BAR!`, "!!str", "BAR!"},
+	{`_: "BAR!"`, "!!str", "BAR!"},
+	{"_: !!foo 'BAR!'", "!!foo", "BAR!"},
+}
+
+var unmarshalerResult = map[int]error{}
+
+type unmarshalerType struct {
+	value interface{}
+}
+
+func (o *unmarshalerType) UnmarshalYAML(unmarshal func(v interface{}) error) error {
+	if err := unmarshal(&o.value); err != nil {
+		return err
+	}
+	if i, ok := o.value.(int); ok {
+		if result, ok := unmarshalerResult[i]; ok {
+			return result
+		}
+	}
+	return nil
+}
+
+type unmarshalerPointer struct {
+	Field *unmarshalerType "_"
+}
+
+type unmarshalerValue struct {
+	Field unmarshalerType "_"
+}
+
+func (s *S) TestUnmarshalerPointerField(c *C) {
+	for _, item := range unmarshalerTests {
+		obj := &unmarshalerPointer{}
+		err := yaml.Unmarshal([]byte(item.data), obj)
+		c.Assert(err, IsNil)
+		if item.value == nil {
+			c.Assert(obj.Field, IsNil)
+		} else {
+			c.Assert(obj.Field, NotNil, Commentf("Pointer not initialized (%#v)", item.value))
+			c.Assert(obj.Field.value, DeepEquals, item.value)
+		}
+	}
+}
+
+func (s *S) TestUnmarshalerValueField(c *C) {
+	for _, item := range unmarshalerTests {
+		obj := &unmarshalerValue{}
+		err := yaml.Unmarshal([]byte(item.data), obj)
+		c.Assert(err, IsNil)
+		c.Assert(obj.Field, NotNil, Commentf("Pointer not initialized (%#v)", item.value))
+		c.Assert(obj.Field.value, DeepEquals, item.value)
+	}
+}
+
+func (s *S) TestUnmarshalerWholeDocument(c *C) {
+	obj := &unmarshalerType{}
+	err := yaml.Unmarshal([]byte(unmarshalerTests[0].data), obj)
+	c.Assert(err, IsNil)
+	value, ok := obj.value.(map[interface{}]interface{})
+	c.Assert(ok, Equals, true, Commentf("value: %#v", obj.value))
+	c.Assert(value["_"], DeepEquals, unmarshalerTests[0].value)
+}
+
+func (s *S) TestUnmarshalerTypeError(c *C) {
+	unmarshalerResult[2] = &yaml.TypeError{[]string{"foo"}}
+	unmarshalerResult[4] = &yaml.TypeError{[]string{"bar"}}
+	defer func() {
+		delete(unmarshalerResult, 2)
+		delete(unmarshalerResult, 4)
+	}()
+
+	type T struct {
+		Before int
+		After  int
+		M      map[string]*unmarshalerType
+	}
+	var v T
+	data := `{before: A, m: {abc: 1, def: 2, ghi: 3, jkl: 4}, after: B}`
+	err := yaml.Unmarshal([]byte(data), &v)
+	c.Assert(err, ErrorMatches, ""+
+		"yaml: unmarshal errors:\n"+
+		"  line 1: cannot unmarshal !!str `A` into int\n"+
+		"  foo\n"+
+		"  bar\n"+
+		"  line 1: cannot unmarshal !!str `B` into int")
+	c.Assert(v.M["abc"], NotNil)
+	c.Assert(v.M["def"], IsNil)
+	c.Assert(v.M["ghi"], NotNil)
+	c.Assert(v.M["jkl"], IsNil)
+
+	c.Assert(v.M["abc"].value, Equals, 1)
+	c.Assert(v.M["ghi"].value, Equals, 3)
+}
+
+type proxyTypeError struct{}
+
+func (v *proxyTypeError) UnmarshalYAML(unmarshal func(interface{}) error) error {
+	var s string
+	var a int32
+	var b int64
+	if err := unmarshal(&s); err != nil {
+		panic(err)
+	}
+	if s == "a" {
+		if err := unmarshal(&b); err == nil {
+			panic("should have failed")
+		}
+		return unmarshal(&a)
+	}
+	if err := unmarshal(&a); err == nil {
+		panic("should have failed")
+	}
+	return unmarshal(&b)
+}
+
+func (s *S) TestUnmarshalerTypeErrorProxying(c *C) {
+	type T struct {
+		Before int
+		After  int
+		M      map[string]*proxyTypeError
+	}
+	var v T
+	data := `{before: A, m: {abc: a, def: b}, after: B}`
+	err := yaml.Unmarshal([]byte(data), &v)
+	c.Assert(err, ErrorMatches, ""+
+		"yaml: unmarshal errors:\n"+
+		"  line 1: cannot unmarshal !!str `A` into int\n"+
+		"  line 1: cannot unmarshal !!str `a` into int32\n"+
+		"  line 1: cannot unmarshal !!str `b` into int64\n"+
+		"  line 1: cannot unmarshal !!str `B` into int")
+}
+
+type failingUnmarshaler struct{}
+
+var failingErr = errors.New("failingErr")
+
+func (ft *failingUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error {
+	return failingErr
+}
+
+func (s *S) TestUnmarshalerError(c *C) {
+	err := yaml.Unmarshal([]byte("a: b"), &failingUnmarshaler{})
+	c.Assert(err, Equals, failingErr)
+}
+
+type sliceUnmarshaler []int
+
+func (su *sliceUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error {
+	var slice []int
+	err := unmarshal(&slice)
+	if err == nil {
+		*su = slice
+		return nil
+	}
+
+	var intVal int
+	err = unmarshal(&intVal)
+	if err == nil {
+		*su = []int{intVal}
+		return nil
+	}
+
+	return err
+}
+
+func (s *S) TestUnmarshalerRetry(c *C) {
+	var su sliceUnmarshaler
+	err := yaml.Unmarshal([]byte("[1, 2, 3]"), &su)
+	c.Assert(err, IsNil)
+	c.Assert(su, DeepEquals, sliceUnmarshaler([]int{1, 2, 3}))
+
+	err = yaml.Unmarshal([]byte("1"), &su)
+	c.Assert(err, IsNil)
+	c.Assert(su, DeepEquals, sliceUnmarshaler([]int{1}))
+}
+
+// From http://yaml.org/type/merge.html
+var mergeTests = `
+anchors:
+  list:
+    - &CENTER { "x": 1, "y": 2 }
+    - &LEFT   { "x": 0, "y": 2 }
+    - &BIG    { "r": 10 }
+    - &SMALL  { "r": 1 }
+
+# All the following maps are equal:
+
+plain:
+  # Explicit keys
+  "x": 1
+  "y": 2
+  "r": 10
+  label: center/big
+
+mergeOne:
+  # Merge one map
+  << : *CENTER
+  "r": 10
+  label: center/big
+
+mergeMultiple:
+  # Merge multiple maps
+  << : [ *CENTER, *BIG ]
+  label: center/big
+
+override:
+  # Override
+  << : [ *BIG, *LEFT, *SMALL ]
+  "x": 1
+  label: center/big
+
+shortTag:
+  # Explicit short merge tag
+  !!merge "<<" : [ *CENTER, *BIG ]
+  label: center/big
+
+longTag:
+  # Explicit merge long tag
+  !<tag:yaml.org,2002:merge> "<<" : [ *CENTER, *BIG ]
+  label: center/big
+
+inlineMap:
+  # Inlined map 
+  << : {"x": 1, "y": 2, "r": 10}
+  label: center/big
+
+inlineSequenceMap:
+  # Inlined map in sequence
+  << : [ *CENTER, {"r": 10} ]
+  label: center/big
+`
+
+func (s *S) TestMerge(c *C) {
+	var want = map[interface{}]interface{}{
+		"x":     1,
+		"y":     2,
+		"r":     10,
+		"label": "center/big",
+	}
+
+	var m map[interface{}]interface{}
+	err := yaml.Unmarshal([]byte(mergeTests), &m)
+	c.Assert(err, IsNil)
+	for name, test := range m {
+		if name == "anchors" {
+			continue
+		}
+		c.Assert(test, DeepEquals, want, Commentf("test %q failed", name))
+	}
+}
+
+func (s *S) TestMergeStruct(c *C) {
+	type Data struct {
+		X, Y, R int
+		Label   string
+	}
+	want := Data{1, 2, 10, "center/big"}
+
+	var m map[string]Data
+	err := yaml.Unmarshal([]byte(mergeTests), &m)
+	c.Assert(err, IsNil)
+	for name, test := range m {
+		if name == "anchors" {
+			continue
+		}
+		c.Assert(test, Equals, want, Commentf("test %q failed", name))
+	}
+}
+
+var unmarshalNullTests = []func() interface{}{
+	func() interface{} { var v interface{}; v = "v"; return &v },
+	func() interface{} { var s = "s"; return &s },
+	func() interface{} { var s = "s"; sptr := &s; return &sptr },
+	func() interface{} { var i = 1; return &i },
+	func() interface{} { var i = 1; iptr := &i; return &iptr },
+	func() interface{} { m := map[string]int{"s": 1}; return &m },
+	func() interface{} { m := map[string]int{"s": 1}; return m },
+}
+
+func (s *S) TestUnmarshalNull(c *C) {
+	for _, test := range unmarshalNullTests {
+		item := test()
+		zero := reflect.Zero(reflect.TypeOf(item).Elem()).Interface()
+		err := yaml.Unmarshal([]byte("null"), item)
+		c.Assert(err, IsNil)
+		if reflect.TypeOf(item).Kind() == reflect.Map {
+			c.Assert(reflect.ValueOf(item).Interface(), DeepEquals, reflect.MakeMap(reflect.TypeOf(item)).Interface())
+		} else {
+			c.Assert(reflect.ValueOf(item).Elem().Interface(), DeepEquals, zero)
+		}
+	}
+}
+
+func (s *S) TestUnmarshalSliceOnPreset(c *C) {
+	// Issue #48.
+	v := struct{ A []int }{[]int{1}}
+	yaml.Unmarshal([]byte("a: [2]"), &v)
+	c.Assert(v.A, DeepEquals, []int{2})
+}
+
+//var data []byte
+//func init() {
+//	var err error
+//	data, err = ioutil.ReadFile("/tmp/file.yaml")
+//	if err != nil {
+//		panic(err)
+//	}
+//}
+//
+//func (s *S) BenchmarkUnmarshal(c *C) {
+//	var err error
+//	for i := 0; i < c.N; i++ {
+//		var v map[string]interface{}
+//		err = yaml.Unmarshal(data, &v)
+//	}
+//	if err != nil {
+//		panic(err)
+//	}
+//}
+//
+//func (s *S) BenchmarkMarshal(c *C) {
+//	var v map[string]interface{}
+//	yaml.Unmarshal(data, &v)
+//	c.ResetTimer()
+//	for i := 0; i < c.N; i++ {
+//		yaml.Marshal(&v)
+//	}
+//}


[05/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/parserc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/parserc.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/parserc.go
new file mode 100644
index 0000000..0a7037a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/parserc.go
@@ -0,0 +1,1096 @@
+package yaml
+
+import (
+	"bytes"
+)
+
+// The parser implements the following grammar:
+//
+// stream               ::= STREAM-START implicit_document? explicit_document* STREAM-END
+// implicit_document    ::= block_node DOCUMENT-END*
+// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+// block_node_or_indentless_sequence    ::=
+//                          ALIAS
+//                          | properties (block_content | indentless_block_sequence)?
+//                          | block_content
+//                          | indentless_block_sequence
+// block_node           ::= ALIAS
+//                          | properties block_content?
+//                          | block_content
+// flow_node            ::= ALIAS
+//                          | properties flow_content?
+//                          | flow_content
+// properties           ::= TAG ANCHOR? | ANCHOR TAG?
+// block_content        ::= block_collection | flow_collection | SCALAR
+// flow_content         ::= flow_collection | SCALAR
+// block_collection     ::= block_sequence | block_mapping
+// flow_collection      ::= flow_sequence | flow_mapping
+// block_sequence       ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
+// indentless_sequence  ::= (BLOCK-ENTRY block_node?)+
+// block_mapping        ::= BLOCK-MAPPING_START
+//                          ((KEY block_node_or_indentless_sequence?)?
+//                          (VALUE block_node_or_indentless_sequence?)?)*
+//                          BLOCK-END
+// flow_sequence        ::= FLOW-SEQUENCE-START
+//                          (flow_sequence_entry FLOW-ENTRY)*
+//                          flow_sequence_entry?
+//                          FLOW-SEQUENCE-END
+// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+// flow_mapping         ::= FLOW-MAPPING-START
+//                          (flow_mapping_entry FLOW-ENTRY)*
+//                          flow_mapping_entry?
+//                          FLOW-MAPPING-END
+// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+
+// Peek the next token in the token queue.
+func peek_token(parser *yaml_parser_t) *yaml_token_t {
+	if parser.token_available || yaml_parser_fetch_more_tokens(parser) {
+		return &parser.tokens[parser.tokens_head]
+	}
+	return nil
+}
+
+// Remove the next token from the queue (must be called after peek_token).
+func skip_token(parser *yaml_parser_t) {
+	parser.token_available = false
+	parser.tokens_parsed++
+	parser.stream_end_produced = parser.tokens[parser.tokens_head].typ == yaml_STREAM_END_TOKEN
+	parser.tokens_head++
+}
+
+// Get the next event.
+func yaml_parser_parse(parser *yaml_parser_t, event *yaml_event_t) bool {
+	// Erase the event object.
+	*event = yaml_event_t{}
+
+	// No events after the end of the stream or error.
+	if parser.stream_end_produced || parser.error != yaml_NO_ERROR || parser.state == yaml_PARSE_END_STATE {
+		return true
+	}
+
+	// Generate the next event.
+	return yaml_parser_state_machine(parser, event)
+}
+
+// Set parser error.
+func yaml_parser_set_parser_error(parser *yaml_parser_t, problem string, problem_mark yaml_mark_t) bool {
+	parser.error = yaml_PARSER_ERROR
+	parser.problem = problem
+	parser.problem_mark = problem_mark
+	return false
+}
+
+func yaml_parser_set_parser_error_context(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string, problem_mark yaml_mark_t) bool {
+	parser.error = yaml_PARSER_ERROR
+	parser.context = context
+	parser.context_mark = context_mark
+	parser.problem = problem
+	parser.problem_mark = problem_mark
+	return false
+}
+
+// State dispatcher.
+func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool {
+	//trace("yaml_parser_state_machine", "state:", parser.state.String())
+
+	switch parser.state {
+	case yaml_PARSE_STREAM_START_STATE:
+		return yaml_parser_parse_stream_start(parser, event)
+
+	case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE:
+		return yaml_parser_parse_document_start(parser, event, true)
+
+	case yaml_PARSE_DOCUMENT_START_STATE:
+		return yaml_parser_parse_document_start(parser, event, false)
+
+	case yaml_PARSE_DOCUMENT_CONTENT_STATE:
+		return yaml_parser_parse_document_content(parser, event)
+
+	case yaml_PARSE_DOCUMENT_END_STATE:
+		return yaml_parser_parse_document_end(parser, event)
+
+	case yaml_PARSE_BLOCK_NODE_STATE:
+		return yaml_parser_parse_node(parser, event, true, false)
+
+	case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:
+		return yaml_parser_parse_node(parser, event, true, true)
+
+	case yaml_PARSE_FLOW_NODE_STATE:
+		return yaml_parser_parse_node(parser, event, false, false)
+
+	case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:
+		return yaml_parser_parse_block_sequence_entry(parser, event, true)
+
+	case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:
+		return yaml_parser_parse_block_sequence_entry(parser, event, false)
+
+	case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:
+		return yaml_parser_parse_indentless_sequence_entry(parser, event)
+
+	case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:
+		return yaml_parser_parse_block_mapping_key(parser, event, true)
+
+	case yaml_PARSE_BLOCK_MAPPING_KEY_STATE:
+		return yaml_parser_parse_block_mapping_key(parser, event, false)
+
+	case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE:
+		return yaml_parser_parse_block_mapping_value(parser, event)
+
+	case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:
+		return yaml_parser_parse_flow_sequence_entry(parser, event, true)
+
+	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE:
+		return yaml_parser_parse_flow_sequence_entry(parser, event, false)
+
+	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:
+		return yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event)
+
+	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:
+		return yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event)
+
+	case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:
+		return yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event)
+
+	case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:
+		return yaml_parser_parse_flow_mapping_key(parser, event, true)
+
+	case yaml_PARSE_FLOW_MAPPING_KEY_STATE:
+		return yaml_parser_parse_flow_mapping_key(parser, event, false)
+
+	case yaml_PARSE_FLOW_MAPPING_VALUE_STATE:
+		return yaml_parser_parse_flow_mapping_value(parser, event, false)
+
+	case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:
+		return yaml_parser_parse_flow_mapping_value(parser, event, true)
+
+	default:
+		panic("invalid parser state")
+	}
+	return false
+}
+
+// Parse the production:
+// stream   ::= STREAM-START implicit_document? explicit_document* STREAM-END
+//              ************
+func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool {
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+	if token.typ != yaml_STREAM_START_TOKEN {
+		return yaml_parser_set_parser_error(parser, "did not find expected <stream-start>", token.start_mark)
+	}
+	parser.state = yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE
+	*event = yaml_event_t{
+		typ:        yaml_STREAM_START_EVENT,
+		start_mark: token.start_mark,
+		end_mark:   token.end_mark,
+		encoding:   token.encoding,
+	}
+	skip_token(parser)
+	return true
+}
+
+// Parse the productions:
+// implicit_document    ::= block_node DOCUMENT-END*
+//                          *
+// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+//                          *************************
+func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool {
+
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+
+	// Parse extra document end indicators.
+	if !implicit {
+		for token.typ == yaml_DOCUMENT_END_TOKEN {
+			skip_token(parser)
+			token = peek_token(parser)
+			if token == nil {
+				return false
+			}
+		}
+	}
+
+	if implicit && token.typ != yaml_VERSION_DIRECTIVE_TOKEN &&
+		token.typ != yaml_TAG_DIRECTIVE_TOKEN &&
+		token.typ != yaml_DOCUMENT_START_TOKEN &&
+		token.typ != yaml_STREAM_END_TOKEN {
+		// Parse an implicit document.
+		if !yaml_parser_process_directives(parser, nil, nil) {
+			return false
+		}
+		parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE)
+		parser.state = yaml_PARSE_BLOCK_NODE_STATE
+
+		*event = yaml_event_t{
+			typ:        yaml_DOCUMENT_START_EVENT,
+			start_mark: token.start_mark,
+			end_mark:   token.end_mark,
+		}
+
+	} else if token.typ != yaml_STREAM_END_TOKEN {
+		// Parse an explicit document.
+		var version_directive *yaml_version_directive_t
+		var tag_directives []yaml_tag_directive_t
+		start_mark := token.start_mark
+		if !yaml_parser_process_directives(parser, &version_directive, &tag_directives) {
+			return false
+		}
+		token = peek_token(parser)
+		if token == nil {
+			return false
+		}
+		if token.typ != yaml_DOCUMENT_START_TOKEN {
+			yaml_parser_set_parser_error(parser,
+				"did not find expected <document start>", token.start_mark)
+			return false
+		}
+		parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE)
+		parser.state = yaml_PARSE_DOCUMENT_CONTENT_STATE
+		end_mark := token.end_mark
+
+		*event = yaml_event_t{
+			typ:               yaml_DOCUMENT_START_EVENT,
+			start_mark:        start_mark,
+			end_mark:          end_mark,
+			version_directive: version_directive,
+			tag_directives:    tag_directives,
+			implicit:          false,
+		}
+		skip_token(parser)
+
+	} else {
+		// Parse the stream end.
+		parser.state = yaml_PARSE_END_STATE
+		*event = yaml_event_t{
+			typ:        yaml_STREAM_END_EVENT,
+			start_mark: token.start_mark,
+			end_mark:   token.end_mark,
+		}
+		skip_token(parser)
+	}
+
+	return true
+}
+
+// Parse the productions:
+// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+//                                                    ***********
+//
+func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool {
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+	if token.typ == yaml_VERSION_DIRECTIVE_TOKEN ||
+		token.typ == yaml_TAG_DIRECTIVE_TOKEN ||
+		token.typ == yaml_DOCUMENT_START_TOKEN ||
+		token.typ == yaml_DOCUMENT_END_TOKEN ||
+		token.typ == yaml_STREAM_END_TOKEN {
+		parser.state = parser.states[len(parser.states)-1]
+		parser.states = parser.states[:len(parser.states)-1]
+		return yaml_parser_process_empty_scalar(parser, event,
+			token.start_mark)
+	}
+	return yaml_parser_parse_node(parser, event, true, false)
+}
+
+// Parse the productions:
+// implicit_document    ::= block_node DOCUMENT-END*
+//                                     *************
+// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+//
+func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool {
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+
+	start_mark := token.start_mark
+	end_mark := token.start_mark
+
+	implicit := true
+	if token.typ == yaml_DOCUMENT_END_TOKEN {
+		end_mark = token.end_mark
+		skip_token(parser)
+		implicit = false
+	}
+
+	parser.tag_directives = parser.tag_directives[:0]
+
+	parser.state = yaml_PARSE_DOCUMENT_START_STATE
+	*event = yaml_event_t{
+		typ:        yaml_DOCUMENT_END_EVENT,
+		start_mark: start_mark,
+		end_mark:   end_mark,
+		implicit:   implicit,
+	}
+	return true
+}
+
+// Parse the productions:
+// block_node_or_indentless_sequence    ::=
+//                          ALIAS
+//                          *****
+//                          | properties (block_content | indentless_block_sequence)?
+//                            **********  *
+//                          | block_content | indentless_block_sequence
+//                            *
+// block_node           ::= ALIAS
+//                          *****
+//                          | properties block_content?
+//                            ********** *
+//                          | block_content
+//                            *
+// flow_node            ::= ALIAS
+//                          *****
+//                          | properties flow_content?
+//                            ********** *
+//                          | flow_content
+//                            *
+// properties           ::= TAG ANCHOR? | ANCHOR TAG?
+//                          *************************
+// block_content        ::= block_collection | flow_collection | SCALAR
+//                                                               ******
+// flow_content         ::= flow_collection | SCALAR
+//                                            ******
+func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool {
+	//defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)()
+
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+
+	if token.typ == yaml_ALIAS_TOKEN {
+		parser.state = parser.states[len(parser.states)-1]
+		parser.states = parser.states[:len(parser.states)-1]
+		*event = yaml_event_t{
+			typ:        yaml_ALIAS_EVENT,
+			start_mark: token.start_mark,
+			end_mark:   token.end_mark,
+			anchor:     token.value,
+		}
+		skip_token(parser)
+		return true
+	}
+
+	start_mark := token.start_mark
+	end_mark := token.start_mark
+
+	var tag_token bool
+	var tag_handle, tag_suffix, anchor []byte
+	var tag_mark yaml_mark_t
+	if token.typ == yaml_ANCHOR_TOKEN {
+		anchor = token.value
+		start_mark = token.start_mark
+		end_mark = token.end_mark
+		skip_token(parser)
+		token = peek_token(parser)
+		if token == nil {
+			return false
+		}
+		if token.typ == yaml_TAG_TOKEN {
+			tag_token = true
+			tag_handle = token.value
+			tag_suffix = token.suffix
+			tag_mark = token.start_mark
+			end_mark = token.end_mark
+			skip_token(parser)
+			token = peek_token(parser)
+			if token == nil {
+				return false
+			}
+		}
+	} else if token.typ == yaml_TAG_TOKEN {
+		tag_token = true
+		tag_handle = token.value
+		tag_suffix = token.suffix
+		start_mark = token.start_mark
+		tag_mark = token.start_mark
+		end_mark = token.end_mark
+		skip_token(parser)
+		token = peek_token(parser)
+		if token == nil {
+			return false
+		}
+		if token.typ == yaml_ANCHOR_TOKEN {
+			anchor = token.value
+			end_mark = token.end_mark
+			skip_token(parser)
+			token = peek_token(parser)
+			if token == nil {
+				return false
+			}
+		}
+	}
+
+	var tag []byte
+	if tag_token {
+		if len(tag_handle) == 0 {
+			tag = tag_suffix
+			tag_suffix = nil
+		} else {
+			for i := range parser.tag_directives {
+				if bytes.Equal(parser.tag_directives[i].handle, tag_handle) {
+					tag = append([]byte(nil), parser.tag_directives[i].prefix...)
+					tag = append(tag, tag_suffix...)
+					break
+				}
+			}
+			if len(tag) == 0 {
+				yaml_parser_set_parser_error_context(parser,
+					"while parsing a node", start_mark,
+					"found undefined tag handle", tag_mark)
+				return false
+			}
+		}
+	}
+
+	implicit := len(tag) == 0
+	if indentless_sequence && token.typ == yaml_BLOCK_ENTRY_TOKEN {
+		end_mark = token.end_mark
+		parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE
+		*event = yaml_event_t{
+			typ:        yaml_SEQUENCE_START_EVENT,
+			start_mark: start_mark,
+			end_mark:   end_mark,
+			anchor:     anchor,
+			tag:        tag,
+			implicit:   implicit,
+			style:      yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE),
+		}
+		return true
+	}
+	if token.typ == yaml_SCALAR_TOKEN {
+		var plain_implicit, quoted_implicit bool
+		end_mark = token.end_mark
+		if (len(tag) == 0 && token.style == yaml_PLAIN_SCALAR_STYLE) || (len(tag) == 1 && tag[0] == '!') {
+			plain_implicit = true
+		} else if len(tag) == 0 {
+			quoted_implicit = true
+		}
+		parser.state = parser.states[len(parser.states)-1]
+		parser.states = parser.states[:len(parser.states)-1]
+
+		*event = yaml_event_t{
+			typ:             yaml_SCALAR_EVENT,
+			start_mark:      start_mark,
+			end_mark:        end_mark,
+			anchor:          anchor,
+			tag:             tag,
+			value:           token.value,
+			implicit:        plain_implicit,
+			quoted_implicit: quoted_implicit,
+			style:           yaml_style_t(token.style),
+		}
+		skip_token(parser)
+		return true
+	}
+	if token.typ == yaml_FLOW_SEQUENCE_START_TOKEN {
+		// [Go] Some of the events below can be merged as they differ only on style.
+		end_mark = token.end_mark
+		parser.state = yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE
+		*event = yaml_event_t{
+			typ:        yaml_SEQUENCE_START_EVENT,
+			start_mark: start_mark,
+			end_mark:   end_mark,
+			anchor:     anchor,
+			tag:        tag,
+			implicit:   implicit,
+			style:      yaml_style_t(yaml_FLOW_SEQUENCE_STYLE),
+		}
+		return true
+	}
+	if token.typ == yaml_FLOW_MAPPING_START_TOKEN {
+		end_mark = token.end_mark
+		parser.state = yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE
+		*event = yaml_event_t{
+			typ:        yaml_MAPPING_START_EVENT,
+			start_mark: start_mark,
+			end_mark:   end_mark,
+			anchor:     anchor,
+			tag:        tag,
+			implicit:   implicit,
+			style:      yaml_style_t(yaml_FLOW_MAPPING_STYLE),
+		}
+		return true
+	}
+	if block && token.typ == yaml_BLOCK_SEQUENCE_START_TOKEN {
+		end_mark = token.end_mark
+		parser.state = yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE
+		*event = yaml_event_t{
+			typ:        yaml_SEQUENCE_START_EVENT,
+			start_mark: start_mark,
+			end_mark:   end_mark,
+			anchor:     anchor,
+			tag:        tag,
+			implicit:   implicit,
+			style:      yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE),
+		}
+		return true
+	}
+	if block && token.typ == yaml_BLOCK_MAPPING_START_TOKEN {
+		end_mark = token.end_mark
+		parser.state = yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE
+		*event = yaml_event_t{
+			typ:        yaml_MAPPING_START_EVENT,
+			start_mark: start_mark,
+			end_mark:   end_mark,
+			anchor:     anchor,
+			tag:        tag,
+			implicit:   implicit,
+			style:      yaml_style_t(yaml_BLOCK_MAPPING_STYLE),
+		}
+		return true
+	}
+	if len(anchor) > 0 || len(tag) > 0 {
+		parser.state = parser.states[len(parser.states)-1]
+		parser.states = parser.states[:len(parser.states)-1]
+
+		*event = yaml_event_t{
+			typ:             yaml_SCALAR_EVENT,
+			start_mark:      start_mark,
+			end_mark:        end_mark,
+			anchor:          anchor,
+			tag:             tag,
+			implicit:        implicit,
+			quoted_implicit: false,
+			style:           yaml_style_t(yaml_PLAIN_SCALAR_STYLE),
+		}
+		return true
+	}
+
+	context := "while parsing a flow node"
+	if block {
+		context = "while parsing a block node"
+	}
+	yaml_parser_set_parser_error_context(parser, context, start_mark,
+		"did not find expected node content", token.start_mark)
+	return false
+}
+
+// Parse the productions:
+// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
+//                    ********************  *********** *             *********
+//
+func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
+	if first {
+		token := peek_token(parser)
+		parser.marks = append(parser.marks, token.start_mark)
+		skip_token(parser)
+	}
+
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+
+	if token.typ == yaml_BLOCK_ENTRY_TOKEN {
+		mark := token.end_mark
+		skip_token(parser)
+		token = peek_token(parser)
+		if token == nil {
+			return false
+		}
+		if token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_BLOCK_END_TOKEN {
+			parser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE)
+			return yaml_parser_parse_node(parser, event, true, false)
+		} else {
+			parser.state = yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE
+			return yaml_parser_process_empty_scalar(parser, event, mark)
+		}
+	}
+	if token.typ == yaml_BLOCK_END_TOKEN {
+		parser.state = parser.states[len(parser.states)-1]
+		parser.states = parser.states[:len(parser.states)-1]
+		parser.marks = parser.marks[:len(parser.marks)-1]
+
+		*event = yaml_event_t{
+			typ:        yaml_SEQUENCE_END_EVENT,
+			start_mark: token.start_mark,
+			end_mark:   token.end_mark,
+		}
+
+		skip_token(parser)
+		return true
+	}
+
+	context_mark := parser.marks[len(parser.marks)-1]
+	parser.marks = parser.marks[:len(parser.marks)-1]
+	return yaml_parser_set_parser_error_context(parser,
+		"while parsing a block collection", context_mark,
+		"did not find expected '-' indicator", token.start_mark)
+}
+
+// Parse the productions:
+// indentless_sequence  ::= (BLOCK-ENTRY block_node?)+
+//                           *********** *
+func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool {
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+
+	if token.typ == yaml_BLOCK_ENTRY_TOKEN {
+		mark := token.end_mark
+		skip_token(parser)
+		token = peek_token(parser)
+		if token == nil {
+			return false
+		}
+		if token.typ != yaml_BLOCK_ENTRY_TOKEN &&
+			token.typ != yaml_KEY_TOKEN &&
+			token.typ != yaml_VALUE_TOKEN &&
+			token.typ != yaml_BLOCK_END_TOKEN {
+			parser.states = append(parser.states, yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE)
+			return yaml_parser_parse_node(parser, event, true, false)
+		}
+		parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE
+		return yaml_parser_process_empty_scalar(parser, event, mark)
+	}
+	parser.state = parser.states[len(parser.states)-1]
+	parser.states = parser.states[:len(parser.states)-1]
+
+	*event = yaml_event_t{
+		typ:        yaml_SEQUENCE_END_EVENT,
+		start_mark: token.start_mark,
+		end_mark:   token.start_mark, // [Go] Shouldn't this be token.end_mark?
+	}
+	return true
+}
+
+// Parse the productions:
+// block_mapping        ::= BLOCK-MAPPING_START
+//                          *******************
+//                          ((KEY block_node_or_indentless_sequence?)?
+//                            *** *
+//                          (VALUE block_node_or_indentless_sequence?)?)*
+//
+//                          BLOCK-END
+//                          *********
+//
+func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
+	if first {
+		token := peek_token(parser)
+		parser.marks = append(parser.marks, token.start_mark)
+		skip_token(parser)
+	}
+
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+
+	if token.typ == yaml_KEY_TOKEN {
+		mark := token.end_mark
+		skip_token(parser)
+		token = peek_token(parser)
+		if token == nil {
+			return false
+		}
+		if token.typ != yaml_KEY_TOKEN &&
+			token.typ != yaml_VALUE_TOKEN &&
+			token.typ != yaml_BLOCK_END_TOKEN {
+			parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_VALUE_STATE)
+			return yaml_parser_parse_node(parser, event, true, true)
+		} else {
+			parser.state = yaml_PARSE_BLOCK_MAPPING_VALUE_STATE
+			return yaml_parser_process_empty_scalar(parser, event, mark)
+		}
+	} else if token.typ == yaml_BLOCK_END_TOKEN {
+		parser.state = parser.states[len(parser.states)-1]
+		parser.states = parser.states[:len(parser.states)-1]
+		parser.marks = parser.marks[:len(parser.marks)-1]
+		*event = yaml_event_t{
+			typ:        yaml_MAPPING_END_EVENT,
+			start_mark: token.start_mark,
+			end_mark:   token.end_mark,
+		}
+		skip_token(parser)
+		return true
+	}
+
+	context_mark := parser.marks[len(parser.marks)-1]
+	parser.marks = parser.marks[:len(parser.marks)-1]
+	return yaml_parser_set_parser_error_context(parser,
+		"while parsing a block mapping", context_mark,
+		"did not find expected key", token.start_mark)
+}
+
+// Parse the productions:
+// block_mapping        ::= BLOCK-MAPPING_START
+//
+//                          ((KEY block_node_or_indentless_sequence?)?
+//
+//                          (VALUE block_node_or_indentless_sequence?)?)*
+//                           ***** *
+//                          BLOCK-END
+//
+//
+func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool {
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+	if token.typ == yaml_VALUE_TOKEN {
+		mark := token.end_mark
+		skip_token(parser)
+		token = peek_token(parser)
+		if token == nil {
+			return false
+		}
+		if token.typ != yaml_KEY_TOKEN &&
+			token.typ != yaml_VALUE_TOKEN &&
+			token.typ != yaml_BLOCK_END_TOKEN {
+			parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_KEY_STATE)
+			return yaml_parser_parse_node(parser, event, true, true)
+		}
+		parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE
+		return yaml_parser_process_empty_scalar(parser, event, mark)
+	}
+	parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE
+	return yaml_parser_process_empty_scalar(parser, event, token.start_mark)
+}
+
+// Parse the productions:
+// flow_sequence        ::= FLOW-SEQUENCE-START
+//                          *******************
+//                          (flow_sequence_entry FLOW-ENTRY)*
+//                           *                   **********
+//                          flow_sequence_entry?
+//                          *
+//                          FLOW-SEQUENCE-END
+//                          *****************
+// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+//                          *
+//
+func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
+	if first {
+		token := peek_token(parser)
+		parser.marks = append(parser.marks, token.start_mark)
+		skip_token(parser)
+	}
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+	if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {
+		if !first {
+			if token.typ == yaml_FLOW_ENTRY_TOKEN {
+				skip_token(parser)
+				token = peek_token(parser)
+				if token == nil {
+					return false
+				}
+			} else {
+				context_mark := parser.marks[len(parser.marks)-1]
+				parser.marks = parser.marks[:len(parser.marks)-1]
+				return yaml_parser_set_parser_error_context(parser,
+					"while parsing a flow sequence", context_mark,
+					"did not find expected ',' or ']'", token.start_mark)
+			}
+		}
+
+		if token.typ == yaml_KEY_TOKEN {
+			parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE
+			*event = yaml_event_t{
+				typ:        yaml_MAPPING_START_EVENT,
+				start_mark: token.start_mark,
+				end_mark:   token.end_mark,
+				implicit:   true,
+				style:      yaml_style_t(yaml_FLOW_MAPPING_STYLE),
+			}
+			skip_token(parser)
+			return true
+		} else if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {
+			parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE)
+			return yaml_parser_parse_node(parser, event, false, false)
+		}
+	}
+
+	parser.state = parser.states[len(parser.states)-1]
+	parser.states = parser.states[:len(parser.states)-1]
+	parser.marks = parser.marks[:len(parser.marks)-1]
+
+	*event = yaml_event_t{
+		typ:        yaml_SEQUENCE_END_EVENT,
+		start_mark: token.start_mark,
+		end_mark:   token.end_mark,
+	}
+
+	skip_token(parser)
+	return true
+}
+
+//
+// Parse the productions:
+// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+//                                      *** *
+//
+func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool {
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+	if token.typ != yaml_VALUE_TOKEN &&
+		token.typ != yaml_FLOW_ENTRY_TOKEN &&
+		token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {
+		parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE)
+		return yaml_parser_parse_node(parser, event, false, false)
+	}
+	mark := token.end_mark
+	skip_token(parser)
+	parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE
+	return yaml_parser_process_empty_scalar(parser, event, mark)
+}
+
+// Parse the productions:
+// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+//                                                      ***** *
+//
+func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool {
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+	if token.typ == yaml_VALUE_TOKEN {
+		skip_token(parser)
+		token := peek_token(parser)
+		if token == nil {
+			return false
+		}
+		if token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {
+			parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE)
+			return yaml_parser_parse_node(parser, event, false, false)
+		}
+	}
+	parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE
+	return yaml_parser_process_empty_scalar(parser, event, token.start_mark)
+}
+
+// Parse the productions:
+// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+//                                                                      *
+//
+func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool {
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+	parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE
+	*event = yaml_event_t{
+		typ:        yaml_MAPPING_END_EVENT,
+		start_mark: token.start_mark,
+		end_mark:   token.start_mark, // [Go] Shouldn't this be end_mark?
+	}
+	return true
+}
+
+// Parse the productions:
+// flow_mapping         ::= FLOW-MAPPING-START
+//                          ******************
+//                          (flow_mapping_entry FLOW-ENTRY)*
+//                           *                  **********
+//                          flow_mapping_entry?
+//                          ******************
+//                          FLOW-MAPPING-END
+//                          ****************
+// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+//                          *           *** *
+//
+func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
+	if first {
+		token := peek_token(parser)
+		parser.marks = append(parser.marks, token.start_mark)
+		skip_token(parser)
+	}
+
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+
+	if token.typ != yaml_FLOW_MAPPING_END_TOKEN {
+		if !first {
+			if token.typ == yaml_FLOW_ENTRY_TOKEN {
+				skip_token(parser)
+				token = peek_token(parser)
+				if token == nil {
+					return false
+				}
+			} else {
+				context_mark := parser.marks[len(parser.marks)-1]
+				parser.marks = parser.marks[:len(parser.marks)-1]
+				return yaml_parser_set_parser_error_context(parser,
+					"while parsing a flow mapping", context_mark,
+					"did not find expected ',' or '}'", token.start_mark)
+			}
+		}
+
+		if token.typ == yaml_KEY_TOKEN {
+			skip_token(parser)
+			token = peek_token(parser)
+			if token == nil {
+				return false
+			}
+			if token.typ != yaml_VALUE_TOKEN &&
+				token.typ != yaml_FLOW_ENTRY_TOKEN &&
+				token.typ != yaml_FLOW_MAPPING_END_TOKEN {
+				parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_VALUE_STATE)
+				return yaml_parser_parse_node(parser, event, false, false)
+			} else {
+				parser.state = yaml_PARSE_FLOW_MAPPING_VALUE_STATE
+				return yaml_parser_process_empty_scalar(parser, event, token.start_mark)
+			}
+		} else if token.typ != yaml_FLOW_MAPPING_END_TOKEN {
+			parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE)
+			return yaml_parser_parse_node(parser, event, false, false)
+		}
+	}
+
+	parser.state = parser.states[len(parser.states)-1]
+	parser.states = parser.states[:len(parser.states)-1]
+	parser.marks = parser.marks[:len(parser.marks)-1]
+	*event = yaml_event_t{
+		typ:        yaml_MAPPING_END_EVENT,
+		start_mark: token.start_mark,
+		end_mark:   token.end_mark,
+	}
+	skip_token(parser)
+	return true
+}
+
+// Parse the productions:
+// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+//                                   *                  ***** *
+//
+func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool {
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+	if empty {
+		parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE
+		return yaml_parser_process_empty_scalar(parser, event, token.start_mark)
+	}
+	if token.typ == yaml_VALUE_TOKEN {
+		skip_token(parser)
+		token = peek_token(parser)
+		if token == nil {
+			return false
+		}
+		if token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_MAPPING_END_TOKEN {
+			parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_KEY_STATE)
+			return yaml_parser_parse_node(parser, event, false, false)
+		}
+	}
+	parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE
+	return yaml_parser_process_empty_scalar(parser, event, token.start_mark)
+}
+
+// Generate an empty scalar event.
+func yaml_parser_process_empty_scalar(parser *yaml_parser_t, event *yaml_event_t, mark yaml_mark_t) bool {
+	*event = yaml_event_t{
+		typ:        yaml_SCALAR_EVENT,
+		start_mark: mark,
+		end_mark:   mark,
+		value:      nil, // Empty
+		implicit:   true,
+		style:      yaml_style_t(yaml_PLAIN_SCALAR_STYLE),
+	}
+	return true
+}
+
+var default_tag_directives = []yaml_tag_directive_t{
+	{[]byte("!"), []byte("!")},
+	{[]byte("!!"), []byte("tag:yaml.org,2002:")},
+}
+
+// Parse directives.
+func yaml_parser_process_directives(parser *yaml_parser_t,
+	version_directive_ref **yaml_version_directive_t,
+	tag_directives_ref *[]yaml_tag_directive_t) bool {
+
+	var version_directive *yaml_version_directive_t
+	var tag_directives []yaml_tag_directive_t
+
+	token := peek_token(parser)
+	if token == nil {
+		return false
+	}
+
+	for token.typ == yaml_VERSION_DIRECTIVE_TOKEN || token.typ == yaml_TAG_DIRECTIVE_TOKEN {
+		if token.typ == yaml_VERSION_DIRECTIVE_TOKEN {
+			if version_directive != nil {
+				yaml_parser_set_parser_error(parser,
+					"found duplicate %YAML directive", token.start_mark)
+				return false
+			}
+			if token.major != 1 || token.minor != 1 {
+				yaml_parser_set_parser_error(parser,
+					"found incompatible YAML document", token.start_mark)
+				return false
+			}
+			version_directive = &yaml_version_directive_t{
+				major: token.major,
+				minor: token.minor,
+			}
+		} else if token.typ == yaml_TAG_DIRECTIVE_TOKEN {
+			value := yaml_tag_directive_t{
+				handle: token.value,
+				prefix: token.prefix,
+			}
+			if !yaml_parser_append_tag_directive(parser, value, false, token.start_mark) {
+				return false
+			}
+			tag_directives = append(tag_directives, value)
+		}
+
+		skip_token(parser)
+		token = peek_token(parser)
+		if token == nil {
+			return false
+		}
+	}
+
+	for i := range default_tag_directives {
+		if !yaml_parser_append_tag_directive(parser, default_tag_directives[i], true, token.start_mark) {
+			return false
+		}
+	}
+
+	if version_directive_ref != nil {
+		*version_directive_ref = version_directive
+	}
+	if tag_directives_ref != nil {
+		*tag_directives_ref = tag_directives
+	}
+	return true
+}
+
+// Append a tag directive to the directives stack.
+func yaml_parser_append_tag_directive(parser *yaml_parser_t, value yaml_tag_directive_t, allow_duplicates bool, mark yaml_mark_t) bool {
+	for i := range parser.tag_directives {
+		if bytes.Equal(value.handle, parser.tag_directives[i].handle) {
+			if allow_duplicates {
+				return true
+			}
+			return yaml_parser_set_parser_error(parser, "found duplicate %TAG directive", mark)
+		}
+	}
+
+	// [Go] I suspect the copy is unnecessary. This was likely done
+	// because there was no way to track ownership of the data.
+	value_copy := yaml_tag_directive_t{
+		handle: make([]byte, len(value.handle)),
+		prefix: make([]byte, len(value.prefix)),
+	}
+	copy(value_copy.handle, value.handle)
+	copy(value_copy.prefix, value.prefix)
+	parser.tag_directives = append(parser.tag_directives, value_copy)
+	return true
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/readerc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/readerc.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/readerc.go
new file mode 100644
index 0000000..d5fb097
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/readerc.go
@@ -0,0 +1,391 @@
+package yaml
+
+import (
+	"io"
+)
+
+// Set the reader error and return 0.
+func yaml_parser_set_reader_error(parser *yaml_parser_t, problem string, offset int, value int) bool {
+	parser.error = yaml_READER_ERROR
+	parser.problem = problem
+	parser.problem_offset = offset
+	parser.problem_value = value
+	return false
+}
+
+// Byte order marks.
+const (
+	bom_UTF8    = "\xef\xbb\xbf"
+	bom_UTF16LE = "\xff\xfe"
+	bom_UTF16BE = "\xfe\xff"
+)
+
+// Determine the input stream encoding by checking the BOM symbol. If no BOM is
+// found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure.
+func yaml_parser_determine_encoding(parser *yaml_parser_t) bool {
+	// Ensure that we had enough bytes in the raw buffer.
+	for !parser.eof && len(parser.raw_buffer)-parser.raw_buffer_pos < 3 {
+		if !yaml_parser_update_raw_buffer(parser) {
+			return false
+		}
+	}
+
+	// Determine the encoding.
+	buf := parser.raw_buffer
+	pos := parser.raw_buffer_pos
+	avail := len(buf) - pos
+	if avail >= 2 && buf[pos] == bom_UTF16LE[0] && buf[pos+1] == bom_UTF16LE[1] {
+		parser.encoding = yaml_UTF16LE_ENCODING
+		parser.raw_buffer_pos += 2
+		parser.offset += 2
+	} else if avail >= 2 && buf[pos] == bom_UTF16BE[0] && buf[pos+1] == bom_UTF16BE[1] {
+		parser.encoding = yaml_UTF16BE_ENCODING
+		parser.raw_buffer_pos += 2
+		parser.offset += 2
+	} else if avail >= 3 && buf[pos] == bom_UTF8[0] && buf[pos+1] == bom_UTF8[1] && buf[pos+2] == bom_UTF8[2] {
+		parser.encoding = yaml_UTF8_ENCODING
+		parser.raw_buffer_pos += 3
+		parser.offset += 3
+	} else {
+		parser.encoding = yaml_UTF8_ENCODING
+	}
+	return true
+}
+
+// Update the raw buffer.
+func yaml_parser_update_raw_buffer(parser *yaml_parser_t) bool {
+	size_read := 0
+
+	// Return if the raw buffer is full.
+	if parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) {
+		return true
+	}
+
+	// Return on EOF.
+	if parser.eof {
+		return true
+	}
+
+	// Move the remaining bytes in the raw buffer to the beginning.
+	if parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) {
+		copy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:])
+	}
+	parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos]
+	parser.raw_buffer_pos = 0
+
+	// Call the read handler to fill the buffer.
+	size_read, err := parser.read_handler(parser, parser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)])
+	parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read]
+	if err == io.EOF {
+		parser.eof = true
+	} else if err != nil {
+		return yaml_parser_set_reader_error(parser, "input error: "+err.Error(), parser.offset, -1)
+	}
+	return true
+}
+
+// Ensure that the buffer contains at least `length` characters.
+// Return true on success, false on failure.
+//
+// The length is supposed to be significantly less that the buffer size.
+func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool {
+	if parser.read_handler == nil {
+		panic("read handler must be set")
+	}
+
+	// If the EOF flag is set and the raw buffer is empty, do nothing.
+	if parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) {
+		return true
+	}
+
+	// Return if the buffer contains enough characters.
+	if parser.unread >= length {
+		return true
+	}
+
+	// Determine the input encoding if it is not known yet.
+	if parser.encoding == yaml_ANY_ENCODING {
+		if !yaml_parser_determine_encoding(parser) {
+			return false
+		}
+	}
+
+	// Move the unread characters to the beginning of the buffer.
+	buffer_len := len(parser.buffer)
+	if parser.buffer_pos > 0 && parser.buffer_pos < buffer_len {
+		copy(parser.buffer, parser.buffer[parser.buffer_pos:])
+		buffer_len -= parser.buffer_pos
+		parser.buffer_pos = 0
+	} else if parser.buffer_pos == buffer_len {
+		buffer_len = 0
+		parser.buffer_pos = 0
+	}
+
+	// Open the whole buffer for writing, and cut it before returning.
+	parser.buffer = parser.buffer[:cap(parser.buffer)]
+
+	// Fill the buffer until it has enough characters.
+	first := true
+	for parser.unread < length {
+
+		// Fill the raw buffer if necessary.
+		if !first || parser.raw_buffer_pos == len(parser.raw_buffer) {
+			if !yaml_parser_update_raw_buffer(parser) {
+				parser.buffer = parser.buffer[:buffer_len]
+				return false
+			}
+		}
+		first = false
+
+		// Decode the raw buffer.
+	inner:
+		for parser.raw_buffer_pos != len(parser.raw_buffer) {
+			var value rune
+			var width int
+
+			raw_unread := len(parser.raw_buffer) - parser.raw_buffer_pos
+
+			// Decode the next character.
+			switch parser.encoding {
+			case yaml_UTF8_ENCODING:
+				// Decode a UTF-8 character.  Check RFC 3629
+				// (http://www.ietf.org/rfc/rfc3629.txt) for more details.
+				//
+				// The following table (taken from the RFC) is used for
+				// decoding.
+				//
+				//    Char. number range |        UTF-8 octet sequence
+				//      (hexadecimal)    |              (binary)
+				//   --------------------+------------------------------------
+				//   0000 0000-0000 007F | 0xxxxxxx
+				//   0000 0080-0000 07FF | 110xxxxx 10xxxxxx
+				//   0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
+				//   0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+				//
+				// Additionally, the characters in the range 0xD800-0xDFFF
+				// are prohibited as they are reserved for use with UTF-16
+				// surrogate pairs.
+
+				// Determine the length of the UTF-8 sequence.
+				octet := parser.raw_buffer[parser.raw_buffer_pos]
+				switch {
+				case octet&0x80 == 0x00:
+					width = 1
+				case octet&0xE0 == 0xC0:
+					width = 2
+				case octet&0xF0 == 0xE0:
+					width = 3
+				case octet&0xF8 == 0xF0:
+					width = 4
+				default:
+					// The leading octet is invalid.
+					return yaml_parser_set_reader_error(parser,
+						"invalid leading UTF-8 octet",
+						parser.offset, int(octet))
+				}
+
+				// Check if the raw buffer contains an incomplete character.
+				if width > raw_unread {
+					if parser.eof {
+						return yaml_parser_set_reader_error(parser,
+							"incomplete UTF-8 octet sequence",
+							parser.offset, -1)
+					}
+					break inner
+				}
+
+				// Decode the leading octet.
+				switch {
+				case octet&0x80 == 0x00:
+					value = rune(octet & 0x7F)
+				case octet&0xE0 == 0xC0:
+					value = rune(octet & 0x1F)
+				case octet&0xF0 == 0xE0:
+					value = rune(octet & 0x0F)
+				case octet&0xF8 == 0xF0:
+					value = rune(octet & 0x07)
+				default:
+					value = 0
+				}
+
+				// Check and decode the trailing octets.
+				for k := 1; k < width; k++ {
+					octet = parser.raw_buffer[parser.raw_buffer_pos+k]
+
+					// Check if the octet is valid.
+					if (octet & 0xC0) != 0x80 {
+						return yaml_parser_set_reader_error(parser,
+							"invalid trailing UTF-8 octet",
+							parser.offset+k, int(octet))
+					}
+
+					// Decode the octet.
+					value = (value << 6) + rune(octet&0x3F)
+				}
+
+				// Check the length of the sequence against the value.
+				switch {
+				case width == 1:
+				case width == 2 && value >= 0x80:
+				case width == 3 && value >= 0x800:
+				case width == 4 && value >= 0x10000:
+				default:
+					return yaml_parser_set_reader_error(parser,
+						"invalid length of a UTF-8 sequence",
+						parser.offset, -1)
+				}
+
+				// Check the range of the value.
+				if value >= 0xD800 && value <= 0xDFFF || value > 0x10FFFF {
+					return yaml_parser_set_reader_error(parser,
+						"invalid Unicode character",
+						parser.offset, int(value))
+				}
+
+			case yaml_UTF16LE_ENCODING, yaml_UTF16BE_ENCODING:
+				var low, high int
+				if parser.encoding == yaml_UTF16LE_ENCODING {
+					low, high = 0, 1
+				} else {
+					high, low = 1, 0
+				}
+
+				// The UTF-16 encoding is not as simple as one might
+				// naively think.  Check RFC 2781
+				// (http://www.ietf.org/rfc/rfc2781.txt).
+				//
+				// Normally, two subsequent bytes describe a Unicode
+				// character.  However a special technique (called a
+				// surrogate pair) is used for specifying character
+				// values larger than 0xFFFF.
+				//
+				// A surrogate pair consists of two pseudo-characters:
+				//      high surrogate area (0xD800-0xDBFF)
+				//      low surrogate area (0xDC00-0xDFFF)
+				//
+				// The following formulas are used for decoding
+				// and encoding characters using surrogate pairs:
+				//
+				//  U  = U' + 0x10000   (0x01 00 00 <= U <= 0x10 FF FF)
+				//  U' = yyyyyyyyyyxxxxxxxxxx   (0 <= U' <= 0x0F FF FF)
+				//  W1 = 110110yyyyyyyyyy
+				//  W2 = 110111xxxxxxxxxx
+				//
+				// where U is the character value, W1 is the high surrogate
+				// area, W2 is the low surrogate area.
+
+				// Check for incomplete UTF-16 character.
+				if raw_unread < 2 {
+					if parser.eof {
+						return yaml_parser_set_reader_error(parser,
+							"incomplete UTF-16 character",
+							parser.offset, -1)
+					}
+					break inner
+				}
+
+				// Get the character.
+				value = rune(parser.raw_buffer[parser.raw_buffer_pos+low]) +
+					(rune(parser.raw_buffer[parser.raw_buffer_pos+high]) << 8)
+
+				// Check for unexpected low surrogate area.
+				if value&0xFC00 == 0xDC00 {
+					return yaml_parser_set_reader_error(parser,
+						"unexpected low surrogate area",
+						parser.offset, int(value))
+				}
+
+				// Check for a high surrogate area.
+				if value&0xFC00 == 0xD800 {
+					width = 4
+
+					// Check for incomplete surrogate pair.
+					if raw_unread < 4 {
+						if parser.eof {
+							return yaml_parser_set_reader_error(parser,
+								"incomplete UTF-16 surrogate pair",
+								parser.offset, -1)
+						}
+						break inner
+					}
+
+					// Get the next character.
+					value2 := rune(parser.raw_buffer[parser.raw_buffer_pos+low+2]) +
+						(rune(parser.raw_buffer[parser.raw_buffer_pos+high+2]) << 8)
+
+					// Check for a low surrogate area.
+					if value2&0xFC00 != 0xDC00 {
+						return yaml_parser_set_reader_error(parser,
+							"expected low surrogate area",
+							parser.offset+2, int(value2))
+					}
+
+					// Generate the value of the surrogate pair.
+					value = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF)
+				} else {
+					width = 2
+				}
+
+			default:
+				panic("impossible")
+			}
+
+			// Check if the character is in the allowed range:
+			//      #x9 | #xA | #xD | [#x20-#x7E]               (8 bit)
+			//      | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD]    (16 bit)
+			//      | [#x10000-#x10FFFF]                        (32 bit)
+			switch {
+			case value == 0x09:
+			case value == 0x0A:
+			case value == 0x0D:
+			case value >= 0x20 && value <= 0x7E:
+			case value == 0x85:
+			case value >= 0xA0 && value <= 0xD7FF:
+			case value >= 0xE000 && value <= 0xFFFD:
+			case value >= 0x10000 && value <= 0x10FFFF:
+			default:
+				return yaml_parser_set_reader_error(parser,
+					"control characters are not allowed",
+					parser.offset, int(value))
+			}
+
+			// Move the raw pointers.
+			parser.raw_buffer_pos += width
+			parser.offset += width
+
+			// Finally put the character into the buffer.
+			if value <= 0x7F {
+				// 0000 0000-0000 007F . 0xxxxxxx
+				parser.buffer[buffer_len+0] = byte(value)
+			} else if value <= 0x7FF {
+				// 0000 0080-0000 07FF . 110xxxxx 10xxxxxx
+				parser.buffer[buffer_len+0] = byte(0xC0 + (value >> 6))
+				parser.buffer[buffer_len+1] = byte(0x80 + (value & 0x3F))
+			} else if value <= 0xFFFF {
+				// 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx
+				parser.buffer[buffer_len+0] = byte(0xE0 + (value >> 12))
+				parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 6) & 0x3F))
+				parser.buffer[buffer_len+2] = byte(0x80 + (value & 0x3F))
+			} else {
+				// 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+				parser.buffer[buffer_len+0] = byte(0xF0 + (value >> 18))
+				parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 12) & 0x3F))
+				parser.buffer[buffer_len+2] = byte(0x80 + ((value >> 6) & 0x3F))
+				parser.buffer[buffer_len+3] = byte(0x80 + (value & 0x3F))
+			}
+			buffer_len += width
+
+			parser.unread++
+		}
+
+		// On EOF, put NUL into the buffer and return.
+		if parser.eof {
+			parser.buffer[buffer_len] = 0
+			buffer_len++
+			parser.unread++
+			break
+		}
+	}
+	parser.buffer = parser.buffer[:buffer_len]
+	return true
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/resolve.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/resolve.go b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/resolve.go
new file mode 100644
index 0000000..93a8632
--- /dev/null
+++ b/newt/Godeps/_workspace/src/gopkg.in/yaml.v2/resolve.go
@@ -0,0 +1,203 @@
+package yaml
+
+import (
+	"encoding/base64"
+	"math"
+	"strconv"
+	"strings"
+	"unicode/utf8"
+)
+
+type resolveMapItem struct {
+	value interface{}
+	tag   string
+}
+
+var resolveTable = make([]byte, 256)
+var resolveMap = make(map[string]resolveMapItem)
+
+func init() {
+	t := resolveTable
+	t[int('+')] = 'S' // Sign
+	t[int('-')] = 'S'
+	for _, c := range "0123456789" {
+		t[int(c)] = 'D' // Digit
+	}
+	for _, c := range "yYnNtTfFoO~" {
+		t[int(c)] = 'M' // In map
+	}
+	t[int('.')] = '.' // Float (potentially in map)
+
+	var resolveMapList = []struct {
+		v   interface{}
+		tag string
+		l   []string
+	}{
+		{true, yaml_BOOL_TAG, []string{"y", "Y", "yes", "Yes", "YES"}},
+		{true, yaml_BOOL_TAG, []string{"true", "True", "TRUE"}},
+		{true, yaml_BOOL_TAG, []string{"on", "On", "ON"}},
+		{false, yaml_BOOL_TAG, []string{"n", "N", "no", "No", "NO"}},
+		{false, yaml_BOOL_TAG, []string{"false", "False", "FALSE"}},
+		{false, yaml_BOOL_TAG, []string{"off", "Off", "OFF"}},
+		{nil, yaml_NULL_TAG, []string{"", "~", "null", "Null", "NULL"}},
+		{math.NaN(), yaml_FLOAT_TAG, []string{".nan", ".NaN", ".NAN"}},
+		{math.Inf(+1), yaml_FLOAT_TAG, []string{".inf", ".Inf", ".INF"}},
+		{math.Inf(+1), yaml_FLOAT_TAG, []string{"+.inf", "+.Inf", "+.INF"}},
+		{math.Inf(-1), yaml_FLOAT_TAG, []string{"-.inf", "-.Inf", "-.INF"}},
+		{"<<", yaml_MERGE_TAG, []string{"<<"}},
+	}
+
+	m := resolveMap
+	for _, item := range resolveMapList {
+		for _, s := range item.l {
+			m[s] = resolveMapItem{item.v, item.tag}
+		}
+	}
+}
+
+const longTagPrefix = "tag:yaml.org,2002:"
+
+func shortTag(tag string) string {
+	// TODO This can easily be made faster and produce less garbage.
+	if strings.HasPrefix(tag, longTagPrefix) {
+		return "!!" + tag[len(longTagPrefix):]
+	}
+	return tag
+}
+
+func longTag(tag string) string {
+	if strings.HasPrefix(tag, "!!") {
+		return longTagPrefix + tag[2:]
+	}
+	return tag
+}
+
+func resolvableTag(tag string) bool {
+	switch tag {
+	case "", yaml_STR_TAG, yaml_BOOL_TAG, yaml_INT_TAG, yaml_FLOAT_TAG, yaml_NULL_TAG:
+		return true
+	}
+	return false
+}
+
+func resolve(tag string, in string) (rtag string, out interface{}) {
+	if !resolvableTag(tag) {
+		return tag, in
+	}
+
+	defer func() {
+		switch tag {
+		case "", rtag, yaml_STR_TAG, yaml_BINARY_TAG:
+			return
+		}
+		failf("cannot decode %s `%s` as a %s", shortTag(rtag), in, shortTag(tag))
+	}()
+
+	// Any data is accepted as a !!str or !!binary.
+	// Otherwise, the prefix is enough of a hint about what it might be.
+	hint := byte('N')
+	if in != "" {
+		hint = resolveTable[in[0]]
+	}
+	if hint != 0 && tag != yaml_STR_TAG && tag != yaml_BINARY_TAG {
+		// Handle things we can lookup in a map.
+		if item, ok := resolveMap[in]; ok {
+			return item.tag, item.value
+		}
+
+		// Base 60 floats are a bad idea, were dropped in YAML 1.2, and
+		// are purposefully unsupported here. They're still quoted on
+		// the way out for compatibility with other parser, though.
+
+		switch hint {
+		case 'M':
+			// We've already checked the map above.
+
+		case '.':
+			// Not in the map, so maybe a normal float.
+			floatv, err := strconv.ParseFloat(in, 64)
+			if err == nil {
+				return yaml_FLOAT_TAG, floatv
+			}
+
+		case 'D', 'S':
+			// Int, float, or timestamp.
+			plain := strings.Replace(in, "_", "", -1)
+			intv, err := strconv.ParseInt(plain, 0, 64)
+			if err == nil {
+				if intv == int64(int(intv)) {
+					return yaml_INT_TAG, int(intv)
+				} else {
+					return yaml_INT_TAG, intv
+				}
+			}
+			uintv, err := strconv.ParseUint(plain, 0, 64)
+			if err == nil {
+				return yaml_INT_TAG, uintv
+			}
+			floatv, err := strconv.ParseFloat(plain, 64)
+			if err == nil {
+				return yaml_FLOAT_TAG, floatv
+			}
+			if strings.HasPrefix(plain, "0b") {
+				intv, err := strconv.ParseInt(plain[2:], 2, 64)
+				if err == nil {
+					if intv == int64(int(intv)) {
+						return yaml_INT_TAG, int(intv)
+					} else {
+						return yaml_INT_TAG, intv
+					}
+				}
+				uintv, err := strconv.ParseUint(plain[2:], 2, 64)
+				if err == nil {
+					return yaml_INT_TAG, uintv
+				}
+			} else if strings.HasPrefix(plain, "-0b") {
+				intv, err := strconv.ParseInt(plain[3:], 2, 64)
+				if err == nil {
+					if intv == int64(int(intv)) {
+						return yaml_INT_TAG, -int(intv)
+					} else {
+						return yaml_INT_TAG, -intv
+					}
+				}
+			}
+			// XXX Handle timestamps here.
+
+		default:
+			panic("resolveTable item not yet handled: " + string(rune(hint)) + " (with " + in + ")")
+		}
+	}
+	if tag == yaml_BINARY_TAG {
+		return yaml_BINARY_TAG, in
+	}
+	if utf8.ValidString(in) {
+		return yaml_STR_TAG, in
+	}
+	return yaml_BINARY_TAG, encodeBase64(in)
+}
+
+// encodeBase64 encodes s as base64 that is broken up into multiple lines
+// as appropriate for the resulting length.
+func encodeBase64(s string) string {
+	const lineLen = 70
+	encLen := base64.StdEncoding.EncodedLen(len(s))
+	lines := encLen/lineLen + 1
+	buf := make([]byte, encLen*2+lines)
+	in := buf[0:encLen]
+	out := buf[encLen:]
+	base64.StdEncoding.Encode(in, []byte(s))
+	k := 0
+	for i := 0; i < len(in); i += lineLen {
+		j := i + lineLen
+		if j > len(in) {
+			j = len(in)
+		}
+		k += copy(out[k:], in[i:j])
+		if lines > 1 {
+			out[k] = '\n'
+			k++
+		}
+	}
+	return string(out[:k])
+}


[12/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/README.md b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/README.md
new file mode 100644
index 0000000..659d688
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/README.md
@@ -0,0 +1,46 @@
+# mapstructure
+
+mapstructure is a Go library for decoding generic map values to structures
+and vice versa, while providing helpful error handling.
+
+This library is most useful when decoding values from some data stream (JSON,
+Gob, etc.) where you don't _quite_ know the structure of the underlying data
+until you read a part of it. You can therefore read a `map[string]interface{}`
+and use this library to decode it into the proper underlying native Go
+structure.
+
+## Installation
+
+Standard `go get`:
+
+```
+$ go get github.com/mitchellh/mapstructure
+```
+
+## Usage & Example
+
+For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/mapstructure).
+
+The `Decode` function has examples associated with it there.
+
+## But Why?!
+
+Go offers fantastic standard libraries for decoding formats such as JSON.
+The standard method is to have a struct pre-created, and populate that struct
+from the bytes of the encoded format. This is great, but the problem is if
+you have configuration or an encoding that changes slightly depending on
+specific fields. For example, consider this JSON:
+
+```json
+{
+  "type": "person",
+  "name": "Mitchell"
+}
+```
+
+Perhaps we can't populate a specific structure without first reading
+the "type" field from the JSON. We could always do two passes over the
+decoding of the JSON (reading the "type" first, and the rest later).
+However, it is much simpler to just decode this into a `map[string]interface{}`
+structure, read the "type" key, then use something like this library
+to decode it into the proper structure.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks.go b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks.go
new file mode 100644
index 0000000..aa91f76
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks.go
@@ -0,0 +1,151 @@
+package mapstructure
+
+import (
+	"errors"
+	"reflect"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// typedDecodeHook takes a raw DecodeHookFunc (an interface{}) and turns
+// it into the proper DecodeHookFunc type, such as DecodeHookFuncType.
+func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc {
+	// Create variables here so we can reference them with the reflect pkg
+	var f1 DecodeHookFuncType
+	var f2 DecodeHookFuncKind
+
+	// Fill in the variables into this interface and the rest is done
+	// automatically using the reflect package.
+	potential := []interface{}{f1, f2}
+
+	v := reflect.ValueOf(h)
+	vt := v.Type()
+	for _, raw := range potential {
+		pt := reflect.ValueOf(raw).Type()
+		if vt.ConvertibleTo(pt) {
+			return v.Convert(pt).Interface()
+		}
+	}
+
+	return nil
+}
+
+// DecodeHookExec executes the given decode hook. This should be used
+// since it'll naturally degrade to the older backwards compatible DecodeHookFunc
+// that took reflect.Kind instead of reflect.Type.
+func DecodeHookExec(
+	raw DecodeHookFunc,
+	from reflect.Type, to reflect.Type,
+	data interface{}) (interface{}, error) {
+	// Build our arguments that reflect expects
+	argVals := make([]reflect.Value, 3)
+	argVals[0] = reflect.ValueOf(from)
+	argVals[1] = reflect.ValueOf(to)
+	argVals[2] = reflect.ValueOf(data)
+
+	switch f := typedDecodeHook(raw).(type) {
+	case DecodeHookFuncType:
+		return f(from, to, data)
+	case DecodeHookFuncKind:
+		return f(from.Kind(), to.Kind(), data)
+	default:
+		return nil, errors.New("invalid decode hook signature")
+	}
+}
+
+// ComposeDecodeHookFunc creates a single DecodeHookFunc that
+// automatically composes multiple DecodeHookFuncs.
+//
+// The composed funcs are called in order, with the result of the
+// previous transformation.
+func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc {
+	return func(
+		f reflect.Type,
+		t reflect.Type,
+		data interface{}) (interface{}, error) {
+		var err error
+		for _, f1 := range fs {
+			data, err = DecodeHookExec(f1, f, t, data)
+			if err != nil {
+				return nil, err
+			}
+
+			// Modify the from kind to be correct with the new data
+			f = reflect.ValueOf(data).Type()
+		}
+
+		return data, nil
+	}
+}
+
+// StringToSliceHookFunc returns a DecodeHookFunc that converts
+// string to []string by splitting on the given sep.
+func StringToSliceHookFunc(sep string) DecodeHookFunc {
+	return func(
+		f reflect.Kind,
+		t reflect.Kind,
+		data interface{}) (interface{}, error) {
+		if f != reflect.String || t != reflect.Slice {
+			return data, nil
+		}
+
+		raw := data.(string)
+		if raw == "" {
+			return []string{}, nil
+		}
+
+		return strings.Split(raw, sep), nil
+	}
+}
+
+// StringToTimeDurationHookFunc returns a DecodeHookFunc that converts
+// strings to time.Duration.
+func StringToTimeDurationHookFunc() DecodeHookFunc {
+	return func(
+		f reflect.Type,
+		t reflect.Type,
+		data interface{}) (interface{}, error) {
+		if f.Kind() != reflect.String {
+			return data, nil
+		}
+		if t != reflect.TypeOf(time.Duration(5)) {
+			return data, nil
+		}
+
+		// Convert it by parsing
+		return time.ParseDuration(data.(string))
+	}
+}
+
+func WeaklyTypedHook(
+	f reflect.Kind,
+	t reflect.Kind,
+	data interface{}) (interface{}, error) {
+	dataVal := reflect.ValueOf(data)
+	switch t {
+	case reflect.String:
+		switch f {
+		case reflect.Bool:
+			if dataVal.Bool() {
+				return "1", nil
+			} else {
+				return "0", nil
+			}
+		case reflect.Float32:
+			return strconv.FormatFloat(dataVal.Float(), 'f', -1, 64), nil
+		case reflect.Int:
+			return strconv.FormatInt(dataVal.Int(), 10), nil
+		case reflect.Slice:
+			dataType := dataVal.Type()
+			elemKind := dataType.Elem().Kind()
+			if elemKind == reflect.Uint8 {
+				return string(dataVal.Interface().([]uint8)), nil
+			}
+		case reflect.Uint:
+			return strconv.FormatUint(dataVal.Uint(), 10), nil
+		}
+	}
+
+	return data, nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks_test.go b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks_test.go
new file mode 100644
index 0000000..53289af
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/decode_hooks_test.go
@@ -0,0 +1,229 @@
+package mapstructure
+
+import (
+	"errors"
+	"reflect"
+	"testing"
+	"time"
+)
+
+func TestComposeDecodeHookFunc(t *testing.T) {
+	f1 := func(
+		f reflect.Kind,
+		t reflect.Kind,
+		data interface{}) (interface{}, error) {
+		return data.(string) + "foo", nil
+	}
+
+	f2 := func(
+		f reflect.Kind,
+		t reflect.Kind,
+		data interface{}) (interface{}, error) {
+		return data.(string) + "bar", nil
+	}
+
+	f := ComposeDecodeHookFunc(f1, f2)
+
+	result, err := DecodeHookExec(
+		f, reflect.TypeOf(""), reflect.TypeOf([]byte("")), "")
+	if err != nil {
+		t.Fatalf("bad: %s", err)
+	}
+	if result.(string) != "foobar" {
+		t.Fatalf("bad: %#v", result)
+	}
+}
+
+func TestComposeDecodeHookFunc_err(t *testing.T) {
+	f1 := func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) {
+		return nil, errors.New("foo")
+	}
+
+	f2 := func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) {
+		panic("NOPE")
+	}
+
+	f := ComposeDecodeHookFunc(f1, f2)
+
+	_, err := DecodeHookExec(
+		f, reflect.TypeOf(""), reflect.TypeOf([]byte("")), 42)
+	if err.Error() != "foo" {
+		t.Fatalf("bad: %s", err)
+	}
+}
+
+func TestComposeDecodeHookFunc_kinds(t *testing.T) {
+	var f2From reflect.Kind
+
+	f1 := func(
+		f reflect.Kind,
+		t reflect.Kind,
+		data interface{}) (interface{}, error) {
+		return int(42), nil
+	}
+
+	f2 := func(
+		f reflect.Kind,
+		t reflect.Kind,
+		data interface{}) (interface{}, error) {
+		f2From = f
+		return data, nil
+	}
+
+	f := ComposeDecodeHookFunc(f1, f2)
+
+	_, err := DecodeHookExec(
+		f, reflect.TypeOf(""), reflect.TypeOf([]byte("")), "")
+	if err != nil {
+		t.Fatalf("bad: %s", err)
+	}
+	if f2From != reflect.Int {
+		t.Fatalf("bad: %#v", f2From)
+	}
+}
+
+func TestStringToSliceHookFunc(t *testing.T) {
+	f := StringToSliceHookFunc(",")
+
+	strType := reflect.TypeOf("")
+	sliceType := reflect.TypeOf([]byte(""))
+	cases := []struct {
+		f, t   reflect.Type
+		data   interface{}
+		result interface{}
+		err    bool
+	}{
+		{sliceType, sliceType, 42, 42, false},
+		{strType, strType, 42, 42, false},
+		{
+			strType,
+			sliceType,
+			"foo,bar,baz",
+			[]string{"foo", "bar", "baz"},
+			false,
+		},
+		{
+			strType,
+			sliceType,
+			"",
+			[]string{},
+			false,
+		},
+	}
+
+	for i, tc := range cases {
+		actual, err := DecodeHookExec(f, tc.f, tc.t, tc.data)
+		if tc.err != (err != nil) {
+			t.Fatalf("case %d: expected err %#v", i, tc.err)
+		}
+		if !reflect.DeepEqual(actual, tc.result) {
+			t.Fatalf(
+				"case %d: expected %#v, got %#v",
+				i, tc.result, actual)
+		}
+	}
+}
+
+func TestStringToTimeDurationHookFunc(t *testing.T) {
+	f := StringToTimeDurationHookFunc()
+
+	strType := reflect.TypeOf("")
+	timeType := reflect.TypeOf(time.Duration(5))
+	cases := []struct {
+		f, t   reflect.Type
+		data   interface{}
+		result interface{}
+		err    bool
+	}{
+		{strType, timeType, "5s", 5 * time.Second, false},
+		{strType, timeType, "5", time.Duration(0), true},
+		{strType, strType, "5", "5", false},
+	}
+
+	for i, tc := range cases {
+		actual, err := DecodeHookExec(f, tc.f, tc.t, tc.data)
+		if tc.err != (err != nil) {
+			t.Fatalf("case %d: expected err %#v", i, tc.err)
+		}
+		if !reflect.DeepEqual(actual, tc.result) {
+			t.Fatalf(
+				"case %d: expected %#v, got %#v",
+				i, tc.result, actual)
+		}
+	}
+}
+
+func TestWeaklyTypedHook(t *testing.T) {
+	var f DecodeHookFunc = WeaklyTypedHook
+
+	boolType := reflect.TypeOf(true)
+	strType := reflect.TypeOf("")
+	sliceType := reflect.TypeOf([]byte(""))
+	cases := []struct {
+		f, t   reflect.Type
+		data   interface{}
+		result interface{}
+		err    bool
+	}{
+		// TO STRING
+		{
+			boolType,
+			strType,
+			false,
+			"0",
+			false,
+		},
+
+		{
+			boolType,
+			strType,
+			true,
+			"1",
+			false,
+		},
+
+		{
+			reflect.TypeOf(float32(1)),
+			strType,
+			float32(7),
+			"7",
+			false,
+		},
+
+		{
+			reflect.TypeOf(int(1)),
+			strType,
+			int(7),
+			"7",
+			false,
+		},
+
+		{
+			sliceType,
+			strType,
+			[]uint8("foo"),
+			"foo",
+			false,
+		},
+
+		{
+			reflect.TypeOf(uint(1)),
+			strType,
+			uint(7),
+			"7",
+			false,
+		},
+	}
+
+	for i, tc := range cases {
+		actual, err := DecodeHookExec(f, tc.f, tc.t, tc.data)
+		if tc.err != (err != nil) {
+			t.Fatalf("case %d: expected err %#v", i, tc.err)
+		}
+		if !reflect.DeepEqual(actual, tc.result) {
+			t.Fatalf(
+				"case %d: expected %#v, got %#v",
+				i, tc.result, actual)
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/error.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/error.go b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/error.go
new file mode 100644
index 0000000..47a99e5
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/error.go
@@ -0,0 +1,50 @@
+package mapstructure
+
+import (
+	"errors"
+	"fmt"
+	"sort"
+	"strings"
+)
+
+// Error implements the error interface and can represents multiple
+// errors that occur in the course of a single decode.
+type Error struct {
+	Errors []string
+}
+
+func (e *Error) Error() string {
+	points := make([]string, len(e.Errors))
+	for i, err := range e.Errors {
+		points[i] = fmt.Sprintf("* %s", err)
+	}
+
+	sort.Strings(points)
+	return fmt.Sprintf(
+		"%d error(s) decoding:\n\n%s",
+		len(e.Errors), strings.Join(points, "\n"))
+}
+
+// WrappedErrors implements the errwrap.Wrapper interface to make this
+// return value more useful with the errwrap and go-multierror libraries.
+func (e *Error) WrappedErrors() []error {
+	if e == nil {
+		return nil
+	}
+
+	result := make([]error, len(e.Errors))
+	for i, e := range e.Errors {
+		result[i] = errors.New(e)
+	}
+
+	return result
+}
+
+func appendErrors(errors []string, err error) []string {
+	switch e := err.(type) {
+	case *Error:
+		return append(errors, e.Errors...)
+	default:
+		return append(errors, e.Error())
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure.go b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure.go
new file mode 100644
index 0000000..40be511
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure.go
@@ -0,0 +1,745 @@
+// The mapstructure package exposes functionality to convert an
+// abitrary map[string]interface{} into a native Go structure.
+//
+// The Go structure can be arbitrarily complex, containing slices,
+// other structs, etc. and the decoder will properly decode nested
+// maps and so on into the proper structures in the native Go struct.
+// See the examples to see what the decoder is capable of.
+package mapstructure
+
+import (
+	"errors"
+	"fmt"
+	"reflect"
+	"sort"
+	"strconv"
+	"strings"
+)
+
+// DecodeHookFunc is the callback function that can be used for
+// data transformations. See "DecodeHook" in the DecoderConfig
+// struct.
+//
+// The type should be DecodeHookFuncType or DecodeHookFuncKind.
+// Either is accepted. Types are a superset of Kinds (Types can return
+// Kinds) and are generally a richer thing to use, but Kinds are simpler
+// if you only need those.
+//
+// The reason DecodeHookFunc is multi-typed is for backwards compatibility:
+// we started with Kinds and then realized Types were the better solution,
+// but have a promise to not break backwards compat so we now support
+// both.
+type DecodeHookFunc interface{}
+
+type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface{}, error)
+type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error)
+
+// DecoderConfig is the configuration that is used to create a new decoder
+// and allows customization of various aspects of decoding.
+type DecoderConfig struct {
+	// DecodeHook, if set, will be called before any decoding and any
+	// type conversion (if WeaklyTypedInput is on). This lets you modify
+	// the values before they're set down onto the resulting struct.
+	//
+	// If an error is returned, the entire decode will fail with that
+	// error.
+	DecodeHook DecodeHookFunc
+
+	// If ErrorUnused is true, then it is an error for there to exist
+	// keys in the original map that were unused in the decoding process
+	// (extra keys).
+	ErrorUnused bool
+
+	// ZeroFields, if set to true, will zero fields before writing them.
+	// For example, a map will be emptied before decoded values are put in
+	// it. If this is false, a map will be merged.
+	ZeroFields bool
+
+	// If WeaklyTypedInput is true, the decoder will make the following
+	// "weak" conversions:
+	//
+	//   - bools to string (true = "1", false = "0")
+	//   - numbers to string (base 10)
+	//   - bools to int/uint (true = 1, false = 0)
+	//   - strings to int/uint (base implied by prefix)
+	//   - int to bool (true if value != 0)
+	//   - string to bool (accepts: 1, t, T, TRUE, true, True, 0, f, F,
+	//     FALSE, false, False. Anything else is an error)
+	//   - empty array = empty map and vice versa
+	//   - negative numbers to overflowed uint values (base 10)
+	//
+	WeaklyTypedInput bool
+
+	// Metadata is the struct that will contain extra metadata about
+	// the decoding. If this is nil, then no metadata will be tracked.
+	Metadata *Metadata
+
+	// Result is a pointer to the struct that will contain the decoded
+	// value.
+	Result interface{}
+
+	// The tag name that mapstructure reads for field names. This
+	// defaults to "mapstructure"
+	TagName string
+}
+
+// A Decoder takes a raw interface value and turns it into structured
+// data, keeping track of rich error information along the way in case
+// anything goes wrong. Unlike the basic top-level Decode method, you can
+// more finely control how the Decoder behaves using the DecoderConfig
+// structure. The top-level Decode method is just a convenience that sets
+// up the most basic Decoder.
+type Decoder struct {
+	config *DecoderConfig
+}
+
+// Metadata contains information about decoding a structure that
+// is tedious or difficult to get otherwise.
+type Metadata struct {
+	// Keys are the keys of the structure which were successfully decoded
+	Keys []string
+
+	// Unused is a slice of keys that were found in the raw value but
+	// weren't decoded since there was no matching field in the result interface
+	Unused []string
+}
+
+// Decode takes a map and uses reflection to convert it into the
+// given Go native structure. val must be a pointer to a struct.
+func Decode(m interface{}, rawVal interface{}) error {
+	config := &DecoderConfig{
+		Metadata: nil,
+		Result:   rawVal,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		return err
+	}
+
+	return decoder.Decode(m)
+}
+
+// WeakDecode is the same as Decode but is shorthand to enable
+// WeaklyTypedInput. See DecoderConfig for more info.
+func WeakDecode(input, output interface{}) error {
+	config := &DecoderConfig{
+		Metadata:         nil,
+		Result:           output,
+		WeaklyTypedInput: true,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		return err
+	}
+
+	return decoder.Decode(input)
+}
+
+// NewDecoder returns a new decoder for the given configuration. Once
+// a decoder has been returned, the same configuration must not be used
+// again.
+func NewDecoder(config *DecoderConfig) (*Decoder, error) {
+	val := reflect.ValueOf(config.Result)
+	if val.Kind() != reflect.Ptr {
+		return nil, errors.New("result must be a pointer")
+	}
+
+	val = val.Elem()
+	if !val.CanAddr() {
+		return nil, errors.New("result must be addressable (a pointer)")
+	}
+
+	if config.Metadata != nil {
+		if config.Metadata.Keys == nil {
+			config.Metadata.Keys = make([]string, 0)
+		}
+
+		if config.Metadata.Unused == nil {
+			config.Metadata.Unused = make([]string, 0)
+		}
+	}
+
+	if config.TagName == "" {
+		config.TagName = "mapstructure"
+	}
+
+	result := &Decoder{
+		config: config,
+	}
+
+	return result, nil
+}
+
+// Decode decodes the given raw interface to the target pointer specified
+// by the configuration.
+func (d *Decoder) Decode(raw interface{}) error {
+	return d.decode("", raw, reflect.ValueOf(d.config.Result).Elem())
+}
+
+// Decodes an unknown data type into a specific reflection value.
+func (d *Decoder) decode(name string, data interface{}, val reflect.Value) error {
+	if data == nil {
+		// If the data is nil, then we don't set anything.
+		return nil
+	}
+
+	dataVal := reflect.ValueOf(data)
+	if !dataVal.IsValid() {
+		// If the data value is invalid, then we just set the value
+		// to be the zero value.
+		val.Set(reflect.Zero(val.Type()))
+		return nil
+	}
+
+	if d.config.DecodeHook != nil {
+		// We have a DecodeHook, so let's pre-process the data.
+		var err error
+		data, err = DecodeHookExec(
+			d.config.DecodeHook,
+			dataVal.Type(), val.Type(), data)
+		if err != nil {
+			return err
+		}
+	}
+
+	var err error
+	dataKind := getKind(val)
+	switch dataKind {
+	case reflect.Bool:
+		err = d.decodeBool(name, data, val)
+	case reflect.Interface:
+		err = d.decodeBasic(name, data, val)
+	case reflect.String:
+		err = d.decodeString(name, data, val)
+	case reflect.Int:
+		err = d.decodeInt(name, data, val)
+	case reflect.Uint:
+		err = d.decodeUint(name, data, val)
+	case reflect.Float32:
+		err = d.decodeFloat(name, data, val)
+	case reflect.Struct:
+		err = d.decodeStruct(name, data, val)
+	case reflect.Map:
+		err = d.decodeMap(name, data, val)
+	case reflect.Ptr:
+		err = d.decodePtr(name, data, val)
+	case reflect.Slice:
+		err = d.decodeSlice(name, data, val)
+	default:
+		// If we reached this point then we weren't able to decode it
+		return fmt.Errorf("%s: unsupported type: %s", name, dataKind)
+	}
+
+	// If we reached here, then we successfully decoded SOMETHING, so
+	// mark the key as used if we're tracking metadata.
+	if d.config.Metadata != nil && name != "" {
+		d.config.Metadata.Keys = append(d.config.Metadata.Keys, name)
+	}
+
+	return err
+}
+
+// This decodes a basic type (bool, int, string, etc.) and sets the
+// value to "data" of that type.
+func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error {
+	dataVal := reflect.ValueOf(data)
+	dataValType := dataVal.Type()
+	if !dataValType.AssignableTo(val.Type()) {
+		return fmt.Errorf(
+			"'%s' expected type '%s', got '%s'",
+			name, val.Type(), dataValType)
+	}
+
+	val.Set(dataVal)
+	return nil
+}
+
+func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) error {
+	dataVal := reflect.ValueOf(data)
+	dataKind := getKind(dataVal)
+
+	converted := true
+	switch {
+	case dataKind == reflect.String:
+		val.SetString(dataVal.String())
+	case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
+		if dataVal.Bool() {
+			val.SetString("1")
+		} else {
+			val.SetString("0")
+		}
+	case dataKind == reflect.Int && d.config.WeaklyTypedInput:
+		val.SetString(strconv.FormatInt(dataVal.Int(), 10))
+	case dataKind == reflect.Uint && d.config.WeaklyTypedInput:
+		val.SetString(strconv.FormatUint(dataVal.Uint(), 10))
+	case dataKind == reflect.Float32 && d.config.WeaklyTypedInput:
+		val.SetString(strconv.FormatFloat(dataVal.Float(), 'f', -1, 64))
+	case dataKind == reflect.Slice && d.config.WeaklyTypedInput:
+		dataType := dataVal.Type()
+		elemKind := dataType.Elem().Kind()
+		switch {
+		case elemKind == reflect.Uint8:
+			val.SetString(string(dataVal.Interface().([]uint8)))
+		default:
+			converted = false
+		}
+	default:
+		converted = false
+	}
+
+	if !converted {
+		return fmt.Errorf(
+			"'%s' expected type '%s', got unconvertible type '%s'",
+			name, val.Type(), dataVal.Type())
+	}
+
+	return nil
+}
+
+func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) error {
+	dataVal := reflect.ValueOf(data)
+	dataKind := getKind(dataVal)
+
+	switch {
+	case dataKind == reflect.Int:
+		val.SetInt(dataVal.Int())
+	case dataKind == reflect.Uint:
+		val.SetInt(int64(dataVal.Uint()))
+	case dataKind == reflect.Float32:
+		val.SetInt(int64(dataVal.Float()))
+	case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
+		if dataVal.Bool() {
+			val.SetInt(1)
+		} else {
+			val.SetInt(0)
+		}
+	case dataKind == reflect.String && d.config.WeaklyTypedInput:
+		i, err := strconv.ParseInt(dataVal.String(), 0, val.Type().Bits())
+		if err == nil {
+			val.SetInt(i)
+		} else {
+			return fmt.Errorf("cannot parse '%s' as int: %s", name, err)
+		}
+	default:
+		return fmt.Errorf(
+			"'%s' expected type '%s', got unconvertible type '%s'",
+			name, val.Type(), dataVal.Type())
+	}
+
+	return nil
+}
+
+func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) error {
+	dataVal := reflect.ValueOf(data)
+	dataKind := getKind(dataVal)
+
+	switch {
+	case dataKind == reflect.Int:
+		i := dataVal.Int()
+		if i < 0 && !d.config.WeaklyTypedInput {
+			return fmt.Errorf("cannot parse '%s', %d overflows uint",
+				name, i)
+		}
+		val.SetUint(uint64(i))
+	case dataKind == reflect.Uint:
+		val.SetUint(dataVal.Uint())
+	case dataKind == reflect.Float32:
+		f := dataVal.Float()
+		if f < 0 && !d.config.WeaklyTypedInput {
+			return fmt.Errorf("cannot parse '%s', %f overflows uint",
+				name, f)
+		}
+		val.SetUint(uint64(f))
+	case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
+		if dataVal.Bool() {
+			val.SetUint(1)
+		} else {
+			val.SetUint(0)
+		}
+	case dataKind == reflect.String && d.config.WeaklyTypedInput:
+		i, err := strconv.ParseUint(dataVal.String(), 0, val.Type().Bits())
+		if err == nil {
+			val.SetUint(i)
+		} else {
+			return fmt.Errorf("cannot parse '%s' as uint: %s", name, err)
+		}
+	default:
+		return fmt.Errorf(
+			"'%s' expected type '%s', got unconvertible type '%s'",
+			name, val.Type(), dataVal.Type())
+	}
+
+	return nil
+}
+
+func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) error {
+	dataVal := reflect.ValueOf(data)
+	dataKind := getKind(dataVal)
+
+	switch {
+	case dataKind == reflect.Bool:
+		val.SetBool(dataVal.Bool())
+	case dataKind == reflect.Int && d.config.WeaklyTypedInput:
+		val.SetBool(dataVal.Int() != 0)
+	case dataKind == reflect.Uint && d.config.WeaklyTypedInput:
+		val.SetBool(dataVal.Uint() != 0)
+	case dataKind == reflect.Float32 && d.config.WeaklyTypedInput:
+		val.SetBool(dataVal.Float() != 0)
+	case dataKind == reflect.String && d.config.WeaklyTypedInput:
+		b, err := strconv.ParseBool(dataVal.String())
+		if err == nil {
+			val.SetBool(b)
+		} else if dataVal.String() == "" {
+			val.SetBool(false)
+		} else {
+			return fmt.Errorf("cannot parse '%s' as bool: %s", name, err)
+		}
+	default:
+		return fmt.Errorf(
+			"'%s' expected type '%s', got unconvertible type '%s'",
+			name, val.Type(), dataVal.Type())
+	}
+
+	return nil
+}
+
+func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) error {
+	dataVal := reflect.ValueOf(data)
+	dataKind := getKind(dataVal)
+
+	switch {
+	case dataKind == reflect.Int:
+		val.SetFloat(float64(dataVal.Int()))
+	case dataKind == reflect.Uint:
+		val.SetFloat(float64(dataVal.Uint()))
+	case dataKind == reflect.Float32:
+		val.SetFloat(float64(dataVal.Float()))
+	case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
+		if dataVal.Bool() {
+			val.SetFloat(1)
+		} else {
+			val.SetFloat(0)
+		}
+	case dataKind == reflect.String && d.config.WeaklyTypedInput:
+		f, err := strconv.ParseFloat(dataVal.String(), val.Type().Bits())
+		if err == nil {
+			val.SetFloat(f)
+		} else {
+			return fmt.Errorf("cannot parse '%s' as float: %s", name, err)
+		}
+	default:
+		return fmt.Errorf(
+			"'%s' expected type '%s', got unconvertible type '%s'",
+			name, val.Type(), dataVal.Type())
+	}
+
+	return nil
+}
+
+func (d *Decoder) decodeMap(name string, data interface{}, val reflect.Value) error {
+	valType := val.Type()
+	valKeyType := valType.Key()
+	valElemType := valType.Elem()
+
+	// By default we overwrite keys in the current map
+	valMap := val
+
+	// If the map is nil or we're purposely zeroing fields, make a new map
+	if valMap.IsNil() || d.config.ZeroFields {
+		// Make a new map to hold our result
+		mapType := reflect.MapOf(valKeyType, valElemType)
+		valMap = reflect.MakeMap(mapType)
+	}
+
+	// Check input type
+	dataVal := reflect.Indirect(reflect.ValueOf(data))
+	if dataVal.Kind() != reflect.Map {
+		// Accept empty array/slice instead of an empty map in weakly typed mode
+		if d.config.WeaklyTypedInput &&
+			(dataVal.Kind() == reflect.Slice || dataVal.Kind() == reflect.Array) &&
+			dataVal.Len() == 0 {
+			val.Set(valMap)
+			return nil
+		} else {
+			return fmt.Errorf("'%s' expected a map, got '%s'", name, dataVal.Kind())
+		}
+	}
+
+	// Accumulate errors
+	errors := make([]string, 0)
+
+	for _, k := range dataVal.MapKeys() {
+		fieldName := fmt.Sprintf("%s[%s]", name, k)
+
+		// First decode the key into the proper type
+		currentKey := reflect.Indirect(reflect.New(valKeyType))
+		if err := d.decode(fieldName, k.Interface(), currentKey); err != nil {
+			errors = appendErrors(errors, err)
+			continue
+		}
+
+		// Next decode the data into the proper type
+		v := dataVal.MapIndex(k).Interface()
+		currentVal := reflect.Indirect(reflect.New(valElemType))
+		if err := d.decode(fieldName, v, currentVal); err != nil {
+			errors = appendErrors(errors, err)
+			continue
+		}
+
+		valMap.SetMapIndex(currentKey, currentVal)
+	}
+
+	// Set the built up map to the value
+	val.Set(valMap)
+
+	// If we had errors, return those
+	if len(errors) > 0 {
+		return &Error{errors}
+	}
+
+	return nil
+}
+
+func (d *Decoder) decodePtr(name string, data interface{}, val reflect.Value) error {
+	// Create an element of the concrete (non pointer) type and decode
+	// into that. Then set the value of the pointer to this type.
+	valType := val.Type()
+	valElemType := valType.Elem()
+	realVal := reflect.New(valElemType)
+	if err := d.decode(name, data, reflect.Indirect(realVal)); err != nil {
+		return err
+	}
+
+	val.Set(realVal)
+	return nil
+}
+
+func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) error {
+	dataVal := reflect.Indirect(reflect.ValueOf(data))
+	dataValKind := dataVal.Kind()
+	valType := val.Type()
+	valElemType := valType.Elem()
+	sliceType := reflect.SliceOf(valElemType)
+
+	// Check input type
+	if dataValKind != reflect.Array && dataValKind != reflect.Slice {
+		// Accept empty map instead of array/slice in weakly typed mode
+		if d.config.WeaklyTypedInput && dataVal.Kind() == reflect.Map && dataVal.Len() == 0 {
+			val.Set(reflect.MakeSlice(sliceType, 0, 0))
+			return nil
+		} else {
+			return fmt.Errorf(
+				"'%s': source data must be an array or slice, got %s", name, dataValKind)
+		}
+	}
+
+	// Make a new slice to hold our result, same size as the original data.
+	valSlice := reflect.MakeSlice(sliceType, dataVal.Len(), dataVal.Len())
+
+	// Accumulate any errors
+	errors := make([]string, 0)
+
+	for i := 0; i < dataVal.Len(); i++ {
+		currentData := dataVal.Index(i).Interface()
+		currentField := valSlice.Index(i)
+
+		fieldName := fmt.Sprintf("%s[%d]", name, i)
+		if err := d.decode(fieldName, currentData, currentField); err != nil {
+			errors = appendErrors(errors, err)
+		}
+	}
+
+	// Finally, set the value to the slice we built up
+	val.Set(valSlice)
+
+	// If there were errors, we return those
+	if len(errors) > 0 {
+		return &Error{errors}
+	}
+
+	return nil
+}
+
+func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) error {
+	dataVal := reflect.Indirect(reflect.ValueOf(data))
+
+	// If the type of the value to write to and the data match directly,
+	// then we just set it directly instead of recursing into the structure.
+	if dataVal.Type() == val.Type() {
+		val.Set(dataVal)
+		return nil
+	}
+
+	dataValKind := dataVal.Kind()
+	if dataValKind != reflect.Map {
+		return fmt.Errorf("'%s' expected a map, got '%s'", name, dataValKind)
+	}
+
+	dataValType := dataVal.Type()
+	if kind := dataValType.Key().Kind(); kind != reflect.String && kind != reflect.Interface {
+		return fmt.Errorf(
+			"'%s' needs a map with string keys, has '%s' keys",
+			name, dataValType.Key().Kind())
+	}
+
+	dataValKeys := make(map[reflect.Value]struct{})
+	dataValKeysUnused := make(map[interface{}]struct{})
+	for _, dataValKey := range dataVal.MapKeys() {
+		dataValKeys[dataValKey] = struct{}{}
+		dataValKeysUnused[dataValKey.Interface()] = struct{}{}
+	}
+
+	errors := make([]string, 0)
+
+	// This slice will keep track of all the structs we'll be decoding.
+	// There can be more than one struct if there are embedded structs
+	// that are squashed.
+	structs := make([]reflect.Value, 1, 5)
+	structs[0] = val
+
+	// Compile the list of all the fields that we're going to be decoding
+	// from all the structs.
+	fields := make(map[*reflect.StructField]reflect.Value)
+	for len(structs) > 0 {
+		structVal := structs[0]
+		structs = structs[1:]
+
+		structType := structVal.Type()
+		for i := 0; i < structType.NumField(); i++ {
+			fieldType := structType.Field(i)
+
+			if fieldType.Anonymous {
+				fieldKind := fieldType.Type.Kind()
+				if fieldKind != reflect.Struct {
+					errors = appendErrors(errors,
+						fmt.Errorf("%s: unsupported type: %s", fieldType.Name, fieldKind))
+					continue
+				}
+			}
+
+			// If "squash" is specified in the tag, we squash the field down.
+			squash := false
+			tagParts := strings.Split(fieldType.Tag.Get(d.config.TagName), ",")
+			for _, tag := range tagParts[1:] {
+				if tag == "squash" {
+					squash = true
+					break
+				}
+			}
+
+			if squash {
+				structs = append(structs, val.FieldByName(fieldType.Name))
+				continue
+			}
+
+			// Normal struct field, store it away
+			fields[&fieldType] = structVal.Field(i)
+		}
+	}
+
+	for fieldType, field := range fields {
+		fieldName := fieldType.Name
+
+		tagValue := fieldType.Tag.Get(d.config.TagName)
+		tagValue = strings.SplitN(tagValue, ",", 2)[0]
+		if tagValue != "" {
+			fieldName = tagValue
+		}
+
+		rawMapKey := reflect.ValueOf(fieldName)
+		rawMapVal := dataVal.MapIndex(rawMapKey)
+		if !rawMapVal.IsValid() {
+			// Do a slower search by iterating over each key and
+			// doing case-insensitive search.
+			for dataValKey, _ := range dataValKeys {
+				mK, ok := dataValKey.Interface().(string)
+				if !ok {
+					// Not a string key
+					continue
+				}
+
+				if strings.EqualFold(mK, fieldName) {
+					rawMapKey = dataValKey
+					rawMapVal = dataVal.MapIndex(dataValKey)
+					break
+				}
+			}
+
+			if !rawMapVal.IsValid() {
+				// There was no matching key in the map for the value in
+				// the struct. Just ignore.
+				continue
+			}
+		}
+
+		// Delete the key we're using from the unused map so we stop tracking
+		delete(dataValKeysUnused, rawMapKey.Interface())
+
+		if !field.IsValid() {
+			// This should never happen
+			panic("field is not valid")
+		}
+
+		// If we can't set the field, then it is unexported or something,
+		// and we just continue onwards.
+		if !field.CanSet() {
+			continue
+		}
+
+		// If the name is empty string, then we're at the root, and we
+		// don't dot-join the fields.
+		if name != "" {
+			fieldName = fmt.Sprintf("%s.%s", name, fieldName)
+		}
+
+		if err := d.decode(fieldName, rawMapVal.Interface(), field); err != nil {
+			errors = appendErrors(errors, err)
+		}
+	}
+
+	if d.config.ErrorUnused && len(dataValKeysUnused) > 0 {
+		keys := make([]string, 0, len(dataValKeysUnused))
+		for rawKey, _ := range dataValKeysUnused {
+			keys = append(keys, rawKey.(string))
+		}
+		sort.Strings(keys)
+
+		err := fmt.Errorf("'%s' has invalid keys: %s", name, strings.Join(keys, ", "))
+		errors = appendErrors(errors, err)
+	}
+
+	if len(errors) > 0 {
+		return &Error{errors}
+	}
+
+	// Add the unused keys to the list of unused keys if we're tracking metadata
+	if d.config.Metadata != nil {
+		for rawKey, _ := range dataValKeysUnused {
+			key := rawKey.(string)
+			if name != "" {
+				key = fmt.Sprintf("%s.%s", name, key)
+			}
+
+			d.config.Metadata.Unused = append(d.config.Metadata.Unused, key)
+		}
+	}
+
+	return nil
+}
+
+func getKind(val reflect.Value) reflect.Kind {
+	kind := val.Kind()
+
+	switch {
+	case kind >= reflect.Int && kind <= reflect.Int64:
+		return reflect.Int
+	case kind >= reflect.Uint && kind <= reflect.Uint64:
+		return reflect.Uint
+	case kind >= reflect.Float32 && kind <= reflect.Float64:
+		return reflect.Float32
+	default:
+		return kind
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go
new file mode 100644
index 0000000..b50ac36
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_benchmark_test.go
@@ -0,0 +1,243 @@
+package mapstructure
+
+import (
+	"testing"
+)
+
+func Benchmark_Decode(b *testing.B) {
+	type Person struct {
+		Name   string
+		Age    int
+		Emails []string
+		Extra  map[string]string
+	}
+
+	input := map[string]interface{}{
+		"name":   "Mitchell",
+		"age":    91,
+		"emails": []string{"one", "two", "three"},
+		"extra": map[string]string{
+			"twitter": "mitchellh",
+		},
+	}
+
+	var result Person
+	for i := 0; i < b.N; i++ {
+		Decode(input, &result)
+	}
+}
+
+func Benchmark_DecodeBasic(b *testing.B) {
+	input := map[string]interface{}{
+		"vstring": "foo",
+		"vint":    42,
+		"Vuint":   42,
+		"vbool":   true,
+		"Vfloat":  42.42,
+		"vsilent": true,
+		"vdata":   42,
+	}
+
+	var result Basic
+	for i := 0; i < b.N; i++ {
+		Decode(input, &result)
+	}
+}
+
+func Benchmark_DecodeEmbedded(b *testing.B) {
+	input := map[string]interface{}{
+		"vstring": "foo",
+		"Basic": map[string]interface{}{
+			"vstring": "innerfoo",
+		},
+		"vunique": "bar",
+	}
+
+	var result Embedded
+	for i := 0; i < b.N; i++ {
+		Decode(input, &result)
+	}
+}
+
+func Benchmark_DecodeTypeConversion(b *testing.B) {
+	input := map[string]interface{}{
+		"IntToFloat":    42,
+		"IntToUint":     42,
+		"IntToBool":     1,
+		"IntToString":   42,
+		"UintToInt":     42,
+		"UintToFloat":   42,
+		"UintToBool":    42,
+		"UintToString":  42,
+		"BoolToInt":     true,
+		"BoolToUint":    true,
+		"BoolToFloat":   true,
+		"BoolToString":  true,
+		"FloatToInt":    42.42,
+		"FloatToUint":   42.42,
+		"FloatToBool":   42.42,
+		"FloatToString": 42.42,
+		"StringToInt":   "42",
+		"StringToUint":  "42",
+		"StringToBool":  "1",
+		"StringToFloat": "42.42",
+		"SliceToMap":    []interface{}{},
+		"MapToSlice":    map[string]interface{}{},
+	}
+
+	var resultStrict TypeConversionResult
+	for i := 0; i < b.N; i++ {
+		Decode(input, &resultStrict)
+	}
+}
+
+func Benchmark_DecodeMap(b *testing.B) {
+	input := map[string]interface{}{
+		"vfoo": "foo",
+		"vother": map[interface{}]interface{}{
+			"foo": "foo",
+			"bar": "bar",
+		},
+	}
+
+	var result Map
+	for i := 0; i < b.N; i++ {
+		Decode(input, &result)
+	}
+}
+
+func Benchmark_DecodeMapOfStruct(b *testing.B) {
+	input := map[string]interface{}{
+		"value": map[string]interface{}{
+			"foo": map[string]string{"vstring": "one"},
+			"bar": map[string]string{"vstring": "two"},
+		},
+	}
+
+	var result MapOfStruct
+	for i := 0; i < b.N; i++ {
+		Decode(input, &result)
+	}
+}
+
+func Benchmark_DecodeSlice(b *testing.B) {
+	input := map[string]interface{}{
+		"vfoo": "foo",
+		"vbar": []string{"foo", "bar", "baz"},
+	}
+
+	var result Slice
+	for i := 0; i < b.N; i++ {
+		Decode(input, &result)
+	}
+}
+
+func Benchmark_DecodeSliceOfStruct(b *testing.B) {
+	input := map[string]interface{}{
+		"value": []map[string]interface{}{
+			{"vstring": "one"},
+			{"vstring": "two"},
+		},
+	}
+
+	var result SliceOfStruct
+	for i := 0; i < b.N; i++ {
+		Decode(input, &result)
+	}
+}
+
+func Benchmark_DecodeWeaklyTypedInput(b *testing.B) {
+	type Person struct {
+		Name   string
+		Age    int
+		Emails []string
+	}
+
+	// This input can come from anywhere, but typically comes from
+	// something like decoding JSON, generated by a weakly typed language
+	// such as PHP.
+	input := map[string]interface{}{
+		"name":   123,                      // number => string
+		"age":    "42",                     // string => number
+		"emails": map[string]interface{}{}, // empty map => empty array
+	}
+
+	var result Person
+	config := &DecoderConfig{
+		WeaklyTypedInput: true,
+		Result:           &result,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		panic(err)
+	}
+
+	for i := 0; i < b.N; i++ {
+		decoder.Decode(input)
+	}
+}
+
+func Benchmark_DecodeMetadata(b *testing.B) {
+	type Person struct {
+		Name string
+		Age  int
+	}
+
+	input := map[string]interface{}{
+		"name":  "Mitchell",
+		"age":   91,
+		"email": "foo@bar.com",
+	}
+
+	var md Metadata
+	var result Person
+	config := &DecoderConfig{
+		Metadata: &md,
+		Result:   &result,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		panic(err)
+	}
+
+	for i := 0; i < b.N; i++ {
+		decoder.Decode(input)
+	}
+}
+
+func Benchmark_DecodeMetadataEmbedded(b *testing.B) {
+	input := map[string]interface{}{
+		"vstring": "foo",
+		"vunique": "bar",
+	}
+
+	var md Metadata
+	var result EmbeddedSquash
+	config := &DecoderConfig{
+		Metadata: &md,
+		Result:   &result,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		b.Fatalf("err: %s", err)
+	}
+
+	for i := 0; i < b.N; i++ {
+		decoder.Decode(input)
+	}
+}
+
+func Benchmark_DecodeTagged(b *testing.B) {
+	input := map[string]interface{}{
+		"foo": "bar",
+		"bar": "value",
+	}
+
+	var result Tagged
+	for i := 0; i < b.N; i++ {
+		Decode(input, &result)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go
new file mode 100644
index 0000000..7054f1a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go
@@ -0,0 +1,47 @@
+package mapstructure
+
+import "testing"
+
+// GH-1
+func TestDecode_NilValue(t *testing.T) {
+	input := map[string]interface{}{
+		"vfoo":   nil,
+		"vother": nil,
+	}
+
+	var result Map
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("should not error: %s", err)
+	}
+
+	if result.Vfoo != "" {
+		t.Fatalf("value should be default: %s", result.Vfoo)
+	}
+
+	if result.Vother != nil {
+		t.Fatalf("Vother should be nil: %s", result.Vother)
+	}
+}
+
+// GH-10
+func TestDecode_mapInterfaceInterface(t *testing.T) {
+	input := map[interface{}]interface{}{
+		"vfoo":   nil,
+		"vother": nil,
+	}
+
+	var result Map
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("should not error: %s", err)
+	}
+
+	if result.Vfoo != "" {
+		t.Fatalf("value should be default: %s", result.Vfoo)
+	}
+
+	if result.Vother != nil {
+		t.Fatalf("Vother should be nil: %s", result.Vother)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_examples_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_examples_test.go b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_examples_test.go
new file mode 100644
index 0000000..f17c214
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_examples_test.go
@@ -0,0 +1,203 @@
+package mapstructure
+
+import (
+	"fmt"
+)
+
+func ExampleDecode() {
+	type Person struct {
+		Name   string
+		Age    int
+		Emails []string
+		Extra  map[string]string
+	}
+
+	// This input can come from anywhere, but typically comes from
+	// something like decoding JSON where we're not quite sure of the
+	// struct initially.
+	input := map[string]interface{}{
+		"name":   "Mitchell",
+		"age":    91,
+		"emails": []string{"one", "two", "three"},
+		"extra": map[string]string{
+			"twitter": "mitchellh",
+		},
+	}
+
+	var result Person
+	err := Decode(input, &result)
+	if err != nil {
+		panic(err)
+	}
+
+	fmt.Printf("%#v", result)
+	// Output:
+	// mapstructure.Person{Name:"Mitchell", Age:91, Emails:[]string{"one", "two", "three"}, Extra:map[string]string{"twitter":"mitchellh"}}
+}
+
+func ExampleDecode_errors() {
+	type Person struct {
+		Name   string
+		Age    int
+		Emails []string
+		Extra  map[string]string
+	}
+
+	// This input can come from anywhere, but typically comes from
+	// something like decoding JSON where we're not quite sure of the
+	// struct initially.
+	input := map[string]interface{}{
+		"name":   123,
+		"age":    "bad value",
+		"emails": []int{1, 2, 3},
+	}
+
+	var result Person
+	err := Decode(input, &result)
+	if err == nil {
+		panic("should have an error")
+	}
+
+	fmt.Println(err.Error())
+	// Output:
+	// 5 error(s) decoding:
+	//
+	// * 'Age' expected type 'int', got unconvertible type 'string'
+	// * 'Emails[0]' expected type 'string', got unconvertible type 'int'
+	// * 'Emails[1]' expected type 'string', got unconvertible type 'int'
+	// * 'Emails[2]' expected type 'string', got unconvertible type 'int'
+	// * 'Name' expected type 'string', got unconvertible type 'int'
+}
+
+func ExampleDecode_metadata() {
+	type Person struct {
+		Name string
+		Age  int
+	}
+
+	// This input can come from anywhere, but typically comes from
+	// something like decoding JSON where we're not quite sure of the
+	// struct initially.
+	input := map[string]interface{}{
+		"name":  "Mitchell",
+		"age":   91,
+		"email": "foo@bar.com",
+	}
+
+	// For metadata, we make a more advanced DecoderConfig so we can
+	// more finely configure the decoder that is used. In this case, we
+	// just tell the decoder we want to track metadata.
+	var md Metadata
+	var result Person
+	config := &DecoderConfig{
+		Metadata: &md,
+		Result:   &result,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		panic(err)
+	}
+
+	if err := decoder.Decode(input); err != nil {
+		panic(err)
+	}
+
+	fmt.Printf("Unused keys: %#v", md.Unused)
+	// Output:
+	// Unused keys: []string{"email"}
+}
+
+func ExampleDecode_weaklyTypedInput() {
+	type Person struct {
+		Name   string
+		Age    int
+		Emails []string
+	}
+
+	// This input can come from anywhere, but typically comes from
+	// something like decoding JSON, generated by a weakly typed language
+	// such as PHP.
+	input := map[string]interface{}{
+		"name":   123,                      // number => string
+		"age":    "42",                     // string => number
+		"emails": map[string]interface{}{}, // empty map => empty array
+	}
+
+	var result Person
+	config := &DecoderConfig{
+		WeaklyTypedInput: true,
+		Result:           &result,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		panic(err)
+	}
+
+	err = decoder.Decode(input)
+	if err != nil {
+		panic(err)
+	}
+
+	fmt.Printf("%#v", result)
+	// Output: mapstructure.Person{Name:"123", Age:42, Emails:[]string{}}
+}
+
+func ExampleDecode_tags() {
+	// Note that the mapstructure tags defined in the struct type
+	// can indicate which fields the values are mapped to.
+	type Person struct {
+		Name string `mapstructure:"person_name"`
+		Age  int    `mapstructure:"person_age"`
+	}
+
+	input := map[string]interface{}{
+		"person_name": "Mitchell",
+		"person_age":  91,
+	}
+
+	var result Person
+	err := Decode(input, &result)
+	if err != nil {
+		panic(err)
+	}
+
+	fmt.Printf("%#v", result)
+	// Output:
+	// mapstructure.Person{Name:"Mitchell", Age:91}
+}
+
+func ExampleDecode_embeddedStruct() {
+	// Squashing multiple embedded structs is allowed using the squash tag.
+	// This is demonstrated by creating a composite struct of multiple types
+	// and decoding into it. In this case, a person can carry with it both
+	// a Family and a Location, as well as their own FirstName.
+	type Family struct {
+		LastName string
+	}
+	type Location struct {
+		City string
+	}
+	type Person struct {
+		Family    `mapstructure:",squash"`
+		Location  `mapstructure:",squash"`
+		FirstName string
+	}
+
+	input := map[string]interface{}{
+		"FirstName": "Mitchell",
+		"LastName":  "Hashimoto",
+		"City":      "San Francisco",
+	}
+
+	var result Person
+	err := Decode(input, &result)
+	if err != nil {
+		panic(err)
+	}
+
+	fmt.Printf("%s %s, %s", result.FirstName, result.LastName, result.City)
+	// Output:
+	// Mitchell Hashimoto, San Francisco
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_test.go b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_test.go
new file mode 100644
index 0000000..8a27647
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mitchellh/mapstructure/mapstructure_test.go
@@ -0,0 +1,999 @@
+package mapstructure
+
+import (
+	"reflect"
+	"sort"
+	"testing"
+)
+
+type Basic struct {
+	Vstring string
+	Vint    int
+	Vuint   uint
+	Vbool   bool
+	Vfloat  float64
+	Vextra  string
+	vsilent bool
+	Vdata   interface{}
+}
+
+type BasicSquash struct {
+	Test Basic `mapstructure:",squash"`
+}
+
+type Embedded struct {
+	Basic
+	Vunique string
+}
+
+type EmbeddedPointer struct {
+	*Basic
+	Vunique string
+}
+
+type EmbeddedSquash struct {
+	Basic   `mapstructure:",squash"`
+	Vunique string
+}
+
+type Map struct {
+	Vfoo   string
+	Vother map[string]string
+}
+
+type MapOfStruct struct {
+	Value map[string]Basic
+}
+
+type Nested struct {
+	Vfoo string
+	Vbar Basic
+}
+
+type NestedPointer struct {
+	Vfoo string
+	Vbar *Basic
+}
+
+type Slice struct {
+	Vfoo string
+	Vbar []string
+}
+
+type SliceOfStruct struct {
+	Value []Basic
+}
+
+type Tagged struct {
+	Extra string `mapstructure:"bar,what,what"`
+	Value string `mapstructure:"foo"`
+}
+
+type TypeConversionResult struct {
+	IntToFloat         float32
+	IntToUint          uint
+	IntToBool          bool
+	IntToString        string
+	UintToInt          int
+	UintToFloat        float32
+	UintToBool         bool
+	UintToString       string
+	BoolToInt          int
+	BoolToUint         uint
+	BoolToFloat        float32
+	BoolToString       string
+	FloatToInt         int
+	FloatToUint        uint
+	FloatToBool        bool
+	FloatToString      string
+	SliceUint8ToString string
+	StringToInt        int
+	StringToUint       uint
+	StringToBool       bool
+	StringToFloat      float32
+	SliceToMap         map[string]interface{}
+	MapToSlice         []interface{}
+}
+
+func TestBasicTypes(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vstring": "foo",
+		"vint":    42,
+		"Vuint":   42,
+		"vbool":   true,
+		"Vfloat":  42.42,
+		"vsilent": true,
+		"vdata":   42,
+	}
+
+	var result Basic
+	err := Decode(input, &result)
+	if err != nil {
+		t.Errorf("got an err: %s", err.Error())
+		t.FailNow()
+	}
+
+	if result.Vstring != "foo" {
+		t.Errorf("vstring value should be 'foo': %#v", result.Vstring)
+	}
+
+	if result.Vint != 42 {
+		t.Errorf("vint value should be 42: %#v", result.Vint)
+	}
+
+	if result.Vuint != 42 {
+		t.Errorf("vuint value should be 42: %#v", result.Vuint)
+	}
+
+	if result.Vbool != true {
+		t.Errorf("vbool value should be true: %#v", result.Vbool)
+	}
+
+	if result.Vfloat != 42.42 {
+		t.Errorf("vfloat value should be 42.42: %#v", result.Vfloat)
+	}
+
+	if result.Vextra != "" {
+		t.Errorf("vextra value should be empty: %#v", result.Vextra)
+	}
+
+	if result.vsilent != false {
+		t.Error("vsilent should not be set, it is unexported")
+	}
+
+	if result.Vdata != 42 {
+		t.Error("vdata should be valid")
+	}
+}
+
+func TestBasic_IntWithFloat(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vint": float64(42),
+	}
+
+	var result Basic
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an err: %s", err)
+	}
+}
+
+func TestBasic_Merge(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vint": 42,
+	}
+
+	var result Basic
+	result.Vuint = 100
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an err: %s", err)
+	}
+
+	expected := Basic{
+		Vint:  42,
+		Vuint: 100,
+	}
+	if !reflect.DeepEqual(result, expected) {
+		t.Fatalf("bad: %#v", result)
+	}
+}
+
+func TestDecode_BasicSquash(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vstring": "foo",
+	}
+
+	var result BasicSquash
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an err: %s", err.Error())
+	}
+
+	if result.Test.Vstring != "foo" {
+		t.Errorf("vstring value should be 'foo': %#v", result.Test.Vstring)
+	}
+}
+
+func TestDecode_Embedded(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vstring": "foo",
+		"Basic": map[string]interface{}{
+			"vstring": "innerfoo",
+		},
+		"vunique": "bar",
+	}
+
+	var result Embedded
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an err: %s", err.Error())
+	}
+
+	if result.Vstring != "innerfoo" {
+		t.Errorf("vstring value should be 'innerfoo': %#v", result.Vstring)
+	}
+
+	if result.Vunique != "bar" {
+		t.Errorf("vunique value should be 'bar': %#v", result.Vunique)
+	}
+}
+
+func TestDecode_EmbeddedPointer(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vstring": "foo",
+		"Basic": map[string]interface{}{
+			"vstring": "innerfoo",
+		},
+		"vunique": "bar",
+	}
+
+	var result EmbeddedPointer
+	err := Decode(input, &result)
+	if err == nil {
+		t.Fatal("should get error")
+	}
+}
+
+func TestDecode_EmbeddedSquash(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vstring": "foo",
+		"vunique": "bar",
+	}
+
+	var result EmbeddedSquash
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an err: %s", err.Error())
+	}
+
+	if result.Vstring != "foo" {
+		t.Errorf("vstring value should be 'foo': %#v", result.Vstring)
+	}
+
+	if result.Vunique != "bar" {
+		t.Errorf("vunique value should be 'bar': %#v", result.Vunique)
+	}
+}
+
+func TestDecode_DecodeHook(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vint": "WHAT",
+	}
+
+	decodeHook := func(from reflect.Kind, to reflect.Kind, v interface{}) (interface{}, error) {
+		if from == reflect.String && to != reflect.String {
+			return 5, nil
+		}
+
+		return v, nil
+	}
+
+	var result Basic
+	config := &DecoderConfig{
+		DecodeHook: decodeHook,
+		Result:     &result,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		t.Fatalf("err: %s", err)
+	}
+
+	err = decoder.Decode(input)
+	if err != nil {
+		t.Fatalf("got an err: %s", err)
+	}
+
+	if result.Vint != 5 {
+		t.Errorf("vint should be 5: %#v", result.Vint)
+	}
+}
+
+func TestDecode_DecodeHookType(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vint": "WHAT",
+	}
+
+	decodeHook := func(from reflect.Type, to reflect.Type, v interface{}) (interface{}, error) {
+		if from.Kind() == reflect.String &&
+			to.Kind() != reflect.String {
+			return 5, nil
+		}
+
+		return v, nil
+	}
+
+	var result Basic
+	config := &DecoderConfig{
+		DecodeHook: decodeHook,
+		Result:     &result,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		t.Fatalf("err: %s", err)
+	}
+
+	err = decoder.Decode(input)
+	if err != nil {
+		t.Fatalf("got an err: %s", err)
+	}
+
+	if result.Vint != 5 {
+		t.Errorf("vint should be 5: %#v", result.Vint)
+	}
+}
+
+func TestDecode_Nil(t *testing.T) {
+	t.Parallel()
+
+	var input interface{} = nil
+	result := Basic{
+		Vstring: "foo",
+	}
+
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("err: %s", err)
+	}
+
+	if result.Vstring != "foo" {
+		t.Fatalf("bad: %#v", result.Vstring)
+	}
+}
+
+func TestDecode_NonStruct(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"foo": "bar",
+		"bar": "baz",
+	}
+
+	var result map[string]string
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("err: %s", err)
+	}
+
+	if result["foo"] != "bar" {
+		t.Fatal("foo is not bar")
+	}
+}
+
+func TestDecode_StructMatch(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vbar": Basic{
+			Vstring: "foo",
+		},
+	}
+
+	var result Nested
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an err: %s", err.Error())
+	}
+
+	if result.Vbar.Vstring != "foo" {
+		t.Errorf("bad: %#v", result)
+	}
+}
+
+func TestDecode_TypeConversion(t *testing.T) {
+	input := map[string]interface{}{
+		"IntToFloat":         42,
+		"IntToUint":          42,
+		"IntToBool":          1,
+		"IntToString":        42,
+		"UintToInt":          42,
+		"UintToFloat":        42,
+		"UintToBool":         42,
+		"UintToString":       42,
+		"BoolToInt":          true,
+		"BoolToUint":         true,
+		"BoolToFloat":        true,
+		"BoolToString":       true,
+		"FloatToInt":         42.42,
+		"FloatToUint":        42.42,
+		"FloatToBool":        42.42,
+		"FloatToString":      42.42,
+		"SliceUint8ToString": []uint8("foo"),
+		"StringToInt":        "42",
+		"StringToUint":       "42",
+		"StringToBool":       "1",
+		"StringToFloat":      "42.42",
+		"SliceToMap":         []interface{}{},
+		"MapToSlice":         map[string]interface{}{},
+	}
+
+	expectedResultStrict := TypeConversionResult{
+		IntToFloat:  42.0,
+		IntToUint:   42,
+		UintToInt:   42,
+		UintToFloat: 42,
+		BoolToInt:   0,
+		BoolToUint:  0,
+		BoolToFloat: 0,
+		FloatToInt:  42,
+		FloatToUint: 42,
+	}
+
+	expectedResultWeak := TypeConversionResult{
+		IntToFloat:         42.0,
+		IntToUint:          42,
+		IntToBool:          true,
+		IntToString:        "42",
+		UintToInt:          42,
+		UintToFloat:        42,
+		UintToBool:         true,
+		UintToString:       "42",
+		BoolToInt:          1,
+		BoolToUint:         1,
+		BoolToFloat:        1,
+		BoolToString:       "1",
+		FloatToInt:         42,
+		FloatToUint:        42,
+		FloatToBool:        true,
+		FloatToString:      "42.42",
+		SliceUint8ToString: "foo",
+		StringToInt:        42,
+		StringToUint:       42,
+		StringToBool:       true,
+		StringToFloat:      42.42,
+		SliceToMap:         map[string]interface{}{},
+		MapToSlice:         []interface{}{},
+	}
+
+	// Test strict type conversion
+	var resultStrict TypeConversionResult
+	err := Decode(input, &resultStrict)
+	if err == nil {
+		t.Errorf("should return an error")
+	}
+	if !reflect.DeepEqual(resultStrict, expectedResultStrict) {
+		t.Errorf("expected %v, got: %v", expectedResultStrict, resultStrict)
+	}
+
+	// Test weak type conversion
+	var decoder *Decoder
+	var resultWeak TypeConversionResult
+
+	config := &DecoderConfig{
+		WeaklyTypedInput: true,
+		Result:           &resultWeak,
+	}
+
+	decoder, err = NewDecoder(config)
+	if err != nil {
+		t.Fatalf("err: %s", err)
+	}
+
+	err = decoder.Decode(input)
+	if err != nil {
+		t.Fatalf("got an err: %s", err)
+	}
+
+	if !reflect.DeepEqual(resultWeak, expectedResultWeak) {
+		t.Errorf("expected \n%#v, got: \n%#v", expectedResultWeak, resultWeak)
+	}
+}
+
+func TestDecoder_ErrorUnused(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vstring": "hello",
+		"foo":     "bar",
+	}
+
+	var result Basic
+	config := &DecoderConfig{
+		ErrorUnused: true,
+		Result:      &result,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		t.Fatalf("err: %s", err)
+	}
+
+	err = decoder.Decode(input)
+	if err == nil {
+		t.Fatal("expected error")
+	}
+}
+
+func TestMap(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vfoo": "foo",
+		"vother": map[interface{}]interface{}{
+			"foo": "foo",
+			"bar": "bar",
+		},
+	}
+
+	var result Map
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an error: %s", err)
+	}
+
+	if result.Vfoo != "foo" {
+		t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo)
+	}
+
+	if result.Vother == nil {
+		t.Fatal("vother should not be nil")
+	}
+
+	if len(result.Vother) != 2 {
+		t.Error("vother should have two items")
+	}
+
+	if result.Vother["foo"] != "foo" {
+		t.Errorf("'foo' key should be foo, got: %#v", result.Vother["foo"])
+	}
+
+	if result.Vother["bar"] != "bar" {
+		t.Errorf("'bar' key should be bar, got: %#v", result.Vother["bar"])
+	}
+}
+
+func TestMapMerge(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vfoo": "foo",
+		"vother": map[interface{}]interface{}{
+			"foo": "foo",
+			"bar": "bar",
+		},
+	}
+
+	var result Map
+	result.Vother = map[string]string{"hello": "world"}
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an error: %s", err)
+	}
+
+	if result.Vfoo != "foo" {
+		t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo)
+	}
+
+	expected := map[string]string{
+		"foo":   "foo",
+		"bar":   "bar",
+		"hello": "world",
+	}
+	if !reflect.DeepEqual(result.Vother, expected) {
+		t.Errorf("bad: %#v", result.Vother)
+	}
+}
+
+func TestMapOfStruct(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"value": map[string]interface{}{
+			"foo": map[string]string{"vstring": "one"},
+			"bar": map[string]string{"vstring": "two"},
+		},
+	}
+
+	var result MapOfStruct
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an err: %s", err)
+	}
+
+	if result.Value == nil {
+		t.Fatal("value should not be nil")
+	}
+
+	if len(result.Value) != 2 {
+		t.Error("value should have two items")
+	}
+
+	if result.Value["foo"].Vstring != "one" {
+		t.Errorf("foo value should be 'one', got: %s", result.Value["foo"].Vstring)
+	}
+
+	if result.Value["bar"].Vstring != "two" {
+		t.Errorf("bar value should be 'two', got: %s", result.Value["bar"].Vstring)
+	}
+}
+
+func TestNestedType(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vfoo": "foo",
+		"vbar": map[string]interface{}{
+			"vstring": "foo",
+			"vint":    42,
+			"vbool":   true,
+		},
+	}
+
+	var result Nested
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an err: %s", err.Error())
+	}
+
+	if result.Vfoo != "foo" {
+		t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo)
+	}
+
+	if result.Vbar.Vstring != "foo" {
+		t.Errorf("vstring value should be 'foo': %#v", result.Vbar.Vstring)
+	}
+
+	if result.Vbar.Vint != 42 {
+		t.Errorf("vint value should be 42: %#v", result.Vbar.Vint)
+	}
+
+	if result.Vbar.Vbool != true {
+		t.Errorf("vbool value should be true: %#v", result.Vbar.Vbool)
+	}
+
+	if result.Vbar.Vextra != "" {
+		t.Errorf("vextra value should be empty: %#v", result.Vbar.Vextra)
+	}
+}
+
+func TestNestedTypePointer(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vfoo": "foo",
+		"vbar": &map[string]interface{}{
+			"vstring": "foo",
+			"vint":    42,
+			"vbool":   true,
+		},
+	}
+
+	var result NestedPointer
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got an err: %s", err.Error())
+	}
+
+	if result.Vfoo != "foo" {
+		t.Errorf("vfoo value should be 'foo': %#v", result.Vfoo)
+	}
+
+	if result.Vbar.Vstring != "foo" {
+		t.Errorf("vstring value should be 'foo': %#v", result.Vbar.Vstring)
+	}
+
+	if result.Vbar.Vint != 42 {
+		t.Errorf("vint value should be 42: %#v", result.Vbar.Vint)
+	}
+
+	if result.Vbar.Vbool != true {
+		t.Errorf("vbool value should be true: %#v", result.Vbar.Vbool)
+	}
+
+	if result.Vbar.Vextra != "" {
+		t.Errorf("vextra value should be empty: %#v", result.Vbar.Vextra)
+	}
+}
+
+func TestSlice(t *testing.T) {
+	t.Parallel()
+
+	inputStringSlice := map[string]interface{}{
+		"vfoo": "foo",
+		"vbar": []string{"foo", "bar", "baz"},
+	}
+
+	inputStringSlicePointer := map[string]interface{}{
+		"vfoo": "foo",
+		"vbar": &[]string{"foo", "bar", "baz"},
+	}
+
+	outputStringSlice := &Slice{
+		"foo",
+		[]string{"foo", "bar", "baz"},
+	}
+
+	testSliceInput(t, inputStringSlice, outputStringSlice)
+	testSliceInput(t, inputStringSlicePointer, outputStringSlice)
+}
+
+func TestInvalidSlice(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vfoo": "foo",
+		"vbar": 42,
+	}
+
+	result := Slice{}
+	err := Decode(input, &result)
+	if err == nil {
+		t.Errorf("expected failure")
+	}
+}
+
+func TestSliceOfStruct(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"value": []map[string]interface{}{
+			{"vstring": "one"},
+			{"vstring": "two"},
+		},
+	}
+
+	var result SliceOfStruct
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got unexpected error: %s", err)
+	}
+
+	if len(result.Value) != 2 {
+		t.Fatalf("expected two values, got %d", len(result.Value))
+	}
+
+	if result.Value[0].Vstring != "one" {
+		t.Errorf("first value should be 'one', got: %s", result.Value[0].Vstring)
+	}
+
+	if result.Value[1].Vstring != "two" {
+		t.Errorf("second value should be 'two', got: %s", result.Value[1].Vstring)
+	}
+}
+
+func TestInvalidType(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vstring": 42,
+	}
+
+	var result Basic
+	err := Decode(input, &result)
+	if err == nil {
+		t.Fatal("error should exist")
+	}
+
+	derr, ok := err.(*Error)
+	if !ok {
+		t.Fatalf("error should be kind of Error, instead: %#v", err)
+	}
+
+	if derr.Errors[0] != "'Vstring' expected type 'string', got unconvertible type 'int'" {
+		t.Errorf("got unexpected error: %s", err)
+	}
+
+	inputNegIntUint := map[string]interface{}{
+		"vuint": -42,
+	}
+
+	err = Decode(inputNegIntUint, &result)
+	if err == nil {
+		t.Fatal("error should exist")
+	}
+
+	derr, ok = err.(*Error)
+	if !ok {
+		t.Fatalf("error should be kind of Error, instead: %#v", err)
+	}
+
+	if derr.Errors[0] != "cannot parse 'Vuint', -42 overflows uint" {
+		t.Errorf("got unexpected error: %s", err)
+	}
+
+	inputNegFloatUint := map[string]interface{}{
+		"vuint": -42.0,
+	}
+
+	err = Decode(inputNegFloatUint, &result)
+	if err == nil {
+		t.Fatal("error should exist")
+	}
+
+	derr, ok = err.(*Error)
+	if !ok {
+		t.Fatalf("error should be kind of Error, instead: %#v", err)
+	}
+
+	if derr.Errors[0] != "cannot parse 'Vuint', -42.000000 overflows uint" {
+		t.Errorf("got unexpected error: %s", err)
+	}
+}
+
+func TestMetadata(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vfoo": "foo",
+		"vbar": map[string]interface{}{
+			"vstring": "foo",
+			"Vuint":   42,
+			"foo":     "bar",
+		},
+		"bar": "nil",
+	}
+
+	var md Metadata
+	var result Nested
+	config := &DecoderConfig{
+		Metadata: &md,
+		Result:   &result,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		t.Fatalf("err: %s", err)
+	}
+
+	err = decoder.Decode(input)
+	if err != nil {
+		t.Fatalf("err: %s", err.Error())
+	}
+
+	expectedKeys := []string{"Vbar", "Vbar.Vstring", "Vbar.Vuint", "Vfoo"}
+	sort.Strings(md.Keys)
+	if !reflect.DeepEqual(md.Keys, expectedKeys) {
+		t.Fatalf("bad keys: %#v", md.Keys)
+	}
+
+	expectedUnused := []string{"Vbar.foo", "bar"}
+	if !reflect.DeepEqual(md.Unused, expectedUnused) {
+		t.Fatalf("bad unused: %#v", md.Unused)
+	}
+}
+
+func TestMetadata_Embedded(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"vstring": "foo",
+		"vunique": "bar",
+	}
+
+	var md Metadata
+	var result EmbeddedSquash
+	config := &DecoderConfig{
+		Metadata: &md,
+		Result:   &result,
+	}
+
+	decoder, err := NewDecoder(config)
+	if err != nil {
+		t.Fatalf("err: %s", err)
+	}
+
+	err = decoder.Decode(input)
+	if err != nil {
+		t.Fatalf("err: %s", err.Error())
+	}
+
+	expectedKeys := []string{"Vstring", "Vunique"}
+
+	sort.Strings(md.Keys)
+	if !reflect.DeepEqual(md.Keys, expectedKeys) {
+		t.Fatalf("bad keys: %#v", md.Keys)
+	}
+
+	expectedUnused := []string{}
+	if !reflect.DeepEqual(md.Unused, expectedUnused) {
+		t.Fatalf("bad unused: %#v", md.Unused)
+	}
+}
+
+func TestNonPtrValue(t *testing.T) {
+	t.Parallel()
+
+	err := Decode(map[string]interface{}{}, Basic{})
+	if err == nil {
+		t.Fatal("error should exist")
+	}
+
+	if err.Error() != "result must be a pointer" {
+		t.Errorf("got unexpected error: %s", err)
+	}
+}
+
+func TestTagged(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"foo": "bar",
+		"bar": "value",
+	}
+
+	var result Tagged
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("unexpected error: %s", err)
+	}
+
+	if result.Value != "bar" {
+		t.Errorf("value should be 'bar', got: %#v", result.Value)
+	}
+
+	if result.Extra != "value" {
+		t.Errorf("extra should be 'value', got: %#v", result.Extra)
+	}
+}
+
+func TestWeakDecode(t *testing.T) {
+	t.Parallel()
+
+	input := map[string]interface{}{
+		"foo": "4",
+		"bar": "value",
+	}
+
+	var result struct {
+		Foo int
+		Bar string
+	}
+
+	if err := WeakDecode(input, &result); err != nil {
+		t.Fatalf("err: %s", err)
+	}
+	if result.Foo != 4 {
+		t.Fatalf("bad: %#v", result)
+	}
+	if result.Bar != "value" {
+		t.Fatalf("bad: %#v", result)
+	}
+}
+
+func testSliceInput(t *testing.T, input map[string]interface{}, expected *Slice) {
+	var result Slice
+	err := Decode(input, &result)
+	if err != nil {
+		t.Fatalf("got error: %s", err)
+	}
+
+	if result.Vfoo != expected.Vfoo {
+		t.Errorf("Vfoo expected '%s', got '%s'", expected.Vfoo, result.Vfoo)
+	}
+
+	if result.Vbar == nil {
+		t.Fatalf("Vbar a slice, got '%#v'", result.Vbar)
+	}
+
+	if len(result.Vbar) != len(expected.Vbar) {
+		t.Errorf("Vbar length should be %d, got %d", len(expected.Vbar), len(result.Vbar))
+	}
+
+	for i, v := range result.Vbar {
+		if v != expected.Vbar[i] {
+			t.Errorf(
+				"Vbar[%d] should be '%#v', got '%#v'",
+				i, expected.Vbar[i], v)
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cast/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cast/.gitignore b/newt/Godeps/_workspace/src/github.com/spf13/cast/.gitignore
new file mode 100644
index 0000000..8365624
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cast/.gitignore
@@ -0,0 +1,23 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe
+*.test

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cast/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cast/LICENSE b/newt/Godeps/_workspace/src/github.com/spf13/cast/LICENSE
new file mode 100644
index 0000000..4527efb
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cast/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Steve Francia
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cast/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cast/README.md b/newt/Godeps/_workspace/src/github.com/spf13/cast/README.md
new file mode 100644
index 0000000..af7a1fd
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cast/README.md
@@ -0,0 +1,72 @@
+cast
+====
+
+Easy and safe casting from one type to another in Go
+
+Don’t Panic! ... Cast
+
+## What is Cast?
+
+Cast is a library to convert between different go types in a consistent and easy way.
+
+Cast provides simple functions to easily convert a number to a string, an
+interface into a bool, etc. Cast does this intelligently when an obvious
+conversion is possible. It doesn’t make any attempts to guess what you meant,
+for example you can only convert a string to an int when it is a string
+representation of an int such as “8”. Cast was developed for use in
+[Hugo](http://hugo.spf13.com), a website engine which uses YAML, TOML or JSON
+for meta data.
+
+## Why use Cast?
+
+When working with dynamic data in Go you often need to cast or convert the data
+from one type into another. Cast goes beyond just using type assertion (though
+it uses that when possible) to provide a very straightforward and convenient
+library.
+
+If you are working with interfaces to handle things like dynamic content
+you’ll need an easy way to convert an interface into a given type. This
+is the library for you.
+
+If you are taking in data from YAML, TOML or JSON or other formats which lack
+full types, then Cast is the library for you.
+
+## Usage
+
+Cast provides a handful of To_____ methods. These methods will always return
+the desired type. **If input is provided that will not convert to that type, the
+0 or nil value for that type will be returned**.
+
+Cast also provides identical methods To_____E. These return the same result as
+the To_____ methods, plus an additional error which tells you if it successfully
+converted. Using these methods you can tell the difference between when the
+input matched the zero value or when the conversion failed and the zero value
+was returned.
+
+The following examples are merely a sample of what is available. Please review
+the code for a complete set.
+
+### Example ‘ToString’:
+
+    cast.ToString("mayonegg")         // "mayonegg"
+    cast.ToString(8)                  // "8"
+    cast.ToString(8.31)               // "8.31"
+    cast.ToString([]byte("one time")) // "one time"
+    cast.ToString(nil)                // ""
+
+	var foo interface{} = "one more time"
+    cast.ToString(foo)                // "one more time"
+
+
+### Example ‘ToInt’:
+
+    cast.ToInt(8)                  // 8
+    cast.ToInt(8.31)               // 8
+    cast.ToInt("8")                // 8
+    cast.ToInt(true)               // 1
+    cast.ToInt(false)              // 0
+
+	var eight interface{} = 8
+    cast.ToInt(eight)              // 8
+    cast.ToInt(nil)                // 0
+

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cast/cast.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cast/cast.go b/newt/Godeps/_workspace/src/github.com/spf13/cast/cast.go
new file mode 100644
index 0000000..1dde519
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cast/cast.go
@@ -0,0 +1,68 @@
+// Copyright © 2014 Steve Francia <sp...@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package cast
+
+import "time"
+
+func ToBool(i interface{}) bool {
+	v, _ := ToBoolE(i)
+	return v
+}
+
+func ToTime(i interface{}) time.Time {
+	v, _ := ToTimeE(i)
+	return v
+}
+
+func ToDuration(i interface{}) time.Duration {
+	v, _ := ToDurationE(i)
+	return v
+}
+
+func ToFloat64(i interface{}) float64 {
+	v, _ := ToFloat64E(i)
+	return v
+}
+
+func ToInt(i interface{}) int {
+	v, _ := ToIntE(i)
+	return v
+}
+
+func ToString(i interface{}) string {
+	v, _ := ToStringE(i)
+	return v
+}
+
+func ToStringMapString(i interface{}) map[string]string {
+	v, _ := ToStringMapStringE(i)
+	return v
+}
+
+func ToStringMapBool(i interface{}) map[string]bool {
+	v, _ := ToStringMapBoolE(i)
+	return v
+}
+
+func ToStringMap(i interface{}) map[string]interface{} {
+	v, _ := ToStringMapE(i)
+	return v
+}
+
+func ToSlice(i interface{}) []interface{} {
+	v, _ := ToSliceE(i)
+	return v
+}
+
+func ToStringSlice(i interface{}) []string {
+	v, _ := ToStringSliceE(i)
+	return v
+}
+
+func ToIntSlice(i interface{}) []int {
+	v, _ := ToIntSliceE(i)
+	return v
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cast/cast_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cast/cast_test.go b/newt/Godeps/_workspace/src/github.com/spf13/cast/cast_test.go
new file mode 100644
index 0000000..3fa717f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cast/cast_test.go
@@ -0,0 +1,117 @@
+// Copyright © 2014 Steve Francia <sp...@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package cast
+
+import (
+	"testing"
+
+	"html/template"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestToInt(t *testing.T) {
+	var eight interface{} = 8
+	assert.Equal(t, ToInt(8), 8)
+	assert.Equal(t, ToInt(8.31), 8)
+	assert.Equal(t, ToInt("8"), 8)
+	assert.Equal(t, ToInt(true), 1)
+	assert.Equal(t, ToInt(false), 0)
+	assert.Equal(t, ToInt(eight), 8)
+}
+
+func TestToFloat64(t *testing.T) {
+	var eight interface{} = 8
+	assert.Equal(t, ToFloat64(8), 8.00)
+	assert.Equal(t, ToFloat64(8.31), 8.31)
+	assert.Equal(t, ToFloat64("8.31"), 8.31)
+	assert.Equal(t, ToFloat64(eight), 8.0)
+}
+
+func TestToString(t *testing.T) {
+	var foo interface{} = "one more time"
+	assert.Equal(t, ToString(8), "8")
+	assert.Equal(t, ToString(8.12), "8.12")
+	assert.Equal(t, ToString([]byte("one time")), "one time")
+	assert.Equal(t, ToString(template.HTML("one time")), "one time")
+	assert.Equal(t, ToString(foo), "one more time")
+	assert.Equal(t, ToString(nil), "")
+}
+
+type foo struct {
+	val string
+}
+
+func (x foo) String() string {
+	return x.val
+}
+
+func TestStringerToString(t *testing.T) {
+
+	var x foo
+	x.val = "bar"
+	assert.Equal(t, "bar", ToString(x))
+}
+
+type fu struct {
+	val string
+}
+
+func (x fu) Error() string {
+	return x.val
+}
+
+func TestErrorToString(t *testing.T) {
+	var x fu
+	x.val = "bar"
+	assert.Equal(t, "bar", ToString(x))
+}
+
+func TestMaps(t *testing.T) {
+	var taxonomies = map[interface{}]interface{}{"tag": "tags", "group": "groups"}
+	var stringMapBool = map[interface{}]interface{}{"v1": true, "v2": false}
+	assert.Equal(t, ToStringMap(taxonomies), map[string]interface{}{"tag": "tags", "group": "groups"})
+	assert.Equal(t, ToStringMapBool(stringMapBool), map[string]bool{"v1": true, "v2": false})
+}
+
+func TestSlices(t *testing.T) {
+	assert.Equal(t, []string{"a", "b"}, ToStringSlice([]string{"a", "b"}))
+	assert.Equal(t, []string{"1", "3"}, ToStringSlice([]interface{}{1, 3}))
+	assert.Equal(t, []int{1, 3}, ToIntSlice([]int{1, 3}))
+	assert.Equal(t, []int{1, 3}, ToIntSlice([]interface{}{1.2, 3.2}))
+	assert.Equal(t, []int{2, 3}, ToIntSlice([]string{"2", "3"}))
+	assert.Equal(t, []int{2, 3}, ToIntSlice([2]string{"2", "3"}))
+}
+
+func TestToBool(t *testing.T) {
+	assert.Equal(t, ToBool(0), false)
+	assert.Equal(t, ToBool(nil), false)
+	assert.Equal(t, ToBool("false"), false)
+	assert.Equal(t, ToBool("FALSE"), false)
+	assert.Equal(t, ToBool("False"), false)
+	assert.Equal(t, ToBool("f"), false)
+	assert.Equal(t, ToBool("F"), false)
+	assert.Equal(t, ToBool(false), false)
+	assert.Equal(t, ToBool("foo"), false)
+
+	assert.Equal(t, ToBool("true"), true)
+	assert.Equal(t, ToBool("TRUE"), true)
+	assert.Equal(t, ToBool("True"), true)
+	assert.Equal(t, ToBool("t"), true)
+	assert.Equal(t, ToBool("T"), true)
+	assert.Equal(t, ToBool(1), true)
+	assert.Equal(t, ToBool(true), true)
+	assert.Equal(t, ToBool(-1), true)
+}
+
+func TestIndirectPointers(t *testing.T) {
+	x := 13
+	y := &x
+	z := &y
+
+	assert.Equal(t, ToInt(y), 13)
+	assert.Equal(t, ToInt(z), 13)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/cast/caste.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/cast/caste.go b/newt/Godeps/_workspace/src/github.com/spf13/cast/caste.go
new file mode 100644
index 0000000..58d72df
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/cast/caste.go
@@ -0,0 +1,378 @@
+// Copyright © 2014 Steve Francia <sp...@spf13.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package cast
+
+import (
+	"errors"
+	"fmt"
+	"html/template"
+	"reflect"
+	"strconv"
+	"strings"
+	"time"
+
+	jww "github.com/spf13/jwalterweatherman"
+)
+
+func ToTimeE(i interface{}) (tim time.Time, err error) {
+	i = indirect(i)
+	jww.DEBUG.Println("ToTimeE called on type:", reflect.TypeOf(i))
+
+	switch s := i.(type) {
+	case time.Time:
+		return s, nil
+	case string:
+		d, e := StringToDate(s)
+		if e == nil {
+			return d, nil
+		}
+		return time.Time{}, fmt.Errorf("Could not parse Date/Time format: %v\n", e)
+	default:
+		return time.Time{}, fmt.Errorf("Unable to Cast %#v to Time\n", i)
+	}
+}
+
+func ToDurationE(i interface{}) (d time.Duration, err error) {
+	i = indirect(i)
+	jww.DEBUG.Println("ToDurationE called on type:", reflect.TypeOf(i))
+
+	switch s := i.(type) {
+	case time.Duration:
+		return s, nil
+	case string:
+		d, err = time.ParseDuration(s)
+		return
+	default:
+		err = fmt.Errorf("Unable to Cast %#v to Duration\n", i)
+		return
+	}
+}
+
+func ToBoolE(i interface{}) (bool, error) {
+	i = indirect(i)
+	jww.DEBUG.Println("ToBoolE called on type:", reflect.TypeOf(i))
+
+	switch b := i.(type) {
+	case bool:
+		return b, nil
+	case nil:
+		return false, nil
+	case int:
+		if i.(int) != 0 {
+			return true, nil
+		}
+		return false, nil
+	case string:
+		return strconv.ParseBool(i.(string))
+	default:
+		return false, fmt.Errorf("Unable to Cast %#v to bool", i)
+	}
+}
+
+func ToFloat64E(i interface{}) (float64, error) {
+	i = indirect(i)
+	jww.DEBUG.Println("ToFloat64E called on type:", reflect.TypeOf(i))
+
+	switch s := i.(type) {
+	case float64:
+		return s, nil
+	case float32:
+		return float64(s), nil
+	case int64:
+		return float64(s), nil
+	case int32:
+		return float64(s), nil
+	case int16:
+		return float64(s), nil
+	case int8:
+		return float64(s), nil
+	case int:
+		return float64(s), nil
+	case string:
+		v, err := strconv.ParseFloat(s, 64)
+		if err == nil {
+			return float64(v), nil
+		} else {
+			return 0.0, fmt.Errorf("Unable to Cast %#v to float", i)
+		}
+	default:
+		return 0.0, fmt.Errorf("Unable to Cast %#v to float", i)
+	}
+}
+
+func ToIntE(i interface{}) (int, error) {
+	i = indirect(i)
+	jww.DEBUG.Println("ToIntE called on type:", reflect.TypeOf(i))
+
+	switch s := i.(type) {
+	case int:
+		return s, nil
+	case int64:
+		return int(s), nil
+	case int32:
+		return int(s), nil
+	case int16:
+		return int(s), nil
+	case int8:
+		return int(s), nil
+	case string:
+		v, err := strconv.ParseInt(s, 0, 0)
+		if err == nil {
+			return int(v), nil
+		} else {
+			return 0, fmt.Errorf("Unable to Cast %#v to int", i)
+		}
+	case float64:
+		return int(s), nil
+	case bool:
+		if bool(s) {
+			return 1, nil
+		} else {
+			return 0, nil
+		}
+	case nil:
+		return 0, nil
+	default:
+		return 0, fmt.Errorf("Unable to Cast %#v to int", i)
+	}
+}
+
+// From html/template/content.go
+// Copyright 2011 The Go Authors. All rights reserved.
+// indirect returns the value, after dereferencing as many times
+// as necessary to reach the base type (or nil).
+func indirect(a interface{}) interface{} {
+	if a == nil {
+		return nil
+	}
+	if t := reflect.TypeOf(a); t.Kind() != reflect.Ptr {
+		// Avoid creating a reflect.Value if it's not a pointer.
+		return a
+	}
+	v := reflect.ValueOf(a)
+	for v.Kind() == reflect.Ptr && !v.IsNil() {
+		v = v.Elem()
+	}
+	return v.Interface()
+}
+
+// From html/template/content.go
+// Copyright 2011 The Go Authors. All rights reserved.
+// indirectToStringerOrError returns the value, after dereferencing as many times
+// as necessary to reach the base type (or nil) or an implementation of fmt.Stringer
+// or error,
+func indirectToStringerOrError(a interface{}) interface{} {
+	if a == nil {
+		return nil
+	}
+
+	var errorType = reflect.TypeOf((*error)(nil)).Elem()
+	var fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
+
+	v := reflect.ValueOf(a)
+	for !v.Type().Implements(fmtStringerType) && !v.Type().Implements(errorType) && v.Kind() == reflect.Ptr && !v.IsNil() {
+		v = v.Elem()
+	}
+	return v.Interface()
+}
+
+func ToStringE(i interface{}) (string, error) {
+	i = indirectToStringerOrError(i)
+	jww.DEBUG.Println("ToStringE called on type:", reflect.TypeOf(i))
+
+	switch s := i.(type) {
+	case string:
+		return s, nil
+	case float64:
+		return strconv.FormatFloat(i.(float64), 'f', -1, 64), nil
+	case int:
+		return strconv.FormatInt(int64(i.(int)), 10), nil
+	case []byte:
+		return string(s), nil
+	case template.HTML:
+		return string(s), nil
+	case nil:
+		return "", nil
+	case fmt.Stringer:
+		return s.String(), nil
+	case error:
+		return s.Error(), nil
+	default:
+		return "", fmt.Errorf("Unable to Cast %#v to string", i)
+	}
+}
+
+func ToStringMapStringE(i interface{}) (map[string]string, error) {
+	jww.DEBUG.Println("ToStringMapStringE called on type:", reflect.TypeOf(i))
+
+	var m = map[string]string{}
+
+	switch v := i.(type) {
+	case map[interface{}]interface{}:
+		for k, val := range v {
+			m[ToString(k)] = ToString(val)
+		}
+		return m, nil
+	case map[string]interface{}:
+		for k, val := range v {
+			m[ToString(k)] = ToString(val)
+		}
+		return m, nil
+	case map[string]string:
+		return v, nil
+	default:
+		return m, fmt.Errorf("Unable to Cast %#v to map[string]string", i)
+	}
+	return m, fmt.Errorf("Unable to Cast %#v to map[string]string", i)
+}
+
+func ToStringMapBoolE(i interface{}) (map[string]bool, error) {
+	jww.DEBUG.Println("ToStringMapBoolE called on type:", reflect.TypeOf(i))
+
+	var m = map[string]bool{}
+
+	switch v := i.(type) {
+	case map[interface{}]interface{}:
+		for k, val := range v {
+			m[ToString(k)] = ToBool(val)
+		}
+		return m, nil
+	case map[string]interface{}:
+		for k, val := range v {
+			m[ToString(k)] = ToBool(val)
+		}
+		return m, nil
+	case map[string]bool:
+		return v, nil
+	default:
+		return m, fmt.Errorf("Unable to Cast %#v to map[string]bool", i)
+	}
+	return m, fmt.Errorf("Unable to Cast %#v to map[string]bool", i)
+}
+
+func ToStringMapE(i interface{}) (map[string]interface{}, error) {
+	jww.DEBUG.Println("ToStringMapE called on type:", reflect.TypeOf(i))
+
+	var m = map[string]interface{}{}
+
+	switch v := i.(type) {
+	case map[interface{}]interface{}:
+		for k, val := range v {
+			m[ToString(k)] = val
+		}
+		return m, nil
+	case map[string]interface{}:
+		return v, nil
+	default:
+		return m, fmt.Errorf("Unable to Cast %#v to map[string]interface{}", i)
+	}
+
+	return m, fmt.Errorf("Unable to Cast %#v to map[string]interface{}", i)
+}
+
+func ToSliceE(i interface{}) ([]interface{}, error) {
+	jww.DEBUG.Println("ToSliceE called on type:", reflect.TypeOf(i))
+
+	var s []interface{}
+
+	switch v := i.(type) {
+	case []interface{}:
+		for _, u := range v {
+			s = append(s, u)
+		}
+		return s, nil
+	case []map[string]interface{}:
+		for _, u := range v {
+			s = append(s, u)
+		}
+		return s, nil
+	default:
+		return s, fmt.Errorf("Unable to Cast %#v of type %v to []interface{}", i, reflect.TypeOf(i))
+	}
+
+	return s, fmt.Errorf("Unable to Cast %#v to []interface{}", i)
+}
+
+func ToStringSliceE(i interface{}) ([]string, error) {
+	jww.DEBUG.Println("ToStringSliceE called on type:", reflect.TypeOf(i))
+
+	var a []string
+
+	switch v := i.(type) {
+	case []interface{}:
+		for _, u := range v {
+			a = append(a, ToString(u))
+		}
+		return a, nil
+	case []string:
+		return v, nil
+	case string:
+		return strings.Fields(v), nil
+	default:
+		return a, fmt.Errorf("Unable to Cast %#v to []string", i)
+	}
+
+	return a, fmt.Errorf("Unable to Cast %#v to []string", i)
+}
+
+func ToIntSliceE(i interface{}) ([]int, error) {
+	jww.DEBUG.Println("ToIntSliceE called on type:", reflect.TypeOf(i))
+
+	if i == nil {
+		return []int{}, fmt.Errorf("Unable to Cast %#v to []int", i)
+	}
+
+	switch v := i.(type) {
+	case []int:
+		return v, nil
+	}
+
+	kind := reflect.TypeOf(i).Kind()
+	switch kind {
+	case reflect.Slice, reflect.Array:
+		s := reflect.ValueOf(i)
+		a := make([]int, s.Len())
+		for j := 0; j < s.Len(); j++ {
+			val, err := ToIntE(s.Index(j).Interface())
+			if err != nil {
+				return []int{}, fmt.Errorf("Unable to Cast %#v to []int", i)
+			}
+			a[j] = val
+		}
+		return a, nil
+	default:
+		return []int{}, fmt.Errorf("Unable to Cast %#v to []int", i)
+	}
+
+	return []int{}, fmt.Errorf("Unable to Cast %#v to []int", i)
+}
+
+func StringToDate(s string) (time.Time, error) {
+	return parseDateWith(s, []string{
+		time.RFC3339,
+		"2006-01-02T15:04:05", // iso8601 without timezone
+		time.RFC1123Z,
+		time.RFC1123,
+		time.RFC822Z,
+		time.RFC822,
+		time.ANSIC,
+		time.UnixDate,
+		time.RubyDate,
+		"2006-01-02 15:04:05Z07:00",
+		"02 Jan 06 15:04 MST",
+		"2006-01-02",
+		"02 Jan 2006",
+	})
+}
+
+func parseDateWith(s string, dates []string) (d time.Time, e error) {
+	for _, dateType := range dates {
+		if d, e = time.Parse(dateType, s); e == nil {
+			return
+		}
+	}
+	return d, errors.New(fmt.Sprintf("Unable to parse date: %s", s))
+}



[02/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/compiler.go
----------------------------------------------------------------------
diff --git a/newt/cli/compiler.go b/newt/cli/compiler.go
new file mode 100644
index 0000000..94cea3a
--- /dev/null
+++ b/newt/cli/compiler.go
@@ -0,0 +1,619 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cli
+
+import (
+	"io/ioutil"
+	"log"
+	"os"
+	"path"
+	"path/filepath"
+	"sort"
+	"strings"
+	"time"
+)
+
+const (
+	COMPILER_TYPE_C   = 0
+	COMPILER_TYPE_ASM = 1
+)
+
+type Compiler struct {
+	ConfigPath   string
+	TargetName   string
+	BaseIncludes map[string]bool
+	ObjPathList  map[string]bool
+	LinkerScript string
+
+	Cflags string
+	Aflags string
+	Lflags string
+
+	depTracker            DepTracker
+	ccPath                string
+	asPath                string
+	arPath                string
+	odPath                string
+	osPath                string
+	ocPath                string
+	ldFlags               string
+	ldResolveCircularDeps bool
+	ldMapFile             bool
+}
+
+func NewCompiler(ccPath string, cDef string, tName string, includes []string) (
+	*Compiler, error) {
+
+	c := &Compiler{
+		ConfigPath:   ccPath,
+		TargetName:   tName,
+		BaseIncludes: map[string]bool{},
+		ObjPathList:  map[string]bool{},
+	}
+
+	c.depTracker = NewDepTracker(c)
+	for _, incl := range includes {
+		c.BaseIncludes[incl] = true
+	}
+
+	StatusMessage(VERBOSITY_VERBOSE,
+		"Loading compiler %s, target %s, def %s\n", ccPath, tName, cDef)
+
+	err := c.ReadSettings(cDef)
+	if err != nil {
+		return nil, err
+	}
+
+	return c, nil
+}
+
+func (c *Compiler) ReadSettings(cDef string) error {
+	v, err := ReadConfig(c.ConfigPath, "compiler")
+	if err != nil {
+		return err
+	}
+
+	c.ccPath = v.GetString("compiler.path.cc")
+	c.asPath = v.GetString("compiler.path.as")
+	c.arPath = v.GetString("compiler.path.archive")
+	c.odPath = v.GetString("compiler.path.objdump")
+	c.osPath = v.GetString("compiler.path.objsize")
+	c.ocPath = v.GetString("compiler.path.objcopy")
+
+	cflags := v.GetStringSlice("compiler.flags." + cDef)
+	for _, flag := range cflags {
+		if strings.HasPrefix(flag, "compiler.flags") {
+			c.Cflags += " " + strings.Trim(v.GetString(flag), "\n")
+		} else {
+			c.Cflags += " " + strings.Trim(flag, "\n")
+		}
+	}
+
+	c.ldFlags = v.GetString("compiler.ld.flags")
+	c.ldResolveCircularDeps = v.GetBool("compiler.ld.resolve_circular_deps")
+	c.ldMapFile = v.GetBool("compiler.ld.mapfile")
+
+	log.Printf("[INFO] ccPath = %s, arPath = %s, flags = %s", c.ccPath,
+		c.arPath, c.Cflags)
+
+	return nil
+}
+
+// Skips compilation of the specified C or assembly file, but adds the name of
+// the object file that would have been generated to the compiler's list of
+// object files.  This function is used when the object file is already up to
+// date, so no compilation is necessary.  The name of the object file should
+// still be remembered so that it gets linked in to the final library or
+// executable.
+func (c *Compiler) SkipSourceFile(srcFile string) error {
+	wd, _ := os.Getwd()
+	objDir := wd + "/obj/" + c.TargetName + "/"
+	objFile := objDir + strings.TrimSuffix(srcFile, filepath.Ext(srcFile)) +
+		".o"
+	c.ObjPathList[filepath.ToSlash(objFile)] = true
+
+	// Update the dependency tracker with the object file's modification time.
+	// This is necessary later for determining if the library / executable
+	// needs to be rebuilt.
+	err := c.depTracker.ProcessFileTime(objFile)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Generates a string consisting of all the necessary include path (-I)
+// options.  The result is sorted and contains no duplicate paths.
+func (c *Compiler) IncludesString() string {
+	includes := make([]string, 0, len(c.BaseIncludes))
+	for k, _ := range c.BaseIncludes {
+		includes = append(includes, filepath.ToSlash(k))
+	}
+
+	sort.Strings(includes)
+
+	return "-I" + strings.Join(includes, " -I")
+}
+
+// Calculates the command-line invocation necessary to compile the specified C
+// or assembly file.
+//
+// @param file                  The filename of the source file to compile.
+// @param compilerType          One of the COMPILER_TYPE_[...] constants.
+//
+// @return                      (success) The command string.
+func (c *Compiler) CompileFileCmd(file string,
+	compilerType int) (string, error) {
+
+	wd, _ := os.Getwd()
+	objDir := wd + "/obj/" + c.TargetName + "/"
+	objFile := strings.TrimSuffix(file, filepath.Ext(file)) + ".o"
+	objPath := filepath.ToSlash(objDir + objFile)
+
+	var cmd string
+
+	switch compilerType {
+	case COMPILER_TYPE_C:
+		cmd = c.ccPath
+	case COMPILER_TYPE_ASM:
+		cmd = c.asPath
+	default:
+		return "", NewNewtError("Unknown compiler type")
+	}
+
+	cmd += " -c " + "-o " + objPath + " " + file +
+		" " + c.Cflags + " " + c.IncludesString()
+
+	return cmd, nil
+}
+
+// Generates a dependency Makefile (.d) for the specified source C file.
+//
+// @param file                  The name of the source file.
+func (c *Compiler) GenDepsForFile(file string) error {
+	wd, _ := os.Getwd()
+	objDir := wd + "/obj/" + c.TargetName + "/"
+
+	if NodeNotExist(objDir) {
+		os.MkdirAll(objDir, 0755)
+	}
+
+	depFile := objDir + strings.TrimSuffix(file, filepath.Ext(file)) + ".d"
+	depFile = filepath.ToSlash(depFile)
+	cFlags := c.Cflags + " " + c.IncludesString()
+
+	var cmd string
+	var err error
+
+	cmd = c.ccPath + " " + cFlags + " -MM -MG " + file + " > " + depFile
+	_, err = ShellCommand(cmd)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Compile the specified C or assembly file.
+//
+// @param file                  The filename of the source file to compile.
+// @param compilerType          One of the COMPILER_TYPE_[...] constants.
+func (c *Compiler) CompileFile(file string, compilerType int) error {
+	wd, _ := os.Getwd()
+	objDir := wd + "/obj/" + c.TargetName + "/"
+
+	if NodeNotExist(objDir) {
+		os.MkdirAll(objDir, 0755)
+	}
+
+	objFile := strings.TrimSuffix(file, filepath.Ext(file)) + ".o"
+
+	objPath := objDir + objFile
+	c.ObjPathList[filepath.ToSlash(objPath)] = true
+
+	cmd, err := c.CompileFileCmd(file, compilerType)
+	if err != nil {
+		return err
+	}
+
+	switch compilerType {
+	case COMPILER_TYPE_C:
+		StatusMessage(VERBOSITY_DEFAULT, "Compiling %s\n", file)
+	case COMPILER_TYPE_ASM:
+		StatusMessage(VERBOSITY_DEFAULT, "Assembling %s\n", file)
+	default:
+		return NewNewtError("Unknown compiler type")
+	}
+
+	rsp, err := ShellCommand(cmd)
+	if err != nil {
+		StatusMessage(VERBOSITY_QUIET, string(rsp))
+		return err
+	}
+
+	err = WriteCommandFile(objPath, cmd)
+	if err != nil {
+		return err
+	}
+
+	// Tell the dependency tracker that an object file was just rebuilt.
+	c.depTracker.MostRecent = time.Now()
+
+	return nil
+}
+
+// Compiles all C files matching the specified file glob.
+//
+// @param match                 The file glob specifying which C files to
+//                                  compile.
+func (c *Compiler) Compile(match string) error {
+	files, _ := filepath.Glob(match)
+
+	wd, err := os.Getwd()
+	if err != nil {
+		return err
+	}
+
+	log.Printf("[INFO] Compiling C if outdated (%s/%s) %s", wd, match,
+		strings.Join(files, " "))
+	for _, file := range files {
+		file = filepath.ToSlash(file)
+		compileRequired, err := c.depTracker.CompileRequired(file, 0)
+		if err != nil {
+			return err
+		}
+		if compileRequired {
+			err = c.CompileFile(file, COMPILER_TYPE_C)
+		} else {
+			err = c.SkipSourceFile(file)
+		}
+		if err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+// Compiles all assembly files matching the specified file glob.
+//
+// @param match                 The file glob specifying which assembly files
+//                                  to compile.
+func (c *Compiler) CompileAs(match string) error {
+	files, _ := filepath.Glob(match)
+
+	wd, err := os.Getwd()
+	if err != nil {
+		return err
+	}
+
+	log.Printf("[INFO] Compiling assembly if outdated (%s/%s) %s", wd, match,
+		strings.Join(files, " "))
+	for _, file := range files {
+		compileRequired, err := c.depTracker.CompileRequired(file, 1)
+		if err != nil {
+			return err
+		}
+		if compileRequired {
+			err = c.CompileFile(file, COMPILER_TYPE_ASM)
+		} else {
+			err = c.SkipSourceFile(file)
+		}
+		if err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (c *Compiler) RecursiveClean(path string, tName string) error {
+	// Find all the subdirectories of path that contain an "obj/" directory,
+	// and remove that directory either altogether, or just the arch specific
+	// directory.
+	dirList, err := ioutil.ReadDir(path)
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	for _, node := range dirList {
+		if node.IsDir() {
+			if node.Name() == "obj" || node.Name() == "bin" {
+				if tName == "" {
+					os.RemoveAll(path + "/" + node.Name() + "/")
+				} else {
+					os.RemoveAll(path + "/" + node.Name() + "/" + tName + "/")
+				}
+			} else {
+				// recurse into the directory.
+				err = c.RecursiveClean(path+"/"+node.Name(), tName)
+				if err != nil {
+					return err
+				}
+			}
+		}
+	}
+
+	return nil
+}
+
+func (c *Compiler) processEntry(wd string, node os.FileInfo, match string, cType int,
+	ignDirs []string) error {
+	// check to see if we ignore this element
+	for _, entry := range ignDirs {
+		if entry == node.Name() {
+			return nil
+		}
+	}
+
+	// if not, recurse into the directory
+	os.Chdir(wd + "/" + node.Name())
+	return c.RecursiveCompile(match, cType, ignDirs)
+}
+
+func (c *Compiler) RecursiveCompile(match string, cType int, ignDirs []string) error {
+	// Get a list of files in the current directory, and if they are a directory,
+	// and that directory is not in the ignDirs variable, then recurse into that
+	// directory and compile the files in there
+	wd, err := os.Getwd()
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+	wd = filepath.ToSlash(wd)
+
+	dirList, err := ioutil.ReadDir(wd)
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	for _, node := range dirList {
+		if node.IsDir() {
+			err = c.processEntry(wd, node, match, cType, ignDirs)
+			if err != nil {
+				return err
+			}
+		}
+	}
+
+	os.Chdir(wd)
+
+	switch cType {
+	case 0:
+		return c.Compile(match)
+	case 1:
+		return c.CompileAs(match)
+	default:
+		return NewNewtError("Wrong compiler type specified to RecursiveCompile")
+	}
+}
+
+func (c *Compiler) getObjFiles(baseObjFiles []string) string {
+	for objName, _ := range c.ObjPathList {
+		baseObjFiles = append(baseObjFiles, objName)
+	}
+
+	sort.Strings(baseObjFiles)
+	objList := strings.Join(baseObjFiles, " ")
+	return objList
+}
+
+// Calculates the command-line invocation necessary to link the specified elf
+// file.
+//
+// @param dstFile               The filename of the destination elf file to
+//                                  link.
+// @param options               Some build options specifying how the elf file
+//                                  gets generated.
+// @param objFiles              An array of the source .o and .a filenames.
+//
+// @return                      (success) The command string.
+func (c *Compiler) CompileBinaryCmd(dstFile string, options map[string]bool,
+	objFiles []string) string {
+
+	objList := c.getObjFiles(UniqueStrings(objFiles))
+
+	cmd := c.ccPath + " -o " + dstFile + " " + c.ldFlags + " " + c.Cflags
+	if c.ldResolveCircularDeps {
+		cmd += " -Wl,--start-group " + objList + " -Wl,--end-group "
+	} else {
+		cmd += " " + objList
+	}
+
+	if c.LinkerScript != "" {
+		cmd += " -T " + c.LinkerScript
+	}
+	if checkBoolMap(options, "mapFile") {
+		cmd += " -Wl,-Map=" + dstFile + ".map"
+	}
+
+	return cmd
+}
+
+// Links the specified elf file.
+//
+// @param dstFile               The filename of the destination elf file to
+//                                  link.
+// @param options               Some build options specifying how the elf file
+//                                  gets generated.
+// @param objFiles              An array of the source .o and .a filenames.
+func (c *Compiler) CompileBinary(dstFile string, options map[string]bool,
+	objFiles []string) error {
+
+	objList := c.getObjFiles(UniqueStrings(objFiles))
+
+	StatusMessage(VERBOSITY_DEFAULT, "Linking %s\n", path.Base(dstFile))
+	StatusMessage(VERBOSITY_VERBOSE, "Linking %s with input files %s\n",
+		dstFile, objList)
+
+	cmd := c.CompileBinaryCmd(dstFile, options, objFiles)
+	rsp, err := ShellCommand(cmd)
+	if err != nil {
+		StatusMessage(VERBOSITY_QUIET, string(rsp))
+		return err
+	}
+
+	err = WriteCommandFile(dstFile, cmd)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Generates the following build artifacts:
+//    * lst file
+//    * map file
+//    * bin file
+//
+// @param elfFilename           The filename of the elf file corresponding to
+//                                  the artifacts to be generated.
+// @param options               Some build options specifying which artifacts
+//                                  get generated.
+func (c *Compiler) generateExtras(elfFilename string,
+	options map[string]bool) error {
+
+	var cmd string
+
+	if checkBoolMap(options, "listFile") {
+		listFile := elfFilename + ".lst"
+		// if list file exists, remove it
+		if NodeExist(listFile) {
+			if err := os.RemoveAll(listFile); err != nil {
+				return err
+			}
+		}
+
+		cmd = c.odPath + " -wxdS " + elfFilename + " >> " + listFile
+		_, err := ShellCommand(cmd)
+		if err != nil {
+			// XXX: gobjdump appears to always crash.  Until we get that sorted
+			// out, don't fail the link process if lst generation fails.
+			return nil
+		}
+
+		sects := []string{".text", ".rodata", ".data"}
+		for _, sect := range sects {
+			cmd = c.odPath + " -s -j " + sect + " " + elfFilename + " >> " +
+				listFile
+			ShellCommand(cmd)
+		}
+
+		cmd = c.osPath + " " + elfFilename + " >> " + listFile
+		_, err = ShellCommand(cmd)
+		if err != nil {
+			return err
+		}
+	}
+
+	if checkBoolMap(options, "binFile") {
+		binFile := elfFilename + ".bin"
+		cmd = c.ocPath + " -R .bss -R .bss.core -R .bss.core.nz -O binary " +
+			elfFilename + " " + binFile
+		_, err := ShellCommand(cmd)
+		if err != nil {
+			return err
+		}
+	}
+
+	return nil
+}
+
+// Links the specified elf file and generates some associated artifacts (lst,
+// bin, and map files).
+//
+// @param binFile               The filename of the destination elf file to
+//                                  link.
+// @param options               Some build options specifying how the elf file
+//                                  gets generated.
+// @param objFiles              An array of the source .o and .a filenames.
+func (c *Compiler) CompileElf(binFile string, options map[string]bool,
+	objFiles []string) error {
+
+	binFile += ".elf"
+
+	linkRequired, err := c.depTracker.LinkRequired(binFile, options, objFiles)
+	if err != nil {
+		return err
+	}
+	if linkRequired {
+		err := c.CompileBinary(binFile, options, objFiles)
+		if err != nil {
+			return err
+		}
+	}
+
+	err = c.generateExtras(binFile, options)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Calculates the command-line invocation necessary to archive the specified
+// static library.
+//
+// @param archiveFile           The filename of the library to archive.
+// @param objFiles              An array of the source .o filenames.
+//
+// @return                      The command string.
+func (c *Compiler) CompileArchiveCmd(archiveFile string,
+	objFiles []string) string {
+
+	objList := c.getObjFiles(objFiles)
+	return c.arPath + " rcs " + archiveFile + " " + objList
+}
+
+// Archives the specified static library.
+//
+// @param archiveFile           The filename of the library to archive.
+// @param objFiles              An array of the source .o filenames.
+func (c *Compiler) CompileArchive(archiveFile string, objFiles []string) error {
+	arRequired, err := c.depTracker.ArchiveRequired(archiveFile, objFiles)
+	if err != nil {
+		return err
+	}
+	if !arRequired {
+		return nil
+	}
+
+	objList := c.getObjFiles(objFiles)
+
+	StatusMessage(VERBOSITY_DEFAULT, "Archiving %s\n", path.Base(archiveFile))
+	StatusMessage(VERBOSITY_VERBOSE, "Archiving %s with object files %s",
+		archiveFile, objList)
+
+	// Delete the old archive, if it exists.
+	err = os.Remove(archiveFile)
+	if err != nil && !os.IsNotExist(err) {
+		return NewNewtError(err.Error())
+	}
+
+	cmd := c.CompileArchiveCmd(archiveFile, objFiles)
+	rsp, err := ShellCommand(cmd)
+	if err != nil {
+		StatusMessage(VERBOSITY_QUIET, string(rsp))
+		return err
+	}
+
+	err = WriteCommandFile(archiveFile, cmd)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/deps.go
----------------------------------------------------------------------
diff --git a/newt/cli/deps.go b/newt/cli/deps.go
new file mode 100644
index 0000000..23dd4b9
--- /dev/null
+++ b/newt/cli/deps.go
@@ -0,0 +1,239 @@
+package cli
+
+import (
+	"os"
+	"path/filepath"
+	"strings"
+	"time"
+)
+
+type DepTracker struct {
+	// Most recent .o modification time.
+	MostRecent time.Time
+
+	compiler *Compiler
+}
+
+func NewDepTracker(c *Compiler) DepTracker {
+	tracker := DepTracker{
+		MostRecent: time.Unix(0, 0),
+		compiler:   c,
+	}
+
+	return tracker
+}
+
+// Parses a dependency (.d) file generated by gcc.  On success, the returned
+// string array is populated with the dependency filenames.  This function
+// expects the first line of a dependency file to have the following format:
+//
+// <file>.d: <file>.c a.h b.h c.h \
+//  d.h e.h f.h
+//
+// This function ignores all lines except for the first.
+func ParseDepsFile(filename string) ([]string, error) {
+	lines, err := ReadLines(filename)
+	if err != nil {
+		return nil, err
+	}
+
+	if len(lines) == 0 {
+		return []string{}, nil
+	}
+
+	// Assume only the first line is important.
+	tokens := strings.Fields(lines[0])
+	if len(tokens) == 0 {
+		return nil, NewNewtError("Invalid Makefile dependency file; first " +
+			"line is blank")
+	}
+
+	dFileTok := tokens[0]
+	if dFileTok[len(dFileTok)-1:] != ":" {
+		return nil, NewNewtError("Invalid Makefile dependency file; first " +
+			"line missing ':'")
+	}
+
+	return tokens[1:], nil
+}
+
+// Updates the dependency tracker's most recent timestamp according to the
+// modification time of the specified file.  If the specified file is older
+// than the tracker's currently most-recent time, this function has no effect.
+func (tracker *DepTracker) ProcessFileTime(file string) error {
+	modTime, err := FileModificationTime(file)
+	if err != nil {
+		return err
+	}
+
+	if modTime.After(tracker.MostRecent) {
+		tracker.MostRecent = modTime
+	}
+
+	return nil
+}
+
+// Determines if the specified C or assembly file needs to be built.  A compile
+// is required if any of the following is true:
+//     * The destination object file does not exist.
+//     * The existing object file was built with a different compiler
+//       invocation.
+//     * The source file has a newer modification time than the object file.
+//     * One or more included header files has a newer modification time than
+//       the object file.
+func (tracker *DepTracker) CompileRequired(srcFile string,
+	compilerType int) (bool, error) {
+	wd, _ := os.Getwd()
+	objDir := wd + "/obj/" + tracker.compiler.TargetName + "/"
+
+	objFile := objDir + strings.TrimSuffix(srcFile, filepath.Ext(srcFile)) +
+		".o"
+	depFile := objDir + strings.TrimSuffix(srcFile, filepath.Ext(srcFile)) +
+		".d"
+
+	// If the object was previously built with a different set of options, a
+	// rebuild is necessary.
+	cmd, err := tracker.compiler.CompileFileCmd(srcFile, compilerType)
+	if err != nil {
+		return false, err
+	}
+	if CommandHasChanged(objFile, cmd) {
+		return true, nil
+	}
+
+	srcModTime, err := FileModificationTime(srcFile)
+	if err != nil {
+		return false, err
+	}
+
+	objModTime, err := FileModificationTime(objFile)
+	if err != nil {
+		return false, err
+	}
+
+	// If the object doesn't exist or is older than the source file, a build is
+	// required; no need to check dependencies.
+	if srcModTime.After(objModTime) {
+		return true, nil
+	}
+
+	// Determine if the dependency (.d) file needs to be generated.  If it
+	// doesn't exist or is older than the source file, it is out of date and
+	// needs to be created.
+	depModTime, err := FileModificationTime(depFile)
+	if err != nil {
+		return false, err
+	}
+
+	if srcModTime.After(depModTime) {
+		err := tracker.compiler.GenDepsForFile(srcFile)
+		if err != nil {
+			return false, err
+		}
+	}
+
+	// Extract the dependency filenames from the dependency file.
+	deps, err := ParseDepsFile(depFile)
+	if err != nil {
+		return false, err
+	}
+
+	// Check if any dependencies are newer than the destination object file.
+	for _, dep := range deps {
+		if NodeNotExist(dep) {
+			depModTime = time.Now()
+		} else {
+			depModTime, err = FileModificationTime(dep)
+			if err != nil {
+				return false, err
+			}
+		}
+
+		if depModTime.After(objModTime) {
+			return true, nil
+		}
+	}
+
+	return false, nil
+}
+
+// Determines if the specified static library needs to be rearchived.  The
+// library needs to be archived if any of the following is true:
+//     * The destination library file does not exist.
+//     * The existing library file was built with a different compiler
+//       invocation.
+//     * One or more source object files has a newer modification time than the
+//       library file.
+func (tracker *DepTracker) ArchiveRequired(archiveFile string,
+	objFiles []string) (bool, error) {
+
+	// If the archive was previously built with a different set of options, a
+	// rebuild is required.
+	cmd := tracker.compiler.CompileArchiveCmd(archiveFile, objFiles)
+	if CommandHasChanged(archiveFile, cmd) {
+		return true, nil
+	}
+
+	// If the archive doesn't exist or is older than any object file, a rebuild
+	// is required.
+	aModTime, err := FileModificationTime(archiveFile)
+	if err != nil {
+		return false, err
+	}
+	if tracker.MostRecent.After(aModTime) {
+		return true, nil
+	}
+
+	// The library is up to date.
+	return false, nil
+}
+
+// Determines if the specified elf file needs to be linked.  Linking is
+// necessary if the elf file does not exist or has an older modification time
+// than any source object or library file.
+// Determines if the specified static library needs to be rearchived.  The
+// library needs to be archived if any of the following is true:
+//     * The destination library file does not exist.
+//     * The existing library file was built with a different compiler
+//       invocation.
+//     * One or more source object files has a newer modification time than the
+//       library file.
+func (tracker *DepTracker) LinkRequired(dstFile string,
+	options map[string]bool, objFiles []string) (bool, error) {
+
+	// If the elf file was previously built with a different set of options, a
+	// rebuild is required.
+	cmd := tracker.compiler.CompileBinaryCmd(dstFile, options, objFiles)
+	if CommandHasChanged(dstFile, cmd) {
+		return true, nil
+	}
+
+	// If the elf file doesn't exist or is older than any input file, a rebuild
+	// is required.
+	dstModTime, err := FileModificationTime(dstFile)
+	if err != nil {
+		return false, err
+	}
+
+	// Check timestamp of each .o file in the project.
+	if tracker.MostRecent.After(dstModTime) {
+		return true, nil
+	}
+
+	// Check timestamp of the linker script and all input libraries.
+	if tracker.compiler.LinkerScript != "" {
+		objFiles = append(objFiles, tracker.compiler.LinkerScript)
+	}
+	for _, obj := range objFiles {
+		objModTime, err := FileModificationTime(obj)
+		if err != nil {
+			return false, err
+		}
+
+		if objModTime.After(dstModTime) {
+			return true, nil
+		}
+	}
+
+	return false, nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/downloader.go
----------------------------------------------------------------------
diff --git a/newt/cli/downloader.go b/newt/cli/downloader.go
new file mode 100644
index 0000000..b743fea
--- /dev/null
+++ b/newt/cli/downloader.go
@@ -0,0 +1,90 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cli
+
+import (
+	"fmt"
+	"io/ioutil"
+	"os"
+)
+
+type Downloader struct {
+	Repos map[string]string
+}
+
+func NewDownloader() (*Downloader, error) {
+	dl := &Downloader{}
+
+	dl.Repos = map[string]string{}
+
+	return dl, nil
+}
+
+func (dl *Downloader) gitClone(url string, branch string, dest string) error {
+	StatusMessage(VERBOSITY_VERBOSE,
+		"Git cloning URL %s branch %s into dest %s\n", branch, url, dest)
+
+	_, err := ShellCommand(fmt.Sprintf("git clone --depth 1 -b %s %s %s", branch, url, dest))
+	if err != nil {
+		return NewNewtError(fmt.Sprintf("Command git clone %s branch %s failed",
+			url, branch))
+	}
+
+	StatusMessage(VERBOSITY_VERBOSE,
+		"Git clone successful, removing .git directory\n")
+
+	if err := os.RemoveAll(dest + "/.git/"); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (dl *Downloader) GetRepo(repoUrl string, branch string) (string, error) {
+	// If repo already exists, return the temporary directory where it exists
+	dir, ok := dl.Repos[repoUrl+branch]
+	if ok {
+		return dir, nil
+	}
+
+	dir, err := ioutil.TempDir("", "newtrepo")
+	if err != nil {
+		return "", err
+	}
+
+	// Otherwise, get a temporary directory and place the repo there.
+	if err := dl.gitClone(repoUrl, branch, dir); err != nil {
+		return "", err
+	}
+
+	dl.Repos[repoUrl+branch] = dir
+
+	return dir, nil
+}
+
+func (dl *Downloader) DownloadFile(repoUrl string, branch string,
+	filePath string, destPath string) error {
+	repoDir, err := dl.GetRepo(repoUrl, branch)
+	if err != nil {
+		return err
+	}
+
+	if err := CopyFile(repoDir+"/"+filePath, destPath); err != nil {
+		return err
+	}
+
+	return nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/egg.go
----------------------------------------------------------------------
diff --git a/newt/cli/egg.go b/newt/cli/egg.go
new file mode 100644
index 0000000..0758a51
--- /dev/null
+++ b/newt/cli/egg.go
@@ -0,0 +1,775 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cli
+
+import (
+	"crypto/sha1"
+	"fmt"
+	"io/ioutil"
+	"log"
+	"os"
+	"path/filepath"
+	"regexp"
+	"strconv"
+	"strings"
+)
+
+type VersMatch struct {
+	CompareType string
+	Vers        *Version
+}
+
+type Version struct {
+	Major    int64
+	Minor    int64
+	Revision int64
+}
+
+type DependencyRequirement struct {
+	Name        string
+	Stability   string
+	VersMatches []*VersMatch
+}
+
+type Egg struct {
+	// Base directory of the egg
+	BasePath string
+	// Name of the egg
+	Name string
+	// Full Name of the egg include prefix dir
+	FullName string
+	// Nest this egg belongs to
+	Nest *Nest
+	// Egg version
+	Version *Version
+	// Type of egg
+	LinkerScript string
+
+	// For BSP egg, how to download
+	DownloadScript string
+	// For BSP egg, how to start debugger and attach it to target board
+	DebugScript string
+
+	// Has the dependencies been loaded for this egg
+	DepLoaded bool
+
+	// Has the configuration been loaded for this egg
+	CfgLoaded bool
+
+	// Egg sources
+	Sources []string
+	// Egg include directories
+	Includes []string
+
+	// Egg compiler flags
+	Cflags string
+
+	// Egg linker flags
+	Lflags string
+
+	// Egg assembler flags
+	Aflags string
+
+	// Whether or not this egg is a BSP
+	IsBsp bool
+
+	// Capabilities that this egg exports
+	Capabilities []*DependencyRequirement
+
+	// Capabilities that this egg requires
+	ReqCapabilities []*DependencyRequirement
+
+	// Whether or not we've already compiled this egg
+	Built bool
+
+	// Whether or not we've already cleaned this egg
+	Clean bool
+
+	// Eggs that this egg depends on
+	Deps []*DependencyRequirement
+}
+
+type EggShell struct {
+	FullName string
+	Version  *Version
+	/* Clutch this eggshell belongs to */
+	Clutch  *Clutch
+	Hash    string
+	Deps    []*DependencyRequirement
+	Caps    []*DependencyRequirement
+	ReqCaps []*DependencyRequirement
+}
+
+func NewEggShell(clutch *Clutch) (*EggShell, error) {
+	eShell := &EggShell{
+		Clutch: clutch,
+	}
+
+	return eShell, nil
+}
+
+func (es *EggShell) serializeDepReq(name string,
+	drList []*DependencyRequirement, indent string) string {
+	drStr := ""
+	if len(drList) > 0 {
+		drStr += fmt.Sprintf("%s%s:\n", indent, name)
+		for _, dr := range drList {
+			drStr += fmt.Sprintf("%s    - %s\n", indent, dr)
+		}
+	}
+
+	return drStr
+}
+
+func (es *EggShell) Serialize(indent string) string {
+	esStr := fmt.Sprintf("%s%s:\n", indent, es.FullName)
+	indent += "    "
+	if es.Version == nil {
+		es.Version = &Version{0, 0, 0}
+	}
+	esStr += fmt.Sprintf("%svers: %s\n", indent, es.Version)
+	esStr += fmt.Sprintf("%shash: %s\n", indent, es.Hash)
+	esStr += es.serializeDepReq("deps", es.Deps, indent)
+	esStr += es.serializeDepReq("caps", es.Caps, indent)
+	esStr += es.serializeDepReq("req_caps", es.ReqCaps, indent)
+
+	return esStr
+}
+
+func (v *Version) compareVersions(vers1 *Version, vers2 *Version) int64 {
+	log.Printf("[DEBUG] Comparing %s to %s (%d %d %d)", vers1, vers2,
+		vers1.Major-vers2.Major, vers1.Minor-vers2.Minor,
+		vers1.Revision-vers2.Revision)
+
+	if r := vers1.Major - vers2.Major; r != 0 {
+		return r
+	}
+
+	if r := vers1.Minor - vers2.Minor; r != 0 {
+		return r
+	}
+
+	if r := vers1.Revision - vers2.Revision; r != 0 {
+		return r
+	}
+
+	return 0
+}
+
+func (v *Version) SatisfiesVersion(versMatches []*VersMatch) bool {
+	if versMatches == nil {
+		return true
+	}
+
+	for _, match := range versMatches {
+		r := v.compareVersions(match.Vers, v)
+		switch match.CompareType {
+		case "<":
+			if r <= 0 {
+				return false
+			}
+		case "<=":
+			if r < 0 {
+				return false
+			}
+		case ">":
+			if r >= 0 {
+				return false
+			}
+		case ">=":
+			if r > 0 {
+				return false
+			}
+		case "==":
+			if r != 0 {
+				return false
+			}
+		}
+	}
+
+	return true
+}
+
+func (vers *Version) String() string {
+	return fmt.Sprintf("%d.%d.%d", vers.Major, vers.Minor, vers.Revision)
+}
+
+func NewVersParseString(versStr string) (*Version, error) {
+	var err error
+
+	parts := strings.Split(versStr, ".")
+	if len(parts) > 3 {
+		return nil, NewNewtError(fmt.Sprintf("Invalid version string: %s", versStr))
+	}
+
+	if strings.Trim(parts[0], " ") == "" || strings.Trim(parts[0], " ") == "none" {
+		return nil, nil
+	}
+
+	v := &Version{}
+
+	// convert first string to an int
+	if v.Major, err = strconv.ParseInt(parts[0], 0, 64); err != nil {
+		return nil, NewNewtError(err.Error())
+	}
+	if len(parts) >= 2 {
+		if v.Minor, err = strconv.ParseInt(parts[1], 0, 64); err != nil {
+			return nil, NewNewtError(err.Error())
+		}
+	}
+	if len(parts) == 3 {
+		if v.Revision, err = strconv.ParseInt(parts[2], 0, 64); err != nil {
+			return nil, NewNewtError(err.Error())
+		}
+	}
+
+	return v, nil
+}
+
+//
+// Set the version comparison constraints on a dependency requirement.
+// The version string contains a list of version constraints in the following format:
+//    - <comparison><version>
+// Where <comparison> can be any one of the following comparison
+//   operators: <=, <, >, >=, ==
+// And <version> is specified in the form: X.Y.Z where X, Y and Z are all
+// int64 types in decimal form
+func (dr *DependencyRequirement) SetVersStr(versStr string) error {
+	var err error
+
+	re, err := regexp.Compile(`(<=|>=|==|>|<)([\d\.]+)`)
+	if err != nil {
+		return err
+	}
+
+	matches := re.FindAllStringSubmatch(versStr, -1)
+	if matches != nil {
+		dr.VersMatches = make([]*VersMatch, 0, len(matches))
+		for _, match := range matches {
+			vm := &VersMatch{}
+			vm.CompareType = match[1]
+			if vm.Vers, err = NewVersParseString(match[2]); err != nil {
+				return err
+			}
+
+			if vm.Vers != nil {
+				dr.VersMatches = append(dr.VersMatches, vm)
+			}
+		}
+	} else {
+		dr.VersMatches = make([]*VersMatch, 0)
+		vm := &VersMatch{}
+		vm.CompareType = "=="
+		if vm.Vers, err = NewVersParseString(versStr); err != nil {
+			return err
+		}
+		if vm.Vers != nil {
+			dr.VersMatches = append(dr.VersMatches, vm)
+		}
+	}
+
+	if len(dr.VersMatches) == 0 {
+		dr.VersMatches = nil
+	}
+
+	return nil
+}
+
+// Convert the array of version matches into a string for display
+func (dr *DependencyRequirement) VersMatchesString() string {
+	if dr.VersMatches != nil {
+		str := ""
+		for _, match := range dr.VersMatches {
+			str += fmt.Sprintf("%s%s", match.CompareType, match.Vers)
+		}
+		return str
+	} else {
+		return "none"
+	}
+}
+
+// Convert the dependency requirement to a string for display
+func (dr *DependencyRequirement) String() string {
+	return fmt.Sprintf("%s@%s#%s", dr.Name, dr.VersMatchesString(), dr.Stability)
+}
+
+func (dr *DependencyRequirement) SatisfiesCapability(
+	capability *DependencyRequirement) error {
+	if dr.Name != capability.Name {
+		return NewNewtError(fmt.Sprintf("Required capability name %s doesn't match "+
+			"specified capability name %s", dr.Name, capability.Name))
+	}
+
+	for _, versMatch := range dr.VersMatches {
+		if !versMatch.Vers.SatisfiesVersion(capability.VersMatches) {
+			return NewNewtError(fmt.Sprintf("Capability %s doesn't satisfy version "+
+				"requirement %s", capability, versMatch.Vers))
+		}
+	}
+
+	return nil
+}
+
+// Check whether the passed in egg satisfies the current dependency requirement
+func (dr *DependencyRequirement) SatisfiesDependency(egg *Egg) bool {
+	if egg.FullName != dr.Name {
+		return false
+	}
+
+	if egg.Version.SatisfiesVersion(dr.VersMatches) {
+		return true
+	}
+
+	return false
+}
+
+// Convert the dependency requirement to branch name to look for
+func (dr *DependencyRequirement) BranchName() string {
+	if dr.Stability != "stable" {
+		// XXX should compare to latest
+		return dr.Stability
+	}
+	for _, versMatch := range dr.VersMatches {
+		if versMatch.CompareType == "==" || versMatch.CompareType == "<=" {
+			if versMatch.Vers.Minor == 0 && versMatch.Vers.Revision == 0 {
+				return fmt.Sprintf("%d", versMatch.Vers.Major)
+			} else if versMatch.Vers.Revision == 0 {
+				return fmt.Sprintf("%d.%d", versMatch.Vers.Major,
+					versMatch.Vers.Minor)
+			} else {
+				return fmt.Sprintf("%d.%d.%d", versMatch.Vers.Major,
+					versMatch.Vers.Minor, versMatch.Vers.Revision)
+			}
+		}
+		// XXX What to do with other version comparisons?
+	}
+	return "master"
+}
+
+// Create a New DependencyRequirement structure from the contents of the depReq
+// string that has been passed in as an argument.
+func NewDependencyRequirementParseString(depReq string) (*DependencyRequirement,
+	error) {
+	// Allocate dependency requirement
+	dr := &DependencyRequirement{}
+	// Split string into multiple parts, @#
+	// first, get dependency name
+	parts := strings.Split(depReq, "@")
+	if len(parts) == 1 {
+		parts = strings.Split(depReq, "#")
+		dr.Name = parts[0]
+		if len(parts) > 1 {
+			dr.Stability = parts[1]
+		} else {
+			dr.Stability = "stable"
+		}
+	} else if len(parts) == 2 {
+		dr.Name = parts[0]
+		verParts := strings.Split(parts[1], "#")
+
+		if err := dr.SetVersStr(verParts[0]); err != nil {
+			return nil, err
+		}
+		if len(verParts) == 2 {
+			dr.Stability = verParts[1]
+		} else {
+			dr.Stability = "stable"
+		}
+	}
+
+	return dr, nil
+}
+
+// Get a map of egg capabilities.  The returned map contains the name of the
+// capability, and its version as the key, and a pointer to the
+// Capability structure associated with that name.
+func (egg *Egg) GetCapabilities() ([]*DependencyRequirement, error) {
+	return egg.Capabilities, nil
+}
+
+// Return the egg dependencies for this egg.
+func (egg *Egg) GetDependencies() ([]*DependencyRequirement, error) {
+	return egg.Deps, nil
+}
+
+func (egg *Egg) GetReqCapabilities() ([]*DependencyRequirement, error) {
+	return egg.ReqCapabilities, nil
+}
+
+func (eggShell *EggShell) GetCapabilities() ([]*DependencyRequirement, error) {
+	return eggShell.Caps, nil
+}
+
+// Return the egg dependencies for this eggShell.
+func (eggShell *EggShell) GetDependencies() ([]*DependencyRequirement, error) {
+	return eggShell.Deps, nil
+}
+
+func (eggShell *EggShell) GetReqCapabilities() ([]*DependencyRequirement, error) {
+	return eggShell.ReqCaps, nil
+}
+
+// Load a egg's configuration information from the egg config
+// file.
+func (egg *Egg) GetIncludes(t *Target) ([]string, error) {
+	// Return the include directories for just this egg
+	incls := []string{
+		egg.BasePath + "/include/",
+		egg.BasePath + "/include/" + egg.Name + "/arch/" + t.Arch + "/",
+	}
+
+	return incls, nil
+}
+
+// Load capabilities from a string containing a list of capabilities.
+// The capability format is expected to be one of:
+//   name@version
+//   name
+// @param capList An array of capability strings
+// @return On success error is nil, and a list of capabilities is returned,
+// on failure error is non-nil
+func (egg *Egg) loadCaps(capList []string) ([]*DependencyRequirement, error) {
+	if len(capList) == 0 {
+		return nil, nil
+	}
+
+	// Allocate an array of capabilities
+	caps := make([]*DependencyRequirement, 0)
+
+	StatusMessage(VERBOSITY_VERBOSE, "Loading capabilities %s\n",
+		strings.Join(capList, " "))
+	for _, capItem := range capList {
+		dr, err := NewDependencyRequirementParseString(capItem)
+		if err != nil {
+			return nil, err
+		}
+
+		caps = append(caps, dr)
+		log.Printf("[DEBUG] Appending new capability egg: %s, cap:%s",
+			egg.Name, dr)
+	}
+
+	return caps, nil
+}
+
+// Create a dependency requirement out of an egg
+//
+func (egg *Egg) MakeDependency() (*DependencyRequirement, error) {
+	return NewDependencyRequirementParseString(egg.FullName)
+}
+
+// Generate a hash of the contents of an egg.  This function recursively
+// processes the contents of a directory, ignoring hidden files and the
+// bin and obj directories.  It returns a hash of all the files, their
+// contents.
+func (egg *Egg) GetHash() (string, error) {
+	hash := sha1.New()
+
+	err := filepath.Walk(egg.BasePath,
+		func(path string, info os.FileInfo, err error) error {
+			name := info.Name()
+			if name == "bin" || name == "obj" || name[0] == '.' {
+				return filepath.SkipDir
+			}
+
+			if info.IsDir() {
+				// SHA the directory name into the hash
+				hash.Write([]byte(name))
+			} else {
+				// SHA the file name & contents into the hash
+				contents, err := ioutil.ReadFile(path)
+				if err != nil {
+					return err
+				}
+				hash.Write(contents)
+			}
+			return nil
+		})
+	if err != nil && err != filepath.SkipDir {
+		return "", NewNewtError(err.Error())
+	}
+
+	hashStr := fmt.Sprintf("%x", hash.Sum(nil))
+
+	return hashStr, nil
+}
+
+// Load egg's configuration, and collect required capabilities, dependencies, and
+// identities it provides, so we'll have this available when target is being built.
+func (egg *Egg) LoadDependencies(identities map[string]string,
+	capabilities map[string]string) error {
+
+	if egg.DepLoaded {
+		return nil
+	}
+
+	log.Printf("[DEBUG] Loading dependencies for egg %s", egg.BasePath)
+
+	v, err := ReadConfig(egg.BasePath, "egg")
+	if err != nil {
+		return err
+	}
+
+	// Append all identities that this egg exposes.
+	idents := GetStringSliceIdentities(v, identities, "egg.identities")
+
+	// Add these to project identities
+	for _, item := range idents {
+		StatusMessage(VERBOSITY_VERBOSE, "    Adding identity %s - %s\n", item,
+			egg.FullName)
+		identities[item] = egg.FullName
+	}
+
+	// Load the list of capabilities that this egg exposes
+	egg.Capabilities, err = egg.loadCaps(GetStringSliceIdentities(v, identities,
+		"egg.caps"))
+	if err != nil {
+		return err
+	}
+
+	// Add these to project capabilities
+	for _, cap := range egg.Capabilities {
+		if capabilities[cap.String()] != "" &&
+			capabilities[cap.String()] != egg.FullName {
+
+			return NewNewtError(fmt.Sprintf("Multiple eggs with "+
+				"capability %s (%s and %s)",
+				cap.String(), capabilities[cap.String()], egg.FullName))
+		}
+		capabilities[cap.String()] = egg.FullName
+		StatusMessage(VERBOSITY_VERBOSE, "    Adding capability %s - %s\n",
+			cap.String(), egg.FullName)
+	}
+
+	// Load the list of capabilities that this egg requires
+	egg.ReqCapabilities, err = egg.loadCaps(GetStringSliceIdentities(v, identities,
+		"egg.req_caps"))
+	if err != nil {
+		return err
+	}
+
+	// Load egg dependencies
+	depList := GetStringSliceIdentities(v, identities, "egg.deps")
+	if len(depList) > 0 {
+		egg.Deps = make([]*DependencyRequirement, 0, len(depList))
+		for _, depStr := range depList {
+			log.Printf("[DEBUG] Loading dependency %s from egg %s", depStr,
+				egg.FullName)
+			dr, err := NewDependencyRequirementParseString(depStr)
+			if err != nil {
+				return err
+			}
+
+			egg.Deps = append(egg.Deps, dr)
+		}
+	}
+	for _, cap := range egg.ReqCapabilities {
+		eggName := capabilities[cap.String()]
+		if eggName == "" {
+			continue
+		}
+		dr, err := NewDependencyRequirementParseString(eggName)
+		if err != nil {
+			return err
+		}
+		egg.Deps = append(egg.Deps, dr)
+	}
+
+	// Check these as well
+	egg.LinkerScript = GetStringIdentities(v, identities, "egg.linkerscript")
+	egg.DownloadScript = GetStringIdentities(v, identities, "egg.downloadscript")
+	egg.DebugScript = GetStringIdentities(v, identities, "egg.debugscript")
+
+	egg.Cflags = GetStringIdentities(v, identities, "egg.cflags")
+	egg.Lflags = GetStringIdentities(v, identities, "egg.lflags")
+	egg.Aflags = GetStringIdentities(v, identities, "egg.aflags")
+
+	egg.DepLoaded = true
+
+	return nil
+}
+
+// Collect identities and capabilities that egg and it's dependencies provide
+func (egg *Egg) collectDependencies(clutch *Clutch,
+	identities map[string]string,
+	capabilities map[string]string) error {
+
+	if egg.DepLoaded {
+		return nil
+	}
+
+	StatusMessage(VERBOSITY_VERBOSE, "  Collecting egg %s dependencies\n", egg.Name)
+
+	err := egg.LoadDependencies(identities, capabilities)
+	if err != nil {
+		return err
+	}
+
+	for _, dep := range egg.Deps {
+		egg, err := clutch.ResolveEggName(dep.Name)
+		if err != nil {
+			return err
+		}
+		err = egg.collectDependencies(clutch, identities, capabilities)
+		if err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+// Clear the var which says that dependencies have been checked for this egg and
+// it's dependencies
+func (egg *Egg) clearDependencyMarker(clutch *Clutch) {
+
+	if egg.DepLoaded == false {
+		return
+	}
+	egg.DepLoaded = false
+
+	for _, dep := range egg.Deps {
+		egg, err := clutch.ResolveEggName(dep.Name)
+		if err == nil {
+			egg.clearDependencyMarker(clutch)
+		}
+	}
+}
+
+// Load a egg's configuration.  This allocates & initializes a fair number of
+// the main data structures within the egg.
+func (egg *Egg) LoadConfig(t *Target, force bool) error {
+	if egg.CfgLoaded && !force {
+		return nil
+	}
+
+	log.Printf("[DEBUG] Loading configuration for egg %s", egg.BasePath)
+
+	v, err := ReadConfig(egg.BasePath, "egg")
+	if err != nil {
+		return err
+	}
+
+	egg.FullName = v.GetString("egg.name")
+	egg.Name = filepath.Base(egg.FullName)
+
+	egg.Version, err = NewVersParseString(v.GetString("egg.vers"))
+	if err != nil {
+		return err
+	}
+
+	// Append all the identities that this egg exposes to sub-eggs.  This must
+	// be done before the remainder of the settings, as some settings depend on
+	// identity.
+	identities := map[string]string{}
+	if t != nil {
+		identities = t.Identities;
+		idents := GetStringSliceIdentities(v, identities, "egg.identities")
+		for _, item := range idents {
+		    identities[item] = egg.FullName;
+		}
+	}
+
+	egg.LinkerScript = GetStringIdentities(v, identities, "egg.linkerscript")
+	egg.DownloadScript = GetStringIdentities(v, identities, "egg.downloadscript")
+	egg.DebugScript = GetStringIdentities(v, identities, "egg.debugscript")
+
+	egg.Cflags += GetStringIdentities(v, identities, "egg.cflags")
+	egg.Lflags += GetStringIdentities(v, identities, "egg.lflags")
+	egg.Aflags += GetStringIdentities(v, identities, "egg.aflags")
+
+	// Load egg dependencies
+	depList := GetStringSliceIdentities(v, identities, "egg.deps")
+	if len(depList) > 0 {
+		egg.Deps = make([]*DependencyRequirement, 0, len(depList))
+		for _, depStr := range depList {
+			log.Printf("[DEBUG] Loading dependency %s from egg %s", depStr,
+				egg.FullName)
+			dr, err := NewDependencyRequirementParseString(depStr)
+			if err != nil {
+				return err
+			}
+
+			egg.Deps = append(egg.Deps, dr)
+		}
+	}
+
+	// Load the list of capabilities that this egg exposes
+	egg.Capabilities, err = egg.loadCaps(GetStringSliceIdentities(v, identities,
+		"egg.caps"))
+	if err != nil {
+		return err
+	}
+
+	// Load the list of capabilities that this egg requires
+	egg.ReqCapabilities, err = egg.loadCaps(GetStringSliceIdentities(v, identities,
+		"egg.req_caps"))
+	if err != nil {
+		return err
+	}
+	if len(egg.ReqCapabilities) > 0 {
+		for _, reqStr := range egg.ReqCapabilities {
+			log.Printf("[DEBUG] Loading reqCap %s from egg %s", reqStr,
+				egg.FullName)
+		}
+	}
+	egg.CfgLoaded = true
+
+	return nil
+}
+
+// Initialize a egg: loads the egg configuration, and sets up egg data
+// structures.  Should only be called from NewEgg
+func (egg *Egg) Init() error {
+	return nil
+}
+
+// Allocate and initialize a new egg, and return a fully initialized Egg
+//     structure.
+// @param nest The Nest this egg is located in
+// @param basePath The path to this egg, within the specified nest
+// @return On success, error is nil, and a Egg is returned.  on failure,
+//         error is not nil.
+func NewEgg(nest *Nest, basePath string) (*Egg, error) {
+	egg := &Egg{
+		BasePath: basePath,
+		Nest:     nest,
+	}
+
+	if err := egg.Init(); err != nil {
+		return nil, err
+	}
+
+	return egg, nil
+}
+
+func (egg *Egg) TestBinName() string {
+	return "test_" + egg.Name
+}
+
+/*
+ * Download egg from a clutch and stick it to nest.
+ */
+func (eggShell *EggShell) Install(eggMgr *Clutch, branch string) error {
+	downloaded, err := eggMgr.InstallEgg(eggShell.FullName, branch, nil)
+	for _, remoteNest := range downloaded {
+		remoteNest.Remove()
+	}
+	return err
+}
+
+func (egg *Egg) Remove() error {
+	return os.RemoveAll(egg.BasePath)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/nest.go
----------------------------------------------------------------------
diff --git a/newt/cli/nest.go b/newt/cli/nest.go
new file mode 100644
index 0000000..abc2bce
--- /dev/null
+++ b/newt/cli/nest.go
@@ -0,0 +1,467 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cli
+
+import (
+	"database/sql"
+	"fmt"
+	_ "github.com/mattn/go-sqlite3"
+	"io/ioutil"
+	"log"
+	"os"
+	"path"
+	"path/filepath"
+)
+
+type Nest struct {
+	// Name of the Nest
+	Name string
+
+	// Path to the Nest Store
+	StorePath string
+
+	// Path to the Nest Clutches
+	ClutchPath string
+
+	// Nest File
+	NestFile string
+
+	// Base path of the nest
+	BasePath string
+
+	// Store of Clutches
+	Clutches map[string]*Clutch
+
+	// Configuration
+	Config map[string]map[string]string
+
+	// The database handle for the nest configuration database
+	db *sql.DB
+}
+
+// Create a new Nest object and initialize it
+func NewNest() (*Nest, error) {
+	n := &Nest{}
+
+	err := n.Init()
+	if err != nil {
+		return nil, err
+	}
+
+	return n, nil
+}
+
+// Create a Nest object constructed out of repo in given path
+func NewNestWithDir(srcDir string) (*Nest, error) {
+	n := &Nest{}
+
+	err := n.InitPath(srcDir)
+	if err != nil {
+		return nil, err
+	}
+
+	return n, nil
+}
+
+func CreateNest(nestName string, destDir string, tadpoleUrl string) error {
+	if tadpoleUrl == "" {
+		tadpoleUrl = "https://git-wip-us.apache.org/repos/asf/incubator-mynewt-tadpole.git"
+	}
+
+	if NodeExist(destDir) {
+		return NewNewtError(fmt.Sprintf("Directory %s already exists, "+
+			" cannot create new newt nest", destDir))
+	}
+
+	dl, err := NewDownloader()
+	if err != nil {
+		return err
+	}
+
+	StatusMessage(VERBOSITY_DEFAULT, "Downloading nest skeleton from %s...",
+		tadpoleUrl)
+	if err := dl.DownloadFile(tadpoleUrl, "master", "/",
+		destDir); err != nil {
+		return err
+	}
+	StatusMessage(VERBOSITY_DEFAULT, OK_STRING)
+
+	// Overwrite nest.yml
+	contents := []byte(fmt.Sprintf("nest.name: %s\n", nestName))
+	if err := ioutil.WriteFile(destDir+"/nest.yml",
+		contents, 0644); err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	// DONE!
+
+	return nil
+}
+
+// Get a temporary directory to stick stuff in
+func (nest *Nest) GetTmpDir(dirName string, prefix string) (string, error) {
+	tmpDir := dirName
+	if NodeNotExist(tmpDir) {
+		if err := os.MkdirAll(tmpDir, 0700); err != nil {
+			return "", err
+		}
+	}
+
+	name, err := ioutil.TempDir(tmpDir, prefix)
+	if err != nil {
+		return "", err
+	}
+
+	return name, nil
+}
+
+// Find the repo file.  Searches the current directory, and then recurses
+// parent directories until it finds a file named .repo.yml
+// if no repo file found in the directory heirarchy, an error is returned
+func (nest *Nest) getNestFile() (string, error) {
+	rFile := ""
+
+	curDir, err := os.Getwd()
+	if err != nil {
+		return rFile, NewNewtError(err.Error())
+	}
+
+	for {
+		rFile = curDir + "/nest.yml"
+		log.Printf("[DEBUG] Searching for nest file at %s", rFile)
+		if _, err := os.Stat(rFile); err == nil {
+			log.Printf("[DEBUG] Found nest file at %s!", rFile)
+			break
+		}
+
+		curDir = path.Clean(curDir + "../../")
+		if curDir == "/" {
+			rFile = ""
+			err = NewNewtError("No repo file found!")
+			break
+		}
+	}
+
+	return rFile, err
+}
+
+// Create the contents of the configuration database
+func (nest *Nest) createDb(db *sql.DB) error {
+	query := `
+	CREATE TABLE IF NOT EXISTS newt_cfg (
+		cfg_name VARCHAR(255) NOT NULL,
+		key VARCHAR(255) NOT NULL,
+		value TEXT
+	)
+	`
+	_, err := db.Exec(query)
+	if err != nil {
+		return NewNewtError(err.Error())
+	} else {
+		return nil
+	}
+}
+
+// Initialize the configuration database specified by dbName.  If the database
+// doesn't exist, create it.
+func (nest *Nest) initDb(dbName string) error {
+	db, err := sql.Open("sqlite3", dbName)
+	if err != nil {
+		return err
+	}
+	nest.db = db
+
+	err = nest.createDb(db)
+	if err != nil {
+		return err
+	}
+
+	// Populate repo configuration
+	log.Printf("[DEBUG] Populating Nest configuration from %s", dbName)
+
+	rows, err := db.Query("SELECT * FROM newt_cfg")
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+	defer rows.Close()
+
+	for rows.Next() {
+		var cfgName sql.NullString
+		var cfgKey sql.NullString
+		var cfgVal sql.NullString
+
+		err := rows.Scan(&cfgName, &cfgKey, &cfgVal)
+		if err != nil {
+			return NewNewtError(err.Error())
+		}
+
+		log.Printf("[DEBUG] Setting sect %s, key %s to val %s", cfgName.String,
+			cfgKey.String, cfgVal.String)
+
+		_, ok := nest.Config[cfgName.String]
+		if !ok {
+			nest.Config[cfgName.String] = make(map[string]string)
+		}
+
+		nest.Config[cfgName.String][cfgKey.String] = cfgVal.String
+	}
+
+	return nil
+}
+
+// Get a configuration variable in section sect, with key
+// error is populated if variable doesn't exist
+func (nest *Nest) GetConfig(sect string, key string) (string, error) {
+	sectMap, ok := nest.Config[sect]
+	if !ok {
+		return "", NewNewtError("No configuration section exists")
+	}
+
+	val, ok := sectMap[key]
+	if !ok {
+		return "", NewNewtError("No configuration variable exists")
+	}
+
+	return val, nil
+}
+
+func (nest *Nest) GetConfigSect(sect string) (map[string]string, error) {
+	sm, ok := nest.Config[sect]
+	if !ok {
+		return nil, NewNewtError("No configuration section exists")
+	}
+
+	return sm, nil
+}
+
+// Delete a configuration variable in section sect with key and val
+// Returns an error if configuration variable cannot be deleted
+// (most likely due to database error or key not existing)
+func (nest *Nest) DelConfig(sect string, key string) error {
+	db := nest.db
+
+	log.Printf("[DEBUG] Deleting sect %s, key %s", sect, key)
+
+	tx, err := db.Begin()
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	stmt, err := tx.Prepare("DELETE FROM newt_cfg WHERE cfg_name=? AND key=?")
+	if err != nil {
+		return err
+	}
+	defer stmt.Close()
+
+	res, err := stmt.Exec(sect, key)
+	if err != nil {
+		return err
+	}
+
+	tx.Commit()
+
+	if affected, err := res.RowsAffected(); affected > 0 && err == nil {
+		log.Printf("[DEBUG] sect %s, key %s successfully deleted from database",
+			sect, key)
+	} else {
+		log.Printf("[DEBUG] sect %s, key %s not found, considering \"delete\" successful",
+			sect, key)
+	}
+
+	return nil
+}
+
+// Set a configuration variable in section sect with key, and val
+// Returns an error if configuration variable cannot be set
+// (most likely not able to set it in database.)
+func (nest *Nest) SetConfig(sect string, key string, val string) error {
+	_, ok := nest.Config[sect]
+	if !ok {
+		nest.Config[sect] = make(map[string]string)
+	}
+	nest.Config[sect][key] = val
+
+	// Store config
+	log.Printf("[DEBUG] Storing value %s into key %s for section %s",
+		val, sect, key)
+	db := nest.db
+
+	tx, err := db.Begin()
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	stmt, err := tx.Prepare(
+		"UPDATE newt_cfg SET value=? WHERE cfg_name=? AND key=?")
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+	defer stmt.Close()
+
+	res, err := stmt.Exec(val, sect, key)
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	// Value already existed, and we updated it.  Mission accomplished!
+	// Exit
+	if affected, err := res.RowsAffected(); affected > 0 && err == nil {
+		tx.Commit()
+		log.Printf("[DEBUG] Key %s, sect %s successfully updated to %s", key, sect, val)
+		return nil
+	}
+
+	// Otherwise, insert a new row
+	stmt1, err := tx.Prepare("INSERT INTO newt_cfg VALUES (?, ?, ?)")
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+	defer stmt1.Close()
+
+	_, err = stmt1.Exec(sect, key, val)
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	tx.Commit()
+
+	log.Printf("[DEBUG] Key %s, sect %s successfully create, value set to %s",
+		key, sect, val)
+
+	return nil
+}
+
+// Load the repo configuration file
+func (nest *Nest) loadConfig() error {
+	v, err := ReadConfig(nest.BasePath, "nest")
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	nest.Name = v.GetString("nest.name")
+	if nest.Name == "" {
+		return NewNewtError("Nest file must specify nest name")
+	}
+
+	return nil
+}
+
+func (nest *Nest) LoadClutches() error {
+	files, err := ioutil.ReadDir(nest.ClutchPath)
+	if err != nil {
+		return err
+	}
+	for _, fileInfo := range files {
+		file := fileInfo.Name()
+		if filepath.Ext(file) == ".yml" {
+			name := file[:len(filepath.Base(file))-len(".yml")]
+			log.Printf("[DEBUG] Loading Clutch %s", name)
+			clutch, err := NewClutch(nest)
+			if err != nil {
+				return err
+			}
+			if err := clutch.Load(name); err != nil {
+				return err
+			}
+		}
+	}
+	return nil
+}
+
+func (nest *Nest) InitPath(nestPath string) error {
+	cwd, err := os.Getwd()
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	if err = os.Chdir(nestPath); err != nil {
+		return NewNewtError(err.Error())
+	}
+
+	log.Printf("[DEBUG] Searching for repository, starting in directory %s", cwd)
+
+	if nest.NestFile, err = nest.getNestFile(); err != nil {
+		return err
+	}
+
+	log.Printf("[DEBUG] Nest file found, directory %s, loading configuration...",
+		nest.NestFile)
+
+	nest.BasePath = filepath.ToSlash(path.Dir(nest.NestFile))
+
+	if err = nest.loadConfig(); err != nil {
+		return err
+	}
+
+	if err = os.Chdir(cwd); err != nil {
+		return NewNewtError(err.Error())
+	}
+	return nil
+}
+
+// Initialze the repository
+// returns a NewtError on failure, and nil on success
+func (nest *Nest) Init() error {
+	var err error
+
+	cwd, err := os.Getwd()
+	if err != nil {
+		return NewNewtError(err.Error())
+	}
+	if err := nest.InitPath(cwd); err != nil {
+		return err
+	}
+
+	log.Printf("[DEBUG] Configuration loaded!  Initializing .nest database")
+
+	// Create Nest store directory
+	nest.StorePath = nest.BasePath + "/.nest/"
+	if NodeNotExist(nest.StorePath) {
+		if err := os.MkdirAll(nest.StorePath, 0755); err != nil {
+			return NewNewtError(err.Error())
+		}
+	}
+
+	// Create Nest configuration database
+	nest.Config = make(map[string]map[string]string)
+
+	dbName := nest.StorePath + "/nest.db"
+	if err := nest.initDb(dbName); err != nil {
+		return err
+	}
+
+	log.Printf("[DEBUG] Database initialized.")
+
+	// Load Clutches for the current Nest
+	nest.ClutchPath = nest.StorePath + "/clutches/"
+	if NodeNotExist(nest.ClutchPath) {
+		if err := os.MkdirAll(nest.ClutchPath, 0755); err != nil {
+			return NewNewtError(err.Error())
+		}
+	}
+
+	nest.Clutches = map[string]*Clutch{}
+
+	if err := nest.LoadClutches(); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (nest *Nest) GetClutches() (map[string]*Clutch, error) {
+	return nest.Clutches, nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/project.go
----------------------------------------------------------------------
diff --git a/newt/cli/project.go b/newt/cli/project.go
new file mode 100644
index 0000000..e7aa0da
--- /dev/null
+++ b/newt/cli/project.go
@@ -0,0 +1,484 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cli
+
+import (
+	"log"
+	"os"
+)
+
+// Structure representing a project
+type Project struct {
+	// Project name
+	Name string
+
+	// Base path of project
+	BasePath string
+
+	// Eggs
+	Eggs []string
+
+	// Capabilities
+	Capabilities []string
+
+	// Assembler compiler flags
+	Aflags string
+
+	// Compiler flags
+	Cflags string
+
+	// Linker flags
+	Lflags string
+
+	// The repository the project is located in
+	Nest *Nest
+
+	// The target associated with this project
+	Target *Target
+}
+
+// Load and initialize a project specified by name
+// nest & t are the nest and target to associate the project with
+func LoadProject(nest *Nest, t *Target, name string) (*Project, error) {
+	p := &Project{
+		Name:   name,
+		Nest:   nest,
+		Target: t,
+	}
+
+	StatusMessage(VERBOSITY_VERBOSE,
+		"Loading project %s for repo %s, target %s\n",
+		name, nest.BasePath, t.Name)
+
+	if err := p.Init(); err != nil {
+		return nil, err
+	} else {
+		return p, nil
+	}
+}
+
+// Get the packages associated with the project
+func (p *Project) GetEggs() []string {
+	return p.Eggs
+}
+
+// Load project configuration
+func (p *Project) loadConfig() error {
+	log.Printf("[DEBUG] Reading Project configuration for %s in %s",
+		p.Name, p.BasePath)
+
+	v, err := ReadConfig(p.BasePath, p.Name)
+	if err != nil {
+		return err
+	}
+
+	t := p.Target
+
+	p.Eggs = GetStringSliceIdentities(v, t.Identities, "project.eggs")
+
+	idents := GetStringSliceIdentities(v, t.Identities, "project.identities")
+	for _, ident := range idents {
+		t.Identities[ident] = p.Name
+	}
+	p.Capabilities = GetStringSliceIdentities(v, t.Identities, "project.caps")
+
+	p.Cflags = GetStringIdentities(v, t.Identities, "project.cflags")
+	p.Lflags = GetStringIdentities(v, t.Identities, "project.lflags")
+	p.Aflags = GetStringIdentities(v, t.Identities, "project.aflags")
+
+	return nil
+}
+
+// Clean the project build, and all packages that were built with the
+// project, if cleanAll is true, then clean everything, not just the current
+// architecture
+func (p *Project) BuildClean(cleanAll bool) error {
+	clutch, err := NewClutch(p.Nest)
+	if err != nil {
+		return err
+	}
+
+	// first, clean packages
+	StatusMessage(VERBOSITY_VERBOSE,
+		"Cleaning all the packages associated with project %s", p.Name)
+	for _, eggName := range p.GetEggs() {
+		err = clutch.BuildClean(p.Target, eggName, cleanAll)
+		if err != nil {
+			return err
+		}
+	}
+
+	// clean the BSP, if it exists
+	if p.Target.Bsp != "" {
+		if err := clutch.BuildClean(p.Target, p.Target.Bsp, cleanAll); err != nil {
+			return err
+		}
+	}
+
+	c, err := NewCompiler(p.Target.GetCompiler(), p.Target.Cdef, p.Target.Name, []string{})
+	if err != nil {
+		return err
+	}
+
+	tName := p.Target.Name
+	if cleanAll {
+		tName = ""
+	}
+
+	if err := c.RecursiveClean(p.BasePath, tName); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Collect all identities and capabilities that project has
+func (p *Project) collectAllDeps(clutch *Clutch, identities map[string]string,
+	capabilities map[string]string) error {
+
+	eggList := p.GetEggs()
+	if eggList == nil {
+		return nil
+	}
+
+	StatusMessage(VERBOSITY_VERBOSE, " Collecting all project dependencies\n")
+
+	t := p.Target
+
+	eggList = append(eggList, t.Dependencies...)
+	if t.Bsp != "" {
+		eggList = append(eggList, t.Bsp)
+	}
+
+	for _, eggName := range eggList {
+		if eggName == "" {
+			continue
+		}
+
+		egg, err := clutch.ResolveEggName(eggName)
+		if err != nil {
+			return err
+		}
+
+		err = egg.collectDependencies(clutch, identities, capabilities)
+		if err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+func (p *Project) clearAllDeps(clutch *Clutch) {
+	eggList := p.GetEggs()
+	if eggList == nil {
+		return
+	}
+
+	t := p.Target
+
+	eggList = append(eggList, t.Dependencies...)
+	if t.Bsp != "" {
+		eggList = append(eggList, t.Bsp)
+	}
+
+	for _, eggName := range eggList {
+		if eggName == "" {
+			continue
+		}
+		egg, err := clutch.ResolveEggName(eggName)
+		if err != nil {
+			return
+		}
+		egg.clearDependencyMarker(clutch)
+	}
+}
+
+// Collect project identities and capabilities, and make target ready for
+// building.
+func (p *Project) collectDeps(clutch *Clutch) error {
+
+	identCount := 0
+	capCount := 0
+
+	t := p.Target
+
+	StatusMessage(VERBOSITY_VERBOSE,
+		"Collecting egg dependencies for project %s\n", p.Name)
+
+	// Need to do this multiple times, until there are no new identities,
+	// capabilities which show up.
+	identities := t.Identities
+	capabilities := map[string]string{}
+	for {
+		err := p.collectAllDeps(clutch, identities, capabilities)
+		if err != nil {
+			return err
+		}
+		newIdentCount := len(identities)
+		newCapCount := len(capabilities)
+		StatusMessage(VERBOSITY_VERBOSE, "Collected idents %d caps %d\n",
+			newIdentCount, newCapCount)
+		if identCount == newIdentCount && capCount == newCapCount {
+			break
+		}
+		p.clearAllDeps(clutch)
+		identCount = newIdentCount
+		capCount = newCapCount
+	}
+
+	return nil
+}
+
+// Build the packages that this project depends on
+// clutch is an initialized package manager, incls is an array of includes to
+// append to (package includes get append as they are built)
+// libs is an array of archive files to append to (package libraries get
+// appended as they are built)
+func (p *Project) buildDeps(clutch *Clutch, incls *[]string,
+	libs *[]string) (map[string]string, error) {
+	eggList := p.GetEggs()
+	if eggList == nil {
+		return nil, nil
+	}
+
+	StatusMessage(VERBOSITY_VERBOSE,
+		"Building egg dependencies for project %s\n", p.Name)
+
+	t := p.Target
+
+	// Append project variables to target variables, so that all package builds
+	// inherit from them
+	eggList = append(eggList, t.Dependencies...)
+	t.Capabilities = append(t.Capabilities, p.Capabilities...)
+	t.Cflags += " " + p.Cflags
+	t.Lflags += " " + p.Lflags
+	t.Aflags += " " + p.Aflags
+
+	deps := map[string]*DependencyRequirement{}
+	reqcaps := map[string]*DependencyRequirement{}
+	caps := map[string]*DependencyRequirement{}
+	capEggs := map[string]string{}
+
+	// inherit project capabilities, mark these capabilities as supported.
+	for _, cName := range t.Capabilities {
+		dr, err := NewDependencyRequirementParseString(cName)
+		if err != nil {
+			return nil, err
+		}
+
+		caps[dr.String()] = dr
+	}
+
+	for _, eggName := range eggList {
+		if eggName == "" {
+			continue
+		}
+
+		egg, err := clutch.ResolveEggName(eggName)
+		if err != nil {
+			return nil, err
+		}
+
+		if err := clutch.CheckEggDeps(egg, deps, reqcaps, caps, capEggs); err != nil {
+			return nil, err
+		}
+	}
+
+	StatusMessage(VERBOSITY_VERBOSE,
+		"Reporting required capabilities for project %s\n", p.Name)
+	for dname, dep := range reqcaps {
+		StatusMessage(VERBOSITY_VERBOSE,
+			"	%s - %s\n", dname, dep.Name)
+	}
+	StatusMessage(VERBOSITY_VERBOSE,
+		"Reporting actual capabilities for project %s\n", p.Name)
+	for dname, dep := range caps {
+		StatusMessage(VERBOSITY_VERBOSE,
+			"	%s - %s ", dname, dep.Name)
+		if capEggs[dname] != "" {
+			StatusMessage(VERBOSITY_VERBOSE,
+				"- %s\n", capEggs[dname])
+		} else {
+			StatusMessage(VERBOSITY_VERBOSE, "\n")
+		}
+	}
+
+	// After processing all the dependencies, verify that the package's
+	// capability requirements are satisfied as well
+	if err := clutch.VerifyCaps(reqcaps, caps); err != nil {
+		return nil, err
+	}
+
+	// now go through and build everything
+	for _, eggName := range eggList {
+		if eggName == "" {
+			continue
+		}
+
+		egg, err := clutch.ResolveEggName(eggName)
+		if err != nil {
+			return nil, err
+		}
+
+		if err = clutch.Build(p.Target, eggName, *incls, libs); err != nil {
+			return nil, err
+		}
+
+		// Don't fail if package did not produce a library file; some packages
+		// are header-only.
+		if lib := clutch.GetEggLib(p.Target, egg); NodeExist(lib) {
+			*libs = append(*libs, lib)
+		}
+
+		*incls = append(*incls, egg.Includes...)
+	}
+
+	return capEggs, nil
+}
+
+// Build the BSP for this project.
+// The BSP is specified by the Target attached to the project.
+// clutch is an initialized egg mgr, containing all the packages
+// incls and libs are pointers to an array of includes and libraries, when buildBsp()
+// builds the BSP, it appends the include directories for the BSP, and the archive file
+// to these variables.
+func (p *Project) buildBsp(clutch *Clutch, incls *[]string,
+	libs *[]string, capEggs map[string]string) (string, error) {
+
+	StatusMessage(VERBOSITY_VERBOSE, "Building BSP %s for project %s\n",
+		p.Target.Bsp, p.Name)
+
+	if p.Target.Bsp == "" {
+		return "", NewNewtError("Must specify a BSP to build project")
+	}
+
+	return buildBsp(p.Target, clutch, incls, libs, capEggs)
+}
+
+// Build the project
+func (p *Project) Build() error {
+	clutch, err := NewClutch(p.Nest)
+	if err != nil {
+		return err
+	}
+
+	// Load the configuration for this target
+	if err := clutch.LoadConfigs(nil, false); err != nil {
+		return err
+	}
+
+	incls := []string{}
+	libs := []string{}
+	linkerScript := ""
+
+	// Collect target identities, libraries to include
+	err = p.collectDeps(clutch)
+	if err != nil {
+		return err
+	}
+
+	// If there is a BSP:
+	//     1. Calculate the include paths that it and its dependencies export.
+	//        This set of include paths is accessible during all subsequent
+	//        builds.
+	//     2. Build the BSP package.
+	if p.Target.Bsp != "" {
+		incls, err = BspIncludePaths(clutch, p.Target)
+		if err != nil {
+			return err
+		}
+	}
+
+	// Build the project dependencies.
+	capEggs, err := p.buildDeps(clutch, &incls, &libs)
+	if err != nil {
+		return err
+	}
+
+	if p.Target.Bsp != "" {
+		linkerScript, err = p.buildBsp(clutch, &incls, &libs, capEggs)
+		if err != nil {
+			return err
+		}
+	}
+
+	// Append project includes
+	projIncls := []string{
+		p.BasePath + "/include/",
+		p.BasePath + "/arch/" + p.Target.Arch + "/include/",
+	}
+
+	incls = append(incls, projIncls...)
+
+	c, err := NewCompiler(p.Target.GetCompiler(), p.Target.Cdef, p.Target.Name,
+		incls)
+	if err != nil {
+		return err
+	}
+
+	c.LinkerScript = linkerScript
+
+	// Add target C flags
+	c.Cflags = CreateCflags(clutch, c, p.Target, p.Cflags)
+
+	os.Chdir(p.BasePath + "/src/")
+	if err = c.Compile("*.c"); err != nil {
+		return err
+	}
+
+	if !NodeNotExist(p.BasePath + "/src/arch/" + p.Target.Arch + "/") {
+		os.Chdir(p.BasePath + "/src/arch/" + p.Target.Arch + "/")
+		if err = c.Compile("*.c"); err != nil {
+			return err
+		}
+	}
+
+	StatusMessage(VERBOSITY_DEFAULT, "Building project %s\n", p.Name)
+
+	// Create binaries in the project bin/ directory, under:
+	// bin/<arch>/
+	binDir := p.BinPath()
+	if NodeNotExist(binDir) {
+		os.MkdirAll(binDir, 0755)
+	}
+
+	options := map[string]bool{"mapFile": c.ldMapFile,
+		"listFile": true, "binFile": true}
+	err = c.CompileElf(binDir+p.Name, options, libs)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Initialize the project, and project definition
+func (p *Project) Init() error {
+	p.BasePath = p.Nest.BasePath + "/project/" + p.Name + "/"
+	if NodeNotExist(p.BasePath) {
+		return NewNewtError("Project directory does not exist")
+	}
+
+	if err := p.loadConfig(); err != nil {
+		return err
+	}
+	return nil
+}
+
+// Return path to target binary
+func (p *Project) BinPath() string {
+	return p.BasePath + "/bin/" + p.Target.Name + "/"
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/cli/remotenest.go
----------------------------------------------------------------------
diff --git a/newt/cli/remotenest.go b/newt/cli/remotenest.go
new file mode 100644
index 0000000..7bd51d7
--- /dev/null
+++ b/newt/cli/remotenest.go
@@ -0,0 +1,121 @@
+/*
+ Copyright 2015 Runtime Inc.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cli
+
+import (
+	"fmt"
+	"os"
+	"path/filepath"
+)
+
+type RemoteNest struct {
+	// Nestsitory associated with the Eggs
+	Nest *Nest
+
+	Clutch *Clutch
+
+	Name string
+
+	RemoteLoc string
+
+	LocalLoc string
+}
+
+// Allocate a new  structure, and initialize it.
+func NewRemoteNest(clutch *Clutch, branch string) (*RemoteNest, error) {
+	remoteNest := &RemoteNest{
+		Name : clutch.Name,
+		RemoteLoc: clutch.RemoteUrl,
+		LocalLoc: "",
+	}
+
+	err := remoteNest.Download(branch)
+	if err != nil {
+		return nil, err
+	}
+	return remoteNest, nil
+}
+
+// Download it
+func (remoteNest *RemoteNest) Download(branch string) error {
+	dl, err := NewDownloader()
+	if err != nil {
+		return err
+	}
+
+	StatusMessage(VERBOSITY_DEFAULT, "Downloading %s from %s/"+
+		"%s...", remoteNest.Name, remoteNest.RemoteLoc, branch)
+
+	dir, err := dl.GetRepo(remoteNest.RemoteLoc, branch)
+	if err != nil {
+		return err
+	}
+
+	StatusMessage(VERBOSITY_DEFAULT, OK_STRING)
+
+	remoteNest.LocalLoc = dir
+
+	nest, err := NewNestWithDir(dir)
+	if err != nil {
+		return err
+	}
+	remoteNest.Nest = nest
+
+	clutch, err := NewClutch(nest)
+	if err != nil {
+		return err
+	}
+
+	err = clutch.LoadConfigs(nil, false)
+	if err != nil {
+		return err
+	}
+	remoteNest.Clutch = clutch
+
+	return nil
+}
+
+func (remoteNest *RemoteNest) ResolveEggName(eggName string) (*Egg, error) {
+	if remoteNest.Clutch == nil {
+		return nil, NewNewtError(fmt.Sprintf("RemoteNest %s not downloaded yet!",
+					remoteNest.Name))
+	}
+	return remoteNest.Clutch.ResolveEggName(eggName)
+}
+
+func (remoteNest *RemoteNest) fetchEgg(eggName string, tgtBase string) error {
+	egg, err := remoteNest.ResolveEggName(eggName)
+	if err != nil {
+		return err
+	}
+
+	StatusMessage(VERBOSITY_DEFAULT, "Installing %s\n", egg.FullName)
+
+	srcDir := filepath.Join(remoteNest.LocalLoc, egg.FullName)
+	tgtDir := filepath.Join(tgtBase, egg.FullName)
+
+	err = CopyDir(srcDir, tgtDir)
+	return err
+}
+
+// Remove local copy
+func (remoteNest *RemoteNest) Remove() error {
+	if remoteNest.LocalLoc != "" {
+		err := os.RemoveAll(remoteNest.LocalLoc)
+		return err
+	}
+	return nil
+}


[16/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/properties_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/properties_test.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/properties_test.go
new file mode 100644
index 0000000..36ff293
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/properties_test.go
@@ -0,0 +1,846 @@
+// Copyright 2013-2014 Frank Schroeder. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package properties
+
+import (
+	"bytes"
+	"flag"
+	"fmt"
+	"math"
+	"os"
+	"strings"
+	"testing"
+	"time"
+
+	. "gopkg.in/check.v1"
+)
+
+func Test(t *testing.T) { TestingT(t) }
+
+type TestSuite struct {
+	prevHandler ErrorHandlerFunc
+}
+
+var (
+	_       = Suite(&TestSuite{})
+	verbose = flag.Bool("verbose", false, "Verbose output")
+)
+
+// --------------------------------------------------------------------
+
+func (s *TestSuite) SetUpSuite(c *C) {
+	s.prevHandler = ErrorHandler
+	ErrorHandler = PanicHandler
+}
+
+// --------------------------------------------------------------------
+
+func (s *TestSuite) TearDownSuite(c *C) {
+	ErrorHandler = s.prevHandler
+}
+
+// ----------------------------------------------------------------------------
+
+// define test cases in the form of
+// {"input", "key1", "value1", "key2", "value2", ...}
+var complexTests = [][]string{
+	// whitespace prefix
+	{" key=value", "key", "value"},     // SPACE prefix
+	{"\fkey=value", "key", "value"},    // FF prefix
+	{"\tkey=value", "key", "value"},    // TAB prefix
+	{" \f\tkey=value", "key", "value"}, // mix prefix
+
+	// multiple keys
+	{"key1=value1\nkey2=value2\n", "key1", "value1", "key2", "value2"},
+	{"key1=value1\rkey2=value2\r", "key1", "value1", "key2", "value2"},
+	{"key1=value1\r\nkey2=value2\r\n", "key1", "value1", "key2", "value2"},
+
+	// blank lines
+	{"\nkey=value\n", "key", "value"},
+	{"\rkey=value\r", "key", "value"},
+	{"\r\nkey=value\r\n", "key", "value"},
+
+	// escaped chars in key
+	{"k\\ ey = value", "k ey", "value"},
+	{"k\\:ey = value", "k:ey", "value"},
+	{"k\\=ey = value", "k=ey", "value"},
+	{"k\\fey = value", "k\fey", "value"},
+	{"k\\ney = value", "k\ney", "value"},
+	{"k\\rey = value", "k\rey", "value"},
+	{"k\\tey = value", "k\tey", "value"},
+
+	// escaped chars in value
+	{"key = v\\ alue", "key", "v alue"},
+	{"key = v\\:alue", "key", "v:alue"},
+	{"key = v\\=alue", "key", "v=alue"},
+	{"key = v\\falue", "key", "v\falue"},
+	{"key = v\\nalue", "key", "v\nalue"},
+	{"key = v\\ralue", "key", "v\ralue"},
+	{"key = v\\talue", "key", "v\talue"},
+
+	// silently dropped escape character
+	{"k\\zey = value", "kzey", "value"},
+	{"key = v\\zalue", "key", "vzalue"},
+
+	// unicode literals
+	{"key\\u2318 = value", "key⌘", "value"},
+	{"k\\u2318ey = value", "k⌘ey", "value"},
+	{"key = value\\u2318", "key", "value⌘"},
+	{"key = valu\\u2318e", "key", "valu⌘e"},
+
+	// multiline values
+	{"key = valueA,\\\n    valueB", "key", "valueA,valueB"},   // SPACE indent
+	{"key = valueA,\\\n\f\f\fvalueB", "key", "valueA,valueB"}, // FF indent
+	{"key = valueA,\\\n\t\t\tvalueB", "key", "valueA,valueB"}, // TAB indent
+	{"key = valueA,\\\n \f\tvalueB", "key", "valueA,valueB"},  // mix indent
+
+	// comments
+	{"# this is a comment\n! and so is this\nkey1=value1\nkey#2=value#2\n\nkey!3=value!3\n# and another one\n! and the final one", "key1", "value1", "key#2", "value#2", "key!3", "value!3"},
+
+	// expansion tests
+	{"key=value\nkey2=${key}", "key", "value", "key2", "value"},
+	{"key=value\nkey2=aa${key}", "key", "value", "key2", "aavalue"},
+	{"key=value\nkey2=${key}bb", "key", "value", "key2", "valuebb"},
+	{"key=value\nkey2=aa${key}bb", "key", "value", "key2", "aavaluebb"},
+	{"key=value\nkey2=${key}\nkey3=${key2}", "key", "value", "key2", "value", "key3", "value"},
+	{"key=${USER}", "key", os.Getenv("USER")},
+	{"key=${USER}\nUSER=value", "key", "value", "USER", "value"},
+}
+
+// ----------------------------------------------------------------------------
+
+var commentTests = []struct {
+	input, key, value string
+	comments          []string
+}{
+	{"key=value", "key", "value", nil},
+	{"#\nkey=value", "key", "value", []string{""}},
+	{"#comment\nkey=value", "key", "value", []string{"comment"}},
+	{"# comment\nkey=value", "key", "value", []string{"comment"}},
+	{"#  comment\nkey=value", "key", "value", []string{"comment"}},
+	{"# comment\n\nkey=value", "key", "value", []string{"comment"}},
+	{"# comment1\n# comment2\nkey=value", "key", "value", []string{"comment1", "comment2"}},
+	{"# comment1\n\n# comment2\n\nkey=value", "key", "value", []string{"comment1", "comment2"}},
+	{"!comment\nkey=value", "key", "value", []string{"comment"}},
+	{"! comment\nkey=value", "key", "value", []string{"comment"}},
+	{"!  comment\nkey=value", "key", "value", []string{"comment"}},
+	{"! comment\n\nkey=value", "key", "value", []string{"comment"}},
+	{"! comment1\n! comment2\nkey=value", "key", "value", []string{"comment1", "comment2"}},
+	{"! comment1\n\n! comment2\n\nkey=value", "key", "value", []string{"comment1", "comment2"}},
+}
+
+// ----------------------------------------------------------------------------
+
+var errorTests = []struct {
+	input, msg string
+}{
+	// unicode literals
+	{"key\\u1 = value", "invalid unicode literal"},
+	{"key\\u12 = value", "invalid unicode literal"},
+	{"key\\u123 = value", "invalid unicode literal"},
+	{"key\\u123g = value", "invalid unicode literal"},
+	{"key\\u123", "invalid unicode literal"},
+
+	// circular references
+	{"key=${key}", "circular reference"},
+	{"key1=${key2}\nkey2=${key1}", "circular reference"},
+
+	// malformed expressions
+	{"key=${ke", "malformed expression"},
+	{"key=valu${ke", "malformed expression"},
+}
+
+// ----------------------------------------------------------------------------
+
+var writeTests = []struct {
+	input, output, encoding string
+}{
+	// ISO-8859-1 tests
+	{"key = value", "key = value\n", "ISO-8859-1"},
+	{"key = value \\\n   continued", "key = value continued\n", "ISO-8859-1"},
+	{"key⌘ = value", "key\\u2318 = value\n", "ISO-8859-1"},
+	{"ke\\ \\:y = value", "ke\\ \\:y = value\n", "ISO-8859-1"},
+
+	// UTF-8 tests
+	{"key = value", "key = value\n", "UTF-8"},
+	{"key = value \\\n   continued", "key = value continued\n", "UTF-8"},
+	{"key⌘ = value⌘", "key⌘ = value⌘\n", "UTF-8"},
+	{"ke\\ \\:y = value", "ke\\ \\:y = value\n", "UTF-8"},
+}
+
+// ----------------------------------------------------------------------------
+
+var writeCommentTests = []struct {
+	input, output, encoding string
+}{
+	// ISO-8859-1 tests
+	{"key = value", "key = value\n", "ISO-8859-1"},
+	{"#\nkey = value", "key = value\n", "ISO-8859-1"},
+	{"#\n#\n#\nkey = value", "key = value\n", "ISO-8859-1"},
+	{"# comment\nkey = value", "# comment\nkey = value\n", "ISO-8859-1"},
+	{"\n# comment\nkey = value", "# comment\nkey = value\n", "ISO-8859-1"},
+	{"# comment\n\nkey = value", "# comment\nkey = value\n", "ISO-8859-1"},
+	{"# comment1\n# comment2\nkey = value", "# comment1\n# comment2\nkey = value\n", "ISO-8859-1"},
+	{"#comment1\nkey1 = value1\n#comment2\nkey2 = value2", "# comment1\nkey1 = value1\n\n# comment2\nkey2 = value2\n", "ISO-8859-1"},
+
+	// UTF-8 tests
+	{"key = value", "key = value\n", "UTF-8"},
+	{"# comment⌘\nkey = value⌘", "# comment⌘\nkey = value⌘\n", "UTF-8"},
+	{"\n# comment⌘\nkey = value⌘", "# comment⌘\nkey = value⌘\n", "UTF-8"},
+	{"# comment⌘\n\nkey = value⌘", "# comment⌘\nkey = value⌘\n", "UTF-8"},
+	{"# comment1⌘\n# comment2⌘\nkey = value⌘", "# comment1⌘\n# comment2⌘\nkey = value⌘\n", "UTF-8"},
+	{"#comment1⌘\nkey1 = value1⌘\n#comment2⌘\nkey2 = value2⌘", "# comment1⌘\nkey1 = value1⌘\n\n# comment2⌘\nkey2 = value2⌘\n", "UTF-8"},
+}
+
+// ----------------------------------------------------------------------------
+
+var boolTests = []struct {
+	input, key string
+	def, value bool
+}{
+	// valid values for TRUE
+	{"key = 1", "key", false, true},
+	{"key = on", "key", false, true},
+	{"key = On", "key", false, true},
+	{"key = ON", "key", false, true},
+	{"key = true", "key", false, true},
+	{"key = True", "key", false, true},
+	{"key = TRUE", "key", false, true},
+	{"key = yes", "key", false, true},
+	{"key = Yes", "key", false, true},
+	{"key = YES", "key", false, true},
+
+	// valid values for FALSE (all other)
+	{"key = 0", "key", true, false},
+	{"key = off", "key", true, false},
+	{"key = false", "key", true, false},
+	{"key = no", "key", true, false},
+
+	// non existent key
+	{"key = true", "key2", false, false},
+}
+
+// ----------------------------------------------------------------------------
+
+var durationTests = []struct {
+	input, key string
+	def, value time.Duration
+}{
+	// valid values
+	{"key = 1", "key", 999, 1},
+	{"key = 0", "key", 999, 0},
+	{"key = -1", "key", 999, -1},
+	{"key = 0123", "key", 999, 123},
+
+	// invalid values
+	{"key = 0xff", "key", 999, 999},
+	{"key = 1.0", "key", 999, 999},
+	{"key = a", "key", 999, 999},
+
+	// non existent key
+	{"key = 1", "key2", 999, 999},
+}
+
+// ----------------------------------------------------------------------------
+
+var parsedDurationTests = []struct {
+	input, key string
+	def, value time.Duration
+}{
+	// valid values
+	{"key = -1ns", "key", 999, -1 * time.Nanosecond},
+	{"key = 300ms", "key", 999, 300 * time.Millisecond},
+	{"key = 5s", "key", 999, 5 * time.Second},
+	{"key = 3h", "key", 999, 3 * time.Hour},
+	{"key = 2h45m", "key", 999, 2*time.Hour + 45*time.Minute},
+
+	// invalid values
+	{"key = 0xff", "key", 999, 999},
+	{"key = 1.0", "key", 999, 999},
+	{"key = a", "key", 999, 999},
+	{"key = 1", "key", 999, 999},
+	{"key = 0", "key", 999, 0},
+
+	// non existent key
+	{"key = 1", "key2", 999, 999},
+}
+
+// ----------------------------------------------------------------------------
+
+var floatTests = []struct {
+	input, key string
+	def, value float64
+}{
+	// valid values
+	{"key = 1.0", "key", 999, 1.0},
+	{"key = 0.0", "key", 999, 0.0},
+	{"key = -1.0", "key", 999, -1.0},
+	{"key = 1", "key", 999, 1},
+	{"key = 0", "key", 999, 0},
+	{"key = -1", "key", 999, -1},
+	{"key = 0123", "key", 999, 123},
+
+	// invalid values
+	{"key = 0xff", "key", 999, 999},
+	{"key = a", "key", 999, 999},
+
+	// non existent key
+	{"key = 1", "key2", 999, 999},
+}
+
+// ----------------------------------------------------------------------------
+
+var int64Tests = []struct {
+	input, key string
+	def, value int64
+}{
+	// valid values
+	{"key = 1", "key", 999, 1},
+	{"key = 0", "key", 999, 0},
+	{"key = -1", "key", 999, -1},
+	{"key = 0123", "key", 999, 123},
+
+	// invalid values
+	{"key = 0xff", "key", 999, 999},
+	{"key = 1.0", "key", 999, 999},
+	{"key = a", "key", 999, 999},
+
+	// non existent key
+	{"key = 1", "key2", 999, 999},
+}
+
+// ----------------------------------------------------------------------------
+
+var uint64Tests = []struct {
+	input, key string
+	def, value uint64
+}{
+	// valid values
+	{"key = 1", "key", 999, 1},
+	{"key = 0", "key", 999, 0},
+	{"key = 0123", "key", 999, 123},
+
+	// invalid values
+	{"key = -1", "key", 999, 999},
+	{"key = 0xff", "key", 999, 999},
+	{"key = 1.0", "key", 999, 999},
+	{"key = a", "key", 999, 999},
+
+	// non existent key
+	{"key = 1", "key2", 999, 999},
+}
+
+// ----------------------------------------------------------------------------
+
+var stringTests = []struct {
+	input, key string
+	def, value string
+}{
+	// valid values
+	{"key = abc", "key", "def", "abc"},
+
+	// non existent key
+	{"key = abc", "key2", "def", "def"},
+}
+
+// ----------------------------------------------------------------------------
+
+var keysTests = []struct {
+	input string
+	keys  []string
+}{
+	{"", []string{}},
+	{"key = abc", []string{"key"}},
+	{"key = abc\nkey2=def", []string{"key", "key2"}},
+	{"key2 = abc\nkey=def", []string{"key2", "key"}},
+	{"key = abc\nkey=def", []string{"key"}},
+}
+
+// ----------------------------------------------------------------------------
+
+var filterTests = []struct {
+	input   string
+	pattern string
+	keys    []string
+	err     string
+}{
+	{"", "", []string{}, ""},
+	{"", "abc", []string{}, ""},
+	{"key=value", "", []string{"key"}, ""},
+	{"key=value", "key=", []string{}, ""},
+	{"key=value\nfoo=bar", "", []string{"foo", "key"}, ""},
+	{"key=value\nfoo=bar", "f", []string{"foo"}, ""},
+	{"key=value\nfoo=bar", "fo", []string{"foo"}, ""},
+	{"key=value\nfoo=bar", "foo", []string{"foo"}, ""},
+	{"key=value\nfoo=bar", "fooo", []string{}, ""},
+	{"key=value\nkey2=value2\nfoo=bar", "ey", []string{"key", "key2"}, ""},
+	{"key=value\nkey2=value2\nfoo=bar", "key", []string{"key", "key2"}, ""},
+	{"key=value\nkey2=value2\nfoo=bar", "^key", []string{"key", "key2"}, ""},
+	{"key=value\nkey2=value2\nfoo=bar", "^(key|foo)", []string{"foo", "key", "key2"}, ""},
+	{"key=value\nkey2=value2\nfoo=bar", "[ abc", nil, "error parsing regexp.*"},
+}
+
+// ----------------------------------------------------------------------------
+
+var filterPrefixTests = []struct {
+	input  string
+	prefix string
+	keys   []string
+}{
+	{"", "", []string{}},
+	{"", "abc", []string{}},
+	{"key=value", "", []string{"key"}},
+	{"key=value", "key=", []string{}},
+	{"key=value\nfoo=bar", "", []string{"foo", "key"}},
+	{"key=value\nfoo=bar", "f", []string{"foo"}},
+	{"key=value\nfoo=bar", "fo", []string{"foo"}},
+	{"key=value\nfoo=bar", "foo", []string{"foo"}},
+	{"key=value\nfoo=bar", "fooo", []string{}},
+	{"key=value\nkey2=value2\nfoo=bar", "key", []string{"key", "key2"}},
+}
+
+// ----------------------------------------------------------------------------
+
+var setTests = []struct {
+	input      string
+	key, value string
+	prev       string
+	ok         bool
+	err        string
+	keys       []string
+}{
+	{"", "", "", "", false, "", []string{}},
+	{"", "key", "value", "", false, "", []string{"key"}},
+	{"key=value", "key2", "value2", "", false, "", []string{"key", "key2"}},
+	{"key=value", "abc", "value3", "", false, "", []string{"key", "abc"}},
+	{"key=value", "key", "value3", "value", true, "", []string{"key"}},
+}
+
+// ----------------------------------------------------------------------------
+
+// TestBasic tests basic single key/value combinations with all possible
+// whitespace, delimiter and newline permutations.
+func (s *TestSuite) TestBasic(c *C) {
+	testWhitespaceAndDelimiterCombinations(c, "key", "")
+	testWhitespaceAndDelimiterCombinations(c, "key", "value")
+	testWhitespaceAndDelimiterCombinations(c, "key", "value   ")
+}
+
+func (s *TestSuite) TestComplex(c *C) {
+	for _, test := range complexTests {
+		testKeyValue(c, test[0], test[1:]...)
+	}
+}
+
+func (s *TestSuite) TestErrors(c *C) {
+	for _, test := range errorTests {
+		_, err := Load([]byte(test.input), ISO_8859_1)
+		c.Assert(err, NotNil)
+		c.Assert(strings.Contains(err.Error(), test.msg), Equals, true, Commentf("Expected %q got %q", test.msg, err.Error()))
+	}
+}
+
+func (s *TestSuite) TestMustGet(c *C) {
+	input := "key = value\nkey2 = ghi"
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGet("key"), Equals, "value")
+	c.Assert(func() { p.MustGet("invalid") }, PanicMatches, "unknown property: invalid")
+}
+
+func (s *TestSuite) TestGetBool(c *C) {
+	for _, test := range boolTests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.Len(), Equals, 1)
+		c.Assert(p.GetBool(test.key, test.def), Equals, test.value)
+	}
+}
+
+func (s *TestSuite) TestMustGetBool(c *C) {
+	input := "key = true\nkey2 = ghi"
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetBool("key"), Equals, true)
+	c.Assert(func() { p.MustGetBool("invalid") }, PanicMatches, "unknown property: invalid")
+}
+
+func (s *TestSuite) TestGetDuration(c *C) {
+	for _, test := range durationTests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.Len(), Equals, 1)
+		c.Assert(p.GetDuration(test.key, test.def), Equals, test.value)
+	}
+}
+
+func (s *TestSuite) TestMustGetDuration(c *C) {
+	input := "key = 123\nkey2 = ghi"
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetDuration("key"), Equals, time.Duration(123))
+	c.Assert(func() { p.MustGetDuration("key2") }, PanicMatches, "strconv.ParseInt: parsing.*")
+	c.Assert(func() { p.MustGetDuration("invalid") }, PanicMatches, "unknown property: invalid")
+}
+
+func (s *TestSuite) TestGetParsedDuration(c *C) {
+	for _, test := range parsedDurationTests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.Len(), Equals, 1)
+		c.Assert(p.GetParsedDuration(test.key, test.def), Equals, test.value)
+	}
+}
+
+func (s *TestSuite) TestMustGetParsedDuration(c *C) {
+	input := "key = 123ms\nkey2 = ghi"
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetParsedDuration("key"), Equals, 123*time.Millisecond)
+	c.Assert(func() { p.MustGetParsedDuration("key2") }, PanicMatches, "time: invalid duration ghi")
+	c.Assert(func() { p.MustGetParsedDuration("invalid") }, PanicMatches, "unknown property: invalid")
+}
+
+func (s *TestSuite) TestGetFloat64(c *C) {
+	for _, test := range floatTests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.Len(), Equals, 1)
+		c.Assert(p.GetFloat64(test.key, test.def), Equals, test.value)
+	}
+}
+
+func (s *TestSuite) TestMustGetFloat64(c *C) {
+	input := "key = 123\nkey2 = ghi"
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetFloat64("key"), Equals, float64(123))
+	c.Assert(func() { p.MustGetFloat64("key2") }, PanicMatches, "strconv.ParseFloat: parsing.*")
+	c.Assert(func() { p.MustGetFloat64("invalid") }, PanicMatches, "unknown property: invalid")
+}
+
+func (s *TestSuite) TestGetInt(c *C) {
+	for _, test := range int64Tests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.Len(), Equals, 1)
+		c.Assert(p.GetInt(test.key, int(test.def)), Equals, int(test.value))
+	}
+}
+
+func (s *TestSuite) TestMustGetInt(c *C) {
+	input := "key = 123\nkey2 = ghi"
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetInt("key"), Equals, int(123))
+	c.Assert(func() { p.MustGetInt("key2") }, PanicMatches, "strconv.ParseInt: parsing.*")
+	c.Assert(func() { p.MustGetInt("invalid") }, PanicMatches, "unknown property: invalid")
+}
+
+func (s *TestSuite) TestGetInt64(c *C) {
+	for _, test := range int64Tests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.Len(), Equals, 1)
+		c.Assert(p.GetInt64(test.key, test.def), Equals, test.value)
+	}
+}
+
+func (s *TestSuite) TestMustGetInt64(c *C) {
+	input := "key = 123\nkey2 = ghi"
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetInt64("key"), Equals, int64(123))
+	c.Assert(func() { p.MustGetInt64("key2") }, PanicMatches, "strconv.ParseInt: parsing.*")
+	c.Assert(func() { p.MustGetInt64("invalid") }, PanicMatches, "unknown property: invalid")
+}
+
+func (s *TestSuite) TestGetUint(c *C) {
+	for _, test := range uint64Tests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.Len(), Equals, 1)
+		c.Assert(p.GetUint(test.key, uint(test.def)), Equals, uint(test.value))
+	}
+}
+
+func (s *TestSuite) TestMustGetUint(c *C) {
+	input := "key = 123\nkey2 = ghi"
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetUint("key"), Equals, uint(123))
+	c.Assert(func() { p.MustGetUint64("key2") }, PanicMatches, "strconv.ParseUint: parsing.*")
+	c.Assert(func() { p.MustGetUint64("invalid") }, PanicMatches, "unknown property: invalid")
+}
+
+func (s *TestSuite) TestGetUint64(c *C) {
+	for _, test := range uint64Tests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.Len(), Equals, 1)
+		c.Assert(p.GetUint64(test.key, test.def), Equals, test.value)
+	}
+}
+
+func (s *TestSuite) TestMustGetUint64(c *C) {
+	input := "key = 123\nkey2 = ghi"
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetUint64("key"), Equals, uint64(123))
+	c.Assert(func() { p.MustGetUint64("key2") }, PanicMatches, "strconv.ParseUint: parsing.*")
+	c.Assert(func() { p.MustGetUint64("invalid") }, PanicMatches, "unknown property: invalid")
+}
+
+func (s *TestSuite) TestGetString(c *C) {
+	for _, test := range stringTests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.Len(), Equals, 1)
+		c.Assert(p.GetString(test.key, test.def), Equals, test.value)
+	}
+}
+
+func (s *TestSuite) TestMustGetString(c *C) {
+	input := `key = value`
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetString("key"), Equals, "value")
+	c.Assert(func() { p.MustGetString("invalid") }, PanicMatches, "unknown property: invalid")
+}
+
+func (s *TestSuite) TestComment(c *C) {
+	for _, test := range commentTests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.MustGetString(test.key), Equals, test.value)
+		c.Assert(p.GetComments(test.key), DeepEquals, test.comments)
+		if test.comments != nil {
+			c.Assert(p.GetComment(test.key), Equals, test.comments[len(test.comments)-1])
+		} else {
+			c.Assert(p.GetComment(test.key), Equals, "")
+		}
+
+		// test setting comments
+		if len(test.comments) > 0 {
+			// set single comment
+			p.ClearComments()
+			c.Assert(len(p.c), Equals, 0)
+			p.SetComment(test.key, test.comments[0])
+			c.Assert(p.GetComment(test.key), Equals, test.comments[0])
+
+			// set multiple comments
+			p.ClearComments()
+			c.Assert(len(p.c), Equals, 0)
+			p.SetComments(test.key, test.comments)
+			c.Assert(p.GetComments(test.key), DeepEquals, test.comments)
+
+			// clear comments for a key
+			p.SetComments(test.key, nil)
+			c.Assert(p.GetComment(test.key), Equals, "")
+			c.Assert(p.GetComments(test.key), IsNil)
+		}
+	}
+}
+
+func (s *TestSuite) TestFilter(c *C) {
+	for _, test := range filterTests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		pp, err := p.Filter(test.pattern)
+		if err != nil {
+			c.Assert(err, ErrorMatches, test.err)
+			continue
+		}
+		c.Assert(pp, NotNil)
+		c.Assert(pp.Len(), Equals, len(test.keys))
+		for _, key := range test.keys {
+			v1, ok1 := p.Get(key)
+			v2, ok2 := pp.Get(key)
+			c.Assert(ok1, Equals, true)
+			c.Assert(ok2, Equals, true)
+			c.Assert(v1, Equals, v2)
+		}
+	}
+}
+
+func (s *TestSuite) TestFilterPrefix(c *C) {
+	for _, test := range filterPrefixTests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		pp := p.FilterPrefix(test.prefix)
+		c.Assert(pp, NotNil)
+		c.Assert(pp.Len(), Equals, len(test.keys))
+		for _, key := range test.keys {
+			v1, ok1 := p.Get(key)
+			v2, ok2 := pp.Get(key)
+			c.Assert(ok1, Equals, true)
+			c.Assert(ok2, Equals, true)
+			c.Assert(v1, Equals, v2)
+		}
+	}
+}
+
+func (s *TestSuite) TestKeys(c *C) {
+	for _, test := range keysTests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		c.Assert(p.Len(), Equals, len(test.keys))
+		c.Assert(len(p.Keys()), Equals, len(test.keys))
+		c.Assert(p.Keys(), DeepEquals, test.keys)
+	}
+}
+
+func (s *TestSuite) TestSet(c *C) {
+	for _, test := range setTests {
+		p, err := parse(test.input)
+		c.Assert(err, IsNil)
+		prev, ok, err := p.Set(test.key, test.value)
+		if test.err != "" {
+			c.Assert(err, ErrorMatches, test.err)
+			continue
+		}
+
+		c.Assert(err, IsNil)
+		c.Assert(ok, Equals, test.ok)
+		if ok {
+			c.Assert(prev, Equals, test.prev)
+		}
+		c.Assert(p.Keys(), DeepEquals, test.keys)
+	}
+}
+
+func (s *TestSuite) TestMustSet(c *C) {
+	input := "key=${key}"
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(func() { p.MustSet("key", "${key}") }, PanicMatches, "circular reference .*")
+}
+
+func (s *TestSuite) TestWrite(c *C) {
+	for _, test := range writeTests {
+		p, err := parse(test.input)
+
+		buf := new(bytes.Buffer)
+		var n int
+		switch test.encoding {
+		case "UTF-8":
+			n, err = p.Write(buf, UTF8)
+		case "ISO-8859-1":
+			n, err = p.Write(buf, ISO_8859_1)
+		}
+		c.Assert(err, IsNil)
+		s := string(buf.Bytes())
+		c.Assert(n, Equals, len(test.output), Commentf("input=%q expected=%q obtained=%q", test.input, test.output, s))
+		c.Assert(s, Equals, test.output, Commentf("input=%q expected=%q obtained=%q", test.input, test.output, s))
+	}
+}
+
+func (s *TestSuite) TestWriteComment(c *C) {
+	for _, test := range writeCommentTests {
+		p, err := parse(test.input)
+
+		buf := new(bytes.Buffer)
+		var n int
+		switch test.encoding {
+		case "UTF-8":
+			n, err = p.WriteComment(buf, "# ", UTF8)
+		case "ISO-8859-1":
+			n, err = p.WriteComment(buf, "# ", ISO_8859_1)
+		}
+		c.Assert(err, IsNil)
+		s := string(buf.Bytes())
+		c.Assert(n, Equals, len(test.output), Commentf("input=%q expected=%q obtained=%q", test.input, test.output, s))
+		c.Assert(s, Equals, test.output, Commentf("input=%q expected=%q obtained=%q", test.input, test.output, s))
+	}
+}
+
+func (s *TestSuite) TestCustomExpansionExpression(c *C) {
+	testKeyValuePrePostfix(c, "*[", "]*", "key=value\nkey2=*[key]*", "key", "value", "key2", "value")
+}
+
+func (s *TestSuite) TestPanicOn32BitIntOverflow(c *C) {
+	is32Bit = true
+	var min, max int64 = math.MinInt32 - 1, math.MaxInt32 + 1
+	input := fmt.Sprintf("min=%d\nmax=%d", min, max)
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetInt64("min"), Equals, min)
+	c.Assert(p.MustGetInt64("max"), Equals, max)
+	c.Assert(func() { p.MustGetInt("min") }, PanicMatches, ".* out of range")
+	c.Assert(func() { p.MustGetInt("max") }, PanicMatches, ".* out of range")
+}
+
+func (s *TestSuite) TestPanicOn32BitUintOverflow(c *C) {
+	is32Bit = true
+	var max = math.MaxUint32 + 1
+	input := fmt.Sprintf("max=%d", max)
+	p, err := parse(input)
+	c.Assert(err, IsNil)
+	c.Assert(p.MustGetUint64("max"), Equals, uint64(max))
+	c.Assert(func() { p.MustGetUint("max") }, PanicMatches, ".* out of range")
+}
+
+// ----------------------------------------------------------------------------
+
+// tests all combinations of delimiters, leading and/or trailing whitespace and newlines.
+func testWhitespaceAndDelimiterCombinations(c *C, key, value string) {
+	whitespace := []string{"", " ", "\f", "\t"}
+	delimiters := []string{"", " ", "=", ":"}
+	newlines := []string{"", "\r", "\n", "\r\n"}
+	for _, dl := range delimiters {
+		for _, ws1 := range whitespace {
+			for _, ws2 := range whitespace {
+				for _, nl := range newlines {
+					// skip the one case where there is nothing between a key and a value
+					if ws1 == "" && dl == "" && ws2 == "" && value != "" {
+						continue
+					}
+
+					input := fmt.Sprintf("%s%s%s%s%s%s", key, ws1, dl, ws2, value, nl)
+					testKeyValue(c, input, key, value)
+				}
+			}
+		}
+	}
+}
+
+// tests whether key/value pairs exist for a given input.
+// keyvalues is expected to be an even number of strings of "key", "value", ...
+func testKeyValue(c *C, input string, keyvalues ...string) {
+	testKeyValuePrePostfix(c, "${", "}", input, keyvalues...)
+}
+
+// tests whether key/value pairs exist for a given input.
+// keyvalues is expected to be an even number of strings of "key", "value", ...
+func testKeyValuePrePostfix(c *C, prefix, postfix, input string, keyvalues ...string) {
+	printf("%q\n", input)
+
+	p, err := Load([]byte(input), ISO_8859_1)
+	c.Assert(err, IsNil)
+	p.Prefix = prefix
+	p.Postfix = postfix
+	assertKeyValues(c, input, p, keyvalues...)
+}
+
+// tests whether key/value pairs exist for a given input.
+// keyvalues is expected to be an even number of strings of "key", "value", ...
+func assertKeyValues(c *C, input string, p *Properties, keyvalues ...string) {
+	c.Assert(p, NotNil)
+	c.Assert(2*p.Len(), Equals, len(keyvalues), Commentf("Odd number of key/value pairs."))
+
+	for i := 0; i < len(keyvalues); i += 2 {
+		key, value := keyvalues[i], keyvalues[i+1]
+		v, ok := p.Get(key)
+		c.Assert(ok, Equals, true, Commentf("No key %q found (input=%q)", key, input))
+		c.Assert(v, Equals, value, Commentf("Value %q does not match %q (input=%q)", v, value, input))
+	}
+}
+
+// prints to stderr if the -verbose flag was given.
+func printf(format string, args ...interface{}) {
+	if *verbose {
+		fmt.Fprintf(os.Stderr, format, args...)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/magiconair/properties/rangecheck.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/rangecheck.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/rangecheck.go
new file mode 100644
index 0000000..6df4e6c
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/magiconair/properties/rangecheck.go
@@ -0,0 +1,31 @@
+// Copyright 2013-2014 Frank Schroeder. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package properties
+
+import (
+	"fmt"
+	"math"
+)
+
+// make this a var to overwrite it in a test
+var is32Bit = ^uint(0) == math.MaxUint32
+
+// intRangeCheck checks if the value fits into the int type and
+// panics if it does not.
+func intRangeCheck(key string, v int64) int {
+	if is32Bit && (v < math.MinInt32 || v > math.MaxInt32) {
+		panic(fmt.Sprintf("Value %d for key %s out of range", v, key))
+	}
+	return int(v)
+}
+
+// uintRangeCheck checks if the value fits into the uint type and
+// panics if it does not.
+func uintRangeCheck(key string, v uint64) uint {
+	if is32Bit && v > math.MaxUint32 {
+		panic(fmt.Sprintf("Value %d for key %s out of range", v, key))
+	}
+	return uint(v)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.gitignore
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.gitignore b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.gitignore
new file mode 100644
index 0000000..bf90dfd
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.gitignore
@@ -0,0 +1,3 @@
+*.db
+*.exe
+*.dll

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.travis.yml
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.travis.yml b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.travis.yml
new file mode 100644
index 0000000..ac7bfea
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/.travis.yml
@@ -0,0 +1,9 @@
+language: go
+go:
+  - tip
+before_install:
+  - go get github.com/axw/gocov/gocov
+  - go get github.com/mattn/goveralls
+  - go get golang.org/x/tools/cmd/cover
+script:
+    - $HOME/gopath/bin/goveralls -repotoken 3qJVUE0iQwqnCbmNcDsjYu1nh4J4KIFXx

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/LICENSE
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/LICENSE b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/LICENSE
new file mode 100644
index 0000000..ca458bb
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Yasuhiro Matsumoto
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/README.md
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/README.md b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/README.md
new file mode 100644
index 0000000..4383f0c
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/README.md
@@ -0,0 +1,62 @@
+go-sqlite3
+==========
+
+[![Build Status](https://travis-ci.org/mattn/go-sqlite3.png?branch=master)](https://travis-ci.org/mattn/go-sqlite3)
+[![Coverage Status](https://coveralls.io/repos/mattn/go-sqlite3/badge.png?branch=master)](https://coveralls.io/r/mattn/go-sqlite3?branch=master)
+
+Description
+-----------
+
+sqlite3 driver conforming to the built-in database/sql interface
+
+Installation
+------------
+
+This package can be installed with the go get command:
+
+    go get github.com/mattn/go-sqlite3
+    
+Documentation
+-------------
+
+API documentation can be found here: http://godoc.org/github.com/mattn/go-sqlite3
+
+Examples can be found under the `./_example` directory
+
+FAQ
+---
+
+* Can't build go-sqlite3 on windows 64bit.
+
+    > Probably, you are using go 1.0, go1.0 has a problem when it comes to compiling/linking on windows 64bit. 
+    > See: https://github.com/mattn/go-sqlite3/issues/27
+
+* Getting insert error while query is opened.
+
+    > You can pass some arguments into the connection string, for example, a URI.
+    > See: https://github.com/mattn/go-sqlite3/issues/39
+
+* Do you want cross compiling? mingw on Linux or Mac?
+
+    > See: https://github.com/mattn/go-sqlite3/issues/106
+    > See also: http://www.limitlessfx.com/cross-compile-golang-app-for-windows-from-linux.html
+
+* Want to get time.Time with current locale
+
+    Use `loc=auto` in SQLite3 filename schema like `file:foo.db?loc=auto`.
+
+License
+-------
+
+MIT: http://mattn.mit-license.org/2012
+
+sqlite3-binding.c, sqlite3-binding.h, sqlite3ext.h
+
+The -binding suffix was added to avoid build failures under gccgo.
+
+In this repository, those files are amalgamation code that copied from SQLite3. The license of those codes are depend on the license of SQLite3.
+
+Author
+------
+
+Yasuhiro Matsumoto (a.k.a mattn)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/backup.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/backup.go b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/backup.go
new file mode 100644
index 0000000..3807c60
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/backup.go
@@ -0,0 +1,70 @@
+// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package sqlite3
+
+/*
+#include <sqlite3-binding.h>
+#include <stdlib.h>
+*/
+import "C"
+import (
+	"runtime"
+	"unsafe"
+)
+
+type SQLiteBackup struct {
+	b *C.sqlite3_backup
+}
+
+func (c *SQLiteConn) Backup(dest string, conn *SQLiteConn, src string) (*SQLiteBackup, error) {
+	destptr := C.CString(dest)
+	defer C.free(unsafe.Pointer(destptr))
+	srcptr := C.CString(src)
+	defer C.free(unsafe.Pointer(srcptr))
+
+	if b := C.sqlite3_backup_init(c.db, destptr, conn.db, srcptr); b != nil {
+		bb := &SQLiteBackup{b: b}
+		runtime.SetFinalizer(bb, (*SQLiteBackup).Finish)
+		return bb, nil
+	}
+	return nil, c.lastError()
+}
+
+// Backs up for one step. Calls the underlying `sqlite3_backup_step` function.
+// This function returns a boolean indicating if the backup is done and
+// an error signalling any other error. Done is returned if the underlying C
+// function returns SQLITE_DONE (Code 101)
+func (b *SQLiteBackup) Step(p int) (bool, error) {
+	ret := C.sqlite3_backup_step(b.b, C.int(p))
+	if ret == C.SQLITE_DONE {
+		return true, nil
+	} else if ret != 0 && ret != C.SQLITE_LOCKED && ret != C.SQLITE_BUSY {
+		return false, Error{Code: ErrNo(ret)}
+	}
+	return false, nil
+}
+
+func (b *SQLiteBackup) Remaining() int {
+	return int(C.sqlite3_backup_remaining(b.b))
+}
+
+func (b *SQLiteBackup) PageCount() int {
+	return int(C.sqlite3_backup_pagecount(b.b))
+}
+
+func (b *SQLiteBackup) Finish() error {
+	return b.Close()
+}
+
+func (b *SQLiteBackup) Close() error {
+	ret := C.sqlite3_backup_finish(b.b)
+	if ret != 0 {
+		return Error{Code: ErrNo(ret)}
+	}
+	b.b = nil
+	runtime.SetFinalizer(b, nil)
+	return nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/doc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/doc.go b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/doc.go
new file mode 100644
index 0000000..51364c3
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/doc.go
@@ -0,0 +1,95 @@
+/*
+Package sqlite3 provides interface to SQLite3 databases.
+
+This works as driver for database/sql.
+
+Installation
+
+    go get github.com/mattn/go-sqlite3
+
+Supported Types
+
+Currently, go-sqlite3 support following data types.
+
+    +------------------------------+
+    |go        | sqlite3           |
+    |----------|-------------------|
+    |nil       | null              |
+    |int       | integer           |
+    |int64     | integer           |
+    |float64   | float             |
+    |bool      | integer           |
+    |[]byte    | blob              |
+    |string    | text              |
+    |time.Time | timestamp/datetime|
+    +------------------------------+
+
+SQLite3 Extension
+
+You can write your own extension module for sqlite3. For example, below is a
+extension for Regexp matcher operation.
+
+    #include <pcre.h>
+    #include <string.h>
+    #include <stdio.h>
+    #include <sqlite3ext.h>
+    
+    SQLITE_EXTENSION_INIT1
+    static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) {
+      if (argc >= 2) {
+        const char *target  = (const char *)sqlite3_value_text(argv[1]);
+        const char *pattern = (const char *)sqlite3_value_text(argv[0]);
+        const char* errstr = NULL;
+        int erroff = 0;
+        int vec[500];
+        int n, rc;
+        pcre* re = pcre_compile(pattern, 0, &errstr, &erroff, NULL);
+        rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500); 
+        if (rc <= 0) {
+          sqlite3_result_error(context, errstr, 0);
+          return;
+        }
+        sqlite3_result_int(context, 1);
+      }
+    }
+    
+    #ifdef _WIN32
+    __declspec(dllexport)
+    #endif
+    int sqlite3_extension_init(sqlite3 *db, char **errmsg,
+          const sqlite3_api_routines *api) {
+      SQLITE_EXTENSION_INIT2(api);
+      return sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8,
+          (void*)db, regexp_func, NULL, NULL);
+    }
+
+It need to build as so/dll shared library. And you need to register
+extension module like below.
+
+	sql.Register("sqlite3_with_extensions",
+		&sqlite3.SQLiteDriver{
+			Extensions: []string{
+				"sqlite3_mod_regexp",
+			},
+		})
+
+Then, you can use this extension.
+
+	rows, err := db.Query("select text from mytable where name regexp '^golang'")
+
+Connection Hook
+
+You can hook and inject your codes when connection established. database/sql
+doesn't provide the way to get native go-sqlite3 interfaces. So if you want,
+you need to hook ConnectHook and get the SQLiteConn.
+
+	sql.Register("sqlite3_with_hook_example",
+			&sqlite3.SQLiteDriver{
+					ConnectHook: func(conn *sqlite3.SQLiteConn) error {
+						sqlite3conn = append(sqlite3conn, conn)
+						return nil
+					},
+			})
+
+*/
+package sqlite3

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error.go b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error.go
new file mode 100644
index 0000000..b910108
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error.go
@@ -0,0 +1,128 @@
+// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package sqlite3
+
+import "C"
+
+type ErrNo int
+
+const ErrNoMask C.int = 0xff
+
+type ErrNoExtended int
+
+type Error struct {
+	Code         ErrNo         /* The error code returned by SQLite */
+	ExtendedCode ErrNoExtended /* The extended error code returned by SQLite */
+	err          string        /* The error string returned by sqlite3_errmsg(),
+	this usually contains more specific details. */
+}
+
+// result codes from http://www.sqlite.org/c3ref/c_abort.html
+var (
+	ErrError      = ErrNo(1)  /* SQL error or missing database */
+	ErrInternal   = ErrNo(2)  /* Internal logic error in SQLite */
+	ErrPerm       = ErrNo(3)  /* Access permission denied */
+	ErrAbort      = ErrNo(4)  /* Callback routine requested an abort */
+	ErrBusy       = ErrNo(5)  /* The database file is locked */
+	ErrLocked     = ErrNo(6)  /* A table in the database is locked */
+	ErrNomem      = ErrNo(7)  /* A malloc() failed */
+	ErrReadonly   = ErrNo(8)  /* Attempt to write a readonly database */
+	ErrInterrupt  = ErrNo(9)  /* Operation terminated by sqlite3_interrupt() */
+	ErrIoErr      = ErrNo(10) /* Some kind of disk I/O error occurred */
+	ErrCorrupt    = ErrNo(11) /* The database disk image is malformed */
+	ErrNotFound   = ErrNo(12) /* Unknown opcode in sqlite3_file_control() */
+	ErrFull       = ErrNo(13) /* Insertion failed because database is full */
+	ErrCantOpen   = ErrNo(14) /* Unable to open the database file */
+	ErrProtocol   = ErrNo(15) /* Database lock protocol error */
+	ErrEmpty      = ErrNo(16) /* Database is empty */
+	ErrSchema     = ErrNo(17) /* The database schema changed */
+	ErrTooBig     = ErrNo(18) /* String or BLOB exceeds size limit */
+	ErrConstraint = ErrNo(19) /* Abort due to constraint violation */
+	ErrMismatch   = ErrNo(20) /* Data type mismatch */
+	ErrMisuse     = ErrNo(21) /* Library used incorrectly */
+	ErrNoLFS      = ErrNo(22) /* Uses OS features not supported on host */
+	ErrAuth       = ErrNo(23) /* Authorization denied */
+	ErrFormat     = ErrNo(24) /* Auxiliary database format error */
+	ErrRange      = ErrNo(25) /* 2nd parameter to sqlite3_bind out of range */
+	ErrNotADB     = ErrNo(26) /* File opened that is not a database file */
+	ErrNotice     = ErrNo(27) /* Notifications from sqlite3_log() */
+	ErrWarning    = ErrNo(28) /* Warnings from sqlite3_log() */
+)
+
+func (err ErrNo) Error() string {
+	return Error{Code: err}.Error()
+}
+
+func (err ErrNo) Extend(by int) ErrNoExtended {
+	return ErrNoExtended(int(err) | (by << 8))
+}
+
+func (err ErrNoExtended) Error() string {
+	return Error{Code: ErrNo(C.int(err) & ErrNoMask), ExtendedCode: err}.Error()
+}
+
+func (err Error) Error() string {
+	if err.err != "" {
+		return err.err
+	}
+	return errorString(err)
+}
+
+// result codes from http://www.sqlite.org/c3ref/c_abort_rollback.html
+var (
+	ErrIoErrRead              = ErrIoErr.Extend(1)
+	ErrIoErrShortRead         = ErrIoErr.Extend(2)
+	ErrIoErrWrite             = ErrIoErr.Extend(3)
+	ErrIoErrFsync             = ErrIoErr.Extend(4)
+	ErrIoErrDirFsync          = ErrIoErr.Extend(5)
+	ErrIoErrTruncate          = ErrIoErr.Extend(6)
+	ErrIoErrFstat             = ErrIoErr.Extend(7)
+	ErrIoErrUnlock            = ErrIoErr.Extend(8)
+	ErrIoErrRDlock            = ErrIoErr.Extend(9)
+	ErrIoErrDelete            = ErrIoErr.Extend(10)
+	ErrIoErrBlocked           = ErrIoErr.Extend(11)
+	ErrIoErrNoMem             = ErrIoErr.Extend(12)
+	ErrIoErrAccess            = ErrIoErr.Extend(13)
+	ErrIoErrCheckReservedLock = ErrIoErr.Extend(14)
+	ErrIoErrLock              = ErrIoErr.Extend(15)
+	ErrIoErrClose             = ErrIoErr.Extend(16)
+	ErrIoErrDirClose          = ErrIoErr.Extend(17)
+	ErrIoErrSHMOpen           = ErrIoErr.Extend(18)
+	ErrIoErrSHMSize           = ErrIoErr.Extend(19)
+	ErrIoErrSHMLock           = ErrIoErr.Extend(20)
+	ErrIoErrSHMMap            = ErrIoErr.Extend(21)
+	ErrIoErrSeek              = ErrIoErr.Extend(22)
+	ErrIoErrDeleteNoent       = ErrIoErr.Extend(23)
+	ErrIoErrMMap              = ErrIoErr.Extend(24)
+	ErrIoErrGetTempPath       = ErrIoErr.Extend(25)
+	ErrIoErrConvPath          = ErrIoErr.Extend(26)
+	ErrLockedSharedCache      = ErrLocked.Extend(1)
+	ErrBusyRecovery           = ErrBusy.Extend(1)
+	ErrBusySnapshot           = ErrBusy.Extend(2)
+	ErrCantOpenNoTempDir      = ErrCantOpen.Extend(1)
+	ErrCantOpenIsDir          = ErrCantOpen.Extend(2)
+	ErrCantOpenFullPath       = ErrCantOpen.Extend(3)
+	ErrCantOpenConvPath       = ErrCantOpen.Extend(4)
+	ErrCorruptVTab            = ErrCorrupt.Extend(1)
+	ErrReadonlyRecovery       = ErrReadonly.Extend(1)
+	ErrReadonlyCantLock       = ErrReadonly.Extend(2)
+	ErrReadonlyRollback       = ErrReadonly.Extend(3)
+	ErrReadonlyDbMoved        = ErrReadonly.Extend(4)
+	ErrAbortRollback          = ErrAbort.Extend(2)
+	ErrConstraintCheck        = ErrConstraint.Extend(1)
+	ErrConstraintCommitHook   = ErrConstraint.Extend(2)
+	ErrConstraintForeignKey   = ErrConstraint.Extend(3)
+	ErrConstraintFunction     = ErrConstraint.Extend(4)
+	ErrConstraintNotNull      = ErrConstraint.Extend(5)
+	ErrConstraintPrimaryKey   = ErrConstraint.Extend(6)
+	ErrConstraintTrigger      = ErrConstraint.Extend(7)
+	ErrConstraintUnique       = ErrConstraint.Extend(8)
+	ErrConstraintVTab         = ErrConstraint.Extend(9)
+	ErrConstraintRowId        = ErrConstraint.Extend(10)
+	ErrNoticeRecoverWAL       = ErrNotice.Extend(1)
+	ErrNoticeRecoverRollback  = ErrNotice.Extend(2)
+	ErrWarningAutoIndex       = ErrWarning.Extend(1)
+)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error_test.go b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error_test.go
new file mode 100644
index 0000000..1ccbe5b
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/mattn/go-sqlite3/error_test.go
@@ -0,0 +1,242 @@
+// Copyright (C) 2014 Yasuhiro Matsumoto <ma...@gmail.com>.
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package sqlite3
+
+import (
+	"database/sql"
+	"io/ioutil"
+	"os"
+	"path"
+	"testing"
+)
+
+func TestSimpleError(t *testing.T) {
+	e := ErrError.Error()
+	if e != "SQL logic error or missing database" {
+		t.Error("wrong error code:" + e)
+	}
+}
+
+func TestCorruptDbErrors(t *testing.T) {
+	dirName, err := ioutil.TempDir("", "sqlite3")
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer os.RemoveAll(dirName)
+
+	dbFileName := path.Join(dirName, "test.db")
+	f, err := os.Create(dbFileName)
+	if err != nil {
+		t.Error(err)
+	}
+	f.Write([]byte{1, 2, 3, 4, 5})
+	f.Close()
+
+	db, err := sql.Open("sqlite3", dbFileName)
+	if err == nil {
+		_, err = db.Exec("drop table foo")
+	}
+
+	sqliteErr := err.(Error)
+	if sqliteErr.Code != ErrNotADB {
+		t.Error("wrong error code for corrupted DB")
+	}
+	if err.Error() == "" {
+		t.Error("wrong error string for corrupted DB")
+	}
+	db.Close()
+}
+
+func TestSqlLogicErrors(t *testing.T) {
+	dirName, err := ioutil.TempDir("", "sqlite3")
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer os.RemoveAll(dirName)
+
+	dbFileName := path.Join(dirName, "test.db")
+	db, err := sql.Open("sqlite3", dbFileName)
+	if err != nil {
+		t.Error(err)
+	}
+	defer db.Close()
+
+	_, err = db.Exec("CREATE TABLE Foo (id INTEGER PRIMARY KEY)")
+	if err != nil {
+		t.Error(err)
+	}
+
+	const expectedErr = "table Foo already exists"
+	_, err = db.Exec("CREATE TABLE Foo (id INTEGER PRIMARY KEY)")
+	if err.Error() != expectedErr {
+		t.Errorf("Unexpected error: %s, expected %s", err.Error(), expectedErr)
+	}
+
+}
+
+func TestExtendedErrorCodes_ForeignKey(t *testing.T) {
+	dirName, err := ioutil.TempDir("", "sqlite3-err")
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer os.RemoveAll(dirName)
+
+	dbFileName := path.Join(dirName, "test.db")
+	db, err := sql.Open("sqlite3", dbFileName)
+	if err != nil {
+		t.Error(err)
+	}
+	defer db.Close()
+
+	_, err = db.Exec("PRAGMA foreign_keys=ON;")
+	if err != nil {
+		t.Errorf("PRAGMA foreign_keys=ON: %v", err)
+	}
+
+	_, err = db.Exec(`CREATE TABLE Foo (
+		id INTEGER PRIMARY KEY AUTOINCREMENT,
+		value INTEGER NOT NULL,
+		ref INTEGER NULL REFERENCES Foo (id),
+		UNIQUE(value)
+	);`)
+	if err != nil {
+		t.Error(err)
+	}
+
+	_, err = db.Exec("INSERT INTO Foo (ref, value) VALUES (100, 100);")
+	if err == nil {
+		t.Error("No error!")
+	} else {
+		sqliteErr := err.(Error)
+		if sqliteErr.Code != ErrConstraint {
+			t.Errorf("Wrong basic error code: %d != %d",
+				sqliteErr.Code, ErrConstraint)
+		}
+		if sqliteErr.ExtendedCode != ErrConstraintForeignKey {
+			t.Errorf("Wrong extended error code: %d != %d",
+				sqliteErr.ExtendedCode, ErrConstraintForeignKey)
+		}
+	}
+
+}
+
+func TestExtendedErrorCodes_NotNull(t *testing.T) {
+	dirName, err := ioutil.TempDir("", "sqlite3-err")
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer os.RemoveAll(dirName)
+
+	dbFileName := path.Join(dirName, "test.db")
+	db, err := sql.Open("sqlite3", dbFileName)
+	if err != nil {
+		t.Error(err)
+	}
+	defer db.Close()
+
+	_, err = db.Exec("PRAGMA foreign_keys=ON;")
+	if err != nil {
+		t.Errorf("PRAGMA foreign_keys=ON: %v", err)
+	}
+
+	_, err = db.Exec(`CREATE TABLE Foo (
+		id INTEGER PRIMARY KEY AUTOINCREMENT,
+		value INTEGER NOT NULL,
+		ref INTEGER NULL REFERENCES Foo (id),
+		UNIQUE(value)
+	);`)
+	if err != nil {
+		t.Error(err)
+	}
+
+	res, err := db.Exec("INSERT INTO Foo (value) VALUES (100);")
+	if err != nil {
+		t.Fatalf("Creating first row: %v", err)
+	}
+
+	id, err := res.LastInsertId()
+	if err != nil {
+		t.Fatalf("Retrieving last insert id: %v", err)
+	}
+
+	_, err = db.Exec("INSERT INTO Foo (ref) VALUES (?);", id)
+	if err == nil {
+		t.Error("No error!")
+	} else {
+		sqliteErr := err.(Error)
+		if sqliteErr.Code != ErrConstraint {
+			t.Errorf("Wrong basic error code: %d != %d",
+				sqliteErr.Code, ErrConstraint)
+		}
+		if sqliteErr.ExtendedCode != ErrConstraintNotNull {
+			t.Errorf("Wrong extended error code: %d != %d",
+				sqliteErr.ExtendedCode, ErrConstraintNotNull)
+		}
+	}
+
+}
+
+func TestExtendedErrorCodes_Unique(t *testing.T) {
+	dirName, err := ioutil.TempDir("", "sqlite3-err")
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer os.RemoveAll(dirName)
+
+	dbFileName := path.Join(dirName, "test.db")
+	db, err := sql.Open("sqlite3", dbFileName)
+	if err != nil {
+		t.Error(err)
+	}
+	defer db.Close()
+
+	_, err = db.Exec("PRAGMA foreign_keys=ON;")
+	if err != nil {
+		t.Errorf("PRAGMA foreign_keys=ON: %v", err)
+	}
+
+	_, err = db.Exec(`CREATE TABLE Foo (
+		id INTEGER PRIMARY KEY AUTOINCREMENT,
+		value INTEGER NOT NULL,
+		ref INTEGER NULL REFERENCES Foo (id),
+		UNIQUE(value)
+	);`)
+	if err != nil {
+		t.Error(err)
+	}
+
+	res, err := db.Exec("INSERT INTO Foo (value) VALUES (100);")
+	if err != nil {
+		t.Fatalf("Creating first row: %v", err)
+	}
+
+	id, err := res.LastInsertId()
+	if err != nil {
+		t.Fatalf("Retrieving last insert id: %v", err)
+	}
+
+	_, err = db.Exec("INSERT INTO Foo (ref, value) VALUES (?, 100);", id)
+	if err == nil {
+		t.Error("No error!")
+	} else {
+		sqliteErr := err.(Error)
+		if sqliteErr.Code != ErrConstraint {
+			t.Errorf("Wrong basic error code: %d != %d",
+				sqliteErr.Code, ErrConstraint)
+		}
+		if sqliteErr.ExtendedCode != ErrConstraintUnique {
+			t.Errorf("Wrong extended error code: %d != %d",
+				sqliteErr.ExtendedCode, ErrConstraintUnique)
+		}
+		extended := sqliteErr.Code.Extend(3).Error()
+		expected := "constraint failed"
+		if extended != expected {
+			t.Errorf("Wrong basic error code: %q != %q",
+				extended, expected)
+		}
+	}
+
+}


[09/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/flag.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/flag.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/flag.go
new file mode 100644
index 0000000..865259b
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/flag.go
@@ -0,0 +1,749 @@
+// 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.
+
+/*
+	pflag is a drop-in replacement for Go's flag package, implementing
+	POSIX/GNU-style --flags.
+
+	pflag is compatible with the GNU extensions to the POSIX recommendations
+	for command-line options. See
+	http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
+
+	Usage:
+
+	pflag is a drop-in replacement of Go's native flag package. If you import
+	pflag under the name "flag" then all code should continue to function
+	with no changes.
+
+		import flag "github.com/ogier/pflag"
+
+	There is one exception to this: if you directly instantiate the Flag struct
+	there is one more field "Shorthand" that you will need to set.
+	Most code never instantiates this struct directly, and instead uses
+	functions such as String(), BoolVar(), and Var(), and is therefore
+	unaffected.
+
+	Define flags using flag.String(), Bool(), Int(), etc.
+
+	This declares an integer flag, -flagname, stored in the pointer ip, with type *int.
+		var ip = flag.Int("flagname", 1234, "help message for flagname")
+	If you like, you can bind the flag to a variable using the Var() functions.
+		var flagvar int
+		func init() {
+			flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname")
+		}
+	Or you can create custom flags that satisfy the Value interface (with
+	pointer receivers) and couple them to flag parsing by
+		flag.Var(&flagVal, "name", "help message for flagname")
+	For such flags, the default value is just the initial value of the variable.
+
+	After all flags are defined, call
+		flag.Parse()
+	to parse the command line into the defined flags.
+
+	Flags may then be used directly. If you're using the flags themselves,
+	they are all pointers; if you bind to variables, they're values.
+		fmt.Println("ip has value ", *ip)
+		fmt.Println("flagvar has value ", flagvar)
+
+	After parsing, the arguments after the flag are available as the
+	slice flag.Args() or individually as flag.Arg(i).
+	The arguments are indexed from 0 through flag.NArg()-1.
+
+	The pflag package also defines some new functions that are not in flag,
+	that give one-letter shorthands for flags. You can use these by appending
+	'P' to the name of any function that defines a flag.
+		var ip = flag.IntP("flagname", "f", 1234, "help message")
+		var flagvar bool
+		func init() {
+			flag.BoolVarP("boolname", "b", true, "help message")
+		}
+		flag.VarP(&flagVar, "varname", "v", 1234, "help message")
+	Shorthand letters can be used with single dashes on the command line.
+	Boolean shorthand flags can be combined with other shorthand flags.
+
+	Command line flag syntax:
+		--flag    // boolean flags only
+		--flag=x
+
+	Unlike the flag package, a single dash before an option means something
+	different than a double dash. Single dashes signify a series of shorthand
+	letters for flags. All but the last shorthand letter must be boolean flags.
+		// boolean flags
+		-f
+		-abc
+		// non-boolean flags
+		-n 1234
+		-Ifile
+		// mixed
+		-abcs "hello"
+		-abcn1234
+
+	Flag parsing stops after the terminator "--". Unlike the flag package,
+	flags can be interspersed with arguments anywhere on the command line
+	before this terminator.
+
+	Integer flags accept 1234, 0664, 0x1234 and may be negative.
+	Boolean flags (in their long form) accept 1, 0, t, f, true, false,
+	TRUE, FALSE, True, False.
+	Duration flags accept any input valid for time.ParseDuration.
+
+	The default set of command-line flags is controlled by
+	top-level functions.  The FlagSet type allows one to define
+	independent sets of flags, such as to implement subcommands
+	in a command-line interface. The methods of FlagSet are
+	analogous to the top-level functions for the command-line
+	flag set.
+*/
+package pflag
+
+import (
+	"bytes"
+	"errors"
+	"fmt"
+	"io"
+	"os"
+	"sort"
+	"strings"
+)
+
+// ErrHelp is the error returned if the flag -help is invoked but no such flag is defined.
+var ErrHelp = errors.New("pflag: help requested")
+
+// ErrorHandling defines how to handle flag parsing errors.
+type ErrorHandling int
+
+const (
+	ContinueOnError ErrorHandling = iota
+	ExitOnError
+	PanicOnError
+)
+
+// NormalizedName is a flag name that has been normalized according to rules
+// for the FlagSet (e.g. making '-' and '_' equivalent).
+type NormalizedName string
+
+// A FlagSet represents a set of defined flags.
+type FlagSet struct {
+	// Usage is the function called when an error occurs while parsing flags.
+	// The field is a function (not a method) that may be changed to point to
+	// a custom error handler.
+	Usage func()
+
+	name              string
+	parsed            bool
+	actual            map[NormalizedName]*Flag
+	formal            map[NormalizedName]*Flag
+	shorthands        map[byte]*Flag
+	args              []string // arguments after flags
+	exitOnError       bool     // does the program exit if there's an error?
+	errorHandling     ErrorHandling
+	output            io.Writer // nil means stderr; use out() accessor
+	interspersed      bool      // allow interspersed option/non-option args
+	normalizeNameFunc func(f *FlagSet, name string) NormalizedName
+}
+
+// A Flag represents the state of a flag.
+type Flag struct {
+	Name        string              // name as it appears on command line
+	Shorthand   string              // one-letter abbreviated flag
+	Usage       string              // help message
+	Value       Value               // value as set
+	DefValue    string              // default value (as text); for usage message
+	Changed     bool                // If the user set the value (or if left to default)
+	NoOptDefVal string              //default value (as text); if the flag is on the command line without any options
+	Deprecated  string              // If this flag is deprecated, this string is the new or now thing to use
+	Annotations map[string][]string // used by cobra.Command  bash autocomple code
+}
+
+// Value is the interface to the dynamic value stored in a flag.
+// (The default value is represented as a string.)
+type Value interface {
+	String() string
+	Set(string) error
+	Type() string
+}
+
+// sortFlags returns the flags as a slice in lexicographical sorted order.
+func sortFlags(flags map[NormalizedName]*Flag) []*Flag {
+	list := make(sort.StringSlice, len(flags))
+	i := 0
+	for k := range flags {
+		list[i] = string(k)
+		i++
+	}
+	list.Sort()
+	result := make([]*Flag, len(list))
+	for i, name := range list {
+		result[i] = flags[NormalizedName(name)]
+	}
+	return result
+}
+
+func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) {
+	f.normalizeNameFunc = n
+	for k, v := range f.formal {
+		delete(f.formal, k)
+		nname := f.normalizeFlagName(string(k))
+		f.formal[nname] = v
+		v.Name = string(nname)
+	}
+}
+
+func (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) NormalizedName {
+	if f.normalizeNameFunc != nil {
+		return f.normalizeNameFunc
+	}
+	return func(f *FlagSet, name string) NormalizedName { return NormalizedName(name) }
+}
+
+func (f *FlagSet) normalizeFlagName(name string) NormalizedName {
+	n := f.GetNormalizeFunc()
+	return n(f, name)
+}
+
+func (f *FlagSet) out() io.Writer {
+	if f.output == nil {
+		return os.Stderr
+	}
+	return f.output
+}
+
+// SetOutput sets the destination for usage and error messages.
+// If output is nil, os.Stderr is used.
+func (f *FlagSet) SetOutput(output io.Writer) {
+	f.output = output
+}
+
+// VisitAll visits the flags in lexicographical order, calling fn for each.
+// It visits all flags, even those not set.
+func (f *FlagSet) VisitAll(fn func(*Flag)) {
+	for _, flag := range sortFlags(f.formal) {
+		fn(flag)
+	}
+}
+
+func (f *FlagSet) HasFlags() bool {
+	return len(f.formal) > 0
+}
+
+// VisitAll visits the command-line flags in lexicographical order, calling
+// fn for each.  It visits all flags, even those not set.
+func VisitAll(fn func(*Flag)) {
+	CommandLine.VisitAll(fn)
+}
+
+// Visit visits the flags in lexicographical order, calling fn for each.
+// It visits only those flags that have been set.
+func (f *FlagSet) Visit(fn func(*Flag)) {
+	for _, flag := range sortFlags(f.actual) {
+		fn(flag)
+	}
+}
+
+// Visit visits the command-line flags in lexicographical order, calling fn
+// for each.  It visits only those flags that have been set.
+func Visit(fn func(*Flag)) {
+	CommandLine.Visit(fn)
+}
+
+// Lookup returns the Flag structure of the named flag, returning nil if none exists.
+func (f *FlagSet) Lookup(name string) *Flag {
+	return f.lookup(f.normalizeFlagName(name))
+}
+
+// lookup returns the Flag structure of the named flag, returning nil if none exists.
+func (f *FlagSet) lookup(name NormalizedName) *Flag {
+	return f.formal[name]
+}
+
+// func to return a given type for a given flag name
+func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) {
+	flag := f.Lookup(name)
+	if flag == nil {
+		err := fmt.Errorf("flag accessed but not defined: %s\n", name)
+		return nil, err
+	}
+
+	if flag.Value.Type() != ftype {
+		err := fmt.Errorf("trying to get %s value of flag of type %s\n", ftype, flag.Value.Type())
+		return nil, err
+	}
+
+	sval := flag.Value.String()
+	result, err := convFunc(sval)
+	if err != nil {
+		return nil, err
+	}
+	return result, nil
+}
+
+// Mark a flag deprecated in your program
+func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error {
+	flag := f.Lookup(name)
+	if flag == nil {
+		return fmt.Errorf("flag %q does not exist", name)
+	}
+	flag.Deprecated = usageMessage
+	return nil
+}
+
+// Lookup returns the Flag structure of the named command-line flag,
+// returning nil if none exists.
+func Lookup(name string) *Flag {
+	return CommandLine.Lookup(name)
+}
+
+// Set sets the value of the named flag.
+func (f *FlagSet) Set(name, value string) error {
+	normalName := f.normalizeFlagName(name)
+	flag, ok := f.formal[normalName]
+	if !ok {
+		return fmt.Errorf("no such flag -%v", name)
+	}
+	err := flag.Value.Set(value)
+	if err != nil {
+		return err
+	}
+	if f.actual == nil {
+		f.actual = make(map[NormalizedName]*Flag)
+	}
+	f.actual[normalName] = flag
+	flag.Changed = true
+	if len(flag.Deprecated) > 0 {
+		fmt.Fprintf(os.Stderr, "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
+	}
+	return nil
+}
+
+func (f *FlagSet) SetAnnotation(name, key string, values []string) error {
+	normalName := f.normalizeFlagName(name)
+	flag, ok := f.formal[normalName]
+	if !ok {
+		return fmt.Errorf("no such flag -%v", name)
+	}
+	if flag.Annotations == nil {
+		flag.Annotations = map[string][]string{}
+	}
+	flag.Annotations[key] = values
+	return nil
+}
+
+// Set sets the value of the named command-line flag.
+func Set(name, value string) error {
+	return CommandLine.Set(name, value)
+}
+
+// PrintDefaults prints, to standard error unless configured
+// otherwise, the default values of all defined flags in the set.
+func (f *FlagSet) PrintDefaults() {
+	f.VisitAll(func(flag *Flag) {
+		if len(flag.Deprecated) > 0 {
+			return
+		}
+		format := ""
+		// ex: w/ option string argument '-%s, --%s[=%q]: %s\n'
+		if len(flag.Shorthand) > 0 {
+			format = "  -%s, --%s"
+		} else {
+			format = "   %s   --%s"
+		}
+		if len(flag.NoOptDefVal) > 0 {
+			format = format + "["
+		}
+		if _, ok := flag.Value.(*stringValue); ok {
+			format = format + "=%q"
+		} else {
+			format = format + "=%s"
+		}
+		if len(flag.NoOptDefVal) > 0 {
+			format = format + "]"
+		}
+		format = format + ": %s\n"
+		fmt.Fprintf(f.out(), format, flag.Shorthand, flag.Name, flag.DefValue, flag.Usage)
+	})
+}
+
+func (f *FlagSet) FlagUsages() string {
+	x := new(bytes.Buffer)
+
+	f.VisitAll(func(flag *Flag) {
+		if len(flag.Deprecated) > 0 {
+			return
+		}
+		format := "--%s=%s: %s\n"
+		if _, ok := flag.Value.(*stringValue); ok {
+			// put quotes on the value
+			format = "--%s=%q: %s\n"
+		}
+		if len(flag.Shorthand) > 0 {
+			format = "  -%s, " + format
+		} else {
+			format = "   %s   " + format
+		}
+		fmt.Fprintf(x, format, flag.Shorthand, flag.Name, flag.DefValue, flag.Usage)
+	})
+
+	return x.String()
+}
+
+// PrintDefaults prints to standard error the default values of all defined command-line flags.
+func PrintDefaults() {
+	CommandLine.PrintDefaults()
+}
+
+// defaultUsage is the default function to print a usage message.
+func defaultUsage(f *FlagSet) {
+	fmt.Fprintf(f.out(), "Usage of %s:\n", f.name)
+	f.PrintDefaults()
+}
+
+// NOTE: Usage is not just defaultUsage(CommandLine)
+// because it serves (via godoc flag Usage) as the example
+// for how to write your own usage function.
+
+// Usage prints to standard error a usage message documenting all defined command-line flags.
+// The function is a variable that may be changed to point to a custom function.
+var Usage = func() {
+	fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
+	PrintDefaults()
+}
+
+// NFlag returns the number of flags that have been set.
+func (f *FlagSet) NFlag() int { return len(f.actual) }
+
+// NFlag returns the number of command-line flags that have been set.
+func NFlag() int { return len(CommandLine.actual) }
+
+// Arg returns the i'th argument.  Arg(0) is the first remaining argument
+// after flags have been processed.
+func (f *FlagSet) Arg(i int) string {
+	if i < 0 || i >= len(f.args) {
+		return ""
+	}
+	return f.args[i]
+}
+
+// Arg returns the i'th command-line argument.  Arg(0) is the first remaining argument
+// after flags have been processed.
+func Arg(i int) string {
+	return CommandLine.Arg(i)
+}
+
+// NArg is the number of arguments remaining after flags have been processed.
+func (f *FlagSet) NArg() int { return len(f.args) }
+
+// NArg is the number of arguments remaining after flags have been processed.
+func NArg() int { return len(CommandLine.args) }
+
+// Args returns the non-flag arguments.
+func (f *FlagSet) Args() []string { return f.args }
+
+// Args returns the non-flag command-line arguments.
+func Args() []string { return CommandLine.args }
+
+// Var defines a flag with the specified name and usage string. The type and
+// value of the flag are represented by the first argument, of type Value, which
+// typically holds a user-defined implementation of Value. For instance, the
+// caller could create a flag that turns a comma-separated string into a slice
+// of strings by giving the slice the methods of Value; in particular, Set would
+// decompose the comma-separated string into the slice.
+func (f *FlagSet) Var(value Value, name string, usage string) {
+	f.VarP(value, name, "", usage)
+}
+
+// Like VarP, but returns the flag created
+func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag {
+	// Remember the default value as a string; it won't change.
+	flag := &Flag{
+		Name:      name,
+		Shorthand: shorthand,
+		Usage:     usage,
+		Value:     value,
+		DefValue:  value.String(),
+	}
+	f.AddFlag(flag)
+	return flag
+}
+
+// Like Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) VarP(value Value, name, shorthand, usage string) {
+	_ = f.VarPF(value, name, shorthand, usage)
+}
+
+func (f *FlagSet) AddFlag(flag *Flag) {
+	// Call normalizeFlagName function only once
+	var normalizedFlagName NormalizedName = f.normalizeFlagName(flag.Name)
+
+	_, alreadythere := f.formal[normalizedFlagName]
+	if alreadythere {
+		msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name)
+		fmt.Fprintln(f.out(), msg)
+		panic(msg) // Happens only if flags are declared with identical names
+	}
+	if f.formal == nil {
+		f.formal = make(map[NormalizedName]*Flag)
+	}
+
+	flag.Name = string(normalizedFlagName)
+	f.formal[normalizedFlagName] = flag
+
+	if len(flag.Shorthand) == 0 {
+		return
+	}
+	if len(flag.Shorthand) > 1 {
+		fmt.Fprintf(f.out(), "%s shorthand more than ASCII character: %s\n", f.name, flag.Shorthand)
+		panic("shorthand is more than one character")
+	}
+	if f.shorthands == nil {
+		f.shorthands = make(map[byte]*Flag)
+	}
+	c := flag.Shorthand[0]
+	old, alreadythere := f.shorthands[c]
+	if alreadythere {
+		fmt.Fprintf(f.out(), "%s shorthand reused: %q for %s already used for %s\n", f.name, c, flag.Name, old.Name)
+		panic("shorthand redefinition")
+	}
+	f.shorthands[c] = flag
+}
+
+// Var defines a flag with the specified name and usage string. The type and
+// value of the flag are represented by the first argument, of type Value, which
+// typically holds a user-defined implementation of Value. For instance, the
+// caller could create a flag that turns a comma-separated string into a slice
+// of strings by giving the slice the methods of Value; in particular, Set would
+// decompose the comma-separated string into the slice.
+func Var(value Value, name string, usage string) {
+	CommandLine.VarP(value, name, "", usage)
+}
+
+// Like Var, but accepts a shorthand letter that can be used after a single dash.
+func VarP(value Value, name, shorthand, usage string) {
+	CommandLine.VarP(value, name, shorthand, usage)
+}
+
+// failf prints to standard error a formatted error and usage message and
+// returns the error.
+func (f *FlagSet) failf(format string, a ...interface{}) error {
+	err := fmt.Errorf(format, a...)
+	fmt.Fprintln(f.out(), err)
+	f.usage()
+	return err
+}
+
+// usage calls the Usage method for the flag set, or the usage function if
+// the flag set is CommandLine.
+func (f *FlagSet) usage() {
+	if f == CommandLine {
+		Usage()
+	} else if f.Usage == nil {
+		defaultUsage(f)
+	} else {
+		f.Usage()
+	}
+}
+
+func (f *FlagSet) setFlag(flag *Flag, value string, origArg string) error {
+	if err := flag.Value.Set(value); err != nil {
+		return f.failf("invalid argument %q for %s: %v", value, origArg, err)
+	}
+	// mark as visited for Visit()
+	if f.actual == nil {
+		f.actual = make(map[NormalizedName]*Flag)
+	}
+	f.actual[f.normalizeFlagName(flag.Name)] = flag
+	flag.Changed = true
+	if len(flag.Deprecated) > 0 {
+		fmt.Fprintf(os.Stderr, "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
+	}
+	return nil
+}
+
+func (f *FlagSet) parseLongArg(s string, args []string) (a []string, err error) {
+	a = args
+	name := s[2:]
+	if len(name) == 0 || name[0] == '-' || name[0] == '=' {
+		err = f.failf("bad flag syntax: %s", s)
+		return
+	}
+	split := strings.SplitN(name, "=", 2)
+	name = split[0]
+	flag, alreadythere := f.formal[f.normalizeFlagName(name)]
+	if !alreadythere {
+		if name == "help" { // special case for nice help message.
+			f.usage()
+			return a, ErrHelp
+		}
+		err = f.failf("unknown flag: --%s", name)
+		return
+	}
+	var value string
+	if len(split) == 2 {
+		// '--flag=arg'
+		value = split[1]
+	} else if len(flag.NoOptDefVal) > 0 {
+		// '--flag' (arg was optional)
+		value = flag.NoOptDefVal
+	} else if len(a) > 0 {
+		// '--flag arg'
+		value = a[0]
+		a = a[1:]
+	} else {
+		// '--flag' (arg was required)
+		err = f.failf("flag needs an argument: %s", s)
+		return
+	}
+	err = f.setFlag(flag, value, s)
+	return
+}
+
+func (f *FlagSet) parseSingleShortArg(shorthands string, args []string) (outShorts string, outArgs []string, err error) {
+	outArgs = args
+	outShorts = shorthands[1:]
+	c := shorthands[0]
+
+	flag, alreadythere := f.shorthands[c]
+	if !alreadythere {
+		if c == 'h' { // special case for nice help message.
+			f.usage()
+			err = ErrHelp
+			return
+		}
+		//TODO continue on error
+		err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands)
+		return
+	}
+	var value string
+	if len(shorthands) > 2 && shorthands[1] == '=' {
+		value = shorthands[2:]
+		outShorts = ""
+	} else if len(flag.NoOptDefVal) > 0 {
+		value = flag.NoOptDefVal
+	} else if len(shorthands) > 1 {
+		value = shorthands[1:]
+		outShorts = ""
+	} else if len(args) > 0 {
+		value = args[0]
+		outArgs = args[1:]
+	} else {
+		err = f.failf("flag needs an argument: %q in -%s", c, shorthands)
+		return
+	}
+	err = f.setFlag(flag, value, shorthands)
+	return
+}
+
+func (f *FlagSet) parseShortArg(s string, args []string) (a []string, err error) {
+	a = args
+	shorthands := s[1:]
+
+	for len(shorthands) > 0 {
+		shorthands, a, err = f.parseSingleShortArg(shorthands, args)
+		if err != nil {
+			return
+		}
+	}
+
+	return
+}
+
+func (f *FlagSet) parseArgs(args []string) (err error) {
+	for len(args) > 0 {
+		s := args[0]
+		args = args[1:]
+		if len(s) == 0 || s[0] != '-' || len(s) == 1 {
+			if !f.interspersed {
+				f.args = append(f.args, s)
+				f.args = append(f.args, args...)
+				return nil
+			}
+			f.args = append(f.args, s)
+			continue
+		}
+
+		if s[1] == '-' {
+			if len(s) == 2 { // "--" terminates the flags
+				f.args = append(f.args, args...)
+				break
+			}
+			args, err = f.parseLongArg(s, args)
+		} else {
+			args, err = f.parseShortArg(s, args)
+		}
+		if err != nil {
+			return
+		}
+	}
+	return
+}
+
+// Parse parses flag definitions from the argument list, which should not
+// include the command name.  Must be called after all flags in the FlagSet
+// are defined and before flags are accessed by the program.
+// The return value will be ErrHelp if -help was set but not defined.
+func (f *FlagSet) Parse(arguments []string) error {
+	f.parsed = true
+	f.args = make([]string, 0, len(arguments))
+	err := f.parseArgs(arguments)
+	if err != nil {
+		switch f.errorHandling {
+		case ContinueOnError:
+			return err
+		case ExitOnError:
+			os.Exit(2)
+		case PanicOnError:
+			panic(err)
+		}
+	}
+	return nil
+}
+
+// Parsed reports whether f.Parse has been called.
+func (f *FlagSet) Parsed() bool {
+	return f.parsed
+}
+
+// Parse parses the command-line flags from os.Args[1:].  Must be called
+// after all flags are defined and before flags are accessed by the program.
+func Parse() {
+	// Ignore errors; CommandLine is set for ExitOnError.
+	CommandLine.Parse(os.Args[1:])
+}
+
+// Whether to support interspersed option/non-option arguments.
+func SetInterspersed(interspersed bool) {
+	CommandLine.SetInterspersed(interspersed)
+}
+
+// Parsed returns true if the command-line flags have been parsed.
+func Parsed() bool {
+	return CommandLine.Parsed()
+}
+
+// The default set of command-line flags, parsed from os.Args.
+var CommandLine = NewFlagSet(os.Args[0], ExitOnError)
+
+// NewFlagSet returns a new, empty flag set with the specified name and
+// error handling property.
+func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {
+	f := &FlagSet{
+		name:          name,
+		errorHandling: errorHandling,
+		interspersed:  true,
+	}
+	return f
+}
+
+// Whether to support interspersed option/non-option arguments.
+func (f *FlagSet) SetInterspersed(interspersed bool) {
+	f.interspersed = interspersed
+}
+
+// Init sets the name and error handling property for a flag set.
+// By default, the zero FlagSet uses an empty name and the
+// ContinueOnError error handling policy.
+func (f *FlagSet) Init(name string, errorHandling ErrorHandling) {
+	f.name = name
+	f.errorHandling = errorHandling
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go
new file mode 100644
index 0000000..a5928e5
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go
@@ -0,0 +1,755 @@
+// 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.
+
+package pflag
+
+import (
+	"bytes"
+	"fmt"
+	"io"
+	"io/ioutil"
+	"net"
+	"os"
+	"reflect"
+	"sort"
+	"strings"
+	"testing"
+	"time"
+)
+
+var (
+	test_bool                    = Bool("test_bool", false, "bool value")
+	test_int                     = Int("test_int", 0, "int value")
+	test_int64                   = Int64("test_int64", 0, "int64 value")
+	test_uint                    = Uint("test_uint", 0, "uint value")
+	test_uint64                  = Uint64("test_uint64", 0, "uint64 value")
+	test_string                  = String("test_string", "0", "string value")
+	test_float64                 = Float64("test_float64", 0, "float64 value")
+	test_duration                = Duration("test_duration", 0, "time.Duration value")
+	test_optional_int            = Int("test_optional_int", 0, "optional int value")
+	normalizeFlagNameInvocations = 0
+)
+
+func boolString(s string) string {
+	if s == "0" {
+		return "false"
+	}
+	return "true"
+}
+
+func TestEverything(t *testing.T) {
+	m := make(map[string]*Flag)
+	desired := "0"
+	visitor := func(f *Flag) {
+		if len(f.Name) > 5 && f.Name[0:5] == "test_" {
+			m[f.Name] = f
+			ok := false
+			switch {
+			case f.Value.String() == desired:
+				ok = true
+			case f.Name == "test_bool" && f.Value.String() == boolString(desired):
+				ok = true
+			case f.Name == "test_duration" && f.Value.String() == desired+"s":
+				ok = true
+			}
+			if !ok {
+				t.Error("Visit: bad value", f.Value.String(), "for", f.Name)
+			}
+		}
+	}
+	VisitAll(visitor)
+	if len(m) != 9 {
+		t.Error("VisitAll misses some flags")
+		for k, v := range m {
+			t.Log(k, *v)
+		}
+	}
+	m = make(map[string]*Flag)
+	Visit(visitor)
+	if len(m) != 0 {
+		t.Errorf("Visit sees unset flags")
+		for k, v := range m {
+			t.Log(k, *v)
+		}
+	}
+	// Now set all flags
+	Set("test_bool", "true")
+	Set("test_int", "1")
+	Set("test_int64", "1")
+	Set("test_uint", "1")
+	Set("test_uint64", "1")
+	Set("test_string", "1")
+	Set("test_float64", "1")
+	Set("test_duration", "1s")
+	Set("test_optional_int", "1")
+	desired = "1"
+	Visit(visitor)
+	if len(m) != 9 {
+		t.Error("Visit fails after set")
+		for k, v := range m {
+			t.Log(k, *v)
+		}
+	}
+	// Now test they're visited in sort order.
+	var flagNames []string
+	Visit(func(f *Flag) { flagNames = append(flagNames, f.Name) })
+	if !sort.StringsAreSorted(flagNames) {
+		t.Errorf("flag names not sorted: %v", flagNames)
+	}
+}
+
+func TestUsage(t *testing.T) {
+	called := false
+	ResetForTesting(func() { called = true })
+	if GetCommandLine().Parse([]string{"--x"}) == nil {
+		t.Error("parse did not fail for unknown flag")
+	}
+	if !called {
+		t.Error("did not call Usage for unknown flag")
+	}
+}
+
+func TestAnnotation(t *testing.T) {
+	f := NewFlagSet("shorthand", ContinueOnError)
+
+	if err := f.SetAnnotation("missing-flag", "key", nil); err == nil {
+		t.Errorf("Expected error setting annotation on non-existent flag")
+	}
+
+	f.StringP("stringa", "a", "", "string value")
+	if err := f.SetAnnotation("stringa", "key", nil); err != nil {
+		t.Errorf("Unexpected error setting new nil annotation: %v", err)
+	}
+	if annotation := f.Lookup("stringa").Annotations["key"]; annotation != nil {
+		t.Errorf("Unexpected annotation: %v", annotation)
+	}
+
+	f.StringP("stringb", "b", "", "string2 value")
+	if err := f.SetAnnotation("stringb", "key", []string{"value1"}); err != nil {
+		t.Errorf("Unexpected error setting new annotation: %v", err)
+	}
+	if annotation := f.Lookup("stringb").Annotations["key"]; !reflect.DeepEqual(annotation, []string{"value1"}) {
+		t.Errorf("Unexpected annotation: %v", annotation)
+	}
+
+	if err := f.SetAnnotation("stringb", "key", []string{"value2"}); err != nil {
+		t.Errorf("Unexpected error updating annotation: %v", err)
+	}
+	if annotation := f.Lookup("stringb").Annotations["key"]; !reflect.DeepEqual(annotation, []string{"value2"}) {
+		t.Errorf("Unexpected annotation: %v", annotation)
+	}
+}
+
+func testParse(f *FlagSet, t *testing.T) {
+	if f.Parsed() {
+		t.Error("f.Parse() = true before Parse")
+	}
+	boolFlag := f.Bool("bool", false, "bool value")
+	bool2Flag := f.Bool("bool2", false, "bool2 value")
+	bool3Flag := f.Bool("bool3", false, "bool3 value")
+	intFlag := f.Int("int", 0, "int value")
+	int8Flag := f.Int8("int8", 0, "int value")
+	int32Flag := f.Int32("int32", 0, "int value")
+	int64Flag := f.Int64("int64", 0, "int64 value")
+	uintFlag := f.Uint("uint", 0, "uint value")
+	uint8Flag := f.Uint8("uint8", 0, "uint value")
+	uint16Flag := f.Uint16("uint16", 0, "uint value")
+	uint32Flag := f.Uint32("uint32", 0, "uint value")
+	uint64Flag := f.Uint64("uint64", 0, "uint64 value")
+	stringFlag := f.String("string", "0", "string value")
+	float32Flag := f.Float32("float32", 0, "float32 value")
+	float64Flag := f.Float64("float64", 0, "float64 value")
+	ipFlag := f.IP("ip", net.ParseIP("127.0.0.1"), "ip value")
+	maskFlag := f.IPMask("mask", ParseIPv4Mask("0.0.0.0"), "mask value")
+	durationFlag := f.Duration("duration", 5*time.Second, "time.Duration value")
+	optionalIntNoValueFlag := f.Int("optional-int-no-value", 0, "int value")
+	f.Lookup("optional-int-no-value").NoOptDefVal = "9"
+	optionalIntWithValueFlag := f.Int("optional-int-with-value", 0, "int value")
+	f.Lookup("optional-int-no-value").NoOptDefVal = "9"
+	extra := "one-extra-argument"
+	args := []string{
+		"--bool",
+		"--bool2=true",
+		"--bool3=false",
+		"--int=22",
+		"--int8=-8",
+		"--int32=-32",
+		"--int64=0x23",
+		"--uint", "24",
+		"--uint8=8",
+		"--uint16=16",
+		"--uint32=32",
+		"--uint64=25",
+		"--string=hello",
+		"--float32=-172e12",
+		"--float64=2718e28",
+		"--ip=10.11.12.13",
+		"--mask=255.255.255.0",
+		"--duration=2m",
+		"--optional-int-no-value",
+		"--optional-int-with-value=42",
+		extra,
+	}
+	if err := f.Parse(args); err != nil {
+		t.Fatal(err)
+	}
+	if !f.Parsed() {
+		t.Error("f.Parse() = false after Parse")
+	}
+	if *boolFlag != true {
+		t.Error("bool flag should be true, is ", *boolFlag)
+	}
+	if v, err := f.GetBool("bool"); err != nil || v != *boolFlag {
+		t.Error("GetBool does not work.")
+	}
+	if *bool2Flag != true {
+		t.Error("bool2 flag should be true, is ", *bool2Flag)
+	}
+	if *bool3Flag != false {
+		t.Error("bool3 flag should be false, is ", *bool2Flag)
+	}
+	if *intFlag != 22 {
+		t.Error("int flag should be 22, is ", *intFlag)
+	}
+	if v, err := f.GetInt("int"); err != nil || v != *intFlag {
+		t.Error("GetInt does not work.")
+	}
+	if *int8Flag != -8 {
+		t.Error("int8 flag should be 0x23, is ", *int8Flag)
+	}
+	if v, err := f.GetInt8("int8"); err != nil || v != *int8Flag {
+		t.Error("GetInt8 does not work.")
+	}
+	if *int32Flag != -32 {
+		t.Error("int32 flag should be 0x23, is ", *int32Flag)
+	}
+	if v, err := f.GetInt32("int32"); err != nil || v != *int32Flag {
+		t.Error("GetInt32 does not work.")
+	}
+	if *int64Flag != 0x23 {
+		t.Error("int64 flag should be 0x23, is ", *int64Flag)
+	}
+	if v, err := f.GetInt64("int64"); err != nil || v != *int64Flag {
+		t.Error("GetInt64 does not work.")
+	}
+	if *uintFlag != 24 {
+		t.Error("uint flag should be 24, is ", *uintFlag)
+	}
+	if v, err := f.GetUint("uint"); err != nil || v != *uintFlag {
+		t.Error("GetUint does not work.")
+	}
+	if *uint8Flag != 8 {
+		t.Error("uint8 flag should be 8, is ", *uint8Flag)
+	}
+	if v, err := f.GetUint8("uint8"); err != nil || v != *uint8Flag {
+		t.Error("GetUint8 does not work.")
+	}
+	if *uint16Flag != 16 {
+		t.Error("uint16 flag should be 16, is ", *uint16Flag)
+	}
+	if v, err := f.GetUint16("uint16"); err != nil || v != *uint16Flag {
+		t.Error("GetUint16 does not work.")
+	}
+	if *uint32Flag != 32 {
+		t.Error("uint32 flag should be 32, is ", *uint32Flag)
+	}
+	if v, err := f.GetUint32("uint32"); err != nil || v != *uint32Flag {
+		t.Error("GetUint32 does not work.")
+	}
+	if *uint64Flag != 25 {
+		t.Error("uint64 flag should be 25, is ", *uint64Flag)
+	}
+	if v, err := f.GetUint64("uint64"); err != nil || v != *uint64Flag {
+		t.Error("GetUint64 does not work.")
+	}
+	if *stringFlag != "hello" {
+		t.Error("string flag should be `hello`, is ", *stringFlag)
+	}
+	if v, err := f.GetString("string"); err != nil || v != *stringFlag {
+		t.Error("GetString does not work.")
+	}
+	if *float32Flag != -172e12 {
+		t.Error("float32 flag should be -172e12, is ", *float32Flag)
+	}
+	if v, err := f.GetFloat32("float32"); err != nil || v != *float32Flag {
+		t.Errorf("GetFloat32 returned %v but float32Flag was %v", v, *float32Flag)
+	}
+	if *float64Flag != 2718e28 {
+		t.Error("float64 flag should be 2718e28, is ", *float64Flag)
+	}
+	if v, err := f.GetFloat64("float64"); err != nil || v != *float64Flag {
+		t.Errorf("GetFloat64 returned %v but float64Flag was %v", v, *float64Flag)
+	}
+	if !(*ipFlag).Equal(net.ParseIP("10.11.12.13")) {
+		t.Error("ip flag should be 10.11.12.13, is ", *ipFlag)
+	}
+	if v, err := f.GetIP("ip"); err != nil || !v.Equal(*ipFlag) {
+		t.Errorf("GetIP returned %v but ipFlag was %v", v, *ipFlag)
+	}
+	if (*maskFlag).String() != ParseIPv4Mask("255.255.255.0").String() {
+		t.Error("mask flag should be 255.255.255.0, is ", (*maskFlag).String())
+	}
+	if v, err := f.GetIPv4Mask("mask"); err != nil || v.String() != (*maskFlag).String() {
+		t.Errorf("GetIP returned %v but maskFlag was %v", v, *maskFlag, err)
+	}
+	if *durationFlag != 2*time.Minute {
+		t.Error("duration flag should be 2m, is ", *durationFlag)
+	}
+	if v, err := f.GetDuration("duration"); err != nil || v != *durationFlag {
+		t.Error("GetDuration does not work.")
+	}
+	if _, err := f.GetInt("duration"); err == nil {
+		t.Error("GetInt parsed a time.Duration?!?!")
+	}
+	if *optionalIntNoValueFlag != 9 {
+		t.Error("optional int flag should be the default value, is ", *optionalIntNoValueFlag)
+	}
+	if *optionalIntWithValueFlag != 42 {
+		t.Error("optional int flag should be 42, is ", *optionalIntWithValueFlag)
+	}
+	if len(f.Args()) != 1 {
+		t.Error("expected one argument, got", len(f.Args()))
+	} else if f.Args()[0] != extra {
+		t.Errorf("expected argument %q got %q", extra, f.Args()[0])
+	}
+}
+
+func TestShorthand(t *testing.T) {
+	f := NewFlagSet("shorthand", ContinueOnError)
+	if f.Parsed() {
+		t.Error("f.Parse() = true before Parse")
+	}
+	boolaFlag := f.BoolP("boola", "a", false, "bool value")
+	boolbFlag := f.BoolP("boolb", "b", false, "bool2 value")
+	boolcFlag := f.BoolP("boolc", "c", false, "bool3 value")
+	booldFlag := f.BoolP("boold", "d", false, "bool4 value")
+	stringaFlag := f.StringP("stringa", "s", "0", "string value")
+	stringzFlag := f.StringP("stringz", "z", "0", "string value")
+	extra := "interspersed-argument"
+	notaflag := "--i-look-like-a-flag"
+	args := []string{
+		"-ab",
+		extra,
+		"-cs",
+		"hello",
+		"-z=something",
+		"-d=true",
+		"--",
+		notaflag,
+	}
+	f.SetOutput(ioutil.Discard)
+	if err := f.Parse(args); err != nil {
+		t.Error("expected no error, got ", err)
+	}
+	if !f.Parsed() {
+		t.Error("f.Parse() = false after Parse")
+	}
+	if *boolaFlag != true {
+		t.Error("boola flag should be true, is ", *boolaFlag)
+	}
+	if *boolbFlag != true {
+		t.Error("boolb flag should be true, is ", *boolbFlag)
+	}
+	if *boolcFlag != true {
+		t.Error("boolc flag should be true, is ", *boolcFlag)
+	}
+	if *booldFlag != true {
+		t.Error("boold flag should be true, is ", *booldFlag)
+	}
+	if *stringaFlag != "hello" {
+		t.Error("stringa flag should be `hello`, is ", *stringaFlag)
+	}
+	if *stringzFlag != "something" {
+		t.Error("stringz flag should be `something`, is ", *stringzFlag)
+	}
+	if len(f.Args()) != 2 {
+		t.Error("expected one argument, got", len(f.Args()))
+	} else if f.Args()[0] != extra {
+		t.Errorf("expected argument %q got %q", extra, f.Args()[0])
+	} else if f.Args()[1] != notaflag {
+		t.Errorf("expected argument %q got %q", notaflag, f.Args()[1])
+	}
+}
+
+func TestParse(t *testing.T) {
+	ResetForTesting(func() { t.Error("bad parse") })
+	testParse(GetCommandLine(), t)
+}
+
+func TestFlagSetParse(t *testing.T) {
+	testParse(NewFlagSet("test", ContinueOnError), t)
+}
+
+func replaceSeparators(name string, from []string, to string) string {
+	result := name
+	for _, sep := range from {
+		result = strings.Replace(result, sep, to, -1)
+	}
+	// Type convert to indicate normalization has been done.
+	return result
+}
+
+func wordSepNormalizeFunc(f *FlagSet, name string) NormalizedName {
+	seps := []string{"-", "_"}
+	name = replaceSeparators(name, seps, ".")
+	normalizeFlagNameInvocations++
+
+	return NormalizedName(name)
+}
+
+func testWordSepNormalizedNames(args []string, t *testing.T) {
+	f := NewFlagSet("normalized", ContinueOnError)
+	if f.Parsed() {
+		t.Error("f.Parse() = true before Parse")
+	}
+	withDashFlag := f.Bool("with-dash-flag", false, "bool value")
+	// Set this after some flags have been added and before others.
+	f.SetNormalizeFunc(wordSepNormalizeFunc)
+	withUnderFlag := f.Bool("with_under_flag", false, "bool value")
+	withBothFlag := f.Bool("with-both_flag", false, "bool value")
+	if err := f.Parse(args); err != nil {
+		t.Fatal(err)
+	}
+	if !f.Parsed() {
+		t.Error("f.Parse() = false after Parse")
+	}
+	if *withDashFlag != true {
+		t.Error("withDashFlag flag should be true, is ", *withDashFlag)
+	}
+	if *withUnderFlag != true {
+		t.Error("withUnderFlag flag should be true, is ", *withUnderFlag)
+	}
+	if *withBothFlag != true {
+		t.Error("withBothFlag flag should be true, is ", *withBothFlag)
+	}
+}
+
+func TestWordSepNormalizedNames(t *testing.T) {
+	args := []string{
+		"--with-dash-flag",
+		"--with-under-flag",
+		"--with-both-flag",
+	}
+	testWordSepNormalizedNames(args, t)
+
+	args = []string{
+		"--with_dash_flag",
+		"--with_under_flag",
+		"--with_both_flag",
+	}
+	testWordSepNormalizedNames(args, t)
+
+	args = []string{
+		"--with-dash_flag",
+		"--with-under_flag",
+		"--with-both_flag",
+	}
+	testWordSepNormalizedNames(args, t)
+}
+
+func aliasAndWordSepFlagNames(f *FlagSet, name string) NormalizedName {
+	seps := []string{"-", "_"}
+
+	oldName := replaceSeparators("old-valid_flag", seps, ".")
+	newName := replaceSeparators("valid-flag", seps, ".")
+
+	name = replaceSeparators(name, seps, ".")
+	switch name {
+	case oldName:
+		name = newName
+		break
+	}
+
+	return NormalizedName(name)
+}
+
+func TestCustomNormalizedNames(t *testing.T) {
+	f := NewFlagSet("normalized", ContinueOnError)
+	if f.Parsed() {
+		t.Error("f.Parse() = true before Parse")
+	}
+
+	validFlag := f.Bool("valid-flag", false, "bool value")
+	f.SetNormalizeFunc(aliasAndWordSepFlagNames)
+	someOtherFlag := f.Bool("some-other-flag", false, "bool value")
+
+	args := []string{"--old_valid_flag", "--some-other_flag"}
+	if err := f.Parse(args); err != nil {
+		t.Fatal(err)
+	}
+
+	if *validFlag != true {
+		t.Errorf("validFlag is %v even though we set the alias --old_valid_falg", *validFlag)
+	}
+	if *someOtherFlag != true {
+		t.Error("someOtherFlag should be true, is ", *someOtherFlag)
+	}
+}
+
+// Every flag we add, the name (displayed also in usage) should normalized
+func TestNormalizationFuncShouldChangeFlagName(t *testing.T) {
+	// Test normalization after addition
+	f := NewFlagSet("normalized", ContinueOnError)
+
+	f.Bool("valid_flag", false, "bool value")
+	if f.Lookup("valid_flag").Name != "valid_flag" {
+		t.Error("The new flag should have the name 'valid_flag' instead of ", f.Lookup("valid_flag").Name)
+	}
+
+	f.SetNormalizeFunc(wordSepNormalizeFunc)
+	if f.Lookup("valid_flag").Name != "valid.flag" {
+		t.Error("The new flag should have the name 'valid.flag' instead of ", f.Lookup("valid_flag").Name)
+	}
+
+	// Test normalization before addition
+	f = NewFlagSet("normalized", ContinueOnError)
+	f.SetNormalizeFunc(wordSepNormalizeFunc)
+
+	f.Bool("valid_flag", false, "bool value")
+	if f.Lookup("valid_flag").Name != "valid.flag" {
+		t.Error("The new flag should have the name 'valid.flag' instead of ", f.Lookup("valid_flag").Name)
+	}
+}
+
+// Declare a user-defined flag type.
+type flagVar []string
+
+func (f *flagVar) String() string {
+	return fmt.Sprint([]string(*f))
+}
+
+func (f *flagVar) Set(value string) error {
+	*f = append(*f, value)
+	return nil
+}
+
+func (f *flagVar) Type() string {
+	return "flagVar"
+}
+
+func TestUserDefined(t *testing.T) {
+	var flags FlagSet
+	flags.Init("test", ContinueOnError)
+	var v flagVar
+	flags.VarP(&v, "v", "v", "usage")
+	if err := flags.Parse([]string{"--v=1", "-v2", "-v", "3"}); err != nil {
+		t.Error(err)
+	}
+	if len(v) != 3 {
+		t.Fatal("expected 3 args; got ", len(v))
+	}
+	expect := "[1 2 3]"
+	if v.String() != expect {
+		t.Errorf("expected value %q got %q", expect, v.String())
+	}
+}
+
+func TestSetOutput(t *testing.T) {
+	var flags FlagSet
+	var buf bytes.Buffer
+	flags.SetOutput(&buf)
+	flags.Init("test", ContinueOnError)
+	flags.Parse([]string{"--unknown"})
+	if out := buf.String(); !strings.Contains(out, "--unknown") {
+		t.Logf("expected output mentioning unknown; got %q", out)
+	}
+}
+
+// This tests that one can reset the flags. This still works but not well, and is
+// superseded by FlagSet.
+func TestChangingArgs(t *testing.T) {
+	ResetForTesting(func() { t.Fatal("bad parse") })
+	oldArgs := os.Args
+	defer func() { os.Args = oldArgs }()
+	os.Args = []string{"cmd", "--before", "subcmd"}
+	before := Bool("before", false, "")
+	if err := GetCommandLine().Parse(os.Args[1:]); err != nil {
+		t.Fatal(err)
+	}
+	cmd := Arg(0)
+	os.Args = []string{"subcmd", "--after", "args"}
+	after := Bool("after", false, "")
+	Parse()
+	args := Args()
+
+	if !*before || cmd != "subcmd" || !*after || len(args) != 1 || args[0] != "args" {
+		t.Fatalf("expected true subcmd true [args] got %v %v %v %v", *before, cmd, *after, args)
+	}
+}
+
+// Test that -help invokes the usage message and returns ErrHelp.
+func TestHelp(t *testing.T) {
+	var helpCalled = false
+	fs := NewFlagSet("help test", ContinueOnError)
+	fs.Usage = func() { helpCalled = true }
+	var flag bool
+	fs.BoolVar(&flag, "flag", false, "regular flag")
+	// Regular flag invocation should work
+	err := fs.Parse([]string{"--flag=true"})
+	if err != nil {
+		t.Fatal("expected no error; got ", err)
+	}
+	if !flag {
+		t.Error("flag was not set by --flag")
+	}
+	if helpCalled {
+		t.Error("help called for regular flag")
+		helpCalled = false // reset for next test
+	}
+	// Help flag should work as expected.
+	err = fs.Parse([]string{"--help"})
+	if err == nil {
+		t.Fatal("error expected")
+	}
+	if err != ErrHelp {
+		t.Fatal("expected ErrHelp; got ", err)
+	}
+	if !helpCalled {
+		t.Fatal("help was not called")
+	}
+	// If we define a help flag, that should override.
+	var help bool
+	fs.BoolVar(&help, "help", false, "help flag")
+	helpCalled = false
+	err = fs.Parse([]string{"--help"})
+	if err != nil {
+		t.Fatal("expected no error for defined --help; got ", err)
+	}
+	if helpCalled {
+		t.Fatal("help was called; should not have been for defined help flag")
+	}
+}
+
+func TestNoInterspersed(t *testing.T) {
+	f := NewFlagSet("test", ContinueOnError)
+	f.SetInterspersed(false)
+	f.Bool("true", true, "always true")
+	f.Bool("false", false, "always false")
+	err := f.Parse([]string{"--true", "break", "--false"})
+	if err != nil {
+		t.Fatal("expected no error; got ", err)
+	}
+	args := f.Args()
+	if len(args) != 2 || args[0] != "break" || args[1] != "--false" {
+		t.Fatal("expected interspersed options/non-options to fail")
+	}
+}
+
+func TestTermination(t *testing.T) {
+	f := NewFlagSet("termination", ContinueOnError)
+	boolFlag := f.BoolP("bool", "l", false, "bool value")
+	if f.Parsed() {
+		t.Error("f.Parse() = true before Parse")
+	}
+	arg1 := "ls"
+	arg2 := "-l"
+	args := []string{
+		"--",
+		arg1,
+		arg2,
+	}
+	f.SetOutput(ioutil.Discard)
+	if err := f.Parse(args); err != nil {
+		t.Fatal("expected no error; got ", err)
+	}
+	if !f.Parsed() {
+		t.Error("f.Parse() = false after Parse")
+	}
+	if *boolFlag {
+		t.Error("expected boolFlag=false, got true")
+	}
+	if len(f.Args()) != 2 {
+		t.Errorf("expected 2 arguments, got %d: %v", len(f.Args()), f.Args())
+	}
+	if f.Args()[0] != arg1 {
+		t.Errorf("expected argument %q got %q", arg1, f.Args()[0])
+	}
+	if f.Args()[1] != arg2 {
+		t.Errorf("expected argument %q got %q", arg2, f.Args()[1])
+	}
+}
+
+func TestDeprecatedFlagInDocs(t *testing.T) {
+	f := NewFlagSet("bob", ContinueOnError)
+	f.Bool("badflag", true, "always true")
+	f.MarkDeprecated("badflag", "use --good-flag instead")
+
+	out := new(bytes.Buffer)
+	f.SetOutput(out)
+	f.PrintDefaults()
+
+	if strings.Contains(out.String(), "badflag") {
+		t.Errorf("found deprecated flag in usage!")
+	}
+}
+
+func parseReturnStderr(t *testing.T, f *FlagSet, args []string) (string, error) {
+	oldStderr := os.Stderr
+	r, w, _ := os.Pipe()
+	os.Stderr = w
+
+	err := f.Parse(args)
+
+	outC := make(chan string)
+	// copy the output in a separate goroutine so printing can't block indefinitely
+	go func() {
+		var buf bytes.Buffer
+		io.Copy(&buf, r)
+		outC <- buf.String()
+	}()
+
+	w.Close()
+	os.Stderr = oldStderr
+	out := <-outC
+
+	return out, err
+}
+
+func TestDeprecatedFlagUsage(t *testing.T) {
+	f := NewFlagSet("bob", ContinueOnError)
+	f.Bool("badflag", true, "always true")
+	usageMsg := "use --good-flag instead"
+	f.MarkDeprecated("badflag", usageMsg)
+
+	args := []string{"--badflag"}
+	out, err := parseReturnStderr(t, f, args)
+	if err != nil {
+		t.Fatal("expected no error; got ", err)
+	}
+
+	if !strings.Contains(out, usageMsg) {
+		t.Errorf("usageMsg not printed when using a deprecated flag!")
+	}
+}
+
+func TestDeprecatedFlagUsageNormalized(t *testing.T) {
+	f := NewFlagSet("bob", ContinueOnError)
+	f.Bool("bad-double_flag", true, "always true")
+	f.SetNormalizeFunc(wordSepNormalizeFunc)
+	usageMsg := "use --good-flag instead"
+	f.MarkDeprecated("bad_double-flag", usageMsg)
+
+	args := []string{"--bad_double_flag"}
+	out, err := parseReturnStderr(t, f, args)
+	if err != nil {
+		t.Fatal("expected no error; got ", err)
+	}
+
+	if !strings.Contains(out, usageMsg) {
+		t.Errorf("usageMsg not printed when using a deprecated flag!")
+	}
+}
+
+// Name normalization function should be called only once on flag addition
+func TestMultipleNormalizeFlagNameInvocations(t *testing.T) {
+	normalizeFlagNameInvocations = 0
+
+	f := NewFlagSet("normalized", ContinueOnError)
+	f.SetNormalizeFunc(wordSepNormalizeFunc)
+	f.Bool("with_under_flag", false, "bool value")
+
+	if normalizeFlagNameInvocations != 1 {
+		t.Fatal("Expected normalizeFlagNameInvocations to be 1; got ", normalizeFlagNameInvocations)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/float32.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/float32.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/float32.go
new file mode 100644
index 0000000..30174cb
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/float32.go
@@ -0,0 +1,91 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- float32 Value
+type float32Value float32
+
+func newFloat32Value(val float32, p *float32) *float32Value {
+	*p = val
+	return (*float32Value)(p)
+}
+
+func (f *float32Value) Set(s string) error {
+	v, err := strconv.ParseFloat(s, 32)
+	*f = float32Value(v)
+	return err
+}
+
+func (f *float32Value) Type() string {
+	return "float32"
+}
+
+func (f *float32Value) String() string { return fmt.Sprintf("%v", *f) }
+
+func float32Conv(sval string) (interface{}, error) {
+	v, err := strconv.ParseFloat(sval, 32)
+	if err != nil {
+		return 0, err
+	}
+	return float32(v), nil
+}
+
+// GetFloat32 return the float32 value of a flag with the given name
+func (f *FlagSet) GetFloat32(name string) (float32, error) {
+	val, err := f.getFlagType(name, "float32", float32Conv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(float32), nil
+}
+
+// Float32Var defines a float32 flag with specified name, default value, and usage string.
+// The argument p points to a float32 variable in which to store the value of the flag.
+func (f *FlagSet) Float32Var(p *float32, name string, value float32, usage string) {
+	f.VarP(newFloat32Value(value, p), name, "", usage)
+}
+
+// Like Float32Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value float32, usage string) {
+	f.VarP(newFloat32Value(value, p), name, shorthand, usage)
+}
+
+// Float32Var defines a float32 flag with specified name, default value, and usage string.
+// The argument p points to a float32 variable in which to store the value of the flag.
+func Float32Var(p *float32, name string, value float32, usage string) {
+	CommandLine.VarP(newFloat32Value(value, p), name, "", usage)
+}
+
+// Like Float32Var, but accepts a shorthand letter that can be used after a single dash.
+func Float32VarP(p *float32, name, shorthand string, value float32, usage string) {
+	CommandLine.VarP(newFloat32Value(value, p), name, shorthand, usage)
+}
+
+// Float32 defines a float32 flag with specified name, default value, and usage string.
+// The return value is the address of a float32 variable that stores the value of the flag.
+func (f *FlagSet) Float32(name string, value float32, usage string) *float32 {
+	p := new(float32)
+	f.Float32VarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Float32, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Float32P(name, shorthand string, value float32, usage string) *float32 {
+	p := new(float32)
+	f.Float32VarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Float32 defines a float32 flag with specified name, default value, and usage string.
+// The return value is the address of a float32 variable that stores the value of the flag.
+func Float32(name string, value float32, usage string) *float32 {
+	return CommandLine.Float32P(name, "", value, usage)
+}
+
+// Like Float32, but accepts a shorthand letter that can be used after a single dash.
+func Float32P(name, shorthand string, value float32, usage string) *float32 {
+	return CommandLine.Float32P(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/float64.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/float64.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/float64.go
new file mode 100644
index 0000000..10e17e4
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/float64.go
@@ -0,0 +1,87 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- float64 Value
+type float64Value float64
+
+func newFloat64Value(val float64, p *float64) *float64Value {
+	*p = val
+	return (*float64Value)(p)
+}
+
+func (f *float64Value) Set(s string) error {
+	v, err := strconv.ParseFloat(s, 64)
+	*f = float64Value(v)
+	return err
+}
+
+func (f *float64Value) Type() string {
+	return "float64"
+}
+
+func (f *float64Value) String() string { return fmt.Sprintf("%v", *f) }
+
+func float64Conv(sval string) (interface{}, error) {
+	return strconv.ParseFloat(sval, 64)
+}
+
+// GetFloat64 return the float64 value of a flag with the given name
+func (f *FlagSet) GetFloat64(name string) (float64, error) {
+	val, err := f.getFlagType(name, "float64", float64Conv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(float64), nil
+}
+
+// Float64Var defines a float64 flag with specified name, default value, and usage string.
+// The argument p points to a float64 variable in which to store the value of the flag.
+func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage string) {
+	f.VarP(newFloat64Value(value, p), name, "", usage)
+}
+
+// Like Float64Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Float64VarP(p *float64, name, shorthand string, value float64, usage string) {
+	f.VarP(newFloat64Value(value, p), name, shorthand, usage)
+}
+
+// Float64Var defines a float64 flag with specified name, default value, and usage string.
+// The argument p points to a float64 variable in which to store the value of the flag.
+func Float64Var(p *float64, name string, value float64, usage string) {
+	CommandLine.VarP(newFloat64Value(value, p), name, "", usage)
+}
+
+// Like Float64Var, but accepts a shorthand letter that can be used after a single dash.
+func Float64VarP(p *float64, name, shorthand string, value float64, usage string) {
+	CommandLine.VarP(newFloat64Value(value, p), name, shorthand, usage)
+}
+
+// Float64 defines a float64 flag with specified name, default value, and usage string.
+// The return value is the address of a float64 variable that stores the value of the flag.
+func (f *FlagSet) Float64(name string, value float64, usage string) *float64 {
+	p := new(float64)
+	f.Float64VarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Float64, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Float64P(name, shorthand string, value float64, usage string) *float64 {
+	p := new(float64)
+	f.Float64VarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Float64 defines a float64 flag with specified name, default value, and usage string.
+// The return value is the address of a float64 variable that stores the value of the flag.
+func Float64(name string, value float64, usage string) *float64 {
+	return CommandLine.Float64P(name, "", value, usage)
+}
+
+// Like Float64, but accepts a shorthand letter that can be used after a single dash.
+func Float64P(name, shorthand string, value float64, usage string) *float64 {
+	return CommandLine.Float64P(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/int.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/int.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int.go
new file mode 100644
index 0000000..23f70dd
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int.go
@@ -0,0 +1,87 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- int Value
+type intValue int
+
+func newIntValue(val int, p *int) *intValue {
+	*p = val
+	return (*intValue)(p)
+}
+
+func (i *intValue) Set(s string) error {
+	v, err := strconv.ParseInt(s, 0, 64)
+	*i = intValue(v)
+	return err
+}
+
+func (i *intValue) Type() string {
+	return "int"
+}
+
+func (i *intValue) String() string { return fmt.Sprintf("%v", *i) }
+
+func intConv(sval string) (interface{}, error) {
+	return strconv.Atoi(sval)
+}
+
+// GetInt return the int value of a flag with the given name
+func (f *FlagSet) GetInt(name string) (int, error) {
+	val, err := f.getFlagType(name, "int", intConv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(int), nil
+}
+
+// IntVar defines an int flag with specified name, default value, and usage string.
+// The argument p points to an int variable in which to store the value of the flag.
+func (f *FlagSet) IntVar(p *int, name string, value int, usage string) {
+	f.VarP(newIntValue(value, p), name, "", usage)
+}
+
+// Like IntVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usage string) {
+	f.VarP(newIntValue(value, p), name, shorthand, usage)
+}
+
+// IntVar defines an int flag with specified name, default value, and usage string.
+// The argument p points to an int variable in which to store the value of the flag.
+func IntVar(p *int, name string, value int, usage string) {
+	CommandLine.VarP(newIntValue(value, p), name, "", usage)
+}
+
+// Like IntVar, but accepts a shorthand letter that can be used after a single dash.
+func IntVarP(p *int, name, shorthand string, value int, usage string) {
+	CommandLine.VarP(newIntValue(value, p), name, shorthand, usage)
+}
+
+// Int defines an int flag with specified name, default value, and usage string.
+// The return value is the address of an int variable that stores the value of the flag.
+func (f *FlagSet) Int(name string, value int, usage string) *int {
+	p := new(int)
+	f.IntVarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Int, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) IntP(name, shorthand string, value int, usage string) *int {
+	p := new(int)
+	f.IntVarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Int defines an int flag with specified name, default value, and usage string.
+// The return value is the address of an int variable that stores the value of the flag.
+func Int(name string, value int, usage string) *int {
+	return CommandLine.IntP(name, "", value, usage)
+}
+
+// Like Int, but accepts a shorthand letter that can be used after a single dash.
+func IntP(name, shorthand string, value int, usage string) *int {
+	return CommandLine.IntP(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/int32.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/int32.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int32.go
new file mode 100644
index 0000000..515f90b
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int32.go
@@ -0,0 +1,91 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- int32 Value
+type int32Value int32
+
+func newInt32Value(val int32, p *int32) *int32Value {
+	*p = val
+	return (*int32Value)(p)
+}
+
+func (i *int32Value) Set(s string) error {
+	v, err := strconv.ParseInt(s, 0, 32)
+	*i = int32Value(v)
+	return err
+}
+
+func (i *int32Value) Type() string {
+	return "int32"
+}
+
+func (i *int32Value) String() string { return fmt.Sprintf("%v", *i) }
+
+func int32Conv(sval string) (interface{}, error) {
+	v, err := strconv.ParseInt(sval, 0, 32)
+	if err != nil {
+		return 0, err
+	}
+	return int32(v), nil
+}
+
+// GetInt32 return the int32 value of a flag with the given name
+func (f *FlagSet) GetInt32(name string) (int32, error) {
+	val, err := f.getFlagType(name, "int32", int32Conv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(int32), nil
+}
+
+// Int32Var defines an int32 flag with specified name, default value, and usage string.
+// The argument p points to an int32 variable in which to store the value of the flag.
+func (f *FlagSet) Int32Var(p *int32, name string, value int32, usage string) {
+	f.VarP(newInt32Value(value, p), name, "", usage)
+}
+
+// Like Int32Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Int32VarP(p *int32, name, shorthand string, value int32, usage string) {
+	f.VarP(newInt32Value(value, p), name, shorthand, usage)
+}
+
+// Int32Var defines an int32 flag with specified name, default value, and usage string.
+// The argument p points to an int32 variable in which to store the value of the flag.
+func Int32Var(p *int32, name string, value int32, usage string) {
+	CommandLine.VarP(newInt32Value(value, p), name, "", usage)
+}
+
+// Like Int32Var, but accepts a shorthand letter that can be used after a single dash.
+func Int32VarP(p *int32, name, shorthand string, value int32, usage string) {
+	CommandLine.VarP(newInt32Value(value, p), name, shorthand, usage)
+}
+
+// Int32 defines an int32 flag with specified name, default value, and usage string.
+// The return value is the address of an int32 variable that stores the value of the flag.
+func (f *FlagSet) Int32(name string, value int32, usage string) *int32 {
+	p := new(int32)
+	f.Int32VarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Int32, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Int32P(name, shorthand string, value int32, usage string) *int32 {
+	p := new(int32)
+	f.Int32VarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Int32 defines an int32 flag with specified name, default value, and usage string.
+// The return value is the address of an int32 variable that stores the value of the flag.
+func Int32(name string, value int32, usage string) *int32 {
+	return CommandLine.Int32P(name, "", value, usage)
+}
+
+// Like Int32, but accepts a shorthand letter that can be used after a single dash.
+func Int32P(name, shorthand string, value int32, usage string) *int32 {
+	return CommandLine.Int32P(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/int64.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/int64.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int64.go
new file mode 100644
index 0000000..b77ade4
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int64.go
@@ -0,0 +1,87 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- int64 Value
+type int64Value int64
+
+func newInt64Value(val int64, p *int64) *int64Value {
+	*p = val
+	return (*int64Value)(p)
+}
+
+func (i *int64Value) Set(s string) error {
+	v, err := strconv.ParseInt(s, 0, 64)
+	*i = int64Value(v)
+	return err
+}
+
+func (i *int64Value) Type() string {
+	return "int64"
+}
+
+func (i *int64Value) String() string { return fmt.Sprintf("%v", *i) }
+
+func int64Conv(sval string) (interface{}, error) {
+	return strconv.ParseInt(sval, 0, 64)
+}
+
+// GetInt64 return the int64 value of a flag with the given name
+func (f *FlagSet) GetInt64(name string) (int64, error) {
+	val, err := f.getFlagType(name, "int64", int64Conv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(int64), nil
+}
+
+// Int64Var defines an int64 flag with specified name, default value, and usage string.
+// The argument p points to an int64 variable in which to store the value of the flag.
+func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string) {
+	f.VarP(newInt64Value(value, p), name, "", usage)
+}
+
+// Like Int64Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Int64VarP(p *int64, name, shorthand string, value int64, usage string) {
+	f.VarP(newInt64Value(value, p), name, shorthand, usage)
+}
+
+// Int64Var defines an int64 flag with specified name, default value, and usage string.
+// The argument p points to an int64 variable in which to store the value of the flag.
+func Int64Var(p *int64, name string, value int64, usage string) {
+	CommandLine.VarP(newInt64Value(value, p), name, "", usage)
+}
+
+// Like Int64Var, but accepts a shorthand letter that can be used after a single dash.
+func Int64VarP(p *int64, name, shorthand string, value int64, usage string) {
+	CommandLine.VarP(newInt64Value(value, p), name, shorthand, usage)
+}
+
+// Int64 defines an int64 flag with specified name, default value, and usage string.
+// The return value is the address of an int64 variable that stores the value of the flag.
+func (f *FlagSet) Int64(name string, value int64, usage string) *int64 {
+	p := new(int64)
+	f.Int64VarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Int64, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Int64P(name, shorthand string, value int64, usage string) *int64 {
+	p := new(int64)
+	f.Int64VarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Int64 defines an int64 flag with specified name, default value, and usage string.
+// The return value is the address of an int64 variable that stores the value of the flag.
+func Int64(name string, value int64, usage string) *int64 {
+	return CommandLine.Int64P(name, "", value, usage)
+}
+
+// Like Int64, but accepts a shorthand letter that can be used after a single dash.
+func Int64P(name, shorthand string, value int64, usage string) *int64 {
+	return CommandLine.Int64P(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/int8.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/int8.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int8.go
new file mode 100644
index 0000000..c51cb4f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int8.go
@@ -0,0 +1,91 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+)
+
+// -- int8 Value
+type int8Value int8
+
+func newInt8Value(val int8, p *int8) *int8Value {
+	*p = val
+	return (*int8Value)(p)
+}
+
+func (i *int8Value) Set(s string) error {
+	v, err := strconv.ParseInt(s, 0, 8)
+	*i = int8Value(v)
+	return err
+}
+
+func (i *int8Value) Type() string {
+	return "int8"
+}
+
+func (i *int8Value) String() string { return fmt.Sprintf("%v", *i) }
+
+func int8Conv(sval string) (interface{}, error) {
+	v, err := strconv.ParseInt(sval, 0, 8)
+	if err != nil {
+		return 0, err
+	}
+	return int8(v), nil
+}
+
+// GetInt8 return the int8 value of a flag with the given name
+func (f *FlagSet) GetInt8(name string) (int8, error) {
+	val, err := f.getFlagType(name, "int8", int8Conv)
+	if err != nil {
+		return 0, err
+	}
+	return val.(int8), nil
+}
+
+// Int8Var defines an int8 flag with specified name, default value, and usage string.
+// The argument p points to an int8 variable in which to store the value of the flag.
+func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) {
+	f.VarP(newInt8Value(value, p), name, "", usage)
+}
+
+// Like Int8Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, usage string) {
+	f.VarP(newInt8Value(value, p), name, shorthand, usage)
+}
+
+// Int8Var defines an int8 flag with specified name, default value, and usage string.
+// The argument p points to an int8 variable in which to store the value of the flag.
+func Int8Var(p *int8, name string, value int8, usage string) {
+	CommandLine.VarP(newInt8Value(value, p), name, "", usage)
+}
+
+// Like Int8Var, but accepts a shorthand letter that can be used after a single dash.
+func Int8VarP(p *int8, name, shorthand string, value int8, usage string) {
+	CommandLine.VarP(newInt8Value(value, p), name, shorthand, usage)
+}
+
+// Int8 defines an int8 flag with specified name, default value, and usage string.
+// The return value is the address of an int8 variable that stores the value of the flag.
+func (f *FlagSet) Int8(name string, value int8, usage string) *int8 {
+	p := new(int8)
+	f.Int8VarP(p, name, "", value, usage)
+	return p
+}
+
+// Like Int8, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Int8P(name, shorthand string, value int8, usage string) *int8 {
+	p := new(int8)
+	f.Int8VarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// Int8 defines an int8 flag with specified name, default value, and usage string.
+// The return value is the address of an int8 variable that stores the value of the flag.
+func Int8(name string, value int8, usage string) *int8 {
+	return CommandLine.Int8P(name, "", value, usage)
+}
+
+// Like Int8, but accepts a shorthand letter that can be used after a single dash.
+func Int8P(name, shorthand string, value int8, usage string) *int8 {
+	return CommandLine.Int8P(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/int_slice.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/int_slice.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int_slice.go
new file mode 100644
index 0000000..fb3e67b
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int_slice.go
@@ -0,0 +1,113 @@
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+	"strings"
+)
+
+// -- intSlice Value
+type intSliceValue []int
+
+func newIntSliceValue(val []int, p *[]int) *intSliceValue {
+	*p = val
+	return (*intSliceValue)(p)
+}
+
+func (s *intSliceValue) Set(val string) error {
+	ss := strings.Split(val, ",")
+	out := make([]int, len(ss))
+	for i, d := range ss {
+		var err error
+		out[i], err = strconv.Atoi(d)
+		if err != nil {
+			return err
+		}
+
+	}
+	*s = intSliceValue(out)
+	return nil
+}
+
+func (s *intSliceValue) Type() string {
+	return "intSlice"
+}
+
+func (s *intSliceValue) String() string {
+	out := make([]string, len(*s))
+	for i, d := range *s {
+		out[i] = fmt.Sprintf("%d", d)
+	}
+	return strings.Join(out, ",")
+}
+
+func intSliceConv(val string) (interface{}, error) {
+	ss := strings.Split(val, ",")
+	out := make([]int, len(ss))
+	for i, d := range ss {
+		var err error
+		out[i], err = strconv.Atoi(d)
+		if err != nil {
+			return nil, err
+		}
+
+	}
+	return out, nil
+}
+
+// GetIntSlice return the []int value of a flag with the given name
+func (f *FlagSet) GetIntSlice(name string) ([]int, error) {
+	val, err := f.getFlagType(name, "intSlice", intSliceConv)
+	if err != nil {
+		return []int{}, err
+	}
+	return val.([]int), nil
+}
+
+// IntSliceVar defines a intSlice flag with specified name, default value, and usage string.
+// The argument p points to a []int variable in which to store the value of the flag.
+func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string) {
+	f.VarP(newIntSliceValue(value, p), name, "", usage)
+}
+
+// Like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
+	f.VarP(newIntSliceValue(value, p), name, shorthand, usage)
+}
+
+// IntSliceVar defines a int[] flag with specified name, default value, and usage string.
+// The argument p points to a int[] variable in which to store the value of the flag.
+func IntSliceVar(p *[]int, name string, value []int, usage string) {
+	CommandLine.VarP(newIntSliceValue(value, p), name, "", usage)
+}
+
+// Like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
+func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
+	CommandLine.VarP(newIntSliceValue(value, p), name, shorthand, usage)
+}
+
+// IntSlice defines a []int flag with specified name, default value, and usage string.
+// The return value is the address of a []int variable that stores the value of the flag.
+func (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int {
+	p := make([]int, 0)
+	f.IntSliceVarP(&p, name, "", value, usage)
+	return &p
+}
+
+// Like IntSlice, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage string) *[]int {
+	p := make([]int, 0)
+	f.IntSliceVarP(&p, name, shorthand, value, usage)
+	return &p
+}
+
+// IntSlice defines a []int flag with specified name, default value, and usage string.
+// The return value is the address of a []int variable that stores the value of the flag.
+func IntSlice(name string, value []int, usage string) *[]int {
+	return CommandLine.IntSliceP(name, "", value, usage)
+}
+
+// Like IntSlice, but accepts a shorthand letter that can be used after a single dash.
+func IntSliceP(name, shorthand string, value []int, usage string) *[]int {
+	return CommandLine.IntSliceP(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/int_slice_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/int_slice_test.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int_slice_test.go
new file mode 100644
index 0000000..d162e86
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/int_slice_test.go
@@ -0,0 +1,49 @@
+// 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.
+
+package pflag
+
+import (
+	"fmt"
+	"strconv"
+	"strings"
+	"testing"
+)
+
+func setUpISFlagSet(isp *[]int) *FlagSet {
+	f := NewFlagSet("test", ContinueOnError)
+	f.IntSliceVar(isp, "is", []int{}, "Command seperated list!")
+	return f
+}
+
+func TestIS(t *testing.T) {
+	var is []int
+	f := setUpISFlagSet(&is)
+
+	vals := []string{"1", "2", "4", "3"}
+	arg := fmt.Sprintf("--is=%s", strings.Join(vals, ","))
+	err := f.Parse([]string{arg})
+	if err != nil {
+		t.Fatal("expected no error; got", err)
+	}
+	for i, v := range is {
+		d, err := strconv.Atoi(vals[i])
+		if err != nil {
+			t.Fatalf("got error: %v", err)
+		}
+		if d != v {
+			t.Fatalf("expected is[%d] to be %s but got: %d", i, vals[i], v)
+		}
+	}
+	getIS, err := f.GetIntSlice("is")
+	for i, v := range getIS {
+		d, err := strconv.Atoi(vals[i])
+		if err != nil {
+			t.Fatalf("got error: %v", err)
+		}
+		if d != v {
+			t.Fatalf("expected is[%d] to be %s but got: %d from GetIntSlice", i, vals[i], v)
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/ip.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/ip.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/ip.go
new file mode 100644
index 0000000..746eefd
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/ip.go
@@ -0,0 +1,93 @@
+package pflag
+
+import (
+	"fmt"
+	"net"
+)
+
+// -- net.IP value
+type ipValue net.IP
+
+func newIPValue(val net.IP, p *net.IP) *ipValue {
+	*p = val
+	return (*ipValue)(p)
+}
+
+func (i *ipValue) String() string { return net.IP(*i).String() }
+func (i *ipValue) Set(s string) error {
+	ip := net.ParseIP(s)
+	if ip == nil {
+		return fmt.Errorf("failed to parse IP: %q", s)
+	}
+	*i = ipValue(ip)
+	return nil
+}
+
+func (i *ipValue) Type() string {
+	return "ip"
+}
+
+func ipConv(sval string) (interface{}, error) {
+	ip := net.ParseIP(sval)
+	if ip != nil {
+		return ip, nil
+	}
+	return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval)
+}
+
+// GetIP return the net.IP value of a flag with the given name
+func (f *FlagSet) GetIP(name string) (net.IP, error) {
+	val, err := f.getFlagType(name, "ip", ipConv)
+	if err != nil {
+		return nil, err
+	}
+	return val.(net.IP), nil
+}
+
+// IPVar defines an net.IP flag with specified name, default value, and usage string.
+// The argument p points to an net.IP variable in which to store the value of the flag.
+func (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage string) {
+	f.VarP(newIPValue(value, p), name, "", usage)
+}
+
+// Like IPVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {
+	f.VarP(newIPValue(value, p), name, shorthand, usage)
+}
+
+// IPVar defines an net.IP flag with specified name, default value, and usage string.
+// The argument p points to an net.IP variable in which to store the value of the flag.
+func IPVar(p *net.IP, name string, value net.IP, usage string) {
+	CommandLine.VarP(newIPValue(value, p), name, "", usage)
+}
+
+// Like IPVar, but accepts a shorthand letter that can be used after a single dash.
+func IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {
+	CommandLine.VarP(newIPValue(value, p), name, shorthand, usage)
+}
+
+// IP defines an net.IP flag with specified name, default value, and usage string.
+// The return value is the address of an net.IP variable that stores the value of the flag.
+func (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP {
+	p := new(net.IP)
+	f.IPVarP(p, name, "", value, usage)
+	return p
+}
+
+// Like IP, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) IPP(name, shorthand string, value net.IP, usage string) *net.IP {
+	p := new(net.IP)
+	f.IPVarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// IP defines an net.IP flag with specified name, default value, and usage string.
+// The return value is the address of an net.IP variable that stores the value of the flag.
+func IP(name string, value net.IP, usage string) *net.IP {
+	return CommandLine.IPP(name, "", value, usage)
+}
+
+// Like IP, but accepts a shorthand letter that can be used after a single dash.
+func IPP(name, shorthand string, value net.IP, usage string) *net.IP {
+	return CommandLine.IPP(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go
new file mode 100644
index 0000000..1b10efb
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go
@@ -0,0 +1,122 @@
+package pflag
+
+import (
+	"fmt"
+	"net"
+	"strconv"
+)
+
+// -- net.IPMask value
+type ipMaskValue net.IPMask
+
+func newIPMaskValue(val net.IPMask, p *net.IPMask) *ipMaskValue {
+	*p = val
+	return (*ipMaskValue)(p)
+}
+
+func (i *ipMaskValue) String() string { return net.IPMask(*i).String() }
+func (i *ipMaskValue) Set(s string) error {
+	ip := ParseIPv4Mask(s)
+	if ip == nil {
+		return fmt.Errorf("failed to parse IP mask: %q", s)
+	}
+	*i = ipMaskValue(ip)
+	return nil
+}
+
+func (i *ipMaskValue) Type() string {
+	return "ipMask"
+}
+
+// Parse IPv4 netmask written in IP form (e.g. 255.255.255.0).
+// This function should really belong to the net package.
+func ParseIPv4Mask(s string) net.IPMask {
+	mask := net.ParseIP(s)
+	if mask == nil {
+		if len(s) != 8 {
+			return nil
+		}
+		// net.IPMask.String() actually outputs things like ffffff00
+		// so write a horrible parser for that as well  :-(
+		m := []int{}
+		for i := 0; i < 4; i++ {
+			b := "0x" + s[2*i:2*i+2]
+			d, err := strconv.ParseInt(b, 0, 0)
+			if err != nil {
+				return nil
+			}
+			m = append(m, int(d))
+		}
+		s := fmt.Sprintf("%d.%d.%d.%d", m[0], m[1], m[2], m[3])
+		mask = net.ParseIP(s)
+		if mask == nil {
+			return nil
+		}
+	}
+	return net.IPv4Mask(mask[12], mask[13], mask[14], mask[15])
+}
+
+func parseIPv4Mask(sval string) (interface{}, error) {
+	mask := ParseIPv4Mask(sval)
+	if mask == nil {
+		return nil, fmt.Errorf("unable to parse %s as net.IPMask", sval)
+	}
+	return mask, nil
+}
+
+// GetIPv4Mask return the net.IPv4Mask value of a flag with the given name
+func (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) {
+	val, err := f.getFlagType(name, "ipMask", parseIPv4Mask)
+	if err != nil {
+		return nil, err
+	}
+	return val.(net.IPMask), nil
+}
+
+// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.
+// The argument p points to an net.IPMask variable in which to store the value of the flag.
+func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
+	f.VarP(newIPMaskValue(value, p), name, "", usage)
+}
+
+// Like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {
+	f.VarP(newIPMaskValue(value, p), name, shorthand, usage)
+}
+
+// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.
+// The argument p points to an net.IPMask variable in which to store the value of the flag.
+func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
+	CommandLine.VarP(newIPMaskValue(value, p), name, "", usage)
+}
+
+// Like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
+func IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {
+	CommandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage)
+}
+
+// IPMask defines an net.IPMask flag with specified name, default value, and usage string.
+// The return value is the address of an net.IPMask variable that stores the value of the flag.
+func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMask {
+	p := new(net.IPMask)
+	f.IPMaskVarP(p, name, "", value, usage)
+	return p
+}
+
+// Like IPMask, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {
+	p := new(net.IPMask)
+	f.IPMaskVarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// IPMask defines an net.IPMask flag with specified name, default value, and usage string.
+// The return value is the address of an net.IPMask variable that stores the value of the flag.
+func IPMask(name string, value net.IPMask, usage string) *net.IPMask {
+	return CommandLine.IPMaskP(name, "", value, usage)
+}
+
+// Like IP, but accepts a shorthand letter that can be used after a single dash.
+func IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {
+	return CommandLine.IPMaskP(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/string.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/string.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/string.go
new file mode 100644
index 0000000..f89ea8b
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/string.go
@@ -0,0 +1,82 @@
+package pflag
+
+import "fmt"
+
+// -- string Value
+type stringValue string
+
+func newStringValue(val string, p *string) *stringValue {
+	*p = val
+	return (*stringValue)(p)
+}
+
+func (s *stringValue) Set(val string) error {
+	*s = stringValue(val)
+	return nil
+}
+func (s *stringValue) Type() string {
+	return "string"
+}
+
+func (s *stringValue) String() string { return fmt.Sprintf("%s", *s) }
+
+func stringConv(sval string) (interface{}, error) {
+	return sval, nil
+}
+
+// GetString return the string value of a flag with the given name
+func (f *FlagSet) GetString(name string) (string, error) {
+	val, err := f.getFlagType(name, "string", stringConv)
+	if err != nil {
+		return "", err
+	}
+	return val.(string), nil
+}
+
+// StringVar defines a string flag with specified name, default value, and usage string.
+// The argument p points to a string variable in which to store the value of the flag.
+func (f *FlagSet) StringVar(p *string, name string, value string, usage string) {
+	f.VarP(newStringValue(value, p), name, "", usage)
+}
+
+// Like StringVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) StringVarP(p *string, name, shorthand string, value string, usage string) {
+	f.VarP(newStringValue(value, p), name, shorthand, usage)
+}
+
+// StringVar defines a string flag with specified name, default value, and usage string.
+// The argument p points to a string variable in which to store the value of the flag.
+func StringVar(p *string, name string, value string, usage string) {
+	CommandLine.VarP(newStringValue(value, p), name, "", usage)
+}
+
+// Like StringVar, but accepts a shorthand letter that can be used after a single dash.
+func StringVarP(p *string, name, shorthand string, value string, usage string) {
+	CommandLine.VarP(newStringValue(value, p), name, shorthand, usage)
+}
+
+// String defines a string flag with specified name, default value, and usage string.
+// The return value is the address of a string variable that stores the value of the flag.
+func (f *FlagSet) String(name string, value string, usage string) *string {
+	p := new(string)
+	f.StringVarP(p, name, "", value, usage)
+	return p
+}
+
+// Like String, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string {
+	p := new(string)
+	f.StringVarP(p, name, shorthand, value, usage)
+	return p
+}
+
+// String defines a string flag with specified name, default value, and usage string.
+// The return value is the address of a string variable that stores the value of the flag.
+func String(name string, value string, usage string) *string {
+	return CommandLine.StringP(name, "", value, usage)
+}
+
+// Like String, but accepts a shorthand letter that can be used after a single dash.
+func StringP(name, shorthand string, value string, usage string) *string {
+	return CommandLine.StringP(name, shorthand, value, usage)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/spf13/pflag/string_slice.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/spf13/pflag/string_slice.go b/newt/Godeps/_workspace/src/github.com/spf13/pflag/string_slice.go
new file mode 100644
index 0000000..bbe6e00
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/spf13/pflag/string_slice.go
@@ -0,0 +1,86 @@
+package pflag
+
+import (
+	"strings"
+)
+
+// -- stringSlice Value
+type stringSliceValue []string
+
+func newStringSliceValue(val []string, p *[]string) *stringSliceValue {
+	*p = val
+	return (*stringSliceValue)(p)
+}
+
+func (s *stringSliceValue) Set(val string) error {
+	v := strings.Split(val, ",")
+	*s = stringSliceValue(v)
+	return nil
+}
+func (s *stringSliceValue) Type() string {
+	return "stringSlice"
+}
+
+func (s *stringSliceValue) String() string { return strings.Join(*s, ",") }
+
+func stringSliceConv(sval string) (interface{}, error) {
+	v := strings.Split(sval, ",")
+	return v, nil
+}
+
+// GetStringSlice return the []string value of a flag with the given name
+func (f *FlagSet) GetStringSlice(name string) ([]string, error) {
+	val, err := f.getFlagType(name, "stringSlice", stringSliceConv)
+	if err != nil {
+		return []string{}, err
+	}
+	return val.([]string), nil
+}
+
+// StringSliceVar defines a string flag with specified name, default value, and usage string.
+// The argument p points to a []string variable in which to store the value of the flag.
+func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) {
+	f.VarP(newStringSliceValue(value, p), name, "", usage)
+}
+
+// Like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {
+	f.VarP(newStringSliceValue(value, p), name, shorthand, usage)
+}
+
+// StringSliceVar defines a string flag with specified name, default value, and usage string.
+// The argument p points to a []string variable in which to store the value of the flag.
+func StringSliceVar(p *[]string, name string, value []string, usage string) {
+	CommandLine.VarP(newStringSliceValue(value, p), name, "", usage)
+}
+
+// Like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
+func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {
+	CommandLine.VarP(newStringSliceValue(value, p), name, shorthand, usage)
+}
+
+// StringSlice defines a string flag with specified name, default value, and usage string.
+// The return value is the address of a []string variable that stores the value of the flag.
+func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string {
+	p := make([]string, 0)
+	f.StringSliceVarP(&p, name, "", value, usage)
+	return &p
+}
+
+// Like StringSlice, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage string) *[]string {
+	p := make([]string, 0)
+	f.StringSliceVarP(&p, name, shorthand, value, usage)
+	return &p
+}
+
+// StringSlice defines a string flag with specified name, default value, and usage string.
+// The return value is the address of a []string variable that stores the value of the flag.
+func StringSlice(name string, value []string, usage string) *[]string {
+	return CommandLine.StringSliceP(name, "", value, usage)
+}
+
+// Like StringSlice, but accepts a shorthand letter that can be used after a single dash.
+func StringSliceP(name, shorthand string, value []string, usage string) *[]string {
+	return CommandLine.StringSliceP(name, shorthand, value, usage)
+}



[19/42] incubator-mynewt-newt git commit: Move newt source into a "newt" subdirectory.

Posted by cc...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/compat.h
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/compat.h b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/compat.h
new file mode 100644
index 0000000..5550970
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/compat.h
@@ -0,0 +1,380 @@
+
+/* generated by compatgen.py */
+#include<curl/curl.h>
+
+
+
+#if (LIBCURL_VERSION_MINOR == 36 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 36 
+#define CURLOPT_SSL_ENABLE_NPN 0
+#define CURLOPT_SSL_ENABLE_ALPN 0
+#define CURLOPT_EXPECT_100_TIMEOUT_MS 0
+#if (LIBCURL_VERSION_MINOR == 35 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 35 
+#if (LIBCURL_VERSION_MINOR == 34 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 34 
+#define CURLOPT_LOGIN_OPTIONS 0
+#define CURLINFO_TLS_SESSION 0
+#if (LIBCURL_VERSION_MINOR == 33 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 33 
+#define CURLOPT_XOAUTH2_BEARER 0
+#define CURLOPT_DNS_INTERFACE 0
+#define CURLOPT_DNS_LOCAL_IP4 0
+#define CURLOPT_DNS_LOCAL_IP6 0
+#define CURL_VERSION_HTTP2 0
+#if (LIBCURL_VERSION_MINOR == 32 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 32 
+#define CURLOPT_XFERINFODATA 0
+#define CURLOPT_XFERINFOFUNCTION 0
+#if (LIBCURL_VERSION_MINOR == 31 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 31 
+#define CURLOPT_SASL_IR 0
+#if (LIBCURL_VERSION_MINOR == 30 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 30 
+#define CURLE_NO_CONNECTION_AVAILABLE -1
+#if (LIBCURL_VERSION_MINOR == 29 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 29 
+#if (LIBCURL_VERSION_MINOR == 28 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 28 
+#if (LIBCURL_VERSION_MINOR == 28 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 28 
+#if (LIBCURL_VERSION_MINOR == 27 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 27 
+#if (LIBCURL_VERSION_MINOR == 26 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 26 
+#if (LIBCURL_VERSION_MINOR == 25 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 25 
+#define CURLOPT_TCP_KEEPALIVE 0
+#define CURLOPT_TCP_KEEPIDLE 0
+#define CURLOPT_TCP_KEEPINTVL 0
+#define CURLOPT_SSL_OPTIONS 0
+#define CURLOPT_MAIL_AUTH 0
+#if (LIBCURL_VERSION_MINOR == 24 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 24 
+#define CURLOPT_DNS_SERVERS 0
+#define CURLOPT_ACCEPTTIMEOUT_MS 0
+#define CURLE_FTP_ACCEPT_FAILED -1
+#define CURLE_FTP_ACCEPT_TIMEOUT -1
+#if (LIBCURL_VERSION_MINOR == 23 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 23 
+#if (LIBCURL_VERSION_MINOR == 23 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 23 
+#if (LIBCURL_VERSION_MINOR == 22 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 22 
+#define CURLOPT_GSSAPI_DELEGATION 0
+#define CURL_VERSION_NTLM_WB 0
+#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 7) || LIBCURL_VERSION_MINOR < 21 
+#define CURLOPT_CLOSESOCKETFUNCTION 0
+#define CURLOPT_CLOSESOCKETDATA 0
+#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 6) || LIBCURL_VERSION_MINOR < 21 
+#define CURLOPT_ACCEPT_ENCODING 0
+#define CURLOPT_TRANSFER_ENCODING 0
+#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 5) || LIBCURL_VERSION_MINOR < 21 
+#define CURLE_NOT_BUILT_IN -1
+#define CURLE_UNKNOWN_OPTION -1
+#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 4) || LIBCURL_VERSION_MINOR < 21 
+#define CURLOPT_TLSAUTH_USERNAME 0
+#define CURLOPT_TLSAUTH_PASSWORD 0
+#define CURLOPT_TLSAUTH_TYPE 0
+#define CURL_VERSION_TLSAUTH_SRP 0
+#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 21 
+#define CURLOPT_RESOLVE 0
+#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 21 
+#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 21 
+#if (LIBCURL_VERSION_MINOR == 21 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 21 
+#define CURLOPT_WILDCARDMATCH 0
+#define CURLOPT_CHUNK_BGN_FUNCTION 0
+#define CURLOPT_CHUNK_END_FUNCTION 0
+#define CURLOPT_FNMATCH_FUNCTION 0
+#define CURLOPT_CHUNK_DATA 0
+#define CURLOPT_FNMATCH_DATA 0
+#define CURLE_FTP_BAD_FILE_LIST -1
+#define CURLE_CHUNK_FAILED -1
+#define CURLINFO_PRIMARY_PORT 0
+#define CURLINFO_LOCAL_IP 0
+#define CURLINFO_LOCAL_PORT 0
+#if (LIBCURL_VERSION_MINOR == 20 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 20 
+#if (LIBCURL_VERSION_MINOR == 20 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 20 
+#define CURLOPT_SERVER_RESPONSE_TIMEOUT 0
+#define CURLOPT_MAIL_FROM 0
+#define CURLOPT_MAIL_RCPT 0
+#define CURLOPT_FTP_USE_PRET 0
+#define CURLOPT_RTSP_REQUEST 0
+#define CURLOPT_RTSP_SESSION_ID 0
+#define CURLOPT_RTSP_STREAM_URI 0
+#define CURLOPT_RTSP_TRANSPORT 0
+#define CURLOPT_RTSP_CLIENT_CSEQ 0
+#define CURLOPT_RTSP_SERVER_CSEQ 0
+#define CURLOPT_INTERLEAVEDATA 0
+#define CURLOPT_INTERLEAVEFUNCTION 0
+#define CURLOPT_RTSPHEADER 0
+#define CURLE_FTP_PRET_FAILED -1
+#define CURLE_RTSP_CSEQ_ERROR -1
+#define CURLE_RTSP_SESSION_ERROR -1
+#define CURLINFO_RTSP_SESSION_ID 0
+#define CURLINFO_RTSP_CLIENT_CSEQ 0
+#define CURLINFO_RTSP_SERVER_CSEQ 0
+#define CURLINFO_RTSP_CSEQ_RECV 0
+#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 7) || LIBCURL_VERSION_MINOR < 19 
+#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 6) || LIBCURL_VERSION_MINOR < 19 
+#define CURLOPT_SSH_KNOWNHOSTS 0
+#define CURLOPT_SSH_KEYFUNCTION 0
+#define CURLOPT_SSH_KEYDATA 0
+#define CURL_VERSION_CURLDEBUG 0
+#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 5) || LIBCURL_VERSION_MINOR < 19 
+#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 4) || LIBCURL_VERSION_MINOR < 19 
+#define CURLOPT_NOPROXY 0
+#define CURLOPT_TFTP_BLKSIZE 0
+#define CURLOPT_SOCKS5_GSSAPI_SERVICE 0
+#define CURLOPT_SOCKS5_GSSAPI_NEC 0
+#define CURLOPT_PROTOCOLS 0
+#define CURLOPT_REDIR_PROTOCOLS 0
+#define CURLINFO_CONDITION_UNMET 0
+#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 19 
+#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 19 
+#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 19 
+#define CURLOPT_POSTREDIR 0
+#define CURLOPT_CERTINFO 0
+#define CURLOPT_USERNAME 0
+#define CURLOPT_PASSWORD 0
+#define CURLOPT_PROXYUSERNAME 0
+#define CURLOPT_PROXYPASSWORD 0
+#define CURLINFO_CERTINFO 0
+#if (LIBCURL_VERSION_MINOR == 19 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 19 
+#define CURLOPT_CRLFILE 0
+#define CURLOPT_ISSUERCERT 0
+#define CURLOPT_ADDRESS_SCOPE 0
+#define CURLE_SSL_CRL_BADFILE -1
+#define CURLE_SSL_ISSUER_ERROR -1
+#define CURLINFO_PRIMARY_IP 0
+#define CURLINFO_APPCONNECT_TIME 0
+#if (LIBCURL_VERSION_MINOR == 18 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 18 
+#define CURLE_AGAIN -1
+#define CURLINFO_REDIRECT_URL 0
+#if (LIBCURL_VERSION_MINOR == 18 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 18 
+#if (LIBCURL_VERSION_MINOR == 18 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 18 
+#define CURLOPT_PROXY_TRANSFER_MODE 0
+#define CURLOPT_SEEKFUNCTION 0
+#define CURLOPT_SEEKDATA 0
+#if (LIBCURL_VERSION_MINOR == 17 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 17 
+#define CURLOPT_POST301 0
+#define CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 0
+#define CURLOPT_OPENSOCKETFUNCTION 0
+#define CURLOPT_OPENSOCKETDATA 0
+#define CURLOPT_COPYPOSTFIELDS 0
+#define CURLE_PEER_FAILED_VERIFICATION -1
+#if (LIBCURL_VERSION_MINOR == 17 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 17 
+#define CURLOPT_LOW_SPEED_LIMIT 0
+#define CURLOPT_KEYPASSWD 0
+#define CURLOPT_DIRLISTONLY 0
+#define CURLOPT_APPEND 0
+#define CURLOPT_FTP_RESPONSE_TIMEOUT 0
+#define CURLOPT_USE_SSL 0
+#define CURLE_OBSOLETE4 -1
+#define CURLE_REMOTE_ACCESS_DENIED -1
+#define CURLE_OBSOLETE10 -1
+#define CURLE_OBSOLETE12 -1
+#define CURLE_OBSOLETE16 -1
+#define CURLE_FTP_COULDNT_SET_TYPE -1
+#define CURLE_OBSOLETE20 -1
+#define CURLE_QUOTE_ERROR -1
+#define CURLE_OBSOLETE24 -1
+#define CURLE_OBSOLETE29 -1
+#define CURLE_OBSOLETE32 -1
+#define CURLE_RANGE_ERROR -1
+#define CURLE_OBSOLETE40 -1
+#define CURLE_OBSOLETE44 -1
+#define CURLE_OBSOLETE46 -1
+#define CURLE_OBSOLETE50 -1
+#define CURLE_OBSOLETE57 -1
+#define CURLE_USE_SSL_FAILED -1
+#define CURLE_REMOTE_DISK_FULL -1
+#define CURLE_REMOTE_FILE_EXISTS -1
+#if (LIBCURL_VERSION_MINOR == 16 && LIBCURL_VERSION_PATCH < 4) || LIBCURL_VERSION_MINOR < 16 
+#define CURLOPT_KRBLEVEL 0
+#define CURLOPT_NEW_FILE_PERMS 0
+#define CURLOPT_NEW_DIRECTORY_PERMS 0
+#if (LIBCURL_VERSION_MINOR == 16 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 16 
+#define CURLE_UPLOAD_FAILED -1
+#if (LIBCURL_VERSION_MINOR == 16 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 16 
+#define CURLOPT_TIMEOUT_MS 0
+#define CURLOPT_CONNECTTIMEOUT_MS 0
+#define CURLOPT_HTTP_TRANSFER_DECODING 0
+#define CURLOPT_HTTP_CONTENT_DECODING 0
+#if (LIBCURL_VERSION_MINOR == 16 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 16 
+#define CURLOPT_SSH_AUTH_TYPES 0
+#define CURLOPT_SSH_PUBLIC_KEYFILE 0
+#define CURLOPT_SSH_PRIVATE_KEYFILE 0
+#define CURLOPT_FTP_SSL_CCC 0
+#define CURLE_REMOTE_FILE_NOT_FOUND -1
+#define CURLE_SSH -1
+#define CURLE_SSL_SHUTDOWN_FAILED -1
+#if (LIBCURL_VERSION_MINOR == 16 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 16 
+#define CURLOPT_SOCKOPTFUNCTION 0
+#define CURLOPT_SOCKOPTDATA 0
+#define CURLOPT_SSL_SESSIONID_CACHE 0
+#define CURLE_SSL_CACERT_BADFILE -1
+#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 5) || LIBCURL_VERSION_MINOR < 15 
+#define CURLOPT_MAX_SEND_SPEED_LARGE 0
+#define CURLOPT_MAX_RECV_SPEED_LARGE 0
+#define CURLOPT_FTP_ALTERNATIVE_TO_USER 0
+#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 4) || LIBCURL_VERSION_MINOR < 15 
+#define CURLOPT_CONV_FROM_NETWORK_FUNCTION 0
+#define CURLOPT_CONV_TO_NETWORK_FUNCTION 0
+#define CURLOPT_CONV_FROM_UTF8_FUNCTION 0
+#define CURLE_CONV_FAILED -1
+#define CURLE_CONV_REQD -1
+#define CURLINFO_FTP_ENTRY_PATH 0
+#define CURL_VERSION_CONV 0
+#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 15 
+#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 15 
+#define CURLOPT_LOCALPORT 0
+#define CURLOPT_LOCALPORTRANGE 0
+#define CURLOPT_CONNECT_ONLY 0
+#define CURLINFO_LASTSOCKET 0
+#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 15 
+#define CURLOPT_FTP_FILEMETHOD 0
+#if (LIBCURL_VERSION_MINOR == 15 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 15 
+#define CURLOPT_FTP_SKIP_PASV_IP 0
+#define CURLE_TFTP_NOTFOUND -1
+#define CURLE_TFTP_PERM -1
+#define CURLE_TFTP_DISKFULL -1
+#define CURLE_TFTP_ILLEGAL -1
+#define CURLE_TFTP_UNKNOWNID -1
+#define CURLE_TFTP_EXISTS -1
+#define CURLE_TFTP_NOSUCHUSER -1
+#if (LIBCURL_VERSION_MINOR == 14 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 14 
+#define CURLOPT_COOKIELIST 0
+#define CURLOPT_IGNORE_CONTENT_LENGTH 0
+#define CURLINFO_COOKIELIST 0
+#if (LIBCURL_VERSION_MINOR == 14 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 14 
+#if (LIBCURL_VERSION_MINOR == 13 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 13 
+#define CURL_VERSION_SSPI 0
+#if (LIBCURL_VERSION_MINOR == 13 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 13 
+#define CURLE_LOGIN_DENIED -1
+#if (LIBCURL_VERSION_MINOR == 13 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 13 
+#define CURLOPT_SOURCE_URL 0
+#define CURLOPT_SOURCE_QUOTE 0
+#define CURLOPT_FTP_ACCOUNT 0
+#if (LIBCURL_VERSION_MINOR == 12 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 12 
+#define CURLOPT_IOCTLFUNCTION 0
+#define CURLOPT_IOCTLDATA 0
+#define CURLE_SEND_FAIL_REWIND -1
+#define CURLE_SSL_ENGINE_INITFAILED -1
+#define CURLINFO_NUM_CONNECTS 0
+#define CURLINFO_SSL_ENGINES 0
+#if (LIBCURL_VERSION_MINOR == 12 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 12 
+#define CURLOPT_FTPSSLAUTH 0
+#define CURLINFO_OS_ERRNO 0
+#if (LIBCURL_VERSION_MINOR == 12 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 12 
+#define CURLOPT_SOURCE_HOST 0
+#define CURLOPT_SOURCE_USERPWD 0
+#define CURLOPT_SOURCE_PATH 0
+#define CURLOPT_SOURCE_PORT 0
+#define CURLOPT_PASV_HOST 0
+#define CURLOPT_SOURCE_PREQUOTE 0
+#define CURLOPT_SOURCE_POSTQUOTE 0
+#if (LIBCURL_VERSION_MINOR == 12 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 12 
+#define CURLE_INTERFACE_FAILED -1
+#define CURL_VERSION_IDN 0
+#if (LIBCURL_VERSION_MINOR == 11 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 11 
+#define CURLOPT_TCP_NODELAY 0
+#if (LIBCURL_VERSION_MINOR == 11 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 11 
+#define CURLOPT_POSTFIELDSIZE_LARGE 0
+#define CURL_VERSION_LARGEFILE 0
+#if (LIBCURL_VERSION_MINOR == 11 && LIBCURL_VERSION_PATCH < 0) || LIBCURL_VERSION_MINOR < 11 
+#define CURLOPT_INFILESIZE_LARGE 0
+#define CURLOPT_RESUME_FROM_LARGE 0
+#define CURLOPT_MAXFILESIZE_LARGE 0
+#define CURLOPT_NETRC_FILE 0
+#define CURLOPT_FTP_SSL 0
+#define CURLE_FTP_SSL_FAILED -1
+#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 8) || LIBCURL_VERSION_MINOR < 10 
+#define CURLOPT_IPRESOLVE 0
+#define CURLOPT_MAXFILESIZE 0
+#define CURLE_LDAP_INVALID_URL -1
+#define CURLE_FILESIZE_EXCEEDED -1
+#define CURLINFO_RESPONSE_CODE 0
+#define CURLINFO_HTTPAUTH_AVAIL 0
+#define CURLINFO_PROXYAUTH_AVAIL 0
+#define CURL_VERSION_SPNEGO 0
+#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 7) || LIBCURL_VERSION_MINOR < 10 
+#define CURLOPT_FTP_CREATE_MISSING_DIRS 0
+#define CURLOPT_PROXYAUTH 0
+#define CURLINFO_HTTP_CONNECTCODE 0
+#define CURL_VERSION_ASYNCHDNS 0
+#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 6) || LIBCURL_VERSION_MINOR < 10 
+#define CURLOPT_HTTPAUTH 0
+#define CURLOPT_SSL_CTX_FUNCTION 0
+#define CURLOPT_SSL_CTX_DATA 0
+#define CURL_VERSION_NTLM 0
+#define CURL_VERSION_GSSNEGOTIATE 0
+#define CURL_VERSION_DEBUG 0
+#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 5) || LIBCURL_VERSION_MINOR < 10 
+#define CURLOPT_FTP_USE_EPRT 0
+#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 4) || LIBCURL_VERSION_MINOR < 10 
+#define CURLOPT_UNRESTRICTED_AUTH 0
+#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 3) || LIBCURL_VERSION_MINOR < 10 
+#define CURLOPT_PRIVATE 0
+#define CURLOPT_HTTP200ALIASES 0
+#define CURLE_HTTP_RETURNED_ERROR -1
+#define CURLINFO_PRIVATE 0
+#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 2) || LIBCURL_VERSION_MINOR < 10 
+#define CURLE_OPERATION_TIMEDOUT -1
+#if (LIBCURL_VERSION_MINOR == 10 && LIBCURL_VERSION_PATCH < 1) || LIBCURL_VERSION_MINOR < 10 
+#error your version is TOOOOOOOO low
+#endif /* 7.10.1 */
+#endif /* 7.10.2 */
+#endif /* 7.10.3 */
+#endif /* 7.10.4 */
+#endif /* 7.10.5 */
+#endif /* 7.10.6 */
+#endif /* 7.10.7 */
+#endif /* 7.10.8 */
+#endif /* 7.11.0 */
+#endif /* 7.11.1 */
+#endif /* 7.11.2 */
+#endif /* 7.12.0 */
+#endif /* 7.12.1 */
+#endif /* 7.12.2 */
+#endif /* 7.12.3 */
+#endif /* 7.13.0 */
+#endif /* 7.13.1 */
+#endif /* 7.13.2 */
+#endif /* 7.14.0 */
+#endif /* 7.14.1 */
+#endif /* 7.15.0 */
+#endif /* 7.15.1 */
+#endif /* 7.15.2 */
+#endif /* 7.15.3 */
+#endif /* 7.15.4 */
+#endif /* 7.15.5 */
+#endif /* 7.16.0 */
+#endif /* 7.16.1 */
+#endif /* 7.16.2 */
+#endif /* 7.16.3 */
+#endif /* 7.16.4 */
+#endif /* 7.17.0 */
+#endif /* 7.17.1 */
+#endif /* 7.18.0 */
+#endif /* 7.18.1 */
+#endif /* 7.18.2 */
+#endif /* 7.19.0 */
+#endif /* 7.19.1 */
+#endif /* 7.19.2 */
+#endif /* 7.19.3 */
+#endif /* 7.19.4 */
+#endif /* 7.19.5 */
+#endif /* 7.19.6 */
+#endif /* 7.19.7 */
+#endif /* 7.20.0 */
+#endif /* 7.20.1 */
+#endif /* 7.21.0 */
+#endif /* 7.21.1 */
+#endif /* 7.21.2 */
+#endif /* 7.21.3 */
+#endif /* 7.21.4 */
+#endif /* 7.21.5 */
+#endif /* 7.21.6 */
+#endif /* 7.21.7 */
+#endif /* 7.22.0 */
+#endif /* 7.23.0 */
+#endif /* 7.23.1 */
+#endif /* 7.24.0 */
+#endif /* 7.25.0 */
+#endif /* 7.26.0 */
+#endif /* 7.27.0 */
+#endif /* 7.28.0 */
+#endif /* 7.28.1 */
+#endif /* 7.29.0 */
+#endif /* 7.30.0 */
+#endif /* 7.31.0 */
+#endif /* 7.32.0 */
+#endif /* 7.33.0 */
+#endif /* 7.34.0 */
+#endif /* 7.35.0 */
+#endif /* 7.36.0 */
+/* generated ends */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/const.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/const.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/const.go
new file mode 100644
index 0000000..8635486
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/const.go
@@ -0,0 +1,179 @@
+package curl
+
+/*
+#include <curl/curl.h>
+#include "compat.h"
+
+*/
+import "C"
+
+// for GlobalInit(flag)
+const (
+	GLOBAL_SSL     = C.CURL_GLOBAL_SSL
+	GLOBAL_WIN32   = C.CURL_GLOBAL_WIN32
+	GLOBAL_ALL     = C.CURL_GLOBAL_ALL
+	GLOBAL_NOTHING = C.CURL_GLOBAL_NOTHING
+	GLOBAL_DEFAULT = C.CURL_GLOBAL_DEFAULT
+)
+
+// CURLMcode
+const (
+	M_CALL_MULTI_PERFORM = C.CURLM_CALL_MULTI_PERFORM
+	//        M_OK                 = C.CURLM_OK
+	M_BAD_HANDLE      = C.CURLM_BAD_HANDLE
+	M_BAD_EASY_HANDLE = C.CURLM_BAD_EASY_HANDLE
+	M_OUT_OF_MEMORY   = C.CURLM_OUT_OF_MEMORY
+	M_INTERNAL_ERROR  = C.CURLM_INTERNAL_ERROR
+	M_BAD_SOCKET      = C.CURLM_BAD_SOCKET
+	M_UNKNOWN_OPTION  = C.CURLM_UNKNOWN_OPTION
+)
+
+// for multi.Setopt(flag, ...)
+const (
+	MOPT_SOCKETFUNCTION = C.CURLMOPT_SOCKETFUNCTION
+	MOPT_SOCKETDATA     = C.CURLMOPT_SOCKETDATA
+	MOPT_PIPELINING     = C.CURLMOPT_PIPELINING
+	MOPT_TIMERFUNCTION  = C.CURLMOPT_TIMERFUNCTION
+	MOPT_TIMERDATA      = C.CURLMOPT_TIMERDATA
+	MOPT_MAXCONNECTS    = C.CURLMOPT_MAXCONNECTS
+)
+
+// CURLSHcode
+const (
+	//        SHE_OK         = C.CURLSHE_OK
+	SHE_BAD_OPTION = C.CURLSHE_BAD_OPTION
+	SHE_IN_USE     = C.CURLSHE_IN_USE
+	SHE_INVALID    = C.CURLSHE_INVALID
+	SHE_NOMEM      = C.CURLSHE_NOMEM
+)
+
+// for share.Setopt(flat, ...)
+const (
+	SHOPT_SHARE      = C.CURLSHOPT_SHARE
+	SHOPT_UNSHARE    = C.CURLSHOPT_UNSHARE
+	SHOPT_LOCKFUNC   = C.CURLSHOPT_LOCKFUNC
+	SHOPT_UNLOCKFUNC = C.CURLSHOPT_UNLOCKFUNC
+	SHOPT_USERDATA   = C.CURLSHOPT_USERDATA
+)
+
+// for share.Setopt(SHOPT_SHARE/SHOPT_UNSHARE, flag)
+const (
+	LOCK_DATA_SHARE       = C.CURL_LOCK_DATA_SHARE
+	LOCK_DATA_COOKIE      = C.CURL_LOCK_DATA_COOKIE
+	LOCK_DATA_DNS         = C.CURL_LOCK_DATA_DNS
+	LOCK_DATA_SSL_SESSION = C.CURL_LOCK_DATA_SSL_SESSION
+	LOCK_DATA_CONNECT     = C.CURL_LOCK_DATA_CONNECT
+)
+
+// for VersionInfo(flag)
+const (
+	VERSION_FIRST  = C.CURLVERSION_FIRST
+	VERSION_SECOND = C.CURLVERSION_SECOND
+	VERSION_THIRD  = C.CURLVERSION_THIRD
+	// VERSION_FOURTH = C.CURLVERSION_FOURTH
+	VERSION_LAST = C.CURLVERSION_LAST
+	VERSION_NOW  = C.CURLVERSION_NOW
+)
+
+// for VersionInfo(...).Features mask flag
+const (
+	VERSION_IPV6         = C.CURL_VERSION_IPV6
+	VERSION_KERBEROS4    = C.CURL_VERSION_KERBEROS4
+	VERSION_SSL          = C.CURL_VERSION_SSL
+	VERSION_LIBZ         = C.CURL_VERSION_LIBZ
+	VERSION_NTLM         = C.CURL_VERSION_NTLM
+	VERSION_GSSNEGOTIATE = C.CURL_VERSION_GSSNEGOTIATE
+	VERSION_DEBUG        = C.CURL_VERSION_DEBUG
+	VERSION_ASYNCHDNS    = C.CURL_VERSION_ASYNCHDNS
+	VERSION_SPNEGO       = C.CURL_VERSION_SPNEGO
+	VERSION_LARGEFILE    = C.CURL_VERSION_LARGEFILE
+	VERSION_IDN          = C.CURL_VERSION_IDN
+	VERSION_SSPI         = C.CURL_VERSION_SSPI
+	VERSION_CONV         = C.CURL_VERSION_CONV
+	VERSION_CURLDEBUG    = C.CURL_VERSION_CURLDEBUG
+	VERSION_TLSAUTH_SRP  = C.CURL_VERSION_TLSAUTH_SRP
+	VERSION_NTLM_WB      = C.CURL_VERSION_NTLM_WB
+)
+
+// for OPT_READFUNCTION, return a int flag
+const (
+	READFUNC_ABORT = C.CURL_READFUNC_ABORT
+	READFUNC_PAUSE = C.CURL_READFUNC_PAUSE
+)
+
+// for easy.Setopt(OPT_HTTP_VERSION, flag)
+const (
+	HTTP_VERSION_NONE = C.CURL_HTTP_VERSION_NONE
+	HTTP_VERSION_1_0  = C.CURL_HTTP_VERSION_1_0
+	HTTP_VERSION_1_1  = C.CURL_HTTP_VERSION_1_1
+)
+
+// for easy.Setopt(OPT_PROXYTYPE, flag)
+const (
+	PROXY_HTTP     = C.CURLPROXY_HTTP     /* added in 7.10, new in 7.19.4 default is to use CONNECT HTTP/1.1 */
+	PROXY_HTTP_1_0 = C.CURLPROXY_HTTP_1_0 /* added in 7.19.4, force to use CONNECT HTTP/1.0  */
+	PROXY_SOCKS4   = C.CURLPROXY_SOCKS4   /* support added in 7.15.2, enum existed already in 7.10 */
+	PROXY_SOCKS5   = C.CURLPROXY_SOCKS5   /* added in 7.10 */
+	PROXY_SOCKS4A  = C.CURLPROXY_SOCKS4A  /* added in 7.18.0 */
+	// Use the SOCKS5 protocol but pass along the host name rather than the IP address.
+	PROXY_SOCKS5_HOSTNAME = C.CURLPROXY_SOCKS5_HOSTNAME
+)
+
+// for easy.Setopt(OPT_SSLVERSION, flag)
+const (
+	SSLVERSION_DEFAULT = C.CURL_SSLVERSION_DEFAULT
+	SSLVERSION_TLSv1   = C.CURL_SSLVERSION_TLSv1
+	SSLVERSION_SSLv2   = C.CURL_SSLVERSION_SSLv2
+	SSLVERSION_SSLv3   = C.CURL_SSLVERSION_SSLv3
+)
+
+// for easy.Setopt(OPT_TIMECONDITION, flag)
+const (
+	TIMECOND_NONE         = C.CURL_TIMECOND_NONE
+	TIMECOND_IFMODSINCE   = C.CURL_TIMECOND_IFMODSINCE
+	TIMECOND_IFUNMODSINCE = C.CURL_TIMECOND_IFUNMODSINCE
+	TIMECOND_LASTMOD      = C.CURL_TIMECOND_LASTMOD
+)
+
+// for easy.Setopt(OPT_NETRC, flag)
+const (
+	NETRC_IGNORED  = C.CURL_NETRC_IGNORED
+	NETRC_OPTIONAL = C.CURL_NETRC_OPTIONAL
+	NETRC_REQUIRED = C.CURL_NETRC_REQUIRED
+)
+
+// for easy.Setopt(OPT_FTP_CREATE_MISSING_DIRS, flag)
+const (
+	FTP_CREATE_DIR_NONE  = C.CURLFTP_CREATE_DIR_NONE
+	FTP_CREATE_DIR       = C.CURLFTP_CREATE_DIR
+	FTP_CREATE_DIR_RETRY = C.CURLFTP_CREATE_DIR_RETRY
+)
+
+// for easy.Setopt(OPT_IPRESOLVE, flag)
+const (
+	IPRESOLVE_WHATEVER = C.CURL_IPRESOLVE_WHATEVER
+	IPRESOLVE_V4       = C.CURL_IPRESOLVE_V4
+	IPRESOLVE_V6       = C.CURL_IPRESOLVE_V6
+)
+
+// for easy.Setopt(OPT_SSL_OPTIONS, flag)
+const (
+	SSLOPT_ALLOW_BEAST = 1
+)
+
+// for easy.Pause(flat)
+const (
+	PAUSE_RECV      = C.CURLPAUSE_RECV
+	PAUSE_RECV_CONT = C.CURLPAUSE_RECV_CONT
+	PAUSE_SEND      = C.CURLPAUSE_SEND
+	PAUSE_SEND_CONT = C.CURLPAUSE_SEND_CONT
+	PAUSE_ALL       = C.CURLPAUSE_ALL
+	PAUSE_CONT      = C.CURLPAUSE_CONT
+)
+
+// for multi.Info_read()
+const (
+	CURLMSG_NONE	= C.CURLMSG_NONE
+	CURLMSG_DONE	= C.CURLMSG_DONE
+	CURLMSG_LAST	= C.CURLMSG_LAST
+)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/const_gen.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/const_gen.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/const_gen.go
new file mode 100644
index 0000000..872138f
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/const_gen.go
@@ -0,0 +1,410 @@
+
+// generated by codegen.py
+
+package curl
+/*
+#include <curl/curl.h>
+#include "compat.h"
+*/
+import "C"
+
+// CURLcode
+const (
+	E_UNSUPPORTED_PROTOCOL    = C.CURLE_UNSUPPORTED_PROTOCOL
+	E_FAILED_INIT             = C.CURLE_FAILED_INIT
+	E_URL_MALFORMAT           = C.CURLE_URL_MALFORMAT
+	E_NOT_BUILT_IN            = C.CURLE_NOT_BUILT_IN
+	E_COULDNT_RESOLVE_PROXY   = C.CURLE_COULDNT_RESOLVE_PROXY
+	E_COULDNT_RESOLVE_HOST    = C.CURLE_COULDNT_RESOLVE_HOST
+	E_COULDNT_CONNECT         = C.CURLE_COULDNT_CONNECT
+	E_FTP_WEIRD_SERVER_REPLY  = C.CURLE_FTP_WEIRD_SERVER_REPLY
+	E_REMOTE_ACCESS_DENIED    = C.CURLE_REMOTE_ACCESS_DENIED
+	E_FTP_ACCEPT_FAILED       = C.CURLE_FTP_ACCEPT_FAILED
+	E_FTP_WEIRD_PASS_REPLY    = C.CURLE_FTP_WEIRD_PASS_REPLY
+	E_FTP_ACCEPT_TIMEOUT      = C.CURLE_FTP_ACCEPT_TIMEOUT
+	E_FTP_WEIRD_PASV_REPLY    = C.CURLE_FTP_WEIRD_PASV_REPLY
+	E_FTP_WEIRD_227_FORMAT    = C.CURLE_FTP_WEIRD_227_FORMAT
+	E_FTP_CANT_GET_HOST       = C.CURLE_FTP_CANT_GET_HOST
+	E_OBSOLETE16              = C.CURLE_OBSOLETE16
+	E_FTP_COULDNT_SET_TYPE    = C.CURLE_FTP_COULDNT_SET_TYPE
+	E_PARTIAL_FILE            = C.CURLE_PARTIAL_FILE
+	E_FTP_COULDNT_RETR_FILE   = C.CURLE_FTP_COULDNT_RETR_FILE
+	E_OBSOLETE20              = C.CURLE_OBSOLETE20
+	E_QUOTE_ERROR             = C.CURLE_QUOTE_ERROR
+	E_HTTP_RETURNED_ERROR     = C.CURLE_HTTP_RETURNED_ERROR
+	E_WRITE_ERROR             = C.CURLE_WRITE_ERROR
+	E_OBSOLETE24              = C.CURLE_OBSOLETE24
+	E_UPLOAD_FAILED           = C.CURLE_UPLOAD_FAILED
+	E_READ_ERROR              = C.CURLE_READ_ERROR
+	E_OUT_OF_MEMORY           = C.CURLE_OUT_OF_MEMORY
+	E_OPERATION_TIMEDOUT      = C.CURLE_OPERATION_TIMEDOUT
+	E_OBSOLETE29              = C.CURLE_OBSOLETE29
+	E_FTP_PORT_FAILED         = C.CURLE_FTP_PORT_FAILED
+	E_FTP_COULDNT_USE_REST    = C.CURLE_FTP_COULDNT_USE_REST
+	E_OBSOLETE32              = C.CURLE_OBSOLETE32
+	E_RANGE_ERROR             = C.CURLE_RANGE_ERROR
+	E_HTTP_POST_ERROR         = C.CURLE_HTTP_POST_ERROR
+	E_SSL_CONNECT_ERROR       = C.CURLE_SSL_CONNECT_ERROR
+	E_BAD_DOWNLOAD_RESUME     = C.CURLE_BAD_DOWNLOAD_RESUME
+	E_FILE_COULDNT_READ_FILE  = C.CURLE_FILE_COULDNT_READ_FILE
+	E_LDAP_CANNOT_BIND        = C.CURLE_LDAP_CANNOT_BIND
+	E_LDAP_SEARCH_FAILED      = C.CURLE_LDAP_SEARCH_FAILED
+	E_OBSOLETE40              = C.CURLE_OBSOLETE40
+	E_FUNCTION_NOT_FOUND      = C.CURLE_FUNCTION_NOT_FOUND
+	E_ABORTED_BY_CALLBACK     = C.CURLE_ABORTED_BY_CALLBACK
+	E_BAD_FUNCTION_ARGUMENT   = C.CURLE_BAD_FUNCTION_ARGUMENT
+	E_OBSOLETE44              = C.CURLE_OBSOLETE44
+	E_INTERFACE_FAILED        = C.CURLE_INTERFACE_FAILED
+	E_OBSOLETE46              = C.CURLE_OBSOLETE46
+	E_UNKNOWN_OPTION          = C.CURLE_UNKNOWN_OPTION
+	E_OBSOLETE50              = C.CURLE_OBSOLETE50
+	E_PEER_FAILED_VERIFICATION = C.CURLE_PEER_FAILED_VERIFICATION
+	E_GOT_NOTHING             = C.CURLE_GOT_NOTHING
+	E_SSL_ENGINE_NOTFOUND     = C.CURLE_SSL_ENGINE_NOTFOUND
+	E_SSL_ENGINE_SETFAILED    = C.CURLE_SSL_ENGINE_SETFAILED
+	E_SEND_ERROR              = C.CURLE_SEND_ERROR
+	E_RECV_ERROR              = C.CURLE_RECV_ERROR
+	E_OBSOLETE57              = C.CURLE_OBSOLETE57
+	E_SSL_CERTPROBLEM         = C.CURLE_SSL_CERTPROBLEM
+	E_SSL_CIPHER              = C.CURLE_SSL_CIPHER
+	E_SSL_CACERT              = C.CURLE_SSL_CACERT
+	E_BAD_CONTENT_ENCODING    = C.CURLE_BAD_CONTENT_ENCODING
+	E_LDAP_INVALID_URL        = C.CURLE_LDAP_INVALID_URL
+	E_FILESIZE_EXCEEDED       = C.CURLE_FILESIZE_EXCEEDED
+	E_USE_SSL_FAILED          = C.CURLE_USE_SSL_FAILED
+	E_SEND_FAIL_REWIND        = C.CURLE_SEND_FAIL_REWIND
+	E_SSL_ENGINE_INITFAILED   = C.CURLE_SSL_ENGINE_INITFAILED
+	E_LOGIN_DENIED            = C.CURLE_LOGIN_DENIED
+	E_TFTP_NOTFOUND           = C.CURLE_TFTP_NOTFOUND
+	E_TFTP_PERM               = C.CURLE_TFTP_PERM
+	E_REMOTE_DISK_FULL        = C.CURLE_REMOTE_DISK_FULL
+	E_TFTP_ILLEGAL            = C.CURLE_TFTP_ILLEGAL
+	E_TFTP_UNKNOWNID          = C.CURLE_TFTP_UNKNOWNID
+	E_REMOTE_FILE_EXISTS      = C.CURLE_REMOTE_FILE_EXISTS
+	E_TFTP_NOSUCHUSER         = C.CURLE_TFTP_NOSUCHUSER
+	E_CONV_FAILED             = C.CURLE_CONV_FAILED
+	E_CONV_REQD               = C.CURLE_CONV_REQD
+	E_SSL_CACERT_BADFILE      = C.CURLE_SSL_CACERT_BADFILE
+	E_REMOTE_FILE_NOT_FOUND   = C.CURLE_REMOTE_FILE_NOT_FOUND
+	E_SSH                     = C.CURLE_SSH
+	E_SSL_SHUTDOWN_FAILED     = C.CURLE_SSL_SHUTDOWN_FAILED
+	E_AGAIN                   = C.CURLE_AGAIN
+	E_SSL_CRL_BADFILE         = C.CURLE_SSL_CRL_BADFILE
+	E_SSL_ISSUER_ERROR        = C.CURLE_SSL_ISSUER_ERROR
+	E_FTP_PRET_FAILED         = C.CURLE_FTP_PRET_FAILED
+	E_RTSP_CSEQ_ERROR         = C.CURLE_RTSP_CSEQ_ERROR
+	E_RTSP_SESSION_ERROR      = C.CURLE_RTSP_SESSION_ERROR
+	E_FTP_BAD_FILE_LIST       = C.CURLE_FTP_BAD_FILE_LIST
+	E_CHUNK_FAILED            = C.CURLE_CHUNK_FAILED
+	E_NO_CONNECTION_AVAILABLE = C.CURLE_NO_CONNECTION_AVAILABLE
+	E_OBSOLETE10              = C.CURLE_OBSOLETE10
+	E_OBSOLETE12              = C.CURLE_OBSOLETE12
+	E_UNKNOWN_TELNET_OPTION   = C.CURLE_UNKNOWN_TELNET_OPTION
+	E_SSL_PEER_CERTIFICATE    = C.CURLE_SSL_PEER_CERTIFICATE
+	E_OBSOLETE                = C.CURLE_OBSOLETE
+	E_BAD_PASSWORD_ENTERED    = C.CURLE_BAD_PASSWORD_ENTERED
+	E_BAD_CALLING_ORDER       = C.CURLE_BAD_CALLING_ORDER
+	E_FTP_USER_PASSWORD_INCORRECT = C.CURLE_FTP_USER_PASSWORD_INCORRECT
+	E_FTP_CANT_RECONNECT      = C.CURLE_FTP_CANT_RECONNECT
+	E_FTP_COULDNT_GET_SIZE    = C.CURLE_FTP_COULDNT_GET_SIZE
+	E_FTP_COULDNT_SET_ASCII   = C.CURLE_FTP_COULDNT_SET_ASCII
+	E_FTP_WEIRD_USER_REPLY    = C.CURLE_FTP_WEIRD_USER_REPLY
+	E_FTP_WRITE_ERROR         = C.CURLE_FTP_WRITE_ERROR
+	E_LIBRARY_NOT_FOUND       = C.CURLE_LIBRARY_NOT_FOUND
+	E_MALFORMAT_USER          = C.CURLE_MALFORMAT_USER
+	E_SHARE_IN_USE            = C.CURLE_SHARE_IN_USE
+	E_URL_MALFORMAT_USER      = C.CURLE_URL_MALFORMAT_USER
+	E_FTP_ACCESS_DENIED       = C.CURLE_FTP_ACCESS_DENIED
+	E_FTP_COULDNT_SET_BINARY  = C.CURLE_FTP_COULDNT_SET_BINARY
+	E_FTP_QUOTE_ERROR         = C.CURLE_FTP_QUOTE_ERROR
+	E_TFTP_DISKFULL           = C.CURLE_TFTP_DISKFULL
+	E_TFTP_EXISTS             = C.CURLE_TFTP_EXISTS
+	E_HTTP_RANGE_ERROR        = C.CURLE_HTTP_RANGE_ERROR
+	E_FTP_SSL_FAILED          = C.CURLE_FTP_SSL_FAILED
+	E_OPERATION_TIMEOUTED     = C.CURLE_OPERATION_TIMEOUTED
+	E_HTTP_NOT_FOUND          = C.CURLE_HTTP_NOT_FOUND
+	E_HTTP_PORT_FAILED        = C.CURLE_HTTP_PORT_FAILED
+	E_FTP_COULDNT_STOR_FILE   = C.CURLE_FTP_COULDNT_STOR_FILE
+	E_FTP_PARTIAL_FILE        = C.CURLE_FTP_PARTIAL_FILE
+	E_FTP_BAD_DOWNLOAD_RESUME = C.CURLE_FTP_BAD_DOWNLOAD_RESUME
+	E_ALREADY_COMPLETE        = C.CURLE_ALREADY_COMPLETE
+)
+
+// easy.Setopt(flag, ...)
+const (
+	OPT_ENCODING                  = C.CURLOPT_ENCODING
+	OPT_FILE                      = C.CURLOPT_FILE
+	OPT_URL                       = C.CURLOPT_URL
+	OPT_PORT                      = C.CURLOPT_PORT
+	OPT_PROXY                     = C.CURLOPT_PROXY
+	OPT_USERPWD                   = C.CURLOPT_USERPWD
+	OPT_PROXYUSERPWD              = C.CURLOPT_PROXYUSERPWD
+	OPT_RANGE                     = C.CURLOPT_RANGE
+	OPT_INFILE                    = C.CURLOPT_INFILE
+	OPT_ERRORBUFFER               = C.CURLOPT_ERRORBUFFER
+	OPT_WRITEFUNCTION             = C.CURLOPT_WRITEFUNCTION
+	OPT_READFUNCTION              = C.CURLOPT_READFUNCTION
+	OPT_TIMEOUT                   = C.CURLOPT_TIMEOUT
+	OPT_INFILESIZE                = C.CURLOPT_INFILESIZE
+	OPT_POSTFIELDS                = C.CURLOPT_POSTFIELDS
+	OPT_REFERER                   = C.CURLOPT_REFERER
+	OPT_FTPPORT                   = C.CURLOPT_FTPPORT
+	OPT_USERAGENT                 = C.CURLOPT_USERAGENT
+	OPT_LOW_SPEED_LIMIT           = C.CURLOPT_LOW_SPEED_LIMIT
+	OPT_LOW_SPEED_TIME            = C.CURLOPT_LOW_SPEED_TIME
+	OPT_RESUME_FROM               = C.CURLOPT_RESUME_FROM
+	OPT_COOKIE                    = C.CURLOPT_COOKIE
+	OPT_HTTPHEADER                = C.CURLOPT_HTTPHEADER
+	OPT_HTTPPOST                  = C.CURLOPT_HTTPPOST
+	OPT_SSLCERT                   = C.CURLOPT_SSLCERT
+	OPT_KEYPASSWD                 = C.CURLOPT_KEYPASSWD
+	OPT_CRLF                      = C.CURLOPT_CRLF
+	OPT_QUOTE                     = C.CURLOPT_QUOTE
+	OPT_WRITEHEADER               = C.CURLOPT_WRITEHEADER
+	OPT_COOKIEFILE                = C.CURLOPT_COOKIEFILE
+	OPT_SSLVERSION                = C.CURLOPT_SSLVERSION
+	OPT_TIMECONDITION             = C.CURLOPT_TIMECONDITION
+	OPT_TIMEVALUE                 = C.CURLOPT_TIMEVALUE
+	OPT_CUSTOMREQUEST             = C.CURLOPT_CUSTOMREQUEST
+	OPT_STDERR                    = C.CURLOPT_STDERR
+	OPT_POSTQUOTE                 = C.CURLOPT_POSTQUOTE
+	OPT_WRITEINFO                 = C.CURLOPT_WRITEINFO
+	OPT_VERBOSE                   = C.CURLOPT_VERBOSE
+	OPT_HEADER                    = C.CURLOPT_HEADER
+	OPT_NOPROGRESS                = C.CURLOPT_NOPROGRESS
+	OPT_NOBODY                    = C.CURLOPT_NOBODY
+	OPT_FAILONERROR               = C.CURLOPT_FAILONERROR
+	OPT_UPLOAD                    = C.CURLOPT_UPLOAD
+	OPT_POST                      = C.CURLOPT_POST
+	OPT_DIRLISTONLY               = C.CURLOPT_DIRLISTONLY
+	OPT_APPEND                    = C.CURLOPT_APPEND
+	OPT_NETRC                     = C.CURLOPT_NETRC
+	OPT_FOLLOWLOCATION            = C.CURLOPT_FOLLOWLOCATION
+	OPT_TRANSFERTEXT              = C.CURLOPT_TRANSFERTEXT
+	OPT_PUT                       = C.CURLOPT_PUT
+	OPT_PROGRESSFUNCTION          = C.CURLOPT_PROGRESSFUNCTION
+	OPT_PROGRESSDATA              = C.CURLOPT_PROGRESSDATA
+	OPT_XFERINFODATA              = C.CURLOPT_XFERINFODATA
+	OPT_AUTOREFERER               = C.CURLOPT_AUTOREFERER
+	OPT_PROXYPORT                 = C.CURLOPT_PROXYPORT
+	OPT_POSTFIELDSIZE             = C.CURLOPT_POSTFIELDSIZE
+	OPT_HTTPPROXYTUNNEL           = C.CURLOPT_HTTPPROXYTUNNEL
+	OPT_INTERFACE                 = C.CURLOPT_INTERFACE
+	OPT_KRBLEVEL                  = C.CURLOPT_KRBLEVEL
+	OPT_SSL_VERIFYPEER            = C.CURLOPT_SSL_VERIFYPEER
+	OPT_CAINFO                    = C.CURLOPT_CAINFO
+	OPT_MAXREDIRS                 = C.CURLOPT_MAXREDIRS
+	OPT_FILETIME                  = C.CURLOPT_FILETIME
+	OPT_TELNETOPTIONS             = C.CURLOPT_TELNETOPTIONS
+	OPT_MAXCONNECTS               = C.CURLOPT_MAXCONNECTS
+	OPT_CLOSEPOLICY               = C.CURLOPT_CLOSEPOLICY
+	OPT_FRESH_CONNECT             = C.CURLOPT_FRESH_CONNECT
+	OPT_FORBID_REUSE              = C.CURLOPT_FORBID_REUSE
+	OPT_RANDOM_FILE               = C.CURLOPT_RANDOM_FILE
+	OPT_EGDSOCKET                 = C.CURLOPT_EGDSOCKET
+	OPT_CONNECTTIMEOUT            = C.CURLOPT_CONNECTTIMEOUT
+	OPT_HEADERFUNCTION            = C.CURLOPT_HEADERFUNCTION
+	OPT_HTTPGET                   = C.CURLOPT_HTTPGET
+	OPT_SSL_VERIFYHOST            = C.CURLOPT_SSL_VERIFYHOST
+	OPT_COOKIEJAR                 = C.CURLOPT_COOKIEJAR
+	OPT_SSL_CIPHER_LIST           = C.CURLOPT_SSL_CIPHER_LIST
+	OPT_HTTP_VERSION              = C.CURLOPT_HTTP_VERSION
+	OPT_FTP_USE_EPSV              = C.CURLOPT_FTP_USE_EPSV
+	OPT_SSLCERTTYPE               = C.CURLOPT_SSLCERTTYPE
+	OPT_SSLKEY                    = C.CURLOPT_SSLKEY
+	OPT_SSLKEYTYPE                = C.CURLOPT_SSLKEYTYPE
+	OPT_SSLENGINE                 = C.CURLOPT_SSLENGINE
+	OPT_SSLENGINE_DEFAULT         = C.CURLOPT_SSLENGINE_DEFAULT
+	OPT_DNS_USE_GLOBAL_CACHE      = C.CURLOPT_DNS_USE_GLOBAL_CACHE
+	OPT_DNS_CACHE_TIMEOUT         = C.CURLOPT_DNS_CACHE_TIMEOUT
+	OPT_PREQUOTE                  = C.CURLOPT_PREQUOTE
+	OPT_DEBUGFUNCTION             = C.CURLOPT_DEBUGFUNCTION
+	OPT_DEBUGDATA                 = C.CURLOPT_DEBUGDATA
+	OPT_COOKIESESSION             = C.CURLOPT_COOKIESESSION
+	OPT_CAPATH                    = C.CURLOPT_CAPATH
+	OPT_BUFFERSIZE                = C.CURLOPT_BUFFERSIZE
+	OPT_NOSIGNAL                  = C.CURLOPT_NOSIGNAL
+	OPT_SHARE                     = C.CURLOPT_SHARE
+	OPT_PROXYTYPE                 = C.CURLOPT_PROXYTYPE
+	OPT_ACCEPT_ENCODING           = C.CURLOPT_ACCEPT_ENCODING
+	OPT_PRIVATE                   = C.CURLOPT_PRIVATE
+	OPT_HTTP200ALIASES            = C.CURLOPT_HTTP200ALIASES
+	OPT_UNRESTRICTED_AUTH         = C.CURLOPT_UNRESTRICTED_AUTH
+	OPT_FTP_USE_EPRT              = C.CURLOPT_FTP_USE_EPRT
+	OPT_HTTPAUTH                  = C.CURLOPT_HTTPAUTH
+	OPT_SSL_CTX_FUNCTION          = C.CURLOPT_SSL_CTX_FUNCTION
+	OPT_SSL_CTX_DATA              = C.CURLOPT_SSL_CTX_DATA
+	OPT_FTP_CREATE_MISSING_DIRS   = C.CURLOPT_FTP_CREATE_MISSING_DIRS
+	OPT_PROXYAUTH                 = C.CURLOPT_PROXYAUTH
+	OPT_FTP_RESPONSE_TIMEOUT      = C.CURLOPT_FTP_RESPONSE_TIMEOUT
+	OPT_SERVER_RESPONSE_TIMEOUT   = C.CURLOPT_SERVER_RESPONSE_TIMEOUT
+	OPT_IPRESOLVE                 = C.CURLOPT_IPRESOLVE
+	OPT_MAXFILESIZE               = C.CURLOPT_MAXFILESIZE
+	OPT_INFILESIZE_LARGE          = C.CURLOPT_INFILESIZE_LARGE
+	OPT_RESUME_FROM_LARGE         = C.CURLOPT_RESUME_FROM_LARGE
+	OPT_MAXFILESIZE_LARGE         = C.CURLOPT_MAXFILESIZE_LARGE
+	OPT_NETRC_FILE                = C.CURLOPT_NETRC_FILE
+	OPT_USE_SSL                   = C.CURLOPT_USE_SSL
+	OPT_POSTFIELDSIZE_LARGE       = C.CURLOPT_POSTFIELDSIZE_LARGE
+	OPT_TCP_NODELAY               = C.CURLOPT_TCP_NODELAY
+	OPT_FTPSSLAUTH                = C.CURLOPT_FTPSSLAUTH
+	OPT_IOCTLFUNCTION             = C.CURLOPT_IOCTLFUNCTION
+	OPT_IOCTLDATA                 = C.CURLOPT_IOCTLDATA
+	OPT_FTP_ACCOUNT               = C.CURLOPT_FTP_ACCOUNT
+	OPT_COOKIELIST                = C.CURLOPT_COOKIELIST
+	OPT_IGNORE_CONTENT_LENGTH     = C.CURLOPT_IGNORE_CONTENT_LENGTH
+	OPT_FTP_SKIP_PASV_IP          = C.CURLOPT_FTP_SKIP_PASV_IP
+	OPT_FTP_FILEMETHOD            = C.CURLOPT_FTP_FILEMETHOD
+	OPT_LOCALPORT                 = C.CURLOPT_LOCALPORT
+	OPT_LOCALPORTRANGE            = C.CURLOPT_LOCALPORTRANGE
+	OPT_CONNECT_ONLY              = C.CURLOPT_CONNECT_ONLY
+	OPT_CONV_FROM_NETWORK_FUNCTION = C.CURLOPT_CONV_FROM_NETWORK_FUNCTION
+	OPT_CONV_TO_NETWORK_FUNCTION  = C.CURLOPT_CONV_TO_NETWORK_FUNCTION
+	OPT_CONV_FROM_UTF8_FUNCTION   = C.CURLOPT_CONV_FROM_UTF8_FUNCTION
+	OPT_MAX_SEND_SPEED_LARGE      = C.CURLOPT_MAX_SEND_SPEED_LARGE
+	OPT_MAX_RECV_SPEED_LARGE      = C.CURLOPT_MAX_RECV_SPEED_LARGE
+	OPT_FTP_ALTERNATIVE_TO_USER   = C.CURLOPT_FTP_ALTERNATIVE_TO_USER
+	OPT_SOCKOPTFUNCTION           = C.CURLOPT_SOCKOPTFUNCTION
+	OPT_SOCKOPTDATA               = C.CURLOPT_SOCKOPTDATA
+	OPT_SSL_SESSIONID_CACHE       = C.CURLOPT_SSL_SESSIONID_CACHE
+	OPT_SSH_AUTH_TYPES            = C.CURLOPT_SSH_AUTH_TYPES
+	OPT_SSH_PUBLIC_KEYFILE        = C.CURLOPT_SSH_PUBLIC_KEYFILE
+	OPT_SSH_PRIVATE_KEYFILE       = C.CURLOPT_SSH_PRIVATE_KEYFILE
+	OPT_FTP_SSL_CCC               = C.CURLOPT_FTP_SSL_CCC
+	OPT_TIMEOUT_MS                = C.CURLOPT_TIMEOUT_MS
+	OPT_CONNECTTIMEOUT_MS         = C.CURLOPT_CONNECTTIMEOUT_MS
+	OPT_HTTP_TRANSFER_DECODING    = C.CURLOPT_HTTP_TRANSFER_DECODING
+	OPT_HTTP_CONTENT_DECODING     = C.CURLOPT_HTTP_CONTENT_DECODING
+	OPT_NEW_FILE_PERMS            = C.CURLOPT_NEW_FILE_PERMS
+	OPT_NEW_DIRECTORY_PERMS       = C.CURLOPT_NEW_DIRECTORY_PERMS
+	OPT_POSTREDIR                 = C.CURLOPT_POSTREDIR
+	OPT_SSH_HOST_PUBLIC_KEY_MD5   = C.CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
+	OPT_OPENSOCKETFUNCTION        = C.CURLOPT_OPENSOCKETFUNCTION
+	OPT_OPENSOCKETDATA            = C.CURLOPT_OPENSOCKETDATA
+	OPT_COPYPOSTFIELDS            = C.CURLOPT_COPYPOSTFIELDS
+	OPT_PROXY_TRANSFER_MODE       = C.CURLOPT_PROXY_TRANSFER_MODE
+	OPT_SEEKFUNCTION              = C.CURLOPT_SEEKFUNCTION
+	OPT_SEEKDATA                  = C.CURLOPT_SEEKDATA
+	OPT_CRLFILE                   = C.CURLOPT_CRLFILE
+	OPT_ISSUERCERT                = C.CURLOPT_ISSUERCERT
+	OPT_ADDRESS_SCOPE             = C.CURLOPT_ADDRESS_SCOPE
+	OPT_CERTINFO                  = C.CURLOPT_CERTINFO
+	OPT_USERNAME                  = C.CURLOPT_USERNAME
+	OPT_PASSWORD                  = C.CURLOPT_PASSWORD
+	OPT_PROXYUSERNAME             = C.CURLOPT_PROXYUSERNAME
+	OPT_PROXYPASSWORD             = C.CURLOPT_PROXYPASSWORD
+	OPT_NOPROXY                   = C.CURLOPT_NOPROXY
+	OPT_TFTP_BLKSIZE              = C.CURLOPT_TFTP_BLKSIZE
+	OPT_SOCKS5_GSSAPI_SERVICE     = C.CURLOPT_SOCKS5_GSSAPI_SERVICE
+	OPT_SOCKS5_GSSAPI_NEC         = C.CURLOPT_SOCKS5_GSSAPI_NEC
+	OPT_PROTOCOLS                 = C.CURLOPT_PROTOCOLS
+	OPT_REDIR_PROTOCOLS           = C.CURLOPT_REDIR_PROTOCOLS
+	OPT_SSH_KNOWNHOSTS            = C.CURLOPT_SSH_KNOWNHOSTS
+	OPT_SSH_KEYFUNCTION           = C.CURLOPT_SSH_KEYFUNCTION
+	OPT_SSH_KEYDATA               = C.CURLOPT_SSH_KEYDATA
+	OPT_MAIL_FROM                 = C.CURLOPT_MAIL_FROM
+	OPT_MAIL_RCPT                 = C.CURLOPT_MAIL_RCPT
+	OPT_FTP_USE_PRET              = C.CURLOPT_FTP_USE_PRET
+	OPT_RTSP_REQUEST              = C.CURLOPT_RTSP_REQUEST
+	OPT_RTSP_SESSION_ID           = C.CURLOPT_RTSP_SESSION_ID
+	OPT_RTSP_STREAM_URI           = C.CURLOPT_RTSP_STREAM_URI
+	OPT_RTSP_TRANSPORT            = C.CURLOPT_RTSP_TRANSPORT
+	OPT_RTSP_CLIENT_CSEQ          = C.CURLOPT_RTSP_CLIENT_CSEQ
+	OPT_RTSP_SERVER_CSEQ          = C.CURLOPT_RTSP_SERVER_CSEQ
+	OPT_INTERLEAVEDATA            = C.CURLOPT_INTERLEAVEDATA
+	OPT_INTERLEAVEFUNCTION        = C.CURLOPT_INTERLEAVEFUNCTION
+	OPT_WILDCARDMATCH             = C.CURLOPT_WILDCARDMATCH
+	OPT_CHUNK_BGN_FUNCTION        = C.CURLOPT_CHUNK_BGN_FUNCTION
+	OPT_CHUNK_END_FUNCTION        = C.CURLOPT_CHUNK_END_FUNCTION
+	OPT_FNMATCH_FUNCTION          = C.CURLOPT_FNMATCH_FUNCTION
+	OPT_CHUNK_DATA                = C.CURLOPT_CHUNK_DATA
+	OPT_FNMATCH_DATA              = C.CURLOPT_FNMATCH_DATA
+	OPT_RESOLVE                   = C.CURLOPT_RESOLVE
+	OPT_TLSAUTH_USERNAME          = C.CURLOPT_TLSAUTH_USERNAME
+	OPT_TLSAUTH_PASSWORD          = C.CURLOPT_TLSAUTH_PASSWORD
+	OPT_TLSAUTH_TYPE              = C.CURLOPT_TLSAUTH_TYPE
+	OPT_TRANSFER_ENCODING         = C.CURLOPT_TRANSFER_ENCODING
+	OPT_CLOSESOCKETFUNCTION       = C.CURLOPT_CLOSESOCKETFUNCTION
+	OPT_CLOSESOCKETDATA           = C.CURLOPT_CLOSESOCKETDATA
+	OPT_GSSAPI_DELEGATION         = C.CURLOPT_GSSAPI_DELEGATION
+	OPT_DNS_SERVERS               = C.CURLOPT_DNS_SERVERS
+	OPT_ACCEPTTIMEOUT_MS          = C.CURLOPT_ACCEPTTIMEOUT_MS
+	OPT_TCP_KEEPALIVE             = C.CURLOPT_TCP_KEEPALIVE
+	OPT_TCP_KEEPIDLE              = C.CURLOPT_TCP_KEEPIDLE
+	OPT_TCP_KEEPINTVL             = C.CURLOPT_TCP_KEEPINTVL
+	OPT_SSL_OPTIONS               = C.CURLOPT_SSL_OPTIONS
+	OPT_MAIL_AUTH                 = C.CURLOPT_MAIL_AUTH
+	OPT_SASL_IR                   = C.CURLOPT_SASL_IR
+	OPT_XFERINFOFUNCTION          = C.CURLOPT_XFERINFOFUNCTION
+	OPT_XOAUTH2_BEARER            = C.CURLOPT_XOAUTH2_BEARER
+	OPT_DNS_INTERFACE             = C.CURLOPT_DNS_INTERFACE
+	OPT_DNS_LOCAL_IP4             = C.CURLOPT_DNS_LOCAL_IP4
+	OPT_DNS_LOCAL_IP6             = C.CURLOPT_DNS_LOCAL_IP6
+	OPT_LOGIN_OPTIONS             = C.CURLOPT_LOGIN_OPTIONS
+	OPT_SSL_ENABLE_NPN            = C.CURLOPT_SSL_ENABLE_NPN
+	OPT_SSL_ENABLE_ALPN           = C.CURLOPT_SSL_ENABLE_ALPN
+	OPT_EXPECT_100_TIMEOUT_MS     = C.CURLOPT_EXPECT_100_TIMEOUT_MS
+	OPT_POST301                   = C.CURLOPT_POST301
+	OPT_SSLKEYPASSWD              = C.CURLOPT_SSLKEYPASSWD
+	OPT_FTPAPPEND                 = C.CURLOPT_FTPAPPEND
+	OPT_FTPLISTONLY               = C.CURLOPT_FTPLISTONLY
+	OPT_FTP_SSL                   = C.CURLOPT_FTP_SSL
+	OPT_SSLCERTPASSWD             = C.CURLOPT_SSLCERTPASSWD
+	OPT_KRB4LEVEL                 = C.CURLOPT_KRB4LEVEL
+	OPT_WRITEDATA                 = C.CURLOPT_WRITEDATA
+	OPT_READDATA                  = C.CURLOPT_READDATA
+	OPT_HEADERDATA                = C.CURLOPT_HEADERDATA
+	OPT_RTSPHEADER                = C.CURLOPT_RTSPHEADER
+)
+
+// easy.Getinfo(flag)
+const (
+	INFO_TEXT                 = C.CURLINFO_TEXT
+	INFO_EFFECTIVE_URL        = C.CURLINFO_EFFECTIVE_URL
+	INFO_RESPONSE_CODE        = C.CURLINFO_RESPONSE_CODE
+	INFO_TOTAL_TIME           = C.CURLINFO_TOTAL_TIME
+	INFO_NAMELOOKUP_TIME      = C.CURLINFO_NAMELOOKUP_TIME
+	INFO_CONNECT_TIME         = C.CURLINFO_CONNECT_TIME
+	INFO_PRETRANSFER_TIME     = C.CURLINFO_PRETRANSFER_TIME
+	INFO_SIZE_UPLOAD          = C.CURLINFO_SIZE_UPLOAD
+	INFO_SIZE_DOWNLOAD        = C.CURLINFO_SIZE_DOWNLOAD
+	INFO_SPEED_DOWNLOAD       = C.CURLINFO_SPEED_DOWNLOAD
+	INFO_SPEED_UPLOAD         = C.CURLINFO_SPEED_UPLOAD
+	INFO_HEADER_SIZE          = C.CURLINFO_HEADER_SIZE
+	INFO_REQUEST_SIZE         = C.CURLINFO_REQUEST_SIZE
+	INFO_SSL_VERIFYRESULT     = C.CURLINFO_SSL_VERIFYRESULT
+	INFO_FILETIME             = C.CURLINFO_FILETIME
+	INFO_CONTENT_LENGTH_DOWNLOAD = C.CURLINFO_CONTENT_LENGTH_DOWNLOAD
+	INFO_CONTENT_LENGTH_UPLOAD = C.CURLINFO_CONTENT_LENGTH_UPLOAD
+	INFO_STARTTRANSFER_TIME   = C.CURLINFO_STARTTRANSFER_TIME
+	INFO_CONTENT_TYPE         = C.CURLINFO_CONTENT_TYPE
+	INFO_REDIRECT_TIME        = C.CURLINFO_REDIRECT_TIME
+	INFO_REDIRECT_COUNT       = C.CURLINFO_REDIRECT_COUNT
+	INFO_PRIVATE              = C.CURLINFO_PRIVATE
+	INFO_HTTP_CONNECTCODE     = C.CURLINFO_HTTP_CONNECTCODE
+	INFO_HTTPAUTH_AVAIL       = C.CURLINFO_HTTPAUTH_AVAIL
+	INFO_PROXYAUTH_AVAIL      = C.CURLINFO_PROXYAUTH_AVAIL
+	INFO_OS_ERRNO             = C.CURLINFO_OS_ERRNO
+	INFO_NUM_CONNECTS         = C.CURLINFO_NUM_CONNECTS
+	INFO_SSL_ENGINES          = C.CURLINFO_SSL_ENGINES
+	INFO_COOKIELIST           = C.CURLINFO_COOKIELIST
+	INFO_LASTSOCKET           = C.CURLINFO_LASTSOCKET
+	INFO_FTP_ENTRY_PATH       = C.CURLINFO_FTP_ENTRY_PATH
+	INFO_REDIRECT_URL         = C.CURLINFO_REDIRECT_URL
+	INFO_PRIMARY_IP           = C.CURLINFO_PRIMARY_IP
+	INFO_APPCONNECT_TIME      = C.CURLINFO_APPCONNECT_TIME
+	INFO_CERTINFO             = C.CURLINFO_CERTINFO
+	INFO_CONDITION_UNMET      = C.CURLINFO_CONDITION_UNMET
+	INFO_RTSP_SESSION_ID      = C.CURLINFO_RTSP_SESSION_ID
+	INFO_RTSP_CLIENT_CSEQ     = C.CURLINFO_RTSP_CLIENT_CSEQ
+	INFO_RTSP_SERVER_CSEQ     = C.CURLINFO_RTSP_SERVER_CSEQ
+	INFO_RTSP_CSEQ_RECV       = C.CURLINFO_RTSP_CSEQ_RECV
+	INFO_PRIMARY_PORT         = C.CURLINFO_PRIMARY_PORT
+	INFO_LOCAL_IP             = C.CURLINFO_LOCAL_IP
+	INFO_LOCAL_PORT           = C.CURLINFO_LOCAL_PORT
+	INFO_TLS_SESSION          = C.CURLINFO_TLS_SESSION
+	INFO_LASTONE              = C.CURLINFO_LASTONE
+	INFO_HTTP_CODE            = C.CURLINFO_HTTP_CODE
+)
+
+// generated ends

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/core.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/core.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/core.go
new file mode 100644
index 0000000..a4e0fc5
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/core.go
@@ -0,0 +1,118 @@
+// libcurl go bingding
+package curl
+
+/*
+#cgo linux pkg-config: libcurl
+#cgo darwin LDFLAGS: -lcurl
+#cgo windows LDFLAGS: -lcurl
+#include <stdlib.h>
+#include <curl/curl.h>
+
+static char *string_array_index(char **p, int i) {
+  return p[i];
+}
+*/
+import "C"
+
+import (
+	"time"
+	"unsafe"
+)
+
+// curl_global_init - Global libcurl initialisation
+func GlobalInit(flags int) error {
+	return newCurlError(C.curl_global_init(C.long(flags)))
+}
+
+// curl_global_cleanup - global libcurl cleanup
+func GlobalCleanup() {
+	C.curl_global_cleanup()
+}
+
+type VersionInfoData struct {
+	Age C.CURLversion
+	// age >= 0
+	Version       string
+	VersionNum    uint
+	Host          string
+	Features      int
+	SslVersion    string
+	SslVersionNum int
+	LibzVersion   string
+	Protocols     []string
+	// age >= 1
+	Ares    string
+	AresNum int
+	// age >= 2
+	Libidn string
+	// age >= 3
+	IconvVerNum   int
+	LibsshVersion string
+}
+
+// curl_version - returns the libcurl version string
+func Version() string {
+	return C.GoString(C.curl_version())
+}
+
+// curl_version_info - returns run-time libcurl version info
+func VersionInfo(ver C.CURLversion) *VersionInfoData {
+	data := C.curl_version_info(ver)
+	ret := new(VersionInfoData)
+	ret.Age = data.age
+	switch age := ret.Age; {
+	case age >= 0:
+		ret.Version = string(C.GoString(data.version))
+		ret.VersionNum = uint(data.version_num)
+		ret.Host = C.GoString(data.host)
+		ret.Features = int(data.features)
+		ret.SslVersion = C.GoString(data.ssl_version)
+		ret.SslVersionNum = int(data.ssl_version_num)
+		ret.LibzVersion = C.GoString(data.libz_version)
+		// ugly but works
+		ret.Protocols = []string{}
+		for i := C.int(0); C.string_array_index(data.protocols, i) != nil; i++ {
+			p := C.string_array_index(data.protocols, i)
+			ret.Protocols = append(ret.Protocols, C.GoString(p))
+		}
+		fallthrough
+	case age >= 1:
+		ret.Ares = C.GoString(data.ares)
+		ret.AresNum = int(data.ares_num)
+		fallthrough
+	case age >= 2:
+		ret.Libidn = C.GoString(data.libidn)
+		fallthrough
+	case age >= 3:
+		ret.IconvVerNum = int(data.iconv_ver_num)
+		ret.LibsshVersion = C.GoString(data.libssh_version)
+	}
+	return ret
+}
+
+// curl_getdate - Convert a date string to number of seconds since January 1, 1970
+// In golang, we convert it to a *time.Time
+func Getdate(date string) *time.Time {
+	datestr := C.CString(date)
+	defer C.free(unsafe.Pointer(datestr))
+	t := C.curl_getdate(datestr, nil)
+	if t == -1 {
+		return nil
+	}
+	unix := time.Unix(int64(t), 0).UTC()
+	return &unix
+
+	/*
+	   // curl_getenv - return value for environment name
+	   func Getenv(name string) string {
+	           namestr := C.CString(name)
+	           defer C.free(unsafe.Pointer(namestr))
+	           ret := C.curl_getenv(unsafe.Pointer(namestr))
+	           defer C.free(unsafe.Pointer(ret))
+
+	           return C.GoString(ret)
+	   }
+	*/
+}
+
+// TODO: curl_global_init_mem

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/core_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/core_test.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/core_test.go
new file mode 100644
index 0000000..a10425a
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/core_test.go
@@ -0,0 +1,23 @@
+package curl
+
+import (
+	"testing"
+)
+
+func TestVersionInfo(t *testing.T) {
+	info := VersionInfo(VERSION_FIRST)
+	expectedProtocols := []string{"dict", "file", "ftp", "ftps", "gopher", "http", "https", "imap", "imaps", "ldap", "ldaps", "pop3", "pop3s", "rtmp", "rtsp", "smtp", "smtps", "telnet", "tftp", "scp", "sftp"}
+	protocols := info.Protocols
+	for _, protocol := range protocols {
+		found := false
+		for _, expectedProtocol := range expectedProtocols {
+			if expectedProtocol == protocol {
+				found = true
+				break
+			}
+		}
+		if !found {
+			t.Errorf("protocol should be in %v and is %v.", expectedProtocols, protocol)
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/easy.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/easy.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/easy.go
new file mode 100644
index 0000000..4593590
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/easy.go
@@ -0,0 +1,495 @@
+package curl
+
+/*
+#include <stdlib.h>
+#include <curl/curl.h>
+#include "callback.h"
+#include "compat.h"
+
+static CURLcode curl_easy_setopt_long(CURL *handle, CURLoption option, long parameter) {
+  return curl_easy_setopt(handle, option, parameter);
+}
+static CURLcode curl_easy_setopt_string(CURL *handle, CURLoption option, char *parameter) {
+  return curl_easy_setopt(handle, option, parameter);
+}
+static CURLcode curl_easy_setopt_slist(CURL *handle, CURLoption option, struct curl_slist *parameter) {
+  return curl_easy_setopt(handle, option, parameter);
+}
+static CURLcode curl_easy_setopt_pointer(CURL *handle, CURLoption option, void *parameter) {
+  return curl_easy_setopt(handle, option, parameter);
+}
+static CURLcode curl_easy_setopt_off_t(CURL *handle, CURLoption option, off_t parameter) {
+  return curl_easy_setopt(handle, option, parameter);
+}
+
+static CURLcode curl_easy_getinfo_string(CURL *curl, CURLINFO info, char **p) {
+ return curl_easy_getinfo(curl, info, p);
+}
+static CURLcode curl_easy_getinfo_long(CURL *curl, CURLINFO info, long *p) {
+ return curl_easy_getinfo(curl, info, p);
+}
+static CURLcode curl_easy_getinfo_double(CURL *curl, CURLINFO info, double *p) {
+ return curl_easy_getinfo(curl, info, p);
+}
+static CURLcode curl_easy_getinfo_slist(CURL *curl, CURLINFO info, struct curl_slist **p) {
+ return curl_easy_getinfo(curl, info, p);
+}
+
+static CURLFORMcode curl_formadd_name_content_length(
+    struct curl_httppost **httppost, struct curl_httppost **last_post, char *name, char *content, int length) {
+    return curl_formadd(httppost, last_post,
+                        CURLFORM_COPYNAME, name,
+                        CURLFORM_COPYCONTENTS, content,
+                        CURLFORM_CONTENTSLENGTH, length, CURLFORM_END);
+}
+static CURLFORMcode curl_formadd_name_content_length_type(
+    struct curl_httppost **httppost, struct curl_httppost **last_post, char *name, char *content, int length, char *type) {
+    return curl_formadd(httppost, last_post,
+                        CURLFORM_COPYNAME, name,
+                        CURLFORM_COPYCONTENTS, content,
+                        CURLFORM_CONTENTSLENGTH, length,
+                        CURLFORM_CONTENTTYPE, type, CURLFORM_END);
+}
+static CURLFORMcode curl_formadd_name_file_type(
+    struct curl_httppost **httppost, struct curl_httppost **last_post, char *name, char *filename, char *type) {
+    return curl_formadd(httppost, last_post,
+                        CURLFORM_COPYNAME, name,
+                        CURLFORM_FILE, filename,
+                        CURLFORM_CONTENTTYPE, type, CURLFORM_END);
+}
+ // TODO: support multi file
+
+*/
+import "C"
+
+import (
+	"fmt"
+	"mime"
+	"path"
+	"reflect"
+	"unsafe"
+)
+
+type CurlInfo C.CURLINFO
+type CurlError C.CURLcode
+
+type CurlString *C.char
+
+func NewCurlString(s string) CurlString {
+	return CurlString(unsafe.Pointer(C.CString(s)))
+}
+
+func FreeCurlString(s CurlString) {
+	C.free(unsafe.Pointer(s))
+}
+
+func (e CurlError) Error() string {
+	// ret is const char*, no need to free
+	ret := C.curl_easy_strerror(C.CURLcode(e))
+	return fmt.Sprintf("curl: %s", C.GoString(ret))
+}
+
+func newCurlError(errno C.CURLcode) error {
+	if errno == C.CURLE_OK { // if nothing wrong
+		return nil
+	}
+	return CurlError(errno)
+}
+
+// curl_easy interface
+type CURL struct {
+	handle unsafe.Pointer
+	// callback functions, bool ret means ok or not
+	headerFunction, writeFunction *func([]byte, interface{}) bool
+	readFunction                  *func([]byte, interface{}) int // return num of bytes writed to buf
+	progressFunction              *func(float64, float64, float64, float64, interface{}) bool
+	fnmatchFunction               *func(string, string, interface{}) int
+	// callback datas
+	headerData, writeData, readData, progressData, fnmatchData *interface{}
+	// list of C allocs
+	mallocAllocs []*C.char
+}
+
+// curl_easy_init - Start a libcurl easy session
+func EasyInit() *CURL {
+	p := C.curl_easy_init()
+	return &CURL{handle: p, mallocAllocs: make([]*C.char, 0)} // other field defaults to nil
+}
+
+// curl_easy_duphandle - Clone a libcurl session handle
+func (curl *CURL) Duphandle() *CURL {
+	p := curl.handle
+	return &CURL{handle: C.curl_easy_duphandle(p)}
+}
+
+// curl_easy_cleanup - End a libcurl easy session
+func (curl *CURL) Cleanup() {
+	p := curl.handle
+	C.curl_easy_cleanup(p)
+	curl.MallocFreeAfter(0)
+}
+
+// curl_easy_setopt - set options for a curl easy handle
+// WARNING: a function pointer is &fun, but function addr is reflect.ValueOf(fun).Pointer()
+func (curl *CURL) Setopt(opt int, param interface{}) error {
+	p := curl.handle
+	if param == nil {
+		// NOTE: some option will crash program when got a nil param
+		return newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), nil))
+	}
+	switch {
+	// not really set
+	case opt == OPT_READDATA: // OPT_INFILE
+		curl.readData = &param
+		return nil
+	case opt == OPT_PROGRESSDATA:
+		curl.progressData = &param
+		return nil
+	case opt == OPT_HEADERDATA: // also known as OPT_WRITEHEADER
+		curl.headerData = &param
+		return nil
+	case opt == OPT_WRITEDATA: // OPT_FILE
+		curl.writeData = &param
+		return nil
+
+	case opt == OPT_READFUNCTION:
+		fun := param.(func([]byte, interface{}) int)
+		curl.readFunction = &fun
+
+		ptr := C.return_read_function()
+		if err := newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), ptr)); err == nil {
+			return newCurlError(C.curl_easy_setopt_pointer(p, OPT_READDATA,
+				unsafe.Pointer(reflect.ValueOf(curl).Pointer())))
+		} else {
+			return err
+		}
+
+	case opt == OPT_PROGRESSFUNCTION:
+		fun := param.(func(float64, float64, float64, float64, interface{}) bool)
+		curl.progressFunction = &fun
+
+		ptr := C.return_progress_function()
+		if err := newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), ptr)); err == nil {
+			return newCurlError(C.curl_easy_setopt_pointer(p, OPT_PROGRESSDATA,
+				unsafe.Pointer(reflect.ValueOf(curl).Pointer())))
+		} else {
+			return err
+		}
+
+	case opt == OPT_HEADERFUNCTION:
+		fun := param.(func([]byte, interface{}) bool)
+		curl.headerFunction = &fun
+
+		ptr := C.return_header_function()
+		if err := newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), ptr)); err == nil {
+			return newCurlError(C.curl_easy_setopt_pointer(p, OPT_HEADERDATA,
+				unsafe.Pointer(reflect.ValueOf(curl).Pointer())))
+		} else {
+			return err
+		}
+
+	case opt == OPT_WRITEFUNCTION:
+		fun := param.(func([]byte, interface{}) bool)
+		curl.writeFunction = &fun
+
+		ptr := C.return_write_function()
+		if err := newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), ptr)); err == nil {
+			return newCurlError(C.curl_easy_setopt_pointer(p, OPT_WRITEDATA,
+				unsafe.Pointer(reflect.ValueOf(curl).Pointer())))
+		} else {
+			return err
+		}
+
+	// for OPT_HTTPPOST, use struct Form
+	case opt == OPT_HTTPPOST:
+		post := param.(*Form)
+		ptr := post.head
+		return newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt), unsafe.Pointer(ptr)))
+
+	case opt >= C.CURLOPTTYPE_OFF_T:
+		val := C.off_t(0)
+		switch t := param.(type) {
+		case int:
+			val = C.off_t(t)
+		case uint64:
+			val = C.off_t(t)
+		default:
+			panic("OFF_T conversion not supported")
+		}
+		return newCurlError(C.curl_easy_setopt_off_t(p, C.CURLoption(opt), val))
+
+	case opt >= C.CURLOPTTYPE_FUNCTIONPOINT:
+		// function pointer
+		panic("function pointer not implemented yet!")
+
+	case opt >= C.CURLOPTTYPE_OBJECTPOINT:
+		switch t := param.(type) {
+		case string:
+			ptr := C.CString(t)
+			curl.mallocAddPtr(ptr)
+			return newCurlError(C.curl_easy_setopt_string(p, C.CURLoption(opt), ptr))
+		case CurlString:
+			ptr := (*C.char)(t)
+			return newCurlError(C.curl_easy_setopt_string(p, C.CURLoption(opt), ptr))
+		case []string:
+			if len(t) > 0 {
+				ptr := C.CString(t[0])
+				curl.mallocAddPtr(ptr)
+				a_slist := C.curl_slist_append(nil, ptr)
+				for _, s := range t[1:] {
+					ptr := C.CString(s)
+					curl.mallocAddPtr(ptr)
+					a_slist = C.curl_slist_append(a_slist, ptr)
+				}
+				return newCurlError(C.curl_easy_setopt_slist(p, C.CURLoption(opt), a_slist))
+			} else {
+				return newCurlError(C.curl_easy_setopt_slist(p, C.CURLoption(opt), nil))
+			}
+		case []CurlString:
+			if len(t) > 0 {
+				ptr := (*C.char)(t[0])
+				a_slist := C.curl_slist_append(nil, ptr)
+				for _, s := range t[1:] {
+					ptr := (*C.char)(s)
+					a_slist = C.curl_slist_append(a_slist, ptr)
+				}
+				return newCurlError(C.curl_easy_setopt_slist(p, C.CURLoption(opt), a_slist))
+			} else {
+				return newCurlError(C.curl_easy_setopt_slist(p, C.CURLoption(opt), nil))
+			}
+		default:
+			// It panics if v's Kind is not Chan, Func, Map, Ptr, Slice, or UnsafePointer.
+			// val := reflect.ValueOf(param)
+			//fmt.Printf("DEBUG(Setopt): param=%x\n", val.Pointer())
+			//println("DEBUG can addr =", val.Pointer(), "opt=", opt)
+			// pass a pointer to GoInterface
+			return newCurlError(C.curl_easy_setopt_pointer(p, C.CURLoption(opt),
+				unsafe.Pointer(&param)))
+		}
+	case opt >= C.CURLOPTTYPE_LONG:
+		val := C.long(0)
+		switch t := param.(type) {
+		case int:
+			val = C.long(t)
+		case bool:
+			if t {
+				val = 1
+			}
+		case int64:
+			val = C.long(t)
+		case int32:
+			val = C.long(t)
+		default:
+			panic("not supported converstion to c long")
+		}
+		return newCurlError(C.curl_easy_setopt_long(p, C.CURLoption(opt), val))
+	}
+	panic("opt param error!")
+}
+
+// curl_easy_send - sends raw data over an "easy" connection
+func (curl *CURL) Send(buffer []byte) (int, error) {
+	p := curl.handle
+	buflen := len(buffer)
+	n := C.size_t(0)
+	ret := C.curl_easy_send(p, unsafe.Pointer(&buffer[0]), C.size_t(buflen), &n)
+	return int(n), newCurlError(ret)
+}
+
+// curl_easy_recv - receives raw data on an "easy" connection
+func (curl *CURL) Recv(buffer []byte) (int, error) {
+	p := curl.handle
+	buflen := len(buffer)
+	buf := C.CString(string(buffer))
+	n := C.size_t(0)
+	ret := C.curl_easy_recv(p, unsafe.Pointer(buf), C.size_t(buflen), &n)
+	return copy(buffer, C.GoStringN(buf, C.int(n))), newCurlError(ret)
+}
+
+// curl_easy_perform - Perform a file transfer
+func (curl *CURL) Perform() error {
+	p := curl.handle
+	return newCurlError(C.curl_easy_perform(p))
+}
+
+// curl_easy_pause - pause and unpause a connection
+func (curl *CURL) Pause(bitmask int) error {
+	p := curl.handle
+	return newCurlError(C.curl_easy_pause(p, C.int(bitmask)))
+}
+
+// curl_easy_reset - reset all options of a libcurl session handle
+func (curl *CURL) Reset() {
+	p := curl.handle
+	C.curl_easy_reset(p)
+}
+
+// curl_easy_escape - URL encodes the given string
+func (curl *CURL) Escape(url string) string {
+	p := curl.handle
+	oldUrl := C.CString(url)
+	defer C.free(unsafe.Pointer(oldUrl))
+	newUrl := C.curl_easy_escape(p, oldUrl, 0)
+	defer C.curl_free(unsafe.Pointer(newUrl))
+	return C.GoString(newUrl)
+}
+
+// curl_easy_unescape - URL decodes the given string
+func (curl *CURL) Unescape(url string) string {
+	p := curl.handle
+	oldUrl := C.CString(url)
+	outlength := C.int(0)
+	defer C.free(unsafe.Pointer(oldUrl))
+	// If outlength is non-NULL, the function will write the length of the
+	// returned string in  the  integer  it  points  to.  This allows an
+	// escaped string containing %00 to still get used properly after unescaping.
+	newUrl := C.curl_easy_unescape(p, oldUrl, 0, &outlength)
+	defer C.curl_free(unsafe.Pointer(newUrl))
+	return C.GoStringN(newUrl, outlength)
+}
+
+// curl_easy_getinfo - extract information from a curl handle
+func (curl *CURL) Getinfo(info CurlInfo) (ret interface{}, err error) {
+	p := curl.handle
+	cInfo := C.CURLINFO(info)
+	switch cInfo & C.CURLINFO_TYPEMASK {
+	case C.CURLINFO_STRING:
+		a_string := C.CString("")
+		defer C.free(unsafe.Pointer(a_string))
+		err := newCurlError(C.curl_easy_getinfo_string(p, cInfo, &a_string))
+		ret := C.GoString(a_string)
+		debugf("Getinfo %s", ret)
+		return ret, err
+	case C.CURLINFO_LONG:
+		a_long := C.long(-1)
+		err := newCurlError(C.curl_easy_getinfo_long(p, cInfo, &a_long))
+		ret := int(a_long)
+		debugf("Getinfo %s", ret)
+		return ret, err
+	case C.CURLINFO_DOUBLE:
+		a_double := C.double(0.0)
+		err := newCurlError(C.curl_easy_getinfo_double(p, cInfo, &a_double))
+		ret := float64(a_double)
+		debugf("Getinfo %s", ret)
+		return ret, err
+	case C.CURLINFO_SLIST:
+		a_ptr_slist := new(_Ctype_struct_curl_slist)
+		err := newCurlError(C.curl_easy_getinfo_slist(p, cInfo, &a_ptr_slist))
+		ret := []string{}
+		for a_ptr_slist != nil {
+			debugf("Getinfo %s %v", C.GoString(a_ptr_slist.data), a_ptr_slist.next)
+			ret = append(ret, C.GoString(a_ptr_slist.data))
+			a_ptr_slist = a_ptr_slist.next
+		}
+		return ret, err
+	default:
+		panic("error calling Getinfo\n")
+	}
+	panic("not implemented yet!")
+	return nil, nil
+}
+
+func (curl *CURL) GetHandle() unsafe.Pointer {
+	return curl.handle
+}
+
+func (curl *CURL) MallocGetPos() int {
+	return len(curl.mallocAllocs)
+}
+
+func (curl *CURL) MallocFreeAfter(from int) {
+	l := len(curl.mallocAllocs)
+	for idx := from; idx < l; idx++ {
+		C.free(unsafe.Pointer(curl.mallocAllocs[idx]))
+		curl.mallocAllocs[idx] = nil
+	}
+	curl.mallocAllocs = curl.mallocAllocs[0:from]
+}
+
+func (curl *CURL) mallocAddPtr(ptr *C.char) {
+	curl.mallocAllocs = append(curl.mallocAllocs, ptr)
+}
+
+// A multipart/formdata HTTP POST form
+type Form struct {
+	head, last *C.struct_curl_httppost
+}
+
+func NewForm() *Form {
+	return &Form{}
+}
+
+func (form *Form) Add(name string, content interface{}) error {
+	head, last := form.head, form.last
+	namestr := C.CString(name)
+	defer C.free(unsafe.Pointer(namestr))
+	var (
+		buffer *C.char
+		length C.int
+	)
+	switch t := content.(type) {
+	case string:
+		buffer = C.CString(t)
+		length = C.int(len(t))
+	case []byte:
+		buffer = C.CString(string(t))
+		length = C.int(len(t))
+	default:
+		panic("not implemented")
+	}
+	defer C.free(unsafe.Pointer(buffer))
+	C.curl_formadd_name_content_length(&head, &last, namestr, buffer, length)
+	form.head, form.last = head, last
+	return nil
+}
+
+func (form *Form) AddWithType(name string, content interface{}, content_type string) error {
+	head, last := form.head, form.last
+	namestr := C.CString(name)
+	typestr := C.CString(content_type)
+	defer C.free(unsafe.Pointer(namestr))
+	defer C.free(unsafe.Pointer(typestr))
+	var (
+		buffer *C.char
+		length C.int
+	)
+	switch t := content.(type) {
+	case string:
+		buffer = C.CString(t)
+		length = C.int(len(t))
+	case []byte:
+		buffer = C.CString(string(t))
+		length = C.int(len(t))
+	default:
+		panic("not implemented")
+	}
+	defer C.free(unsafe.Pointer(buffer))
+	C.curl_formadd_name_content_length_type(&head, &last, namestr, buffer, length, typestr)
+	form.head, form.last = head, last
+	return nil
+}
+
+func (form *Form) AddFile(name, filename string) error {
+	head, last := form.head, form.last
+	namestr := C.CString(name)
+	pathstr := C.CString(filename)
+	typestr := C.CString(guessType(filename))
+	defer C.free(unsafe.Pointer(namestr))
+	defer C.free(unsafe.Pointer(pathstr))
+	defer C.free(unsafe.Pointer(typestr))
+	C.curl_formadd_name_file_type(&head, &last, namestr, pathstr, typestr)
+	form.head, form.last = head, last
+	return nil
+}
+
+func (form *Form) AddFromFile(name, filename string) {
+}
+
+func guessType(filename string) string {
+	ext := path.Ext(filename)
+	file_type := mime.TypeByExtension(ext)
+	if file_type == "" {
+		return "application/octet-stream"
+	}
+	return file_type
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/easy_test.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/easy_test.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/easy_test.go
new file mode 100644
index 0000000..071245c
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/easy_test.go
@@ -0,0 +1,61 @@
+package curl
+
+import (
+	"fmt"
+	"net/http"
+	"net/http/httptest"
+	"testing"
+)
+
+func setupTestServer(serverContent string) *httptest.Server {
+	return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		fmt.Fprintln(w, serverContent)
+	}))
+}
+
+func TestEasyInterface(t *testing.T) {
+	ts := setupTestServer("")
+	defer ts.Close()
+
+	easy := EasyInit()
+	defer easy.Cleanup()
+
+	easy.Setopt(OPT_URL, ts.URL)
+	if err := easy.Perform(); err != nil {
+		t.Fatal(err)
+	}
+}
+
+func TestCallbackFunction(t *testing.T) {
+	serverContent := "A random string"
+	ts := setupTestServer(serverContent)
+	defer ts.Close()
+
+	easy := EasyInit()
+	defer easy.Cleanup()
+
+	easy.Setopt(OPT_URL, ts.URL)
+	easy.Setopt(OPT_WRITEFUNCTION, func(buf []byte, userdata interface{}) bool {
+		result := string(buf)
+		expected := serverContent + "\n"
+		if result != expected {
+			t.Errorf("output should be %q and is %q.", expected, result)
+		}
+		return true
+	})
+	if err := easy.Perform(); err != nil {
+		t.Fatal(err)
+	}
+}
+
+func TestEscape(t *testing.T) {
+	easy := EasyInit()
+	defer easy.Cleanup()
+
+	payload := `payload={"msg": "First line\nSecond Line"}`
+	expected := `payload%3D%7B%22msg%22%3A%20%22First%20line%5CnSecond%20Line%22%7D`
+	result := easy.Escape(payload)
+	if result != expected {
+		t.Errorf("escaped output should be %q and is %q.", expected, result)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/channal_callback.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/channal_callback.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/channal_callback.go
new file mode 100644
index 0000000..c9c93f6
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/channal_callback.go
@@ -0,0 +1,47 @@
+package main
+
+import (
+	curl "github.com/andelf/go-curl"
+	"time"
+)
+
+func write_data(ptr []byte, userdata interface{}) bool {
+	ch, ok := userdata.(chan string)
+	if ok {
+		ch <- string(ptr)
+		return true // ok
+	} else {
+		println("ERROR!")
+		return false
+	}
+	return false
+}
+
+func main() {
+	curl.GlobalInit(curl.GLOBAL_ALL)
+
+	// init the curl session
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+
+	easy.Setopt(curl.OPT_URL, "http://cn.bing.com/")
+
+	easy.Setopt(curl.OPT_WRITEFUNCTION, write_data)
+
+	// make a chan
+	ch := make(chan string, 100)
+	go func(ch chan string) {
+		for {
+			data := <-ch
+			println("Got data size=", len(data))
+		}
+	}(ch)
+
+	easy.Setopt(curl.OPT_WRITEDATA, ch)
+
+	if err := easy.Perform(); err != nil {
+		println("ERROR: ", err.Error())
+	}
+
+	time.Sleep(10000) // wait gorotine
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/ftpget.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/ftpget.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/ftpget.go
new file mode 100644
index 0000000..1c1502d
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/ftpget.go
@@ -0,0 +1,37 @@
+package main
+
+import (
+	curl "github.com/andelf/go-curl"
+	"os"
+)
+
+const filename = "README"
+
+func main() {
+	curl.GlobalInit(curl.GLOBAL_DEFAULT)
+	defer curl.GlobalCleanup()
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+
+	easy.Setopt(curl.OPT_URL, "ftp://ftp.gnu.org/README")
+
+	// define our callback use lambda function
+	easy.Setopt(curl.OPT_WRITEFUNCTION, func(ptr []byte, userdata interface{}) bool {
+		file := userdata.(*os.File)
+		if _, err := file.Write(ptr); err != nil {
+			return false
+		}
+		return true
+	})
+
+	fp, _ := os.OpenFile(filename, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0777)
+	defer fp.Close() // defer close
+
+	easy.Setopt(curl.OPT_WRITEDATA, fp)
+
+	easy.Setopt(curl.OPT_VERBOSE, true)
+
+	if err := easy.Perform(); err != nil {
+		println("ERROR", err.Error())
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/https.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/https.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/https.go
new file mode 100644
index 0000000..0a4e031
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/https.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+	curl "github.com/andelf/go-curl"
+)
+
+func main() {
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+	if easy != nil {
+		easy.Setopt(curl.OPT_URL, "https://mail.google.com/")
+		// skip_peer_verification
+		easy.Setopt(curl.OPT_SSL_VERIFYPEER, false) // 0 is ok
+
+		easy.Perform()
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/misc.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/misc.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/misc.go
new file mode 100644
index 0000000..d66d2b7
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/misc.go
@@ -0,0 +1,104 @@
+package main
+
+import (
+	"fmt"
+	curl "github.com/andelf/go-curl"
+	"os"
+	"reflect"
+)
+
+const endl = "\n"
+
+func main() {
+	println("DEBUG chdir=>", os.Chdir("/sadf"))
+	ret := curl.EasyInit()
+	defer ret.Cleanup()
+	print("init =>", ret, " ", reflect.TypeOf(ret).String(), endl)
+	ret = ret.Duphandle()
+	defer ret.Cleanup()
+
+	print("dup =>", ret, " ", reflect.TypeOf(ret).String(), endl)
+	print("global init =>", curl.GlobalInit(curl.GLOBAL_ALL), endl)
+	print("version =>", curl.Version(), endl)
+	// debug
+	//print("set verbose =>", ret.Setopt(curl.OPT_VERBOSE, true), endl)
+
+	//print("set header =>", ret.Setopt(curl.OPT_HEADER, true), endl)
+
+	// auto calculate port
+	// print("set port =>", ret.EasySetopt(curl.OPT_PORT, 6060), endl)
+	fmt.Printf("XXXX debug setopt %#v \n", ret.Setopt(30000, 19).Error())
+
+	print("set timeout =>", ret.Setopt(curl.OPT_TIMEOUT, 20), endl)
+
+	//print("set post size =>", ret.Setopt(curl.OPT_POSTFIELDSIZE, 10), endl)
+	if ret.Setopt(curl.OPT_URL, "http://www.baidu.com:8000/") != nil {
+		println("set url ok!")
+	}
+	//print("set url =>", ret.Setopt(curl.OPT_URL, "http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/104547/chrome-linux.zip"), endl)
+
+	print("set user_agent =>", ret.Setopt(curl.OPT_USERAGENT, "go-curl v0.0.1") == nil, endl)
+	// add to DNS cache
+	print("set resolve =>", ret.Setopt(curl.OPT_RESOLVE, []string{"www.baidu.com:8000:127.0.0.1"}) == nil, endl)
+	// ret.EasyReset()  clean seted
+
+	// currently not finished!
+	//
+	fooTest := func(buf []byte, userdata interface{}) bool {
+		// buf := ptr.([]byte)
+		println("size=>", len(buf))
+		println("DEBUG(in callback)", buf, userdata)
+		println("data = >", string(buf))
+		return true
+	}
+
+	ret.Setopt(curl.OPT_WRITEFUNCTION, fooTest) // curl.CallbackWriteFunction(fooTest))
+	println("set opt!")
+	// for test only
+
+	code := ret.Perform()
+	//	dump.Dump(code)
+	fmt.Printf("code -> %v\n", code)
+
+	println("================================")
+	print("pause =>", ret.Pause(curl.PAUSE_ALL), endl)
+
+	print("escape =>", ret.Escape("http://baidu.com/"), endl)
+	print("unescape =>", ret.Unescape("http://baidu.com/-%00-%5c"), endl)
+
+	print("unescape lenght =>", len(ret.Unescape("http://baidu.com/-%00-%5c")), endl)
+	// print("version info data =>", curl.VersionInfo(1), endl)
+	ver := curl.VersionInfo(curl.VERSION_NOW)
+	fmt.Printf("VersionInfo: Age: %d, Version:%s, Host:%s, Features:%d, SslVer: %s, LibzV: %s, ssh: %s\n",
+		ver.Age, ver.Version, ver.Host, ver.Features, ver.SslVersion, ver.LibzVersion, ver.LibsshVersion)
+
+	print("Protocols:")
+	for _, p := range ver.Protocols {
+		print(p, ", ")
+	}
+	print(endl)
+	println(curl.Getdate("20111002 15:05:58 +0800").String())
+	ret.Getinfo(curl.INFO_EFFECTIVE_URL)
+	ret.Getinfo(curl.INFO_RESPONSE_CODE)
+
+	ret.Getinfo(curl.INFO_FILETIME)
+	ret.Getinfo(curl.INFO_SSL_ENGINES)
+
+	ret.Getinfo(curl.INFO_TOTAL_TIME)
+
+	println("================================")
+
+	// ret.Getinfo(curl.INFO_SSL_ENGINES)
+
+	/*	mret := curl.MultiInit()
+		mret.AddHandle(ret)			// works
+		defer mret.Cleanup()
+		if ok, handles := mret.Perform(); ok == curl.OK {
+			fmt.Printf("ok=%s, handles=%d\n", ok, handles)
+		} else {
+			fmt.Printf("error calling multi\n")
+		}
+	*/
+	println("================================")
+	//println(curl.GlobalInit(curl.GLOBAL_SSL))
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_and_select.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_and_select.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_and_select.go
new file mode 100644
index 0000000..950da36
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_and_select.go
@@ -0,0 +1,101 @@
+package main
+
+/*
+#include <stdlib.h>
+#include <sys/select.h>
+static void _FD_ZERO(void *set) {
+    FD_ZERO((fd_set*)set);
+}
+static void _FD_SET(int sysfd, void *set) {
+    FD_SET(sysfd, (fd_set*)set);
+}
+static int _FD_ISSET (int sysfd, void *set) {
+    return FD_ISSET(sysfd, (fd_set*)set);
+}
+*/
+import "C"
+
+import (
+	curl "github.com/Pyrrvs/go-curl"
+	"syscall"
+	"unsafe"
+	"fmt"
+)
+
+func FD_ZERO(set *syscall.FdSet) {
+    s := unsafe.Pointer(set)
+    C._FD_ZERO(s)
+}
+
+func FD_SET(sysfd int, set *syscall.FdSet) {
+    s := unsafe.Pointer(set)
+    fd := C.int(sysfd)
+    C._FD_SET(fd, s)
+}
+
+func FD_ISSET(sysfd int, set *syscall.FdSet) bool {
+    s := unsafe.Pointer(set)
+    fd := C.int(sysfd)
+    return C._FD_ISSET(fd, s) != 0
+}
+
+func main() {
+    var (
+            rset, wset, eset syscall.FdSet
+            still_running, curl_timeout int = 0, 0
+            err error
+    )
+
+	ch1 := curl.EasyInit()
+	ch2 := curl.EasyInit()
+
+	ch1.Setopt(curl.OPT_URL, "http://www.163.com")
+	ch1.Setopt(curl.OPT_HEADER, 0)
+	ch1.Setopt(curl.OPT_VERBOSE, true)
+	ch2.Setopt(curl.OPT_URL, "http://www.baidu.com")
+	ch2.Setopt(curl.OPT_HEADER, 0)
+	ch2.Setopt(curl.OPT_VERBOSE, true)
+
+	mh := curl.MultiInit()
+
+	mh.AddHandle(ch1)
+	mh.AddHandle(ch2)
+
+	for {
+        FD_ZERO(&rset)
+        FD_ZERO(&wset)
+        FD_ZERO(&eset)
+
+        timeout := syscall.Timeval{Sec:1, Usec:0}
+       	curl_timeout, err = mh.Timeout()
+       	if err != nil {
+       		fmt.Printf("Error multi_timeout: %s\n", err)
+       	}
+       	if curl_timeout >= 0 {
+       		timeout.Sec = int64(curl_timeout / 1000)
+       		if timeout.Sec > 1 {
+       			timeout.Sec = 1
+       		} else {
+       			timeout.Usec = int64((curl_timeout % 1000)) * 1000
+       		}
+       	}
+
+	max_fd, err := mh.Fdset(&rset, &wset, &eset)
+        if err != nil {
+            fmt.Printf("Error FDSET: %s\n", err)
+        }
+
+        _, err = syscall.Select(int(max_fd + 1), &rset, &wset, &eset, &timeout)
+        if err != nil {
+        	fmt.Printf("Error select: %s\n", err)
+        } else {
+        	still_running, err = mh.Perform()
+        	if still_running > 0 {
+        		fmt.Printf("Still running: %d\n", still_running)
+        	} else {
+        		break
+        	}
+        }
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_sample.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_sample.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_sample.go
new file mode 100644
index 0000000..a0563a8
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/multi_sample.go
@@ -0,0 +1,36 @@
+
+package main
+
+import (
+	curl "github.com/andelf/go-curl"
+	"time"
+)
+
+func main() {
+
+	ch1 := curl.EasyInit()
+	ch2 := curl.EasyInit()
+
+	ch1.Setopt(curl.OPT_URL, "http://www.163.com")
+	ch1.Setopt(curl.OPT_HEADER, 0)
+	ch1.Setopt(curl.OPT_VERBOSE, true)
+	ch2.Setopt(curl.OPT_URL, "http://www.baidu.com")
+	ch2.Setopt(curl.OPT_HEADER, 0)
+	ch2.Setopt(curl.OPT_VERBOSE, true)
+
+	mh := curl.MultiInit()
+
+	mh.AddHandle(ch1)
+	mh.AddHandle(ch2)
+
+	for {
+		nRunning, _ := mh.Perform()
+		// println("n =", nRunning)
+		if nRunning == 0 {
+			println("ok")
+			break
+		}
+		time.Sleep(1000)
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/post-callback.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/post-callback.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/post-callback.go
new file mode 100644
index 0000000..3b02802
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/post-callback.go
@@ -0,0 +1,43 @@
+package main
+
+import (
+	curl "github.com/andelf/go-curl"
+	"time"
+)
+
+const POST_DATA = "a_test_data_only"
+
+var sent = false
+
+func main() {
+	// init the curl session
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+
+	easy.Setopt(curl.OPT_URL, "http://www.google.com")
+
+	easy.Setopt(curl.OPT_POST, true)
+	easy.Setopt(curl.OPT_VERBOSE, true)
+
+	easy.Setopt(curl.OPT_READFUNCTION,
+		func(ptr []byte, userdata interface{}) int {
+			// WARNING: never use append()
+			if !sent {
+				sent = true
+				ret := copy(ptr, POST_DATA)
+				return ret
+			}
+			return 0 // sent ok
+		})
+
+	// disable HTTP/1.1 Expect 100
+	easy.Setopt(curl.OPT_HTTPHEADER, []string{"Expect:"})
+	// must set
+	easy.Setopt(curl.OPT_POSTFIELDSIZE, len(POST_DATA))
+
+	if err := easy.Perform(); err != nil {
+		println("ERROR: ", err.Error())
+	}
+
+	time.Sleep(10000) // wait gorotine
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/progress.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/progress.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/progress.go
new file mode 100644
index 0000000..09efcf5
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/progress.go
@@ -0,0 +1,47 @@
+// A sample program to show how to use PROGRESS callback to calculate
+// downloading percentage and speed
+package main
+
+import (
+	"fmt"
+	curl "github.com/andelf/go-curl"
+	"time"
+)
+
+func write_data(ptr []byte, userdata interface{}) bool {
+	// make it ok, do nothing
+	return true
+}
+
+func main() {
+	curl.GlobalInit(curl.GLOBAL_ALL)
+
+	// init the curl session
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+
+	easy.Setopt(curl.OPT_URL, "http://curl.haxx.se/download/curl-7.22.0.tar.gz")
+
+	easy.Setopt(curl.OPT_WRITEFUNCTION, write_data)
+
+	easy.Setopt(curl.OPT_NOPROGRESS, false)
+
+	started := int64(0)
+	easy.Setopt(curl.OPT_PROGRESSFUNCTION, func(dltotal, dlnow, ultotal, ulnow float64, userdata interface{}) bool {
+		// canceled when 50% finished
+		if dlnow/dltotal > 0.5 {
+			println("")
+			// abort downloading
+			return false
+		}
+		if started == 0 {
+			started = time.Now().Unix()
+		}
+		fmt.Printf("Downloaded: %3.2f%%, Speed: %.1fKiB/s \r", dlnow/dltotal*100, dlnow/1000/float64((time.Now().Unix()-started)))
+		return true
+	})
+
+	if err := easy.Perform(); err != nil {
+		fmt.Printf("ERROR: %v\n", err)
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_login.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_login.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_login.go
new file mode 100644
index 0000000..60ef84c
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_login.go
@@ -0,0 +1,36 @@
+// 测试人人网登录, 并保存cookiejar
+package main
+
+import (
+	"flag"
+	curl "github.com/andelf/go-curl"
+)
+
+func main() {
+	// init the curl session
+
+	var username *string = flag.String("username", "test", "renren.com email")
+	var password *string = flag.String("password", "test", "renren.com password")
+
+	flag.Parse()
+
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+
+	easy.Setopt(curl.OPT_URL, "http://m.renren.com/home.do")
+
+	easy.Setopt(curl.OPT_PORT, 80)
+	easy.Setopt(curl.OPT_VERBOSE, true)
+
+	easy.Setopt(curl.OPT_COOKIEJAR, "./cookie.jar")
+
+	// disable HTTP/1.1 Expect: 100-continue
+	easy.Setopt(curl.OPT_HTTPHEADER, []string{"Expect:"})
+
+	postdata := "email=" + *username + "&password=" + *password + "&login=" + easy.Escape("登录")
+	easy.Setopt(curl.OPT_POSTFIELDS, postdata)
+
+	if err := easy.Perform(); err != nil {
+		println("ERROR: ", err.Error())
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_upload.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_upload.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_upload.go
new file mode 100644
index 0000000..d02e320
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/renren_upload.go
@@ -0,0 +1,77 @@
+// 人人网图片上传
+package main
+
+import (
+	"fmt"
+	curl "github.com/andelf/go-curl"
+	"regexp"
+	"time"
+)
+
+func getUploadUrl() string {
+	page := ""
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+
+	u := "http://3g.renren.com/album/wuploadphoto.do"
+	easy.Setopt(curl.OPT_URL, u)
+	easy.Setopt(curl.OPT_COOKIEFILE, "./cookie.jar")
+	easy.Setopt(curl.OPT_COOKIEJAR, "./cookie.jar")
+	easy.Setopt(curl.OPT_VERBOSE, true)
+	easy.Setopt(curl.OPT_WRITEFUNCTION, func(ptr []byte, _ interface{}) bool {
+		page += string(ptr)
+		return true
+	})
+	easy.Perform()
+	// extract url from
+	// <form enctype="multipart/form-data" action="http://3g.renren.com/album/wuploadphoto.do?type=3&amp;sid=zv3tiXTZr6Cu1rj5dhgX_X"
+	pattern, _ := regexp.Compile(`action="(.*?)"`)
+
+	if matches := pattern.FindStringSubmatch(page); len(matches) == 2 {
+		return matches[1]
+	}
+	return ""
+}
+
+func main() {
+	// init the curl session
+
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+
+	posturl := getUploadUrl()
+
+	easy.Setopt(curl.OPT_URL, posturl)
+
+	easy.Setopt(curl.OPT_PORT, 80)
+	easy.Setopt(curl.OPT_VERBOSE, true)
+
+	// save cookie and load cookie
+	easy.Setopt(curl.OPT_COOKIEFILE, "./cookie.jar")
+	easy.Setopt(curl.OPT_COOKIEJAR, "./cookie.jar")
+
+	// disable HTTP/1.1 Expect: 100-continue
+	easy.Setopt(curl.OPT_HTTPHEADER, []string{"Expect:"})
+
+	form := curl.NewForm()
+	form.Add("albumid", "452618633") // your album id
+	form.AddFile("theFile", "./test.jpg")
+	form.Add("description", "我就尝试下这段代码靠谱不。。截图下看看")
+	form.Add("post", "上传照片")
+
+	easy.Setopt(curl.OPT_HTTPPOST, form)
+
+	// print upload progress
+	easy.Setopt(curl.OPT_NOPROGRESS, false)
+	easy.Setopt(curl.OPT_PROGRESSFUNCTION, func(dltotal, dlnow, ultotal, ulnow float64, _ interface{}) bool {
+		fmt.Printf("Download %3.2f%%, Uploading %3.2f%%\r", dlnow/dltotal*100, ulnow/ultotal*100)
+		return true
+	})
+
+	if err := easy.Perform(); err != nil {
+		println("ERROR: ", err.Error())
+	}
+
+	time.Sleep(1000000000) // wait gorotine
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sendrecv.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sendrecv.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sendrecv.go
new file mode 100644
index 0000000..841825c
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sendrecv.go
@@ -0,0 +1,44 @@
+package main
+
+import (
+	"fmt"
+	curl "github.com/andelf/go-curl"
+	"time"
+)
+
+const POST_DATA = "a_test_data_only"
+
+var sent = false
+
+func main() {
+	// init the curl session
+
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+
+	easy.Setopt(curl.OPT_URL, "http://www.renren.com")
+
+	easy.Setopt(curl.OPT_PORT, 80)
+	easy.Setopt(curl.OPT_VERBOSE, true)
+	easy.Setopt(curl.OPT_CONNECT_ONLY, true)
+
+	easy.Setopt(curl.OPT_WRITEFUNCTION, nil)
+
+	if err := easy.Perform(); err != nil {
+		println("ERROR: ", err.Error())
+	}
+
+	easy.Send([]byte("HEAD / HTTP/1.0\r\nHost: www.renren.com\r\n\r\n"))
+
+	buf := make([]byte, 1000)
+	time.Sleep(1000000000) // wait gorotine
+	num, err := easy.Recv(buf)
+	if err != nil {
+		println("ERROR:", err.Error())
+	}
+	println("recv num = ", num)
+	// NOTE: must use buf[:num]
+	println(string(buf[:num]))
+
+	fmt.Printf("got:\n%#v\n", string(buf[:num]))
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e95057f4/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sepheaders.go
----------------------------------------------------------------------
diff --git a/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sepheaders.go b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sepheaders.go
new file mode 100644
index 0000000..b7603e3
--- /dev/null
+++ b/newt/Godeps/_workspace/src/github.com/andelf/go-curl/examples/sepheaders.go
@@ -0,0 +1,49 @@
+package main
+
+import (
+	curl "github.com/andelf/go-curl"
+	"os"
+)
+
+const (
+	headerfilename = "head.out"
+	bodyfilename   = "body.out"
+)
+
+func write_data(ptr []byte, userdata interface{}) bool {
+	//println("DEBUG(write_data): ", userdata)
+	//println("DEBUG", userdata.(interface{}))
+	fp := userdata.(*os.File)
+	if _, err := fp.Write(ptr); err == nil {
+		return true
+	}
+	return false
+}
+
+func main() {
+	curl.GlobalInit(curl.GLOBAL_ALL)
+
+	// init the curl session
+	easy := curl.EasyInit()
+	defer easy.Cleanup()
+
+	// set URL to get
+	easy.Setopt(curl.OPT_URL, "http://cn.bing.com/")
+
+	// no progress meter
+	easy.Setopt(curl.OPT_NOPROGRESS, true)
+
+	easy.Setopt(curl.OPT_WRITEFUNCTION, write_data)
+
+	// write file
+	fp, _ := os.OpenFile(bodyfilename, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0777)
+	defer fp.Close()
+	easy.Setopt(curl.OPT_WRITEDATA, fp)
+
+	// easy.Setopt(curl.OPT_WRITEHEADER, 0)
+
+	if err := easy.Perform(); err != nil {
+		println("ERROR: ", err.Error())
+	}
+
+}